/* GramGPT-style shell — размеры как в style.css, другая обстановка */

html.theme-dark {
  --gram-bg: #0f1419;
  --gram-sidebar: #121a28;
  --gram-card: #1a2332;
  --gram-card-hover: #1f2a3d;
  --gram-border: rgba(71, 100, 150, 0.28);
  --gram-accent: #22d3ee;
  --gram-accent-2: #818cf8;
  --gram-purple: #a78bfa;
}

html.theme-dark body {
  background: var(--gram-bg);
}

html.theme-dark .sidebar-glass {
  background: var(--gram-sidebar);
  border-right-color: var(--gram-border);
}

html.theme-dark .content-glass {
  background: rgba(20, 28, 46, 0.65);
  border-color: var(--gram-border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

html.theme-dark .panel-card,
html.theme-dark .stat-card,
html.theme-dark .table-container,
html.theme-dark .gram-card {
  background: var(--gram-card);
  border-color: var(--gram-border);
}

html.theme-dark .menu-item.active {
  background: rgba(34, 211, 238, 0.1);
  box-shadow: inset 3px 0 0 var(--gram-accent);
}

/* —— CTA (верх аккаунтов) —— */
.gram-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.gram-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: filter 0.15s, transform 0.1s;
}

.gram-cta:active { transform: scale(0.98); }
.gram-cta-blue { background: linear-gradient(135deg, #3b82f6, #2563eb); color: #fff; }
.gram-cta-cyan { background: linear-gradient(135deg, #22d3ee, #0891b2); color: #0f1419; }
.gram-cta-green { background: linear-gradient(135deg, #34d399, #059669); color: #fff; }
.gram-cta:hover { filter: brightness(1.08); }

/* —— Панель массовых действий (GramGPT) —— */
.gram-bulk-bar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: none;
  background: transparent;
  position: relative;
  z-index: 30;
  min-height: 32px;
  min-width: 0;
}

.gram-sel-count {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  line-height: 1;
  flex-shrink: 0;
  margin-right: 2px;
}

.gram-sel-count b {
  color: var(--text);
  font-weight: 700;
  font-size: 14px;
}

html.theme-dark .gram-sel-count b {
  color: #f1f5f9;
}

.gram-bulk-cats {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  flex: 0 1 auto;
  min-width: 0;
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.gram-bulk-cats::-webkit-scrollbar {
  display: none;
}

.gram-bulk-cat-wrap {
  position: relative;
  flex: 0 0 auto;
}

.gram-bulk-cat-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px 5px 5px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  height: 32px;
  line-height: 1;
  transition: border-color 0.12s, background 0.12s;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

html.theme-dark .gram-bulk-cat-btn {
  background: #152238;
  color: #e2e8f0;
  border-color: rgba(56, 189, 248, 0.2);
  box-shadow: none;
}

.gram-bulk-cat-btn:hover,
.gram-bulk-cat-wrap.is-open .gram-bulk-cat-btn {
  border-color: rgba(59, 130, 246, 0.35);
  background: var(--surface-hover);
}

html.theme-dark .gram-bulk-cat-btn:hover,
html.theme-dark .gram-bulk-cat-wrap.is-open .gram-bulk-cat-btn {
  background: #1a2f4f;
  border-color: rgba(56, 189, 248, 0.28);
}

.gram-bulk-cat-icon {
  width: 24px;
  height: 24px;
  min-width: 24px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #fff;
  flex-shrink: 0;
}

.gram-bulk-cat-icon-blue { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.gram-bulk-cat-icon-violet { background: linear-gradient(135deg, #a78bfa, #7c3aed); }
.gram-bulk-cat-icon-cyan { background: linear-gradient(135deg, #22d3ee, #0891b2); }
.gram-bulk-cat-icon-orange { background: linear-gradient(135deg, #f59e0b, #ea580c); }
.gram-bulk-cat-icon-amber { background: linear-gradient(135deg, #fbbf24, #d97706); }
.gram-bulk-cat-icon-slate { background: linear-gradient(135deg, #64748b, #475569); }
.gram-bulk-cat-icon-emerald { background: linear-gradient(135deg, #34d399, #059669); }
.gram-bulk-cat-icon-red { background: linear-gradient(135deg, #f87171, #dc2626); }
.gram-bulk-cat-icon-pink { background: linear-gradient(135deg, #f472b6, #db2777); }

.gram-bulk-cat-label {
  flex-shrink: 0;
}

.gram-bulk-cat-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 5px;
  background: rgba(148, 163, 184, 0.18);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

html.theme-dark .gram-bulk-cat-badge {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(226, 232, 240, 0.88);
}

.gram-bulk-cat-chevron {
  font-size: 10px;
  color: var(--text-muted);
  flex-shrink: 0;
  opacity: 0.65;
  transition: transform 0.15s;
}

.gram-bulk-cat-wrap.is-open .gram-bulk-cat-chevron {
  transform: rotate(180deg);
}

.gram-bulk-drop {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 260px;
  max-width: 320px;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.16);
  z-index: 60;
}

.gram-bulk-drop.is-fixed {
  z-index: 9999;
}

html.theme-dark .gram-bulk-drop {
  background: #152238;
  border-color: rgba(56, 189, 248, 0.24);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}

.gram-bulk-drop-section + .gram-bulk-drop-section {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}

html.theme-dark .gram-bulk-drop-section + .gram-bulk-drop-section {
  border-top-color: rgba(148, 163, 184, 0.12);
}

.gram-bulk-drop-title {
  padding: 4px 8px 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.gram-bulk-drop-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s;
}

html.theme-dark .gram-bulk-drop-item {
  color: #e2e8f0;
}

.gram-bulk-drop-item:hover:not(.is-disabled) {
  background: rgba(59, 130, 246, 0.08);
}

html.theme-dark .gram-bulk-drop-item:hover:not(.is-disabled) {
  background: rgba(255, 255, 255, 0.06);
}

.gram-bulk-drop-item.is-disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.gram-bulk-drop-icon {
  width: 30px;
  height: 30px;
  min-width: 30px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #fff;
  flex-shrink: 0;
}

.gram-bulk-drop-label {
  flex: 1;
  line-height: 1.25;
}

.gram-bulk-bar.has-selection {
  justify-content: flex-start;
  gap: 8px;
}

.gram-bulk-bar-end {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  margin-left: auto;
}

.gram-bulk-web {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 12px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: #2aabee;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}

.gram-bulk-web:hover {
  background: #229ed9;
}

.acc-row-busy {
  opacity: 0.55;
  pointer-events: none;
}

.acc-row-busy .acc-actions-inner {
  pointer-events: auto;
}

.acc-row-busy .acc-actions-inner .btn-icon-sm[disabled] {
  opacity: 0.35;
  cursor: not-allowed;
}

.acc-row-busy .acc-select[disabled] {
  cursor: not-allowed;
}

.gram-bulk-del {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 12px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: #ef4444;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}

.gram-bulk-del:hover {
  background: #dc2626;
}

.gram-bulk-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  flex-shrink: 0;
}

html.theme-dark .gram-bulk-clear {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(148, 163, 184, 0.25);
  color: #94a3b8;
}

.gram-bulk-clear:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.35);
  color: #ef4444;
}

/* —— Контролы таблицы: поиск + bulk (GramGPT) —— */
.gram-acc-controls {
  margin-bottom: 14px;
  overflow: visible;
}

.gram-acc-controls .gram-bulk-bar {
  margin-top: 12px;
  margin-bottom: 4px;
  overflow: visible;
}

.accounts-table-wrapper.gram-table-wrap {
  margin-top: 0;
}

.acc-table-head .gram-acc-controls {
  margin-bottom: 8px;
}

.gram-accounts-page > .acc-stats-section {
  margin-bottom: 0;
}

.gram-accounts-page > .acc-stats-section + .acc-table-head,
.gram-accounts-page > .accounts-check-live-bar + .acc-table-head {
  margin-top: -4px;
}

.gram-acc-controls-line {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-height: 34px;
}

.gram-acc-search {
  flex: 1 1 auto;
  min-width: 0;
  height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}

html.theme-dark .gram-acc-search {
  background: #152238;
  border-color: rgba(56, 189, 248, 0.2);
}

.gram-acc-search:focus-within {
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.gram-acc-search > .pi-search {
  color: var(--text-muted);
  font-size: 14px;
  flex-shrink: 0;
}

.gram-acc-search-input {
  flex: 1;
  min-width: 0;
  width: 100%;
  border: none;
  background: transparent;
  padding: 0;
  font-size: 13px;
  color: var(--text);
  outline: none;
  font-family: inherit;
}

.gram-acc-search-input::placeholder {
  color: var(--text-muted);
}

.gram-acc-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.5;
  font-size: 13px;
  font-family: inherit;
}

.gram-acc-filter-btn {
  cursor: pointer;
  opacity: 1;
  position: relative;
}

.gram-acc-filter-btn.is-active,
.gram-acc-filter-btn.is-open {
  border-color: rgba(59, 130, 246, 0.45);
  color: #2563eb;
  background: rgba(59, 130, 246, 0.08);
}

html.theme-dark .gram-acc-filter-btn.is-active,
html.theme-dark .gram-acc-filter-btn.is-open {
  color: #60a5fa;
  background: rgba(59, 130, 246, 0.15);
}

.gram-acc-range-pick {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  height: 34px;
  padding: 0 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.gram-acc-range-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  user-select: none;
}

.gram-acc-range-input {
  width: 48px;
  padding: 4px 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  text-align: center;
  font-family: inherit;
}

.gram-acc-range-input::placeholder {
  color: var(--text-muted);
}

.gram-acc-range-input:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.gram-acc-range-sep {
  color: var(--text-muted);
  font-size: 12px;
  user-select: none;
}

.gram-acc-range-btn {
  padding: 6px 10px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #38bdf8, #0284c7);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.gram-acc-range-btn:hover {
  filter: brightness(1.06);
}

html.theme-dark .gram-acc-range-pick {
  border-color: rgba(56, 189, 248, 0.2);
  background: #152238;
}

html.theme-dark .gram-acc-range-input {
  background: rgba(15, 23, 42, 0.45);
  border-color: rgba(148, 163, 184, 0.22);
  color: var(--text);
}

.gram-acc-filter-wrap {
  position: relative;
  flex-shrink: 0;
}

.gram-acc-filter-drop {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 240px;
  max-width: 300px;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.16);
  z-index: 80;
}

html.theme-dark .gram-acc-filter-drop {
  background: #152238;
  border-color: rgba(56, 189, 248, 0.24);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}

.gram-acc-filter-empty {
  margin: 0;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.gram-acc-filter-cat,
.gram-acc-filter-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s;
}

.gram-acc-filter-cat:hover,
.gram-acc-filter-opt:hover {
  background: rgba(59, 130, 246, 0.08);
}

html.theme-dark .gram-acc-filter-cat:hover,
html.theme-dark .gram-acc-filter-opt:hover {
  background: rgba(255, 255, 255, 0.06);
}

.gram-acc-filter-cat-icon {
  width: 30px;
  height: 30px;
  min-width: 30px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  color: #fff;
  font-size: 13px;
}

.gram-acc-filter-cat-label,
.gram-acc-filter-opt-label {
  flex: 1;
  min-width: 0;
  line-height: 1.25;
}

.gram-acc-filter-cat-arrow {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.gram-acc-filter-count {
  min-width: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  color: var(--text-muted);
  flex-shrink: 0;
}

.gram-acc-filter-back {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-bottom: 4px;
  padding: 6px 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.gram-acc-filter-back:hover {
  background: rgba(148, 163, 184, 0.1);
  color: var(--text);
}

.gram-acc-filter-opt-list {
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gram-acc-filter-flag {
  width: 22px;
  line-height: 1;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.28);
  flex-shrink: 0;
}

.gram-acc-filter-geo-unknown {
  width: 22px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-muted);
  font-size: 10px;
  flex-shrink: 0;
}

.gram-acc-filter-status-badge,
.gram-acc-filter-role-badge {
  flex: 1;
  min-width: 0;
  justify-content: center;
  max-width: 100%;
}

.gram-acc-filter-active {
  margin-top: 8px;
}

.gram-acc-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(59, 130, 246, 0.35);
  background: rgba(59, 130, 246, 0.08);
  color: #2563eb;
  font-size: 12px;
  font-weight: 600;
}

html.theme-dark .gram-acc-filter-chip {
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.14);
}

.gram-acc-filter-chip-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.12);
  color: inherit;
  cursor: pointer;
  font-size: 10px;
}

.gram-acc-filter-chip-clear:hover {
  background: rgba(59, 130, 246, 0.22);
}

html.theme-dark .gram-acc-icon-btn {
  background: #152238;
  border-color: rgba(56, 189, 248, 0.2);
}

.gram-acc-tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  flex-shrink: 0;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

html.theme-dark .gram-acc-tool-btn {
  background: #152238;
  border-color: rgba(56, 189, 248, 0.2);
  color: #e2e8f0;
}

.gram-acc-tool-btn:hover {
  border-color: rgba(59, 130, 246, 0.4);
  background: rgba(59, 130, 246, 0.06);
}

.gram-acc-tool-btn.is-active {
  border-color: rgba(59, 130, 246, 0.45);
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
}

html.theme-dark .gram-acc-tool-btn.is-active {
  color: #93c5fd;
}

.gram-acc-tool-btn i {
  font-size: 12px;
}

.acc-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.acc-toolbar-right .acc-check-mini {
  flex-shrink: 0;
}

@media (max-width: 720px) {
  .gram-acc-controls-line {
    flex-wrap: wrap;
  }
  .gram-acc-search {
    flex: 1 1 100%;
  }
  .gram-acc-tool-btn span {
    display: none;
  }
  .gram-acc-tool-btn {
    width: 40px;
    padding: 0;
  }
  .gram-bulk-del span {
    display: none;
  }
}

.gram-pills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
}

.gram-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  border: none;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  color: #fff;
  transition: filter 0.15s, transform 0.1s;
}

.gram-pill:active { transform: scale(0.97); }
.gram-pill:hover { filter: brightness(1.1); }
.gram-pill i { font-size: 12px; }

.gram-pill-blue { background: #3b82f6; }
.gram-pill-purple { background: #8b5cf6; }
.gram-pill-cyan { background: #06b6d4; }
.gram-pill-green { background: #10b981; }
.gram-pill-orange { background: #f59e0b; color: #1e293b; }
.gram-pill-red { background: #ef4444; }
.gram-pill-slate { background: #475569; }

/* —— Бейджи статуса —— */
.gram-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.gram-badge-ok {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.35);
}

.gram-badge-off {
  background: rgba(100, 116, 139, 0.2);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.gram-badge-warn {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.3);
}

/* —— Карточки настроек —— */
.gram-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  margin-bottom: 0;
}

html.theme-dark .gram-card {
  background: var(--gram-card);
  border-color: var(--gram-border);
}

.gram-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(59, 130, 246, 0.04);
  flex-wrap: wrap;
}

.gram-card-head .live-log-badge {
  margin-left: auto;
}

html.theme-dark .gram-card-head {
  background: rgba(34, 211, 238, 0.06);
  border-bottom-color: var(--gram-border);
}

.gram-card-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.25), rgba(129, 140, 248, 0.25));
  color: var(--primary-cyan);
  font-size: 14px;
  flex-shrink: 0;
}

.gram-card-title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text);
}

.gram-card-body {
  padding: 14px 16px 16px;
}

.gram-card-body .settings-fields {
  gap: 12px;
}

.gram-settings-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* —— Шапка страницы модуля —— */
.gram-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.gram-page-title {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 700;
}

.gram-page-desc {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
  max-width: 420px;
}

/* —— Модалка —— */
.panel-modal-card.gram-modal-card {
  max-width: 520px;
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}

html.theme-dark .panel-modal-card.gram-modal-card {
  background: #1a2332;
  border-color: var(--gram-border);
}

.gram-modal-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.gram-modal-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #fff;
  flex-shrink: 0;
}

.gram-modal-icon-orange { background: linear-gradient(135deg, #f59e0b, #ea580c); }
.gram-modal-icon-amber { background: linear-gradient(135deg, #fbbf24, #d97706); }
.gram-modal-icon-red { background: linear-gradient(135deg, #f87171, #dc2626); }
.gram-modal-icon-emerald { background: linear-gradient(135deg, #34d399, #059669); }
.gram-modal-icon-violet { background: linear-gradient(135deg, #a78bfa, #7c3aed); }
.gram-modal-icon-blue { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.gram-modal-icon-cyan { background: linear-gradient(135deg, #22d3ee, #0891b2); }
.gram-modal-icon-slate { background: linear-gradient(135deg, #64748b, #475569); }

.panel-modal-card.gram-modal-compact {
  width: min(400px, 100%);
  max-width: 400px;
}

.panel-modal-card.gram-modal-compact .panel-modal-header {
  padding: 14px 16px;
}

.panel-modal-card.gram-modal-compact .panel-modal-body {
  padding: 12px 16px 14px;
}

.panel-modal-card.gram-modal-compact .panel-modal-footer {
  padding: 10px 16px 14px;
  border-top: none;
}

.panel-modal-card.gram-modal-compact .panel-modal-title {
  font-size: 15px;
}

.panel-modal-card.gram-modal-compact .gram-modal-icon {
  width: 36px;
  height: 36px;
  font-size: 16px;
  border-radius: 9px;
}

.panel-modal-card.gram-modal-compact .account-picker-compact {
  max-height: 160px;
}

.gram-acc-tools-section {
  padding: 16px 18px;
  margin-bottom: 0;
}

.gram-acc-tools-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.gram-acc-tools-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.gram-acc-tools-sub {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

.gram-acc-tools-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.gram-acc-tool-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-hover);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.12s;
}

html.theme-dark .gram-acc-tool-card {
  background: rgba(15, 23, 42, 0.35);
  border-color: var(--gram-border);
}

.gram-acc-tool-card:hover {
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.12);
  transform: translateY(-1px);
}

.gram-acc-tool-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  font-size: 15px;
  flex-shrink: 0;
}

.gram-acc-tool-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.gram-acc-tool-text b {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.gram-acc-tool-text span {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.3;
}

/* —— Менеджер аккаунтов (GramGPT) —— */
.gram-accounts-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.gram-acc-empty-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  padding: 28px 16px 24px;
  text-align: center;
}

.gram-accounts-page .gram-acc-empty-row > td {
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

.gram-accounts-page .table-container.has-acc-empty {
  min-height: 320px;
}

.gram-accounts-page .table-container.has-acc-empty .data-table thead {
  opacity: 0.55;
}

.gram-acc-empty-visual {
  position: relative;
  width: 168px;
  height: 168px;
  margin-bottom: 4px;
}

.gram-acc-empty-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(14, 165, 233, 0.28);
  animation: gramAccEmptyBreath 3.4s ease-in-out infinite;
}

.gram-acc-empty-ring.ring-2 {
  inset: -18px;
  animation-delay: 0.55s;
  opacity: 0.75;
}

.gram-acc-empty-ring.ring-3 {
  inset: -36px;
  animation-delay: 1.1s;
  opacity: 0.45;
}

@keyframes gramAccEmptyBreath {
  0%,
  100% {
    transform: scale(0.9);
    opacity: 0.3;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.9;
  }
}

.gram-acc-empty-glass {
  position: absolute;
  inset: 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 18px;
  border: 1px solid rgba(56, 189, 248, 0.38);
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.62), rgba(30, 41, 59, 0.42));
  box-shadow:
    0 0 40px rgba(14, 165, 233, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  animation: gramAccEmptyGlassPulse 3.4s ease-in-out infinite;
  cursor: pointer;
  color: inherit;
  padding: 0;
  font: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.gram-acc-empty-glass:hover {
  border-color: rgba(125, 211, 252, 0.65);
  transform: scale(1.02);
}

.gram-acc-empty-glass:focus-visible {
  outline: 2px solid rgba(56, 189, 248, 0.75);
  outline-offset: 3px;
}

@keyframes gramAccEmptyGlassPulse {
  0%,
  100% {
    box-shadow:
      0 0 28px rgba(14, 165, 233, 0.14),
      inset 0 1px 0 rgba(255, 255, 255, 0.06);
    transform: scale(0.98);
  }
  50% {
    box-shadow:
      0 0 52px rgba(14, 165, 233, 0.32),
      inset 0 1px 0 rgba(255, 255, 255, 0.12);
    transform: scale(1);
  }
}

.gram-acc-empty-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1.45rem;
  color: #e0f2fe;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.35), rgba(99, 102, 241, 0.45));
  box-shadow: 0 0 24px rgba(14, 165, 233, 0.45);
}

.gram-acc-empty-drop-hint {
  font-size: 11px;
  color: #7dd3fc;
  letter-spacing: 0.02em;
  max-width: 120px;
  line-height: 1.35;
}

.gram-acc-empty-float {
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  color: #bae6fd;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  animation: gramAccEmptyFloat 4s ease-in-out infinite;
  pointer-events: none;
}

.gram-acc-empty-float-a {
  top: 18px;
  right: 8px;
}

.gram-acc-empty-float-b {
  bottom: 22px;
  left: 4px;
  animation-delay: 1.2s;
}

@keyframes gramAccEmptyFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

.gram-acc-empty-kicker {
  margin: 12px 0 6px;
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #38bdf8;
  font-weight: 700;
}

.gram-acc-empty-title {
  margin: 0 0 8px;
  font-size: clamp(1.1rem, 2.5vw, 1.45rem);
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.25;
}

.gram-acc-empty-desc {
  margin: 0;
  max-width: 420px;
  color: #94a3b8;
  font-size: 0.88rem;
  line-height: 1.5;
}

.gram-acc-empty-desc code {
  font-size: 0.88em;
  color: #bae6fd;
}

@media (prefers-reduced-motion: reduce) {
  .gram-acc-empty-ring,
  .gram-acc-empty-glass,
  .gram-acc-empty-float {
    animation: none !important;
  }
}

html.theme-dark .gram-accounts-page .stat-card,
html.theme-dark .gram-accounts-page .table-container {
  background: #152238;
  border-color: rgba(56, 189, 248, 0.24);
}

.content-glass:has(.gram-accounts-page.gram-acc-glass) {
  background: linear-gradient(145deg, rgba(240, 249, 255, 0.55) 0%, rgba(224, 242, 254, 0.35) 42%, rgba(248, 250, 252, 0.9) 100%);
  border-color: rgba(56, 189, 248, 0.22);
  box-shadow:
    0 4px 28px rgba(14, 165, 233, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

html.theme-dark .content-glass:has(.gram-accounts-page.gram-acc-glass) {
  background: linear-gradient(145deg, #0b1220 0%, #101a2e 38%, #152238 72%, #0f172a 100%);
  border-color: rgba(56, 189, 248, 0.22);
  box-shadow:
    0 8px 36px rgba(0, 0, 0, 0.42),
    0 0 48px rgba(14, 165, 233, 0.08);
}

.gram-accounts-page.gram-acc-glass .acc-toolbar {
  border-radius: 18px;
  border: 1px solid rgba(56, 189, 248, 0.28);
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.72), rgba(30, 58, 95, 0.45));
  box-shadow: 0 0 36px rgba(14, 165, 233, 0.12);
  padding: 14px 16px;
}

html:not(.theme-dark) .gram-accounts-page.gram-acc-glass .acc-toolbar {
  background: linear-gradient(145deg, rgba(240, 249, 255, 0.95), rgba(224, 242, 254, 0.75));
  border-color: rgba(56, 189, 248, 0.24);
  box-shadow: 0 0 28px rgba(14, 165, 233, 0.1);
}

.gram-accounts-page.gram-acc-glass .stat-card,
.gram-accounts-page.gram-acc-glass .table-container,
.gram-accounts-page.gram-acc-glass .acc-table-head,
.gram-accounts-page.gram-acc-glass .accounts-check-live-bar {
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(15, 23, 42, 0.5), rgba(30, 41, 59, 0.34));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.06),
    0 8px 32px rgba(2, 8, 23, 0.18);
  overflow: hidden;
}

html.theme-dark .gram-accounts-page.gram-acc-glass .stat-card,
html.theme-dark .gram-accounts-page.gram-acc-glass .table-container,
html.theme-dark .gram-accounts-page.gram-acc-glass .acc-table-head,
html.theme-dark .gram-accounts-page.gram-acc-glass .accounts-check-live-bar {
  background: linear-gradient(160deg, rgba(21, 34, 56, 0.92), rgba(15, 23, 42, 0.78));
  border-color: rgba(56, 189, 248, 0.24);
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.1),
    0 8px 28px rgba(0, 0, 0, 0.35),
    0 0 24px rgba(56, 189, 248, 0.06);
}

html:not(.theme-dark) .gram-accounts-page.gram-acc-glass .stat-card,
html:not(.theme-dark) .gram-accounts-page.gram-acc-glass .table-container,
html:not(.theme-dark) .gram-accounts-page.gram-acc-glass .acc-table-head,
html:not(.theme-dark) .gram-accounts-page.gram-acc-glass .accounts-check-live-bar {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.86), rgba(241, 245, 249, 0.68));
  border-color: rgba(148, 163, 184, 0.32);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.85),
    0 8px 32px rgba(15, 23, 42, 0.08),
    0 0 20px rgba(56, 189, 248, 0.06);
}

.gram-accounts-page.gram-acc-glass .acc-table-head {
  padding: 10px 12px;
}

.gram-accounts-page.gram-acc-glass .acc-stats-section .stat-card-active {
  border-color: rgba(56, 189, 248, 0.35);
  background: linear-gradient(160deg, rgba(14, 165, 233, 0.18), rgba(30, 41, 59, 0.42));
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.28),
    0 8px 28px rgba(14, 165, 233, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

html:not(.theme-dark) .gram-accounts-page.gram-acc-glass .acc-stats-section .stat-card-active {
  background: linear-gradient(160deg, rgba(224, 242, 254, 0.95), rgba(186, 230, 253, 0.55));
  border-color: rgba(14, 165, 233, 0.38);
}

.gram-accounts-page.gram-acc-glass .stat-card-click:hover {
  border-color: rgba(56, 189, 248, 0.32);
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.12),
    0 8px 24px rgba(14, 165, 233, 0.1);
}

.acc-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
}

.acc-toolbar-left {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.acc-toolbar-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.gram-meta-ai-compact {
  gap: 8px;
  padding: 5px 10px 5px 6px;
}

.gram-meta-ai-compact .gram-meta-ai-icon {
  width: 20px;
  height: 20px;
  font-size: 10px;
}

.gram-bulk-bar .gram-pills-row {
  margin-left: auto;
}

.gram-acc-limits-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px 5px 9px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.38);
  background:
    linear-gradient(135deg, rgba(14, 165, 233, 0.2), rgba(99, 102, 241, 0.14)),
    rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 4px 18px rgba(14, 165, 233, 0.12);
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  color: var(--text, #0f172a);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.12s;
}

html:not(.theme-dark) .gram-acc-limits-pill {
  color: #0369a1;
  border-color: rgba(14, 165, 233, 0.32);
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.12), rgba(99, 102, 241, 0.08)), #f0f9ff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 2px 10px rgba(14, 165, 233, 0.1);
}

html:not(.theme-dark) .gram-acc-limits-pill:hover {
  border-color: rgba(14, 165, 233, 0.48);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 4px 14px rgba(14, 165, 233, 0.16);
}

html:not(.theme-dark) .gram-acc-limits-pill i {
  color: #0ea5e9;
}

html.theme-dark .gram-acc-limits-pill {
  color: #e2e8f0;
  border-color: rgba(56, 189, 248, 0.45);
  background:
    linear-gradient(135deg, rgba(14, 165, 233, 0.22), rgba(99, 102, 241, 0.16)),
    rgba(15, 23, 42, 0.55);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 4px 22px rgba(14, 165, 233, 0.16);
}

.gram-acc-limits-pill:hover {
  border-color: rgba(56, 189, 248, 0.62);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 6px 24px rgba(14, 165, 233, 0.22);
}

.gram-acc-limits-pill i {
  font-size: 11px;
  color: #38bdf8;
  filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.45));
}

.gram-acc-limits-text {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.panel-modal-card.gram-gpt-profile-sheet.gram-acc-limits-modal {
  position: relative;
  overflow: hidden;
  width: min(440px, calc(100vw - 28px)) !important;
  max-width: 440px !important;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  background: linear-gradient(
    165deg,
    rgba(20, 48, 68, 0.55) 0%,
    rgba(18, 24, 38, 0.96) 28%,
    rgba(14, 18, 30, 0.98) 100%
  ) !important;
  box-shadow:
    0 0 0 1px rgba(0, 136, 204, 0.08),
    0 28px 72px rgba(0, 0, 0, 0.55),
    0 0 80px rgba(0, 136, 204, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
}

.panel-modal-card.gram-gpt-profile-sheet.gram-acc-limits-modal::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 220px;
  height: 160px;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(ellipse at 20% 10%, rgba(0, 136, 204, 0.34), transparent 70%);
}

.panel-modal-card.gram-gpt-profile-sheet.gram-acc-limits-modal > * {
  position: relative;
  z-index: 1;
}

html.theme-dark .panel-modal-card.gram-gpt-profile-sheet.gram-acc-limits-modal {
  background: linear-gradient(
    165deg,
    rgba(20, 48, 68, 0.55) 0%,
    rgba(18, 24, 38, 0.96) 28%,
    rgba(14, 18, 30, 0.98) 100%
  ) !important;
}

html:not(.theme-dark) .panel-modal-card.gram-gpt-profile-sheet.gram-acc-limits-modal {
  background: linear-gradient(165deg, #ecfeff 0%, #fff 24%, #f8fafc 100%) !important;
  border-color: rgba(15, 23, 42, 0.1) !important;
  box-shadow:
    0 24px 64px rgba(15, 23, 42, 0.16),
    0 0 48px rgba(0, 136, 204, 0.1) !important;
}

html:not(.theme-dark) .panel-modal-card.gram-gpt-profile-sheet.gram-acc-limits-modal::before {
  background: radial-gradient(ellipse at 20% 10%, rgba(0, 136, 204, 0.18), transparent 70%);
}

.gram-acc-limits-modal .panel-modal-header {
  background: transparent !important;
  border-bottom: none !important;
  padding: 1.15rem 1.25rem 0.35rem !important;
}

.gram-acc-limits-modal .gram-modal-icon-cyan {
  background: linear-gradient(145deg, #22d3ee, #0088cc) !important;
  box-shadow: 0 0 24px rgba(0, 136, 204, 0.45);
  border-radius: 50%;
}

.gram-acc-limits-modal .panel-modal-body {
  padding: 0.5rem 1.15rem 1rem !important;
}

.gram-acc-limits-modal .panel-modal-footer.acc-limits-modal-footer {
  background: transparent !important;
  border-top: none !important;
  padding: 0.25rem 1.15rem 1.15rem !important;
  gap: 0.75rem;
  justify-content: stretch;
}

.gram-acc-limits-modal .acc-limits-modal-footer .gpt-ep-cancel {
  flex: 1;
  border-radius: 999px;
  height: 2.75rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
}

html:not(.theme-dark) .gram-acc-limits-modal .acc-limits-modal-footer .gpt-ep-cancel {
  background: rgba(15, 23, 42, 0.04);
  border-color: rgba(15, 23, 42, 0.12);
  color: #334155;
}

.gram-acc-limits-modal .acc-limits-modal-footer .gram-gpt-btn-primary {
  flex: 1.15;
  min-width: 0;
  border-radius: 999px;
  height: 2.75rem;
  font-weight: 600;
  background: #0088cc !important;
  border: none !important;
  box-shadow: 0 8px 24px rgba(0, 136, 204, 0.35);
}

.acc-limits-modal-sheet .acc-limits-modal-grid {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.acc-limits-modal-card {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(255, 255, 255, 0.42);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

html.theme-dark .gram-gpt-profile-sheet .acc-limits-modal-card,
html.theme-dark .gram-acc-limits-modal .acc-limits-modal-card {
  border-color: rgba(0, 136, 204, 0.22);
  background: rgba(15, 23, 42, 0.55);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 8px 24px rgba(0, 0, 0, 0.18);
}

.acc-limits-modal-card-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}

/* Единый стиль иконок слоты/потоки/задачи (cyan-семья) */
.gram-acc-limits-modal .acc-limits-modal-card-head .gram-card-icon {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #e0f2fe !important;
  border: 1px solid rgba(0, 136, 204, 0.35);
  box-shadow:
    0 0 0 1px rgba(0, 136, 204, 0.08),
    0 8px 18px rgba(0, 136, 204, 0.16);
}

.gram-acc-limits-modal .acc-limits-modal-card-head .gram-card-icon.gram-tone-cyan,
.gram-acc-limits-modal .acc-limits-modal-card-head .gram-card-icon.gram-tone-violet,
.gram-acc-limits-modal .acc-limits-modal-card-head .gram-card-icon.gram-tone-amber {
  background: linear-gradient(145deg, rgba(34, 211, 238, 0.28), rgba(0, 136, 204, 0.55)) !important;
  color: #f0f9ff !important;
}

html:not(.theme-dark) .gram-acc-limits-modal .acc-limits-modal-card-head .gram-card-icon.gram-tone-cyan,
html:not(.theme-dark) .gram-acc-limits-modal .acc-limits-modal-card-head .gram-card-icon.gram-tone-violet,
html:not(.theme-dark) .gram-acc-limits-modal .acc-limits-modal-card-head .gram-card-icon.gram-tone-amber {
  background: linear-gradient(145deg, #e0f2fe, #bae6fd) !important;
  color: #0c4a6e !important;
  border-color: rgba(0, 136, 204, 0.35);
}

.gram-acc-limits-modal .acc-limits-modal-card-head .gram-card-icon .pi {
  font-size: 15px;
  line-height: 1;
}

/* Premium cyan chrome — профиль / роль / 2FA / папки */
.panel-modal-card.gram-gpt-profile-sheet.gram-acc-premium-cyan-modal {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  background: linear-gradient(
    165deg,
    rgba(20, 48, 68, 0.55) 0%,
    rgba(18, 24, 38, 0.96) 28%,
    rgba(14, 18, 30, 0.98) 100%
  ) !important;
  box-shadow:
    0 0 0 1px rgba(0, 136, 204, 0.08),
    0 28px 72px rgba(0, 0, 0, 0.55),
    0 0 80px rgba(0, 136, 204, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
}

.panel-modal-card.gram-gpt-profile-sheet.gram-acc-premium-cyan-modal::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 220px;
  height: 160px;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(ellipse at 20% 10%, rgba(0, 136, 204, 0.34), transparent 70%);
}

.panel-modal-card.gram-gpt-profile-sheet.gram-acc-premium-cyan-modal > * {
  position: relative;
  z-index: 1;
}

html:not(.theme-dark) .panel-modal-card.gram-gpt-profile-sheet.gram-acc-premium-cyan-modal {
  background: linear-gradient(165deg, #ecfeff 0%, #fff 24%, #f8fafc 100%) !important;
  border-color: rgba(15, 23, 42, 0.1) !important;
  box-shadow:
    0 24px 64px rgba(15, 23, 42, 0.16),
    0 0 48px rgba(0, 136, 204, 0.1) !important;
}

.gram-acc-premium-cyan-modal .panel-modal-header {
  background: transparent !important;
  border-bottom: none !important;
}

.gram-acc-premium-cyan-modal .gram-modal-icon-cyan,
.gram-acc-premium-cyan-modal .gram-modal-icon-blue,
.gram-acc-premium-cyan-modal .gram-modal-icon-amber {
  background: linear-gradient(145deg, #22d3ee, #0088cc) !important;
  box-shadow: 0 0 24px rgba(0, 136, 204, 0.45);
  border-radius: 50%;
}

.gram-acc-premium-cyan-modal .panel-modal-footer.acc-premium-cyan-footer,
.gram-acc-premium-cyan-modal .panel-modal-footer.cf-run-footer {
  background: transparent !important;
  border-top: none !important;
}

.gram-acc-premium-cyan-modal .acc-premium-cyan-footer .gpt-ep-cancel,
.gram-acc-premium-cyan-modal .cf-run-footer .gpt-ep-cancel {
  border-radius: 999px;
  height: 2.75rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
  padding: 0 1.1rem;
}

.gram-acc-premium-cyan-modal .acc-premium-cyan-footer .gram-gpt-btn-primary,
.gram-acc-premium-cyan-modal .cf-run-footer .gram-gpt-btn-primary {
  border-radius: 999px !important;
  height: 2.75rem;
  background: #0088cc !important;
  border: none !important;
  box-shadow: 0 8px 24px rgba(0, 136, 204, 0.35);
}

.gram-acc-premium-cyan-modal .acc-premium-cyan-dialog .gpt-ep-input,
.gram-acc-premium-cyan-modal .acc-premium-cyan-dialog .gram-input,
.gram-acc-premium-cyan-modal .acc-premium-cyan-dialog textarea {
  border-radius: 12px;
  border-color: rgba(0, 136, 204, 0.28);
  background: rgba(15, 23, 42, 0.45);
}

html:not(.theme-dark) .gram-acc-premium-cyan-modal .acc-premium-cyan-dialog .gpt-ep-input,
html:not(.theme-dark) .gram-acc-premium-cyan-modal .acc-premium-cyan-dialog .gram-input,
html:not(.theme-dark) .gram-acc-premium-cyan-modal .acc-premium-cyan-dialog textarea {
  background: #f8fafc;
  border-color: rgba(0, 136, 204, 0.22);
}

/* Inner premium: секции / сегменты / роль / инпуты */
.gram-acc-premium-cyan-modal .acc-premium-cyan-dialog {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.gram-acc-premium-cyan-modal .acc-premium-cyan-dialog .gpt-ep-rows {
  gap: 0.75rem;
}

.gram-acc-premium-cyan-modal .acc-premium-cyan-dialog .gpt-ep-row,
.gram-acc-premium-cyan-modal .acc-premium-cyan-dialog .gram-modal-section {
  border-radius: 16px !important;
  border: 1px solid rgba(0, 136, 204, 0.22) !important;
  background:
    linear-gradient(165deg, rgba(0, 136, 204, 0.1), transparent 55%),
    rgba(15, 23, 42, 0.55) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 10px 28px rgba(0, 0, 0, 0.18) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  overflow: hidden;
}

html:not(.theme-dark) .gram-acc-premium-cyan-modal .acc-premium-cyan-dialog .gpt-ep-row,
html:not(.theme-dark) .gram-acc-premium-cyan-modal .acc-premium-cyan-dialog .gram-modal-section {
  background:
    linear-gradient(165deg, rgba(0, 136, 204, 0.06), transparent 55%),
    rgba(255, 255, 255, 0.88) !important;
  border-color: rgba(0, 136, 204, 0.18) !important;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06) !important;
}

.gram-acc-premium-cyan-modal .acc-premium-cyan-dialog .gpt-ep-row.is-on,
.gram-acc-premium-cyan-modal .acc-premium-cyan-dialog .gpt-ep-row.is-open {
  border-color: rgba(0, 136, 204, 0.42) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 0 1px rgba(0, 136, 204, 0.12),
    0 12px 32px rgba(0, 136, 204, 0.12) !important;
}

.gram-acc-premium-cyan-modal .acc-premium-cyan-dialog .gpt-ep-row-head,
.gram-acc-premium-cyan-modal .acc-premium-cyan-dialog .gram-modal-section-head {
  padding: 0.85rem 1rem !important;
  background: rgba(0, 136, 204, 0.06);
  border-bottom: 1px solid rgba(0, 136, 204, 0.12);
}

.gram-acc-premium-cyan-modal .acc-premium-cyan-dialog .gpt-ep-row-body,
.gram-acc-premium-cyan-modal .acc-premium-cyan-dialog .gram-modal-section-body {
  padding: 0.9rem 1rem 1rem !important;
}

.gram-acc-premium-cyan-modal .acc-premium-cyan-dialog .gpt-ep-seg {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.2rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 136, 204, 0.22);
  background: rgba(0, 0, 0, 0.22);
  margin-bottom: 0.75rem;
}

html:not(.theme-dark) .gram-acc-premium-cyan-modal .acc-premium-cyan-dialog .gpt-ep-seg {
  background: rgba(0, 136, 204, 0.06);
}

.gram-acc-premium-cyan-modal .acc-premium-cyan-dialog .gpt-ep-seg-btn {
  border: 0 !important;
  border-radius: 999px !important;
  background: transparent !important;
  color: #94a3b8 !important;
  padding: 0.4rem 0.85rem !important;
  font-weight: 600;
}

.gram-acc-premium-cyan-modal .acc-premium-cyan-dialog .gpt-ep-seg-btn.active {
  background: #0088cc !important;
  color: #fff !important;
  box-shadow: 0 6px 16px rgba(0, 136, 204, 0.35);
}

.gram-acc-premium-cyan-modal .acc-premium-cyan-dialog .gpt-ep-input,
.gram-acc-premium-cyan-modal .acc-premium-cyan-dialog .gram-input,
.gram-acc-premium-cyan-modal .acc-premium-cyan-dialog textarea.gram-textarea,
.gram-acc-premium-cyan-modal .acc-premium-cyan-dialog .gram-gpt-select-btn {
  min-height: 2.5rem;
  border-radius: 12px !important;
  border: 1px solid rgba(0, 136, 204, 0.28) !important;
  background: rgba(8, 15, 28, 0.55) !important;
  color: #e2e8f0 !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.gram-acc-premium-cyan-modal .acc-premium-cyan-dialog .gpt-ep-input:focus,
.gram-acc-premium-cyan-modal .acc-premium-cyan-dialog .gram-input:focus,
.gram-acc-premium-cyan-modal .acc-premium-cyan-dialog textarea:focus {
  outline: none;
  border-color: rgba(0, 136, 204, 0.55) !important;
  box-shadow: 0 0 0 3px rgba(0, 136, 204, 0.16) !important;
}

.gram-acc-premium-cyan-modal .acc-premium-cyan-dialog .gpt-ep-photo-drop,
.gram-acc-premium-cyan-modal .acc-premium-cyan-dialog .ep-photo-drop,
.gram-acc-premium-cyan-modal .acc-premium-cyan-dialog [class*="photo-drop"],
.gram-acc-premium-cyan-modal .acc-premium-cyan-dialog .gpt-ep-upload {
  border-radius: 14px !important;
  border: 1px dashed rgba(0, 136, 204, 0.4) !important;
  background: rgba(0, 136, 204, 0.06) !important;
}

.gram-acc-premium-cyan-modal .acc-premium-cyan-dialog .role-swatches {
  gap: 0.55rem;
}

.gram-acc-premium-cyan-modal .acc-premium-cyan-dialog .role-swatch {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.65), 0 0 12px rgba(0, 136, 204, 0.12);
}

.gram-acc-premium-cyan-modal .acc-premium-cyan-dialog .role-swatch.active {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(0, 136, 204, 0.55), 0 0 16px rgba(0, 136, 204, 0.35);
}

.gram-acc-premium-cyan-modal .acc-premium-cyan-dialog .role-icon-grid {
  gap: 0.45rem;
}

.gram-acc-premium-cyan-modal .acc-premium-cyan-dialog .role-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 11px !important;
  border: 1px solid rgba(0, 136, 204, 0.22) !important;
  background: rgba(15, 23, 42, 0.5) !important;
  color: #cbd5e1 !important;
}

.gram-acc-premium-cyan-modal .acc-premium-cyan-dialog .role-icon-btn.active {
  background: rgba(0, 136, 204, 0.22) !important;
  border-color: rgba(0, 136, 204, 0.55) !important;
  color: #7dd3fc !important;
  box-shadow: 0 0 16px rgba(0, 136, 204, 0.25);
}

.gram-acc-premium-cyan-modal .acc-premium-cyan-dialog .gram-gpt-btn-purple {
  border-radius: 999px !important;
  background: linear-gradient(135deg, #7c3aed, #0088cc) !important;
  border: none !important;
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.28);
}

.gram-acc-premium-cyan-modal .acc-premium-cyan-footer .gram-gpt-btn-soft,
.gram-acc-premium-cyan-modal .cf-run-footer .gram-gpt-btn-soft {
  border-radius: 999px !important;
  height: 2.75rem;
  border: 1px solid rgba(0, 136, 204, 0.28) !important;
  background: rgba(0, 136, 204, 0.1) !important;
  color: #e0f2fe !important;
}

.acc-limits-modal-card-head h4 {
  margin: 0 0 2px;
  font-size: 13px;
  font-weight: 600;
}

.acc-limits-modal-val {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.acc-ttr-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.acc-ttr-score {
  position: relative;
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  cursor: default;
  line-height: 1.2;
}

.acc-ttr-tip {
  display: none;
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  min-width: 140px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: var(--surface, #fff);
  font-size: 10px;
  font-weight: 400;
  color: var(--text-muted, #64748b);
  z-index: 20;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

html.theme-dark .acc-ttr-tip {
  background: #1e293b;
  border-color: rgba(71, 100, 150, 0.4);
  color: #94a3b8;
}

.acc-ttr-tip-line {
  display: block;
  white-space: nowrap;
}

.acc-ttr-score:hover .acc-ttr-tip,
.acc-ttr-score:focus-visible .acc-ttr-tip {
  display: block;
}

.acc-ttr-score.acc-ttr-ok { color: #0d9488; text-shadow: 0 0 14px rgba(20, 184, 166, 0.28); }
.acc-ttr-score.acc-ttr-warn { color: #ca8a04; text-shadow: 0 0 14px rgba(234, 179, 8, 0.22); }
.acc-ttr-score.acc-ttr-bad { color: #e11d48; text-shadow: 0 0 14px rgba(244, 63, 94, 0.24); }
.acc-ttr-score.acc-ttr-muted { color: #94a3b8; }

html.theme-dark .acc-ttr-score.acc-ttr-ok { color: #5eead4; text-shadow: 0 0 16px rgba(94, 234, 212, 0.35); }
html.theme-dark .acc-ttr-score.acc-ttr-warn { color: #fcd34d; text-shadow: 0 0 16px rgba(252, 211, 77, 0.28); }
html.theme-dark .acc-ttr-score.acc-ttr-bad { color: #fb7185; text-shadow: 0 0 16px rgba(251, 113, 133, 0.32); }
html.theme-dark .acc-ttr-score.acc-ttr-muted { color: #64748b; }

.gram-accounts-page .cell-name {
  min-width: 128px;
}

.gram-accounts-page .acc-ttr-cell {
  min-width: 52px;
}

.acc-ttr-cell.acc-ttr-stale .acc-ttr-score {
  opacity: 0.72;
}

.acc-check-mini {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border, rgba(148, 163, 184, 0.4));
  background: var(--surface-hover, rgba(248, 250, 252, 0.95));
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
  color: var(--text-muted, #64748b);
  transition: border-color 0.15s, background 0.15s;
}

html.theme-dark .acc-check-mini {
  background: rgba(15, 23, 42, 0.45);
  border-color: rgba(71, 100, 150, 0.35);
}

.acc-check-mini:hover {
  border-color: rgba(14, 165, 233, 0.45);
  background: rgba(14, 165, 233, 0.06);
}

.acc-check-mini i {
  font-size: 11px;
  opacity: 0.75;
}

@media (max-width: 720px) {
  .acc-toolbar-right { width: 100%; margin-left: 0; justify-content: flex-end; }
  .gram-bulk-bar .gram-pills-row { margin-left: 0; width: 100%; }
}

.gram-accounts-page .acc-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.acc-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

.gram-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border, rgba(148, 163, 184, 0.4));
  background: var(--surface-hover, rgba(248, 250, 252, 0.95));
  font-size: 11px;
  color: var(--text-muted, #64748b);
  line-height: 1.2;
}

html.theme-dark .gram-meta-pill {
  background: rgba(15, 23, 42, 0.45);
  border-color: rgba(71, 100, 150, 0.35);
}

.gram-meta-ai {
  gap: 10px;
  padding-right: 8px;
}

.gram-meta-ai-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(139, 92, 246, 0.15);
  color: #7c3aed;
  font-size: 11px;
}

html.theme-dark .gram-meta-ai-icon {
  background: rgba(139, 92, 246, 0.22);
  color: #c4b5fd;
}

.gram-meta-ai-label {
  font-weight: 700;
  color: var(--text, #0f172a);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

html.theme-dark .gram-meta-ai-label { color: #e2e8f0; }

.gram-meta-ai-state {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-muted, #64748b);
  font-size: 10px;
  font-weight: 600;
}

.gram-meta-ai-state.is-on {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}

html.theme-dark .gram-meta-ai-state.is-on {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}

.gram-meta-ai-toggles {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding-left: 4px;
  border-left: 1px solid var(--border, rgba(148, 163, 184, 0.35));
}

.gram-meta-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted, #64748b);
  user-select: none;
}

.gram-meta-toggle:hover { background: rgba(148, 163, 184, 0.12); }

.gram-meta-toggle input {
  width: 12px;
  height: 12px;
  margin: 0;
  accent-color: #8b5cf6;
}

.gram-meta-check {
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s;
}

.gram-meta-check:hover {
  border-color: rgba(14, 165, 233, 0.45);
  background: rgba(14, 165, 233, 0.06);
}

.gram-meta-check-nums {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-variant-numeric: tabular-nums;
}

.gram-meta-check-nums b { font-weight: 700; font-size: 12px; }
.gram-meta-check-nums b.ok { color: #16a34a; }
.gram-meta-check-nums b.warn { color: #d97706; }
.gram-meta-check-nums b.bad { color: #dc2626; }
.gram-meta-check-nums b.freeze { color: #0284c7; }
.gram-meta-check-nums .sep { opacity: 0.35; }

.gram-acc-tools-compact {
  padding: 12px 14px;
  margin-bottom: 14px;
}

.gram-acc-tools-grid-compact {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}

.gram-acc-tools-grid-compact .gram-acc-tool-card {
  padding: 8px 10px;
  border-radius: 10px;
}

.gram-acc-tools-grid-compact .gram-acc-tool-icon {
  width: 30px;
  height: 30px;
  font-size: 14px;
}

.gram-acc-tools-grid-compact .gram-acc-tool-text b { font-size: 12px; }
.gram-acc-tools-grid-compact .gram-acc-tool-text span { font-size: 10px; }

@media (max-width: 900px) {
  .gram-accounts-page .acc-page-head { flex-direction: column; }
  .acc-meta-row { margin-left: 0; width: 100%; }
}

@media (max-width: 640px) {
  .gram-meta-ai-toggles { border-left: none; padding-left: 0; width: 100%; }
  .gram-meta-ai { flex-wrap: wrap; border-radius: 12px; }
}

.gram-modal-field {
  margin-bottom: 12px;
}

.gram-modal-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.gram-cleanup-opts {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 140px;
  overflow: auto;
}

.gram-modal-summary {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
}

.gram-modal-log {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-hover);
  font-family: inherit;
  font-size: 12px;
  line-height: 1.45;
  max-height: 180px;
  white-space: pre-wrap;
  word-break: break-word;
}

.gram-code-result {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gram-code-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-hover);
  font-size: 14px;
}

.gram-code-row b {
  font-size: 18px;
  letter-spacing: 0.06em;
}

.gram-modal-result.err {
  color: #ef4444;
  font-size: 13px;
  margin: 0;
}

@media (max-width: 960px) {
  .gram-acc-tools-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .gram-acc-tools-grid { grid-template-columns: 1fr; }
}

/* —— Account manager stats —— */
.acc-stats-section {
  display: flex;
  align-items: stretch;
  gap: 12px;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}

.acc-stats-grid {
  flex: 1 1 auto;
  min-width: max-content;
  display: grid;
  grid-template-columns: repeat(6, minmax(140px, 1fr));
  gap: 10px;
}

.acc-stats-grid .stat-card {
  padding: 10px 12px;
  min-height: 0;
}

.acc-stats-grid .stat-value {
  font-size: 20px;
}

.acc-stats-grid .stat-icon {
  width: 28px;
  height: 28px;
  font-size: 13px;
  margin-bottom: 2px;
}

.stat-card-click {
  cursor: pointer;
}

.stat-card-click:hover {
  border-color: rgba(59, 130, 246, 0.35);
}

.stat-card-active {
  border-color: rgba(59, 130, 246, 0.55);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.stat-card-active .stat-hover-indicator {
  opacity: 1;
}

html.theme-dark .stat-card-active {
  border-color: rgba(34, 211, 238, 0.45);
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.12);
}

.acc-limit-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: center;
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-hover);
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
}

html.theme-dark .acc-limit-pill {
  background: rgba(15, 23, 42, 0.45);
  border-color: var(--gram-border);
}

.acc-limit-pill i {
  font-size: 12px;
  color: #8b5cf6;
}

.acc-limit-nums b {
  color: var(--text);
  font-weight: 700;
}

.icon-nospam { background: #ecfdf5; color: #10b981; }
.icon-frozen { background: #ecfeff; color: #0891b2; }

html.theme-dark .icon-nospam { background: rgba(16, 185, 129, 0.15); }
html.theme-dark .icon-frozen { background: rgba(8, 145, 178, 0.15); }
html.theme-dark .icon-working { background: rgba(59, 130, 246, 0.15); }
html.theme-dark .icon-spam { background: rgba(245, 158, 11, 0.15); }

@media (max-width: 1100px) {
  .acc-stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .acc-stats-section { flex-direction: column; align-items: stretch; }
  .acc-limit-pill { align-self: flex-start; }
  .acc-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.gram-modal-sub {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
}

.gram-info-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 14px;
  border-radius: var(--radius-sm);
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.25);
  font-size: 13px;
  color: var(--text);
}

html.theme-dark .gram-info-bar {
  background: rgba(34, 211, 238, 0.1);
  border-color: rgba(34, 211, 238, 0.25);
}

.gram-info-bar i { color: var(--primary-cyan); }

.gram-info-bar-accent {
  background: linear-gradient(90deg, rgba(14, 165, 233, 0.12), rgba(139, 92, 246, 0.08));
  border-color: rgba(14, 165, 233, 0.25);
}

html.theme-dark .gram-info-bar-accent {
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.1), rgba(139, 92, 246, 0.12));
}

.panel-modal-card.gram-modal-wide {
  width: min(560px, calc(100vw - 32px));
  max-width: 560px;
}

.gram-modal-hint {
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
}

.gram-textarea {
  min-height: 72px;
  resize: none;
}

.gram-modal-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 13px;
}

.gram-modal-section {
  margin-bottom: 16px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-hover);
}

html.theme-dark .gram-modal-section {
  background: rgba(15, 23, 42, 0.45);
  border-color: rgba(71, 100, 150, 0.35);
}

.gram-modal-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.gram-modal-section-head i {
  color: var(--primary-cyan);
  font-size: 14px;
}

.gram-action-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.gram-action-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: var(--surface);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
}

html.theme-dark .gram-action-menu-item {
  background: rgba(15, 23, 42, 0.55);
}

.gram-action-menu-item:hover {
  border-color: rgba(139, 92, 246, 0.35);
  background: rgba(139, 92, 246, 0.06);
  transform: translateX(2px);
}

.gram-action-menu-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex-shrink: 0;
  font-size: 15px;
}

.gram-action-menu-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gram-action-menu-text b {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.gram-action-menu-text span {
  font-size: 11px;
  color: var(--text-muted);
}

.gram-action-menu-arrow {
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.5;
}

.gram-cleanup-field .gram-cleanup-opts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 6px;
}

/* —— Таблица —— */
.gram-table-wrap {
  overflow: visible;
}

.gram-table-wrap .table-container {
  border-radius: var(--radius);
}

html.theme-dark .data-table tbody tr:hover td {
  background: rgba(34, 211, 238, 0.06);
}

html.theme-dark .data-table th {
  background: #152238;
  color: var(--text-muted);
}

html.theme-dark .gram-accounts-page .data-table input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  margin: 0;
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 4px;
  background: #152238;
  cursor: pointer;
  position: relative;
  vertical-align: middle;
}

html.theme-dark .gram-accounts-page .data-table input[type="checkbox"]:checked {
  background: #0891b2;
  border-color: #22d3ee;
}

html.theme-dark .gram-accounts-page .data-table input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: 2px solid #fff;
  border-top: 0;
  border-left: 0;
  transform: rotate(45deg);
}

html.theme-dark .gram-accounts-page .data-table input[type="checkbox"]:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.avatar-cell {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 38%, #06b6d4 72%, #22d3ee 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.avatar-cell-no-photo {
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 38%, #06b6d4 72%, #22d3ee 100%) !important;
  color: #fff !important;
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.45);
}

html:not(.theme-dark) .avatar-cell-no-photo {
  background: linear-gradient(135deg, #1e40af 0%, #2563eb 42%, #0284c7 100%) !important;
  border: 1px solid rgba(30, 64, 175, 0.35);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.22);
}

.avatar-cell-has-img {
  background: rgba(15, 23, 42, 0.08);
  box-shadow: none;
}

.avatar-cell-has-img.avatar-cell-no-photo {
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 38%, #06b6d4 72%, #22d3ee 100%);
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.35);
}

.avatar-cell-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}

.avatar-cell-photo.is-broken {
  display: none;
}

.avatar-cell-fallback {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
}

.avatar-cell-fallback.is-visible {
  display: flex;
  color: #fff !important;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(15, 23, 42, 0.45);
}

/* —— Журнал / модули —— */
.gram-page { display: flex; flex-direction: column; gap: 14px; }

.category-card.gram-module-card {
  transition: border-color 0.15s, transform 0.15s;
}

html.theme-dark .category-card.gram-module-card:hover {
  border-color: var(--gram-accent);
  transform: translateY(-1px);
}

/* Светлая тема — те же компоненты */
html:not(.theme-dark) .gram-card-head {
  background: rgba(59, 130, 246, 0.06);
}

html:not(.theme-dark) .gram-bulk-bar {
  background: #f8fafc;
}

/* —— Настройки модуля (GramGPT, не mini-app) —— */
.gram-module-page .gram-module-hero {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.gram-module-hero-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  color: #fff;
  font-size: 18px;
  flex-shrink: 0;
}

.gram-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.gram-settings-grid .gram-card-span,
.gram-settings-grid .settings-section:has(.gram-field-wide),
.gram-settings-grid .settings-section:has(.gram-textarea-tall) {
  grid-column: 1 / -1;
}

.gram-settings-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}

html.theme-dark .gram-settings-footer {
  background: var(--gram-card);
  border-color: var(--gram-border);
}

.gram-templates-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.gram-templates-row .settings-input-inline {
  flex: 1;
  min-width: 140px;
}

/* Режим — крупные пилюли как в GramGPT */
.gram-mode-row {
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.gram-segment {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gram-segment-lg {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.gram-segment-btn {
  flex: 1;
  min-width: 120px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  transition: all 0.2s ease;
}

html.theme-dark .gram-segment-btn {
  background: #152238;
  border-color: var(--gram-border);
  color: var(--text-muted);
}

.gram-segment-btn:hover:not(.active) {
  border-color: var(--primary-cyan);
  color: var(--text);
  background: var(--surface-hover);
}

.gram-segment-btn.active {
  background: linear-gradient(135deg, #8b5cf6, #6366f1) !important;
  color: #fff !important;
  border-color: transparent !important;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.35);
}

html.theme-dark .gram-segment-btn.active {
  background: linear-gradient(135deg, #22d3ee, #2563eb) !important;
  box-shadow: 0 4px 16px rgba(34, 211, 238, 0.3);
}

.gram-fields-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
  margin-bottom: 12px;
}

.gram-fields-grid-1 {
  grid-template-columns: 1fr;
}

.gram-field-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.gram-field-wrap[style*="display: none"] {
  display: none !important;
}

.gram-field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.gram-input,
.gram-field .settings-input,
.gram-field .settings-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--input-bg, var(--surface));
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

html.theme-dark .gram-input,
html.theme-dark .gram-field .settings-input,
html.theme-dark .gram-field .settings-textarea {
  background: #152238;
  border-color: var(--gram-border);
}

.gram-input:focus,
.gram-field .settings-input:focus,
.gram-field .settings-textarea:focus {
  outline: none;
  border-color: var(--primary-cyan);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15);
}

.gram-field-hint {
  margin: 6px 0 0;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
}

.gram-check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.gram-check-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(59, 130, 246, 0.04);
  cursor: pointer;
  margin: 0;
  transition: border-color 0.15s, background 0.15s;
}

html.theme-dark .gram-check-card {
  background: #152238;
  border-color: var(--gram-border);
}

.gram-check-card:has(input:checked) {
  border-color: rgba(139, 92, 246, 0.5);
  background: rgba(139, 92, 246, 0.1);
}

html.theme-dark .gram-check-card:has(input:checked) {
  border-color: rgba(34, 211, 238, 0.45);
  background: rgba(34, 211, 238, 0.08);
}

.gram-check-card input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: #8b5cf6;
  flex-shrink: 0;
}

.gram-check-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.35;
}

/* —— Цветные маркеры (GramGPT) —— */
.gram-icon-tone {
  color: #fff !important;
  border: none;
}

.gram-icon-tone-blue { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.gram-icon-tone-indigo { background: linear-gradient(135deg, #6366f1, #4f46e5); }
.gram-icon-tone-cyan { background: linear-gradient(135deg, #22d3ee, #0891b2); }
.gram-icon-tone-emerald { background: linear-gradient(135deg, #34d399, #059669); }
.gram-icon-tone-green { background: linear-gradient(135deg, #22c55e, #16a34a); }
.gram-icon-tone-violet { background: linear-gradient(135deg, #a78bfa, #7c3aed); }
.gram-icon-tone-purple { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.gram-icon-tone-orange { background: linear-gradient(135deg, #fb923c, #ea580c); }
.gram-icon-tone-amber { background: linear-gradient(135deg, #fbbf24, #d97706); }
.gram-icon-tone-pink { background: linear-gradient(135deg, #f472b6, #db2777); }
.gram-icon-tone-rose { background: linear-gradient(135deg, #fb7185, #e11d48); }
.gram-icon-tone-slate { background: linear-gradient(135deg, #64748b, #475569); }

.gram-tone-blue { background: linear-gradient(135deg, #3b82f6, #2563eb); color: #fff; }
.gram-tone-indigo { background: linear-gradient(135deg, #6366f1, #4f46e5); color: #fff; }
.gram-tone-cyan { background: linear-gradient(135deg, #22d3ee, #0891b2); color: #0f1419; }
.gram-tone-emerald { background: linear-gradient(135deg, #34d399, #059669); color: #fff; }
.gram-tone-green { background: linear-gradient(135deg, #22c55e, #16a34a); color: #fff; }
.gram-tone-violet { background: linear-gradient(135deg, #a78bfa, #7c3aed); color: #fff; }
.gram-tone-purple { background: linear-gradient(135deg, #8b5cf6, #6d28d9); color: #fff; }
.gram-tone-orange { background: linear-gradient(135deg, #fb923c, #ea580c); color: #fff; }
.gram-tone-amber { background: linear-gradient(135deg, #fbbf24, #d97706); color: #1e293b; }
.gram-tone-pink { background: linear-gradient(135deg, #f472b6, #db2777); color: #fff; }
.gram-tone-rose { background: linear-gradient(135deg, #fb7185, #e11d48); color: #fff; }
.gram-tone-slate { background: linear-gradient(135deg, #64748b, #475569); color: #fff; }

.gram-card-icon.gram-tone-blue,
.gram-card-icon.gram-tone-indigo,
.gram-card-icon.gram-tone-cyan,
.gram-card-icon.gram-tone-emerald,
.gram-card-icon.gram-tone-green,
.gram-card-icon.gram-tone-violet,
.gram-card-icon.gram-tone-purple,
.gram-card-icon.gram-tone-orange,
.gram-card-icon.gram-tone-amber,
.gram-card-icon.gram-tone-pink,
.gram-card-icon.gram-tone-rose,
.gram-card-icon.gram-tone-slate {
  background: inherit;
  color: inherit;
}

.gram-card-icon[class*="gram-tone-"] {
  background: var(--gram-tone-bg, linear-gradient(135deg, rgba(34, 211, 238, 0.25), rgba(129, 140, 248, 0.25)));
}

.gram-card-icon.gram-tone-blue { background: linear-gradient(135deg, #3b82f6, #2563eb); color: #fff; }
.gram-card-icon.gram-tone-indigo { background: linear-gradient(135deg, #6366f1, #4f46e5); color: #fff; }
.gram-card-icon.gram-tone-cyan { background: linear-gradient(135deg, #22d3ee, #0891b2); color: #0f1419; }
.gram-card-icon.gram-tone-emerald { background: linear-gradient(135deg, #34d399, #059669); color: #fff; }
.gram-card-icon.gram-tone-green { background: linear-gradient(135deg, #22c55e, #16a34a); color: #fff; }
.gram-card-icon.gram-tone-violet { background: linear-gradient(135deg, #a78bfa, #7c3aed); color: #fff; }
.gram-card-icon.gram-tone-purple { background: linear-gradient(135deg, #8b5cf6, #6d28d9); color: #fff; }
.gram-card-icon.gram-tone-orange { background: linear-gradient(135deg, #fb923c, #ea580c); color: #fff; }
.gram-card-icon.gram-tone-amber { background: linear-gradient(135deg, #fbbf24, #d97706); color: #1e293b; }
.gram-card-icon.gram-tone-pink { background: linear-gradient(135deg, #f472b6, #db2777); color: #fff; }
.gram-card-icon.gram-tone-rose { background: linear-gradient(135deg, #fb7185, #e11d48); color: #fff; }
.gram-card-icon.gram-tone-slate { background: linear-gradient(135deg, #64748b, #475569); color: #fff; }

.gram-module-hero-icon[class*="gram-tone-"] {
  color: #fff;
}

.gram-module-hero-icon.gram-tone-cyan { color: #0f1419; }
.gram-module-hero-icon.gram-tone-amber { color: #1e293b; }

.submenu-link {
  gap: 8px;
}

.submenu-run-dot {
  width: 8px;
  height: 8px;
  margin-left: auto;
  flex-shrink: 0;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.25), 0 0 10px rgba(34, 197, 94, 0.65);
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.submenu-link.is-module-running .submenu-run-dot {
  opacity: 1;
  transform: scale(1);
}

.submenu-module-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  flex-shrink: 0;
}

.category-card-icon.gram-icon-tone {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 14px;
}

.menu-item.active .gram-icon-tone,
.menu-icon-active.gram-icon-tone {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25);
}

html.theme-dark .menu-item.active .gram-icon-tone {
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.35);
}

/* —— Модуль: заморозка настроек во время задачи —— */
.gram-module-frozen-zone {
  position: relative;
}

.gram-module-running-lock .gram-module-frozen-zone {
  pointer-events: none;
  user-select: none;
}

.gram-module-running-lock .gram-module-frozen-zone::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(
    145deg,
    rgba(241, 245, 249, 0.32) 0%,
    rgba(186, 230, 253, 0.16) 42%,
    rgba(226, 232, 240, 0.28) 100%
  );
  box-shadow:
    inset 0 0 0 1px rgba(148, 163, 184, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  animation: gram-module-frost-in 0.4s ease;
}

html.theme-dark .gram-module-running-lock .gram-module-frozen-zone::after {
  background: linear-gradient(
    145deg,
    rgba(15, 23, 42, 0.38) 0%,
    rgba(14, 116, 144, 0.12) 45%,
    rgba(15, 23, 42, 0.32) 100%
  );
  box-shadow:
    inset 0 0 0 1px rgba(56, 189, 248, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.gram-module-running-lock .gram-module-frozen-zone > * {
  opacity: 0.82;
  filter: saturate(0.88) contrast(0.98);
  transition: opacity 0.4s ease, filter 0.4s ease;
}

.gram-module-running-lock .gram-gpt-action-bar,
.gram-module-running-lock .gram-action-bar {
  position: relative;
  z-index: 6;
  border-color: rgba(56, 189, 248, 0.18);
  box-shadow:
    0 -6px 18px rgba(14, 165, 233, 0.06),
    0 0 0 1px rgba(56, 189, 248, 0.05);
  transition: box-shadow 0.4s ease, border-color 0.4s ease;
}

html.theme-dark .gram-module-running-lock .gram-gpt-action-bar,
html.theme-dark .gram-module-running-lock .gram-action-bar {
  border-color: rgba(56, 189, 248, 0.14);
  box-shadow:
    0 -8px 22px rgba(14, 165, 233, 0.08),
    0 0 0 1px rgba(56, 189, 248, 0.06);
}

.gram-module-running-lock .gram-gpt-action-bar button[type="submit"],
.gram-module-running-lock .gram-action-bar button[type="submit"] {
  pointer-events: none;
  opacity: 0.58;
  filter: grayscale(0.2);
}

.gram-module-running-lock #panelCancelBtn:not([hidden]) {
  opacity: 1;
  filter: none;
  box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.18), 0 4px 14px rgba(239, 68, 68, 0.1);
}

@keyframes gram-module-frost-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* —— Кабинет: амбассадор (glass) —— */
.gram-cab-amb-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.gram-cab-amb-hero {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(56, 189, 248, 0.32);
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.72), rgba(30, 41, 59, 0.48));
  box-shadow:
    0 0 40px rgba(14, 165, 233, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  padding: 20px 22px;
}

html:not(.theme-dark) .gram-cab-amb-hero {
  background: linear-gradient(145deg, rgba(240, 249, 255, 0.92), rgba(224, 242, 254, 0.72));
  border-color: rgba(14, 165, 233, 0.28);
  box-shadow: 0 12px 36px rgba(14, 165, 233, 0.1);
}

.gram-cab-amb-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 60% at 100% 0%, rgba(56, 189, 248, 0.18), transparent 55%);
  pointer-events: none;
}

.gram-cab-amb-hero-inner {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.gram-cab-amb-hero-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  color: #e0f2fe;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.45), rgba(99, 102, 241, 0.5));
  box-shadow: 0 0 28px rgba(14, 165, 233, 0.35);
  flex-shrink: 0;
}

.gram-cab-amb-hero-title {
  margin: 0 0 6px;
  font-size: 1.25rem;
  font-weight: 700;
}

.gram-cab-amb-hero-sub {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.45;
}

.gram-cab-amb-glass {
  border-radius: 16px;
  border: 1px solid rgba(56, 189, 248, 0.2);
  background: linear-gradient(160deg, rgba(15, 23, 42, 0.55), rgba(30, 41, 59, 0.38));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

html:not(.theme-dark) .gram-cab-amb-glass {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.82), rgba(241, 245, 249, 0.65));
  border-color: rgba(148, 163, 184, 0.35);
}

.gram-cab-amb-glass-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(56, 189, 248, 0.12);
}

.gram-cab-amb-glass-body {
  padding: 16px;
}

.gram-cab-amb-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.gram-cab-amb-kpi {
  border-radius: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(56, 189, 248, 0.14);
  background: rgba(14, 165, 233, 0.06);
  text-align: center;
}

.gram-cab-amb-kpi b {
  display: block;
  font-size: 1.15rem;
  margin-bottom: 4px;
}

.gram-cab-amb-kpi span {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.gram-cab-amb-link-box {
  display: block;
  margin: 12px 0;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px dashed rgba(56, 189, 248, 0.35);
  background: rgba(15, 23, 42, 0.35);
  font-size: 12px;
  word-break: break-all;
}

html:not(.theme-dark) .gram-cab-amb-link-box {
  background: rgba(255, 255, 255, 0.55);
}

.gram-cab-amb-period {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.gram-cab-amb-period .p-btn.is-active {
  border-color: rgba(56, 189, 248, 0.55);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.2);
}

.gram-cab-amb-notify-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.gram-cab-amb-notify-row:last-child {
  border-bottom: none;
}

@media (max-width: 720px) {
  .gram-cab-amb-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* —— Кабинет партнёра: хаб —— */
.gram-amb-hub {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.gram-amb-hub-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: sticky;
  top: 12px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(56, 189, 248, 0.18);
  background: linear-gradient(160deg, rgba(15, 23, 42, 0.55), rgba(30, 41, 59, 0.38));
  backdrop-filter: blur(10px);
}

html:not(.theme-dark) .gram-amb-hub-nav {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.88), rgba(241, 245, 249, 0.72));
  border-color: rgba(148, 163, 184, 0.35);
}

.gram-amb-hub-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.gram-amb-hub-nav-btn:hover {
  background: rgba(56, 189, 248, 0.08);
  border-color: rgba(56, 189, 248, 0.15);
}

.gram-amb-hub-nav-btn.is-active {
  background: rgba(14, 165, 233, 0.14);
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.gram-amb-hub-nav-btn.is-soon {
  opacity: 0.55;
  cursor: default;
}

.gram-amb-hub-nav-btn small {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.gram-amb-hub-main {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.gram-amb-hub-glass {
  border-radius: 16px;
  border: 1px solid rgba(56, 189, 248, 0.18);
  background: linear-gradient(160deg, rgba(15, 23, 42, 0.5), rgba(30, 41, 59, 0.34));
  backdrop-filter: blur(10px);
  overflow: hidden;
}

html:not(.theme-dark) .gram-amb-hub-glass {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.86), rgba(241, 245, 249, 0.68));
  border-color: rgba(148, 163, 184, 0.32);
}

.gram-amb-hub-glass-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(56, 189, 248, 0.1);
}

.gram-amb-hub-glass-body {
  padding: 16px;
}

.gram-amb-hub-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 650;
}

.gram-amb-hub-eyebrow {
  margin: 0 0 4px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7dd3fc;
}

.gram-amb-hub-hero {
  border-radius: 18px;
  border: 1px solid rgba(56, 189, 248, 0.28);
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.72), rgba(30, 58, 95, 0.45));
  box-shadow: 0 0 36px rgba(14, 165, 233, 0.12);
  padding: 20px;
}

html:not(.theme-dark) .gram-amb-hub-hero {
  background: linear-gradient(145deg, rgba(240, 249, 255, 0.95), rgba(224, 242, 254, 0.75));
}

.gram-amb-hub-hero-inner {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.gram-amb-hub-hero-title {
  margin: 0 0 8px;
  font-size: 1.35rem;
}

.gram-amb-hub-hero-meta {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
}

.gram-amb-hub-hero-balances {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.gram-amb-hub-hero-balances div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gram-amb-hub-hero-balances span {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.gram-amb-hub-hero-balances b {
  font-size: 1.2rem;
}

.gram-amb-hub-motivate {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: stretch;
}

.gram-amb-hub-kpi {
  border-radius: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(56, 189, 248, 0.14);
  background: rgba(14, 165, 233, 0.06);
  text-align: center;
}

.gram-amb-hub-kpi b {
  display: block;
  font-size: 1.05rem;
  margin-bottom: 4px;
}

.gram-amb-hub-kpi span {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.gram-amb-hub-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.gram-amb-hub-kpi-grid--finance {
  margin-bottom: 14px;
}

.gram-amb-hub-promote-btn {
  align-self: stretch;
  min-width: 180px;
  justify-content: center;
}

.gram-amb-hub-badge {
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: #7dd3fc;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.gram-amb-hub-status {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.gram-amb-hub-status--paid { border-color: rgba(34, 197, 94, 0.35); color: #86efac; }
.gram-amb-hub-status--demo,
.gram-amb-hub-status--demo_active { border-color: rgba(234, 179, 8, 0.35); color: #fde047; }
.gram-amb-hub-status--expired { border-color: rgba(248, 113, 113, 0.35); color: #fca5a5; }

.gram-amb-hub-promote-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 20px;
}

.gram-amb-hub-promote-modal[hidden] {
  display: none !important;
}

.gram-amb-hub-promote-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
}

.gram-amb-hub-promote-panel {
  position: relative;
  width: min(520px, 100%);
  z-index: 1;
}

.gram-amb-hub-promote-actions {
  margin-top: 12px;
}

.gram-amb-hub-period {
  margin: 0;
}

.gram-amb-chart-wrap {
  margin-top: 16px;
  min-height: 220px;
  position: relative;
}

.gram-amb-analytics-periods {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gram-amb-preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.gram-amb-link-create-actions {
  margin-top: 12px;
}

.gram-amb-utm-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0;
}

.gram-amb-users-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
}

@media (max-width: 720px) {
  .gram-amb-utm-grid {
    grid-template-columns: 1fr;
  }
  .gram-amb-wallet-grid {
    grid-template-columns: 1fr;
  }
}

.gram-amb-wallet-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0;
}

.gram-amb-payout-form .p-btn {
  margin-top: 10px;
}

.gram-amb-qr-row {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.gram-amb-qr-row canvas {
  border-radius: 12px;
  background: #fff;
  padding: 8px;
}

.gram-amb-material-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.gram-amb-material-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(56, 189, 248, 0.18);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.gram-amb-material-card:hover {
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(56, 189, 248, 0.06);
}

.gram-amb-template {
  border: 1px solid rgba(56, 189, 248, 0.12);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
}

.gram-amb-template-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.gram-amb-template-text {
  margin: 0;
  white-space: pre-wrap;
  font-size: 12px;
  color: var(--text-muted);
  font-family: inherit;
}

.gram-amb-promo-create {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.gram-amb-promo-create .gram-input {
  flex: 1 1 120px;
}

.gram-amb-lessons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gram-amb-lesson {
  border: 1px solid rgba(56, 189, 248, 0.14);
  border-radius: 12px;
  overflow: hidden;
}

.gram-amb-lesson-head {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: left;
}

.gram-amb-lesson-body {
  display: none;
  padding: 0 14px 14px;
}

.gram-amb-lesson.is-open .gram-amb-lesson-body {
  display: block;
}

.gram-amb-lesson.is-open .gram-amb-lesson-head .pi-chevron-down {
  transform: rotate(180deg);
}

.gram-amb-perks {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--text-muted);
}

.gram-amb-lb-you td {
  font-weight: 600;
}

html:not(.theme-dark) .gram-amb-hub-eyebrow {
  color: #0369a1;
}

html:not(.theme-dark) .gram-amb-hub-kpi {
  background: rgba(14, 165, 233, 0.07);
  border-color: rgba(14, 165, 233, 0.22);
}

html:not(.theme-dark) .gram-amb-hub-status--paid {
  border-color: rgba(22, 163, 74, 0.35);
  color: #15803d;
  background: rgba(22, 163, 74, 0.08);
}

html:not(.theme-dark) .gram-amb-hub-status--demo,
html:not(.theme-dark) .gram-amb-hub-status--demo_active {
  border-color: rgba(202, 138, 4, 0.35);
  color: #a16207;
  background: rgba(202, 138, 4, 0.08);
}

html:not(.theme-dark) .gram-amb-hub-status--expired {
  border-color: rgba(220, 38, 38, 0.3);
  color: #b91c1c;
  background: rgba(220, 38, 38, 0.06);
}

html:not(.theme-dark) .gram-amb-hub-nav-btn.is-active {
  background: rgba(14, 165, 233, 0.12);
  border-color: rgba(14, 165, 233, 0.35);
}

html:not(.theme-dark) .gram-amb-material-card {
  border-color: rgba(148, 163, 184, 0.35);
  background: rgba(255, 255, 255, 0.5);
}

.cabinet-promo-inline {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.cabinet-promo-inline .gram-input {
  flex: 1 1 160px;
}

.cabinet-promo-row {
  margin-bottom: 16px;
}

@media (max-width: 960px) {
  .gram-amb-hub {
    grid-template-columns: 1fr;
  }
  .gram-amb-hub-nav {
    flex-direction: row;
    flex-wrap: wrap;
    position: static;
  }
  .gram-amb-hub-nav-btn {
    width: auto;
    flex: 1 1 120px;
  }
  .gram-amb-hub-motivate {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .gram-amb-hub-promote-btn {
    grid-column: 1 / -1;
  }
}

/* —— Модуль: колонка, действия, распределение —— */
.gram-module-page .gram-settings-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 0;
}

.gram-action-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  margin-top: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}

html.theme-dark .gram-action-bar {
  background: var(--gram-card);
  border-color: var(--gram-border);
}

.gram-action-bar .gram-cta { flex: 1; min-width: 160px; justify-content: center; }
.gram-action-bar .p-btn { flex-shrink: 0; }

.gram-cta-purple { background: linear-gradient(135deg, #8b5cf6, #6d28d9); color: #fff; }
.gram-cta-green { background: linear-gradient(135deg, #22c55e, #16a34a); color: #fff; }

.gram-dist-card .gram-field-hint {
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.gram-dist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 12px;
  max-width: 100%;
  min-width: 0;
}

.gram-dist-grid.gram-gpt-dist-grid {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}

.gram-dist-grid.gram-gpt-dist-grid .dist-box {
  flex: 0 0 180px;
  min-width: 160px;
}

.gram-dist-grid .dist-box {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-hover);
}

html.theme-dark .gram-dist-grid .dist-box {
  background: rgba(15, 23, 42, 0.35);
  border-color: var(--gram-border);
}

.gram-dist-grid .dist-box h4 {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
}

.gram-dist-grid .dist-box ul {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 11px;
  color: var(--text-muted);
  max-height: 100px;
  overflow: auto;
}

.gram-dist-grid .dist-box li {
  padding: 2px 0;
  word-break: break-all;
}

.dist-box--editable {
  min-width: 0;
}

.dist-box--editable .dist-box-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.dist-box--editable .dist-box-head h4 {
  margin: 0;
  flex: 1;
  min-width: 0;
}

.dist-box-toggle {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(139, 92, 246, 0.35);
  background: rgba(139, 92, 246, 0.12);
  color: #c4b5fd;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.dist-box-toggle:hover,
.dist-box-toggle.is-open {
  border-color: rgba(139, 92, 246, 0.55);
  background: rgba(139, 92, 246, 0.22);
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.2);
}

.dist-box-preview[hidden] {
  display: none;
}

.dist-box-more {
  font-style: italic;
  opacity: 0.75;
}

.dist-box-edit {
  margin-top: 8px;
}

.dist-box-links-input {
  width: 100%;
  min-height: 88px;
  resize: vertical;
  border-radius: 8px;
  border: 1px solid rgba(71, 100, 150, 0.35);
  background: rgba(15, 23, 42, 0.35);
  color: inherit;
  font-family: inherit;
  font-size: 11px;
  line-height: 1.45;
  padding: 8px 10px;
  box-sizing: border-box;
}

html:not(.theme-dark) .dist-box-links-input {
  background: rgba(248, 250, 252, 0.95);
  border-color: rgba(148, 163, 184, 0.45);
}

.dist-box-edit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.dist-box-add-line,
.dist-box-clear {
  border: 1px solid rgba(71, 100, 150, 0.28);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.25);
  color: inherit;
  font-size: 11px;
  padding: 5px 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

html:not(.theme-dark) .dist-box-add-line,
html:not(.theme-dark) .dist-box-clear {
  background: rgba(248, 250, 252, 0.9);
}

.dist-box-add-line:hover {
  border-color: rgba(34, 197, 94, 0.45);
  color: #4ade80;
}

.dist-box-clear:hover {
  border-color: rgba(248, 113, 113, 0.45);
  color: #f87171;
}

.module-card-toned {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.modules-hub .module-grid {
  gap: 10px;
}

.modules-hub .module-card {
  padding: 12px 18px;
  font-size: 14px;
}

.modules-hub .module-card .submenu-module-icon {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  font-size: 12px;
}

.modules-hub .module-card-toned {
  gap: 9px;
}

.modules-hub .gram-module-hero {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modules-hub-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.modules-hub-title-row .gram-page-title {
  margin: 0;
}

.gram-module-page .gram-module-hero .modules-hub-title-row {
  flex: 1;
  min-width: 0;
}

.gram-module-head-text {
  flex: 1;
  min-width: 0;
}

/* —— Поддержка (тикеты из панели) —— */
.gram-support-page .gram-page-head {
  align-items: center;
}

.gram-support-type-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.gram-cta-orange {
  background: linear-gradient(135deg, #fb923c, #ea580c);
  color: #fff;
}

.gram-support-chat {
  min-height: 220px;
  max-height: 360px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--log-console-bg, #f1f5f9);
}

html.theme-dark .gram-support-chat {
  background: var(--log-console-bg, #0f1a2e);
}

.gram-support-empty {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  padding: 24px 8px;
}

.gram-support-msg {
  max-width: 92%;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.4;
}

.gram-support-msg-user {
  align-self: flex-end;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.2), rgba(59, 130, 246, 0.25));
  border: 1px solid rgba(34, 211, 238, 0.35);
}

.gram-support-msg-staff {
  align-self: flex-start;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.gram-support-msg-system {
  align-self: center;
  max-width: 100%;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  background: transparent;
  border: none;
}

.gram-support-msg-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.gram-support-msg-time {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
}

.gram-support-compose {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gram-support-compose .gram-cta {
  align-self: flex-end;
}

.gram-support-chat-disabled .gram-support-chat {
  opacity: 0.55;
}

.gram-support-new-btn {
  margin-left: auto;
  font-size: 12px;
  padding: 6px 10px;
}

.gram-support-attach-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.gram-support-attach-btn {
  position: relative;
  cursor: pointer;
  margin: 0;
}

.gram-support-file-input {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.gram-support-file-name {
  font-size: 12px;
  color: var(--text-muted);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gram-support-preview {
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  max-width: 200px;
}

.gram-support-preview img {
  display: block;
  max-width: 100%;
  max-height: 140px;
  object-fit: contain;
}

.gram-support-img-link {
  display: block;
  margin-bottom: 6px;
}

.gram-support-img {
  display: block;
  max-width: 220px;
  max-height: 160px;
  border-radius: 8px;
  border: 1px solid var(--border);
  object-fit: contain;
}

.gram-support-file-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--primary-cyan);
  text-decoration: none;
  margin-bottom: 6px;
}

.gram-support-page--list .gram-support-list-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.gram-support-list-title {
  margin: 0 0 4px;
  font-size: 1.65rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary-cyan, #22d3ee), var(--primary-light, #3b82f6));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.gram-support-list-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.gram-support-list-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.gram-support-search {
  flex: 1;
  min-width: 200px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--input-bg, #fff);
}

.gram-support-search .pi-search {
  color: var(--text-muted);
  font-size: 14px;
}

.gram-support-search .gram-input {
  border: none;
  background: transparent;
  box-shadow: none;
  padding-left: 0;
  flex: 1;
}

.gram-support-status-filter {
  min-width: 160px;
}

.gram-support-ticket-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gram-support-ticket-card {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface, #fff);
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  color: inherit;
  font: inherit;
}

html.theme-dark .gram-support-ticket-card {
  background: var(--gram-card, #1a2332);
  border-color: var(--gram-border, rgba(71, 100, 150, 0.28));
}

.gram-support-ticket-card:hover {
  border-color: rgba(34, 211, 238, 0.45);
  box-shadow: 0 4px 18px rgba(34, 211, 238, 0.08);
}

.gram-support-ticket-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.gram-support-ticket-id {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  font-family: var(--font-mono, "JetBrains Mono", monospace);
}

.gram-support-status {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.gram-support-status--open {
  background: rgba(34, 197, 94, 0.14);
  color: #16a34a;
}

.gram-support-status--answered {
  background: rgba(59, 130, 246, 0.14);
  color: #2563eb;
}

.gram-support-status--closed {
  background: rgba(148, 163, 184, 0.18);
  color: var(--text-muted);
}

.gram-support-ticket-subject {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
}

.gram-support-ticket-excerpt {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.45;
}

.gram-support-empty-state {
  text-align: center;
  padding: 48px 20px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
}

.gram-support-empty-icon {
  display: inline-flex;
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.12);
  margin-bottom: 12px;
  font-size: 20px;
}

.gram-support-form-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
}

.gram-support-back {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.gram-support-back:hover {
  border-color: var(--primary-cyan, #22d3ee);
  color: var(--primary-cyan, #22d3ee);
}

.gram-support-form {
  padding: 18px;
}

.gram-support-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 120px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  padding: 16px;
}

.gram-support-dropzone.is-drag,
.gram-support-dropzone:hover {
  border-color: rgba(34, 211, 238, 0.5);
  background: rgba(34, 211, 238, 0.05);
}

.gram-support-dropzone-icon {
  font-size: 22px;
  color: var(--text-muted);
}

.gram-support-dropzone-text {
  font-size: 13px;
  color: var(--text-muted);
}

.gram-support-new-files {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.gram-support-new-file-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  font-size: 12px;
}

.gram-support-new-file-chip button {
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.gram-support-advanced {
  margin-top: 8px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.gram-support-advanced summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 10px;
}

.gram-support-advanced-body {
  display: grid;
  gap: 12px;
}

.gram-support-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.gram-support-chat-head-meta .gram-page-title {
  margin: 0 0 4px;
  font-size: 1.2rem;
}

.gram-support-close-btn {
  margin-left: auto;
  flex-shrink: 0;
}

.gram-req {
  color: #ef4444;
}

html:not(.theme-dark) .live-log-progress {
  background: rgba(59, 130, 246, 0.08);
  color: var(--text);
}

html:not(.theme-dark) .live-log-badge.live {
  background: rgba(34, 197, 94, 0.12);
  color: #059669;
}

@media (max-width: 900px) {
  .gram-settings-grid {
    grid-template-columns: 1fr;
  }
  .gram-fields-grid,
  .gram-check-grid {
    grid-template-columns: 1fr;
  }
  .gram-action-bar .gram-cta {
    min-width: 100%;
  }
}

/* —— Модули: фон области + чистые карточки (не blur-каша) —— */
.content-glass:has(.gram-module-page) {
  background: linear-gradient(165deg, #eef4ff 0%, #f4f8ff 36%, #fafbfd 100%);
  border-color: rgba(148, 163, 184, 0.32);
  box-shadow: 0 4px 28px rgba(59, 130, 246, 0.07);
}

html.theme-dark .content-glass:has(.gram-module-page) {
  background: linear-gradient(165deg, #0b1220 0%, #101a2e 40%, #152238 100%);
  border-color: var(--gram-border);
  box-shadow: 0 8px 36px rgba(0, 0, 0, 0.42);
}

.gram-module-page.gram-gpt-layout .gram-gpt-window {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

html.theme-dark .gram-module-page.gram-gpt-layout .gram-gpt-window {
  background: var(--gram-card);
  border-color: var(--gram-border);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.28);
}

.gram-module-page.gram-gpt-layout .gram-gpt-window-head {
  background: rgba(59, 130, 246, 0.05);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

html.theme-dark .gram-module-page.gram-gpt-layout .gram-gpt-window-head {
  background: rgba(34, 211, 238, 0.06);
}

/* NC glass — перебить flat-layout выше (backdrop-filter: none) */
.gram-neurocommenting-page.gram-nc-glass.gram-module-page.gram-gpt-layout .gram-gpt-window {
  border: 1px solid rgba(71, 100, 150, 0.32);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.06),
    0 8px 32px rgba(2, 8, 23, 0.18);
  overflow: visible;
}

html.theme-dark .gram-neurocommenting-page.gram-nc-glass.gram-module-page.gram-gpt-layout .gram-gpt-window {
  background: rgba(21, 34, 56, 0.88);
  border-color: rgba(56, 189, 248, 0.24);
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.1),
    0 8px 28px rgba(0, 0, 0, 0.35),
    0 0 24px rgba(56, 189, 248, 0.05);
}

html:not(.theme-dark) .gram-neurocommenting-page.gram-nc-glass.gram-module-page.gram-gpt-layout .gram-gpt-window {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(148, 163, 184, 0.35);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.85),
    0 8px 32px rgba(15, 23, 42, 0.08),
    0 0 20px rgba(56, 189, 248, 0.06);
}

.gram-neurocommenting-page.gram-nc-glass.gram-module-page.gram-gpt-layout .gram-gpt-window-head {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

html.theme-dark .gram-neurocommenting-page.gram-nc-glass.gram-module-page.gram-gpt-layout .gram-gpt-window-head {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.12) 0%, rgba(21, 34, 56, 0.15) 100%);
  border-bottom-color: rgba(56, 189, 248, 0.18);
}

html:not(.theme-dark) .gram-neurocommenting-page.gram-nc-glass.gram-module-page.gram-gpt-layout .gram-gpt-window-head {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.08) 0%, rgba(255, 255, 255, 0.45) 100%);
  border-bottom-color: rgba(148, 163, 184, 0.3);
}

.gram-settings-refreshing .gram-gpt-form,
.gram-settings-refreshing .gram-gpt-page {
  transition: opacity 0.2s ease;
}

.gram-settings-refreshing.gram-module-page::after,
.gram-settings-refreshing.gram-gpt-page::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.55), transparent);
  animation: gram-settings-refresh-bar 1.1s ease-in-out infinite;
}

@keyframes gram-settings-refresh-bar {
  0%, 100% { opacity: 0.35; transform: translateX(-8%); }
  50% { opacity: 1; transform: translateX(8%); }
}

/* —— GramGPT окна (рассылка в ЛС) —— */
.gram-gpt-layout { gap: 16px; }
.gram-gpt-form { display: flex; flex-direction: column; gap: 16px; }
.gram-gpt-row-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.gram-gpt-window {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  overflow: hidden;
}
html.theme-dark .gram-gpt-window {
  background: var(--gram-card, var(--surface));
  border-color: var(--gram-border, var(--border));
}
.gram-gpt-window-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(59, 130, 246, 0.04);
}
html.theme-dark .gram-gpt-window-head {
  background: rgba(34, 211, 238, 0.06);
  border-bottom-color: var(--gram-border, var(--border));
}
.gram-gpt-window-head .live-log-badge { margin-left: auto; }
.gram-gpt-window-title {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.gram-gpt-window-body { padding: 14px 16px 16px; }
.gram-gpt-section-label {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.gram-gpt-mode-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.gram-gpt-thread-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.gram-gpt-mode-card,
.gram-gpt-thread-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-hover);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
  color: var(--text);
}
html.theme-dark .gram-gpt-mode-card,
html.theme-dark .gram-gpt-thread-card {
  background: rgba(15, 23, 42, 0.35);
}
.gram-gpt-mode-card:hover,
.gram-gpt-thread-card:hover {
  border-color: var(--primary-light);
  transform: translateY(-1px);
}
.gram-gpt-mode-card.active,
.gram-gpt-thread-card.active {
  border-color: var(--primary-cyan);
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.35);
}
html:not(.theme-dark) .gram-gpt-mode-card.active,
html:not(.theme-dark) .gram-gpt-thread-card.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.25);
}
.gram-gpt-mode-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.gram-gpt-mode-title { font-size: 13px; font-weight: 700; }
.gram-gpt-mode-desc { font-size: 11px; color: var(--text-muted); line-height: 1.35; }
.gram-gpt-fields-compact {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}
.gram-gpt-tabs { margin-left: auto; display: flex; gap: 6px; }
.gram-gpt-tab {
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(34, 211, 238, 0.15);
  color: var(--primary-cyan);
  border: 1px solid rgba(34, 211, 238, 0.35);
}
html:not(.theme-dark) .gram-gpt-tab {
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
  border-color: rgba(37, 99, 235, 0.25);
}
.gram-gpt-dist-block {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}
.gram-gpt-options-body .gram-check-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.gram-spam-layout .gram-textarea-tall { min-height: 200px; }
.gram-spam-layout .gram-gpt-text-body .gram-field-wide,
.gram-spam-layout .gram-gpt-audience-body .gram-field-wide { height: 100%; }
.gram-spam-layout .gram-gpt-audience-body .gram-textarea-tall { min-height: 160px; }
.gram-spam-layout .gram-gpt-params-body .gram-fields-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.gram-gpt-row-main { align-items: stretch; }
.gram-gpt-row-main .gram-gpt-window { display: flex; flex-direction: column; }
.gram-gpt-row-main .gram-gpt-window-body { flex: 1; }
@media (max-width: 960px) {
  .gram-spam-layout .gram-gpt-params-body .gram-fields-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .gram-spam-layout .gram-gpt-params-body .gram-fields-grid {
    grid-template-columns: 1fr;
  }
}

/* —— GramGPT layout v2 (все модули) —— */
.gram-gpt-layout {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.gram-gpt-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.gram-gpt-row-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.gram-gpt-row-main { align-items: stretch; }
.gram-gpt-row-main .gram-gpt-window {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.gram-gpt-row-main .gram-gpt-window-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.gram-gpt-row-main .gram-gpt-text-preview {
  flex: 1;
  min-height: 120px;
  max-height: none;
  height: auto;
}

.gram-gpt-row-main .gram-gpt-window:last-child .gram-field-label {
  display: none;
}

.gram-gpt-text-preview-block {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.gram-gpt-text-preview-panel {
  margin-top: 12px;
  flex: 1;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-hover);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 52px;
}

html.theme-dark .gram-gpt-text-preview-panel {
  background: rgba(15, 23, 42, 0.35);
  border-color: var(--gram-border);
}

.gram-gpt-text-preview-panel.is-empty {
  color: var(--text-muted);
  font-style: italic;
}

.gram-module-page .gram-spam-head-sub {
  margin-left: 0;
}

.gram-gpt-window-title-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.gram-spam-text-window .gram-gpt-window-head {
  overflow: visible;
}

.gram-spam-text-window .gram-gpt-window-title-row .gram-info-tip-inline {
  margin-left: 0;
}

.gram-spam-text-window .gram-gpt-window-title-row .gram-info-tip-link {
  padding: 4px;
  line-height: 1;
}

.gram-spam-text-window .gram-gpt-window-title-row .gram-info-tip-pop {
  top: auto;
  bottom: calc(100% + 8px);
  left: 0;
  right: auto;
  transform: translateY(4px);
}

.gram-spam-text-window .gram-info-tip:hover .gram-info-tip-pop,
.gram-spam-text-window .gram-info-tip.is-open .gram-info-tip-pop,
.gram-spam-text-window .gram-info-tip:focus-within .gram-info-tip-pop {
  transform: translateY(0);
}

.gram-spam-text-window .gram-gpt-window-body {
  overflow: visible;
  max-height: none;
}

.gram-spam-text-window .gram-gpt-text-preview-panel {
  flex: 0 1 auto;
  max-height: 200px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 4px;
}

.gram-spam-page .gram-gpt-row-main {
  align-items: start;
}

.gram-spam-text-window .gram-tg-post-preview {
  margin-bottom: 0;
}

.gram-spam-text-window .gram-tg-post-embed-wrap {
  min-height: 0;
  max-height: none;
  overflow: hidden;
  transform: scale(0.88);
  transform-origin: top center;
  margin: 0 auto;
  width: 100%;
}

.gram-spam-text-window .gram-tg-post-embed-wrap iframe {
  display: block;
  margin: 0 auto;
}

.gram-spam-text-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.gram-spam-text-mode {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-hover, #f8fafc);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.gram-spam-text-mode:hover {
  border-color: rgba(59, 130, 246, 0.45);
  background: rgba(59, 130, 246, 0.08);
}

html.theme-dark .gram-spam-text-mode {
  background: rgba(15, 23, 42, 0.45);
}

.gram-spam-attach-strip {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin-top: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  flex-shrink: 0;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}

.gram-spam-attach-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 4px 4px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-hover, #f8fafc);
  font-size: 11px;
  flex: 0 0 auto;
  max-width: 220px;
}

.gram-spam-attach-chip img {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 6px;
}

.gram-spam-attach-chip > i {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.12);
  color: #3b82f6;
  font-size: 14px;
}

.gram-spam-attach-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 140px;
}

.gram-spam-attach-rm {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  line-height: 1;
}

.gram-spam-attach-rm:hover {
  color: #ef4444;
}

.gram-gpt-text-preview-panel .gram-spam-preview-empty {
  color: var(--text-muted);
  font-style: italic;
}

.gram-tg-repost-preview {
  margin-bottom: 10px;
}

.gram-tg-repost-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #38bdf8;
  margin-bottom: 6px;
}

.gram-tg-repost-bar .pi {
  transform: scaleX(-1);
  font-size: 12px;
}

.gram-tg-repost-card {
  border-left: 3px solid #38bdf8;
  padding: 8px 10px;
  border-radius: 0 8px 8px 0;
  background: rgba(56, 189, 248, 0.08);
}

.gram-tg-repost-channel {
  font-weight: 700;
  font-size: 13px;
  color: #38bdf8;
  margin-bottom: 2px;
}

.gram-tg-repost-msg {
  font-size: 12px;
  color: var(--text);
  margin-bottom: 4px;
}

.gram-tg-repost-link {
  font-size: 11px;
  color: var(--text-muted);
  word-break: break-all;
}

.gram-spam-preview-text {
  white-space: pre-wrap;
  word-break: break-word;
}

.gram-spam-preview-attach {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin-top: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}

.gram-spam-preview-attach .gram-spam-preview-media {
  flex: 0 0 auto;
}

.gram-spam-preview-media {
  border-radius: 8px;
  overflow: hidden;
  max-width: 160px;
}

.gram-spam-preview-media img {
  display: block;
  max-width: 160px;
  max-height: 120px;
  object-fit: cover;
}

.gram-spam-preview-media.is-doc {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.04);
  font-size: 12px;
}

html.theme-dark .gram-spam-preview-media.is-doc {
  background: rgba(15, 23, 42, 0.35);
}

.gram-spam-preview-media.is-doc .pi {
  font-size: 18px;
  color: #38bdf8;
}

.gram-spam-text-window .gram-gpt-text-preview-block {
  flex: 0 0 auto;
}

.gram-tg-post-preview {
  margin-bottom: 10px;
}

.gram-tg-post-forward {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #38bdf8;
  margin-bottom: 6px;
}

.gram-tg-post-forward .pi {
  transform: scaleX(-1);
  font-size: 12px;
}

.gram-tg-post-bubble {
  border-left: 3px solid #38bdf8;
  padding: 10px 12px;
  border-radius: 0 10px 10px 0;
  background: rgba(56, 189, 248, 0.08);
}

.gram-tg-post-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.gram-tg-post-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #38bdf8, #2563eb);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.gram-tg-post-name {
  font-weight: 700;
  font-size: 13px;
  color: #38bdf8;
  line-height: 1.2;
}

.gram-tg-post-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.gram-tg-post-link {
  font-size: 12px;
  color: var(--text);
  word-break: break-all;
  text-decoration: none;
}

.gram-tg-post-link:hover {
  text-decoration: underline;
}

.gram-tg-post-text {
  white-space: pre-wrap;
  word-break: break-word;
}

.gram-tg-post-media-row {
  margin-top: 8px;
}

.gram-tg-post-embed-wrap {
  min-height: 72px;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid rgba(56, 189, 248, 0.18);
  background: rgba(56, 189, 248, 0.04);
}

.gram-tg-post-embed-wrap iframe {
  display: block;
  max-width: 100%;
}

.gram-tg-post-embed-loading {
  display: block;
  padding: 14px 12px;
  font-size: 12px;
  color: var(--text-muted, #64748b);
}

html.theme-dark .gram-tg-post-embed-wrap {
  border-color: rgba(56, 189, 248, 0.22);
  background: rgba(15, 23, 42, 0.35);
}

html.theme-dark .gram-spam-page .gram-gpt-window {
  background: #152238;
}

.gram-spam-page #moduleLiveLog.gram-log-panel {
  border-radius: 8px;
  border: 1px solid rgba(71, 100, 150, 0.28);
  background: rgba(8, 12, 22, 0.35);
  overflow: hidden;
}

html.theme-dark .gram-spam-page #moduleLiveLog .gram-log-toolbar,
html.theme-dark .gram-spam-page #moduleLiveLog .gram-log-body,
html.theme-dark .gram-spam-page #moduleLiveLog .gram-log-stream,
html.theme-dark .gram-spam-page #moduleLiveLog .gram-log-footer,
html.theme-dark .gram-spam-page #moduleLiveLog .gram-log-progress-wrap {
  background: #152238 !important;
}

html.theme-dark .gram-spam-page #moduleLiveLog .gram-log-toolbar {
  border-bottom-color: rgba(71, 100, 150, 0.28) !important;
}

html.theme-dark .gram-spam-page #moduleLiveLog .gram-log-footer {
  border-top-color: rgba(71, 100, 150, 0.28) !important;
}

.gram-spam-page #moduleLiveLog .gram-log-line {
  grid-template-columns: 44px 24px minmax(88px, max-content) minmax(0, 1fr);
  column-gap: 10px;
  white-space: normal;
  width: 100%;
  min-width: 0;
}

.gram-spam-page #moduleLiveLog .gram-log-line:has(.gram-log-id.is-empty) {
  grid-template-columns: 44px 24px minmax(0, 1fr);
}

.gram-spam-page #moduleLiveLog .gram-log-mark .gram-log-thread-badge {
  color: #c4b5fd;
  background: rgba(99, 102, 241, 0.28);
  border: 1px solid rgba(129, 140, 248, 0.35);
}

html.theme-dark .gram-spam-page #moduleLiveLog .gram-log-id {
  color: #22d3ee;
}

html.theme-dark .gram-spam-page #moduleLiveLog .gram-log-msg {
  color: #cbd5e1;
}

html.theme-dark .gram-spam-page #moduleLiveLog .gram-log-level-success .gram-log-msg {
  color: #86efac;
}

html.theme-dark .gram-spam-page #moduleLiveLog .gram-log-level-warn .gram-log-msg {
  color: #fcd34d;
}

html.theme-dark .gram-spam-page #moduleLiveLog .gram-log-level-error .gram-log-msg {
  color: #fca5a5;
}

html.theme-dark .gram-spam-page #moduleLiveLog .gram-log-level-info .gram-log-msg {
  color: #94a3b8;
}

html.theme-dark .gram-spam-page #moduleLiveLog .gram-log-icon-warn {
  color: #f59e0b;
}

html.theme-dark .gram-spam-page #moduleLiveLog .gram-log-icon-error {
  color: #f87171;
}

html.theme-dark .gram-spam-page #moduleLiveLog .gram-log-icon-success {
  color: #4ade80;
}

html.theme-dark .gram-spam-page #moduleLiveLog .gram-log-icon-info {
  color: #94a3b8;
}

html.theme-dark .gram-spam-page #moduleLiveLog .gram-log-row-err {
  background: rgba(239, 68, 68, 0.08);
}

html:not(.theme-dark) .gram-spam-page #moduleLiveLog .gram-log-time {
  color: #475569;
}

html:not(.theme-dark) .gram-spam-page #moduleLiveLog .gram-log-id {
  color: #0369a1;
  font-weight: 600;
}

html:not(.theme-dark) .gram-spam-page #moduleLiveLog .gram-log-mark .gram-log-thread-badge {
  color: #5b21b6;
  background: rgba(99, 102, 241, 0.16);
  border: 1px solid rgba(99, 102, 241, 0.38);
}

html:not(.theme-dark) .gram-spam-page #moduleLiveLog .gram-log-msg {
  color: #334155;
}

html:not(.theme-dark) .gram-spam-page #moduleLiveLog .gram-log-level-success .gram-log-msg {
  color: #15803d;
  font-weight: 500;
}

html:not(.theme-dark) .gram-spam-page #moduleLiveLog .gram-log-level-warn .gram-log-msg {
  color: #b45309;
}

html:not(.theme-dark) .gram-spam-page #moduleLiveLog .gram-log-level-error .gram-log-msg {
  color: #b91c1c;
  font-weight: 500;
}

html:not(.theme-dark) .gram-spam-page #moduleLiveLog .gram-log-level-info .gram-log-msg {
  color: #64748b;
}

html:not(.theme-dark) .gram-spam-page #moduleLiveLog .gram-log-icon-error {
  color: #dc2626;
}

html:not(.theme-dark) .gram-spam-page #moduleLiveLog .gram-log-row-err {
  background: rgba(239, 68, 68, 0.06);
}

.gram-spam-page #moduleLiveLog .gram-log-id.is-empty {
  display: none;
}

.gram-spam-page #moduleLiveLog .gram-log-msg {
  white-space: normal;
  word-break: break-word;
}

.gram-spam-page #moduleLiveLog .gram-log-stream {
  max-height: min(42vh, 320px);
}

.gram-spam-results-panel {
  margin-top: 14px;
  border: 1px solid var(--border, rgba(148, 163, 184, 0.45));
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface, #ffffff);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

html.theme-dark .gram-spam-page .gram-spam-results-panel {
  background: #152238;
  border-color: rgba(71, 100, 150, 0.35);
}

.gram-spam-results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border, rgba(148, 163, 184, 0.35));
}

.gram-spam-results-head-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.gram-spam-results-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--text, #0f172a);
}

.gram-spam-results-desc {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--text-muted, #64748b);
}

.gram-spam-results-collapse {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border, rgba(148, 163, 184, 0.45));
  background: var(--surface-hover, #f8fafc);
  color: var(--text-muted, #64748b);
  cursor: pointer;
  flex-shrink: 0;
}

.gram-spam-results-body {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.gram-spam-run-tabs {
  display: flex;
  gap: 6px;
  padding: 8px 14px 0;
  border-bottom: 1px solid var(--border, rgba(148, 163, 184, 0.25));
}

.gram-spam-run-tab {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-muted, #64748b);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.gram-spam-run-tab.active {
  color: var(--text, #0f172a);
  background: var(--surface-hover, #f8fafc);
  border-bottom-color: #2563eb;
}

.gram-spam-run-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
}

.gram-spam-run-tabpanel {
  display: none;
  flex-direction: column;
}

.gram-spam-run-tabpanel.is-active {
  display: flex;
}

html.theme-dark .gram-spam-run-tab {
  color: #94a3b8;
}

html.theme-dark .gram-spam-run-tab.active {
  color: #e2e8f0;
  background: rgba(30, 41, 59, 0.55);
  border-bottom-color: #38bdf8;
}

html.theme-dark .gram-spam-run-tab-badge {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
}

.gram-spam-results-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border, rgba(148, 163, 184, 0.25));
  font-size: 12px;
  color: var(--text-muted, #64748b);
}

.gram-spam-results-summary-text b {
  color: #2563eb;
  font-size: 15px;
}

.gram-spam-results-meta b {
  color: var(--text, #0f172a);
}

.gram-run-stat-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border, rgba(148, 163, 184, 0.25));
}

.gram-run-stat-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--gram-border, var(--border));
  background: color-mix(in srgb, var(--gram-card, var(--surface)) 90%, #0f172a 10%);
  backdrop-filter: blur(8px);
  min-width: 0;
}

.gram-run-stat-copy {
  min-width: 0;
}

.gram-run-stat-copy strong {
  display: block;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text, #0f172a);
}

.gram-run-stat-copy span {
  display: block;
  margin-top: 1px;
  font-size: 10px;
  line-height: 1.25;
  color: var(--text-muted, #64748b);
}

.gram-run-stat-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.gram-run-stat-card.gram-tone-blue .gram-run-stat-icon {
  background: color-mix(in srgb, #3b82f6 20%, transparent);
  color: #60a5fa;
  box-shadow: 0 0 14px color-mix(in srgb, #3b82f6 35%, transparent);
}

.gram-run-stat-card.gram-tone-green .gram-run-stat-icon {
  background: color-mix(in srgb, #22c55e 20%, transparent);
  color: #4ade80;
  box-shadow: 0 0 14px color-mix(in srgb, #22c55e 35%, transparent);
}

.gram-run-stat-card.gram-tone-red .gram-run-stat-icon {
  background: color-mix(in srgb, #ef4444 20%, transparent);
  color: #f87171;
  box-shadow: 0 0 14px color-mix(in srgb, #ef4444 35%, transparent);
}

.gram-run-stat-card.gram-tone-cyan .gram-run-stat-icon {
  background: color-mix(in srgb, #06b6d4 20%, transparent);
  color: #22d3ee;
  box-shadow: 0 0 14px color-mix(in srgb, #06b6d4 35%, transparent);
}

html:not(.theme-dark) .gram-run-stat-card {
  background: #f1f5f9;
  border-color: rgba(148, 163, 184, 0.45);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

html:not(.theme-dark) .gram-run-stat-copy strong {
  color: #0f172a;
}

html:not(.theme-dark) .gram-run-stat-copy span {
  color: #64748b;
}

html:not(.theme-dark) .gram-run-stat-card.gram-tone-blue .gram-run-stat-icon {
  background: color-mix(in srgb, #3b82f6 28%, #fff);
  color: #2563eb;
  box-shadow: none;
}

html:not(.theme-dark) .gram-run-stat-card.gram-tone-green .gram-run-stat-icon {
  background: color-mix(in srgb, #22c55e 28%, #fff);
  color: #16a34a;
  box-shadow: none;
}

html:not(.theme-dark) .gram-run-stat-card.gram-tone-red .gram-run-stat-icon {
  background: color-mix(in srgb, #ef4444 28%, #fff);
  color: #dc2626;
  box-shadow: none;
}

html:not(.theme-dark) .gram-run-stat-card.gram-tone-cyan .gram-run-stat-icon {
  background: color-mix(in srgb, #06b6d4 28%, #fff);
  color: #0891b2;
  box-shadow: none;
}

html.theme-dark .gram-run-stat-card {
  background: color-mix(in srgb, #152238 88%, transparent);
  border-color: rgba(71, 100, 150, 0.32);
}

html.theme-dark .gram-run-stat-copy strong {
  color: #f1f5f9;
}

@media (max-width: 1100px) {
  .gram-run-stat-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .gram-run-stat-cards {
    grid-template-columns: 1fr;
  }
}

.gram-spam-results-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border, rgba(148, 163, 184, 0.25));
}

.gram-spam-results-toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 240px;
  min-width: 0;
}

.gram-spam-results-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 180px;
  min-width: 140px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--border, rgba(148, 163, 184, 0.45));
  background: var(--surface, #fff);
}

.gram-spam-results-search-wrap .pi-search {
  color: var(--text-muted, #64748b);
  font-size: 12px;
}

.gram-spam-results-search {
  flex: 1;
  border: none;
  background: transparent;
  padding: 7px 0;
  font-size: 12px;
  color: var(--text, #0f172a);
  outline: none;
  min-width: 0;
}

.gram-spam-results-select.gram-gpt-custom-select {
  flex: 0 0 auto;
  min-width: 148px;
  max-width: 180px;
}

.gram-spam-results-select .gram-gpt-select-btn {
  padding: 7px 10px;
  font-size: 12px;
  border-radius: 8px;
}

.gram-spam-results-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.gram-spam-results-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 8px;
  border: none;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.gram-spam-results-btn.is-copy {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
}

.gram-spam-results-btn.is-export {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
}

.gram-spam-results-btn:hover {
  filter: brightness(1.06);
}

.gram-spam-results-panel.is-collapsed .gram-spam-results-body {
  display: none !important;
}

.gram-spam-results-panel.is-collapsed .gram-spam-results-head {
  border-bottom: none;
}

.gram-spam-results-list {
  height: auto;
  min-height: 0;
  max-height: 260px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  -webkit-overflow-scrolling: touch;
}

.gram-spam-result-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border, rgba(148, 163, 184, 0.35));
  background: rgba(248, 250, 252, 0.85);
}

html.theme-dark .gram-spam-result-row {
  background: rgba(15, 23, 42, 0.35);
  border-color: rgba(71, 100, 150, 0.3);
}

.gram-spam-result-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(59, 130, 246, 0.12);
  color: #3b82f6;
  font-size: 14px;
}

.gram-spam-result-row.is-ok .gram-spam-result-icon {
  background: rgba(34, 197, 94, 0.12);
  color: #22c55e;
}

.gram-spam-result-row.is-err .gram-spam-result-icon {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

.gram-spam-result-row.is-pending .gram-spam-result-icon {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
}

.gram-spam-result-main {
  min-width: 0;
}

.gram-spam-result-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}

.gram-spam-result-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text, #0f172a);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gram-spam-result-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  color: var(--text-muted, #64748b);
}

.gram-spam-result-row.is-ok .gram-spam-result-badge {
  background: rgba(34, 197, 94, 0.15);
  color: #16a34a;
}

.gram-spam-result-row.is-err .gram-spam-result-badge {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

.gram-spam-result-row.is-pending .gram-spam-result-badge {
  background: rgba(56, 189, 248, 0.12);
  color: #0284c7;
}

.gram-spam-result-msg {
  font-size: 11px;
  color: var(--text-muted, #64748b);
}

.gram-spam-result-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: var(--text-muted, #64748b);
  text-decoration: none;
}

.gram-spam-result-link:hover {
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
}

.gram-spam-result-link.is-disabled {
  opacity: 0.35;
  pointer-events: none;
}

.gram-spam-results-empty {
  padding: 28px 12px;
  text-align: center;
  color: var(--text-muted, #64748b);
  font-size: 12px;
}

.gram-spam-results-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 14px;
  border-top: 1px solid var(--border, rgba(148, 163, 184, 0.25));
  font-size: 11px;
  color: var(--text-muted, #64748b);
}

.gram-spam-results-pager-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.gram-spam-results-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--border, rgba(148, 163, 184, 0.45));
  background: var(--surface-hover, #f8fafc);
  color: var(--text-muted, #64748b);
  cursor: pointer;
}

.gram-spam-results-page-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.gram-spam-results-page-num {
  min-width: 52px;
  text-align: center;
  font-size: 11px;
  color: var(--text-muted, #64748b);
}

.gram-spam-results-page-size {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 4px;
  font-size: 11px;
}

.gram-spam-results-page-size-select {
  border: 1px solid var(--border, rgba(148, 163, 184, 0.45));
  border-radius: 8px;
  background: var(--surface, #fff);
  color: var(--text, #0f172a);
  font: inherit;
  font-size: 11px;
  padding: 4px 6px;
}

html.theme-dark .gram-spam-results-page-btn,
html.theme-dark .gram-spam-results-page-size-select {
  background: rgba(15, 23, 42, 0.45);
  border-color: rgba(71, 100, 150, 0.35);
  color: #e2e8f0;
}

html.theme-dark .gram-spam-results-search-wrap {
  background: rgba(15, 23, 42, 0.45);
  border-color: rgba(71, 100, 150, 0.35);
  color: #e2e8f0;
}

html.theme-dark .gram-spam-results-search {
  color: #e2e8f0;
}

html.theme-dark .gram-spam-results-collapse {
  background: rgba(15, 23, 42, 0.45);
  border-color: rgba(71, 100, 150, 0.35);
  color: #94a3b8;
}

html.theme-dark .gram-spam-result-name {
  color: #e2e8f0;
}

html.theme-dark .gram-spam-results-meta b {
  color: #e2e8f0;
}

.gram-spam-account-stats {
  margin-top: 0;
  padding: 0;
  border: none;
  background: transparent;
}

#spamRunAccountsPanel {
  padding: 12px 14px 14px;
}

#spamRunAccountsPanel .gram-spam-account-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

#spamRunAccountsPanel .gram-spam-account-stat-card {
  flex: none;
  max-width: none;
  background: var(--surface-hover, #f8fafc);
  border: 1px solid var(--border, rgba(148, 163, 184, 0.35));
}

html:not(.theme-dark) #spamRunAccountsPanel .gram-spam-account-stat-card {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

html:not(.theme-dark) #spamRunAccountsPanel .gram-spam-account-stat-card.is-stopped {
  background: #fef2f2;
  border-color: #fecaca;
}

html:not(.theme-dark) #spamRunAccountsPanel .gram-spam-account-stat-card.is-done {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

html.theme-dark #spamRunAccountsPanel .gram-spam-account-stat-card {
  background: rgba(15, 23, 42, 0.35);
  border-color: rgba(71, 100, 150, 0.35);
}

#parsingRunAccountsPanel .gram-parsing-account-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 10px;
  padding: 2px 0 4px;
}

#parsingRunAccountsPanel .gram-spam-account-stat-card {
  flex: none;
  max-width: none;
  min-height: 88px;
  padding: 12px 14px;
  gap: 4px 10px;
  grid-template-rows: auto auto auto;
  background: var(--surface-hover, #f8fafc);
  border: 1px solid var(--border, rgba(148, 163, 184, 0.35));
}

#parsingRunAccountsPanel .gram-spam-account-stat-card .stat-count {
  grid-column: 1;
  grid-row: 2;
}

#parsingRunAccountsPanel .gram-parsing-account-stat-state {
  grid-column: 1 / -1;
  grid-row: 3;
  font-size: 11px;
  line-height: 1.35;
  opacity: 0.88;
  text-align: left;
  word-break: break-word;
}

html:not(.theme-dark) #parsingRunAccountsPanel .gram-spam-account-stat-card {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

html.theme-dark #parsingRunAccountsPanel .gram-spam-account-stat-card {
  background: rgba(15, 23, 42, 0.35);
  border-color: rgba(71, 100, 150, 0.35);
}

.gram-spam-account-stats-empty {
  padding: 24px 12px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted, #64748b);
}

#spamRunAccountsPanel .gram-spam-account-stats-note {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.22);
  color: var(--text, #334155);
}

.gram-spam-account-stats {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--gram-border, rgba(148, 163, 184, 0.2));
  background: var(--gram-card-bg, rgba(15, 23, 42, 0.35));
}

.gram-spam-account-stats-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.gram-spam-account-stats-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.gram-spam-account-stats-desc {
  margin: 2px 0 0;
  font-size: 12px;
  opacity: 0.75;
}

.gram-spam-account-stats-note {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.45;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.gram-spam-account-stats-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gram-spam-account-stat-card {
  flex: 1 1 132px;
  max-width: 180px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(2, 6, 23, 0.25);
  font-size: 12px;
  line-height: 1.35;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 2px 8px;
  align-items: center;
}

.gram-spam-account-stat-card.is-stopped {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.08);
}

.gram-spam-account-stat-card.is-done {
  border-color: rgba(34, 197, 94, 0.4);
}

.gram-spam-account-stat-card b {
  grid-column: 1 / -1;
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 0;
  letter-spacing: 0.01em;
}

.gram-spam-account-stat-card .stat-count {
  grid-column: 1;
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.gram-spam-account-stat-card > span:last-child {
  grid-column: 2;
  grid-row: 2;
  font-size: 11px;
  opacity: 0.85;
  text-align: right;
}

.journal-refreshing {
  opacity: 0.92;
}

.journal-table-skeleton {
  margin-top: 12px;
  opacity: 0.35;
}

.journal-skeleton-bar {
  display: block;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.15), rgba(148, 163, 184, 0.28), rgba(148, 163, 184, 0.15));
}

.gram-gpt-row-main .gram-field-wrap:first-child {
  display: flex;
  flex-direction: column;
}

.gram-gpt-row-main .gram-field-wide {
  display: flex;
  flex-direction: column;
}

.gram-gpt-row-main .gram-field-wide .settings-textarea,
.gram-gpt-row-main .gram-field-wide .gram-input {
  min-height: 120px;
  max-height: 120px;
  height: 120px;
  resize: none;
}

.gram-gpt-dist {
  margin-top: 14px;
  flex-shrink: 0;
}

.gram-gpt-window {
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 16px;
  background: #ffffff;
  overflow: hidden;
  box-shadow: 0 2px 16px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.02);
}

html.theme-dark .gram-gpt-window {
  background: var(--gram-card, #1a2332);
  border-color: var(--gram-border, rgba(71, 100, 150, 0.28));
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.22);
}

.gram-gpt-window-flat .gram-gpt-window-head { display: none; }
.gram-gpt-window-flat .gram-gpt-window-body { padding: 14px 18px; }

.gram-gpt-window-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(241, 245, 249, 0.95);
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.95) 0%, rgba(255, 255, 255, 0) 100%);
}

html.theme-dark .gram-gpt-window-head {
  background: rgba(34, 211, 238, 0.05);
  border-bottom-color: var(--gram-border, rgba(71, 100, 150, 0.28));
}

.gram-gpt-window-head .live-log-badge { margin-left: auto; }

.gram-gpt-window-title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--text);
}

.gram-gpt-window-body { padding: 16px 18px 18px; }

.gram-gpt-chip {
  margin-left: auto;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
  border: 1px solid rgba(37, 99, 235, 0.18);
}

html.theme-dark .gram-gpt-chip {
  background: rgba(34, 211, 238, 0.12);
  color: var(--primary-cyan);
  border-color: rgba(34, 211, 238, 0.28);
}

.gram-gpt-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(59, 130, 246, 0.2);
  background: rgba(59, 130, 246, 0.06);
  font-size: 13px;
  color: var(--text-muted);
}

html.theme-dark .gram-gpt-notice {
  background: rgba(34, 211, 238, 0.06);
  border-color: rgba(34, 211, 238, 0.2);
}

.gram-gpt-notice i { color: var(--primary); margin-top: 2px; }
html.theme-dark .gram-gpt-notice i { color: var(--primary-cyan); }

.gram-gpt-templates {
  width: 100%;
}

.gram-gpt-tpl-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 24px;
}

.gram-gpt-tpl-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.gram-gpt-tpl-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.gram-gpt-tpl-controls .gram-gpt-custom-select {
  flex: 1;
  min-width: 0;
  max-width: none;
}

.gram-gpt-tpl-controls .gram-gpt-input {
  flex: 1;
  min-width: 0;
}

.gram-gpt-tpl-controls .gram-gpt-btn {
  flex-shrink: 0;
}

.gram-gpt-tpl-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 220px;
}

.gram-gpt-tpl-row .gram-gpt-btn,
.gram-gpt-tpl-row .gram-gpt-select,
.gram-gpt-tpl-row .gram-gpt-input {
  flex: 0 1 auto;
  min-height: 40px;
}

.gram-gpt-tpl-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.gram-gpt-tpl-sep {
  width: 1px;
  height: 28px;
  background: var(--border);
  flex-shrink: 0;
}

.gram-gpt-select,
.gram-gpt-input {
  flex: 1;
  min-width: 140px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: #f8fafc;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

html.theme-dark .gram-gpt-select,
html.theme-dark .gram-gpt-input {
  background: #152238;
  border-color: var(--gram-border);
}

.gram-gpt-select:focus,
.gram-gpt-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

html.theme-dark .gram-gpt-select:focus,
html.theme-dark .gram-gpt-input:focus {
  border-color: var(--primary-cyan);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
}

.gram-gpt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  border: none;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: filter 0.15s, transform 0.1s, box-shadow 0.15s;
  white-space: nowrap;
}

.gram-gpt-btn:active { transform: scale(0.98); }
.gram-gpt-btn:disabled { opacity: 0.55; cursor: not-allowed; }

.gram-gpt-btn-soft {
  background: #f1f5f9;
  color: var(--text);
  border: 1px solid rgba(226, 232, 240, 0.95);
}

html.theme-dark .gram-gpt-btn-soft {
  background: #152238;
  border-color: var(--gram-border);
  color: var(--text);
}

.gram-gpt-btn-soft:hover { background: #e2e8f0; }
html.theme-dark .gram-gpt-btn-soft:hover { background: #1a2a42; }

.gram-gpt-btn-primary {
  background: linear-gradient(135deg, #22d3ee, #2563eb);
  color: #fff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28);
}

.gram-gpt-btn-success {
  background: linear-gradient(135deg, #34d399, #059669);
  color: #fff;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.25);
}

.gram-gpt-btn-danger {
  background: linear-gradient(135deg, #f87171, #dc2626);
  color: #fff;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.22);
}

.gram-gpt-btn-purple {
  background: linear-gradient(135deg, #a78bfa, #7c3aed);
  color: #fff;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.25);
}

.gram-gpt-btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px dashed rgba(148, 163, 184, 0.55);
}

.gram-gpt-btn-ghost:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(59, 130, 246, 0.05);
}

.gram-gpt-btn-primary:hover,
.gram-gpt-btn-success:hover,
.gram-gpt-btn-danger:hover,
.gram-gpt-btn-purple:hover { filter: brightness(1.06); }

.gram-gpt-action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

html.theme-dark .gram-gpt-action-bar {
  background: var(--gram-card);
  border-color: var(--gram-border);
}

.gram-gpt-param-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

.gram-gpt-param-grid-compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 12px;
}

.gram-gpt-param-card {
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: #f8fafc;
  transition: border-color 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
  min-height: 108px;
}

html.theme-dark .gram-gpt-param-card {
  background: rgba(15, 23, 42, 0.35);
  border-color: var(--gram-border);
}

.gram-gpt-param-card:focus-within {
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

html.theme-dark .gram-gpt-param-card:focus-within {
  border-color: rgba(34, 211, 238, 0.35);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.08);
}

.gram-gpt-param-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.gram-gpt-param-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}

.gram-gpt-param-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1.35;
  min-height: 2.7em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gram-gpt-param-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: #ffffff;
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  margin-top: auto;
}

html.theme-dark .gram-gpt-param-input {
  background: #152238;
  border-color: var(--gram-border);
}

.gram-gpt-param-input:focus {
  outline: none;
  border-color: var(--primary);
}

html.theme-dark .gram-gpt-param-input:focus {
  border-color: var(--primary-cyan);
}

.gram-gpt-pill-stack { margin-bottom: 14px; }
.gram-gpt-pill-field { margin-bottom: 12px; }

.gram-gpt-field-title {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.gram-gpt-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gram-gpt-pill {
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: #ffffff;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}

html.theme-dark .gram-gpt-pill {
  background: #152238;
  border-color: var(--gram-border);
}

.gram-gpt-pill:hover:not(.active) {
  border-color: var(--primary);
  color: var(--text);
}

.gram-gpt-pill.active {
  background: linear-gradient(135deg, #22d3ee, #2563eb);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28);
}

.gram-gpt-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}

.gram-gpt-options-extra {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 4px;
}

.gram-gpt-options-extra .gram-gpt-param-card {
  height: 100%;
}

.gram-spam-options-extra {
  align-items: start;
}

.gram-spam-autoreply-fields {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(56, 189, 248, 0.18);
  background: rgba(15, 23, 42, 0.22);
}

html.theme-light .gram-spam-autoreply-fields,
html:not(.theme-dark) .gram-spam-autoreply-fields {
  background: #f8fafc;
  border-color: rgba(148, 163, 184, 0.45);
}

.gram-gpt-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: #f8fafc;
  cursor: pointer;
  margin: 0;
  transition: border-color 0.15s, background 0.15s;
}

html.theme-dark .gram-gpt-toggle {
  background: rgba(15, 23, 42, 0.35);
  border-color: var(--gram-border);
}

.gram-gpt-toggle:has(input:checked) {
  border-color: rgba(37, 99, 235, 0.35);
  background: rgba(37, 99, 235, 0.06);
}

html.theme-dark .gram-gpt-toggle:has(input:checked) {
  border-color: rgba(34, 211, 238, 0.35);
  background: rgba(34, 211, 238, 0.08);
}

.gram-gpt-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }

.gram-gpt-toggle-track {
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: #cbd5e1;
  position: relative;
  flex-shrink: 0;
  transition: background 0.2s;
}

.gram-gpt-toggle:has(input:checked) .gram-gpt-toggle-track {
  background: linear-gradient(135deg, #22d3ee, #2563eb);
}

.gram-gpt-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s;
}

.gram-gpt-toggle:has(input:checked) .gram-gpt-toggle-thumb {
  transform: translateX(18px);
}

.gram-gpt-toggle-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.35;
}

.gram-gpt-layout .gram-field-label {
  text-transform: none;
  letter-spacing: normal;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.gram-gpt-layout .gram-field-wide { height: 100%; display: flex; flex-direction: column; }
.gram-gpt-layout .gram-field-wide .gram-input,
.gram-gpt-layout .gram-field-wide .settings-textarea {
  min-height: 120px;
  max-height: 120px;
  height: 120px;
  resize: none;
  border-radius: 12px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: #f8fafc;
  font-size: 13px;
  line-height: 1.5;
  padding: 12px 14px;
}

html.theme-dark .gram-gpt-layout .gram-field-wide .gram-input,
html.theme-dark .gram-gpt-layout .gram-field-wide .settings-textarea {
  background: #152238;
  border-color: var(--gram-border);
}

.gram-gpt-layout .gram-textarea-tall { min-height: 200px; }

.gram-gpt-layout .gram-gpt-misc-body .gram-fields-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.gram-gpt-dist {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed rgba(148, 163, 184, 0.45);
}

.gram-gpt-dist-hint {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
}

.gram-gpt-dist-grid { margin-top: 12px; }

.gram-gpt-dist {
  min-width: 0;
  max-width: 100%;
}

.gram-gpt-window-overflow {
  overflow: visible;
}

.gram-gpt-window-overflow .gram-gpt-window-body {
  overflow: visible;
}

.gram-gpt-select-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

.gram-gpt-log {
  min-height: 140px;
  border-radius: 10px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: #f8fafc;
}

html.theme-dark .gram-gpt-log {
  background: #0f1419;
  border-color: var(--gram-border);
}

@media (max-width: 1100px) {
  .gram-gpt-param-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
  .gram-gpt-layout .gram-gpt-row-2 { grid-template-columns: 1fr; }
  .gram-gpt-row-main .gram-gpt-window { min-height: 0; }
}

@media (max-width: 720px) {
  .gram-gpt-param-grid,
  .gram-gpt-options-extra,
  .gram-gpt-options,
  .gram-gpt-layout .gram-gpt-misc-body .gram-fields-grid,
  .gram-gpt-tpl-grid {
    grid-template-columns: 1fr;
  }
  .gram-gpt-tpl-sep { display: none; }
  .gram-gpt-action-bar .gram-gpt-btn { flex: 1; min-width: 100%; }
  .gram-gpt-row-main .gram-field-wide .settings-textarea,
  .gram-gpt-row-main .gram-field-wide .gram-input {
    min-height: 160px;
    max-height: 160px;
  }
}

/* Выбор аккаунтов */
.gram-gpt-accounts-bar .gram-gpt-window-body { padding: 16px 18px; }

.gram-gpt-accounts-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.gram-gpt-accounts-title { flex: 1; min-width: 200px; }

.gram-gpt-accounts-heading {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.gram-gpt-accounts-sub {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.gram-gpt-accounts-actions {
  display: flex;
  gap: 6px;
}

.gram-gpt-btn-xs {
  padding: 6px 12px;
  font-size: 12px;
}

.gram-gpt-accounts-summary {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.45;
}

.gram-gpt-accounts-summary[hidden] {
  display: none !important;
}

.gram-gpt-accounts-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35em;
  height: 1.35em;
  padding: 0 5px;
  margin-left: 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  background: rgba(255, 255, 255, 0.28);
  color: #fff;
}

.gram-gpt-accounts-count[hidden] {
  display: none !important;
}

.gram-gpt-run-slot {
  display: contents;
}

#panelLaunchBtn[hidden],
#panelCancelBtn[hidden],
.gram-gpt-run-slot #panelLaunchBtn[hidden],
.gram-gpt-run-slot #panelCancelBtn[hidden] {
  display: none !important;
}

.gram-gpt-accounts-summary strong {
  color: var(--text);
  font-weight: 700;
}

.gram-gpt-accounts-warn {
  color: #d97706;
}

html.theme-dark .gram-gpt-accounts-warn {
  color: #fbbf24;
}

/* Модалка выбора аккаунтов (две колонки) */
.panel-modal-card.gram-modal-picker {
  width: min(960px, calc(100vw - 24px));
  max-width: 960px;
}

.panel-modal-card.gram-modal-picker .panel-modal-body {
  padding: 16px 18px 12px;
  max-height: min(78vh, 720px);
  overflow: auto;
}

.gram-apick-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.gram-apick-search {
  flex: 1 1 220px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--border, rgba(148, 163, 184, 0.35));
  background: var(--surface-2, rgba(15, 23, 42, 0.35));
  min-height: 40px;
}

.gram-apick-search i { color: var(--text-muted); font-size: 13px; }

.gram-apick-search-input {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  outline: none;
  min-width: 0;
}

.gram-apick-select {
  flex: 0 1 160px;
  min-width: 130px;
  max-width: 200px;
}

.gram-apick-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.gram-apick-btn-sm {
  padding: 7px 12px;
  font-size: 12px;
}

.gram-apick-btn-xs {
  padding: 5px 10px;
  font-size: 11px;
  margin-left: auto;
}

.gram-apick-range {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 10px;
  border: 1px solid var(--border, rgba(148, 163, 184, 0.25));
  background: var(--surface-2, rgba(15, 23, 42, 0.2));
}

.gram-apick-range-label,
.gram-apick-range-input {
  font-size: 12px;
}

.gram-apick-range-input {
  width: 42px;
  padding: 5px 6px;
  border-radius: 8px;
  border: 1px solid var(--border, rgba(148, 163, 184, 0.3));
  background: var(--surface, rgba(255, 255, 255, 0.04));
  color: var(--text);
  text-align: center;
}

.gram-apick-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.gram-apick-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}

.gram-apick-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  min-height: 280px;
}

@media (max-width: 720px) {
  .gram-apick-columns { grid-template-columns: 1fr; }
}

.gram-apick-col {
  display: flex;
  flex-direction: column;
  min-height: 260px;
  border-radius: 12px;
  border: 1px solid var(--border, rgba(148, 163, 184, 0.28));
  background: var(--surface, rgba(15, 23, 42, 0.25));
  overflow: hidden;
}

.gram-apick-col-selected {
  border-color: rgba(34, 211, 238, 0.35);
  box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.08);
}

.gram-apick-col-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border, rgba(148, 163, 184, 0.2));
  background: rgba(15, 23, 42, 0.15);
}

.gram-apick-col-head h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.gram-apick-col-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(148, 163, 184, 0.2);
  color: var(--text-muted);
}

.gram-apick-col-count-on {
  background: rgba(34, 211, 238, 0.2);
  color: #22d3ee;
}

.gram-apick-list {
  flex: 1;
  overflow: auto;
  padding: 8px;
  max-height: min(42vh, 360px);
}

.gram-apick-empty {
  padding: 32px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

.gram-apick-group { margin-bottom: 10px; }

.gram-apick-group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  padding: 0 4px;
}

.gram-apick-geo-flag {
  width: 20px;
  line-height: 1;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.28);
  flex-shrink: 0;
}

.gram-apick-geo-unknown {
  width: 20px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-muted);
  font-size: 9px;
}

.gram-apick-geo-opt {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.gram-apick-select .gram-gpt-select-label .gram-apick-geo-opt,
.gram-apick-select .gram-gpt-select-item .gram-apick-geo-opt {
  min-width: 0;
}

.gram-apick-group-geo {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #22d3ee;
}

.gram-apick-group-count {
  font-size: 11px;
  color: var(--text-muted);
}

.gram-apick-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  margin-bottom: 6px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.gram-apick-card:hover {
  border-color: rgba(34, 211, 238, 0.25);
  background: rgba(34, 211, 238, 0.06);
}

.gram-apick-card.is-busy { opacity: 0.72; }
.gram-apick-busy-section { margin-top: 12px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,0.08); }
.gram-apick-busy-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 12px; color: #fbbf24; opacity: 0.9; }
.gram-apick-arrow-disabled { display: inline-flex; align-items: center; justify-content: center; width: 36px; color: #fbbf24; opacity: 0.85; }

.gram-apick-card-main { flex: 1; min-width: 0; }

.gram-apick-card-top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
}

.gram-apick-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.gram-apick-user {
  font-size: 12px;
  color: var(--text-muted);
}

.gram-apick-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.gram-apick-phone {
  font-size: 11px;
  color: var(--text-muted);
}

.gram-apick-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
}

.gram-apick-pill-geo {
  background: rgba(34, 211, 238, 0.12);
  color: #22d3ee;
}

.gram-apick-role {
  background: color-mix(in srgb, var(--role-color, #3b82f6) 18%, transparent);
  color: var(--role-color, #3b82f6);
}

.gram-apick-arrow {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: rgba(34, 211, 238, 0.12);
  color: #22d3ee;
  cursor: pointer;
}

.gram-apick-arrow:hover { background: rgba(34, 211, 238, 0.22); }

html.theme-light .gram-apick-col {
  background: #eef2f7;
  border-color: rgba(148, 163, 184, 0.55);
}

html.theme-light .gram-apick-col-head {
  background: #e2e8f0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.45);
}

html.theme-light .gram-apick-list {
  background: #f8fafc;
}

html.theme-light .gram-apick-card {
  background: #fff;
  border-color: rgba(148, 163, 184, 0.5);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

html.theme-light .gram-apick-card:hover {
  border-color: rgba(59, 130, 246, 0.45);
  background: #fff;
}

html:not(.theme-dark) .gram-apick-col {
  background: #eef2f7;
  border-color: rgba(148, 163, 184, 0.55);
}

html:not(.theme-dark) .gram-apick-col-head {
  background: #e2e8f0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.45);
}

html:not(.theme-dark) .gram-apick-list {
  background: #f8fafc;
}

html:not(.theme-dark) .gram-apick-card {
  background: #fff;
  border-color: rgba(148, 163, 184, 0.5);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

html:not(.theme-dark) .gram-apick-card:hover {
  border-color: rgba(59, 130, 246, 0.45);
}

html.theme-light .gram-apick-search,
html:not(.theme-dark) .gram-apick-search {
  background: #fff;
  border-color: rgba(148, 163, 184, 0.55);
}

html.theme-light .gram-apick-search-input,
html:not(.theme-dark) .gram-apick-search-input {
  color: #0f172a;
}

html.theme-light .gram-apick-search-input::placeholder,
html:not(.theme-dark) .gram-apick-search-input::placeholder {
  color: #94a3b8;
}

html.theme-light .gram-apick-search i,
html:not(.theme-dark) .gram-apick-search i {
  color: #64748b;
}

html.theme-light .gram-apick-select.gram-gpt-custom-select,
html:not(.theme-dark) .gram-apick-select.gram-gpt-custom-select {
  background: #fff;
  border-color: rgba(148, 163, 184, 0.55);
}

html.theme-light .gram-apick-range,
html:not(.theme-dark) .gram-apick-range {
  background: #fff;
  border-color: rgba(148, 163, 184, 0.45);
}

html.theme-light .gram-apick-range-input,
html:not(.theme-dark) .gram-apick-range-input {
  background: #f8fafc;
  border-color: rgba(148, 163, 184, 0.45);
  color: #0f172a;
}

html.theme-dark .gram-apick-col {
  background: #152238;
  border-color: rgba(56, 189, 248, 0.24);
}

html.theme-dark .gram-apick-col-head {
  background: rgba(10, 18, 32, 0.55);
  border-bottom-color: rgba(56, 189, 248, 0.18);
}

html.theme-dark .gram-apick-search {
  background: #152238;
  border-color: rgba(56, 189, 248, 0.2);
}

html.theme-dark .gram-apick-range {
  background: #152238;
  border-color: rgba(56, 189, 248, 0.2);
}

html.theme-dark .gram-apick-range-input {
  background: rgba(10, 18, 32, 0.65);
  border-color: rgba(56, 189, 248, 0.18);
}

/* Кастомный select шаблонов */
.gram-gpt-custom-select {
  position: relative;
  flex: 1;
  min-width: 160px;
  max-width: 280px;
}

.gram-gpt-select-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: #f8fafc;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, box-shadow 0.15s;
}

html.theme-dark .gram-gpt-select-btn {
  background: #152238;
  border-color: var(--gram-border);
}

.gram-gpt-select-btn:hover,
.gram-gpt-select-btn[aria-expanded="true"] {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

html.theme-dark .gram-gpt-select-btn:hover,
html.theme-dark .gram-gpt-select-btn[aria-expanded="true"] {
  border-color: var(--primary-cyan);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.1);
}

.gram-gpt-select-btn i {
  font-size: 11px;
  color: var(--text-muted);
  transition: transform 0.15s;
}

.gram-gpt-select-btn[aria-expanded="true"] i {
  transform: rotate(180deg);
}

.gram-gpt-select-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 50;
  margin: 0;
  padding: 6px;
  list-style: none;
  border-radius: 12px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: #ffffff;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
  max-height: 220px;
  overflow-y: auto;
}

html.theme-dark .gram-gpt-select-menu {
  background: var(--gram-card);
  border-color: var(--gram-border);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.gram-gpt-select-item {
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  transition: background 0.12s;
}

.gram-gpt-select-item:hover {
  background: rgba(59, 130, 246, 0.08);
}

.gram-gpt-select-item.active {
  background: rgba(37, 99, 235, 0.12);
  font-weight: 600;
  color: var(--primary);
}

html.theme-dark .gram-gpt-select-item.active {
  background: rgba(34, 211, 238, 0.12);
  color: var(--primary-cyan);
}

.gram-gpt-select-item-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 4px 4px 0;
  cursor: default;
}

.gram-gpt-select-item-row:hover {
  background: transparent;
}

.gram-gpt-select-item-row.active {
  background: rgba(37, 99, 235, 0.08);
}

html.theme-dark .gram-gpt-select-item-row.active {
  background: rgba(34, 211, 238, 0.08);
}

.gram-gpt-select-item-pick {
  flex: 1;
  min-width: 0;
  padding: 7px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.gram-gpt-select-item-pick:hover {
  background: rgba(59, 130, 246, 0.08);
}

.gram-gpt-select-item-row.active .gram-gpt-select-item-pick {
  font-weight: 600;
  color: var(--primary);
}

.gram-gpt-select-item-del {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted, #94a3b8);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.gram-gpt-select-item-del:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.gram-picker-table-wrap {
  max-height: 360px;
  overflow: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.gram-picker-table th,
.gram-picker-table td {
  padding: 10px 12px;
  font-size: 13px;
}

.gram-gpt-text-source-wrap {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.gram-gpt-text-card .gram-gpt-window-head .gram-gpt-btn {
  margin-left: auto;
}

.gram-gpt-text-preview {
  margin: 0;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: #f8fafc;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 120px;
  overflow: auto;
}

html.theme-dark .gram-gpt-text-preview {
  background: #152238;
  border-color: var(--gram-border);
}

.gram-gpt-text-preview.is-empty {
  color: var(--text-muted);
  font-style: italic;
}

.gram-gpt-modal-textarea {
  width: 100%;
  min-height: 280px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: #f8fafc;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.55;
  resize: vertical;
}

html.theme-dark .gram-gpt-modal-textarea {
  background: #152238;
  border-color: var(--gram-border);
}

.gram-gpt-modal-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.gram-search-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 4px 4px 12px;
  border: 1px solid var(--border, rgba(148, 163, 184, 0.35));
  border-radius: 12px;
  background: var(--surface-hover, #f8fafc);
}
html.theme-dark .gram-search-row {
  border-color: var(--gram-border, #2a3548);
  background: #152238;
}
.gram-search-row .gram-input { border: none; background: transparent; flex: 1; box-shadow: none; min-height: 0; padding: 8px 0; }
.gram-search-row .pi-search { color: var(--muted, #94a3b8); flex-shrink: 0; }
.gram-search-row .sc-inline-run {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  margin: 0;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sc-donor-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin: 10px 0;
  border-radius: 12px;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.15);
}
.sc-donor-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
}
.sc-stories-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 12px 0 8px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.sc-stories-actions { display: flex; gap: 6px; align-items: center; position: relative; z-index: 2; }
.sc-link-btn {
  border: none;
  background: none;
  color: var(--primary-cyan, #00b8ff);
  cursor: pointer;
  font-size: 12px;
  padding: 4px 2px;
  text-decoration: none;
}
.sc-link-btn:hover { text-decoration: underline; color: #38bdf8; }
.sc-stories-hint { margin: 0 0 14px; line-height: 1.45; }
.sc-repost-hint { margin: 10px 0 14px; line-height: 1.45; }
.sc-opt-hint { margin: -4px 0 8px 28px; font-size: 12px; }
.sc-load-block { margin-top: 12px; }
.sc-load-label { display: block; margin-bottom: 8px; font-size: 13px; color: var(--muted, #94a3b8); }
.sc-donor-pick-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border, rgba(148, 163, 184, 0.35));
  background: var(--surface-hover, #f8fafc);
}
html.theme-dark .sc-donor-pick-card {
  border-color: var(--gram-border, #2a3548);
  background: #152238;
}
.sc-donor-pick-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sc-donor-pick-meta b { font-size: 14px; }
.sc-donor-pick-ph {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #e2e8f0;
  color: #64748b;
}
html.theme-dark .sc-donor-pick-ph {
  background: #1e293b;
  color: #94a3b8;
}
.sc-donor-pick-btn { width: 100%; margin-top: 10px; }
html.theme-dark .gram-apick--compact .gram-apick-search,
html.theme-dark .gram-apick--compact .gram-apick-select,
html.theme-dark .gram-apick--compact .gram-apick-col,
html.theme-dark .gram-apick--compact .gram-apick-col-head {
  background: #152238;
  border-color: #2a3548;
}
html.theme-dark .gram-apick--compact .gram-apick-search {
  border: 1px solid #2a3548;
}
.sc-stories-grid {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
}
.sc-story-card {
  position: relative;
  flex: 0 0 92px;
  width: 92px;
  height: 148px;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid transparent;
  padding: 0;
  cursor: pointer;
  background: #1a2233;
}
.sc-story-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sc-story-ph {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 28px;
  color: #94a3b8;
  background: linear-gradient(160deg, #1e293b, #0f172a);
}
.sc-story-card.selected { border-color: #ec4899; box-shadow: 0 0 0 1px #ec4899; }
.sc-story-check {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ec4899;
  color: #fff;
  display: none;
  place-items: center;
  font-size: 11px;
}
.sc-story-card.selected .sc-story-check { display: grid; }
.sc-story-opts { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.sc-story-opt { font-size: 13px; }

.ps-stories-sheet {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ps-stories-drop {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px dashed rgba(148, 163, 184, 0.45);
  background: linear-gradient(135deg, rgba(148, 163, 184, 0.08), rgba(100, 116, 139, 0.06));
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

html.theme-dark .ps-stories-drop {
  border-color: rgba(148, 163, 184, 0.28);
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.85), rgba(51, 65, 85, 0.55));
}

.ps-stories-drop:hover,
.ps-stories-drop.is-drag {
  border-color: rgba(139, 92, 246, 0.55);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}

.ps-stories-drop-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  color: #fff;
  font-size: 20px;
  flex-shrink: 0;
}

.ps-stories-drop-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.ps-stories-drop-meta b { font-size: 14px; }
.ps-stories-drop-meta span { font-size: 12px; color: var(--muted); }

.ps-stories-empty {
  margin: 0;
  padding: 20px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  border-radius: 12px;
  background: rgba(148, 163, 184, 0.08);
}

.ps-stories-empty i {
  display: block;
  font-size: 22px;
  margin-bottom: 8px;
  opacity: 0.65;
}

.ps-stories-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.ps-stories-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 0 8px;
  scrollbar-width: thin;
}

.ps-story-card {
  position: relative;
  flex: 0 0 56px;
  width: 56px;
  height: 84px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: #1a2233;
}

.ps-story-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ps-story-ph {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 16px;
  color: #94a3b8;
  background: linear-gradient(160deg, #1e293b, #0f172a);
}

.ps-story-rm {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.82);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 9px;
  line-height: 1;
}

.ps-story-rm:hover { background: rgba(239, 68, 68, 0.92); }

html.theme-dark .settings-check {
  background: rgba(30, 41, 59, 0.55);
  border-color: rgba(148, 163, 184, 0.22);
  color: #e2e8f0;
}

html.theme-dark .settings-check span {
  color: #e2e8f0;
}

.ps-pin-opt span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ps-pin-opt .pi-bookmark {
  color: #8b5cf6;
  font-size: 14px;
}

.ps-dist-seg { margin-top: 4px; }
.ps-dist-hint { margin: -4px 0 0; }

.sc-success-wrap { text-align: center; padding: 8px 0 4px; }
.sc-success-badge-big {
  width: 72px;
  height: 72px;
  margin: 0 auto 12px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  font-size: 36px;
}
.sc-success-count {
  font-size: 28px;
  font-weight: 800;
  color: #22c55e;
  margin-bottom: 14px;
}
.sc-success-count span { font-size: 14px; font-weight: 600; color: var(--muted); margin-left: 4px; }
.sc-success-list { text-align: left; max-height: 240px; overflow: auto; }
.sc-success-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(34, 197, 94, 0.08);
  margin-bottom: 6px;
}
.sc-success-row.sc-success-fail { background: rgba(239, 68, 68, 0.08); }
.sc-success-icon { color: #22c55e; font-size: 18px; }
.sc-success-fail .sc-success-icon { color: #ef4444; }
.sc-success-name { flex: 1; font-weight: 600; font-size: 14px; }
.sc-success-stories { color: var(--muted); font-size: 13px; }


.gram-market-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}
.gram-market-item .gram-market-features {
  list-style: none;
  margin: 0 0 12px;
  padding: 0 0 0 4px;
  font-size: 13px;
  color: var(--muted);
}
.gram-market-item .gram-market-features li { margin-bottom: 4px; }
.gram-market-pay {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* —— Маркетплейс —— */
.gram-mkt-page {
  max-width: 1200px;
}

.gram-mkt-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.gram-mkt-section .gram-gpt-window-body {
  padding-top: 10px;
}

.gram-mkt-sec-desc {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.45;
}

.gram-mkt-stub {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  white-space: pre-line;
}

.gram-mkt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.gram-mkt-product {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--gram-border, var(--border));
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  min-height: 100%;
}

.gram-mkt-product.is-popular {
  border-color: color-mix(in srgb, #8b5cf6 45%, var(--gram-border, var(--border)));
  box-shadow: 0 0 0 1px color-mix(in srgb, #8b5cf6 12%, transparent);
}

.gram-mkt-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: color-mix(in srgb, #8b5cf6 18%, transparent);
  color: #a78bfa;
  border: 1px solid color-mix(in srgb, #8b5cf6 35%, transparent);
}

.gram-mkt-product-head {
  padding-right: 72px;
}

.gram-mkt-product-emoji,
.gram-mkt-product-icon.gram-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-bottom: 8px;
  font-size: 16px;
  border-radius: 10px;
}

.gram-mkt-section .gram-gpt-window-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gram-mkt-section .gram-gpt-window-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.gram-mkt-product-title {
  margin: 0 0 2px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
}

.gram-mkt-product-period {
  margin: 0;
  font-size: 11px;
  color: var(--text-muted);
}

.gram-mkt-product-price strong {
  display: block;
  font-size: 22px;
  line-height: 1.1;
}

.gram-mkt-product-price span {
  font-size: 12px;
  color: var(--text-muted);
}

.gram-mkt-features {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
}

.gram-mkt-features li {
  margin-bottom: 4px;
  padding-left: 12px;
  position: relative;
}

.gram-mkt-features li::before {
  content: "·";
  position: absolute;
  left: 0;
  color: color-mix(in srgb, var(--text-muted) 70%, transparent);
}

.gram-mkt-pay {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 4px;
}

.gram-mkt-pay .gram-gpt-btn {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12px;
  padding: 6px 8px;
}

.gram-mkt-buy-ai {
  width: 100%;
  margin-top: auto;
}

.gram-mkt-empty {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

/* Rocket Market — glass / glow (как масслукинг) */
.gram-mkt-page.gram-mkt-glass .gram-gpt-window {
  border: 1px solid rgba(71, 100, 150, 0.32);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.06),
    0 8px 32px rgba(2, 8, 23, 0.18);
  overflow: visible;
}

html.theme-dark .gram-mkt-page.gram-mkt-glass .gram-gpt-window {
  background: #152238;
  border-color: rgba(56, 189, 248, 0.24);
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.1),
    0 8px 28px rgba(0, 0, 0, 0.35),
    0 0 24px rgba(56, 189, 248, 0.05);
}

html:not(.theme-dark) .gram-mkt-page.gram-mkt-glass .gram-gpt-window {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(148, 163, 184, 0.35);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.85),
    0 8px 32px rgba(15, 23, 42, 0.08),
    0 0 20px rgba(56, 189, 248, 0.06);
}

.gram-mkt-page.gram-mkt-glass .gram-gpt-window-head {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.1) 0%, rgba(15, 23, 42, 0.02) 100%);
  border-bottom-color: rgba(56, 189, 248, 0.16);
}

html:not(.theme-dark) .gram-mkt-page.gram-mkt-glass .gram-gpt-window-head {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.08) 0%, rgba(255, 255, 255, 0.45) 100%);
  border-bottom-color: rgba(148, 163, 184, 0.3);
}

.gram-mkt-page.gram-mkt-glass .gram-mkt-product {
  background: rgba(21, 34, 56, 0.55);
  border-color: rgba(56, 189, 248, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow:
    inset 0 1px 0 rgba(56, 189, 248, 0.06),
    0 4px 16px rgba(2, 8, 23, 0.12);
}

html:not(.theme-dark) .gram-mkt-page.gram-mkt-glass .gram-mkt-product {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(148, 163, 184, 0.35);
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06);
}

.gram-mkt-page.gram-mkt-glass .gram-mkt-product.is-popular {
  border-color: rgba(139, 92, 246, 0.42);
  box-shadow:
    0 0 0 1px rgba(139, 92, 246, 0.18),
    0 0 22px rgba(139, 92, 246, 0.14),
    0 6px 20px rgba(15, 23, 42, 0.1);
}

.gram-mkt-page.gram-mkt-glass .gram-module-hero-icon.gram-tone-cyan {
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.22);
}

html.theme-dark .gram-mkt-page.gram-mkt-glass .gram-mkt-section .gram-gpt-window-title {
  color: #f1f5f9;
}

html.theme-dark .gram-mkt-page.gram-mkt-glass .gram-mkt-product-title {
  color: #e2e8f0;
}

html.theme-dark .gram-mkt-page.gram-mkt-glass .gram-mkt-product-price strong {
  color: #f8fafc;
}

html.theme-dark .gram-mkt-page.gram-mkt-glass .gram-mkt-features,
html.theme-dark .gram-mkt-page.gram-mkt-glass .gram-mkt-product-period,
html.theme-dark .gram-mkt-page.gram-mkt-glass .gram-mkt-sec-desc,
html.theme-dark .gram-mkt-page.gram-mkt-glass .gram-mkt-stub,
html.theme-dark .gram-mkt-page.gram-mkt-glass .gram-mkt-product-price span,
html.theme-dark .gram-mkt-page.gram-mkt-glass .gram-mkt-empty {
  color: #94a3b8;
}

html:not(.theme-dark) .gram-mkt-page.gram-mkt-glass .gram-mkt-product-title {
  color: var(--text);
}

html:not(.theme-dark) .gram-mkt-page.gram-mkt-glass .gram-mkt-features,
html:not(.theme-dark) .gram-mkt-page.gram-mkt-glass .gram-mkt-product-period,
html:not(.theme-dark) .gram-mkt-page.gram-mkt-glass .gram-mkt-sec-desc {
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .gram-mkt-grid {
    grid-template-columns: 1fr;
  }
  .gram-mkt-product-head {
    padding-right: 0;
    padding-top: 22px;
  }
}

/* —— Биржа —— */
.gram-ex-page { display: flex; flex-direction: column; gap: 20px; }
.gram-ex-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.gram-ex-tab {
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--gram-border);
  background: transparent; color: var(--gram-text-muted); cursor: pointer; font-size: 13px;
}
.gram-ex-tab.is-active { background: var(--gram-accent-soft); color: var(--gram-accent); border-color: var(--gram-accent); }
.gram-ex-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.gram-ex-card {
  padding: 16px; border-radius: 14px; border: 1px solid var(--gram-border);
  background: var(--gram-surface); cursor: pointer; transition: border-color .15s;
}
.gram-ex-card:hover { border-color: var(--gram-accent); }
.gram-ex-card-title { margin: 8px 0 6px; font-size: 15px; }
.gram-ex-card-desc { font-size: 13px; color: var(--gram-text-muted); margin: 0 0 10px; line-height: 1.45; }
.gram-ex-card-foot { display: flex; gap: 12px; align-items: center; font-size: 13px; color: var(--gram-text-muted); }
.gram-ex-card-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.gram-ex-status { font-size: 11px; padding: 3px 8px; border-radius: 999px; background: var(--gram-surface-2); }
.gram-ex-status-open { color: #34d399; }
.gram-ex-status-draft { color: #fbbf24; }
.gram-ex-status-assigned { color: #60a5fa; }
.gram-ex-status-review { color: #c084fc; }
.gram-ex-status-completed { color: #94a3b8; }
.gram-ex-form-body label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; margin-bottom: 12px; }
.gram-ex-form-body input, .gram-ex-form-body textarea, .gram-ex-form-body select {
  padding: 10px 12px; border-radius: 10px; border: 1px solid var(--gram-border);
  background: var(--gram-bg); color: inherit;
}
.gram-ex-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.gram-ex-hint { font-size: 12px; color: var(--gram-text-muted); margin: 0 0 12px; }
.gram-ex-comm { font-size: 13px; margin-top: 6px; color: var(--gram-text-muted); }
.gram-ex-empty { color: var(--gram-text-muted); font-size: 13px; padding: 12px 0; }
.gram-ex-detail { display: flex; flex-direction: column; gap: 12px; }
.gram-ex-meta { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; margin: 12px 0; }
.gram-ex-pay { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; }
.gram-ex-bids { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.gram-ex-bid { padding: 12px; border-radius: 10px; border: 1px solid var(--gram-border); font-size: 13px; }
.gram-ex-bid-form { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.gram-ex-wallet { padding: 12px 16px; border-radius: 12px; background: var(--gram-surface-2); margin-bottom: 12px; }
.gram-ex-exec { padding: 14px; border-radius: 12px; border: 1px solid var(--gram-border); }
.gram-ex-mine-tag { font-size: 11px; color: var(--gram-accent); }

/* —— Менеджер прокси —— */
.gram-proxy-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.gram-proxy-pool-btn {
  flex-shrink: 0;
  margin-top: 4px;
}

.proxy-action-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.proxy-action-stack .gram-cta,
.proxy-action-stack .p-btn {
  width: 100%;
  justify-content: center;
}

.gram-proxy-log-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.proxy-live-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
}

.proxy-live-progress-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 200px;
}

.proxy-live-progress-track {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.25);
  overflow: hidden;
}

.proxy-live-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #22d3ee, #06b6d4);
  transition: width 0.25s ease;
}

.proxy-live-progress-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--gram-text, #0f172a);
  min-width: 36px;
}

.proxy-live-counters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  font-size: 13px;
  color: var(--muted, #64748b);
}

.proxy-live-ok { color: #059669; font-weight: 600; }
.proxy-live-fail { color: #dc2626; font-weight: 600; }

.proxy-log-wrap {
  max-height: min(52vh, 520px);
  overflow: auto;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 10px;
  background: #f8fafc;
}

html.theme-dark .proxy-log-wrap {
  background: #0f1419;
  border-color: var(--gram-border);
}

.proxy-log-table {
  margin: 0;
  font-size: 13px;
}

.proxy-log-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: inherit;
}

.proxy-log-table code.proxy-mask {
  font-size: 12px;
  word-break: break-all;
}

.proxy-log-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.proxy-log-status.is-ok {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}

.proxy-log-status.is-fail {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

.proxy-log-system td {
  font-size: 12px;
  color: var(--muted, #64748b);
  padding-top: 10px;
  padding-bottom: 10px;
}

.proxy-log-system.proxy-log-fail td {
  color: #dc2626;
}

.proxy-pool-modal-wrap {
  max-height: min(70vh, 560px);
  overflow: auto;
}

/* Пул прокси — фон как journal-gpt-card на странице прокси */
html.theme-dark #panelModal:has(#proxyModalTable) .panel-modal-card.gram-modal-card {
  background: #152238;
  border-color: rgba(56, 189, 248, 0.24);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
}

html.theme-dark #panelModal:has(#proxyModalTable) .panel-modal-header,
html.theme-dark #panelModal:has(#proxyModalTable) .panel-modal-body,
html.theme-dark #panelModal:has(#proxyModalTable) .panel-modal-footer {
  background: #152238;
}

html.theme-dark #panelModal:has(#proxyModalTable) .panel-modal-header {
  border-bottom: 1px solid rgba(71, 100, 150, 0.28);
}

html.theme-dark #panelModal:has(#proxyModalTable) .panel-modal-footer {
  border-top: 1px solid rgba(71, 100, 150, 0.28);
}

html.theme-dark #panelModal:has(#proxyModalTable) .panel-modal-title {
  color: #f8fafc;
}

html.theme-dark #panelModal:has(#proxyModalTable) .gram-modal-sub {
  color: #94a3b8;
}

html.theme-dark #panelModal:has(#proxyModalTable) .panel-modal-close {
  color: #e2e8f0;
}

html.theme-dark #panelModal:has(#proxyModalTable) .panel-modal-close:hover {
  color: #fff;
  background: rgba(56, 189, 248, 0.12);
}

html.theme-dark #panelModal:has(#proxyModalTable) .data-table th,
html.theme-dark #panelModal:has(#proxyModalTable) .data-table td {
  background: #152238;
  border-bottom-color: rgba(71, 100, 150, 0.22);
  color: #cbd5e1;
}

html.theme-dark #panelModal:has(#proxyModalTable) .data-table th {
  color: #94a3b8;
}

html.theme-dark #panelModal:has(#proxyModalTable) .data-table tbody tr:hover td {
  background: rgba(30, 41, 59, 0.45);
}

html.theme-dark #panelModal:has(#proxyModalTable) .proxy-idx {
  color: #64748b;
}

html.theme-dark #panelModal:has(#proxyModalTable) code.proxy-mask {
  color: #94a3b8;
  background: transparent;
}

html:not(.theme-dark) #panelModal:has(#proxyModalTable) .panel-modal-card.gram-modal-card {
  background: #fff;
  border-color: rgba(148, 163, 184, 0.35);
}

html:not(.theme-dark) #panelModal:has(#proxyModalTable) .panel-modal-header,
html:not(.theme-dark) #panelModal:has(#proxyModalTable) .panel-modal-body,
html:not(.theme-dark) #panelModal:has(#proxyModalTable) .panel-modal-footer {
  background: #fff;
}

html:not(.theme-dark) #panelModal:has(#proxyModalTable) .panel-modal-header {
  border-bottom-color: #e2e8f0;
}

html:not(.theme-dark) #panelModal:has(#proxyModalTable) .panel-modal-footer {
  border-top-color: #e2e8f0;
}

html:not(.theme-dark) #panelModal:has(#proxyModalTable) .data-table th {
  background: #f8fafc;
}

html:not(.theme-dark) #panelModal:has(#proxyModalTable) .data-table tbody tr:hover td {
  background: rgba(59, 130, 246, 0.04);
}

.gram-proxy-page .gram-textarea-tall,
.gram-proxy-page #proxyAddText {
  resize: none;
}

.gram-proxy-page .gram-proxy-input,
.gram-proxy-page #proxyAddText {
  color: rgba(148, 163, 184, 0.42);
  caret-color: rgba(226, 232, 240, 0.85);
}

.gram-proxy-page .gram-proxy-input:focus,
.gram-proxy-page #proxyAddText:focus {
  color: rgba(203, 213, 225, 0.72);
}

.gram-proxy-page .gram-proxy-input::placeholder,
.gram-proxy-page #proxyAddText::placeholder {
  color: rgba(100, 116, 139, 0.38);
}

.gram-proxy-add-btn {
  width: 100%;
  margin-top: 10px;
}

.gram-geo-toggle[data-geo-on="1"] {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #ecfdf5;
  border: none;
}

.gram-geo-toggle[data-geo-on="0"] {
  background: rgba(51, 65, 85, 0.65);
  color: #94a3b8;
  border: 1px solid rgba(100, 116, 139, 0.45);
}

.gram-geo-toggle[data-geo-on="0"]:hover:not(:disabled) {
  background: rgba(71, 85, 105, 0.75);
  color: #cbd5e1;
}

html:not(.theme-dark) .gram-geo-toggle[data-geo-on="1"] {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #ecfdf5;
}

html:not(.theme-dark) .gram-geo-toggle[data-geo-on="0"] {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #cbd5e1;
}

html:not(.theme-dark) .gram-geo-toggle[data-geo-on="0"]:hover:not(:disabled) {
  background: #e2e8f0;
  color: #475569;
}

html:not(.theme-dark) .gram-proxy-page .gram-proxy-input,
html:not(.theme-dark) .gram-proxy-page #proxyAddText {
  color: rgba(71, 85, 105, 0.72);
  caret-color: #0f172a;
  background: #f8fafc;
  border-color: var(--border, #cbd5e1);
}

html:not(.theme-dark) .gram-proxy-page .gram-proxy-input:focus,
html:not(.theme-dark) .gram-proxy-page #proxyAddText:focus {
  color: #0f172a;
  background: #fff;
}

html:not(.theme-dark) .gram-proxy-page .gram-proxy-input::placeholder,
html:not(.theme-dark) .gram-proxy-page #proxyAddText::placeholder {
  color: rgba(100, 116, 139, 0.55);
}

html:not(.theme-dark) .gram-proxy-page .gram-field-hint code {
  background: rgba(14, 165, 233, 0.08);
  color: #0369a1;
}

html:not(.theme-dark) .gram-proxy-page .proxy-action-stack .p-btn-secondary {
  border-color: #cbd5e1;
  color: #475569;
}

.accounts-check-live-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 8px;
  padding: 12px 14px;
}

.accounts-check-live-main {
  flex: 1;
  min-width: 200px;
}

.accounts-check-live-main > b {
  display: block;
  font-size: 13px;
}

.accounts-check-live-track {
  width: 100%;
  max-width: 100%;
  height: 8px;
  margin-top: 8px;
}

.accounts-check-live-sub {
  display: block;
  margin-top: 6px;
  font-size: 11px;
}

.acc-status-live .acc-check-bar {
  width: 100%;
  min-width: 72px;
  height: 6px;
  margin-bottom: 5px;
}

/* —— Единый журнал (GramLogPanel) —— */
.gram-log-panel {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border, rgba(148, 163, 184, 0.45));
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface, #ffffff);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

.gram-log-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.gram-log-collapse-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--border, rgba(148, 163, 184, 0.45));
  background: var(--surface-hover, #f8fafc);
  color: var(--text-muted, #64748b);
  cursor: pointer;
  flex-shrink: 0;
}

.gram-log-collapse-btn:hover {
  color: var(--text, #0f172a);
  border-color: var(--primary, #2563eb);
}

.gram-log-panel-collapsible.is-collapsed .gram-log-body {
  display: none;
}

.gram-log-panel-collapsible.is-collapsed .gram-log-search {
  display: none;
}

.gram-log-panel-collapsible.is-collapsed .gram-log-toolbar {
  border-bottom: none;
}

.gram-log-panel-collapsible.is-collapsed {
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
}

html.theme-dark .gram-log-collapse-btn {
  background: rgba(15, 23, 42, 0.45);
  border-color: var(--gram-border, rgba(71, 100, 150, 0.35));
  color: #94a3b8;
}

html.theme-dark .gram-log-collapse-btn:hover {
  color: #e2e8f0;
  border-color: var(--primary-cyan, #22d3ee);
}

.gram-log-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 12px;
  background: rgba(248, 250, 252, 0.95);
  border-bottom: 1px solid var(--border, rgba(148, 163, 184, 0.35));
}

.gram-log-toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.gram-log-heading {
  font-size: 13px;
  font-weight: 700;
  color: var(--text, #0f172a);
  white-space: nowrap;
}

.gram-log-heading b { color: var(--text-muted, #64748b); font-weight: 600; }

.gram-log-poll-hint {
  display: inline-block;
  min-width: 9.5em;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted, #64748b);
  opacity: 0.85;
  white-space: nowrap;
}
.gram-log-poll-hint[hidden] { display: none; }
html.theme-dark .gram-log-poll-hint { color: #94a3b8; }

.gram-log-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border, rgba(148, 163, 184, 0.45));
  background: rgba(241, 245, 249, 0.9);
  color: var(--text-muted, #64748b);
  font-size: 11px;
}

.gram-log-live.is-on {
  border-color: rgba(16, 185, 129, 0.45);
  color: #059669;
  background: rgba(16, 185, 129, 0.08);
}

.gram-log-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94a3b8;
}

.gram-log-live.is-on .gram-log-live-dot {
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.gram-log-filters { display: flex; flex-wrap: wrap; gap: 6px; }

.gram-log-filter {
  border: 1px solid var(--border, rgba(148, 163, 184, 0.45));
  background: var(--surface-hover, #f8fafc);
  color: var(--text-muted, #64748b);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11px;
  line-height: 1.2;
  cursor: pointer;
}

.gram-log-filter.active {
  color: var(--text, #0f172a);
  border-color: rgba(14, 165, 233, 0.45);
  background: rgba(14, 165, 233, 0.1);
}

.gram-log-search {
  min-width: 160px;
  max-width: 220px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border, rgba(148, 163, 184, 0.45));
  background: var(--surface, #fff);
  color: var(--text, #0f172a);
  font-size: 11px;
}

.gram-log-progress-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  background: rgba(248, 250, 252, 0.95);
  border-bottom: 1px solid var(--border, rgba(148, 163, 184, 0.3));
}

.gram-log-progress-wrap[hidden] { display: none !important; }
.gram-log-ml-stats[hidden] { display: none !important; }

.gram-log-progress-track {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.35);
  overflow: hidden;
}

.gram-log-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0ea5e9, #06b6d4);
  transition: width 0.25s ease;
}

.gram-log-progress-pct { font-size: 11px; color: var(--text-muted, #64748b); min-width: 32px; text-align: right; }

.gram-log-stream {
  min-height: 220px;
  max-height: min(52vh, 520px);
  overflow-x: auto;
  overflow-y: auto;
  padding: 4px 0;
  background: #f8fafc;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}

.gram-log-line {
  display: grid;
  grid-template-columns: 52px 24px minmax(72px, max-content) auto;
  gap: 4px 8px;
  align-items: center;
  padding: 2px 10px;
  font-size: 10px;
  line-height: 1.35;
  white-space: nowrap;
  width: max-content;
  min-width: 100%;
  box-sizing: border-box;
  border-left: 2px solid transparent;
}

.gram-log-line:hover { background: rgba(148, 163, 184, 0.12); }

.gram-log-row-ok {
  background: transparent;
  border-left-color: transparent;
}

.gram-log-row-warn {
  background: transparent;
  border-left-color: transparent;
}

.gram-log-row-err {
  background: transparent;
  border-left-color: transparent;
}

.gram-log-time {
  color: #64748b;
  font-size: 10px;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  padding-right: 6px;
}

.gram-log-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 0.35em;
  background: #94a3b8;
  flex-shrink: 0;
  justify-self: center;
}

.gram-log-level-info .gram-log-dot { background: #0ea5e9; }
.gram-log-level-success .gram-log-dot { background: #16a34a; }
.gram-log-level-warn .gram-log-dot { background: #d97706; }
.gram-log-level-error .gram-log-dot { background: #dc2626; }
.gram-log-level-debug .gram-log-dot { background: #7c3aed; }

.gram-log-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  font-size: 10px;
  line-height: 1;
  justify-self: center;
  margin-top: 0;
}

.gram-log-icon-info { color: #0ea5e9; }
.gram-log-icon-success { color: #22c55e; }
.gram-log-icon-warn { color: #f59e0b; }
.gram-log-icon-error { color: #ef4444; }
.gram-log-icon-debug { color: #8b5cf6; }

.gram-log-threads {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 1;
  min-width: 0;
  max-width: min(52vw, 420px);
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 1px;
  scrollbar-width: thin;
}

.gram-log-thread {
  border: 1px solid var(--border, rgba(148, 163, 184, 0.45));
  background: var(--surface-hover, #f8fafc);
  color: var(--text-muted, #64748b);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  flex-shrink: 0;
  white-space: nowrap;
}

.gram-log-thread.active {
  color: var(--text, #0f172a);
  border-color: rgba(14, 165, 233, 0.45);
  background: rgba(14, 165, 233, 0.1);
}

.gram-log-pill {
  display: inline-flex;
  align-items: center;
  max-width: 148px;
  padding: 1px 8px;
  border-radius: 6px;
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid rgba(14, 165, 233, 0.22);
  color: #0284c7;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gram-log-id {
  color: #0284c7;
  font-size: 10px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 132px;
}

.gram-log-id.is-empty { visibility: hidden; }

.gram-log-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  min-width: 24px;
  justify-self: center;
}

.gram-log-mark .gram-log-icon {
  margin-top: 0;
}

.gram-log-mark .gram-log-thread-badge {
  min-width: 24px;
  padding: 1px 5px;
}

.gram-log-thread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  padding: 0 4px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #6366f1;
  background: rgba(99, 102, 241, 0.14);
  line-height: 1.4;
}

.gram-log-thread-badge.is-empty { visibility: hidden; }

.gram-log-msg {
  color: #334155;
  white-space: nowrap;
  word-break: normal;
  font-weight: 400;
  letter-spacing: 0.005em;
}
.gram-log-level-info .gram-log-msg { color: #475569; }
.gram-log-level-success .gram-log-msg { color: #15803d; }
.gram-log-level-error .gram-log-msg { color: #b91c1c; }
.gram-log-level-warn .gram-log-msg { color: #a16207; }

.gram-log-empty {
  padding: 24px 12px;
  text-align: center;
  color: var(--text-muted, #64748b);
  font-size: 12px;
}

.gram-log-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(248, 250, 252, 0.95);
  border-top: 1px solid var(--border, rgba(148, 163, 184, 0.35));
  font-size: 11px;
  color: var(--text-muted, #64748b);
}

.gram-log-footer-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.gram-log-result-hint {
  color: #0ea5e9;
  font-size: 11px;
  line-height: 1.35;
}

.gram-log-icon-btn .gram-log-btn-label {
  display: none;
  margin-left: 4px;
  font-size: 10px;
  font-weight: 600;
}

.gram-log-icon-btn.gram-log-report-ready .gram-log-btn-label {
  display: inline;
}

.gram-log-icon-btn.gram-log-report-ready {
  border-color: rgba(14, 165, 233, 0.55);
  color: #0284c7;
  background: rgba(14, 165, 233, 0.08);
}

.gram-log-stat-ok b { color: #16a34a; }
.gram-log-stat-fail b { color: #dc2626; }

.gram-log-icon-btn {
  border: 1px solid var(--border, rgba(148, 163, 184, 0.45));
  background: var(--surface, #fff);
  color: var(--text-muted, #64748b);
  border-radius: 8px;
  padding: 4px 8px;
  cursor: pointer;
}

html.theme-dark .gram-log-panel {
  background: #0b0f14;
  border-color: rgba(51, 65, 85, 0.55);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

html.theme-dark .gram-log-toolbar {
  background: #111820;
  border-bottom-color: rgba(51, 65, 85, 0.65);
}

html.theme-dark .gram-log-heading { color: #e2e8f0; }
html.theme-dark .gram-log-heading b { color: #94a3b8; }

html.theme-dark .gram-log-live {
  border-color: rgba(51, 65, 85, 0.8);
  background: rgba(15, 23, 42, 0.6);
  color: #94a3b8;
}

html.theme-dark .gram-log-live.is-on {
  border-color: rgba(34, 197, 94, 0.45);
  color: #4ade80;
  background: rgba(34, 197, 94, 0.08);
}

html.theme-dark .gram-log-live.is-on .gram-log-live-dot {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
}

html.theme-dark .gram-log-filter {
  border-color: rgba(51, 65, 85, 0.75);
  background: rgba(15, 23, 42, 0.55);
  color: #94a3b8;
}

html.theme-dark .gram-log-filter.active {
  color: #e2e8f0;
  border-color: rgba(56, 189, 248, 0.55);
  background: rgba(56, 189, 248, 0.1);
}

html.theme-dark .gram-log-search {
  border-color: rgba(51, 65, 85, 0.85);
  background: rgba(15, 23, 42, 0.75);
  color: #e2e8f0;
}

html.theme-dark .gram-log-progress-wrap {
  background: #0d1218;
  border-bottom-color: rgba(51, 65, 85, 0.45);
}

html.theme-dark .gram-log-progress-track { background: rgba(51, 65, 85, 0.55); }
html.theme-dark .gram-log-progress-pct { color: #94a3b8; }

html.theme-dark .gram-log-stream {
  background: #06080c;
}

html.theme-dark .gram-log-line:hover { background: rgba(30, 41, 59, 0.28); }

html.theme-dark .gram-log-row-ok {
  background: transparent;
  border-left-color: transparent;
}

html.theme-dark .gram-log-row-warn {
  background: transparent;
  border-left-color: transparent;
}

html.theme-dark .gram-log-row-err {
  background: transparent;
  border-left-color: transparent;
}

html.theme-dark .gram-log-time { color: #565f73; }

html.theme-dark .gram-log-id { color: #22d3ee; }

html.theme-dark .gram-log-thread-badge {
  color: #a5b4fc;
  background: rgba(99, 102, 241, 0.22);
}

html.theme-dark .gram-log-thread {
  border-color: rgba(51, 65, 85, 0.75);
  background: rgba(15, 23, 42, 0.55);
  color: #94a3b8;
}

html.theme-dark .gram-log-thread.active {
  color: #e2e8f0;
  border-color: rgba(56, 189, 248, 0.55);
  background: rgba(56, 189, 248, 0.1);
}

html.theme-dark .gram-log-icon-info { color: #38bdf8; }
html.theme-dark .gram-log-icon-success { color: #4ade80; }
html.theme-dark .gram-log-icon-warn { color: #fbbf24; }
html.theme-dark .gram-log-icon-error { color: #f87171; }

html.theme-dark .gram-log-pill {
  background: rgba(34, 211, 238, 0.1);
  border-color: rgba(34, 211, 238, 0.22);
  color: #22d3ee;
}

html.theme-dark .gram-log-msg { color: #c5cdd9; }
html.theme-dark .gram-log-level-info .gram-log-msg { color: #b8c4d4; }
html.theme-dark .gram-log-level-success .gram-log-msg { color: #86efac; }
html.theme-dark .gram-log-level-error .gram-log-msg { color: #fca5a5; }
html.theme-dark .gram-log-level-warn .gram-log-msg { color: #fcd34d; }

html.theme-dark .gram-log-empty { color: #64748b; }

html.theme-dark .gram-log-footer {
  background: #111820;
  border-top-color: rgba(51, 65, 85, 0.65);
  color: #94a3b8;
}

html.theme-dark .gram-log-stat-ok b { color: #4ade80; }
html.theme-dark .gram-log-stat-fail b { color: #f87171; }

html.theme-dark .gram-log-icon-btn {
  border-color: rgba(51, 65, 85, 0.75);
  background: rgba(15, 23, 42, 0.55);
  color: #94a3b8;
}

.gram-log-icon-btn {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.panel-modal-body .gram-log-panel { margin-top: 12px; }
.panel-modal-body .gram-log-stream { max-height: min(50vh, 420px); }

@media (max-width: 900px) {
  .gram-log-line { grid-template-columns: 48px 24px 1fr; }
  .gram-log-id { display: none; }
  .gram-log-threads { display: none; }
}

@media (max-width: 720px) {
  .gram-proxy-pool-btn { width: 100%; }
  .proxy-live-summary { flex-direction: column; align-items: stretch; }
}

.control-surface-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.1);
  color: #92400e;
}

html.theme-dark .control-surface-banner {
  color: #fcd34d;
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
}

.control-surface-banner-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
}

.control-surface-banner-text span {
  font-size: 12px;
  opacity: 0.9;
}

.panel-mutate-locked,
.panel-form-locked {
  opacity: 0.72;
}

.panel-form-locked {
  pointer-events: none;
}

.panel-form-locked .gram-log-panel,
.panel-form-locked .gram-log-panel * {
  pointer-events: auto;
  opacity: 1;
}

/* —— Прогресс чекинга в таблице аккаунтов —— */
.acc-check-cell {
  min-width: 120px;
  max-width: 160px;
}

.acc-check-bar {
  height: 4px;
  border-radius: 999px;
  background: rgba(51, 65, 85, 0.55);
  overflow: hidden;
  margin-bottom: 4px;
}

.acc-check-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  transition: width 0.35s ease;
}

.acc-check-wait > span { width: 0 !important; background: rgba(100, 116, 139, 0.5); }
.acc-check-run > span { background: linear-gradient(90deg, #0ea5e9, #38bdf8); animation: acc-check-pulse 1.2s ease infinite; }
.acc-check-ok > span { background: #22c55e; }
.acc-check-fail > span { background: #ef4444; }

.acc-check-label {
  display: block;
  font-size: 10px;
  line-height: 1.25;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@keyframes acc-check-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.65; }
}

.gram-modal-icon-pink { background: linear-gradient(135deg, #f472b6, #db2777); }

.panel-modal-card.gram-modal-sheet {
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.35);
}

html.theme-dark .panel-modal-card.gram-modal-sheet {
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(71, 100, 150, 0.35);
}

.gram-bulk-drop[hidden] {
  display: none !important;
}

/* —— Profile edit modal (theme-aware, compact) —— */
.panel-modal-card.gram-modal-card.gram-gpt-profile-sheet {
  width: min(460px, calc(100vw - 28px)) !important;
  max-width: 460px !important;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(59, 130, 246, 0.18);
  box-shadow:
    0 0 0 1px rgba(59, 130, 246, 0.08),
    0 20px 48px rgba(15, 23, 42, 0.14),
    0 0 56px rgba(59, 130, 246, 0.1);
  color: var(--text);
}

.panel-modal-card.gram-modal-card.gram-gpt-profile-sheet.gram-gpt-profile-md {
  width: min(520px, calc(100vw - 28px)) !important;
  max-width: 520px !important;
}

html.theme-dark .panel-modal-card.gram-modal-card.gram-gpt-profile-sheet {
  background: rgba(22, 30, 46, 0.98);
  border-color: rgba(59, 130, 246, 0.28);
  box-shadow:
    0 0 0 1px rgba(59, 130, 246, 0.18),
    0 20px 48px rgba(0, 0, 0, 0.52),
    0 0 72px rgba(59, 130, 246, 0.16);
  backdrop-filter: blur(14px);
  color: #e2e8f0;
}

.gram-gpt-profile-sheet .panel-modal-header {
  border-bottom: 1px solid var(--border);
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.06));
}

html.theme-dark .gram-gpt-profile-sheet .panel-modal-header {
  border-bottom-color: rgba(71, 100, 150, 0.28);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.14), rgba(139, 92, 246, 0.08));
}

.gram-gpt-profile-sheet .gram-modal-head {
  gap: 10px;
}

.gram-gpt-profile-sheet .gram-modal-icon {
  width: 34px;
  height: 34px;
  font-size: 15px;
  border-radius: 9px;
}

.gram-gpt-profile-sheet .panel-modal-title {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

html.theme-dark .gram-gpt-profile-sheet .panel-modal-title {
  color: #f8fafc;
}

.gram-gpt-profile-sheet .gram-modal-sub {
  color: var(--text-muted);
  font-size: 11px;
  margin: 2px 0 0;
  font-weight: 500;
}

html.theme-dark .gram-gpt-profile-sheet .gram-modal-sub {
  color: #94a3b8;
}

.gram-gpt-profile-sheet .panel-modal-close {
  color: var(--text-muted);
  background: transparent;
  border: none;
}

.gram-gpt-profile-sheet .panel-modal-close:hover {
  color: var(--text);
  background: rgba(15, 23, 42, 0.06);
}

html.theme-dark .gram-gpt-profile-sheet .panel-modal-close {
  color: #94a3b8;
}

html.theme-dark .gram-gpt-profile-sheet .panel-modal-close:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.06);
}

.gram-gpt-profile-sheet .panel-modal-body {
  padding: 8px 12px 10px;
}

.gram-gpt-profile-sheet .panel-modal-footer {
  border-top: 1px solid var(--border);
  padding: 10px 14px 12px;
  gap: 8px;
}

html.theme-dark .gram-gpt-profile-sheet .panel-modal-footer {
  border-top-color: rgba(71, 100, 150, 0.28);
}

.gram-gpt-profile-sheet .gram-gpt-btn {
  padding: 8px 14px;
  font-size: 12px;
  border-radius: 9px;
}

.gram-gpt-profile-sheet .gram-gpt-btn-soft {
  background: #f1f5f9;
  border: 1px solid var(--border);
  color: var(--text);
}

.gram-gpt-profile-sheet .gram-gpt-btn-soft:hover {
  background: #e2e8f0;
}

html.theme-dark .gram-gpt-profile-sheet .gram-gpt-btn-soft {
  background: rgba(15, 23, 42, 0.85);
  border-color: rgba(71, 100, 150, 0.38);
  color: #e2e8f0;
}

html.theme-dark .gram-gpt-profile-sheet .gram-gpt-btn-soft:hover {
  background: rgba(30, 41, 59, 0.95);
}

.gram-gpt-profile-sheet .modal-status {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 8px;
}

html.theme-dark .gram-gpt-profile-sheet .modal-status {
  color: #94a3b8;
}

.gpt-ep-sheet {
  display: flex;
  flex-direction: column;
}

.gpt-ep-rows {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gpt-ep-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.15s, background 0.15s;
}

html.theme-dark .gram-gpt-profile-sheet .gpt-ep-row {
  background: rgba(15, 23, 42, 0.55);
  border-color: rgba(71, 100, 150, 0.22);
}

.gpt-ep-row.is-on {
  border-color: rgba(59, 130, 246, 0.35);
  background: rgba(59, 130, 246, 0.04);
}

html.theme-dark .gram-gpt-profile-sheet .gpt-ep-row.is-on {
  border-color: rgba(59, 130, 246, 0.38);
  background: rgba(15, 23, 42, 0.78);
}

.gpt-ep-row.is-disabled {
  opacity: 0.52;
}

.gpt-ep-row-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 8px 12px;
}

.gpt-ep-row.is-disabled .gpt-ep-row-head {
  opacity: 0.55;
}

.gpt-ep-row-toggle {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 4px 8px 4px 0;
  border: none;
  background: transparent;
  color: inherit;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
}

.gpt-ep-row-toggle:disabled {
  cursor: default;
}

.gpt-ep-ai-targets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 10px;
}

.gpt-ep-ai-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(71, 100, 150, 0.35);
  background: rgba(8, 14, 28, 0.55);
  font-size: 12px;
  font-weight: 600;
  color: #cbd5e1;
  cursor: pointer;
  user-select: none;
}

.gpt-ep-ai-pill input {
  accent-color: #8b5cf6;
  margin: 0;
}

.gpt-ep-ai-btn {
  width: 100%;
  margin-top: 4px;
}

.gpt-ep-ai-status {
  margin: 8px 0 0;
  font-size: 12px;
  color: #93c5fd;
  min-height: 16px;
}

.gpt-ep-ai-photo-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.gpt-ep-ai-photo-thumb {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(71, 100, 150, 0.35);
}

.gpt-ep-ai-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gpt-ep-ai-photo-thumb span {
  position: absolute;
  right: 4px;
  bottom: 4px;
  font-size: 9px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.gpt-ep-row-chevron {
  margin-left: auto;
  font-size: 11px;
  color: #64748b;
  transition: transform 0.18s ease;
  flex-shrink: 0;
}

.gpt-ep-row.is-open .gpt-ep-row-chevron {
  transform: rotate(180deg);
}

.gpt-ep-row:not(.is-open) .gpt-ep-row-body {
  display: none;
}

.gpt-ep-row.is-open .gpt-ep-row-body {
  display: block;
}

.gpt-ep-check {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(100, 116, 139, 0.65);
  border-radius: 5px;
  background: transparent;
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
  margin: 0;
}

.gpt-ep-check:checked {
  background: #3b82f6;
  border-color: #3b82f6;
}

.gpt-ep-check:checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 10px;
  border: 2px solid #fff;
  border-top: 0;
  border-left: 0;
  transform: rotate(45deg);
}

.gpt-ep-check:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.gpt-ep-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #fff;
  flex-shrink: 0;
}

.gpt-ep-icon-violet { background: linear-gradient(135deg, #a78bfa, #7c3aed); }
.gpt-ep-icon-cyan { background: linear-gradient(135deg, #22d3ee, #0891b2); }
.gpt-ep-icon-blue { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.gpt-ep-icon-emerald { background: linear-gradient(135deg, #34d399, #059669); }
.gpt-ep-icon-orange { background: linear-gradient(135deg, #f59e0b, #ea580c); }
.gpt-ep-icon-amber { background: linear-gradient(135deg, #fbbf24, #d97706); color: #1e293b; }

.gpt-ep-row-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

html.theme-dark .gram-gpt-profile-sheet .gpt-ep-row-title {
  color: #f1f5f9;
}

.gpt-ep-row-body {
  padding: 0 12px 12px 42px;
}

.gpt-ep-seg {
  display: flex;
  gap: 0;
  padding: 2px;
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
}

html.theme-dark .gram-gpt-profile-sheet .gpt-ep-seg {
  background: rgba(8, 14, 28, 0.85);
  border-color: rgba(71, 100, 150, 0.28);
}

.gpt-ep-seg-btn {
  flex: 1;
  padding: 6px 6px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}

html.theme-dark .gram-gpt-profile-sheet .gpt-ep-seg-btn {
  color: #94a3b8;
}

.gpt-ep-seg-btn:hover:not(.active) {
  color: var(--text);
}

html.theme-dark .gram-gpt-profile-sheet .gpt-ep-seg-btn:hover:not(.active) {
  color: #cbd5e1;
}

.gpt-ep-seg-btn.active {
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.25);
}

html.theme-dark .gram-gpt-profile-sheet .gpt-ep-seg-btn.active {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.45), rgba(37, 99, 235, 0.35));
  color: #f1f5f9;
  box-shadow: inset 0 0 0 1px rgba(147, 197, 253, 0.35), 0 0 14px rgba(59, 130, 246, 0.25);
}

.gpt-ep-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.gpt-ep-field-full {
  grid-column: 1 / -1;
}

.gpt-ep-field label {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-weight: 500;
}

.gpt-ep-input,
.gpt-ep-select,
.gpt-ep-textarea {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 12px;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}

html.theme-dark .gram-gpt-profile-sheet .gpt-ep-input,
html.theme-dark .gram-gpt-profile-sheet .gpt-ep-select,
html.theme-dark .gram-gpt-profile-sheet .gpt-ep-textarea {
  border-color: rgba(71, 100, 150, 0.32);
  background: rgba(8, 14, 28, 0.88);
  color: #f1f5f9;
}

.gpt-ep-input:focus,
.gpt-ep-select:focus,
.gpt-ep-textarea:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.55);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.gpt-ep-input::placeholder,
.gpt-ep-textarea::placeholder {
  color: #64748b;
}

.gpt-ep-textarea {
  min-height: 64px;
  resize: none;
  line-height: 1.45;
}

.gpt-ep-pool-text {
  min-height: 72px;
  font-family: inherit;
}

.gpt-ep-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
  cursor: pointer;
}

.gpt-ep-select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.gpt-ep-selects {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.gpt-ep-hint {
  margin: 6px 0 0;
  font-size: 10px;
  color: #64748b;
  line-height: 1.4;
}

.gpt-ep-upload {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px dashed var(--border);
  background: #f8fafc;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

html.theme-dark .gram-gpt-profile-sheet .gpt-ep-upload {
  border-color: rgba(71, 100, 150, 0.4);
  background: rgba(8, 14, 28, 0.55);
}

.gpt-ep-upload:hover {
  border-color: rgba(52, 211, 153, 0.45);
  background: rgba(52, 211, 153, 0.06);
}

.gpt-ep-upload-preview {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 16px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--surface);
}

html.theme-dark .gram-gpt-profile-sheet .gpt-ep-upload-preview {
  border-color: rgba(71, 100, 150, 0.35);
  background: rgba(15, 23, 42, 0.65);
  color: #64748b;
}

.gpt-ep-upload-preview.has-img {
  border-color: rgba(52, 211, 153, 0.45);
}

.gpt-ep-upload-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gpt-ep-upload-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.gpt-ep-upload-meta b {
  font-size: 13px;
  color: var(--text);
  font-weight: 600;
}

html.theme-dark .gram-gpt-profile-sheet .gpt-ep-upload-meta b {
  color: #f1f5f9;
}

.gpt-ep-upload-meta span {
  font-size: 11px;
  color: #64748b;
}

.gpt-ep-cancel {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 10px;
  font-family: inherit;
  margin-right: auto;
}

.gpt-ep-cancel:hover {
  color: var(--text);
}

html.theme-dark .gram-gpt-profile-sheet .gpt-ep-cancel {
  color: #94a3b8;
}

html.theme-dark .gram-gpt-profile-sheet .gpt-ep-cancel:hover {
  color: #f1f5f9;
}

.gpt-ep-seg-stack {
  flex-direction: column;
}

.gpt-ep-seg-stack .gpt-ep-seg-btn {
  width: 100%;
  text-align: center;
}

.gpt-ep-cleanup-opts {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gpt-ep-cleanup-opts .settings-check {
  font-size: 12px;
}

.gram-gpt-profile-sheet .gram-modal-section {
  margin-bottom: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
}

html.theme-dark .gram-gpt-profile-sheet .gram-modal-section {
  background: rgba(15, 23, 42, 0.55);
  border-color: rgba(71, 100, 150, 0.22);
}

.gram-gpt-profile-sheet .gram-modal-section-head {
  margin-bottom: 8px;
  font-size: 12px;
}

.gram-gpt-profile-sheet .gram-modal-field {
  margin-bottom: 8px;
}

.gram-gpt-profile-sheet .gram-modal-label {
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.gram-gpt-profile-sheet .gram-input,
.gram-gpt-profile-sheet .settings-input,
.gram-gpt-profile-sheet .gram-textarea {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 12px;
  font-family: inherit;
  box-sizing: border-box;
}

html.theme-dark .gram-gpt-profile-sheet .gram-input,
html.theme-dark .gram-gpt-profile-sheet .settings-input,
html.theme-dark .gram-gpt-profile-sheet .gram-textarea {
  border-color: rgba(71, 100, 150, 0.32);
  background: rgba(8, 14, 28, 0.88);
  color: #f1f5f9;
}

.panel-modal-card.gram-gpt-profile-sheet.gram-modal-wide {
  width: min(680px, calc(100vw - 28px));
  max-width: 680px;
}

.gpt-ep-photo-strip-wrap {
  margin-top: 10px;
  padding: 8px 0 2px;
}

.gpt-ep-photo-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 4px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.gpt-ep-photo-strip::-webkit-scrollbar {
  height: 5px;
}

.gpt-ep-photo-strip::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.35);
  border-radius: 999px;
}

.gpt-ep-photo-thumb {
  position: relative;
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  scroll-snap-align: start;
  background: var(--surface);
}

html.theme-dark .gram-gpt-profile-sheet .gpt-ep-photo-thumb {
  border-color: rgba(71, 100, 150, 0.35);
  background: rgba(15, 23, 42, 0.65);
}

.gpt-ep-photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gpt-ep-photo-rm {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
  padding: 0;
}

.gpt-ep-photo-thumb:hover .gpt-ep-photo-rm {
  opacity: 1;
}

.gpt-ep-selects-2 {
  grid-template-columns: 1fr 1fr;
}

.gpt-ep-photo-lib-status {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted, #94a3b8);
}

.gpt-ep-photo-lib-grid-wrap {
  max-height: 220px;
  overflow: auto;
  margin-top: 10px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.25);
}

html.theme-dark .gram-gpt-profile-sheet .gpt-ep-photo-lib-grid-wrap {
  border-color: rgba(71, 100, 150, 0.35);
}

.gpt-ep-photo-lib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
  gap: 8px;
}

.gpt-ep-photo-lib-thumb {
  position: relative;
  aspect-ratio: 1;
  width: 100%;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  background: var(--surface);
}

.gpt-ep-photo-lib-thumb.is-selected {
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.4);
}

.gpt-ep-photo-lib-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.gpt-ep-preview-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(300px, 52vh);
  overflow: auto;
  padding: 2px;
}

.gpt-ep-preview-card {
  border-radius: 10px;
  border: 1px solid rgba(59, 130, 246, 0.14);
  background: rgba(59, 130, 246, 0.04);
  padding: 10px 12px;
}

html.theme-dark .gram-gpt-profile-sheet .gpt-ep-preview-card {
  border-color: rgba(71, 100, 150, 0.32);
  background: rgba(8, 14, 28, 0.55);
}

.gpt-ep-preview-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.gpt-ep-preview-id {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

html.theme-dark .gram-gpt-profile-sheet .gpt-ep-preview-id {
  color: #64748b;
}

.gpt-ep-preview-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.gpt-ep-preview-chips i {
  font-style: normal;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
}

html.theme-dark .gram-gpt-profile-sheet .gpt-ep-preview-chips i {
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
}

.gpt-ep-preview-card-main {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.gpt-ep-preview-avatar {
  flex: 0 0 52px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(59, 130, 246, 0.2);
  background: var(--surface);
}

html.theme-dark .gram-gpt-profile-sheet .gpt-ep-preview-avatar {
  border-color: rgba(71, 100, 150, 0.4);
  background: rgba(15, 23, 42, 0.8);
}

.gpt-ep-preview-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gpt-ep-preview-avatar-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 18px;
}

html.theme-dark .gram-gpt-profile-sheet .gpt-ep-preview-avatar-empty {
  color: #64748b;
}

.gpt-ep-preview-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.gpt-ep-preview-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
}

html.theme-dark .gram-gpt-profile-sheet .gpt-ep-preview-name {
  color: #f1f5f9;
}

.gpt-ep-preview-user {
  font-size: 12px;
  font-weight: 600;
  color: #2563eb;
}

html.theme-dark .gram-gpt-profile-sheet .gpt-ep-preview-user {
  color: #60a5fa;
}

.gpt-ep-preview-bio {
  margin: 2px 0 0;
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-muted);
  word-break: break-word;
}

html.theme-dark .gram-gpt-profile-sheet .gpt-ep-preview-bio {
  color: #94a3b8;
}

.gpt-ep-preview-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 320px;
  overflow: auto;
}

.gpt-ep-preview-row {
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.06);
  border: 1px solid rgba(59, 130, 246, 0.12);
  font-size: 12px;
  color: var(--text);
}

html.theme-dark .gram-gpt-profile-sheet .gpt-ep-preview-row {
  color: #e2e8f0;
}

.gpt-ep-preview-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: stretch;
  justify-content: center;
}

.gpt-ep-preview-overlay[hidden] {
  display: none !important;
}

.gpt-ep-preview-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}

.gpt-ep-preview-overlay-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(720px, calc(100% - 24px));
  max-height: calc(100% - 24px);
  margin: 12px auto;
  border-radius: 16px;
  background: var(--gram-modal-bg, #fff);
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.28);
  overflow: hidden;
}

html.theme-dark .gpt-ep-preview-overlay-panel {
  background: #1e293b;
}

.gpt-ep-preview-overlay-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.gpt-ep-preview-overlay-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.gpt-ep-preview-overlay-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 12px 16px;
}

.gpt-ep-preview-overlay-foot {
  display: flex;
  justify-content: flex-end;
  padding: 10px 16px 14px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.gram-gpt-profile-sheet .panel-modal-card {
  position: relative;
}

.panel-modal .gram-textarea {
  resize: none;
}

/* Tool + checker modals in profile sheet */
.gram-gpt-profile-sheet .gram-modal-hint,
.gram-gpt-profile-sheet .modal-hint {
  margin: 0 0 10px;
  font-size: 11px;
  color: #64748b;
  line-height: 1.45;
}

html.theme-dark .gram-gpt-profile-sheet .gram-modal-hint,
html.theme-dark .gram-gpt-profile-sheet .modal-hint {
  color: #94a3b8;
}

.gram-gpt-profile-sheet .gpt-check-field {
  margin-bottom: 10px;
}

.gram-gpt-profile-sheet .gpt-check-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
}

html.theme-dark .gram-gpt-profile-sheet .gpt-check-label {
  color: #94a3b8;
}

.gram-gpt-profile-sheet .gpt-check-radios {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.gram-gpt-profile-sheet .gpt-check-radios .settings-check {
  font-size: 12px;
}

.gram-gpt-profile-sheet .account-picker,
.gram-gpt-profile-sheet .account-picker-compact {
  max-height: 150px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  margin-top: 4px;
}

html.theme-dark .gram-gpt-profile-sheet .account-picker,
html.theme-dark .gram-gpt-profile-sheet .account-picker-compact {
  border-color: rgba(71, 100, 150, 0.35);
  background: rgba(8, 14, 28, 0.45);
}

.gram-gpt-profile-sheet .account-picker-all {
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

html.theme-dark .gram-gpt-profile-sheet .account-picker-all {
  border-bottom-color: rgba(71, 100, 150, 0.28);
}

.gram-gpt-profile-sheet .check-results-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 8px 0;
}

.gram-gpt-profile-sheet .check-result-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 68px;
  padding: 10px 6px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(248, 250, 252, 0.9);
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
  font-family: inherit;
}

html.theme-dark .gram-gpt-profile-sheet .check-result-card {
  border-color: rgba(71, 100, 150, 0.35);
  background: rgba(8, 14, 28, 0.55);
}

.gram-gpt-profile-sheet .check-result-card:hover {
  transform: translateY(-1px);
  border-color: rgba(59, 130, 246, 0.35);
}

.gram-gpt-profile-sheet .check-result-card i {
  font-size: 18px;
}

.gram-gpt-profile-sheet .check-result-value {
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
}

.gram-gpt-profile-sheet .check-result-label {
  font-size: 11px;
  color: var(--text-muted);
}

html.theme-dark .gram-gpt-profile-sheet .check-result-label {
  color: #94a3b8;
}

.gram-gpt-profile-sheet .check-group-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 280px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
}

html.theme-dark .gram-gpt-profile-sheet .check-group-list {
  border-color: rgba(71, 100, 150, 0.35);
  background: rgba(8, 14, 28, 0.45);
}

.gram-gpt-profile-sheet .check-group-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
}

html.theme-dark .gram-gpt-profile-sheet .check-group-item {
  border-bottom-color: rgba(71, 100, 150, 0.22);
}

.gram-gpt-profile-sheet .check-group-item:last-child {
  border-bottom: none;
}

.gram-gpt-profile-sheet .check-downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.gram-gpt-profile-sheet .check-downloads .p-btn {
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 8px;
}

.gram-gpt-profile-sheet .gram-modal-log {
  max-height: 200px;
  font-size: 11px;
}

.gram-gpt-profile-sheet .sc-success-list {
  max-height: 220px;
}

@media (max-width: 560px) {
  .gpt-ep-fields,
  .gpt-ep-selects {
    grid-template-columns: 1fr;
  }

  .gpt-ep-seg-btn {
    font-size: 11px;
    padding: 8px 4px;
  }

  .gpt-ep-row-body {
    padding-left: 16px;
  }
}

.acc-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(139, 92, 246, 0.35);
  background: rgba(139, 92, 246, 0.1);
  color: #7c3aed;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
}

html.theme-dark .acc-row-actions {
  color: #c4b5fd;
  background: rgba(139, 92, 246, 0.15);
}

.acc-row-actions:hover {
  background: rgba(139, 92, 246, 0.18);
  border-color: rgba(139, 92, 246, 0.55);
}

.acc-row-actions i { font-size: 11px; }

.cell-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.sc-ch-pin {
  margin: 4px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.sc-ch-post-row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.sc-ch-avatar-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  flex: 0 0 88px;
}

.sc-ch-avatar-preview {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px dashed rgba(148, 163, 184, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 22px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.35);
  transition: border-color 0.15s, background 0.15s;
}

.sc-ch-avatar-preview.has-img {
  border-style: solid;
  border-color: rgba(59, 130, 246, 0.45);
}

.sc-ch-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sc-ch-avatar-label {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.3;
}

.sc-ch-post-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sc-ch-post-text {
  min-height: 96px;
  resize: vertical;
}

.sc-ch-image-drop {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px dashed rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.25);
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.sc-ch-image-drop:hover {
  border-color: rgba(59, 130, 246, 0.45);
  background: rgba(59, 130, 246, 0.06);
  color: var(--text);
}

.sc-ch-image-drop i {
  font-size: 16px;
  color: #3b82f6;
}

@media (max-width: 560px) {
  .sc-ch-post-row {
    flex-direction: column;
  }
  .sc-ch-avatar-btn {
    flex-direction: row;
    flex: none;
    width: 100%;
  }
}

/* —— Bulk progress & result modals —— */
.bulk-progress-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bulk-progress-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.bulk-progress-status {
  font-weight: 600;
  font-size: 14px;
}

.bulk-progress-counter {
  font-size: 13px;
  color: var(--text-muted, #94a3b8);
  white-space: nowrap;
}

.bulk-progress-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
  overflow: hidden;
}

.bulk-progress-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #22d3ee, #2563eb);
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.45);
  transition: width 0.25s ease;
}

.bulk-progress-fill.is-indeterminate {
  width: 40% !important;
  animation: bulk-progress-indeterminate 1.2s ease-in-out infinite;
}

@keyframes bulk-progress-indeterminate {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(320%); }
}

.bulk-progress-pct {
  font-size: 12px;
  color: var(--text-muted, #94a3b8);
}

.bulk-progress-current {
  font-size: 14px;
}

.bulk-progress-sub {
  font-size: 12px;
  color: var(--text-muted, #94a3b8);
}

.bulk-progress-step-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(71, 100, 150, 0.28);
  background: rgba(15, 23, 42, 0.22);
}

.bulk-progress-step-block[hidden] {
  display: none !important;
}

.bulk-progress-step-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}

.bulk-progress-step-label {
  font-weight: 600;
  color: var(--text, #e2e8f0);
}

.bulk-progress-step-counter {
  color: var(--text-muted, #94a3b8);
  white-space: nowrap;
}

.bulk-progress-track--step {
  height: 5px;
}

.bulk-progress-fill--step {
  background: linear-gradient(90deg, #22d3ee, #38bdf8);
}

.bulk-progress-detail {
  font-size: 11px;
  color: var(--text-muted, #94a3b8);
  word-break: break-all;
  line-height: 1.35;
}

.bulk-progress-flood {
  font-size: 11px;
  color: #fbbf24;
}

html:not(.theme-dark) .bulk-progress-step-block {
  background: rgba(248, 250, 252, 0.98);
  border-color: rgba(148, 163, 184, 0.45);
}

html:not(.theme-dark) .bulk-progress-step-block .bulk-progress-step-label {
  color: #0f172a;
}

html:not(.theme-dark) .bulk-progress-step-block .bulk-progress-step-counter,
html:not(.theme-dark) .bulk-progress-step-block .bulk-progress-detail {
  color: #64748b;
}

.bulk-progress-accounts {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  margin-top: 4px;
}

.bulk-progress-acc-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.12);
}

html:not(.theme-dark) .bulk-progress-acc-row {
  background: rgba(241, 245, 249, 0.9);
  border-color: rgba(148, 163, 184, 0.35);
}

.bulk-progress-acc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}

.bulk-progress-acc-name {
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bulk-progress-acc-status {
  color: var(--text-muted, #94a3b8);
  white-space: nowrap;
  font-size: 11px;
}

.bulk-progress-track--acc {
  height: 4px;
}

.bulk-progress-fill--acc {
  background: linear-gradient(90deg, #22d3ee, #38bdf8);
}

.bulk-progress-acc-row.is-run .bulk-progress-fill--acc {
  animation: acc-check-pulse 1.2s ease infinite;
}

.bulk-progress-acc-row.is-ok .bulk-progress-fill--acc {
  background: #22c55e;
}

.bulk-progress-acc-row.is-fail .bulk-progress-fill--acc {
  background: #ef4444;
}

.bulk-progress-acc-flood {
  font-size: 10px;
  color: #fbbf24;
}

.bulk-progress-acc-detail {
  display: block;
  font-size: 10px;
  line-height: 1.35;
  color: var(--text-muted, #94a3b8);
  word-break: break-all;
}

.bulk-progress-acc-detail--link {
  color: #38bdf8;
  text-decoration: none;
}

.bulk-progress-acc-detail--link:hover {
  text-decoration: underline;
}

.bulk-result-banner.bulk-result-banner--fail {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.22), rgba(127, 29, 29, 0.12));
  border-color: rgba(239, 68, 68, 0.45);
  color: #fca5a5;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.12);
}

.bulk-result-banner.bulk-result-banner--mixed {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(34, 211, 238, 0.1));
  border-color: rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}

.bulk-result-addlist-link {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  word-break: break-all;
  color: #38bdf8;
}

.accounts-tool-live-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.accounts-tool-live-bar .accounts-check-live-main {
  flex: 1;
  min-width: 180px;
}

.accounts-tool-live-bar .accounts-tool-live-track {
  background: rgba(100, 116, 139, 0.35);
}

.accounts-tool-live-bar .accounts-tool-live-track > span {
  background: linear-gradient(90deg, #22d3ee, #38bdf8);
  animation: acc-check-pulse 1.2s ease infinite;
}

.accounts-tool-live-bar .accounts-tool-live-track.is-done > span {
  background: #22c55e;
  animation: none;
}

.accounts-tool-live-bar .accounts-tool-live-track.is-fail > span {
  background: #ef4444;
  animation: none;
}

.accounts-tool-live-bar .accounts-tool-live-track.is-mixed > span {
  background: #f59e0b;
  animation: none;
}

html:not(.theme-dark) .accounts-tool-live-bar .accounts-tool-live-track {
  background: rgba(148, 163, 184, 0.35);
}

.accounts-tool-live-show {
  flex-shrink: 0;
  font-size: 12px;
  padding: 6px 12px;
}

.accounts-tool-live-dismiss {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
}

.cf-folder-dist {
  margin-top: 10px;
}

.cf-folder-dist .gram-gpt-dist-grid {
  max-width: 100%;
}

.cf-run-foot {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  width: 100%;
}

.cf-run-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.cf-folder-dist .gram-gpt-btn,
.cf-run-actions .gram-gpt-btn {
  position: relative;
  z-index: 2;
  pointer-events: auto;
  cursor: pointer;
}

.cf-folder-dist .gram-gpt-btn .pi,
.cf-run-actions .gram-gpt-btn .pi {
  pointer-events: none;
}

.jc-acc-banner {
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: color-mix(in srgb, #3b82f6 12%, var(--surface));
  border: 1px solid color-mix(in srgb, #3b82f6 25%, var(--border));
  font-size: 14px;
}

.jc-dist-mode {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.gram-modal-radio {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  cursor: pointer;
}

.gram-modal-radio input {
  accent-color: #3b82f6;
}

.gram-modal-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  margin-left: 6px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: #059669;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.jc-delay-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.jc-delay-inp {
  max-width: 120px;
}

.jc-join-dist {
  margin-top: 4px;
}

.cf-run-status {
  margin: 0;
  min-height: 18px;
  font-size: 13px;
  font-weight: 600;
  color: #2563eb;
}

.cf-run-status.is-err {
  color: #dc2626;
}

html.theme-dark .cf-run-status {
  color: #38bdf8;
}

html.theme-dark .cf-run-status.is-err {
  color: #f87171;
}

.gram-gpt-profile-sheet .panel-modal-footer.cf-run-footer {
  flex-direction: column;
  align-items: stretch;
}

.gram-gpt-btn-secondary {
  background: rgba(148, 163, 184, 0.15);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: var(--text, #e2e8f0);
}

html:not(.theme-dark) .gram-gpt-btn-secondary {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
}

.bulk-progress-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 72px;
}

.bulk-progress-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.bulk-result-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bulk-result-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.18), rgba(34, 211, 238, 0.12));
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
  font-weight: 600;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.12);
}

.bulk-result-summary {
  font-size: 14px;
}

.bulk-result-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
}

.bulk-result-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.35);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

html:not(.theme-dark) .bulk-result-row {
  background: #f8fafc;
  border-color: rgba(226, 232, 240, 0.95);
}

.bulk-result-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.bulk-result-meta b {
  font-size: 14px;
}

.bulk-result-user {
  font-size: 12px;
  color: var(--text-muted, #94a3b8);
}

.bulk-result-detail {
  font-size: 11px;
  color: var(--text-muted, #94a3b8);
}

.bulk-result-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.bulk-result-icon.ok { color: #34d399; }
.bulk-result-icon.fail { color: #f87171; }
.bulk-result-icon.skip { color: #fbbf24; }

.bulk-result-close {
  background: linear-gradient(135deg, #22d3ee, #2563eb) !important;
  border: none !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.bulk-result-empty {
  margin: 0;
  padding: 12px 0;
}

/* —— Table: status & role —— */
.acc-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  max-width: 148px;
}

.acc-status-ico {
  font-size: 11px;
  opacity: 0.95;
  flex-shrink: 0;
}

.acc-status-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.acc-status-ok .acc-status-ico,
.acc-status-no_spam .acc-status-ico {
  color: #34d399;
}

.acc-status-warn .acc-status-ico {
  color: #fbbf24;
}

.acc-status-freeze .acc-status-ico {
  color: #60a5fa;
}

.acc-status-bad .acc-status-ico {
  color: #f87171;
}

.gram-gpt-select-menu.is-portal {
  position: fixed;
  z-index: 10200;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.role-custom-select .gram-gpt-select-menu {
  min-width: 100%;
}

.role-custom-select .gram-gpt-select-menu[hidden] {
  display: none !important;
}

.bulk-result-meta-oneline {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}

.bulk-result-meta-oneline > b {
  flex-shrink: 0;
}

.bulk-result-meta-oneline > .bulk-result-user {
  flex-shrink: 0;
}

.bulk-result-meta-oneline > .bulk-result-stats-inline {
  flex: 1 1 auto;
  min-width: 0;
}

.bulk-result-stats-inline {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  font-size: 12px;
  color: var(--text-muted, #94a3b8);
}

.bulk-result-stats-inline i {
  font-size: 11px;
  color: #60a5fa;
  margin-right: 2px;
}

.bulk-result-stats-sep {
  opacity: 0.45;
  user-select: none;
}

.bulk-result-stats-link {
  color: #38bdf8;
  text-decoration: none;
  font-weight: 600;
}

.bulk-result-stats-link:hover {
  text-decoration: underline;
}

.sc-ch-preview-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 360px;
  overflow-y: auto;
}

.sc-ch-preview-card {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.15);
  background: rgba(15, 23, 42, 0.35);
}

.sc-ch-preview-card b {
  display: block;
  font-size: 13px;
  margin-bottom: 6px;
}

.sc-ch-preview-fields {
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted, #94a3b8);
}

.sc-ch-preview-fields span {
  display: block;
}

.acc-status-ok {
  background: rgba(16, 185, 129, 0.14);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.28);
}

.acc-status-warn {
  background: rgba(245, 158, 11, 0.14);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.28);
}

.acc-status-freeze {
  background: rgba(59, 130, 246, 0.14);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.28);
}

.acc-status-bad {
  background: rgba(239, 68, 68, 0.14);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.28);
}

.acc-status-muted {
  color: var(--text-muted, #94a3b8);
  background: transparent;
  border: none;
  padding: 0;
}

.acc-role-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  background: color-mix(in srgb, var(--role-color, #3b82f6) 18%, transparent);
  color: var(--role-color, #3b82f6);
  border: 1px solid color-mix(in srgb, var(--role-color, #3b82f6) 35%, transparent);
  box-shadow: 0 0 10px color-mix(in srgb, var(--role-color, #3b82f6) 20%, transparent);
}

.acc-role-cell,
.acc-status-cell,
.acc-health-cell,
.acc-geo-cell,
.cell-username,
.cell-actions,
.gram-accounts-page .data-table th.acc-col-center,
.gram-accounts-page .data-table td.acc-col-center {
  text-align: center;
  vertical-align: middle;
}

.gram-accounts-page .data-table td.acc-col-center > .acc-cell-inner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  max-width: 100%;
}

.gram-accounts-page .data-table td.cell-actions {
  display: table-cell !important;
}

.gram-accounts-page .acc-health-stack {
  flex-direction: column;
  gap: 4px;
}

.acc-health-pct {
  position: relative;
  display: inline-block;
  padding: 0;
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  cursor: default;
  font-family: inherit;
}

.acc-health-tip {
  display: none;
  position: absolute;
  z-index: 50;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 148px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface, #fff);
  border: 1px solid var(--border, rgba(148, 163, 184, 0.35));
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
  font-size: 11px;
  font-weight: 500;
  color: var(--text, #0f172a);
  text-align: left;
  pointer-events: none;
}

html.theme-dark .acc-health-tip {
  background: #1e293b;
  border-color: rgba(148, 163, 184, 0.28);
  color: #e2e8f0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.acc-health-tip-line {
  display: block;
  line-height: 1.45;
  white-space: nowrap;
}

.acc-health-pct:hover .acc-health-tip,
.acc-health-pct:focus-visible .acc-health-tip {
  display: block;
}

.acc-health-pct.acc-health-ok { color: #059669; }
.acc-health-pct.acc-health-warn { color: #d97706; }
.acc-health-pct.acc-health-bad { color: #dc2626; }
.acc-health-pct.acc-health-muted { color: #64748b; }

.acc-geo-cell {
  min-width: 68px;
}

.acc-geo-inner {
  gap: 5px;
}

.acc-geo-flag {
  width: 18px;
  line-height: 1;
  border-radius: 2px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.28);
}

.acc-geo-code {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text-muted);
}

.acc-role-cell .acc-role-badge,
.acc-status-cell .acc-status-badge {
  max-width: 100%;
}

.cell-name {
  text-align: left;
  min-width: 110px;
}

.cell-username {
  min-width: 96px;
  max-width: 130px;
}

.acc-username-link {
  color: var(--primary-cyan, #0891b2);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  word-break: break-all;
  text-align: center;
}

.acc-username-link:hover {
  text-decoration: underline;
  color: var(--primary, #2563eb);
}

html.theme-dark .acc-username-link {
  color: #22d3ee;
}

.acc-health-cell {
  font-size: 11px;
  min-width: 88px;
}

.acc-status-cell {
  min-width: 108px;
  max-width: 140px;
  overflow: hidden;
}

.acc-status-live .acc-cell-inner {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  max-width: 132px;
  min-width: 0;
  overflow: hidden;
}

.acc-status-live .acc-check-label {
  max-width: 100%;
}

.gram-accounts-page .table-container {
  overflow-x: hidden;
  overflow-y: auto;
}

.acc-role-cell {
  min-width: 88px;
}

.gram-accounts-page .acc-actions-inner {
  gap: 6px;
  flex-wrap: nowrap;
}

.gram-accounts-page .data-table th.cell-actions-th,
.gram-accounts-page .data-table td.cell-actions {
  width: 92px;
  min-width: 92px;
  padding-left: 6px;
  padding-right: 6px;
}

.gram-accounts-page .cell-actions .btn-icon-sm {
  flex-shrink: 0;
}

.gram-accounts-page .cell-actions .btn-icon-sm[data-tg-web] {
  color: #2aabee;
}

.gram-accounts-page .cell-actions .btn-icon-sm[data-tg-web]:hover {
  background: rgba(42, 171, 238, 0.12);
}

.gram-accounts-page .cell-actions .btn-icon-sm[data-acc-card] {
  color: #3b82f6;
}

.gram-accounts-page .cell-actions .btn-icon-sm[data-acc-card]:hover {
  background: rgba(59, 130, 246, 0.1);
}

.gram-accounts-page .cell-actions .btn-icon-sm[data-delete-one] {
  color: #dc2626;
}

.gram-accounts-page .cell-actions .btn-icon-sm[data-delete-one]:hover {
  background: rgba(239, 68, 68, 0.08);
}

.acc-table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.acc-table-footer-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.acc-table-page-size {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.acc-table-page-size select {
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 12px;
}

.acc-table-pager {
  display: inline-flex;
  gap: 6px;
}

/* duplicate cell-actions rules removed — see acc-col-center block above */

/* —— Role modal —— */
.role-sheet {
  gap: 14px;
}

.role-sheet .role-field-visual label {
  display: block;
  margin-bottom: 10px;
}

.role-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 2px 0 4px;
}

.role-swatch {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 2px solid transparent;
  background: var(--swatch);
  cursor: pointer;
  box-shadow: 0 0 8px color-mix(in srgb, var(--swatch) 40%, transparent);
}

.role-swatch.active {
  border-color: #fff;
  outline: 2px solid var(--swatch);
}

.role-icon-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-height: 156px;
  overflow-y: auto;
  padding: 2px 4px 6px 2px;
}

.role-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: #f8fafc;
  color: #64748b;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

html.theme-dark .role-icon-btn {
  border-color: rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.35);
  color: var(--text-muted, #94a3b8);
}

.role-custom-select {
  max-width: none;
  width: 100%;
}

html.theme-dark .role-custom-select .gram-gpt-select-btn {
  background: rgba(15, 23, 42, 0.35);
}

.role-icon-btn.active {
  border-color: #3b82f6;
  color: #2563eb;
  background: rgba(59, 130, 246, 0.1);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

html.theme-dark .role-icon-btn.active {
  color: #60a5fa;
  background: rgba(59, 130, 246, 0.15);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.25);
}

/* —— Account card modal —— */
.acc-card-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 32px;
  color: var(--text-muted, #64748b);
  font-size: 14px;
}

.acc-card-modal {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.acc-card-section {
  border-radius: 12px;
  border: 1px solid var(--border, rgba(226, 232, 240, 0.95));
  background: var(--surface, #fff);
  overflow: hidden;
}

html.theme-dark .acc-card-section {
  background: rgba(15, 23, 42, 0.35);
  border-color: rgba(148, 163, 184, 0.15);
}

.acc-card-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #64748b);
  border-bottom: 1px solid var(--border, rgba(226, 232, 240, 0.6));
}

html.theme-dark .acc-card-section-head {
  border-bottom-color: rgba(148, 163, 184, 0.12);
}

.acc-card-section-head i {
  color: #3b82f6;
  font-size: 13px;
}

html.theme-dark .acc-card-section-head i {
  color: #60a5fa;
}

.acc-card-section-body {
  padding: 14px;
}

.acc-card-profile {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.acc-card-avatar {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(148, 163, 184, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}

.acc-card-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.acc-card-avatar-fallback {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-muted, #94a3b8);
}

.acc-card-profile-main {
  flex: 1;
  min-width: 0;
}

.acc-card-name {
  display: block;
  font-size: 16px;
  margin-bottom: 2px;
}

.acc-card-user {
  display: block;
  font-size: 13px;
  color: var(--text-muted, #64748b);
  margin-bottom: 10px;
}

.acc-card-kv {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  margin-bottom: 8px;
}

.acc-card-kv > span:first-child {
  min-width: 88px;
  flex-shrink: 0;
  color: var(--text-muted, #64748b);
  font-size: 12px;
}

.acc-card-kv-bio p {
  margin: 0;
  line-height: 1.45;
  word-break: break-word;
}

.acc-card-link {
  color: #2563eb;
  text-decoration: none;
  font-weight: 600;
}

html.theme-dark .acc-card-link {
  color: #38bdf8;
}

.acc-card-link:hover {
  text-decoration: underline;
}

.acc-card-2fa-row {
  align-items: center;
}

.acc-card-2fa {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.acc-card-2fa-mask,
.acc-card-2fa-val {
  font-family: ui-monospace, monospace;
  letter-spacing: 0.08em;
}

.acc-card-2fa-toggle {
  border: none;
  background: transparent;
  color: var(--text-muted, #64748b);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 6px;
}

.acc-card-2fa-toggle:hover {
  color: #3b82f6;
  background: rgba(59, 130, 246, 0.08);
}

.acc-card-code {
  font-size: 12px;
  word-break: break-all;
}

.acc-card-hint {
  margin: 8px 0 0;
  font-size: 11px;
  color: var(--text-muted, #64748b);
  line-height: 1.4;
}

.acc-card-ok {
  color: #059669;
}

.acc-card-warn {
  color: #d97706;
}

.acc-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.acc-health-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.2);
  white-space: nowrap;
}

.acc-health-ok { color: #059669; border-color: rgba(16, 185, 129, 0.28); background: rgba(16, 185, 129, 0.1); }
.acc-health-warn { color: #d97706; border-color: rgba(245, 158, 11, 0.28); background: rgba(245, 158, 11, 0.1); }
.acc-health-bad { color: #dc2626; border-color: rgba(239, 68, 68, 0.28); background: rgba(239, 68, 68, 0.08); }
.acc-health-freeze { color: #2563eb; border-color: rgba(59, 130, 246, 0.28); background: rgba(59, 130, 246, 0.1); }
.acc-health-muted { color: #64748b; }

.acc-card-premium {
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  vertical-align: middle;
  color: #7c3aed;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.25);
}

.acc-card-rating-label-inline {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.acc-card-rating {
  margin: 12px 0 8px;
}

.acc-card-rating-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.acc-card-rating-stars {
  color: #f59e0b;
  font-size: 14px;
  letter-spacing: 1px;
}

.acc-card-rating-score {
  font-size: 14px;
}

.acc-card-rating-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  overflow: hidden;
}

.acc-card-rating-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  transition: width 0.3s ease;
}

.acc-card-rating-excellent { background: linear-gradient(90deg, #34d399, #10b981); }
.acc-card-rating-good { background: linear-gradient(90deg, #60a5fa, #3b82f6); }
.acc-card-rating-warn { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.acc-card-rating-bad { background: linear-gradient(90deg, #f87171, #ef4444); }

.acc-card-rating-label {
  margin: 6px 0 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--text, #334155);
}

html.theme-dark .acc-card-rating-label {
  color: #e2e8f0;
}

.acc-card-live-warn {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 12px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: #b45309;
}

html.theme-dark .acc-card-live-warn {
  color: #fbbf24;
}

.cell-actions .btn-icon-sm[data-acc-card] {
  color: #3b82f6;
}

.cell-actions .btn-icon-sm[data-acc-card]:hover {
  background: rgba(59, 130, 246, 0.1);
}

/* —— Журнал задач (panel) —— */
.gram-journal-page .journal-page-head {
  margin-bottom: 0;
}

.journal-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 900px) {
  .journal-stats-grid {
    grid-template-columns: 1fr;
  }
}

.journal-stat-card {
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--elevated);
}

html.theme-dark .journal-stat-card {
  background: var(--gram-card);
  border-color: var(--gram-border);
}

.journal-stat-value {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}

.journal-stat-label {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.journal-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.journal-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.journal-tab {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--elevated);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-secondary);
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.journal-tab:hover {
  border-color: var(--primary-light);
}

.journal-tab.active {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.35);
  color: var(--primary);
}

html.theme-dark .journal-tab.active {
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
}

.journal-active-block {
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.06);
}

.journal-active-block-title {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #059669;
}

.journal-table-wrap {
  margin-top: 0;
}

.journal-table tbody tr {
  cursor: pointer;
  transition: background 0.12s;
}

.journal-table tbody tr:hover {
  background: rgba(59, 130, 246, 0.04);
}

html.theme-dark .journal-table tbody tr:hover {
  background: rgba(59, 130, 246, 0.08);
}

.journal-table tbody tr.journal-row-running {
  background: rgba(16, 185, 129, 0.05);
}

.journal-cell-status-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.journal-row-cancel {
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.08);
  color: #dc2626;
  cursor: pointer;
  white-space: nowrap;
}

.journal-row-cancel:hover {
  background: rgba(239, 68, 68, 0.14);
}

html.theme-dark .journal-row-cancel {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(239, 68, 68, 0.12);
}

.journal-cell-title b {
  display: block;
  font-size: 14px;
  font-weight: 600;
}

.journal-cell-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.journal-progress-cell {
  min-width: 120px;
}

.journal-progress-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.25);
  overflow: hidden;
  margin-bottom: 4px;
}

.journal-progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3b82f6, #06b6d4);
  transition: width 0.25s ease;
}

.journal-progress-fill.is-run {
  background: linear-gradient(90deg, #10b981, #22c55e);
}

.journal-progress-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.journal-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--border);
  background: var(--surface-hover);
  color: var(--text-secondary);
}

.journal-status-run {
  color: #0891b2;
  border-color: rgba(6, 182, 212, 0.25);
  background: rgba(6, 182, 212, 0.08);
}

.journal-status-ok {
  color: #047857;
  border-color: rgba(5, 150, 105, 0.2);
  background: rgba(5, 150, 105, 0.06);
}

.journal-status-bad {
  color: #b91c1c;
  border-color: rgba(220, 38, 38, 0.2);
  background: rgba(220, 38, 38, 0.06);
}

.journal-status-muted {
  color: var(--text-muted);
}

.journal-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px 0 4px;
  font-size: 13px;
  color: var(--text-muted);
}

.journal-task-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.journal-task-card .acc-card-section-head {
  gap: 0;
}

.journal-task-card .acc-card-section-head i {
  display: none;
}

.journal-task-progress {
  margin-top: 4px;
}

.journal-task-progress .acc-card-rating-track {
  height: 8px;
}

.journal-task-accounts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.journal-task-acc-pill {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-family: ui-monospace, monospace;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.journal-task-kv-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
}

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

/* —— Прокси (panel v2) —— */
.gram-proxy-page .gram-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.gram-cta-soft {
  background: var(--elevated);
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: none;
}

.gram-cta-soft:hover {
  border-color: var(--primary-light);
}

.gram-cta-muted {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  box-shadow: none;
}

.gram-cta-muted:hover {
  border-color: rgba(239, 68, 68, 0.35);
  color: #dc2626;
}

.proxy-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 900px) {
  .proxy-stats-grid {
    grid-template-columns: 1fr;
  }
}

.proxy-stat-card {
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--elevated);
}

html.theme-dark .proxy-stat-card {
  background: var(--gram-card);
  border-color: var(--gram-border);
}

.proxy-stat-value {
  font-size: 22px;
  font-weight: 700;
}

.proxy-stat-value-sm {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
}

.journal-section-row-title {
  padding: 10px 12px 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: transparent;
  border: none;
}

.journal-section-row:hover {
  background: transparent !important;
  cursor: default;
}

.journal-section-row {
  cursor: default;
}


.proxy-stat-label {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.proxy-stat-badge {
  display: inline-block;
  margin-top: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.proxy-stat-badge.on {
  color: #059669;
  background: rgba(16, 185, 129, 0.12);
}

.proxy-stat-badge.off {
  color: var(--text-muted);
  background: rgba(148, 163, 184, 0.15);
}

.proxy-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.proxy-toolbar-left,
.proxy-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.proxy-work-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 14px;
}

@media (max-width: 960px) {
  .proxy-work-grid {
    grid-template-columns: 1fr;
  }
}

.proxy-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.proxy-panel-head {
  padding: 14px 16px 0;
}

.proxy-panel-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.proxy-panel-hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

.gram-info-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.gram-info-tip-inline {
  margin-left: 2px;
}

.gram-proxy-hint-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.gram-proxy-hint-row .gram-field-hint {
  margin: 0;
  flex: 1;
  min-width: 0;
}

.gram-info-tip-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted, #64748b);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.3;
  cursor: help;
  white-space: nowrap;
  transition: color 0.15s ease, background 0.15s ease;
}

.gram-info-tip-link i {
  font-size: 12px;
}

.gram-info-tip-link:hover,
.gram-info-tip.is-open .gram-info-tip-link,
.gram-info-tip:focus-within .gram-info-tip-link {
  color: var(--primary-cyan, #0ea5e9);
  background: rgba(14, 165, 233, 0.1);
}

.gram-info-tip-pop--end {
  right: 0;
  left: auto;
  width: min(300px, calc(100vw - 48px));
}

.gram-info-tip-pop--start {
  left: 0;
  right: auto;
  width: min(300px, calc(100vw - 48px));
}

.gram-journal-page-v2 .journal-gpt-head-main {
  overflow: visible;
}

.gram-info-tip-lead--sep {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(148, 163, 184, 0.25);
}

html.theme-dark .gram-info-tip-lead--sep {
  border-top-color: rgba(71, 100, 150, 0.35);
}

#proxyPageRoot .gram-proxy-unified > .gram-proxy-pane.gram-gpt-window {
  overflow: visible;
}

#proxyPageRoot .gram-proxy-unified > .gram-proxy-pane .gram-gpt-window-body {
  overflow: visible;
}

.gram-info-tip-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted, #64748b);
  cursor: help;
  font-size: 13px;
  line-height: 1;
  transition: color 0.15s ease, background 0.15s ease;
}

.gram-info-tip-btn:hover,
.gram-info-tip.is-open .gram-info-tip-btn,
.gram-info-tip:focus-within .gram-info-tip-btn {
  color: var(--primary-cyan, #0ea5e9);
  background: rgba(14, 165, 233, 0.12);
}

.gram-info-tip-pop {
  position: absolute;
  z-index: 50;
  top: calc(100% + 6px);
  right: 0;
  width: min(268px, calc(100vw - 40px));
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-secondary, #475569);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
  pointer-events: none;
}

.gram-info-tip:hover .gram-info-tip-pop,
.gram-info-tip.is-open .gram-info-tip-pop,
.gram-info-tip:focus-within .gram-info-tip-pop {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.gram-info-tip-lead {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text, #0f172a);
}

.gram-info-tip-list {
  margin: 0;
  padding-left: 16px;
}

.gram-info-tip-list li + li {
  margin-top: 4px;
}

.gram-info-tip-pop code {
  font-size: 10px;
}

html.theme-dark .gram-info-tip-pop {
  background: #1a2744;
  border-color: rgba(71, 100, 150, 0.45);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  color: #94a3b8;
}

html.theme-dark .gram-info-tip-lead {
  color: #e2e8f0;
}

html.theme-dark .gram-info-tip-btn:hover,
html.theme-dark .gram-info-tip.is-open .gram-info-tip-btn,
html.theme-dark .gram-info-tip:focus-within .gram-info-tip-btn {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.14);
}

html.theme-dark .gram-info-tip-link:hover,
html.theme-dark .gram-info-tip.is-open .gram-info-tip-link,
html.theme-dark .gram-info-tip:focus-within .gram-info-tip-link {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
}

.proxy-panel-hint code {
  font-size: 11px;
}

.proxy-panel-body {
  padding: 12px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.proxy-pool-preview {
  max-height: 220px;
  overflow: auto;
}

.proxy-pool-line {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.proxy-pool-line:last-child {
  border-bottom: none;
}

.proxy-pool-line-idx {
  width: 28px;
  flex-shrink: 0;
  font-size: 12px;
  color: var(--text-muted);
  text-align: right;
}

.proxy-pool-line code {
  font-size: 12px;
  word-break: break-all;
}

.gram-proxy-page .gram-log-panel {
  margin-top: 4px;
}

/* —— Journal / Proxy v2 (как рассылка в ЛС) —— */
.gram-journal-page.settings-page,
.gram-proxy-layout.settings-page {
  max-width: 860px;
  margin-left: 0;
  margin-right: 0;
}

.gram-journal-page-v2.settings-page,
.gram-journal-gpt.settings-page,
.gram-journal-page-v2.gram-journal-gpt.settings-page,
.gram-proxy-layout.gram-proxy-page-v2.settings-page {
  max-width: 860px;
  width: 100%;
  margin: 0;
  gap: 12px;
}

.gram-cabinet-page.settings-page {
  max-width: 860px;
}

.journal-list-head {
  flex-wrap: wrap;
  gap: 10px;
}

.journal-tabs-inline {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.journal-tabs-inline .journal-tab {
  padding: 5px 11px;
  font-size: 12px;
}

.journal-list-body {
  padding-top: 0 !important;
}

.journal-table-compact .data-table th,
.journal-table-compact .data-table td {
  padding: 10px 14px;
  font-size: 14px;
}

.journal-table-compact .data-table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.journal-cell-title b {
  font-size: 14px;
}

.journal-cell-sub {
  display: block;
  font-size: 12px;
  margin-top: 1px;
}

.journal-cell-time {
  white-space: nowrap;
  font-size: 13px;
}

.journal-cell-result {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.journal-empty {
  padding: 20px 12px;
}

.journal-task-sheet {
  gap: 14px;
}

.journal-task-top {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.journal-task-progress-inline {
  flex: 1;
  min-width: 140px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.journal-task-progress-inline .journal-progress-track {
  flex: 1;
  margin: 0;
}

.journal-task-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-hover);
}

html.theme-dark .journal-task-facts {
  background: rgba(15, 23, 42, 0.35);
  border-color: var(--gram-border);
}

.journal-fact-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.journal-fact-value {
  font-size: 13px;
  font-weight: 600;
  word-break: break-word;
}

.journal-task-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

@media (max-width: 560px) {
  .journal-task-facts,
  .journal-task-metrics {
    grid-template-columns: 1fr 1fr;
  }
}

.journal-metric {
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  text-align: center;
}

.journal-metric span {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.journal-metric b {
  font-size: 18px;
  font-weight: 700;
}

.journal-metric-bad {
  color: #dc2626;
}

.journal-task-accounts-line {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
}

.journal-task-accounts-line code {
  font-size: 11px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.12);
  margin-right: 4px;
}

.journal-task-status-line {
  margin: 0;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--surface-hover);
}

.journal-task-log-wrap .gram-log-stream {
  max-height: 220px;
}

.gram-proxy-layout .proxy-actions-body {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.gram-proxy-layout .proxy-actions-body .gram-cta,
.gram-proxy-layout .proxy-actions-body .p-btn {
  width: auto;
}

.gram-proxy-layout .gram-proxy-input {
  min-height: 160px;
}

.gram-proxy-layout #proxyAddText,
#proxyPageRoot .gram-proxy-input {
  resize: none;
}

.gram-proxy-layout #proxyAddText {
  color: rgba(100, 116, 139, 0.42);
  caret-color: #334155;
}

.gram-proxy-layout #proxyAddText:focus {
  color: rgba(71, 85, 105, 0.55);
}

.gram-proxy-layout #proxyAddText::placeholder {
  color: rgba(148, 163, 184, 0.38);
}

html.theme-dark .gram-proxy-layout #proxyAddText {
  color: rgba(148, 163, 184, 0.34);
  caret-color: rgba(226, 232, 240, 0.82);
}

html.theme-dark .gram-proxy-layout #proxyAddText:focus {
  color: rgba(203, 213, 225, 0.5);
}

html.theme-dark .gram-proxy-layout #proxyAddText::placeholder {
  color: rgba(100, 116, 139, 0.32);
}

.gram-proxy-layout .proxy-pool-preview {
  max-height: 240px;
  min-height: 160px;
}

.gram-proxy-layout .gram-log-panel {
  margin-top: 0;
}

.journal-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 0 4px;
  font-size: 12px;
  color: var(--text-muted);
}

/* —— Journal task card v3 / Proxy v3 —— */
.journal-task-sheet {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.journal-task-headline {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.journal-task-cancel-inline {
  margin-left: auto;
  padding: 6px 12px;
  font-size: 12px;
}

.journal-task-inline-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-hover);
  font-size: 12px;
  color: var(--text-secondary);
}

html.theme-dark .journal-task-inline-stats {
  background: rgba(15, 23, 42, 0.35);
  border-color: var(--gram-border);
}

.journal-task-inline-stats b {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-left: 4px;
}

.journal-stat-bad {
  color: #dc2626;
}

.journal-task-dl {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.journal-task-dl-sub {
  margin-top: -4px;
}

.journal-task-dl-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  align-items: baseline;
}

.journal-task-dl-row:last-child {
  border-bottom: none;
}

.journal-task-dl-row dt {
  margin: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.journal-task-dl-row dd {
  margin: 0;
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
}

@media (max-width: 520px) {
  .journal-task-dl {
    grid-template-columns: 1fr;
  }
}

.journal-task-accounts-line {
  margin: 0;
  font-size: 11px;
  line-height: 1.7;
}

.journal-task-accounts-line code {
  font-size: 11px;
  padding: 2px 6px;
  margin-right: 4px;
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid var(--border);
}

.journal-task-log-wrap .gram-log-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.journal-task-log-wrap .gram-log-toolbar {
  padding: 8px 10px;
}

.journal-task-log-wrap .gram-log-stream {
  max-height: 200px;
  font-size: 12px;
}

.gram-proxy-layout .proxy-action-bar {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 8px;
}

.gram-proxy-layout .proxy-action-bar .proxy-action-btn {
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  padding: 8px 14px;
  font-size: 12px;
  line-height: 1.2;
}

.gram-proxy-layout .proxy-action-bar .proxy-btn-check {
  padding: 10px 20px;
  font-size: 13px;
  background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 55%, #1d4ed8 100%);
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow:
    0 4px 14px rgba(37, 99, 235, 0.32),
    0 0 20px rgba(56, 189, 248, 0.12);
}

.gram-proxy-layout .proxy-action-bar .proxy-btn-check:hover:not(:disabled) {
  filter: brightness(1.08);
  box-shadow:
    0 6px 18px rgba(37, 99, 235, 0.38),
    0 0 24px rgba(56, 189, 248, 0.16);
}

.gram-proxy-layout .proxy-btn-geo.is-on {
  border: 1px solid rgba(16, 185, 129, 0.55);
  color: #059669;
  background: rgba(16, 185, 129, 0.08);
}

.gram-proxy-layout .proxy-btn-geo.is-on:hover:not(:disabled) {
  border-color: rgba(16, 185, 129, 0.75);
  background: rgba(16, 185, 129, 0.14);
}

html.theme-dark .gram-proxy-layout .proxy-btn-geo.is-on {
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.45);
  background: rgba(16, 185, 129, 0.12);
}

.gram-proxy-layout .gram-log-panel {
  margin-top: 0;
}

.gram-proxy-unified > .gram-log-panel {
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.gram-proxy-layout .gram-proxy-hero-icon {
  background: linear-gradient(135deg, #22d3ee 0%, #3b82f6 52%, #06b6d4 100%);
  color: #fff;
  box-shadow: 0 4px 18px rgba(34, 211, 238, 0.38);
}

html.theme-dark .gram-proxy-layout .gram-proxy-hero-icon {
  background: linear-gradient(135deg, #22d3ee 0%, #2563eb 48%, #0891b2 100%);
  color: #fff;
  box-shadow: 0 4px 22px rgba(34, 211, 238, 0.42);
}

.gram-proxy-layout #proxyOpenPoolBtn.proxy-pool-head-btn {
  border: 1px solid rgba(34, 211, 238, 0.55) !important;
  box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.12);
  background: rgba(15, 23, 42, 0.25);
}

html:not(.theme-dark) .gram-proxy-layout #proxyOpenPoolBtn.proxy-pool-head-btn {
  border: 1px solid rgba(37, 99, 235, 0.45) !important;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.08);
  background: rgba(248, 250, 252, 0.9);
}

html.theme-dark .gram-proxy-layout #proxyOpenPoolBtn.proxy-pool-head-btn {
  border-color: rgba(34, 211, 238, 0.55) !important;
  background: rgba(15, 23, 42, 0.45);
}

/* —— Proxy v2 — в одну линию с журналом задач —— */
body:has(#proxyPageRoot) #pageTitle {
  display: none;
}

.gram-proxy-layout.gram-proxy-page-v2.gram-gpt-layout {
  gap: 12px;
}

.gram-proxy-layout.gram-proxy-page-v2 .journal-gpt-head-desc {
  margin: 4px 0 0 52px;
}

.gram-proxy-layout.gram-proxy-page-v2 .journal-gpt-head-row {
  flex-wrap: wrap;
  row-gap: 6px;
}

.gram-proxy-layout.gram-proxy-page-v2 .journal-gpt-head-row .gram-page-doc-pill {
  margin-left: 2px;
}

.gram-proxy-layout.gram-proxy-page-v2 #proxyOpenPoolBtn.proxy-pool-head-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  padding: 8px 14px;
  border-radius: 999px;
  line-height: 1.1;
  cursor: pointer;
  box-shadow: none !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.gram-proxy-layout.gram-proxy-page-v2 #proxyOpenPoolBtn.proxy-pool-head-btn #proxyPoolTab {
  display: block;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: normal;
}

.gram-proxy-layout.gram-proxy-page-v2 #proxyOpenPoolBtn .journal-gpt-total-label {
  margin-top: 2px;
}

html:not(.theme-dark) .gram-proxy-layout.gram-proxy-page-v2 #proxyOpenPoolBtn.proxy-pool-head-btn {
  border: 1px solid rgba(14, 165, 233, 0.28) !important;
  background: linear-gradient(135deg, rgba(224, 242, 254, 0.75), rgba(255, 255, 255, 0.9)) !important;
  color: #64748b;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.1) !important;
}

html:not(.theme-dark) .gram-proxy-layout.gram-proxy-page-v2 #proxyOpenPoolBtn.proxy-pool-head-btn #proxyPoolTab {
  color: #0f172a;
}

html.theme-dark .gram-proxy-layout.gram-proxy-page-v2 #proxyOpenPoolBtn.proxy-pool-head-btn {
  border: 1px solid rgba(56, 189, 248, 0.28) !important;
  background: linear-gradient(135deg, rgba(21, 34, 56, 0.85), rgba(15, 23, 42, 0.55)) !important;
  color: #94a3b8;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.08) !important;
}

html.theme-dark .gram-proxy-layout.gram-proxy-page-v2 #proxyOpenPoolBtn.proxy-pool-head-btn #proxyPoolTab {
  color: #e2e8f0;
}

#journalPageRoot.settings-page {
  max-width: 720px;
  width: 100%;
  margin: 0;
  gap: 12px;
}

#proxyPageRoot.settings-page {
  max-width: 720px;
  width: 100%;
  margin: 0;
  gap: 12px;
}

.gram-proxy-unified.journal-gpt-card {
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
}

#proxyPageRoot.gram-ml-glass .gram-proxy-unified.journal-gpt-card {
  border: 1px solid rgba(71, 100, 150, 0.32);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.06),
    0 10px 36px rgba(2, 8, 23, 0.22),
    0 0 28px rgba(56, 189, 248, 0.04);
}

#proxyPageRoot.gram-ml-glass #proxyAddText.gram-proxy-input {
  border-radius: 12px;
  border: 1px solid rgba(71, 100, 150, 0.32);
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

#proxyPageRoot.gram-ml-glass #proxyAddText.gram-proxy-input:focus {
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 0 0 3px rgba(56, 189, 248, 0.12);
}

html:not(.theme-dark) #proxyPageRoot.gram-ml-glass #proxyAddText.gram-proxy-input {
  background: rgba(248, 250, 252, 0.92);
  border-color: rgba(148, 163, 184, 0.4);
}

html:not(.theme-dark) #proxyPageRoot.gram-ml-glass #proxyAddText.gram-proxy-input:focus {
  border-color: rgba(14, 165, 233, 0.5);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12);
}

html.theme-dark #proxyPageRoot.gram-ml-glass .gram-proxy-unified.journal-gpt-card {
  background: #152238;
  border-color: rgba(56, 189, 248, 0.24);
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.1),
    0 8px 28px rgba(0, 0, 0, 0.35),
    0 0 24px rgba(56, 189, 248, 0.05);
}

html:not(.theme-dark) #proxyPageRoot.gram-ml-glass .gram-proxy-unified.journal-gpt-card {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(148, 163, 184, 0.35);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.85),
    0 8px 32px rgba(15, 23, 42, 0.08),
    0 0 20px rgba(56, 189, 248, 0.06);
}

#proxyPageRoot.gram-ml-glass .gram-proxy-unified > .gram-proxy-pane .gram-gpt-window-head {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.1) 0%, rgba(15, 23, 42, 0.02) 100%);
  border-bottom-color: rgba(56, 189, 248, 0.16);
}

html:not(.theme-dark) #proxyPageRoot.gram-ml-glass .gram-proxy-unified > .gram-proxy-pane .gram-gpt-window-head {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.08) 0%, rgba(255, 255, 255, 0.45) 100%);
  border-bottom-color: rgba(148, 163, 184, 0.3);
}

#proxyPageRoot.gram-ml-glass .journal-gpt-head {
  border: 1px solid rgba(71, 100, 150, 0.28);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.1) 0%, rgba(15, 23, 42, 0.28) 48%, rgba(37, 99, 235, 0.08) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 14px 16px;
  margin-bottom: 4px;
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.06),
    0 8px 28px rgba(2, 8, 23, 0.2);
}

html.theme-dark #proxyPageRoot.gram-ml-glass .journal-gpt-head {
  background: linear-gradient(135deg, rgba(21, 34, 56, 0.92) 0%, rgba(15, 23, 42, 0.78) 55%, rgba(30, 58, 138, 0.22) 100%);
  border-color: rgba(56, 189, 248, 0.24);
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.08),
    0 8px 28px rgba(0, 0, 0, 0.32),
    0 0 32px rgba(56, 189, 248, 0.06);
}

html:not(.theme-dark) #proxyPageRoot.gram-ml-glass .journal-gpt-head {
  background: linear-gradient(135deg, rgba(224, 242, 254, 0.65) 0%, rgba(255, 255, 255, 0.88) 50%, rgba(219, 234, 254, 0.55) 100%);
  border-color: rgba(148, 163, 184, 0.35);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.9),
    0 8px 28px rgba(15, 23, 42, 0.08);
}

.gram-proxy-unified > .gram-proxy-pane,
.gram-proxy-unified > .gram-log-panel {
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.gram-proxy-unified > .gram-proxy-pane {
  border-bottom: 1px solid rgba(71, 100, 150, 0.25);
}

html:not(.theme-dark) .gram-proxy-unified > .gram-proxy-pane {
  border-bottom-color: #e2e8f0;
}

.gram-proxy-unified > .gram-proxy-pane .gram-gpt-window-head {
  background: transparent;
  border-bottom: 1px solid rgba(71, 100, 150, 0.22);
}

html:not(.theme-dark) .gram-proxy-unified > .gram-proxy-pane .gram-gpt-window-head {
  background: #f8fafc;
  border-bottom-color: #e2e8f0;
}

html.theme-dark .gram-proxy-unified > .gram-proxy-pane .gram-gpt-window-head {
  background: transparent;
  border-bottom-color: rgba(71, 100, 150, 0.28);
}

.gram-proxy-unified > .gram-log-panel {
  margin-top: 0;
}

/* Внутренние цвета прокси = journal-gpt-card (#152238), не чёрный log-console */
html.theme-dark #proxyPageRoot .gram-proxy-unified.journal-gpt-card {
  background: #152238;
  border-color: rgba(56, 189, 248, 0.24);
}

html.theme-dark #proxyPageRoot .gram-proxy-unified .gram-log-panel,
html.theme-dark #proxyPageRoot .gram-proxy-unified .gram-log-body,
html.theme-dark #proxyPageRoot .gram-proxy-unified .gram-log-toolbar,
html.theme-dark #proxyPageRoot .gram-proxy-unified .gram-log-progress-wrap,
html.theme-dark #proxyPageRoot .gram-proxy-unified .gram-log-stream,
html.theme-dark #proxyPageRoot .gram-proxy-unified .gram-log-footer {
  background: #152238 !important;
  box-shadow: none !important;
}

html.theme-dark #proxyPageRoot .gram-proxy-unified .gram-log-toolbar {
  border-bottom-color: rgba(71, 100, 150, 0.28) !important;
}

html.theme-dark #proxyPageRoot .gram-proxy-unified .gram-log-progress-wrap {
  border-bottom-color: rgba(71, 100, 150, 0.22) !important;
}

html.theme-dark #proxyPageRoot .gram-proxy-unified .gram-log-footer {
  border-top-color: rgba(71, 100, 150, 0.28) !important;
  color: #94a3b8;
}

html.theme-dark #proxyPageRoot .gram-proxy-unified .gram-log-filter {
  border-color: rgba(71, 100, 150, 0.38);
  background: rgba(15, 23, 42, 0.45);
  color: #94a3b8;
}

html.theme-dark #proxyPageRoot .gram-proxy-unified .gram-log-search {
  border-color: rgba(71, 100, 150, 0.38);
  background: rgba(15, 23, 42, 0.45);
  color: #cbd5e1;
}

html.theme-dark #proxyPageRoot .gram-proxy-unified .gram-proxy-pane .gram-gpt-window-head,
html.theme-dark #proxyPageRoot .gram-proxy-unified .gram-proxy-pane .gram-gpt-window-body {
  background: #152238 !important;
}

html.theme-dark #proxyPageRoot .gram-proxy-unified .gram-proxy-pane .gram-gpt-window-head {
  border-bottom-color: rgba(71, 100, 150, 0.28) !important;
}

html.theme-dark #proxyPageRoot .gram-proxy-unified .gram-proxy-pane.gram-gpt-window,
html.theme-dark #proxyPageRoot .gram-proxy-unified .gram-gpt-audience-body {
  background: #152238 !important;
  box-shadow: none !important;
}

html.theme-dark #proxyPageRoot .gram-proxy-unified .proxy-action-bar.gram-action-bar {
  background: transparent !important;
  border-color: rgba(71, 100, 150, 0.28) !important;
  border-left: none;
  border-right: none;
  border-bottom: none;
  border-radius: 0;
}

html.theme-dark #proxyPageRoot .gram-proxy-unified #proxyAddText {
  background: rgba(15, 23, 42, 0.45) !important;
  border-color: rgba(71, 100, 150, 0.38) !important;
  color: #94a3b8 !important;
  caret-color: #cbd5e1;
}

html.theme-dark #proxyPageRoot .gram-proxy-unified #proxyAddText:focus {
  color: #cbd5e1 !important;
  border-color: rgba(56, 189, 248, 0.45) !important;
}

html.theme-dark #proxyPageRoot .gram-proxy-unified #proxyAddText::placeholder {
  color: rgba(100, 116, 139, 0.72) !important;
}

html.theme-dark #proxyPageRoot .gram-proxy-unified .gram-field-hint {
  color: #64748b;
}

html.theme-dark #proxyPageRoot .gram-proxy-unified .gram-field-hint code {
  color: #94a3b8;
  background: rgba(15, 23, 42, 0.45);
}

html:not(.theme-dark) #proxyPageRoot .gram-proxy-unified.journal-gpt-card {
  background: #fff;
  border-color: #e2e8f0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

html:not(.theme-dark) #proxyPageRoot .gram-proxy-unified .gram-log-panel,
html:not(.theme-dark) #proxyPageRoot .gram-proxy-unified .gram-log-body,
html:not(.theme-dark) #proxyPageRoot .gram-proxy-unified .gram-log-toolbar,
html:not(.theme-dark) #proxyPageRoot .gram-proxy-unified .gram-log-progress-wrap,
html:not(.theme-dark) #proxyPageRoot .gram-proxy-unified .gram-log-stream,
html:not(.theme-dark) #proxyPageRoot .gram-proxy-unified .gram-log-footer {
  background: #fff !important;
  box-shadow: none !important;
}

html:not(.theme-dark) #proxyPageRoot .gram-proxy-unified .gram-log-toolbar {
  background: #f8fafc !important;
  border-bottom-color: #e2e8f0 !important;
}

html:not(.theme-dark) #proxyPageRoot .gram-proxy-unified .gram-log-progress-wrap {
  border-bottom-color: #e2e8f0 !important;
}

html:not(.theme-dark) #proxyPageRoot .gram-proxy-unified .gram-log-footer {
  border-top-color: #e2e8f0 !important;
}

html:not(.theme-dark) #proxyPageRoot .gram-proxy-unified .gram-proxy-pane .gram-gpt-window-head {
  background: #f8fafc !important;
  border-bottom-color: #e2e8f0 !important;
}

html:not(.theme-dark) #proxyPageRoot .gram-proxy-unified #proxyAddText {
  background: #fff !important;
  border-color: #cbd5e1 !important;
  color: #0f172a !important;
}

#proxyPageRoot #proxyLog .gram-log-line {
  grid-template-columns: 44px 24px max-content minmax(0, 1fr);
  column-gap: 8px;
  white-space: normal;
  width: 100%;
  min-width: 0;
}

#proxyPageRoot #proxyLog .gram-log-id {
  max-width: none;
  padding-right: 0;
}

#proxyPageRoot #proxyLog .gram-log-msg {
  white-space: normal;
  overflow-wrap: anywhere;
  min-width: 0;
}

html.theme-dark .gram-journal-page .gram-module-hero-icon.gram-tone-cyan,
html.theme-dark .gram-proxy-layout .gram-module-hero-icon.gram-tone-cyan:not(.gram-proxy-hero-icon) {
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.35), rgba(59, 130, 246, 0.35));
}

.panel-modal-card.gram-modal-sheet .journal-task-sheet {
  gap: 10px;
}

.panel-modal-card.gram-modal-sheet .journal-task-dl-row {
  padding: 7px 10px;
}

.panel-modal-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.cabinet-kv {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
  margin: 0;
}

.cabinet-kv dt {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.cabinet-kv dd {
  margin: 2px 0 0;
  font-size: 14px;
  font-weight: 600;
}

.cabinet-check-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  font-size: 14px;
  cursor: pointer;
}

.cabinet-sub-progress {
  margin-top: 10px;
}

.cabinet-task-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

.cabinet-task-row:last-child {
  border-bottom: none;
}

.cabinet-plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.cabinet-plan-card {
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-hover);
}

.cabinet-plan-card.is-current {
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.12);
}

.cabinet-plan-card.cabinet-plan-tone-blue {
  border-color: rgba(59, 130, 246, 0.42);
  background: linear-gradient(165deg, rgba(59, 130, 246, 0.1) 0%, var(--surface-hover) 55%);
  box-shadow: 0 0 24px rgba(59, 130, 246, 0.1);
}

.cabinet-plan-card.cabinet-plan-tone-violet {
  border-color: rgba(139, 92, 246, 0.42);
  background: linear-gradient(165deg, rgba(139, 92, 246, 0.1) 0%, var(--surface-hover) 55%);
  box-shadow: 0 0 24px rgba(139, 92, 246, 0.1);
}

.cabinet-plan-card.cabinet-plan-tone-amber {
  border-color: rgba(245, 158, 11, 0.42);
  background: linear-gradient(165deg, rgba(245, 158, 11, 0.1) 0%, var(--surface-hover) 55%);
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.1);
}

.cabinet-plan-card.cabinet-plan-tone-rose {
  border-color: rgba(244, 63, 94, 0.42);
  background: linear-gradient(165deg, rgba(244, 63, 94, 0.1) 0%, var(--surface-hover) 55%);
  box-shadow: 0 0 24px rgba(244, 63, 94, 0.12);
}

.cabinet-plan-card.cabinet-plan-tone-emerald {
  border-color: rgba(16, 185, 129, 0.42);
  background: linear-gradient(165deg, rgba(16, 185, 129, 0.1) 0%, var(--surface-hover) 55%);
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.1);
}

.cabinet-plan-card.cabinet-plan-tone-cyan {
  border-color: rgba(6, 182, 212, 0.42);
  background: linear-gradient(165deg, rgba(6, 182, 212, 0.1) 0%, var(--surface-hover) 55%);
  box-shadow: 0 0 24px rgba(6, 182, 212, 0.1);
}

.cabinet-plan-card.cabinet-plan-tone-slate {
  border-color: rgba(148, 163, 184, 0.35);
  background: var(--surface-hover);
}

.cabinet-limit-hint .gram-info-tip-link {
  padding: 0 4px;
}

.cabinet-pay-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.cabinet-pay-btn.p-btn-secondary {
  padding: 6px 12px;
  font-size: 13px;
  line-height: 1.25;
  text-decoration: none;
}

.cabinet-pay-yookassa.p-btn-secondary {
  border-color: rgba(59, 130, 246, 0.42);
  color: #2563eb;
}

.cabinet-pay-yookassa.p-btn-secondary:hover {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.55);
}

.cabinet-pay-crypto.p-btn-secondary {
  border-color: rgba(139, 92, 246, 0.42);
  color: #7c3aed;
}

.cabinet-pay-crypto.p-btn-secondary:hover {
  background: rgba(139, 92, 246, 0.1);
  border-color: rgba(139, 92, 246, 0.55);
}

.cabinet-pay-admin.p-btn-secondary {
  border-color: rgba(148, 163, 184, 0.45);
  color: var(--text-secondary);
}

.cabinet-pay-admin.p-btn-secondary:hover {
  background: var(--surface-hover);
  border-color: rgba(148, 163, 184, 0.6);
}

.cabinet-purchase-limits-copy {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.cabinet-purchase-limits-copy .gram-field-hint {
  margin: 0;
  line-height: 1.45;
}

.cabinet-plan-card h4 {
  margin: 0 0 6px;
  font-size: 15px;
}

.cabinet-plan-price {
  margin: 8px 0 4px;
  font-size: 20px;
  font-weight: 700;
}

.cabinet-plan-features {
  margin: 10px 0;
  padding-left: 18px;
  font-size: 12px;
  color: var(--text-secondary);
}

.cabinet-section-title {
  margin: 16px 0 10px;
  font-size: 14px;
  font-weight: 600;
}

.cabinet-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.cabinet-stat-grid b {
  display: block;
  font-size: 18px;
}

.cabinet-stat-grid span {
  font-size: 11px;
  color: var(--text-muted);
}

.cabinet-ref-link {
  display: block;
  margin: 12px 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-hover);
  font-size: 12px;
  word-break: break-all;
}

.cabinet-ref-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.cabinet-ref-row:last-child {
  border-bottom: none;
}

.cabinet-ref-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.cabinet-amb-period {
  flex-wrap: wrap;
  margin: 12px 0;
}

.cabinet-amb-period .is-active {
  border-color: rgba(56, 189, 248, 0.55);
  background: rgba(56, 189, 248, 0.12);
}

.cabinet-amb-reject {
  color: #fca5a5;
  margin-bottom: 10px;
}

.gram-textarea {
  min-height: 72px;
  resize: vertical;
}

.cabinet-api-form .gram-field-label {
  display: block;
  margin: 10px 0 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.cabinet-api-form .gram-input {
  width: 100%;
}

.gram-cab-api-provider .gram-gpt-window-head {
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.gram-cab-api-head-text {
  flex: 1;
  min-width: 0;
}

.gram-cab-api-head-text .gram-field-hint {
  margin: 4px 0 0;
}

.gram-cab-api-form-box {
  margin-bottom: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--gram-border, var(--border)) 80%, transparent);
  background: color-mix(in srgb, var(--gram-surface-2, var(--surface-2, #12161f)) 88%, transparent);
}

.gram-cab-api-form-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.gram-cab-api-form-actions {
  margin-top: 14px;
  flex-wrap: wrap;
  gap: 8px;
}

.gram-cab-api-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gram-cab-api-empty {
  margin: 8px 0 4px;
  color: var(--text-muted);
  font-size: 13px;
}

.gram-cab-api-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--gram-border, var(--border)) 75%, transparent);
  background: color-mix(in srgb, var(--gram-surface, var(--surface, #0f131a)) 92%, transparent);
}

.gram-cab-api-card.is-active {
  border-color: color-mix(in srgb, #3b82f6 45%, var(--gram-border, var(--border)));
  box-shadow: 0 0 0 1px color-mix(in srgb, #3b82f6 18%, transparent);
}

.gram-cab-api-card-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.gram-cab-api-card-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.gram-cab-api-card-name {
  font-size: 14px;
  font-weight: 650;
}

.gram-cab-api-card-meta {
  font-size: 12px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gram-cab-api-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.gram-cab-api-del {
  padding: 6px 10px;
}

@media (max-width: 640px) {
  .cabinet-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .cabinet-kv {
    grid-template-columns: 1fr;
  }
}

html.theme-dark .gram-cabinet-page .gram-module-hero-icon.gram-tone-violet {
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.35), rgba(124, 58, 237, 0.35));
}

/* Journal summary + modal tabs */
.journal-summary-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.journal-summary-card {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-hover);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.journal-summary-card span {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.journal-summary-card b {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
}

.journal-summary-run {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.06);
}

.journal-modal-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.journal-modal-tab {
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.journal-modal-tab.active {
  color: var(--text);
  border-color: rgba(59, 130, 246, 0.45);
  background: rgba(59, 130, 246, 0.1);
}

.journal-modal-pane {
  display: none;
}

.journal-modal-pane.active {
  display: block;
}

.journal-modal-pane[data-jmodal-pane="log"] .journal-task-log-wrap {
  margin-top: 0;
}

.gram-cta-electric {
  background: linear-gradient(135deg, #22d3ee 0%, #2563eb 50%, #7c3aed 100%);
  color: #fff;
  border: none;
  box-shadow: 0 4px 18px rgba(37, 99, 235, 0.35);
}

.gram-cta-electric:hover {
  filter: brightness(1.08);
  box-shadow: 0 6px 22px rgba(34, 211, 238, 0.4);
}

.gram-cta-electric:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: none;
  box-shadow: none;
}

@media (max-width: 720px) {
  .journal-summary-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* —— Journal v2 compact (GramGPT density) —— */
.gram-journal-page-v2.settings-page {
  max-width: 860px;
  width: 100%;
  margin: 0;
  gap: 8px;
}

/* Journal task modal — компактная карточка как у GramGPT */
.panel-modal-card.gram-journal-task-modal {
  width: min(460px, calc(100vw - 28px));
  max-width: 460px;
}

html.theme-dark .panel-modal-card.gram-journal-task-modal {
  background: #152238;
  border: 1px solid rgba(56, 189, 248, 0.24);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  color: #e8eef7;
}

html.theme-dark .panel-modal-card.gram-journal-task-modal .panel-modal-header {
  border-bottom: 1px solid rgba(71, 100, 150, 0.28);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.1), rgba(99, 102, 241, 0.06));
}

html.theme-dark .panel-modal-card.gram-journal-task-modal .panel-modal-title {
  color: #f8fafc;
}

html.theme-dark .panel-modal-card.gram-journal-task-modal .gram-modal-sub {
  color: #94a3b8;
}

html.theme-dark .panel-modal-card.gram-journal-task-modal .panel-modal-footer {
  border-top: 1px solid rgba(71, 100, 150, 0.28);
}

html.theme-dark .panel-modal-card.gram-journal-task-modal .panel-modal-close {
  color: #e2e8f0;
  background: transparent;
  border: none;
}

html.theme-dark .panel-modal-card.gram-journal-task-modal .panel-modal-close:hover {
  color: #fff;
  background: rgba(56, 189, 248, 0.12);
}

.panel-modal-card.gram-journal-task-modal .panel-modal-body {
  padding: 0 14px 12px;
  max-height: min(78vh, 640px);
  overflow-y: auto;
}

.panel-modal-card.gram-journal-task-modal .journal-gpt-section {
  border: none;
  background: transparent;
  border-radius: 0;
  padding: 10px 0 0;
  border-top: 1px solid rgba(71, 100, 150, 0.22);
}

.panel-modal-card.gram-journal-task-modal .journal-gpt-result-strip {
  border-style: solid;
  border-color: rgba(16, 185, 129, 0.28);
  background: rgba(16, 185, 129, 0.08);
}

.panel-modal-card.gram-journal-task-modal .journal-gpt-result-strip-run {
  border-color: rgba(56, 189, 248, 0.28);
  background: rgba(14, 165, 233, 0.08);
}

.panel-modal-card.gram-journal-task-modal .panel-modal-header {
  padding: 12px 14px 10px;
}

.panel-modal-card.gram-journal-task-modal .panel-modal-title {
  font-size: 16px;
  line-height: 1.25;
}

.panel-modal-card.gram-journal-task-modal .gram-modal-sub {
  margin: 2px 0 0;
  font-size: 11px;
}

.panel-modal-card.gram-journal-task-modal .panel-modal-footer {
  padding: 10px 14px 12px;
}

.gram-journal-page-v2 .journal-summary-row {
  display: none;
}

.gram-journal-page-v2 .gram-page-head,
.gram-journal-page-v2 .gram-module-hero {
  margin-bottom: 0;
}

.journal-v2-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 2px;
}

.journal-v2-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.journal-v2-title-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(14, 165, 233, 0.12);
  color: #0284c7;
  font-size: 15px;
}

.journal-v2-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.journal-v2-desc {
  margin: 4px 0 0 44px;
  font-size: 12px;
  color: var(--text-muted, #64748b);
}

.gram-journal-page-v2 .journal-summary-row {
  display: none;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 10px;
  padding: 0;
  background: transparent;
  border: none;
}

.gram-journal-page-v2 .journal-summary-card {
  flex: 1 1 auto;
  min-width: 88px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border, rgba(148, 163, 184, 0.28));
  background: rgba(15, 23, 42, 0.18);
}

.gram-journal-page-v2 .journal-summary-card span {
  font-size: 10px;
  letter-spacing: 0.04em;
}

.gram-journal-page-v2 .journal-summary-card b {
  font-size: 15px;
  margin-top: 1px;
}

.gram-journal-page-v2 .journal-summary-run {
  border-color: rgba(14, 165, 233, 0.28);
  background: rgba(14, 165, 233, 0.08);
}

.journal-v2-main-card {
  border: 1px solid var(--border, rgba(148, 163, 184, 0.32));
  border-radius: 12px;
  background: var(--surface, #fff);
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

html.theme-dark .journal-v2-main-card {
  background: rgba(15, 23, 42, 0.42);
  border-color: var(--gram-border, rgba(71, 100, 150, 0.35));
}

.journal-v2-card-head {
  padding: 8px 12px 0;
  border-bottom: none;
}

.journal-v2-tabs .journal-tab {
  padding: 4px 10px;
  font-size: 11px;
  border-radius: 999px;
}

.journal-v2-filters {
  padding: 8px 12px 10px;
  border-bottom: 1px solid var(--border, rgba(148, 163, 184, 0.22));
}

.journal-v2-filters-body { gap: 0; }

.journal-v2-filter-grid {
  display: grid;
  grid-template-columns: minmax(120px, 1.1fr) minmax(110px, 1fr) minmax(118px, 0.9fr) minmax(118px, 0.9fr) minmax(140px, 1.3fr) auto;
  gap: 8px;
  align-items: end;
}

.journal-v2-filter-label {
  font-size: 10px;
  margin-bottom: 2px;
}

.journal-v2-filter-input {
  min-height: 32px;
  padding: 5px 8px;
  font-size: 11px;
  border-radius: 8px;
}

.journal-v2-filter-actions {
  display: flex;
  gap: 6px;
  padding-bottom: 1px;
}

.journal-v2-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--border, rgba(148, 163, 184, 0.4));
  background: transparent;
  color: var(--text-muted, #64748b);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.journal-v2-filter-btn-primary {
  color: #fff;
  border-color: rgba(14, 165, 233, 0.5);
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
}

.journal-v2-table-wrap {
  overflow-x: auto;
}

.journal-v2-table {
  width: 100%;
  border-collapse: collapse;
}

.journal-v2-table thead th {
  padding: 8px 12px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted, #64748b);
  border-bottom: 1px solid var(--border, rgba(148, 163, 184, 0.22));
  background: rgba(148, 163, 184, 0.06);
}

.journal-v2-table tbody td {
  padding: 8px 12px;
  font-size: 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  vertical-align: middle;
}

.journal-v2-table tbody tr:last-child td { border-bottom: none; }

.journal-v2-total-badge {
  min-width: 58px;
  padding: 6px 10px;
  border-radius: 10px;
}

.journal-v2-total-badge b { font-size: 18px; }

.journal-v2-module-pill {
  padding: 3px 8px;
  font-size: 10px;
}

.journal-v2-row-sub {
  margin-top: 2px;
  font-size: 10px;
  max-width: 180px;
}

.journal-v2-status {
  font-size: 11px;
  gap: 5px;
}

.journal-v2-result { font-size: 11px; }

.journal-v2-action-btn {
  width: 28px;
  height: 28px;
  border-radius: 999px;
}

.journal-v2-col-actions { width: 76px; }

.gram-journal-page-v2 .journal-pagination {
  padding: 8px 12px 10px;
  margin: 0;
}

/* Task card compact */
.journal-task-sheet-compact {
  gap: 10px;
}

.journal-task-hero-compact {
  padding: 12px 14px;
  border-radius: 10px;
}

.journal-task-hero-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.journal-task-hero-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.journal-task-hero-stat {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.journal-task-hero-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.journal-task-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  font-size: 11px;
  color: var(--text-muted, #64748b);
}

.journal-task-hero-meta b {
  color: var(--text, #0f172a);
  font-weight: 700;
}

html.theme-dark .journal-task-hero-meta b { color: #e2e8f0; }

.journal-task-kv-compact {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  overflow: hidden;
}

.journal-task-kv-compact .journal-task-kv-row {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 8px;
  align-items: start;
  padding: 7px 10px;
  margin: 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.journal-task-kv-compact .journal-task-kv-row:nth-child(odd) {
  background: rgba(148, 163, 184, 0.04);
}

.journal-task-kv-compact .journal-task-kv-row:last-child {
  border-bottom: none;
}

.journal-task-kv-compact .journal-task-kv-wide {
  grid-column: 1 / -1;
}

.journal-task-kv-compact dt {
  margin: 0;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #64748b);
  line-height: 1.4;
}

.journal-task-kv-compact dd {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
  color: var(--text, #0f172a);
  word-break: break-word;
}

html.theme-dark .journal-task-kv-compact dd { color: #e2e8f0; }

.journal-task-kv-compact .journal-task-chip {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.journal-task-hero-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  margin-bottom: 0;
}

.journal-task-hero-progress .journal-progress-track {
  flex: 1;
  height: 4px;
}

.journal-task-hero-compact .journal-task-hero-value {
  font-size: 20px;
  line-height: 1;
}

.journal-task-hero-compact .journal-task-hero-label {
  font-size: 11px;
  white-space: nowrap;
}

.journal-task-hero-compact .journal-status-badge {
  margin: 0;
  white-space: nowrap;
}

.journal-v2-filter-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.journal-v2-filter-search {
  grid-column: span 2;
}

.journal-v2-filter-actions {
  grid-column: span 1;
  justify-content: flex-end;
}

.journal-v2-table {
  min-width: 0;
}

.journal-v2-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.journal-task-section-log {
  padding: 0;
  border: none;
  background: transparent;
}

.journal-task-section-log .journal-task-log-wrap {
  margin: 0;
}

.journal-task-section-log .gram-log-panel {
  border: 1px solid rgba(148, 163, 184, 0.28);
}

.journal-task-hero-row,
.journal-task-hero-topline,
.journal-task-hero-metrics {
  /* legacy — сохранено для совместимости */
}

.journal-task-hero-compact .journal-task-hero-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-size: 16px;
}

.journal-task-hero-compact .journal-task-hero-value {
  font-size: 22px;
}

.journal-task-hero-topline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.journal-task-hero-compact .journal-task-hero-label {
  font-size: 11px;
  margin-top: 0;
}

.journal-task-hero-compact .journal-status-badge {
  padding: 2px 8px;
  font-size: 10px;
}

.journal-task-hero-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 4px;
  padding: 0;
  border: none;
  background: transparent;
  font-size: 11px;
}

.journal-task-hero-metrics span { color: var(--text-muted, #64748b); }

.journal-task-hero-compact .journal-task-hero-actions {
  gap: 6px;
}

.journal-task-hero-compact .journal-task-hero-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  justify-content: center;
  border-radius: 999px;
}

.journal-task-hero-compact .journal-task-hero-btn i { margin: 0; }

.journal-task-hero-progress {
  margin-top: 10px;
  margin-bottom: 0;
}

.journal-task-hero-progress .journal-progress-track {
  height: 4px;
}

.journal-task-section-compact {
  padding: 10px 12px;
  border-radius: 10px;
}

.journal-task-section-compact .journal-task-section-title {
  margin-bottom: 8px;
  font-size: 12px;
}

.journal-task-section-compact .journal-task-params {
  gap: 8px 12px;
}

.journal-task-section-compact .journal-task-param-label {
  font-size: 10px;
  margin-bottom: 2px;
}

.journal-task-section-compact .journal-task-param-value {
  font-size: 12px;
}

.journal-task-section-compact .journal-task-chip,
.journal-task-section-compact .journal-task-acc-chip {
  padding: 2px 8px;
  font-size: 10px;
}

.journal-task-section-log .journal-task-log-wrap .gram-log-panel {
  border-radius: 8px;
  box-shadow: none;
}

.journal-task-section-log .journal-task-log-wrap .gram-log-toolbar {
  padding: 6px 8px;
  flex-wrap: wrap;
  gap: 6px;
}

.journal-task-section-log .journal-task-log-wrap .gram-log-heading {
  font-size: 11px;
}

.journal-task-section-log .journal-task-log-wrap .gram-log-stream {
  min-height: 140px;
  max-height: min(36vh, 280px);
  font-size: 10px;
}

.journal-task-section-log .journal-task-log-wrap .gram-log-line {
  padding: 2px 8px;
  font-size: 10px;
  grid-template-columns: 48px 24px minmax(72px, max-content) auto;
  gap: 4px 10px;
}

.panel-modal-card.gram-modal-sheet .journal-task-sheet-compact {
  gap: 10px;
}

.panel-modal-card.gram-modal-sheet .panel-modal-body {
  padding-top: 10px;
  padding-bottom: 10px;
}

@media (max-width: 960px) {
  .journal-v2-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .journal-v2-filter-actions {
    grid-column: 1 / -1;
  }
  .journal-v2-desc { margin-left: 0; }
}

@media (max-width: 720px) {
  .journal-v2-filter-grid { grid-template-columns: 1fr; }
  .journal-v2-table { min-width: 620px; }
  .journal-task-params { grid-template-columns: 1fr; }
}

.journal-v2-total-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6366f1;
}

html.theme-dark .journal-v2-total-badge {
  background: rgba(99, 102, 241, 0.16);
  border-color: rgba(129, 140, 248, 0.35);
}

html.theme-dark .journal-v2-total-badge b { color: #e2e8f0; }

.journal-v2-th-inner {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.journal-v2-row { cursor: pointer; transition: background 0.12s ease; }
.journal-v2-row:hover { background: rgba(148, 163, 184, 0.08); }

.journal-v2-date-day {
  display: block;
  font-size: 11px;
  font-weight: 600;
}

.journal-v2-date-time {
  display: block;
  margin-top: 1px;
  font-size: 10px;
  color: var(--text-muted, #64748b);
}

.journal-v2-module-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
}

.journal-v2-tone-cyan { color: #0891b2; background: rgba(6, 182, 212, 0.12); border-color: rgba(6, 182, 212, 0.25); }
.journal-v2-tone-blue { color: #2563eb; background: rgba(37, 99, 235, 0.1); border-color: rgba(37, 99, 235, 0.22); }
.journal-v2-tone-green { color: #16a34a; background: rgba(22, 163, 74, 0.1); border-color: rgba(22, 163, 74, 0.22); }
.journal-v2-tone-indigo { color: #4f46e5; background: rgba(79, 70, 229, 0.1); border-color: rgba(79, 70, 229, 0.22); }
.journal-v2-tone-violet { color: #7c3aed; background: rgba(124, 58, 237, 0.1); border-color: rgba(124, 58, 237, 0.22); }
.journal-v2-tone-purple { color: #9333ea; background: rgba(147, 51, 234, 0.1); border-color: rgba(147, 51, 234, 0.22); }
.journal-v2-tone-amber { color: #d97706; background: rgba(217, 119, 6, 0.1); border-color: rgba(217, 119, 6, 0.22); }
.journal-v2-tone-rose { color: #e11d48; background: rgba(225, 29, 72, 0.1); border-color: rgba(225, 29, 72, 0.22); }

.journal-v2-row-sub {
  display: block;
  color: var(--text-muted, #64748b);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.journal-v2-status {
  display: inline-flex;
  align-items: center;
  font-weight: 600;
}

.journal-v2-status-run { color: #0284c7; }
.journal-v2-status-ok { color: #16a34a; }
.journal-v2-status-bad { color: #dc2626; }
.journal-v2-status-muted { color: #64748b; }

.journal-v2-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  justify-content: flex-end;
}

.journal-v2-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border, rgba(148, 163, 184, 0.4));
  background: transparent;
  color: var(--text-muted, #64748b);
  cursor: pointer;
}

.journal-v2-action-btn:hover {
  color: #0284c7;
  border-color: rgba(14, 165, 233, 0.45);
  background: rgba(14, 165, 233, 0.08);
}

.journal-task-sheet-v2,
.journal-task-sheet-compact {
  display: flex;
  flex-direction: column;
}

.journal-task-hero-ok {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.14), rgba(5, 150, 105, 0.06));
  border: 1px solid rgba(16, 185, 129, 0.24);
}

.journal-task-hero-run {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.14), rgba(2, 132, 199, 0.06));
  border: 1px solid rgba(14, 165, 233, 0.24);
}

.journal-task-hero-bad {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(220, 38, 38, 0.06));
  border: 1px solid rgba(239, 68, 68, 0.22);
}

.journal-task-hero-muted {
  background: linear-gradient(135deg, rgba(100, 116, 139, 0.1), rgba(71, 85, 105, 0.06));
  border: 1px solid rgba(100, 116, 139, 0.22);
}

.journal-task-hero-main {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.journal-task-hero-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.45);
  flex-shrink: 0;
}

.journal-task-hero-ok .journal-task-hero-icon { color: #16a34a; }
.journal-task-hero-run .journal-task-hero-icon { color: #0284c7; }
.journal-task-hero-bad .journal-task-hero-icon { color: #dc2626; }
.journal-task-hero-muted .journal-task-hero-icon { color: #64748b; }

html.theme-dark .journal-task-hero-icon { background: rgba(15, 23, 42, 0.35); }

.journal-task-hero-actions {
  display: flex;
  flex-shrink: 0;
}

.journal-task-hero-btn {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(255, 255, 255, 0.5);
  color: var(--text, #0f172a);
  cursor: pointer;
}

html.theme-dark .journal-task-hero-btn {
  background: rgba(15, 23, 42, 0.45);
  border-color: var(--gram-border, rgba(71, 100, 150, 0.35));
  color: #e2e8f0;
}

.journal-task-section {
  border: 1px dashed rgba(148, 163, 184, 0.35);
  background: rgba(248, 250, 252, 0.4);
}

html.theme-dark .journal-task-section {
  background: rgba(15, 23, 42, 0.22);
  border-color: rgba(71, 100, 150, 0.32);
}

.journal-task-section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-weight: 700;
}

.journal-task-params {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.journal-task-param-wide { grid-column: 1 / -1; }

.journal-task-param-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.journal-task-chip,
.journal-task-acc-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(14, 165, 233, 0.22);
  background: rgba(14, 165, 233, 0.07);
  color: #0369a1;
}

.journal-task-acc-chip {
  font-family: "JetBrains Mono", ui-monospace, monospace;
}

.journal-task-chip-more {
  border-color: rgba(99, 102, 241, 0.28);
  background: rgba(99, 102, 241, 0.08);
  color: #4f46e5;
}

html.theme-dark .journal-task-chip,
html.theme-dark .journal-task-acc-chip {
  color: #67e8f9;
  border-color: rgba(34, 211, 238, 0.22);
  background: rgba(34, 211, 238, 0.07);
}

.panel-modal-footer .p-btn-primary#journalGoToTaskBtn {
  margin-right: auto;
}

/* —— Journal GramGPT 1:1 (все задачи) —— */
body:has(#journalPageRoot) #pageTitle {
  display: none;
}

.gram-journal-gpt.settings-page,
.gram-journal-page-v2.gram-journal-gpt.settings-page {
  /* width/align — см. блок Journal / Proxy v2 выше */
  gap: 12px;
}

.journal-gpt-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 2px;
}

.journal-gpt-head-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.journal-gpt-head-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.22), rgba(37, 99, 235, 0.12));
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  font-size: 18px;
  flex-shrink: 0;
}

.journal-gpt-head-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.15;
}

.gram-page-doc-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(148, 163, 184, 0.08);
  color: var(--text-muted, #64748b);
  font-size: 14px;
  text-decoration: none;
  flex-shrink: 0;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.gram-page-doc-link:hover {
  color: var(--primary-cyan, #0ea5e9);
  border-color: rgba(14, 165, 233, 0.45);
  background: rgba(14, 165, 233, 0.1);
}

html.theme-dark .gram-page-doc-link {
  border-color: rgba(71, 100, 150, 0.4);
  background: rgba(15, 23, 42, 0.45);
  color: #94a3b8;
}

html.theme-dark .gram-page-doc-link:hover {
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(56, 189, 248, 0.12);
}

.gram-page-doc-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(148, 163, 184, 0.08);
  color: var(--text-muted, #64748b);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  flex-shrink: 0;
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.gram-page-doc-pill:hover {
  color: var(--primary-cyan, #0ea5e9);
  border-color: rgba(14, 165, 233, 0.45);
  background: rgba(14, 165, 233, 0.1);
}

html.theme-dark .gram-page-doc-pill {
  border-color: rgba(71, 100, 150, 0.4);
  background: rgba(15, 23, 42, 0.45);
  color: #94a3b8;
}

html.theme-dark .gram-page-doc-pill:hover {
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(56, 189, 248, 0.12);
}

.journal-gpt-head-desc {
  margin: 0;
  font-size: 12px;
  color: var(--muted, #64748b);
}

.journal-gpt-head-sub {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px 8px;
  margin: 4px 0 0 52px;
}

.journal-gpt-total {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(71, 100, 150, 0.35);
  background: rgba(15, 23, 42, 0.35);
  line-height: 1.1;
  flex-shrink: 0;
}

.journal-gpt-total b {
  font-size: 20px;
  font-weight: 800;
  color: var(--text, #e2e8f0);
}

.journal-gpt-total-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted, #64748b);
}

html:not(.theme-dark) .journal-gpt-total {
  background: rgba(248, 250, 252, 0.85);
  border-color: rgba(148, 163, 184, 0.35);
}

html:not(.theme-dark) .journal-gpt-total b {
  color: #0f172a;
}

.journal-gpt-card {
  border: 1px solid rgba(71, 100, 150, 0.32);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.28);
  overflow: visible;
}

html.theme-dark .journal-gpt-card {
  background: #152238;
  border-color: rgba(56, 189, 248, 0.24);
}

html:not(.theme-dark) .journal-gpt-card {
  background: var(--gram-surface, #fff);
  border-color: rgba(148, 163, 184, 0.35);
}

.journal-gpt-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(71, 100, 150, 0.25);
  overflow: visible;
}

.journal-gpt-filter-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-left: auto;
}

.journal-gpt-filter,
.journal-gpt-filter-range {
  box-sizing: border-box;
}

select.journal-gpt-filter {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  padding-right: 28px;
  cursor: pointer;
}

select.journal-gpt-filter option {
  background: #0f172a;
  color: #e2e8f0;
}

html:not(.theme-dark) select.journal-gpt-filter option {
  background: #fff;
  color: #0f172a;
}

.journal-gpt-filter {
  height: 36px;
  line-height: 1.2;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid rgba(71, 100, 150, 0.38);
  background: rgba(15, 23, 42, 0.45);
  font-size: 12px;
  color: var(--text, #e2e8f0);
  min-width: 0;
  flex-shrink: 0;
}

html:not(.theme-dark) .journal-gpt-filter {
  background: var(--gram-surface, #fff);
  color: #0f172a;
  border-color: rgba(148, 163, 184, 0.45);
}

.journal-gpt-filter-module {
  width: 148px;
}

.journal-gpt-filter-status {
  width: 132px;
}

.journal-gpt-filter-range {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 36px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid rgba(71, 100, 150, 0.38);
  background: rgba(15, 23, 42, 0.45);
  flex-shrink: 0;
}

html:not(.theme-dark) .journal-gpt-filter-range {
  background: var(--gram-surface, #fff);
  border-color: rgba(148, 163, 184, 0.45);
}

.journal-gpt-filter-range-icon {
  color: var(--muted, #64748b);
  font-size: 12px;
}

.journal-gpt-filter-range .journal-gpt-filter-date {
  width: 108px;
  border: none;
  background: transparent;
  padding: 0 2px;
  height: 32px;
  background-image: none;
  padding-right: 2px;
}

.journal-gpt-filter-sep {
  color: var(--muted, #94a3b8);
  font-size: 12px;
}

.journal-gpt-filter-search {
  flex: 1 1 160px;
  min-width: 120px;
  max-width: 220px;
}

.journal-gpt-filter-apply,
.journal-gpt-filter-clear {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  flex-shrink: 0;
  white-space: nowrap;
}

.journal-gpt-filter-apply {
  background: #0ea5e9;
  color: #fff;
  border-color: #0284c7;
}

.journal-gpt-filter-clear {
  background: transparent;
  color: var(--muted, #94a3b8);
  border-color: rgba(71, 100, 150, 0.38);
}

.journal-gpt-table-wrap {
  overflow-x: auto;
}

.journal-gpt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.journal-gpt-table thead th {
  padding: 8px 10px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted, #64748b);
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
  white-space: nowrap;
}

.journal-gpt-table thead th span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.journal-gpt-sort {
  font-size: 10px;
  opacity: 0.5;
}

.journal-gpt-table tbody td {
  padding: 9px 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
  vertical-align: middle;
}

.journal-gpt-table tbody tr:last-child td {
  border-bottom: none;
}

.journal-gpt-row {
  cursor: pointer;
  transition: background 0.12s ease;
}

.journal-gpt-row:hover {
  background: rgba(148, 163, 184, 0.08);
}

.journal-gpt-th-found,
.journal-gpt-td-found {
  text-align: center;
}

.journal-gpt-th-actions,
.journal-gpt-td-actions {
  width: 72px;
  text-align: center;
}

.journal-gpt-kw-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.journal-gpt-kw-tag {
  display: inline-flex;
  max-width: 120px;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(14, 165, 233, 0.25);
  background: rgba(14, 165, 233, 0.08);
  color: #0369a1;
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.journal-gpt-kw-tag-lg {
  max-width: none;
  font-size: 11px;
  padding: 3px 9px;
}

.journal-gpt-kw-more,
.journal-gpt-kw-empty {
  font-size: 10px;
  color: var(--muted, #94a3b8);
}

.journal-gpt-actions {
  display: flex;
  justify-content: center;
  gap: 4px;
}

.journal-gpt-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(71, 100, 150, 0.4);
  background: rgba(15, 23, 42, 0.35);
  color: var(--muted, #94a3b8);
  cursor: pointer;
}

html:not(.theme-dark) .journal-gpt-action-btn {
  background: transparent;
  border-color: rgba(148, 163, 184, 0.45);
  color: #64748b;
}

.journal-gpt-action-btn:hover {
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(14, 165, 233, 0.1);
}

.journal-gpt-module-pill,
.journal-gpt-table .journal-v2-module-pill,
.gram-journal-gpt .journal-v2-module-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  color: #67e8f9 !important;
  background: rgba(56, 189, 248, 0.1) !important;
  border: 1px solid rgba(56, 189, 248, 0.32) !important;
}

.gram-journal-gpt .journal-v2-tone-cyan,
.gram-journal-gpt .journal-v2-tone-blue,
.gram-journal-gpt .journal-v2-tone-green,
.gram-journal-gpt .journal-v2-tone-indigo,
.gram-journal-gpt .journal-v2-tone-violet,
.gram-journal-gpt .journal-v2-tone-purple,
.gram-journal-gpt .journal-v2-tone-amber,
.gram-journal-gpt .journal-v2-tone-rose,
.gram-journal-gpt .journal-v2-tone-pink,
.gram-journal-gpt .journal-v2-tone-emerald,
.gram-journal-gpt .journal-v2-tone-orange,
.gram-journal-gpt .journal-v2-tone-slate {
  color: #67e8f9 !important;
  background: rgba(56, 189, 248, 0.1) !important;
  border-color: rgba(56, 189, 248, 0.32) !important;
}

.journal-gpt-module-pill .pi,
.journal-gpt-table .journal-v2-module-pill .pi {
  font-size: 11px;
}

.journal-gpt-found {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-weight: 700;
  color: #4ade80;
  font-size: 12px;
}

.journal-gpt-found .pi {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(74, 222, 128, 0.45);
  font-size: 10px;
}

.journal-gpt-found-run {
  color: #38bdf8;
}

.journal-gpt-found-run .pi {
  border-color: rgba(56, 189, 248, 0.45);
}

.gram-journal-gpt .journal-pagination {
  padding: 8px 12px 10px;
}

/* Journal task modal — GramGPT card */
.journal-gpt-modal-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.journal-gpt-modal-badge-wrap .journal-status-badge {
  font-size: 10px;
  padding: 2px 8px;
}

.journal-task-sheet-gpt {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.journal-gpt-result-strip {
  border-radius: 10px;
  padding: 10px 12px;
  border: 1px dashed rgba(71, 100, 150, 0.35);
  background: rgba(15, 23, 42, 0.22);
}

.journal-gpt-result-strip-ok {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.08);
}

.journal-gpt-result-strip-run {
  border-color: rgba(14, 165, 233, 0.35);
  background: rgba(14, 165, 233, 0.08);
}

.journal-gpt-result-strip-bad {
  border-color: rgba(239, 68, 68, 0.32);
  background: rgba(239, 68, 68, 0.06);
}

.journal-gpt-result-strip-muted {
  border-color: rgba(100, 116, 139, 0.32);
  background: rgba(100, 116, 139, 0.06);
}

.journal-gpt-strip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.journal-gpt-found-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.12);
  color: #4ade80;
}

.journal-gpt-result-strip-run .journal-gpt-found-box {
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(14, 165, 233, 0.12);
  color: #38bdf8;
}

.journal-gpt-result-strip-bad .journal-gpt-found-box {
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
}

.journal-gpt-found-box .pi-check,
.journal-gpt-found-box .pi-sync {
  font-size: 14px;
}

.journal-gpt-found-box-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #e2e8f0);
}

.journal-gpt-found-box-text b {
  font-size: 15px;
  font-weight: 800;
  margin-right: 4px;
}

.journal-gpt-strip-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.journal-gpt-strip-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(71, 100, 150, 0.4);
  background: rgba(15, 23, 42, 0.45);
  font-size: 11px;
  font-weight: 600;
  color: var(--text, #e2e8f0);
  cursor: pointer;
  white-space: nowrap;
}

html:not(.theme-dark) .journal-gpt-strip-btn {
  background: #fff;
  border-color: #cbd5e1;
  color: #0f172a;
}

html:not(.theme-dark) .journal-gpt-strip-btn:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

html:not(.theme-dark) .journal-gpt-found-box-text,
html:not(.theme-dark) .journal-gpt-found-box-text b {
  color: #0f172a;
}

.journal-gpt-export-caret {
  font-size: 9px;
  opacity: 0.7;
}

.journal-gpt-strip-top,
.journal-gpt-strip-left,
.journal-gpt-strip-value,
.journal-gpt-strip-label {
  /* legacy strip layout — kept for old markup */
}

.journal-gpt-strip-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
  font-size: 11px;
  color: var(--muted, #64748b);
}

.journal-gpt-strip-meta b {
  color: var(--text, #0f172a);
}

.journal-gpt-strip-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.journal-gpt-strip-progress .journal-progress-track {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.25);
  overflow: hidden;
}

.journal-gpt-strip-pct {
  font-size: 11px;
  font-weight: 700;
  color: #0284c7;
  min-width: 32px;
}

.journal-gpt-section {
  border: 1px dashed rgba(56, 189, 248, 0.22);
  border-radius: 10px;
  padding: 10px 12px;
  background: rgba(14, 165, 233, 0.06);
}

html.theme-dark .journal-gpt-section {
  background: rgba(14, 165, 233, 0.07);
  border-color: rgba(56, 189, 248, 0.24);
}

html:not(.theme-dark) .journal-gpt-section {
  background: rgba(248, 250, 252, 0.45);
  border-color: rgba(148, 163, 184, 0.35);
}

.journal-gpt-params-kw {
  margin-bottom: 8px;
}

.journal-gpt-params-label {
  display: block;
  font-size: 11px;
  color: var(--muted, #94a3b8);
  margin-bottom: 6px;
}

.journal-gpt-status-badge {
  font-size: 9px;
  letter-spacing: 0.04em;
}

.panel-modal-card.gram-journal-task-modal .panel-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.journal-gpt-modal-footer-left {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
}

.journal-gpt-modal-close {
  margin-left: 0;
}

.journal-gpt-result-side {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.journal-gpt-result-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: var(--muted, #94a3b8);
}

.journal-gpt-result-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  color: var(--muted, #94a3b8);
  text-decoration: none;
}

.journal-gpt-result-link:hover {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
}

.journal-gpt-section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
}

.journal-gpt-kw-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.journal-gpt-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.journal-gpt-metric-v2 {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  padding: 10px 9px;
  min-width: 0;
  max-width: 92px;
  min-height: 52px;
  border-radius: 10px;
  border: 1px solid rgba(56, 189, 248, 0.28);
  background: rgba(14, 165, 233, 0.1);
}

html.theme-dark .journal-gpt-metric-v2 {
  border-color: rgba(56, 189, 248, 0.32);
  background: rgba(14, 165, 233, 0.12);
}

.journal-gpt-metric-v2 .journal-gpt-metric-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #38bdf8;
}

.journal-gpt-metric-v2 .journal-gpt-metric-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--text, #e2e8f0);
  line-height: 1.3;
  word-break: break-word;
  max-width: 100%;
}

.journal-gpt-metric-v2 .journal-gpt-metric-value .pi {
  color: #38bdf8;
  margin-right: 4px;
}

.journal-gpt-metric {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(255, 255, 255, 0.5);
  font-size: 11px;
  color: var(--text, #334155);
}

html.theme-dark .journal-gpt-metric {
  background: rgba(14, 165, 233, 0.1);
  border-color: rgba(56, 189, 248, 0.22);
  color: #e2e8f0;
}

.journal-gpt-metric .pi {
  font-size: 11px;
  color: #0284c7;
}

.journal-gpt-params-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 8px;
}

.panel-modal-card.gram-journal-task-modal .journal-gpt-params-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.panel-modal-card.gram-journal-task-modal .journal-gpt-params-grid .journal-gpt-metric-v2 {
  max-width: none;
  width: 100%;
  min-height: 64px;
  align-items: center;
  text-align: center;
  padding: 10px 8px;
  box-sizing: border-box;
}

.panel-modal-card.gram-journal-task-modal .journal-gpt-params-grid .journal-gpt-metric-label {
  width: 100%;
  line-height: 1.25;
  text-wrap: balance;
}

.panel-modal-card.gram-journal-task-modal .journal-gpt-params-grid .journal-gpt-metric-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.panel-modal-card.gram-journal-task-modal .journal-gpt-log-wrap .gram-log-line {
  grid-template-columns: 44px 24px minmax(0, max-content) minmax(0, 1fr);
  column-gap: 10px;
  white-space: normal;
  width: 100%;
  min-width: 0;
}

.panel-modal-card.gram-journal-task-modal .journal-gpt-log-wrap .gram-log-mark {
  width: 24px;
  min-width: 24px;
  justify-self: center;
}

.panel-modal-card.gram-journal-task-modal .journal-gpt-log-wrap .gram-log-id.is-empty {
  display: none;
}

.panel-modal-card.gram-journal-task-modal .journal-gpt-log-wrap .gram-log-line:has(.gram-log-id.is-empty) {
  grid-template-columns: 44px 24px minmax(0, 1fr);
}

.panel-modal-card.gram-journal-task-modal .journal-gpt-log-wrap .gram-log-msg {
  white-space: normal;
  word-break: break-word;
}

.panel-modal-card.gram-journal-task-modal .journal-gpt-log-wrap .gram-log-progress-wrap[hidden] {
  display: none !important;
}

.journal-gpt-log-wrap {
  border-radius: 8px;
  border: 1px solid rgba(71, 100, 150, 0.28);
  background: rgba(8, 12, 22, 0.35);
  overflow: visible;
}

.panel-modal-card.gram-journal-task-modal .journal-gpt-log-wrap .gram-log-panel {
  margin-top: 0;
}

.panel-modal-card.gram-journal-task-modal .journal-gpt-log-wrap .gram-log-stream {
  max-height: min(42vh, 360px);
  overflow-y: auto;
  overflow-x: hidden;
}

html:not(.theme-dark) .journal-gpt-log-wrap {
  background: #fff;
  border-color: rgba(148, 163, 184, 0.35);
}

.journal-gpt-section-export {
  padding-bottom: 10px;
}

.journal-gpt-export-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.journal-gpt-export-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(71, 100, 150, 0.35);
  background: rgba(15, 23, 42, 0.35);
  color: var(--text, #e2e8f0);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
}

html:not(.theme-dark) .journal-gpt-export-btn {
  background: #fff;
  border-color: rgba(148, 163, 184, 0.4);
  color: #0f172a;
}

.journal-gpt-export-btn:hover {
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(14, 165, 233, 0.08);
}

.journal-gpt-export-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(14, 165, 233, 0.12);
  color: #38bdf8;
  flex-shrink: 0;
}

.journal-gpt-export-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.journal-gpt-export-text b {
  font-size: 12px;
  font-weight: 700;
}

.journal-gpt-export-text small {
  font-size: 10px;
  color: var(--muted, #94a3b8);
  line-height: 1.35;
}

.journal-gpt-export-dl {
  font-size: 12px;
  color: var(--muted, #94a3b8);
  flex-shrink: 0;
}

.journal-gpt-section-results {
  padding-bottom: 8px;
}

.journal-gpt-results {
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.journal-gpt-result-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  border-radius: 8px;
}

.journal-gpt-result-row:hover {
  background: rgba(148, 163, 184, 0.1);
}

.journal-gpt-result-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.12);
  color: #0284c7;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}

.journal-gpt-result-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.journal-gpt-result-title {
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.journal-gpt-result-sub {
  font-size: 12px;
  color: #94a3b8;
}

html.theme-dark .journal-gpt-result-sub {
  color: #cbd5e1;
}

.journal-gpt-result-time {
  font-size: 10px;
  color: var(--muted, #94a3b8);
  flex-shrink: 0;
}

.journal-gpt-result-empty {
  padding: 12px 4px;
  font-size: 11px;
  color: var(--muted, #94a3b8);
  text-align: center;
}

.journal-gpt-result-row-v2 .journal-gpt-result-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-muted);
}

.journal-gpt-result-avatar-ok {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.journal-gpt-result-badge {
  flex-shrink: 0;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
}

.journal-gpt-result-badge-ok {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.journal-gpt-result-row-v2.journal-gpt-result-summary {
  border: 1px solid rgba(34, 197, 94, 0.22);
  background: rgba(34, 197, 94, 0.06);
}

.journal-gpt-filters .journal-gpt-custom-select {
  flex: 0 0 auto;
  min-width: 0;
  max-width: none;
}

.journal-gpt-filters #journalFilterModuleWrap {
  width: 168px;
}

.journal-gpt-filters #journalFilterStatusWrap {
  width: 148px;
}

.journal-gpt-filters .journal-gpt-select-btn {
  height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 12px;
}

.journal-gpt-filters .gram-gpt-select-btn i {
  font-size: 10px;
}

html:not(.theme-dark) .gram-journal-gpt.settings-page {
  color: #0f172a;
}

html:not(.theme-dark) .journal-gpt-head-title {
  color: #0f172a;
}

html:not(.theme-dark) .journal-gpt-head-desc {
  color: #64748b;
}

html:not(.theme-dark) .journal-gpt-card {
  background: #fff;
  border-color: #e2e8f0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

html:not(.theme-dark) .journal-gpt-filters {
  background: #f8fafc;
  border-bottom-color: #e2e8f0;
}

html:not(.theme-dark) .journal-gpt-filter,
html:not(.theme-dark) .journal-gpt-filter-range {
  background: #fff;
  border-color: #cbd5e1;
  color: #0f172a;
}

html:not(.theme-dark) .journal-gpt-filter::placeholder {
  color: #94a3b8;
}

html:not(.theme-dark) .journal-gpt-filters .gram-gpt-select-btn {
  background: #fff;
  border-color: #cbd5e1;
  color: #0f172a;
}

html:not(.theme-dark) .journal-gpt-table thead th {
  background: #f8fafc;
  color: #64748b;
  border-bottom-color: #e2e8f0;
}

html:not(.theme-dark) .journal-gpt-table tbody td {
  border-bottom-color: #f1f5f9;
  color: #0f172a;
}

html:not(.theme-dark) .journal-gpt-row:hover {
  background: #f8fafc;
}

html:not(.theme-dark) .journal-gpt-module-pill,
html:not(.theme-dark) .gram-journal-gpt .journal-v2-module-pill,
html:not(.theme-dark) .gram-journal-gpt [class*="journal-v2-tone-"] {
  color: #0369a1 !important;
  background: rgba(14, 165, 233, 0.1) !important;
  border-color: rgba(14, 165, 233, 0.28) !important;
}

html:not(.theme-dark) .journal-gpt-total {
  background: #fff;
  border-color: #e2e8f0;
}

html:not(.theme-dark) .journal-gpt-total b {
  color: #0f172a;
}

html:not(.theme-dark) .journal-gpt-action-btn {
  background: #fff;
  border-color: #cbd5e1;
  color: #64748b;
}

html:not(.theme-dark) .journal-gpt-found {
  color: #16a34a;
}

@media (max-width: 640px) {
  .journal-gpt-head-sub { margin-left: 0; }
  .journal-gpt-head-desc { margin-left: 0; }
  .journal-gpt-filters { flex-direction: column; align-items: stretch; }
  .journal-gpt-filter-search { flex: 1 1 auto; }
  .journal-gpt-strip-top { flex-direction: column; }
  .journal-gpt-strip-actions { flex-direction: row; flex-wrap: wrap; }
  .journal-gpt-table { min-width: 640px; }
}

.gram-dist-count {
  margin-left: 0.45em;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted, #64748b);
}

.gram-parsing-page .gram-gpt-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.gram-parsing-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.gram-parsing-mode-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: var(--surface, #fff);
  color: var(--text, #1e293b);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.gram-parsing-mode-chip input { display: none; }

.gram-parsing-mode-chip.is-active {
  border-color: rgba(59, 130, 246, 0.75);
  background: rgba(59, 130, 246, 0.14);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.25);
}

html:not(.theme-dark) .gram-parsing-mode-chip {
  background: var(--surface, #fff);
  border-color: rgba(148, 163, 184, 0.45);
  color: var(--text, #1e293b);
}

html:not(.theme-dark) .gram-parsing-mode-chip.is-active {
  border-color: rgba(59, 130, 246, 0.65);
  background: rgba(59, 130, 246, 0.08);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.2);
}

.gram-parsing-modes-hint {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--text-muted, #94a3b8);
}

.gram-parsing-bio-row {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

html.theme-dark .gram-parsing-page .gram-gpt-window {
  background: #152238;
  border-color: rgba(71, 100, 150, 0.28);
}

html.theme-dark .gram-parsing-mode-chip {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(148, 163, 184, 0.35);
}

html.theme-dark .gram-parsing-mode-chip.is-active {
  border-color: rgba(96, 165, 250, 0.95);
  background: rgba(59, 130, 246, 0.2);
  box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.55), 0 0 12px rgba(59, 130, 246, 0.18);
}

.gram-parsing-results-panel {
  margin-top: 14px;
  border: 1px solid var(--border, rgba(148, 163, 184, 0.45));
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface, #ffffff);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

html:not(.theme-dark) .gram-parsing-results-panel {
  background: var(--surface, #fff);
  border-color: rgba(148, 163, 184, 0.35);
  color: var(--text, #1e293b);
}

html.theme-dark .gram-parsing-page .gram-parsing-results-panel,
html.theme-dark .gram-parsing-results-panel {
  background: #152238;
  border-color: rgba(71, 100, 150, 0.35);
}

.gram-parsing-results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.gram-parsing-results-head-main {
  display: flex;
  align-items: center;
  gap: 12px;
}

.gram-parsing-results-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--text, #0f172a);
}

.gram-parsing-results-desc {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--text-muted, #64748b);
}

.gram-parsing-results-collapse {
  border: 0;
  background: transparent;
  color: var(--text-muted, #94a3b8);
  cursor: pointer;
  padding: 6px;
}

.gram-parsing-run-tabs {
  display: flex;
  gap: 6px;
  padding: 8px 14px 0;
  border-bottom: 1px solid var(--border, rgba(148, 163, 184, 0.25));
}

.gram-parsing-run-tab {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-muted, #64748b);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.gram-parsing-run-tab.active {
  color: var(--text, #0f172a);
  background: var(--surface-hover, #f8fafc);
  border-bottom-color: #2563eb;
}

.gram-parsing-run-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
}

.gram-parsing-results-body {
  padding: 0;
  display: flex;
  flex-direction: column;
}

.gram-parsing-run-tabpanel {
  display: none;
  flex-direction: column;
}

.gram-parsing-run-tabpanel.is-active {
  display: flex;
}

html.theme-dark .gram-parsing-run-tab {
  color: #94a3b8;
}

html.theme-dark .gram-parsing-run-tab.active {
  color: #e2e8f0;
  background: rgba(30, 41, 59, 0.55);
  border-bottom-color: #38bdf8;
}

html.theme-dark .gram-parsing-run-tab-badge {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
}

.gram-parsing-results-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border, rgba(148, 163, 184, 0.25));
  font-size: 12px;
  color: var(--text-muted, #64748b);
}

.gram-parsing-results-summary-text b {
  color: #2563eb;
  font-size: 15px;
}

html.theme-dark .gram-parsing-results-summary-text b {
  color: #38bdf8;
}

.gram-parsing-results-meta b {
  color: var(--text, #0f172a);
}

html:not(.theme-dark) .gram-parsing-result-name {
  color: var(--text, #1e293b);
}

html.theme-dark .gram-parsing-results-meta b { color: #e2e8f0; }

.gram-parsing-results-toolbar {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border, rgba(148, 163, 184, 0.25));
}

.gram-parsing-results-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(2, 6, 23, 0.25);
}

html:not(.theme-dark) .gram-parsing-results-search-wrap {
  background: var(--surface, #fff);
  border-color: rgba(148, 163, 184, 0.35);
}

html:not(.theme-dark) .gram-parsing-result-row {
  background: var(--surface, #fff);
  border-color: rgba(148, 163, 184, 0.25);
}

.gram-parsing-page .gram-gpt-param-input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.gram-parsing-page .gram-gpt-param-input[type="number"]::-webkit-outer-spin-button,
.gram-parsing-page .gram-gpt-param-input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.gram-parsing-results-search {
  border: 0;
  background: transparent;
  color: inherit;
  width: 100%;
  min-width: 180px;
  outline: none;
}

.gram-parsing-results-list {
  max-height: 280px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 14px 14px;
}

.gram-parsing-result-row {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(2, 6, 23, 0.22);
}

.gram-parsing-result-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(59, 130, 246, 0.12);
  color: #60a5fa;
  flex-shrink: 0;
}

.gram-parsing-result-row.is-ok .gram-parsing-result-icon { background: rgba(34, 197, 94, 0.12); color: #4ade80; }
.gram-parsing-result-row.is-err .gram-parsing-result-icon { background: rgba(239, 68, 68, 0.12); color: #f87171; }

.gram-parsing-result-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.gram-parsing-result-name {
  font-size: 13px;
  font-weight: 600;
  word-break: break-all;
}

.gram-parsing-result-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  opacity: 0.85;
}

.gram-parsing-result-msg {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted, #94a3b8);
}

.gram-parsing-result-acc {
  display: inline-block;
  margin-right: 6px;
  font-weight: 600;
  color: #93c5fd;
}

.gram-parsing-results-empty {
  padding: 18px 12px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted, #94a3b8);
}

.gram-parsing-results-panel.is-collapsed .gram-parsing-results-body { display: none; }

.gram-parsing-modes-window.gram-gpt-window {
  overflow: visible;
}

.gram-parsing-modes-window .gram-gpt-window-head {
  overflow: visible;
  position: relative;
  z-index: 2;
}

.gram-parsing-modes-window .gram-gpt-window-title-row .gram-info-tip-inline {
  margin-left: 2px;
}

.gram-parsing-modes-window .gram-gpt-window-title-row .gram-info-tip-link {
  padding: 2px 4px;
  line-height: 1;
}

.gram-parsing-modes-window .gram-gpt-window-title-row .gram-info-tip-pop {
  top: calc(100% + 6px);
  bottom: auto;
  left: 0;
  right: auto;
  z-index: 200;
  min-width: 260px;
  max-width: min(320px, calc(100vw - 32px));
  transform: translateY(-4px);
}

.gram-parsing-modes-window .gram-info-tip:hover .gram-info-tip-pop,
.gram-parsing-modes-window .gram-info-tip.is-open .gram-info-tip-pop,
.gram-parsing-modes-window .gram-info-tip:focus-within .gram-info-tip-pop {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.gram-parsing-page #moduleLiveLog.gram-log-panel {
  margin-top: 0;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: var(--surface, #fff);
  overflow: hidden;
}

html:not(.theme-dark) .gram-parsing-page #moduleLiveLog .gram-log-toolbar,
html:not(.theme-dark) .gram-parsing-page #moduleLiveLog .gram-log-body,
html:not(.theme-dark) .gram-parsing-page #moduleLiveLog .gram-log-stream,
html:not(.theme-dark) .gram-parsing-page #moduleLiveLog .gram-log-footer,
html:not(.theme-dark) .gram-parsing-page #moduleLiveLog .gram-log-progress-wrap {
  background: var(--surface, #fff) !important;
}

html:not(.theme-dark) .gram-parsing-page #moduleLiveLog .gram-log-toolbar {
  border-bottom-color: rgba(148, 163, 184, 0.25) !important;
}

html:not(.theme-dark) .gram-parsing-page #moduleLiveLog .gram-log-footer {
  border-top-color: rgba(148, 163, 184, 0.25) !important;
}

html:not(.theme-dark) .gram-parsing-page #moduleLiveLog .gram-log-empty {
  color: #64748b;
}

html.theme-dark .gram-parsing-page #moduleLiveLog.gram-log-panel {
  border-color: rgba(71, 100, 150, 0.28);
  background: rgba(8, 12, 22, 0.35);
}

html.theme-dark .gram-parsing-page #moduleLiveLog .gram-log-toolbar,
html.theme-dark .gram-parsing-page #moduleLiveLog .gram-log-body,
html.theme-dark .gram-parsing-page #moduleLiveLog .gram-log-stream,
html.theme-dark .gram-parsing-page #moduleLiveLog .gram-log-footer,
html.theme-dark .gram-parsing-page #moduleLiveLog .gram-log-progress-wrap {
  background: #152238 !important;
}

.gram-parsing-page #moduleLiveLog .gram-log-stream {
  overflow-x: hidden;
  max-height: min(42vh, 320px);
}

.gram-parsing-page #moduleLiveLog .gram-log-id.is-empty {
  display: none;
}

.gram-parsing-page #moduleLiveLog .gram-log-msg {
  white-space: normal;
  word-break: break-word;
}

.gram-parsing-page #moduleLiveLog .gram-log-line {
  grid-template-columns: 44px 24px minmax(88px, max-content) minmax(0, 1fr);
  column-gap: 10px;
  white-space: normal;
  width: 100%;
  min-width: 0;
}

.gram-parsing-page #moduleLiveLog .gram-log-line:has(.gram-log-id.is-empty) {
  grid-template-columns: 44px 24px minmax(0, 1fr);
}

.gram-parsing-page #moduleLiveLog .gram-log-footer {
  flex-wrap: wrap;
  row-gap: 8px;
  align-items: flex-start;
}

.gram-parsing-page #moduleLiveLog .gram-log-footer-meta {
  flex: 1 1 180px;
  min-width: 0;
}

.gram-parsing-page #moduleLiveLog .gram-log-footer-actions {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  margin-left: auto;
}

.gram-parsing-page #moduleLiveLog .gram-log-icon-btn .gram-log-btn-label {
  display: none !important;
}

.gram-parsing-page #moduleLiveLog .gram-log-result-hint {
  word-break: break-word;
}

/* Masslooking — inherits gram-spam-page dark theme */
.gram-masslooking-page.gram-spam-page .gram-gpt-window {
  border-color: rgba(71, 100, 150, 0.28);
}

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

.gram-ml-mode-row {
  margin-bottom: 14px;
}

.gram-ml-mode-row .gram-gpt-pill-field {
  margin-bottom: 0;
}

.gram-ml-param-grid {
  margin-bottom: 14px;
}

.gram-masslooking-page .gram-field-wrap.is-frozen {
  opacity: 0.55;
  pointer-events: none;
}

.gram-ml-reactions {
  margin: 4px 0 14px;
}

.gram-ml-emoji-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.gram-ml-emoji {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: var(--surface, #fff);
  font-size: 1.1rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}

.gram-ml-emoji.is-active {
  border-color: transparent;
  background: linear-gradient(135deg, rgba(244, 114, 182, 0.22), rgba(236, 72, 153, 0.18));
  box-shadow: 0 0 0 1px rgba(244, 114, 182, 0.45), 0 0 12px rgba(244, 114, 182, 0.25);
  transform: scale(1.04);
}

.gram-ml-story-react-card {
  margin-top: 0;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(244, 114, 182, 0.35);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(253, 242, 248, 0.55));
  box-shadow: 0 0 0 1px rgba(244, 114, 182, 0.08);
  min-width: 0;
}

.gram-ml-story-react-card.is-on {
  border-color: rgba(244, 114, 182, 0.5);
  box-shadow: 0 0 20px rgba(244, 114, 182, 0.12);
}

html.theme-dark .gram-ml-story-react-card {
  background: linear-gradient(145deg, rgba(21, 34, 56, 0.95), rgba(30, 20, 40, 0.55));
  border-color: rgba(244, 114, 182, 0.28);
}

.gram-ml-story-react-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
}

.gram-ml-story-react-head .gram-mr-mode-title {
  flex: 1;
  margin: 0;
}

.gram-ml-story-react-toggle {
  flex-shrink: 0;
  margin-left: auto;
}

.gram-ml-story-react-sub,
.gram-ml-story-react-hint {
  margin: 8px 0 0;
  font-size: 11px;
  line-height: 1.35;
  color: var(--text-muted);
}

.gram-ml-story-react-body {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed rgba(244, 114, 182, 0.28);
}

.gram-ml-story-emoji-block {
  margin-top: 12px;
}

.gram-ml-story-emoji-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.gram-ml-story-emoji-label {
  font-size: 12px;
  font-weight: 600;
}

.gram-ml-story-emoji-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #2563eb;
  background: rgba(37, 99, 235, 0.12);
}

html.theme-dark .gram-ml-story-emoji-count {
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.18);
}

.gram-ml-story-emoji-row .gram-ml-emoji.is-active {
  background: linear-gradient(135deg, rgba(244, 114, 182, 0.22), rgba(236, 72, 153, 0.18));
  box-shadow: 0 0 0 1px rgba(244, 114, 182, 0.45), 0 0 12px rgba(244, 114, 182, 0.25);
}

.gram-ml-mode-card {
  margin-top: 0;
}

.gram-masslooking-page .gram-ml-mode-grid {
  margin: 4px 0 14px;
  align-items: stretch;
}

.gram-masslooking-page .gram-mr-mode-card.gram-ml-mode-card {
  background: #f8fafc;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 12px;
  padding: 14px;
  min-width: 0;
  box-shadow: none;
}

html.theme-dark .gram-masslooking-page .gram-mr-mode-card.gram-ml-mode-card {
  background: rgba(15, 23, 42, 0.35);
  border-color: rgba(71, 100, 150, 0.28);
}

.gram-masslooking-page .gram-mr-mode-card .gram-mr-mode-body {
  min-width: 0;
}

.gram-masslooking-page .gram-mr-mode-card .gram-gpt-pill-field {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  margin: 0;
}

.gram-masslooking-page .gram-mr-mode-card .gram-gpt-field-title {
  display: none;
}

.gram-masslooking-page .gram-mr-mode-card .gram-gpt-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
}

.gram-masslooking-page .gram-mr-mode-card .gram-gpt-pill {
  flex: 1 1 calc(50% - 3px);
  justify-content: center;
  padding: 8px 12px;
  font-size: 12px;
  min-width: 0;
  text-align: center;
}

.gram-masslooking-page .gram-mr-mode-sliders {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.gram-masslooking-page .gram-mr-mode-sliders .gram-field-wrap {
  margin: 0;
}

.gram-masslooking-page .gram-mr-mode-card .gram-ml-slider-card {
  background: rgba(255, 255, 255, 0.55);
  border-color: rgba(226, 232, 240, 0.85);
}

html.theme-dark .gram-masslooking-page .gram-mr-mode-card .gram-ml-slider-card {
  background: rgba(15, 23, 42, 0.45);
  border-color: rgba(71, 100, 150, 0.28);
}

.gram-masslooking-page .gram-ml-story-react-card .gram-ml-slider-card {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(244, 114, 182, 0.22);
}

html.theme-dark .gram-masslooking-page .gram-ml-story-react-card .gram-ml-slider-card {
  background: rgba(30, 20, 40, 0.45);
  border-color: rgba(244, 114, 182, 0.2);
}

.gram-masslooking-page .gram-gpt-window-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.gram-masslooking-page .gram-gpt-window-title-row .gram-gpt-window-title {
  flex-shrink: 0;
}

.gram-masslooking-page .gram-ml-targets-chip {
  margin-left: auto;
  flex-shrink: 0;
}

.gram-masslooking-page .gram-gpt-window-title-row .gram-gpt-chip {
  margin-left: auto;
}

.gram-masslooking-page .gram-ai-defender-block {
  margin-bottom: 16px;
  overflow: visible;
}

.gram-masslooking-page .gram-ai-defender-block .gram-gpt-window-head {
  align-items: flex-start;
  gap: 12px;
  overflow: visible;
  position: relative;
  z-index: 2;
}

.gram-masslooking-page .gram-ai-defender-block .gram-gpt-window-title-row .gram-info-tip {
  position: relative;
  z-index: 5;
}

.gram-masslooking-page .gram-ai-defender-block .gram-gpt-window-title-row .gram-info-tip-pop {
  top: calc(100% + 8px);
  bottom: auto;
  left: 0;
  right: auto;
  transform: translateY(4px);
  z-index: 30;
  pointer-events: auto;
}

.gram-masslooking-page .gram-ai-defender-block .gram-info-tip:hover .gram-info-tip-pop,
.gram-masslooking-page .gram-ai-defender-block .gram-info-tip.is-open .gram-info-tip-pop,
.gram-masslooking-page .gram-ai-defender-block .gram-info-tip:focus-within .gram-info-tip-pop {
  transform: translateY(0);
}

.gram-masslooking-page .gram-ai-defender-block .gram-gpt-window-title-row .gram-info-tip-inline {
  margin-top: 1px;
}

html:not(.theme-dark) .gram-masslooking-page .gram-gpt-pill:not(.active) {
  background: #f8fafc;
  border-color: rgba(148, 163, 184, 0.55);
  color: #475569;
}

.gram-masslooking-page .gram-mr-mode-card .gram-gpt-pill.active,
.gram-masslooking-page .gram-ml-mode-card .gram-gpt-pill.active {
  background: linear-gradient(135deg, #22d3ee, #2563eb);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

html.theme-dark .gram-masslooking-page .gram-gpt-pill:not(.active) {
  background: #1a2740;
  border-color: rgba(96, 165, 250, 0.28);
  color: #cbd5e1;
}

html.theme-dark .gram-masslooking-page .gram-gpt-pill.active {
  background: linear-gradient(135deg, #38bdf8, #3b82f6);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.gram-ml-targets-count {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #2563eb;
  background: rgba(37, 99, 235, 0.1);
}

html.theme-dark .gram-ml-targets-count {
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.18);
}

.gram-masslooking-page .gram-ml-autoreply-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: none;
}

.gram-masslooking-page .gram-trr-module-summary .gram-trr-module-meta,
.gram-masslooking-page .gram-trr-module-summary .gram-trr-module-warn {
  display: none;
}

.gram-masslooking-page .gram-ml-ai-window {
  max-width: none;
  overflow: visible;
}

.gram-masslooking-page .gram-ml-ai-window .gram-gpt-window-head {
  align-items: flex-start;
  gap: 12px;
  overflow: visible;
  position: relative;
  z-index: 2;
}

.gram-masslooking-page .gram-ml-ai-window .gram-gpt-window-title-row .gram-info-tip {
  position: relative;
  z-index: 5;
}

.gram-masslooking-page .gram-ml-ai-window .gram-gpt-window-title-row .gram-info-tip-pop {
  top: calc(100% + 8px);
  bottom: auto;
  left: 0;
  right: auto;
  transform: translateY(4px);
  z-index: 30;
  pointer-events: auto;
  width: min(280px, calc(100vw - 48px));
}

.gram-masslooking-page .gram-ml-ai-window .gram-info-tip:hover .gram-info-tip-pop,
.gram-masslooking-page .gram-ml-ai-window .gram-info-tip.is-open .gram-info-tip-pop,
.gram-masslooking-page .gram-ml-ai-window .gram-info-tip:focus-within .gram-info-tip-pop {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.gram-masslooking-page .gram-ml-ai-window .gram-gpt-window-title-row .gram-info-tip-inline {
  margin-left: 4px;
}

.gram-masslooking-page .gram-ml-ai-window .gram-gpt-window-body {
  width: 100%;
}

.gram-masslooking-page .gram-mr-ar-mode {
  margin: 0;
}

.gram-masslooking-page .gram-mr-ar-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.gram-masslooking-page .gram-mr-ar-pills .gram-gpt-pill {
  flex: 0 1 auto;
  padding: 7px 12px;
  font-size: 12px;
  min-width: 0;
}

.gram-masslooking-page .gram-mr-ar-toolbar {
  margin-bottom: 8px;
}

.gram-masslooking-page .gram-mr-attach-strip {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin-top: 8px;
  margin-bottom: 8px;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  flex-shrink: 0;
  align-self: flex-start;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}

.gram-masslooking-page .gram-mr-prompt-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex-wrap: wrap;
}

.gram-masslooking-page .gram-mr-prompt-select {
  flex: 1;
  min-width: 180px;
  max-width: none;
}

.gram-masslooking-page .gram-gpt-select-menu .gram-mr-prompt-edit {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.gram-masslooking-page .gram-gpt-select-menu.is-portal {
  max-height: min(280px, 50vh);
  overflow-y: auto;
}

.gram-masslooking-page .gram-mr-ar-panel {
  margin-top: 0;
}

.gram-masslooking-page .gram-gpt-param-input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.gram-masslooking-page .gram-gpt-param-input[type="number"]::-webkit-outer-spin-button,
.gram-masslooking-page .gram-gpt-param-input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

#masslookingRunAccountsPanel .gram-spam-account-stat-card.gram-ml-account-stat-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 10px 12px;
  grid-template-columns: unset;
  grid-template-rows: unset;
}

#masslookingRunAccountsPanel .gram-ml-account-stat-head {
  display: block;
  width: 100%;
  font-size: 12px;
  font-weight: 600;
  margin: 0;
  letter-spacing: 0.01em;
  line-height: 1.35;
}

#masslookingRunAccountsPanel .gram-ml-account-stat-row {
  display: block;
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}

#masslookingRunAccountsPanel .gram-ml-account-stat-state {
  margin-top: 2px;
  font-size: 10px;
  font-weight: 500;
  opacity: 0.75;
}

.gram-masslooking-page #moduleLiveLog .gram-log-msg {
  font-family: system-ui, -apple-system, "Segoe UI", "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

#masslookingRunAccountsPanel .gram-spam-account-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

#masslookingRunAccountsPanel .gram-spam-account-stat-card {
  flex: none;
  max-width: none;
  background: var(--surface-hover, #f8fafc);
  border: 1px solid var(--border, rgba(148, 163, 184, 0.35));
}

html:not(.theme-dark) #masslookingRunAccountsPanel .gram-spam-account-stat-card {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

html:not(.theme-dark) #masslookingRunAccountsPanel .gram-spam-account-stat-card.is-stopped {
  background: #fef2f2;
  border-color: #fecaca;
}

html:not(.theme-dark) #masslookingRunAccountsPanel .gram-spam-account-stat-card.is-done {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

html.theme-dark #masslookingRunAccountsPanel .gram-spam-account-stat-card {
  background: rgba(15, 23, 42, 0.35);
  border-color: rgba(71, 100, 150, 0.35);
}

html.theme-dark #masslookingRunAccountsPanel .gram-spam-account-stat-card.is-done {
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.1);
}

html.theme-dark .gram-ml-emoji {
  background: #152238;
  border-color: rgba(71, 100, 150, 0.4);
}

.gram-ml-options {
  grid-template-columns: 1fr;
  gap: 12px;
}

.gram-ml-options .gram-field-wrap {
  margin: 0;
}

.gram-ml-slider-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 260px));
  gap: 12px;
  max-width: 540px;
}

.gram-ml-slider-grid .gram-field-wrap {
  margin: 0;
}

.gram-ml-slider-card {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(248, 250, 252, 0.55);
}

html.theme-dark .gram-ml-slider-card {
  background: rgba(15, 23, 42, 0.35);
  border-color: rgba(71, 100, 150, 0.28);
}

.gram-ml-slider {
  padding: 0;
}

.gram-ml-slider-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.gram-ml-slider-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.gram-ml-slider-value {
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 2.5rem;
  text-align: right;
  color: #64748b;
}

html.theme-dark .gram-ml-slider-value {
  color: #93c5fd;
}

.gram-ml-slider-track {
  position: relative;
  height: 4px;
  margin: 0 7px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.28);
}

.gram-ml-slider-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #60a5fa, #2563eb);
  pointer-events: none;
  transition: width 0.1s ease;
}

.gram-ml-slider-input {
  position: absolute;
  inset: -10px -7px;
  width: calc(100% + 14px);
  left: -7px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.gram-ml-slider-track::after {
  content: "";
  position: absolute;
  top: 50%;
  left: var(--ml-thumb-pct, 0%);
  width: 14px;
  height: 14px;
  margin-top: -7px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #2563eb;
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.35);
  pointer-events: none;
  transition: left 0.1s ease;
  transform: translateX(-50%);
}

html.theme-dark .gram-ml-slider-track::after {
  background: #1e293b;
  border-color: #60a5fa;
}

.gram-ml-prob-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(71, 100, 150, 0.28);
  background: rgba(248, 250, 252, 0.55);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  position: relative;
  z-index: 1;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.gram-ml-prob-card:hover {
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.1);
}

html.theme-dark .gram-ml-prob-card {
  background: #152238;
  border-color: rgba(71, 100, 150, 0.35);
}

.gram-ml-prob-card-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gram-ml-prob-card-text strong {
  font-size: 13px;
  color: var(--text);
}

.gram-ml-prob-card-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.gram-ml-prob-chevron {
  color: var(--text-muted);
  font-size: 12px;
}

.gram-ml-sheet-ranges {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 14px;
}

.gram-ml-ai-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gram-ml-ai-hint {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}

.gram-masslooking-page #moduleLiveLog.gram-log-panel {
  border-radius: 8px;
  border: 1px solid rgba(71, 100, 150, 0.28);
}

/* Masslooking — glass / glow (как журнал задач, только «кожа») */
.gram-masslooking-page.gram-ml-glass .gram-gpt-window {
  border: 1px solid rgba(71, 100, 150, 0.32);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.06),
    0 8px 32px rgba(2, 8, 23, 0.18);
  overflow: visible;
}

html.theme-dark .gram-masslooking-page.gram-ml-glass .gram-gpt-window {
  background: #152238;
  border-color: rgba(56, 189, 248, 0.24);
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.1),
    0 8px 28px rgba(0, 0, 0, 0.35),
    0 0 24px rgba(56, 189, 248, 0.05);
}

html:not(.theme-dark) .gram-masslooking-page.gram-ml-glass .gram-gpt-window {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(148, 163, 184, 0.35);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.85),
    0 8px 32px rgba(15, 23, 42, 0.08),
    0 0 20px rgba(56, 189, 248, 0.06);
}

.gram-masslooking-page.gram-ml-glass .gram-gpt-window-head {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.1) 0%, rgba(15, 23, 42, 0.02) 100%);
  border-bottom-color: rgba(56, 189, 248, 0.16);
}

html:not(.theme-dark) .gram-masslooking-page.gram-ml-glass .gram-gpt-window-head {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.08) 0%, rgba(255, 255, 255, 0.45) 100%);
  border-bottom-color: rgba(148, 163, 184, 0.3);
}

.gram-masslooking-page.gram-ml-glass .gram-gpt-notice {
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 10px;
  background: rgba(14, 165, 233, 0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.gram-masslooking-page.gram-ml-glass .gram-mr-mode-card.gram-ml-mode-card {
  background: rgba(21, 34, 56, 0.72);
  border-color: rgba(56, 189, 248, 0.22);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow:
    inset 0 1px 0 rgba(56, 189, 248, 0.08),
    0 4px 18px rgba(2, 8, 23, 0.14);
}

html:not(.theme-dark) .gram-masslooking-page.gram-ml-glass .gram-mr-mode-card.gram-ml-mode-card {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(148, 163, 184, 0.35);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
}

.gram-masslooking-page.gram-ml-glass .gram-ml-story-react-card {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.gram-masslooking-page.gram-ml-glass .gram-ml-story-react-card.is-on {
  box-shadow:
    0 0 0 1px rgba(244, 114, 182, 0.38),
    0 0 28px rgba(244, 114, 182, 0.2),
    0 8px 24px rgba(15, 23, 42, 0.12);
}

.gram-masslooking-page.gram-ml-glass .gram-gpt-param-card {
  background: rgba(15, 23, 42, 0.2);
  border-color: rgba(71, 100, 150, 0.28);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

html:not(.theme-dark) .gram-masslooking-page.gram-ml-glass .gram-gpt-param-card {
  background: rgba(248, 250, 252, 0.85);
  border-color: rgba(148, 163, 184, 0.32);
}

.gram-masslooking-page.gram-ml-glass .gram-gpt-action-bar {
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(14, 165, 233, 0.1) 0%, rgba(15, 23, 42, 0.22) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.07);
}

html:not(.theme-dark) .gram-masslooking-page.gram-ml-glass .gram-gpt-action-bar {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96) 0%, rgba(241, 245, 249, 0.88) 100%);
  border-color: rgba(148, 163, 184, 0.35);
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.08);
}

.gram-masslooking-page.gram-ml-glass #masslookingRunPanel.gram-spam-results-panel {
  border-color: rgba(56, 189, 248, 0.24);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.08),
    0 12px 36px rgba(2, 8, 23, 0.2);
}

html:not(.theme-dark) .gram-masslooking-page.gram-ml-glass #masslookingRunPanel.gram-spam-results-panel {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.08);
}

.gram-masslooking-page.gram-ml-glass .gram-spam-run-tabs {
  gap: 4px;
  padding: 4px;
  margin: 8px 12px 0;
  border-radius: 12px;
  border: 1px solid rgba(56, 189, 248, 0.18);
  background: rgba(15, 23, 42, 0.22);
}

html:not(.theme-dark) .gram-masslooking-page.gram-ml-glass .gram-spam-run-tabs {
  background: rgba(241, 245, 249, 0.92);
  border-color: rgba(148, 163, 184, 0.35);
}

.gram-masslooking-page.gram-ml-glass .gram-spam-run-tab {
  border-radius: 9px;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.gram-masslooking-page.gram-ml-glass .gram-spam-run-tab.active {
  background: rgba(14, 165, 233, 0.14);
  color: #38bdf8;
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.22);
}

html:not(.theme-dark) .gram-masslooking-page.gram-ml-glass .gram-spam-run-tab.active {
  background: #fff;
  color: #0284c7;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.gram-masslooking-page.gram-ml-glass #moduleLiveLog.gram-log-panel {
  border-color: rgba(56, 189, 248, 0.22);
  box-shadow: inset 0 0 24px rgba(56, 189, 248, 0.03);
}

html:has(.gram-masslooking-page.gram-ml-glass) .panel-modal-card.gram-modal-card {
  border: 1px solid rgba(56, 189, 248, 0.28);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.1),
    0 24px 64px rgba(0, 0, 0, 0.45),
    0 0 40px rgba(56, 189, 248, 0.08);
}

html.theme-dark:has(.gram-masslooking-page.gram-ml-glass) .panel-modal-card.gram-modal-card {
  background: rgba(21, 34, 56, 0.94);
  border-color: rgba(56, 189, 248, 0.24);
}

html:not(.theme-dark):has(.gram-masslooking-page.gram-ml-glass) .panel-modal-card.gram-modal-card {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(148, 163, 184, 0.38);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.9),
    0 24px 48px rgba(15, 23, 42, 0.12),
    0 0 32px rgba(56, 189, 248, 0.08);
}

@media (max-width: 720px) {
  .gram-ml-slider-grid {
    grid-template-columns: 1fr;
    max-width: none;
  }
}

/* Header user menu + cabinet shell */
.header-ai-balance {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, #06b6d4 35%, var(--gram-border, var(--border)));
  background: color-mix(in srgb, #06b6d4 12%, var(--surface));
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  z-index: 2;
  pointer-events: auto;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.header-ai-balance:hover {
  border-color: color-mix(in srgb, #06b6d4 55%, var(--gram-border, var(--border)));
  background: color-mix(in srgb, #06b6d4 18%, var(--surface));
}

.header-ai-balance .pi-bolt {
  color: #f59e0b;
  font-size: 14px;
}

.header-ai-buy {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  position: relative;
  z-index: 2;
  pointer-events: auto;
  box-shadow: 0 4px 14px color-mix(in srgb, #8b5cf6 35%, transparent);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.header-ai-buy:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px color-mix(in srgb, #8b5cf6 45%, transparent);
}

.header-user-menu {
  position: relative;
}

.header-user-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px 0 8px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.header-user-btn:hover,
.header-user-menu.open .header-user-btn,
.header-user-btn.active {
  border-color: color-mix(in srgb, var(--accent-cyan) 55%, var(--border));
  background: color-mix(in srgb, var(--accent-cyan) 10%, var(--surface));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent-cyan) 18%, transparent);
}

.header-user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--accent-violet) 22%, transparent);
  color: var(--accent-violet);
  font-size: 12px;
}

.header-user-label {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-user-chevron {
  font-size: 11px;
  opacity: 0.7;
  transition: transform 0.18s ease;
}

.header-user-menu.open .header-user-chevron {
  transform: rotate(180deg);
}

.header-user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--border) 85%, transparent);
  background: color-mix(in srgb, var(--surface-elevated, var(--surface)) 96%, transparent);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
  z-index: 120;
}

.header-user-dropdown-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background 0.16s ease, box-shadow 0.16s ease, color 0.16s ease;
}

.header-user-dropdown-item i {
  width: 18px;
  opacity: 0.85;
}

.gram-cabinet-shell.settings-page {
  max-width: 1180px;
}

.gram-cabinet-page.gram-cabinet-shell {
  max-width: 1180px;
}

.gram-cabinet-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.gram-cabinet-nav-panel {
  padding: 0;
  border: none;
  background: transparent;
  box-sizing: border-box;
}

.gram-cabinet-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gram-cabinet-nav-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease,
    color 0.2s ease;
}

html.theme-dark .gram-cabinet-nav-item {
  background: var(--gram-card, var(--surface));
  border-color: var(--gram-border, var(--border));
}

.gram-cabinet-nav-item[data-cab-tone="blue"]:hover {
  border-color: color-mix(in srgb, #3b82f6 52%, var(--border));
  background: color-mix(in srgb, #3b82f6 11%, var(--surface));
  box-shadow: 0 0 0 1px color-mix(in srgb, #3b82f6 20%, transparent);
}
.gram-cabinet-nav-item[data-cab-tone="blue"].active {
  border-color: color-mix(in srgb, #3b82f6 72%, var(--border));
  background: color-mix(in srgb, #3b82f6 14%, var(--surface));
  box-shadow: 0 0 0 1px color-mix(in srgb, #3b82f6 28%, transparent), 0 6px 18px color-mix(in srgb, #3b82f6 10%, transparent);
}
.gram-cabinet-nav-item[data-cab-tone="blue"].active .gram-cabinet-nav-text b {
  color: #60a5fa;
}

.gram-cabinet-nav-item[data-cab-tone="violet"]:hover {
  border-color: color-mix(in srgb, #8b5cf6 52%, var(--border));
  background: color-mix(in srgb, #8b5cf6 11%, var(--surface));
  box-shadow: 0 0 0 1px color-mix(in srgb, #8b5cf6 20%, transparent);
}
.gram-cabinet-nav-item[data-cab-tone="violet"].active {
  border-color: color-mix(in srgb, #8b5cf6 72%, var(--border));
  background: color-mix(in srgb, #8b5cf6 14%, var(--surface));
  box-shadow: 0 0 0 1px color-mix(in srgb, #8b5cf6 28%, transparent), 0 6px 18px color-mix(in srgb, #8b5cf6 10%, transparent);
}
.gram-cabinet-nav-item[data-cab-tone="violet"].active .gram-cabinet-nav-text b {
  color: #a78bfa;
}

.gram-cabinet-nav-item[data-cab-tone="emerald"]:hover {
  border-color: color-mix(in srgb, #34d399 52%, var(--border));
  background: color-mix(in srgb, #34d399 11%, var(--surface));
  box-shadow: 0 0 0 1px color-mix(in srgb, #34d399 20%, transparent);
}
.gram-cabinet-nav-item[data-cab-tone="emerald"].active {
  border-color: color-mix(in srgb, #34d399 72%, var(--border));
  background: color-mix(in srgb, #34d399 14%, var(--surface));
  box-shadow: 0 0 0 1px color-mix(in srgb, #34d399 28%, transparent), 0 6px 18px color-mix(in srgb, #34d399 10%, transparent);
}
.gram-cabinet-nav-item[data-cab-tone="emerald"].active .gram-cabinet-nav-text b {
  color: #34d399;
}

.gram-cabinet-nav-item[data-cab-tone="amber"]:hover {
  border-color: color-mix(in srgb, #fbbf24 52%, var(--border));
  background: color-mix(in srgb, #fbbf24 11%, var(--surface));
  box-shadow: 0 0 0 1px color-mix(in srgb, #fbbf24 20%, transparent);
}
.gram-cabinet-nav-item[data-cab-tone="amber"].active {
  border-color: color-mix(in srgb, #fbbf24 72%, var(--border));
  background: color-mix(in srgb, #fbbf24 14%, var(--surface));
  box-shadow: 0 0 0 1px color-mix(in srgb, #fbbf24 28%, transparent), 0 6px 18px color-mix(in srgb, #fbbf24 10%, transparent);
}
.gram-cabinet-nav-item[data-cab-tone="amber"].active .gram-cabinet-nav-text b {
  color: #fbbf24;
}

.gram-cabinet-nav-item[data-cab-tone="orange"]:hover {
  border-color: color-mix(in srgb, #fb923c 52%, var(--border));
  background: color-mix(in srgb, #fb923c 11%, var(--surface));
  box-shadow: 0 0 0 1px color-mix(in srgb, #fb923c 20%, transparent);
}
.gram-cabinet-nav-item[data-cab-tone="orange"].active {
  border-color: color-mix(in srgb, #fb923c 72%, var(--border));
  background: color-mix(in srgb, #fb923c 14%, var(--surface));
  box-shadow: 0 0 0 1px color-mix(in srgb, #fb923c 28%, transparent), 0 6px 18px color-mix(in srgb, #fb923c 10%, transparent);
}
.gram-cabinet-nav-item[data-cab-tone="orange"].active .gram-cabinet-nav-text b {
  color: #fb923c;
}

.gram-cabinet-nav-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: box-shadow 0.2s ease;
}

.gram-cabinet-nav-item:hover .gram-cabinet-nav-icon,
.gram-cabinet-nav-item.active .gram-cabinet-nav-icon {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.gram-cabinet-main .gram-gpt-window,
.gram-cabinet-main .cabinet-plan-card,
.gram-cabinet-main .cabinet-ref-row {
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
}

html.theme-dark .gram-cabinet-main .gram-gpt-window {
  background: var(--gram-card, var(--surface));
  border-color: var(--gram-border, var(--border));
}

.gram-cabinet-main .gram-gpt-window:hover {
  border-color: color-mix(in srgb, #06b6d4 55%, var(--border));
  background: color-mix(in srgb, #06b6d4 7%, var(--surface));
  box-shadow: 0 0 0 1px color-mix(in srgb, #06b6d4 22%, transparent), 0 8px 22px color-mix(in srgb, #06b6d4 8%, transparent);
}

.gram-cabinet-main .cabinet-plan-card:hover {
  border-color: color-mix(in srgb, #06b6d4 50%, var(--border));
  background: color-mix(in srgb, #06b6d4 6%, var(--surface));
  box-shadow: 0 0 0 1px color-mix(in srgb, #06b6d4 18%, transparent), 0 6px 18px color-mix(in srgb, #06b6d4 7%, transparent);
}

.gram-cabinet-main .cabinet-plan-card {
  background: var(--surface);
}

html.theme-dark .gram-cabinet-main .cabinet-plan-card {
  background: var(--gram-card, var(--surface));
  border-color: var(--gram-border, var(--border));
}

.gram-cabinet-main .cabinet-ref-row:hover {
  background: color-mix(in srgb, #06b6d4 6%, var(--surface));
  border-radius: 10px;
}

.header-user-dropdown-item[data-cab-tone="blue"]:hover {
  background: color-mix(in srgb, #3b82f6 12%, transparent);
  box-shadow: inset 3px 0 0 #3b82f6;
}
.header-user-dropdown-item[data-cab-tone="violet"]:hover {
  background: color-mix(in srgb, #8b5cf6 12%, transparent);
  box-shadow: inset 3px 0 0 #8b5cf6;
}
.header-user-dropdown-item[data-cab-tone="emerald"]:hover {
  background: color-mix(in srgb, #34d399 12%, transparent);
  box-shadow: inset 3px 0 0 #34d399;
}
.header-user-dropdown-item[data-cab-tone="amber"]:hover {
  background: color-mix(in srgb, #fbbf24 12%, transparent);
  box-shadow: inset 3px 0 0 #fbbf24;
}
.header-user-dropdown-item[data-cab-tone="orange"]:hover {
  background: color-mix(in srgb, #fb923c 12%, transparent);
  box-shadow: inset 3px 0 0 #fb923c;
}

.gram-cabinet-nav-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.gram-cabinet-nav-text b {
  font-size: 14px;
  line-height: 1.25;
}

.gram-cabinet-nav-text small {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.35;
}

.gram-cabinet-main {
  min-width: 0;
}

@media (max-width: 900px) {
  .gram-cabinet-layout {
    grid-template-columns: 1fr;
  }

  .gram-cabinet-nav {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .gram-cabinet-nav-item {
    min-width: 210px;
    flex-shrink: 0;
  }

  .header-user-label {
    max-width: 96px;
  }
}

/* Нейрокомментинг — glass / glow (как масслукинг, отдельные селекторы) */
.gram-neurocommenting-page.gram-nc-glass .gram-gpt-window {
  border: 1px solid rgba(56, 189, 248, 0.32);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    inset 0 1px 0 rgba(56, 189, 248, 0.08),
    0 0 0 1px rgba(56, 189, 248, 0.1),
    0 8px 32px rgba(2, 8, 23, 0.18);
  overflow: visible;
}

html.theme-dark .gram-neurocommenting-page.gram-nc-glass .gram-gpt-window {
  background: #152238;
  border-color: rgba(56, 189, 248, 0.24);
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.1),
    0 8px 28px rgba(0, 0, 0, 0.35),
    0 0 24px rgba(56, 189, 248, 0.05);
}

html:not(.theme-dark) .gram-neurocommenting-page.gram-nc-glass .gram-gpt-window {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(56, 189, 248, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 0 0 1px rgba(56, 189, 248, 0.1),
    0 8px 32px rgba(15, 23, 42, 0.08),
    0 0 20px rgba(56, 189, 248, 0.06);
}

.gram-neurocommenting-page.gram-nc-glass .gram-gpt-window-head {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.1) 0%, rgba(15, 23, 42, 0.02) 100%);
  border-bottom-color: rgba(56, 189, 248, 0.16);
}

html:not(.theme-dark) .gram-neurocommenting-page.gram-nc-glass .gram-gpt-window-head {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.08) 0%, rgba(255, 255, 255, 0.45) 100%);
  border-bottom-color: rgba(148, 163, 184, 0.3);
}

.gram-neurocommenting-page.gram-nc-glass .gram-gpt-notice {
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 10px;
  background: rgba(14, 165, 233, 0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.gram-neurocommenting-page.gram-nc-glass .gram-nc-mode-card:not(.gram-nc-comment-card),
.gram-neurocommenting-page.gram-nc-glass .gram-mr-mode-card.gram-nc-mode-card:not(.gram-nc-comment-card) {
  background: rgba(21, 34, 56, 0.72);
  border: 1px solid rgba(56, 189, 248, 0.32);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow:
    inset 0 1px 0 rgba(56, 189, 248, 0.12),
    0 0 0 1px rgba(56, 189, 248, 0.08),
    0 4px 18px rgba(2, 8, 23, 0.14);
}

html:not(.theme-dark) .gram-neurocommenting-page.gram-nc-glass .gram-nc-mode-card:not(.gram-nc-comment-card),
html:not(.theme-dark) .gram-neurocommenting-page.gram-nc-glass .gram-mr-mode-card.gram-nc-mode-card:not(.gram-nc-comment-card) {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(56, 189, 248, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 0 0 1px rgba(56, 189, 248, 0.1),
    0 4px 20px rgba(15, 23, 42, 0.06);
}

.gram-neurocommenting-page.gram-nc-glass .gram-nc-prompt-card {
  background: rgba(21, 34, 56, 0.72);
  border-color: rgba(56, 189, 248, 0.22);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow:
    inset 0 1px 0 rgba(56, 189, 248, 0.08),
    0 4px 18px rgba(2, 8, 23, 0.14);
}

html:not(.theme-dark) .gram-neurocommenting-page.gram-nc-glass .gram-nc-prompt-card {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(148, 163, 184, 0.35);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
}

.gram-neurocommenting-page.gram-nc-glass .gram-gpt-param-card {
  background: rgba(15, 23, 42, 0.2);
  border-color: rgba(71, 100, 150, 0.28);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

html:not(.theme-dark) .gram-neurocommenting-page.gram-nc-glass .gram-gpt-param-card {
  background: rgba(248, 250, 252, 0.85);
  border-color: rgba(148, 163, 184, 0.32);
}

.gram-neurocommenting-page.gram-nc-glass .gram-gpt-action-bar {
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(14, 165, 233, 0.1) 0%, rgba(15, 23, 42, 0.22) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.07);
}

html:not(.theme-dark) .gram-neurocommenting-page.gram-nc-glass .gram-gpt-action-bar {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96) 0%, rgba(241, 245, 249, 0.88) 100%);
  border-color: rgba(148, 163, 184, 0.35);
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.08);
}

.gram-neurocommenting-page.gram-nc-glass #neurocommentingRunPanel.gram-spam-results-panel {
  border-color: rgba(56, 189, 248, 0.24);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.08),
    0 12px 36px rgba(2, 8, 23, 0.2);
}

html:not(.theme-dark) .gram-neurocommenting-page.gram-nc-glass #neurocommentingRunPanel.gram-spam-results-panel {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.08);
}

.gram-neurocommenting-page.gram-nc-glass .gram-spam-run-tabs {
  gap: 4px;
  padding: 4px;
  margin: 8px 12px 0;
  border-radius: 12px;
  border: 1px solid rgba(56, 189, 248, 0.18);
  background: rgba(15, 23, 42, 0.22);
}

html:not(.theme-dark) .gram-neurocommenting-page.gram-nc-glass .gram-spam-run-tabs {
  background: rgba(241, 245, 249, 0.92);
  border-color: rgba(148, 163, 184, 0.35);
}

.gram-neurocommenting-page.gram-nc-glass .gram-spam-run-tab {
  border-radius: 9px;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.gram-neurocommenting-page.gram-nc-glass .gram-spam-run-tab.active {
  background: rgba(14, 165, 233, 0.14);
  color: #38bdf8;
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.22);
}

html:not(.theme-dark) .gram-neurocommenting-page.gram-nc-glass .gram-spam-run-tab.active {
  background: #fff;
  color: #0284c7;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

#neurocommentingRunAccountsPanel .gram-spam-account-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

#neurocommentingRunAccountsPanel .gram-spam-account-stat-card {
  flex: none;
  max-width: none;
  background: var(--surface-hover, #f8fafc);
  border: 1px solid var(--border, rgba(148, 163, 184, 0.35));
}

html:not(.theme-dark) .gram-neurocommenting-page #neurocommentingRunAccountsPanel .gram-spam-account-stat-card {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
  color: #0f172a;
}

html:not(.theme-dark) .gram-neurocommenting-page #neurocommentingRunAccountsPanel .gram-spam-account-stat-card.is-done {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

html.theme-dark .gram-neurocommenting-page #neurocommentingRunAccountsPanel .gram-spam-account-stat-card {
  background: rgba(15, 23, 42, 0.35);
  border-color: rgba(71, 100, 150, 0.35);
  color: #e2e8f0;
}

html.theme-dark .gram-neurocommenting-page #neurocommentingRunAccountsPanel .gram-spam-account-stat-card.is-done {
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.1);
}

.gram-neurocommenting-page.gram-nc-glass #moduleLiveLog.gram-log-panel {
  border-color: rgba(56, 189, 248, 0.22);
  box-shadow: inset 0 0 24px rgba(56, 189, 248, 0.03);
}

html:not(.theme-dark) .gram-neurocommenting-page.gram-nc-glass .gram-gpt-pill:not(.active) {
  background: #f8fafc;
  border-color: rgba(148, 163, 184, 0.55);
  color: #475569;
}

.gram-neurocommenting-page.gram-nc-glass .gram-nc-mode-card .gram-gpt-pill.active,
.gram-neurocommenting-page.gram-nc-glass .gram-mr-ar-pills .gram-gpt-pill.active {
  background: linear-gradient(135deg, #22d3ee, #2563eb);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

html.theme-dark .gram-neurocommenting-page.gram-nc-glass .gram-gpt-pill:not(.active) {
  background: #1a2740;
  border-color: rgba(96, 165, 250, 0.28);
  color: #cbd5e1;
}

html.theme-dark .gram-neurocommenting-page.gram-nc-glass .gram-gpt-pill.active {
  background: linear-gradient(135deg, #38bdf8, #3b82f6);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.gram-neurocommenting-page.gram-nc-glass .gram-nc-targets-count {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #2563eb;
  background: rgba(37, 99, 235, 0.1);
}

html.theme-dark .gram-neurocommenting-page.gram-nc-glass .gram-nc-targets-count {
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.18);
}

html:has(.gram-neurocommenting-page.gram-nc-glass) .panel-modal-card.gram-modal-card {
  border: 1px solid rgba(56, 189, 248, 0.28);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.1),
    0 24px 64px rgba(0, 0, 0, 0.45),
    0 0 40px rgba(56, 189, 248, 0.08);
}

html.theme-dark:has(.gram-neurocommenting-page.gram-nc-glass) .panel-modal-card.gram-modal-card {
  background: rgba(21, 34, 56, 0.94);
  border-color: rgba(56, 189, 248, 0.24);
}

html:not(.theme-dark):has(.gram-neurocommenting-page.gram-nc-glass) .panel-modal-card.gram-modal-card {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(148, 163, 184, 0.38);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.9),
    0 24px 48px rgba(15, 23, 42, 0.12),
    0 0 32px rgba(56, 189, 248, 0.08);
}

.gram-neurocommenting-page .gram-nc-comment-card.gram-nc-accent-card {
  margin-top: 0;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(244, 114, 182, 0.55);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(253, 242, 248, 0.55));
  box-shadow:
    0 0 0 1px rgba(244, 114, 182, 0.32),
    0 0 28px rgba(244, 114, 182, 0.2),
    0 0 48px rgba(244, 114, 182, 0.1),
    0 8px 24px rgba(15, 23, 42, 0.08);
  min-width: 0;
}

html.theme-dark .gram-neurocommenting-page .gram-nc-comment-card.gram-nc-accent-card {
  background: linear-gradient(145deg, rgba(21, 34, 56, 0.95), rgba(30, 20, 40, 0.55));
  border-color: rgba(244, 114, 182, 0.48);
  box-shadow:
    0 0 0 1px rgba(244, 114, 182, 0.38),
    0 0 28px rgba(244, 114, 182, 0.22),
    0 0 48px rgba(244, 114, 182, 0.12),
    0 8px 24px rgba(15, 23, 42, 0.2);
}

.gram-neurocommenting-page.gram-nc-glass .gram-nc-comment-card.gram-nc-accent-card {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(244, 114, 182, 0.62) !important;
  box-shadow:
    inset 0 1px 0 rgba(244, 114, 182, 0.16),
    0 0 0 1px rgba(244, 114, 182, 0.42),
    0 0 28px rgba(244, 114, 182, 0.28),
    0 0 48px rgba(244, 114, 182, 0.14),
    0 8px 24px rgba(15, 23, 42, 0.14);
}

.gram-neurocommenting-page .gram-nc-comment-card.gram-nc-accent-card .gram-mr-mode-head .gram-card-icon,
.gram-neurocommenting-page .gram-nc-comment-card.gram-nc-accent-card .gram-mr-mode-head .gram-tone-pink {
  box-shadow:
    0 0 0 1px rgba(244, 114, 182, 0.35),
    0 0 16px rgba(244, 114, 182, 0.28);
}

.gram-neurocommenting-page .gram-nc-params-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gram-neurocommenting-page .gram-nc-mode-grid {
  margin: 0;
  align-items: stretch;
  overflow: visible;
}

.gram-neurocommenting-page .gram-nc-param-grid {
  margin: 0;
  gap: 10px;
  position: relative;
  z-index: 0;
}

.gram-neurocommenting-page .gram-nc-param-grid .gram-gpt-param-card {
  min-height: 0;
  padding: 12px 14px;
  box-shadow: none;
  background: #f8fafc;
  border-color: rgba(226, 232, 240, 0.95);
}

html.theme-dark .gram-neurocommenting-page .gram-nc-param-grid .gram-gpt-param-card {
  background: rgba(15, 23, 42, 0.35);
  border-color: rgba(71, 100, 150, 0.28);
}

.gram-neurocommenting-page.gram-nc-glass .gram-nc-param-grid .gram-gpt-param-card {
  background: rgba(15, 23, 42, 0.2);
  border: 1px solid rgba(71, 100, 150, 0.32);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow:
    inset 0 1px 0 rgba(56, 189, 248, 0.08),
    0 0 0 1px rgba(56, 189, 248, 0.06);
}

html:not(.theme-dark) .gram-neurocommenting-page.gram-nc-glass .gram-nc-param-grid .gram-gpt-param-card {
  background: rgba(248, 250, 252, 0.85);
  border-color: rgba(56, 189, 248, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 0 0 1px rgba(56, 189, 248, 0.08);
}

html.theme-dark .gram-neurocommenting-page.gram-nc-glass .gram-nc-param-grid .gram-gpt-param-card {
  background: rgba(15, 23, 42, 0.35);
  border-color: rgba(56, 189, 248, 0.24);
}

.gram-neurocommenting-page.gram-nc-glass .gram-gpt-window-body .gram-mr-mode-card.gram-nc-mode-card:not(.gram-nc-comment-card) {
  box-shadow:
    inset 0 1px 0 rgba(56, 189, 248, 0.12),
    0 0 0 1px rgba(56, 189, 248, 0.08),
    0 4px 18px rgba(2, 8, 23, 0.14);
}

/* Розовая карточка — glow как masslooking .gram-ml-story-react-card.is-on */
.gram-neurocommenting-page.gram-nc-glass .gram-gpt-window-body .gram-mr-mode-card.gram-nc-comment-card.gram-nc-accent-card,
.gram-neurocommenting-page.gram-nc-glass .gram-nc-comment-card.gram-nc-accent-card {
  border-color: rgba(244, 114, 182, 0.5) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    0 0 0 1px rgba(244, 114, 182, 0.38),
    0 0 28px rgba(244, 114, 182, 0.2),
    0 8px 24px rgba(15, 23, 42, 0.12) !important;
}

html.theme-dark .gram-neurocommenting-page.gram-nc-glass .gram-nc-comment-card.gram-nc-accent-card {
  border-color: rgba(244, 114, 182, 0.42) !important;
}

.gram-neurocommenting-page .gram-nc-comment-pills {
  margin-bottom: 0;
}

.gram-neurocommenting-page .gram-nc-comment-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.gram-neurocommenting-page .gram-nc-comment-segment {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(248, 250, 252, 0.55);
  overflow: visible;
}

html:not(.theme-dark) .gram-neurocommenting-page .gram-nc-comment-segment {
  background: #f8fafc;
  border-color: rgba(226, 232, 240, 0.95);
}

html.theme-dark .gram-neurocommenting-page .gram-nc-comment-segment {
  background: rgba(15, 23, 42, 0.35);
  border-color: rgba(71, 100, 150, 0.28);
}

.gram-neurocommenting-page .gram-nc-comment-card .gram-nc-comment-sliders {
  margin-top: 0;
}

.gram-neurocommenting-page .gram-nc-comment-segment .gram-mr-mode-sliders {
  margin-top: 0;
}

.gram-neurocommenting-page .gram-nc-comment-segment .gram-nc-limit-card {
  padding: 0;
  border: none;
  background: transparent;
  overflow: visible;
}

.gram-neurocommenting-page .gram-nc-comment-segment .gram-nc-pill-row {
  gap: 4px;
}

.gram-neurocommenting-page .gram-nc-comment-segment .gram-gpt-pill {
  padding: 7px 8px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  min-height: 0;
  border-radius: 8px;
  box-shadow: none;
  background-clip: padding-box;
}

.gram-neurocommenting-page .gram-nc-comment-segment .gram-nc-pill-row--3 .gram-gpt-pill {
  padding: 7px 8px;
  font-size: 11px;
  white-space: nowrap;
  line-height: 1.2;
}

.gram-neurocommenting-page .gram-nc-comment-segment .gram-gpt-pill.active {
  border: none;
  box-shadow: none;
  outline: none;
}

.gram-neurocommenting-page .gram-nc-mode-card .gram-nc-pill-row {
  gap: 4px;
}

.gram-neurocommenting-page .gram-nc-mode-card .gram-nc-pill-row .gram-gpt-pill {
  box-shadow: none;
  background-clip: padding-box;
}

.gram-neurocommenting-page .gram-nc-mode-card .gram-nc-pill-row .gram-gpt-pill.active {
  border: none;
  box-shadow: none;
  outline: none;
}

.gram-neurocommenting-page .gram-nc-inline-tip .gram-info-tip,
.gram-neurocommenting-page .gram-nc-limit-title .gram-info-tip {
  position: relative;
  z-index: 5;
}

.gram-neurocommenting-page .gram-nc-inline-tip .gram-info-tip-pop,
.gram-neurocommenting-page .gram-nc-limit-title .gram-info-tip-pop,
.gram-neurocommenting-page .gram-nc-skip-media-toggle .gram-info-tip-pop {
  left: auto;
  right: 0;
  top: calc(100% + 6px);
  width: min(260px, calc(100vw - 24px));
  min-width: 220px;
  max-width: 280px;
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
  writing-mode: horizontal-tb;
  text-align: left;
  z-index: 200;
}

.gram-neurocommenting-page .gram-nc-inline-tip .gram-info-tip-pop p,
.gram-neurocommenting-page .gram-nc-limit-title .gram-info-tip-pop p,
.gram-neurocommenting-page .gram-nc-skip-media-toggle .gram-info-tip-pop p {
  display: block;
  white-space: normal;
  word-break: normal;
}

.gram-neurocommenting-page .gram-nc-param-grid {
  margin-top: 0;
}

.gram-neurocommenting-page .gram-nc-mode-card .gram-mr-mode-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.gram-neurocommenting-page .gram-nc-mode-card .gram-mr-mode-sliders {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.gram-neurocommenting-page .gram-nc-mode-card .gram-mr-mode-sliders .gram-field-wrap {
  margin: 0;
}

.gram-neurocommenting-page .gram-nc-field-block {
  width: 100%;
}

.gram-neurocommenting-page .gram-nc-field-block .gram-field-label {
  display: block;
  margin-bottom: 8px;
}

.gram-neurocommenting-page .gram-nc-field-block + .gram-mr-mode-sliders,
.gram-neurocommenting-page .gram-nc-work-pills + .gram-mr-mode-sliders {
  margin-top: 14px;
}

.gram-neurocommenting-page .gram-nc-pill-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  width: 100%;
}

.gram-neurocommenting-page .gram-nc-pill-row .gram-gpt-pill {
  flex: 1 1 0;
  min-width: 0;
  justify-content: center;
  text-align: center;
  padding: 8px 10px;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gram-neurocommenting-page .gram-nc-pill-row--3 .gram-gpt-pill {
  font-size: 11px;
  white-space: normal;
  line-height: 1.25;
  padding: 7px 6px;
}

.gram-neurocommenting-page .gram-nc-work-pills {
  margin: 0;
  padding: 0;
}

.gram-neurocommenting-page .gram-nc-work-stack {
  margin-top: 14px;
}

.gram-neurocommenting-page .gram-nc-work-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gram-neurocommenting-page .gram-nc-limit-card {
  display: block;
  padding: 12px 14px;
  margin: 0;
  min-height: 0;
  overflow: visible;
}

.gram-neurocommenting-page .gram-nc-limit-card .gram-ml-slider-head,
.gram-neurocommenting-page .gram-nc-limit-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0;
}

.gram-neurocommenting-page .gram-nc-limit-title {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
  margin-left: auto;
  text-align: right;
}

.gram-neurocommenting-page .gram-nc-inline-tip {
  flex-shrink: 0;
}

.gram-neurocommenting-page .gram-nc-limit-label {
  flex: 0 1 auto;
  min-width: 0;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-muted);
}

.gram-neurocommenting-page .gram-nc-limit-input {
  flex: 0 0 92px;
  width: 92px !important;
  max-width: 92px !important;
  min-width: 92px;
  text-align: center;
  padding: 4px 8px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.22);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

html:not(.theme-dark) .gram-neurocommenting-page .gram-nc-limit-input {
  background: #ffffff;
  border-color: rgba(148, 163, 184, 0.45);
  color: #334155;
}

.gram-neurocommenting-page .gram-nc-skip-media-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(248, 250, 252, 0.55);
  flex-wrap: nowrap;
  overflow: visible;
}

html:not(.theme-dark) .gram-neurocommenting-page .gram-nc-skip-media-row {
  background: #f8fafc;
  border-color: rgba(226, 232, 240, 0.95);
}

html.theme-dark .gram-neurocommenting-page .gram-nc-skip-media-row {
  background: rgba(15, 23, 42, 0.35);
  border-color: rgba(71, 100, 150, 0.28);
}

.gram-neurocommenting-page .gram-nc-skip-media-toggle {
  flex: 1 1 auto;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.gram-neurocommenting-page .gram-nc-skip-media-toggle .gram-gpt-toggle-text {
  flex: 1 1 auto;
  min-width: 0;
}

.gram-neurocommenting-page .gram-nc-skip-media-toggle .gram-nc-inline-tip {
  margin-left: 2px;
}

.gram-neurocommenting-page .gram-nc-comment-sliders[hidden],
.gram-neurocommenting-page .gram-nc-work-panel[hidden] {
  display: none !important;
}

.gram-neurocommenting-page .gram-nc-posts-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
}

.gram-neurocommenting-page .gram-nc-duration-card {
  margin: 0;
}

.gram-neurocommenting-page .gram-nc-duration-hint {
  margin: 8px 0 0;
  font-size: 11px;
}

.gram-neurocommenting-page .gram-nc-work-panel .gram-gpt-toggle {
  margin: 0;
}

.gram-neurocommenting-page .gram-nc-mode-card .gram-ml-slider-card {
  background: #f8fafc;
  border-color: rgba(226, 232, 240, 0.95);
}

html.theme-dark .gram-neurocommenting-page .gram-nc-mode-card .gram-ml-slider-card {
  background: rgba(15, 23, 42, 0.35);
  border-color: rgba(71, 100, 150, 0.28);
}

html:not(.theme-dark) .gram-neurocommenting-page .gram-nc-mode-card .gram-ml-slider-card {
  background: #f8fafc;
  border-color: rgba(226, 232, 240, 0.95);
}

.gram-neurocommenting-page .gram-nc-limit-input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.gram-neurocommenting-page .gram-nc-limit-input[type="number"]::-webkit-outer-spin-button,
.gram-neurocommenting-page .gram-nc-limit-input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.gram-neurocommenting-page .gram-ai-defender-block {
  margin-bottom: 16px;
  overflow: visible;
  position: relative;
  z-index: 4;
}

.gram-neurocommenting-page .gram-ai-defender-block .gram-gpt-window-head {
  align-items: flex-start;
  gap: 12px;
  overflow: visible;
  position: relative;
  z-index: 2;
}

.gram-neurocommenting-page .gram-ai-defender-block .gram-gpt-window-body {
  padding-top: 4px;
}

.gram-neurocommenting-page .gram-ai-defender-body {
  padding-top: 12px;
}

.gram-neurocommenting-page .gram-ai-defender-block .gram-gpt-window-title-row .gram-info-tip-inline {
  margin-top: 1px;
}

.gram-neurocommenting-page .gram-ai-defender-block:has(.gram-ai-defender-body[hidden]) .gram-info-tip {
  visibility: visible;
}

.gram-neurocommenting-page .gram-ai-defender-block.is-off .gram-gpt-window-head {
  border-bottom: none;
}

.gram-neurocommenting-page .gram-ai-defender-block.is-off .gram-info-tip,
.gram-neurocommenting-page .gram-ai-defender-block.is-off .gram-info-tip-link {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.gram-neurocommenting-page .gram-ai-defender-block.is-off {
  overflow: visible;
  position: relative;
  z-index: 5;
}

/* —— Нейрокомментинг: промпт + редактор —— */
.gram-nc-prompt-card {
  margin: 4px 0 14px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--gram-border, var(--border));
  background: color-mix(in srgb, var(--gram-card, var(--surface)) 92%, #8b5cf6 8%);
}

.gram-nc-prompt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.gram-nc-prompt-preview {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-muted);
  white-space: pre-wrap;
  word-break: break-word;
}

.gram-nc-prompt-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.gram-nc-options .gram-gpt-toggle.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.gram-neurocommenting-page .gram-mr-mode-card.gram-nc-mode-card {
  border-radius: 12px;
  padding: 14px;
  min-width: 0;
  box-shadow: none;
}

.gram-neurocommenting-page .gram-mr-mode-card.gram-nc-work-card {
  background: #f8fafc;
  border: 1px solid rgba(226, 232, 240, 0.95);
  overflow: visible;
  position: relative;
  z-index: 1;
}

.gram-neurocommenting-page .gram-nc-work-card:has(.gram-info-tip.is-open),
.gram-neurocommenting-page .gram-nc-work-card:has(.gram-info-tip:focus-within),
.gram-neurocommenting-page .gram-nc-work-card:has(.gram-info-tip:hover) {
  z-index: 40;
}

.gram-neurocommenting-page.gram-nc-glass .gram-gpt-window-body {
  overflow: visible;
}

html.theme-dark .gram-neurocommenting-page .gram-mr-mode-card.gram-nc-work-card {
  background: rgba(15, 23, 42, 0.35);
  border-color: rgba(71, 100, 150, 0.28);
}

.gram-neurocommenting-page.gram-nc-glass .gram-mr-mode-card.gram-nc-work-card {
  background: rgba(21, 34, 56, 0.72);
  border: 1px solid rgba(56, 189, 248, 0.32);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow:
    inset 0 1px 0 rgba(56, 189, 248, 0.12),
    0 0 0 1px rgba(56, 189, 248, 0.08),
    0 4px 18px rgba(2, 8, 23, 0.14);
}

html:not(.theme-dark) .gram-neurocommenting-page.gram-nc-glass .gram-mr-mode-card.gram-nc-work-card {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(56, 189, 248, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 0 0 1px rgba(56, 189, 248, 0.1),
    0 4px 20px rgba(15, 23, 42, 0.06);
}

.gram-neurocommenting-page .gram-nc-mode-card:not(.gram-nc-comment-card) {
  border-radius: 12px;
  padding: 14px;
  min-width: 0;
  box-shadow: none;
}

.gram-neurocommenting-page .gram-nc-comment-card.gram-nc-mode-card {
  box-shadow:
    0 0 0 1px rgba(244, 114, 182, 0.38),
    0 0 28px rgba(244, 114, 182, 0.22),
    0 0 48px rgba(244, 114, 182, 0.12),
    0 8px 24px rgba(15, 23, 42, 0.08);
}

.gram-neurocommenting-page:not(.gram-nc-glass) .gram-nc-mode-card:not(.gram-nc-comment-card) {
  border: 1px solid var(--gram-border, var(--border));
  background: #f8fafc;
}

html.theme-dark .gram-neurocommenting-page:not(.gram-nc-glass) .gram-nc-mode-card:not(.gram-nc-comment-card) {
  background: rgba(15, 23, 42, 0.35);
  border-color: rgba(71, 100, 150, 0.28);
}

.gram-neurocommenting-page .gram-nc-targets-count {
  margin-right: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--gram-tone-violet, #8b5cf6);
}

.gram-neurocommenting-page .gram-gpt-window-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.gram-neurocommenting-page .gram-gpt-window-title-row .gram-gpt-window-title {
  flex-shrink: 0;
}

.gram-neurocommenting-page .gram-nc-targets-chip {
  margin-left: auto;
  flex-shrink: 0;
}

.gram-neurocommenting-page .gram-gpt-window-title-row .gram-gpt-chip {
  margin-left: auto;
}

.gram-neurocommenting-page .gram-nc-prompts-panel {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
}

.gram-neurocommenting-page.gram-nc-glass .gram-nc-prompts-panel {
  border: 1px solid rgba(56, 189, 248, 0.22);
  background: rgba(21, 34, 56, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow:
    inset 0 1px 0 rgba(56, 189, 248, 0.08),
    0 4px 18px rgba(2, 8, 23, 0.12);
}

html:not(.theme-dark) .gram-neurocommenting-page.gram-nc-glass .gram-nc-prompts-panel {
  background: rgba(255, 255, 255, 0.55);
  border-color: rgba(148, 163, 184, 0.35);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
}

html.theme-dark .gram-neurocommenting-page.gram-nc-glass .gram-nc-prompts-panel {
  background: rgba(21, 34, 56, 0.82);
  border-color: rgba(56, 189, 248, 0.24);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    inset 0 1px 0 rgba(56, 189, 248, 0.1),
    0 4px 22px rgba(0, 0, 0, 0.28),
    0 0 20px rgba(56, 189, 248, 0.05);
}

.gram-neurocommenting-page .gram-nc-prompts-head {
  margin-bottom: 8px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.gram-neurocommenting-page .gram-nc-prompts-head .gram-card-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  font-size: 13px;
}

.gram-neurocommenting-page .gram-nc-prompts-head strong {
  line-height: 1.2;
}

.gram-neurocommenting-page.gram-nc-glass .gram-nc-prompts-head strong {
  color: var(--text);
}

.gram-neurocommenting-page .gram-nc-prompts-section {
  margin-bottom: 8px;
}

.gram-neurocommenting-page .gram-nc-prompts-section:last-of-type {
  margin-bottom: 6px;
}

.gram-neurocommenting-page .gram-nc-prompts-label {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
}

.gram-neurocommenting-page.gram-nc-glass .gram-nc-prompts-label {
  color: #93c5fd;
}

html:not(.theme-dark) .gram-neurocommenting-page.gram-nc-glass .gram-nc-prompts-label {
  color: #0284c7;
}

.gram-neurocommenting-page .gram-nc-prompt-count {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 4px;
}

.gram-neurocommenting-page .gram-nc-prompt-tiles {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 4px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.gram-neurocommenting-page .gram-nc-prompt-tile {
  position: relative;
  flex: 0 0 118px;
  width: 118px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-height: 64px;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  text-align: left;
  cursor: pointer;
  scroll-snap-align: start;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.gram-neurocommenting-page.gram-nc-glass .gram-nc-prompt-tile.gram-nc-prompt-card {
  background: rgba(21, 34, 56, 0.72);
  border-color: rgba(56, 189, 248, 0.22);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow:
    inset 0 1px 0 rgba(56, 189, 248, 0.08),
    0 4px 14px rgba(2, 8, 23, 0.12);
}

html:not(.theme-dark) .gram-neurocommenting-page.gram-nc-glass .gram-nc-prompt-tile.gram-nc-prompt-card {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(148, 163, 184, 0.35);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

html.theme-dark .gram-neurocommenting-page.gram-nc-glass .gram-nc-prompt-tile.gram-nc-prompt-card {
  background: rgba(21, 34, 56, 0.88);
  border-color: rgba(56, 189, 248, 0.26);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    inset 0 1px 0 rgba(56, 189, 248, 0.1),
    0 4px 18px rgba(0, 0, 0, 0.3),
    0 0 16px rgba(56, 189, 248, 0.06);
}

.gram-neurocommenting-page.gram-nc-glass .gram-nc-prompt-tile.gram-nc-prompt-card:hover {
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow:
    inset 0 1px 0 rgba(56, 189, 248, 0.12),
    0 6px 18px rgba(14, 165, 233, 0.14);
}

.gram-neurocommenting-page.gram-nc-glass .gram-nc-prompt-tile.is-active {
  border-width: 2px;
  border-color: rgba(56, 189, 248, 0.95);
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.45),
    0 0 20px rgba(56, 189, 248, 0.3);
}

html:not(.theme-dark) .gram-neurocommenting-page.gram-nc-glass .gram-nc-prompt-tile.is-active {
  border-color: rgba(14, 165, 233, 0.9);
  box-shadow:
    0 0 0 1px rgba(14, 165, 233, 0.4),
    0 0 18px rgba(14, 165, 233, 0.22);
}

html.theme-dark .gram-neurocommenting-page.gram-nc-glass .gram-nc-prompt-tile.is-active {
  border-color: rgba(56, 189, 248, 0.95);
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.5),
    0 0 24px rgba(56, 189, 248, 0.35);
}

.gram-neurocommenting-page.gram-nc-glass .gram-nc-prompt-tile.is-system::before {
  content: "";
  position: absolute;
  top: 0;
  left: 8px;
  right: 8px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  opacity: 0.85;
}

.gram-neurocommenting-page .gram-nc-prompt-tile-kind {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  font-size: 9px;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
}

.gram-neurocommenting-page.gram-nc-glass .gram-nc-prompt-tile.is-system .gram-nc-prompt-tile-kind {
  color: #a78bfa;
  background: rgba(139, 92, 246, 0.14);
}

.gram-neurocommenting-page .gram-nc-prompt-tile--create {
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 64px;
  border-style: dashed;
  color: #38bdf8;
  font-size: 11px;
  font-weight: 600;
}

.gram-neurocommenting-page.gram-nc-glass .gram-nc-prompt-tile--create {
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(14, 165, 233, 0.06);
}

.gram-neurocommenting-page.gram-nc-glass .gram-nc-prompt-tile--create:hover {
  border-color: rgba(56, 189, 248, 0.7);
  background: rgba(14, 165, 233, 0.12);
  color: #7dd3fc;
}

.gram-neurocommenting-page .gram-nc-prompt-tile--create i {
  font-size: 14px;
}

.gram-neurocommenting-page .gram-nc-prompt-tile-name {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gram-neurocommenting-page .gram-nc-prompt-tile-excerpt {
  flex: 1;
  width: 100%;
  font-size: 10px;
  line-height: 1.3;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gram-neurocommenting-page .gram-nc-prompt-tile-actions {
  display: flex;
  gap: 2px;
  margin-top: auto;
  width: 100%;
  justify-content: flex-end;
}

.gram-neurocommenting-page .gram-nc-prompt-tile-act {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.08);
  color: #7dd3fc;
  cursor: pointer;
  font-size: 11px;
}

html:not(.theme-dark) .gram-neurocommenting-page .gram-nc-prompt-tile-act {
  background: rgba(14, 165, 233, 0.1);
  color: #0284c7;
}

.gram-neurocommenting-page .gram-nc-prompt-tile-act:hover {
  color: #fff;
  background: rgba(56, 189, 248, 0.28);
}

.gram-neurocommenting-page .gram-nc-prompt-tile-act--danger:hover {
  color: #fff;
  background: rgba(239, 68, 68, 0.55);
}

.gram-neurocommenting-page .gram-nc-prompt-empty {
  margin: 0;
  flex: 0 0 auto;
  font-size: 11px;
  color: var(--text-muted);
}

.gram-neurocommenting-page .gram-nc-prompt-active-bar {
  margin-top: 2px;
  padding: 6px 8px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.gram-neurocommenting-page.gram-nc-glass .gram-nc-prompt-active-bar {
  border: 1px solid rgba(56, 189, 248, 0.2);
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.08), rgba(21, 34, 56, 0.35));
  box-shadow: inset 0 1px 0 rgba(56, 189, 248, 0.06);
}

html:not(.theme-dark) .gram-neurocommenting-page.gram-nc-glass .gram-nc-prompt-active-bar {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.06), rgba(255, 255, 255, 0.7));
  border-color: rgba(148, 163, 184, 0.32);
}

html.theme-dark .gram-neurocommenting-page.gram-nc-glass .gram-nc-prompt-active-bar {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.1), rgba(21, 34, 56, 0.75));
  border-color: rgba(56, 189, 248, 0.22);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow:
    inset 0 1px 0 rgba(56, 189, 248, 0.08),
    0 2px 12px rgba(0, 0, 0, 0.2);
}

.gram-neurocommenting-page .gram-nc-autoreply-block .gram-mr-prompt-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex-wrap: nowrap;
  width: 100%;
}

.gram-neurocommenting-page .gram-nc-autoreply-block .gram-mr-prompt-select {
  flex: 1;
  min-width: 180px;
  max-width: none;
}

.gram-neurocommenting-page .gram-nc-autoreply-block .gram-gpt-select-btn {
  justify-content: space-between;
}

.gram-neurocommenting-page .gram-nc-autoreply-block #ncArPromptCreate {
  flex-shrink: 0;
  align-self: stretch;
  white-space: nowrap;
}

.gram-neurocommenting-page .gram-mr-ar-textarea {
  resize: none;
  min-height: 140px;
  max-height: 220px;
  height: 140px;
  width: 100%;
  max-width: 100%;
  overflow-y: auto;
}

.gram-neurocommenting-page .gram-mr-attach-strip {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin-top: 8px;
  margin-bottom: 8px;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  flex-shrink: 0;
  align-self: flex-start;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}

.gram-neurocommenting-page .gram-mr-attach-strip .gram-spam-attach-chip {
  flex: 0 0 auto;
  max-width: 220px;
}

.gram-neurocommenting-page .gram-mr-ar-toolbar {
  margin-bottom: 8px;
}

.gram-neurocommenting-page .gram-nc-prompt-active-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 2px;
}

.gram-neurocommenting-page .gram-nc-prompt-active-label {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 999px;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.28);
}

html:not(.theme-dark) .gram-neurocommenting-page .gram-nc-prompt-active-label {
  color: #0369a1;
  background: rgba(14, 165, 233, 0.1);
  border-color: rgba(14, 165, 233, 0.28);
}

html.theme-dark .gram-neurocommenting-page .gram-nc-prompt-active-label {
  color: #7dd3fc;
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.35);
}

.gram-neurocommenting-page .gram-nc-prompt-active-name {
  font-size: 11px;
  font-weight: 600;
  color: #93c5fd;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
  text-align: left;
}

html:not(.theme-dark) .gram-neurocommenting-page .gram-nc-prompt-active-name {
  color: #2563eb;
}

.gram-neurocommenting-page .gram-nc-prompt-preview {
  margin: 0;
  font-size: 11px;
  line-height: 1.35;
  color: var(--text-muted);
}

.gram-neurocommenting-page .gram-nc-prompt-view-pop {
  position: fixed;
  inset: 0;
  z-index: 11500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
}

.gram-neurocommenting-page .gram-nc-prompt-view-pop[hidden] {
  display: none !important;
}

.gram-neurocommenting-page .gram-nc-prompt-view-modal {
  width: min(400px, 100%);
  max-height: min(48vh, 360px);
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  overflow: hidden;
}

.gram-neurocommenting-page.gram-nc-glass .gram-nc-prompt-view-modal {
  border: 1px solid rgba(56, 189, 248, 0.28);
  background: rgba(21, 34, 56, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.1),
    0 20px 48px rgba(0, 0, 0, 0.45),
    0 0 32px rgba(56, 189, 248, 0.1);
}

html:not(.theme-dark) .gram-neurocommenting-page.gram-nc-glass .gram-nc-prompt-view-modal {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(148, 163, 184, 0.38);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
}

.gram-neurocommenting-page .gram-nc-prompt-view-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  font-size: 13px;
}

.gram-neurocommenting-page.gram-nc-glass .gram-nc-prompt-view-head {
  border-bottom: 1px solid rgba(56, 189, 248, 0.16);
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.1), rgba(15, 23, 42, 0.02));
}

html:not(.theme-dark) .gram-neurocommenting-page.gram-nc-glass .gram-nc-prompt-view-head {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.08), rgba(255, 255, 255, 0.5));
  border-bottom-color: rgba(148, 163, 184, 0.3);
}

.gram-neurocommenting-page .gram-nc-prompt-view-body {
  margin: 0;
  flex: 1;
  overflow: auto;
  padding: 10px;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.gram-neurocommenting-page .gram-nc-prompt-view-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.gram-neurocommenting-page .gram-nc-prompt-view-close:hover {
  background: color-mix(in srgb, var(--text-muted) 12%, transparent);
  color: var(--text);
}

.gram-neurocommenting-page .gram-nc-autoreply-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: none;
}

.gram-neurocommenting-page .gram-nc-ai-window {
  max-width: none;
  overflow: visible;
}

.gram-neurocommenting-page .gram-nc-ai-window .gram-gpt-window-head {
  align-items: flex-start;
  gap: 12px;
  overflow: visible;
  position: relative;
  z-index: 2;
}

.gram-neurocommenting-page .gram-nc-ai-window .gram-gpt-window-title-row .gram-info-tip {
  position: relative;
  z-index: 5;
}

.gram-neurocommenting-page .gram-nc-ai-window .gram-gpt-window-title-row .gram-info-tip-pop {
  top: calc(100% + 8px);
  bottom: auto;
  left: 0;
  right: auto;
  transform: translateY(4px);
  z-index: 30;
  pointer-events: auto;
  width: min(280px, calc(100vw - 48px));
}

.gram-neurocommenting-page .gram-nc-ai-window .gram-info-tip:hover .gram-info-tip-pop,
.gram-neurocommenting-page .gram-nc-ai-window .gram-info-tip.is-open .gram-info-tip-pop,
.gram-neurocommenting-page .gram-nc-ai-window .gram-info-tip:focus-within .gram-info-tip-pop {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.gram-neurocommenting-page .gram-nc-ai-window .gram-gpt-window-title-row .gram-info-tip-inline {
  margin-left: 4px;
}

.gram-neurocommenting-page .gram-nc-ai-window .gram-gpt-window-body {
  width: 100%;
}

html.theme-dark .gram-neurocommenting-page.gram-nc-glass .gram-nc-mode-card:not(.gram-nc-comment-card),
html.theme-dark .gram-neurocommenting-page.gram-nc-glass .gram-mr-mode-card.gram-nc-mode-card:not(.gram-nc-comment-card),
html.theme-dark .gram-neurocommenting-page.gram-nc-glass .gram-mr-mode-card.gram-nc-work-card {
  background: rgba(21, 34, 56, 0.88);
  border-color: rgba(56, 189, 248, 0.24);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    inset 0 1px 0 rgba(56, 189, 248, 0.1),
    0 4px 20px rgba(0, 0, 0, 0.28);
}

html.theme-dark .gram-neurocommenting-page.gram-nc-glass .gram-nc-prompt-tile--create {
  border-color: rgba(56, 189, 248, 0.38);
  background: rgba(14, 165, 233, 0.1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

html.theme-dark .gram-neurocommenting-page.gram-nc-glass .gram-gpt-window-head {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.12) 0%, rgba(21, 34, 56, 0.15) 100%);
  border-bottom-color: rgba(56, 189, 248, 0.18);
}

.gram-nc-modes-sheet .gram-nc-sheet-hint {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}

.gram-nc-work-hours-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.gram-nc-run-panel .gram-spam-results-summary-meta [data-nc-stat-ok] {
  color: #22c55e;
}

.gram-prompt-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
}

.gram-prompt-overlay[hidden] {
  display: none !important;
}

.gram-prompt-modal {
  width: min(560px, 100%);
  max-height: min(88vh, 760px);
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  border: 1px solid var(--gram-border, var(--border));
  background: var(--gram-card, var(--surface));
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.25);
}

.gram-prompt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--gram-border, var(--border));
}

.gram-prompt-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.gram-prompt-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.gram-prompt-close:hover {
  background: color-mix(in srgb, var(--text-muted) 12%, transparent);
  color: var(--text);
}

.gram-prompt-body {
  flex: 1;
  overflow: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gram-prompt-vars {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.gram-prompt-var {
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, #8b5cf6 35%, var(--gram-border, var(--border)));
  background: color-mix(in srgb, #8b5cf6 10%, transparent);
  color: var(--text);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  cursor: pointer;
}

.gram-prompt-var:hover {
  background: color-mix(in srgb, #8b5cf6 18%, transparent);
}

.gram-prompt-kb-stub {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px dashed var(--gram-border, var(--border));
  color: var(--text-muted);
  font-size: 13px;
}

.gram-prompt-list-wrap {
  margin-top: 4px;
}

.gram-prompt-list-head {
  margin-bottom: 8px;
  font-size: 13px;
}

.gram-prompt-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 180px;
  overflow: auto;
}

.gram-prompt-empty {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.gram-prompt-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--gram-border, var(--border));
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}

.gram-prompt-card strong {
  font-size: 13px;
}

.gram-prompt-card-sub {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.35;
}

.gram-prompt-card.is-active {
  border-color: color-mix(in srgb, #8b5cf6 55%, var(--gram-border, var(--border)));
  background: color-mix(in srgb, #8b5cf6 10%, var(--surface));
}

.gram-prompt-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--gram-border, var(--border));
}

html.theme-dark .gram-prompt-overlay {
  background: rgba(2, 6, 23, 0.72);
}

html.theme-dark .gram-nc-prompt-card {
  background: color-mix(in srgb, var(--gram-card, var(--surface)) 88%, #7c3aed 12%);
}

/* —— Нейродиалоги: glass + unified page —— */
.gram-neurodialogues-page.gram-nd-glass .gram-gpt-window,
.gram-neurodialogues-page.gram-nd-glass .gram-ai-defender-block {
  border: 1px solid rgba(244, 114, 182, 0.28);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    0 0 0 1px rgba(244, 114, 182, 0.08),
    0 8px 32px rgba(2, 8, 23, 0.18);
  overflow: visible;
}

html.theme-dark .gram-neurodialogues-page.gram-nd-glass .gram-gpt-window,
html.theme-dark .gram-neurodialogues-page.gram-nd-glass .gram-ai-defender-block {
  background: #152238;
  border-color: rgba(244, 114, 182, 0.32);
  box-shadow:
    0 0 0 1px rgba(244, 114, 182, 0.12),
    0 8px 28px rgba(0, 0, 0, 0.35),
    0 0 24px rgba(244, 114, 182, 0.06);
}

html:not(.theme-dark) .gram-neurodialogues-page.gram-nd-glass .gram-gpt-window,
html:not(.theme-dark) .gram-neurodialogues-page.gram-nd-glass .gram-ai-defender-block {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(244, 114, 182, 0.28);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.85),
    0 8px 32px rgba(15, 23, 42, 0.08),
    0 0 20px rgba(244, 114, 182, 0.08);
}

.gram-neurodialogues-page.gram-nd-glass .gram-gpt-window-head {
  background: linear-gradient(135deg, rgba(244, 114, 182, 0.1) 0%, rgba(15, 23, 42, 0.02) 100%);
  border-bottom-color: rgba(244, 114, 182, 0.16);
}

html:not(.theme-dark) .gram-neurodialogues-page.gram-nd-glass .gram-gpt-window-head {
  background: linear-gradient(135deg, rgba(244, 114, 182, 0.08) 0%, rgba(255, 255, 255, 0.45) 100%);
  border-bottom-color: rgba(244, 114, 182, 0.22);
}

.gram-neurodialogues-page.gram-nd-glass .gram-gpt-notice {
  border: 1px solid rgba(244, 114, 182, 0.22);
  border-radius: 10px;
  background: rgba(244, 114, 182, 0.06);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.gram-neurodialogues-page.gram-nd-glass .gram-gpt-action-bar {
  border: 1px solid rgba(244, 114, 182, 0.22);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

html:not(.theme-dark) .gram-neurodialogues-page.gram-nd-glass .gram-gpt-action-bar {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(244, 114, 182, 0.2);
}

.gram-nd-ai-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.gram-nd-ai-head-text {
  flex: 1 1 180px;
  min-width: 0;
}

.gram-nd-ai-head-desc {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

.gram-nd-auto-badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: var(--text-muted);
  background: rgba(148, 163, 184, 0.08);
}

.gram-nd-auto-badge.is-on {
  border-color: rgba(34, 197, 94, 0.45);
  color: #16a34a;
  background: rgba(34, 197, 94, 0.1);
}

.gram-nd-auto-toggle {
  margin-left: auto;
}

.gram-nd-ai-grid {
  margin-top: 12px;
}

.gram-nd-goal-inline {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.gram-nd-limits-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 760px) {
  .gram-nd-limits-row {
    grid-template-columns: 1fr;
  }
}

.gram-neurodialogues-page.gram-nd-glass .gram-nd-limit-card {
  border: 1px solid rgba(244, 114, 182, 0.32);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.gram-neurodialogues-page.gram-nd-glass .gram-nd-limit-card.is-on {
  box-shadow:
    0 0 0 1px rgba(244, 114, 182, 0.38),
    0 0 28px rgba(244, 114, 182, 0.16),
    0 8px 24px rgba(15, 23, 42, 0.12);
}

.gram-nd-stop-link-body {
  padding-top: 4px;
}

.gram-nd-inbox-section {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(244, 114, 182, 0.16);
}

.gram-neurodialogues-page.gram-nd-glass .gram-nd-inbox-shell {
  border: 1px solid rgba(244, 114, 182, 0.22);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 28px rgba(2, 8, 23, 0.14);
}

html:not(.theme-dark) .gram-neurodialogues-page.gram-nd-glass .gram-nd-inbox-shell {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(244, 114, 182, 0.2);
}

.gram-neurodialogues-page.gram-nd-glass .gram-nd-prompts-panel {
  border-color: rgba(244, 114, 182, 0.18);
  background: rgba(244, 114, 182, 0.04);
}

.gram-neurodialogues-page.gram-nd-glass .gram-gpt-param-input[type="number"] {
  -moz-appearance: textfield;
}

.gram-neurodialogues-page.gram-nd-glass .gram-gpt-param-input[type="number"]::-webkit-outer-spin-button,
.gram-neurodialogues-page.gram-nd-glass .gram-gpt-param-input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* —— Нейродиалоги: inbox + tabs —— */
.gram-neurodialogues-page.gram-nd-view-inbox {
  --nd-inbox-height: calc(100vh - 220px);
}

.gram-neurodialogues-page.gram-nd-view-inbox .gram-nd-page-head {
  margin-bottom: 8px;
  justify-content: flex-end;
}

.gram-neurodialogues-page.gram-nd-view-inbox .gram-nd-page-head-inbox {
  min-height: 0;
  padding-bottom: 0;
}

.gram-neurodialogues-page.gram-nd-view-inbox .gram-nd-inbox-hero {
  margin: 0;
}

.gram-neurodialogues-page .gram-nd-tabs {
  display: flex;
  gap: 8px;
  margin: 0 0 16px;
  flex-wrap: wrap;
}

.gram-nd-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--gram-border, var(--border));
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.gram-nd-tab:hover {
  color: var(--text);
  border-color: color-mix(in srgb, #3b82f6 35%, var(--gram-border, var(--border)));
}

.gram-nd-tab.is-active {
  border-color: color-mix(in srgb, #3b82f6 55%, var(--gram-border, var(--border)));
  background: color-mix(in srgb, #3b82f6 14%, var(--surface));
  color: var(--text);
  box-shadow: 0 0 0 1px color-mix(in srgb, #3b82f6 18%, transparent);
}

.gram-nd-inbox-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gram-nd-inbox-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.gram-nd-inbox-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.gram-nd-inbox-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gram-nd-btn-load {
  box-shadow: 0 8px 24px color-mix(in srgb, #3b82f6 28%, transparent);
}

.gram-nd-stat-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.gram-nd-stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--gram-border, var(--border));
  background: color-mix(in srgb, var(--gram-card, var(--surface)) 94%, #0f172a 6%);
}

.gram-nd-stat-copy strong {
  display: block;
  font-size: 24px;
  line-height: 1.1;
  font-weight: 700;
}

.gram-nd-stat-copy span {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-muted);
}

.gram-nd-stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.gram-nd-stat-card.gram-tone-blue .gram-nd-stat-icon {
  background: color-mix(in srgb, #3b82f6 18%, transparent);
  color: #60a5fa;
}

.gram-nd-stat-card.gram-tone-cyan .gram-nd-stat-icon {
  background: color-mix(in srgb, #06b6d4 18%, transparent);
  color: #22d3ee;
}

.gram-nd-stat-card.gram-tone-amber .gram-nd-stat-icon {
  background: color-mix(in srgb, #f59e0b 18%, transparent);
  color: #fbbf24;
}

.gram-nd-account-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px 14px;
  margin: 0 0 14px;
  min-height: 52px;
}

.gram-nd-account-filter-hint {
  align-self: center;
  font-size: 12px;
  color: var(--text-muted);
}

.gram-nd-acc-chip {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.15s ease;
}

.gram-nd-acc-chip-inner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: -0.02em;
  border: 2px solid var(--gram-border, var(--border));
  background: color-mix(in srgb, var(--surface) 90%, #0f172a 10%);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.gram-nd-acc-chip:hover .gram-nd-acc-chip-inner {
  border-color: rgba(244, 114, 182, 0.45);
  color: var(--text);
}

.gram-nd-acc-chip.is-active {
  color: var(--text);
}

.gram-nd-acc-chip.is-active .gram-nd-acc-chip-inner {
  border-color: rgba(244, 114, 182, 0.85);
  box-shadow: 0 0 0 3px rgba(244, 114, 182, 0.16);
  background: rgba(244, 114, 182, 0.12);
}

.gram-nd-acc-chip-lbl {
  max-width: 72px;
  font-size: 10px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gram-nd-acc-chip-count {
  position: absolute;
  top: -2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  color: #fff;
  background: rgba(244, 114, 182, 0.92);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.2);
}

.gram-nd-inbox-shell {
  border: 1px solid var(--gram-border, var(--border));
  border-radius: 16px;
  background: color-mix(in srgb, var(--gram-card, var(--surface)) 96%, #0b1220 4%);
  overflow: hidden;
  min-height: min(560px, var(--nd-inbox-height, 520px));
}

.gram-nd-inbox-body {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 0;
  min-height: min(560px, var(--nd-inbox-height, 520px));
}

.gram-nd-sidebar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-right: 1px solid var(--gram-border, var(--border));
  padding: 12px;
  min-height: 0;
  background: color-mix(in srgb, var(--surface) 98%, #0f172a 2%);
}

.gram-nd-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--gram-border, var(--border));
  background: color-mix(in srgb, var(--surface) 90%, #0f172a 10%);
}

.gram-nd-search-wrap i {
  color: var(--text-muted);
  font-size: 14px;
}

.gram-nd-search-input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  padding: 10px 0;
  outline: none;
}

.gram-nd-dialog-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: auto;
  flex: 1;
  min-height: 0;
  padding-right: 0;
}

.gram-nd-dialog {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 0;
  border: none;
  border-bottom: 1px solid color-mix(in srgb, var(--gram-border, var(--border)) 50%, transparent);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease;
}

.gram-nd-dialog:hover {
  background: color-mix(in srgb, #2aabee 10%, transparent);
}

.gram-nd-dialog.is-active {
  border-color: transparent;
  background: color-mix(in srgb, #2aabee 18%, transparent);
}

.gram-nd-dialog-avatar,
.gram-nd-chat-head-avatar {
  --nd-avatar-hue: 200;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
  background: linear-gradient(
    145deg,
    hsl(var(--nd-avatar-hue) 62% 48%),
    hsl(calc(var(--nd-avatar-hue) + 28) 68% 38%)
  );
}

.gram-nd-dialog-avatar.has-photo,
.gram-nd-chat-head-avatar.has-photo {
  background: none;
  padding: 0;
}

.gram-nd-dialog-avatar img,
.gram-nd-chat-head-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gram-nd-dialog-main {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.gram-nd-dialog-top {
  display: flex;
  width: 100%;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.gram-nd-dialog-name {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
}

.gram-nd-dialog-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.gram-nd-dialog-time {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  flex-shrink: 0;
}

.gram-nd-dialog-bottom {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.gram-nd-dialog-preview {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
}

.gram-nd-dialog-trail {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-left: auto;
}

.gram-nd-dialog-checks {
  color: #5ac8fa;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -1px;
  line-height: 1;
}

.gram-nd-dialog.has-unread .gram-nd-dialog-name {
  font-weight: 700;
}

.gram-nd-dialog.has-unread .gram-nd-dialog-preview {
  color: var(--text);
  font-weight: 500;
}

.gram-nd-dialog-unread {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: #8e8e93;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  line-height: 22px;
  text-align: center;
  display: inline-block;
}

.gram-nd-dialog-acc {
  font-size: 11px;
  color: color-mix(in srgb, #60a5fa 80%, var(--text-muted));
}

.gram-nd-paused {
  font-size: 10px;
  color: #f59e0b;
  font-weight: 600;
}

.gram-nd-list-empty,
.gram-nd-chat-empty {
  margin: 0;
  padding: 16px 8px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

.gram-nd-chat {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: color-mix(in srgb, var(--gram-card, var(--surface)) 98%, #0b1220 2%);
}

.gram-nd-chat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--gram-border, var(--border));
}

.gram-nd-chat-head-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gram-nd-chat-head-main strong {
  font-size: 14px;
  line-height: 1.3;
}

.gram-nd-chat-head-acc {
  font-size: 11px;
  color: var(--text-muted);
}

.gram-nd-chat-messages {
  flex: 1;
  overflow: auto;
  padding: 14px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 280px;
  background-color: #0e1621;
  background-image:
    radial-gradient(ellipse at 20% 10%, rgba(42, 171, 238, 0.06), transparent 45%),
    radial-gradient(ellipse at 80% 90%, rgba(42, 171, 238, 0.04), transparent 40%);
}

.gram-nd-bubble {
  max-width: min(78%, 420px);
  padding: 8px 10px 6px;
  border-radius: 12px;
  font-size: 14.5px;
  line-height: 1.4;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.12);
}

.gram-nd-bubble.is-pending {
  opacity: 0.72;
}

.gram-nd-bubble.is-user {
  align-self: flex-start;
  background: #182533;
  border: none;
  border-top-left-radius: 4px;
}

.gram-nd-bubble.is-ai {
  align-self: flex-end;
  background: #2b5278;
  border: none;
  border-top-right-radius: 4px;
}

.gram-nd-bubble.is-other {
  align-self: flex-end;
  background: color-mix(in srgb, #2b5278 88%, #1e3a57 12%);
  border: none;
  border-top-right-radius: 4px;
}

.gram-nd-bubble-label {
  display: none;
}

.gram-nd-bubble-text {
  white-space: pre-wrap;
  word-break: break-word;
}

.gram-nd-bubble-time {
  display: block;
  margin-top: 4px;
  text-align: right;
  font-size: 11px;
  opacity: 0.65;
}

.gram-nd-reply-form {
  display: flex;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--gram-border, var(--border));
  align-items: flex-end;
  background: #17212b;
}

.gram-nd-reply-input {
  flex: 1;
  min-height: 44px;
  max-height: 120px;
  resize: none;
  border-radius: 22px !important;
  padding: 12px 16px !important;
}

.gram-nd-reply-send {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50% !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.gram-nd-run-bar {
  margin-top: 4px;
}

.gram-nd-run-bar .gram-action-bar {
  border-radius: 14px;
  border: 1px solid var(--gram-border, var(--border));
  background: color-mix(in srgb, var(--gram-card, var(--surface)) 96%, #0f172a 4%);
  padding: 10px 12px;
}

.gram-nd-chat-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 320px;
  color: var(--text-muted);
  padding: 32px 24px;
  margin: auto;
}

.gram-nd-ph-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: color-mix(in srgb, #3b82f6 14%, transparent);
  border: 1px solid color-mix(in srgb, #3b82f6 22%, transparent);
  box-shadow: 0 0 48px color-mix(in srgb, #3b82f6 18%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #60a5fa;
  margin-bottom: 16px;
}

.gram-nd-chat-placeholder strong {
  color: var(--text);
  margin-bottom: 8px;
  font-size: 16px;
}

.gram-nd-chat-placeholder p {
  margin: 0;
  font-size: 13px;
  max-width: 300px;
  line-height: 1.5;
}

.gram-nd-refresh-hidden {
  display: none !important;
}

@media (max-width: 900px) {
  .gram-nd-stat-cards {
    grid-template-columns: 1fr;
  }

  .gram-nd-inbox-body {
    grid-template-columns: 1fr;
  }

  .gram-nd-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--gram-border, var(--border));
    max-height: 280px;
  }
}

/* —— CRM —— */
.gram-crm-page .gram-crm-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.gram-crm-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--gram-border, var(--border));
  background: var(--surface);
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
}

.gram-crm-tab.is-active {
  border-color: color-mix(in srgb, #10b981 50%, var(--gram-border, var(--border)));
  background: color-mix(in srgb, #10b981 12%, var(--surface));
  color: var(--text);
}

.gram-crm-period-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.gram-crm-period {
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid var(--gram-border, var(--border));
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
}

.gram-crm-period.is-active {
  color: var(--text);
  border-color: color-mix(in srgb, #10b981 45%, var(--gram-border, var(--border)));
}

.gram-crm-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.gram-crm-card {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--gram-border, var(--border));
  background: var(--gram-card, var(--surface));
}

.gram-crm-card strong {
  display: block;
  font-size: 22px;
  margin-top: 4px;
}

.gram-crm-card-label {
  font-size: 12px;
  color: var(--text-muted);
}

.gram-crm-card-muted small {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
}

.gram-crm-panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.gram-crm-funnel-row {
  display: grid;
  grid-template-columns: 88px 1fr 36px;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  font-size: 12px;
}

.gram-crm-funnel-track {
  height: 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text-muted) 12%, transparent);
  overflow: hidden;
}

.gram-crm-funnel-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #10b981, #34d399);
}

.gram-crm-hint {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.gram-crm-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.gram-crm-chip {
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--gram-border, var(--border));
  background: transparent;
  font-size: 12px;
  cursor: pointer;
  color: var(--text-muted);
}

.gram-crm-chip.is-active {
  border-color: color-mix(in srgb, #10b981 45%, var(--gram-border, var(--border)));
  color: var(--text);
  background: color-mix(in srgb, #10b981 10%, transparent);
}

.gram-crm-table-wrap {
  overflow: auto;
  border: 1px solid var(--gram-border, var(--border));
  border-radius: 12px;
  margin-bottom: 10px;
}

.gram-crm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.gram-crm-table th,
.gram-crm-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--gram-border, var(--border));
  text-align: left;
  vertical-align: top;
}

.gram-crm-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--text-muted) 6%, transparent);
}

.gram-crm-lead-row {
  cursor: pointer;
}

.gram-crm-lead-row:hover {
  background: color-mix(in srgb, var(--text-muted) 6%, transparent);
}

.gram-crm-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.gram-crm-stage {
  display: inline-block;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, #64748b 14%, var(--surface));
  border: 1px solid transparent;
}

.gram-crm-stage--base { background: color-mix(in srgb, #94a3b8 18%, var(--surface)); border-color: color-mix(in srgb, #94a3b8 40%, transparent); color: #94a3b8; }
.gram-crm-stage--contacted { background: color-mix(in srgb, #3b82f6 16%, var(--surface)); border-color: color-mix(in srgb, #3b82f6 45%, transparent); color: #60a5fa; }
.gram-crm-stage--replied { background: color-mix(in srgb, #22c55e 16%, var(--surface)); border-color: color-mix(in srgb, #22c55e 45%, transparent); color: #4ade80; }
.gram-crm-stage--hot { background: color-mix(in srgb, #f97316 18%, var(--surface)); border-color: color-mix(in srgb, #f97316 50%, transparent); color: #fb923c; }
.gram-crm-stage--warm { background: color-mix(in srgb, #f59e0b 16%, var(--surface)); border-color: color-mix(in srgb, #f59e0b 45%, transparent); color: #fbbf24; }
.gram-crm-stage--cold { background: color-mix(in srgb, #38bdf8 16%, var(--surface)); border-color: color-mix(in srgb, #38bdf8 45%, transparent); color: #7dd3fc; }
.gram-crm-stage--won { background: color-mix(in srgb, #10b981 18%, var(--surface)); border-color: color-mix(in srgb, #10b981 50%, transparent); color: #34d399; }
.gram-crm-stage--refused { background: color-mix(in srgb, #ef4444 16%, var(--surface)); border-color: color-mix(in srgb, #ef4444 45%, transparent); color: #f87171; }

.gram-crm-leads-page .gram-crm-replies-stat-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.gram-crm-leads-page .gram-crm-stat-sm {
  font-size: 15px !important;
  line-height: 1.25;
}

.gram-crm-leads-page .gram-crm-leads-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 10px;
}

.gram-crm-leads-page .gram-crm-board-card .gram-crm-stage {
  margin-top: 6px;
}

.gram-crm-chip.gram-crm-stage--base.is-active,
.gram-crm-chip.gram-crm-stage--contacted.is-active,
.gram-crm-chip.gram-crm-stage--replied.is-active,
.gram-crm-chip.gram-crm-stage--hot.is-active,
.gram-crm-chip.gram-crm-stage--warm.is-active,
.gram-crm-chip.gram-crm-stage--cold.is-active,
.gram-crm-chip.gram-crm-stage--won.is-active,
.gram-crm-chip.gram-crm-stage--refused.is-active {
  box-shadow: inset 0 0 0 1px currentColor;
}

/* CRM · spam_pm shell */
.gram-crm-page.gram-spam-pm-page .gram-crm-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.gram-crm-page.gram-spam-pm-page .gram-crm-period-row {
  margin-bottom: 14px;
}

.gram-crm-page .gram-crm-spam-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  gap: 12px !important;
  align-items: stretch !important;
  margin-bottom: 12px;
}

.gram-crm-page .gram-crm-live-stats {
  margin-bottom: 12px;
}

.gram-crm-page .gram-crm-lead-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gram-crm-page .gram-crm-lead-card {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) auto minmax(0, 0.8fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--gram-border, var(--border));
  background: var(--gram-card, var(--surface));
  cursor: pointer;
}

.gram-crm-page .gram-crm-lead-card:hover {
  border-color: color-mix(in srgb, #0088cc 40%, var(--gram-border, var(--border)));
}

.gram-crm-page .gram-crm-lead-card-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gram-crm-page .gram-crm-hist-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gram-crm-page .gram-crm-hist-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--gram-border, var(--border));
  background: var(--gram-card, var(--surface));
}

.gram-crm-page .gram-crm-hist-time {
  font-size: 12px;
  color: var(--text-muted);
}

.gram-crm-page .gram-crm-hist-preview {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

.gram-crm-page .gram-crm-replies-log {
  max-height: 180px;
  overflow: auto;
  margin: 0;
  font-size: 12px;
  white-space: pre-wrap;
}

@media (max-width: 900px) {
  .gram-crm-page .gram-crm-spam-grid {
    grid-template-columns: 1fr !important;
  }
  .gram-crm-page .gram-crm-lead-card {
    grid-template-columns: 1fr auto;
  }
  .gram-crm-page .gram-crm-hist-row {
    grid-template-columns: 1fr;
  }
}

.gram-crm-cell-preview {
  max-width: 280px;
  color: var(--text-muted);
}

.gram-crm-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 20px;
}

.gram-crm-pager {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.gram-crm-modal {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
}

.gram-crm-modal[hidden] {
  display: none !important;
}

.gram-crm-modal-card {
  width: min(520px, 100%);
  max-height: min(88vh, 720px);
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  border: 1px solid var(--gram-border, var(--border));
  background: var(--gram-card, var(--surface));
}

.gram-crm-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--gram-border, var(--border));
}

.gram-crm-modal-head h3 {
  margin: 0;
  font-size: 16px;
}

.gram-crm-modal-body {
  padding: 14px 16px;
  overflow: auto;
}

.gram-crm-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.gram-crm-ev-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.gram-crm-ev {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--gram-border, var(--border));
  font-size: 13px;
}

.gram-crm-ev-meta {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.gram-crm-ev p {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.gram-nd-load-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.gram-nd-load-card {
  width: min(420px, 100%);
  border-radius: 14px;
  border: 1px solid var(--gram-border, var(--border));
  background: var(--gram-card, var(--surface));
  padding: 14px;
}

.gram-nd-load-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.gram-nd-load-list {
  max-height: 240px;
  overflow: auto;
  margin: 10px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gram-nd-load-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.gram-nd-load-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.gram-crm-leads-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--gram-border, var(--border));
  background: color-mix(in srgb, var(--surface) 94%, #10b981 6%);
}

.gram-crm-leads-toolbar-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-right: 4px;
}

.gram-crm-leads-hint {
  flex: 1 1 100%;
  margin: 0;
  font-size: 12px;
}

.gram-crm-board {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.gram-crm-board-col {
  min-width: 180px;
  max-width: 200px;
  flex: 0 0 auto;
  border-radius: 12px;
  border: 1px solid var(--gram-border, var(--border));
  background: color-mix(in srgb, var(--surface) 92%, #10b981 8%);
}

.gram-crm-board-col-head {
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 600;
  border-bottom: 1px solid var(--gram-border, var(--border));
  display: flex;
  justify-content: space-between;
}

.gram-crm-board-drop {
  min-height: 120px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gram-crm-board-card {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--gram-border, var(--border));
  background: var(--surface);
  cursor: grab;
  font-size: 12px;
}

.gram-crm-board-card strong {
  display: block;
  font-size: 13px;
}

.gram-crm-rem-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.gram-crm-reminder {
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px dashed var(--gram-border, var(--border));
  font-size: 12px;
}

.gram-prompt-kb-list {
  margin: 8px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gram-prompt-kb-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.gram-prompt-kb-upload {
  cursor: pointer;
  margin-top: 6px;
}

.gram-prompt-kb-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 8px;
  padding: 18px 12px;
  border-radius: 12px;
  border: 2px dashed color-mix(in srgb, #8b5cf6 35%, var(--gram-border, var(--border)));
  background: color-mix(in srgb, #8b5cf6 6%, transparent);
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  text-align: center;
}

.gram-prompt-kb-dropzone:hover {
  border-color: color-mix(in srgb, #8b5cf6 55%, var(--gram-border, var(--border)));
  color: var(--text);
}

.gram-prompt-kb-dropzone i {
  font-size: 22px;
  color: #8b5cf6;
}

.gram-prompt-kb-dropzone small {
  font-size: 11px;
  opacity: 0.85;
}

.gram-ml-ai-hint a {
  color: inherit;
  text-decoration: underline;
}

/* Prompt editor modal (макет GRAMPGPT) */
.gram-prompt-modal-wide {
  width: min(720px, 96vw);
  max-height: min(92vh, 860px);
}

.gram-prompt-modal-profile {
  width: min(460px, calc(100vw - 28px)) !important;
  max-width: 460px !important;
  border-radius: 14px;
  border: 1px solid rgba(59, 130, 246, 0.18);
  box-shadow:
    0 0 0 1px rgba(59, 130, 246, 0.08),
    0 20px 48px rgba(15, 23, 42, 0.14),
    0 0 56px rgba(59, 130, 246, 0.1);
}

html.theme-dark .gram-prompt-modal-profile {
  background: rgba(22, 30, 46, 0.98);
  border-color: rgba(59, 130, 246, 0.28);
  box-shadow:
    0 0 0 1px rgba(59, 130, 246, 0.18),
    0 20px 48px rgba(0, 0, 0, 0.52),
    0 0 72px rgba(59, 130, 246, 0.16);
}

.gram-prompt-modal-profile .gram-prompt-head {
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.06));
}

html.theme-dark .gram-prompt-modal-profile .gram-prompt-head {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.14), rgba(139, 92, 246, 0.08));
}

.gram-prompt-modal-profile .gram-prompt-body {
  gap: 10px;
  padding: 12px 14px;
}

.gram-prompt-modal-profile .gram-prompt-template {
  min-height: 120px;
  max-height: 200px;
  resize: none;
}

.gram-prompt-modal-profile .gram-field-label,
.gram-prompt-modal-profile .gram-prompt-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #64748b);
}

html.theme-dark .gram-prompt-modal-profile .gram-input,
html.theme-dark .gram-prompt-modal-profile .gram-textarea,
html.theme-dark .gram-prompt-modal-profile .settings-input {
  background: rgba(15, 23, 42, 0.55);
  border-color: rgba(71, 100, 150, 0.35);
}

.gram-prompt-modal-profile .gram-prompt-foot {
  padding: 12px 14px;
  border-top: 1px solid rgba(148, 163, 184, 0.2);
}

html.theme-dark .gram-prompt-modal-profile .gram-prompt-foot {
  border-top-color: rgba(71, 100, 150, 0.28);
}

.gram-prompt-modal-profile .gram-prompt-foot .gram-gpt-btn-primary.is-saving {
  opacity: 0.75;
  pointer-events: none;
}

.gram-prompt-modal-profile .gram-prompt-row2 {
  grid-template-columns: 1fr;
}

/* Prompt sheet — massreactions (как profile sheet + GramGPT секции) */
.gram-prompt-modal-sheet.gram-prompt-modal-profile {
  color: var(--text);
}

.gram-prompt-modal-sheet .gram-prompt-head-default {
  display: none;
}

.gram-prompt-modal-sheet .gram-prompt-head-sheet {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.06));
}

html.theme-dark .gram-prompt-modal-sheet .gram-prompt-head-sheet {
  border-bottom-color: rgba(71, 100, 150, 0.28);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.14), rgba(139, 92, 246, 0.08));
}

.gram-prompt-head-sheet {
  display: none;
}

.gram-prompt-modal-sheet .gram-prompt-head-sheet .gram-modal-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.gram-prompt-modal-sheet .gram-prompt-head-sheet .gram-modal-icon {
  width: 34px;
  height: 34px;
  font-size: 15px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

html.theme-dark .gram-prompt-modal-sheet .gram-prompt-head-sheet .gram-modal-icon {
  background: rgba(59, 130, 246, 0.22);
  color: #93c5fd;
}

.gram-prompt-modal-sheet .gram-prompt-head-sheet .panel-modal-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

html.theme-dark .gram-prompt-modal-sheet .gram-prompt-head-sheet .panel-modal-title {
  color: #f8fafc;
}

.gram-prompt-modal-sheet .gram-prompt-body {
  gap: 14px;
  padding: 14px;
}

.gram-prompt-modal-sheet .gram-prompt-row2 {
  grid-template-columns: 1fr;
  gap: 10px;
}

.gram-prompt-modal-sheet .gram-field-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #64748b);
}

.gram-prompt-modal-sheet .gram-prompt-template-field > .gram-field-label,
.gram-prompt-modal-sheet .gram-prompt-vars-block > .gram-prompt-vars-label {
  display: none;
}

.gram-prompt-section-head-sheet {
  display: none;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.gram-prompt-section-head-sheet i {
  font-size: 14px;
  color: #3b82f6;
}

html.theme-dark .gram-prompt-section-head-sheet i {
  color: #93c5fd;
}

.gram-prompt-modal-sheet .gram-prompt-section-head-sheet {
  display: flex;
}

.gram-prompt-vars-hint {
  display: none;
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-muted);
}

.gram-prompt-modal-sheet .gram-prompt-vars-hint {
  display: block;
}

.gram-prompt-modal-sheet .gram-prompt-params-block > .gram-prompt-section-title {
  display: none;
}

.gram-prompt-modal-sheet .gram-prompt-template {
  min-height: 110px;
  max-height: 180px;
  resize: none;
  font-family: ui-monospace, monospace;
  font-size: 13px;
}

.gram-prompt-modal-sheet .gram-prompt-len-card {
  padding: 0;
  border: none;
  background: transparent;
}

.gram-prompt-modal-sheet .gram-ml-slider-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.gram-prompt-modal-sheet .gram-ml-slider-value {
  font-size: 13px;
  font-weight: 700;
  color: #2563eb;
}

html.theme-dark .gram-prompt-modal-sheet .gram-ml-slider-value {
  color: #93c5fd;
}

.gram-prompt-len-hint {
  display: none;
  margin: 4px 0 0;
  font-size: 11px;
  color: var(--text-muted);
}

.gram-prompt-modal-sheet .gram-prompt-len-hint {
  display: block;
}

.gram-prompt-modal-sheet .gram-prompt-vars-rich {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gram-prompt-modal-sheet .gram-prompt-var-card {
  flex-direction: row;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(59, 130, 246, 0.35);
  background: rgba(59, 130, 246, 0.1);
}

html.theme-dark .gram-prompt-modal-sheet .gram-prompt-var-card {
  border-color: rgba(96, 165, 250, 0.4);
  background: rgba(59, 130, 246, 0.14);
}

.gram-prompt-modal-sheet .gram-prompt-var-card code {
  font-size: 12px;
  color: #2563eb;
}

html.theme-dark .gram-prompt-modal-sheet .gram-prompt-var-card code {
  color: #93c5fd;
}

.gram-prompt-modal-sheet .gram-prompt-var-card span {
  font-size: 11px;
  opacity: 0.75;
}

.gram-prompt-modal-sheet .gram-prompt-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 14px;
}

.gram-prompt-modal-compact {
  width: min(480px, 94vw);
  max-height: min(86vh, 720px);
}

.gram-prompt-modal-compact .gram-prompt-body {
  gap: 10px;
}

.gram-prompt-modal-compact .gram-prompt-template {
  min-height: 120px;
}

.gram-prompt-modal-compact .gram-prompt-row2 {
  grid-template-columns: 1fr;
}

.gram-prompt-section-title {
  display: block;
  margin: 4px 0 2px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #64748b);
}

.gram-prompt-vars-rich {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}

.gram-prompt-var-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, #8b5cf6 30%, var(--gram-border, var(--border)));
  background: color-mix(in srgb, #8b5cf6 8%, transparent);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.gram-prompt-var-card code {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
}

.gram-prompt-var-card span {
  font-size: 11px;
  line-height: 1.3;
  opacity: 0.8;
}

.gram-prompt-var-card:hover {
  background: color-mix(in srgb, #8b5cf6 16%, transparent);
}

.gram-prompt-row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.gram-prompt-template {
  min-height: 160px;
  font-family: ui-monospace, monospace;
  font-size: 13px;
}

.gram-prompt-vars-block {
  margin: 8px 0 14px;
}

.gram-prompt-vars-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.gram-prompt-len-ends {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.gram-prompt-kb-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin: 4px 0 8px;
}

.gram-nd-refresh-hidden {
  display: none !important;
}

.gram-nd-settings-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.gram-nd-settings-section {
  border: 1px solid var(--gram-border, var(--border));
  border-radius: 16px;
  background: color-mix(in srgb, var(--gram-card, var(--surface)) 96%, #0f172a 4%);
  overflow: hidden;
}

.gram-nd-settings-section-compact {
  padding: 14px 16px;
}

.gram-nd-settings-section-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--gram-border, var(--border));
  background: color-mix(in srgb, var(--surface) 94%, #0f172a 6%);
}

.gram-nd-settings-section-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.gram-nd-settings-section-desc {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

.gram-nd-settings-section-body {
  padding: 14px 16px 16px;
}

.gram-nd-role-row {
  margin-bottom: 12px;
}

.gram-nd-goal-grid {
  grid-template-columns: 1fr;
}

/* Neurodialogues settings prompts */
.gram-nd-prompts-panel {
  margin: 0;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--gram-border, var(--border));
  background: color-mix(in srgb, var(--surface) 92%, #0f172a 8%);
}

.gram-nd-prompts-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.gram-nd-prompts-system {
  margin-bottom: 10px;
}

.gram-nd-prompts-system summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  padding: 6px 0;
}

.gram-nd-prompt-count {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 6px;
}

.gram-nd-prompts-subhead {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 8px;
}

.gram-nd-prompt-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gram-nd-prompt-card {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--gram-border, var(--border));
  background: var(--surface);
  font-size: 13px;
}

.gram-nd-prompt-card.is-active {
  border-color: color-mix(in srgb, #8b5cf6 55%, var(--gram-border, var(--border)));
  background: color-mix(in srgb, #8b5cf6 10%, var(--surface));
}

.gram-nd-prompt-card-actions {
  display: inline-flex;
  gap: 2px;
}

.gram-nd-prompt-act {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 6px;
}

.gram-nd-prompt-act:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--text-muted) 12%, transparent);
}

.gram-nd-active-preview {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-muted);
}

.gram-nd-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.gram-nd-settings-block {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--gram-border, var(--border));
  background: color-mix(in srgb, var(--surface) 94%, #3b82f6 6%);
}

@media (max-width: 900px) {
  .gram-nd-settings-grid {
    grid-template-columns: 1fr;
  }
}

/* CRM stat cards */
.gram-crm-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.gram-crm-head-actions {
  flex-shrink: 0;
}

.gram-crm-stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.gram-crm-stat-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--gram-border, var(--border));
}

.gram-crm-stat-card strong {
  display: block;
  font-size: 20px;
}

.gram-crm-stat-card span {
  font-size: 11px;
  color: var(--text-muted);
}

.gram-crm-stat-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gram-crm-tone-green {
  background: color-mix(in srgb, #10b981 10%, var(--surface));
}
.gram-crm-tone-green .gram-crm-stat-icon {
  background: color-mix(in srgb, #10b981 20%, transparent);
  color: #10b981;
}

.gram-crm-tone-blue {
  background: color-mix(in srgb, #3b82f6 10%, var(--surface));
}
.gram-crm-tone-blue .gram-crm-stat-icon {
  background: color-mix(in srgb, #3b82f6 20%, transparent);
  color: #3b82f6;
}

.gram-crm-tone-violet {
  background: color-mix(in srgb, #8b5cf6 10%, var(--surface));
}
.gram-crm-tone-violet .gram-crm-stat-icon {
  background: color-mix(in srgb, #8b5cf6 20%, transparent);
  color: #8b5cf6;
}

.gram-crm-tone-cyan {
  background: color-mix(in srgb, #06b6d4 10%, var(--surface));
}
.gram-crm-tone-cyan .gram-crm-stat-icon {
  background: color-mix(in srgb, #06b6d4 20%, transparent);
  color: #06b6d4;
}

.gram-crm-tone-amber {
  background: color-mix(in srgb, #f59e0b 10%, var(--surface));
}
.gram-crm-tone-amber .gram-crm-stat-icon {
  background: color-mix(in srgb, #f59e0b 20%, transparent);
  color: #f59e0b;
}

.gram-crm-tone-rose {
  background: color-mix(in srgb, #f43f5e 10%, var(--surface));
}
.gram-crm-tone-rose .gram-crm-stat-icon {
  background: color-mix(in srgb, #f43f5e 20%, transparent);
  color: #f43f5e;
}

@media (max-width: 640px) {
  .gram-prompt-row2 {
    grid-template-columns: 1fr;
  }
  .gram-nd-stat-cards {
    grid-template-columns: 1fr;
  }
  .header-ai-balance span:first-child {
    max-width: 52px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* AI tokens modal */
.gram-ai-tokens-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
}

.gram-ai-tokens-overlay[hidden] {
  display: none !important;
}

.gram-ai-tokens-modal {
  width: min(440px, 96vw);
  max-height: min(90vh, 640px);
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  border: 1px solid var(--gram-border, var(--border));
  background: var(--gram-card, var(--surface));
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.25);
}

.gram-ai-tokens-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--gram-border, var(--border));
}

.gram-ai-tokens-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.gram-ai-tokens-body {
  padding: 14px 16px 18px;
  overflow: auto;
}

.gram-ai-tokens-hint {
  margin: 0 0 14px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-muted);
}

.gram-ai-tokens-section {
  margin-bottom: 14px;
}

.gram-ai-tokens-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.gram-ai-pay-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.gram-ai-pay-method {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--gram-border, var(--border));
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.gram-ai-pay-method strong {
  display: block;
  font-size: 13px;
}

.gram-ai-pay-method small {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
}

.gram-ai-pay-method-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--text-muted) 10%, transparent);
  flex-shrink: 0;
}

.gram-ai-pay-method.is-active {
  border-color: color-mix(in srgb, #3b82f6 55%, var(--gram-border, var(--border)));
  background: color-mix(in srgb, #3b82f6 8%, var(--surface));
}

.gram-ai-pay-method.is-disabled,
.gram-ai-pay-method.is-soon {
  opacity: 0.45;
  cursor: not-allowed;
}

.gram-ai-pack-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gram-ai-pack {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--gram-border, var(--border));
  background: var(--surface);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.gram-ai-pack span {
  font-size: 14px;
}

.gram-ai-pack strong {
  font-size: 15px;
  color: color-mix(in srgb, #10b981 80%, var(--text));
}

.gram-ai-pack.is-active,
.gram-ai-pack:hover {
  border-color: color-mix(in srgb, #8b5cf6 45%, var(--gram-border, var(--border)));
  background: color-mix(in srgb, #8b5cf6 6%, var(--surface));
}

/* —— Ловец лидов · AI Defender —— */
.gram-wiretapping-page .gram-ai-defender-block {
  margin-bottom: 16px;
}

.gram-ai-defender-block .gram-gpt-window-head {
  align-items: flex-start;
  gap: 12px;
  overflow: visible;
  position: relative;
  z-index: 2;
}

.gram-ai-defender-block .gram-gpt-window-title-row .gram-info-tip {
  position: relative;
  z-index: 5;
}

.gram-ai-defender-block .gram-info-tip-pop {
  z-index: 30;
}

.gram-ai-defender-block .gram-gpt-window-title-row .gram-info-tip-inline {
  margin-top: 1px;
}

html.theme-light .gram-ai-defender-block .gram-info-tip-link,
html:not(.theme-dark) .gram-ai-defender-block .gram-info-tip-link {
  color: #2563eb;
  background: rgba(37, 99, 235, 0.08);
  border-radius: 6px;
  padding: 2px 7px;
}

html.theme-light .gram-ai-defender-block .gram-info-tip-link i,
html:not(.theme-dark) .gram-ai-defender-block .gram-info-tip-link i {
  font-size: 14px;
}

.gram-ai-defender-head-text {
  flex: 1;
  min-width: 0;
}

.gram-ai-defender-desc {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--gram-text-muted, var(--text-muted));
}

.gram-ai-defender-new {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #059669;
  background: rgba(52, 211, 153, 0.15);
  vertical-align: middle;
}

.gram-ai-defender-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  cursor: pointer;
  margin: 0;
}

.gram-ai-defender-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.gram-ai-defender-switch {
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: #cbd5e1;
  position: relative;
  transition: background 0.2s;
}

.gram-ai-defender-toggle input:checked + .gram-ai-defender-switch {
  background: linear-gradient(135deg, #22d3ee, #2563eb);
}

.gram-ai-defender-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s;
}

.gram-ai-defender-toggle input:checked + .gram-ai-defender-switch::after {
  transform: translateX(20px);
}

.gram-ai-defender-body {
  padding-top: 4px;
}

.gram-ai-defender-modes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.gram-ai-defender-mode {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--gram-border, var(--border));
  background: var(--gram-surface-2, var(--surface-hover));
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.gram-ai-defender-mode strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #0f172a);
}

html.theme-dark .gram-ai-defender-mode strong {
  color: var(--text, #e2e8f0);
}

.gram-ai-defender-mode > span:last-child {
  font-size: 12px;
  color: var(--gram-text-muted, var(--text-muted));
  line-height: 1.35;
}

.gram-ai-defender-mode:hover {
  border-color: rgba(37, 99, 235, 0.35);
}

.gram-ai-defender-mode.is-active {
  border-color: #2563eb;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.25);
  background: rgba(37, 99, 235, 0.05);
}

html.theme-dark .gram-ai-defender-mode.is-active {
  border-color: #22d3ee;
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.35);
  background: rgba(34, 211, 238, 0.08);
}

.gram-ai-defender-mode-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  margin-bottom: 2px;
}

@media (max-width: 720px) {
  .gram-ai-defender-modes {
    grid-template-columns: 1fr;
  }
}

.gram-ai-defender-status {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
}

.gram-ai-defender-status-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.gram-ai-defender-status-hint {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}

.gram-ai-defender-status-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 160px;
}

.gram-ai-defender-status-empty {
  font-size: 12px;
  color: var(--text-muted);
  padding: 8px 4px;
}

.gram-ai-defender-status-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto minmax(0, 1.2fr);
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(248, 250, 252, 0.5);
  font-size: 12px;
}

html.theme-dark .gram-ai-defender-status-row {
  background: rgba(15, 23, 42, 0.45);
  border-color: rgba(71, 100, 150, 0.35);
}

.gram-ai-defender-status-row.is-medium {
  border-color: rgba(234, 179, 8, 0.35);
}

.gram-ai-defender-status-row.is-high {
  border-color: rgba(248, 113, 113, 0.4);
}

.gram-ai-defender-status-acc {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gram-ai-defender-status-state {
  color: var(--text-muted);
  white-space: nowrap;
}

.gram-ai-defender-status-msg {
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gram-neurochatting-page.gram-nct-glass .gram-gpt-window {
  border: 1px solid rgba(71, 100, 150, 0.32);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.06),
    0 8px 32px rgba(2, 8, 23, 0.18);
  overflow: visible;
}

html.theme-dark .gram-neurochatting-page.gram-nct-glass .gram-gpt-window {
  background: #152238;
  border-color: rgba(56, 189, 248, 0.24);
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.1),
    0 8px 28px rgba(0, 0, 0, 0.35),
    0 0 24px rgba(56, 189, 248, 0.05);
}

html:not(.theme-dark) .gram-neurochatting-page.gram-nct-glass .gram-gpt-window {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(148, 163, 184, 0.35);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.85),
    0 8px 32px rgba(15, 23, 42, 0.08),
    0 0 20px rgba(56, 189, 248, 0.06);
}

.gram-neurochatting-page.gram-nct-glass .gram-gpt-window-head {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.1) 0%, rgba(15, 23, 42, 0.02) 100%);
  border-bottom-color: rgba(56, 189, 248, 0.16);
}

html:not(.theme-dark) .gram-neurochatting-page.gram-nct-glass .gram-gpt-window-head {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.08) 0%, rgba(255, 255, 255, 0.45) 100%);
  border-bottom-color: rgba(148, 163, 184, 0.3);
}

.gram-neurochatting-page.gram-nct-glass .gram-gpt-notice {
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 10px;
  background: rgba(14, 165, 233, 0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.gram-neurochatting-page.gram-nct-glass .gram-mr-mode-card.gram-ml-mode-card {
  background: rgba(21, 34, 56, 0.72);
  border: 1px solid rgba(56, 189, 248, 0.32);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow:
    inset 0 1px 0 rgba(56, 189, 248, 0.12),
    0 0 0 1px rgba(56, 189, 248, 0.08),
    0 4px 18px rgba(2, 8, 23, 0.14);
}

html:not(.theme-dark) .gram-neurochatting-page.gram-nct-glass .gram-mr-mode-card.gram-ml-mode-card {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(56, 189, 248, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 0 0 1px rgba(56, 189, 248, 0.1),
    0 4px 20px rgba(15, 23, 42, 0.06);
}

.gram-neurochatting-page.gram-nct-glass .gram-ml-story-react-card {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(244, 114, 182, 0.45);
  box-shadow:
    inset 0 1px 0 rgba(244, 114, 182, 0.1),
    0 0 0 1px rgba(244, 114, 182, 0.14),
    0 0 20px rgba(244, 114, 182, 0.12);
}

.gram-neurochatting-page.gram-nct-glass .gram-gpt-action-bar {
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(14, 165, 233, 0.1) 0%, rgba(15, 23, 42, 0.22) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.07);
}

html:not(.theme-dark) .gram-neurochatting-page.gram-nct-glass .gram-gpt-action-bar {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96) 0%, rgba(241, 245, 249, 0.88) 100%);
  border-color: rgba(148, 163, 184, 0.35);
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.08);
}

.gram-neurochatting-page.gram-nct-glass #moduleLiveLog.gram-log-panel {
  border-color: rgba(56, 189, 248, 0.22);
  box-shadow: inset 0 0 24px rgba(56, 189, 248, 0.03);
}

.gram-neurochatting-page.gram-nct-glass .gram-ai-defender-block .gram-gpt-window-head {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.1) 0%, rgba(15, 23, 42, 0.02) 100%);
  border-bottom-color: rgba(56, 189, 248, 0.16);
}

.gram-neurochatting-page.gram-nct-glass .gram-nct-aud-tabs {
  gap: 4px;
  padding: 4px;
  margin-bottom: 12px;
  border-radius: 12px;
  border: 1px solid rgba(56, 189, 248, 0.18);
  background: rgba(15, 23, 42, 0.22);
}

html:not(.theme-dark) .gram-neurochatting-page.gram-nct-glass .gram-nct-aud-tabs {
  background: rgba(241, 245, 249, 0.92);
  border-color: rgba(148, 163, 184, 0.35);
}

.gram-neurochatting-page.gram-nct-glass .gram-nct-aud-tab {
  border-radius: 9px;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.gram-neurochatting-page.gram-nct-glass .gram-nct-aud-tab.active {
  background: rgba(14, 165, 233, 0.14);
  color: #38bdf8;
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.22);
}

html:not(.theme-dark) .gram-neurochatting-page.gram-nct-glass .gram-nct-aud-tab.active {
  background: #fff;
  color: #0284c7;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.gram-neurochatting-page.gram-nct-glass .gram-nct-side-card {
  background: rgba(21, 34, 56, 0.72);
  border: 1px solid rgba(56, 189, 248, 0.32);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow:
    inset 0 1px 0 rgba(56, 189, 248, 0.12),
    0 0 0 1px rgba(56, 189, 248, 0.08),
    0 4px 18px rgba(2, 8, 23, 0.14);
}

html:not(.theme-dark) .gram-neurochatting-page.gram-nct-glass .gram-nct-side-card {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(56, 189, 248, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 0 0 1px rgba(56, 189, 248, 0.1),
    0 4px 20px rgba(15, 23, 42, 0.06);
}

html:not(.theme-dark) .gram-neurochatting-page.gram-nct-glass .gram-gpt-pill:not(.active) {
  background: #f8fafc;
  border-color: rgba(148, 163, 184, 0.55);
  color: #475569;
}

.gram-neurochatting-page.gram-nct-glass .gram-gpt-pill.active {
  background: linear-gradient(135deg, #22d3ee, #2563eb);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

html.theme-dark .gram-neurochatting-page.gram-nct-glass .gram-gpt-pill:not(.active) {
  background: #1a2740;
  border-color: rgba(96, 165, 250, 0.28);
  color: #cbd5e1;
}

html.theme-dark .gram-neurochatting-page.gram-nct-glass .gram-gpt-pill.active {
  background: linear-gradient(135deg, #38bdf8, #3b82f6);
  border-color: transparent;
  color: #fff;
}

.gram-neurochatting-page .gram-nct-mode-card,
.gram-neurochatting-page .gram-nct-side-card {
  background: var(--gram-surface, #fff);
  border: 1px solid var(--gram-border, #e8ecf1);
  border-radius: 14px;
  padding: 16px 18px;
}

html.theme-dark .gram-neurochatting-page .gram-nct-mode-card,
html.theme-dark .gram-neurochatting-page .gram-nct-side-card {
  background: var(--gram-surface, #1a1f2b);
  border-color: rgba(255, 255, 255, 0.08);
}

.gram-nct-mode-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.gram-nct-mode-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  flex: 1;
}

.gram-nct-mode-pills {
  margin-bottom: 14px;
}

.gram-neurochatting-page .gram-mr-mode-grid {
  align-items: stretch;
}

.gram-neurochatting-page .gram-nct-mode-card.gram-mr-mode-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.gram-neurochatting-page .gram-nct-mode-card .gram-mr-mode-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.gram-neurochatting-page .gram-nct-mode-card .gram-gpt-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
  justify-content: center;
}

.gram-neurochatting-page .gram-nct-mode-card .gram-gpt-pill {
  flex: 1 1 calc(50% - 3px);
  justify-content: center;
  text-align: center;
  min-width: 0;
  padding: 8px 12px;
  font-size: 12px;
}

.gram-neurochatting-page .gram-nct-mode-card .gram-mr-mode-sliders {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
  min-height: 148px;
}

.gram-neurochatting-page .gram-nct-mode-card .gram-nct-work-slider {
  padding-bottom: 4px;
}

.gram-neurochatting-page .gram-nct-mode-card .gram-nct-work-slider + .gram-nct-work-slider {
  margin-top: 2px;
}

.gram-neurochatting-page .gram-nct-mode-card .gram-ml-slider-card {
  min-width: 0;
}

.gram-neurochatting-page .gram-nct-mode-card .gram-ml-slider-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  margin-bottom: 8px;
}

.gram-neurochatting-page .gram-nct-mode-card .gram-ml-slider-label {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  line-height: 1.35;
  white-space: normal;
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.gram-neurochatting-page .gram-nct-mode-card .gram-ml-slider-value {
  flex-shrink: 0;
  min-width: 2.5em;
  text-align: right;
  padding-top: 1px;
}

.gram-neurochatting-page .gram-nct-mode-card .gram-ml-slider-track {
  margin-top: 2px;
}

#nctRunAccountsPanel .gram-spam-account-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

#nctRunAccountsPanel .gram-spam-account-stat-card {
  flex: none;
  max-width: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  border-radius: 12px;
  background: var(--surface-hover, #f8fafc);
  border: 1px solid var(--border, rgba(148, 163, 184, 0.35));
}

html.theme-dark #nctRunAccountsPanel .gram-spam-account-stat-card {
  background: rgba(15, 23, 42, 0.35);
  border-color: rgba(71, 100, 150, 0.35);
  color: #e2e8f0;
}

#nctRunAccountsPanel .gram-spam-account-stat-card.is-done {
  border-color: rgba(34, 197, 94, 0.45);
}

#nctRunAccountsPanel .gram-spam-account-stat-card b {
  font-size: 13px;
}

#nctRunAccountsPanel .gram-spam-account-stat-card .stat-count {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
}

#nctRunAccountsPanel .gram-spam-account-stat-card span:last-child {
  font-size: 12px;
  opacity: 0.75;
}

.gram-neurochatting-page .gram-nct-mode-card.gram-ml-story-react-card.is-on {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(253, 242, 248, 0.55));
  border: 1px solid rgba(244, 114, 182, 0.35);
  box-shadow:
    0 0 0 1px rgba(244, 114, 182, 0.08),
    0 0 20px rgba(244, 114, 182, 0.12);
}

html.theme-dark .gram-neurochatting-page .gram-nct-mode-card.gram-ml-story-react-card.is-on {
  background: linear-gradient(145deg, rgba(21, 34, 56, 0.95), rgba(30, 20, 40, 0.55));
  border-color: rgba(244, 114, 182, 0.28);
}

.gram-neurochatting-page.gram-nct-glass .gram-nct-mode-card.gram-ml-story-react-card.is-on {
  box-shadow:
    0 0 0 1px rgba(244, 114, 182, 0.38),
    0 0 28px rgba(244, 114, 182, 0.2),
    0 8px 24px rgba(15, 23, 42, 0.12);
}

.gram-neurochatting-page.gram-nct-glass .gram-gpt-param-grid.gram-ml-param-grid .gram-gpt-param-card {
  background: rgba(15, 23, 42, 0.2);
  border: 1px solid rgba(71, 100, 150, 0.32);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

html:not(.theme-dark) .gram-neurochatting-page.gram-nct-glass .gram-gpt-param-grid.gram-ml-param-grid .gram-gpt-param-card {
  background: rgba(248, 250, 252, 0.85);
  border-color: rgba(148, 163, 184, 0.32);
}

.gram-neurochatting-page .gram-gpt-window-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.gram-neurochatting-page .gram-gpt-window-title-row .gram-gpt-window-title {
  flex-shrink: 0;
}

.gram-neurochatting-page .gram-nct-targets-chip {
  margin-left: auto;
  flex-shrink: 0;
}

.gram-neurochatting-page .gram-nct-params-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gram-neurochatting-page .gram-nct-params-block .gram-mr-mode-grid {
  margin: 0;
  align-items: stretch;
}

.gram-neurochatting-page .gram-nct-params-block .gram-nc-param-grid {
  margin: 0;
  gap: 10px;
}

.gram-neurochatting-page .gram-nct-reply-pills {
  margin-bottom: 10px;
}

.gram-neurochatting-page .gram-nct-prompts-panel {
  margin-top: 0;
  padding: 10px 12px;
  border-radius: 12px;
}

.gram-neurochatting-page.gram-nct-glass .gram-nct-prompts-panel {
  border: 1px solid rgba(56, 189, 248, 0.22);
  background: rgba(21, 34, 56, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow:
    inset 0 1px 0 rgba(56, 189, 248, 0.08),
    0 4px 18px rgba(2, 8, 23, 0.12);
}

html:not(.theme-dark) .gram-neurochatting-page.gram-nct-glass .gram-nct-prompts-panel {
  background: rgba(255, 255, 255, 0.55);
  border-color: rgba(148, 163, 184, 0.35);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
}

html.theme-dark .gram-neurochatting-page.gram-nct-glass .gram-nct-prompts-panel {
  background: rgba(21, 34, 56, 0.82);
  border-color: rgba(56, 189, 248, 0.24);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    inset 0 1px 0 rgba(56, 189, 248, 0.1),
    0 4px 22px rgba(0, 0, 0, 0.28),
    0 0 20px rgba(56, 189, 248, 0.05);
}

.gram-neurochatting-page .gram-nc-prompts-head {
  margin-bottom: 8px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.gram-neurochatting-page .gram-nc-prompts-head .gram-card-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  font-size: 13px;
}

.gram-neurochatting-page .gram-nc-prompts-section {
  margin-bottom: 8px;
}

.gram-neurochatting-page .gram-nc-prompts-label {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
}

.gram-neurochatting-page.gram-nct-glass .gram-nc-prompts-label {
  color: #93c5fd;
}

html:not(.theme-dark) .gram-neurochatting-page.gram-nct-glass .gram-nc-prompts-label {
  color: #0284c7;
}

.gram-neurochatting-page .gram-nc-prompt-tiles {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 4px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.gram-neurochatting-page .gram-nc-prompt-tile {
  position: relative;
  flex: 0 0 118px;
  width: 118px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-height: 64px;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  text-align: left;
  cursor: pointer;
  scroll-snap-align: start;
}

.gram-neurochatting-page.gram-nct-glass .gram-nc-prompt-tile.gram-nc-prompt-card {
  background: rgba(21, 34, 56, 0.72);
  border-color: rgba(56, 189, 248, 0.22);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

html:not(.theme-dark) .gram-neurochatting-page.gram-nct-glass .gram-nc-prompt-tile.gram-nc-prompt-card {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(148, 163, 184, 0.35);
}

.gram-neurochatting-page.gram-nct-glass .gram-nc-prompt-tile.is-active {
  border-width: 2px;
  border-color: rgba(56, 189, 248, 0.95);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.45), 0 0 20px rgba(56, 189, 248, 0.3);
}

.gram-neurochatting-page.gram-nct-glass .gram-nc-prompt-tile.is-system::before {
  content: "";
  position: absolute;
  top: 0;
  left: 8px;
  right: 8px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  opacity: 0.85;
}

.gram-neurochatting-page.gram-nct-glass .gram-nc-prompt-tile.is-system .gram-nc-prompt-tile-kind {
  color: #a78bfa;
  background: rgba(139, 92, 246, 0.14);
}

.gram-neurochatting-page .gram-nc-prompt-tile-kind {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  font-size: 9px;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
}

.gram-neurochatting-page .gram-nc-prompt-tile--create {
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 64px;
  border-style: dashed;
  color: #38bdf8;
  font-size: 11px;
  font-weight: 600;
}

.gram-neurochatting-page.gram-nct-glass .gram-nc-prompt-tile--create {
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(14, 165, 233, 0.06);
}

.gram-neurochatting-page .gram-nc-prompt-tile-name {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gram-neurochatting-page .gram-nc-prompt-tile-excerpt {
  flex: 1;
  width: 100%;
  font-size: 10px;
  line-height: 1.3;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gram-neurochatting-page .gram-nc-prompt-tile-actions {
  display: flex;
  gap: 2px;
  margin-top: auto;
  width: 100%;
  justify-content: flex-end;
}

.gram-neurochatting-page .gram-nc-prompt-tile-act {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.08);
  color: #7dd3fc;
  cursor: pointer;
  font-size: 11px;
}

.gram-neurochatting-page .gram-nc-prompt-empty {
  margin: 0;
  flex: 0 0 auto;
  font-size: 11px;
  color: var(--text-muted);
}

.gram-neurochatting-page .gram-nc-prompt-active-bar {
  margin-top: 2px;
  padding: 6px 8px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.gram-neurochatting-page.gram-nct-glass .gram-nc-prompt-active-bar {
  border: 1px solid rgba(56, 189, 248, 0.2);
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.08), rgba(21, 34, 56, 0.35));
}

html:not(.theme-dark) .gram-neurochatting-page.gram-nct-glass .gram-nc-prompt-active-bar {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.06), rgba(255, 255, 255, 0.7));
  border-color: rgba(148, 163, 184, 0.32);
}

.gram-neurochatting-page .gram-nc-prompt-active-label {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 999px;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.28);
}

html:not(.theme-dark) .gram-neurochatting-page .gram-nc-prompt-active-label {
  color: #0369a1;
  background: rgba(14, 165, 233, 0.1);
  border-color: rgba(14, 165, 233, 0.28);
}

html.theme-dark .gram-neurochatting-page .gram-nc-prompt-active-label {
  color: #7dd3fc;
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.35);
}

.gram-neurochatting-page .gram-nc-prompt-active-name {
  font-size: 11px;
  font-weight: 600;
  color: #93c5fd;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html:not(.theme-dark) .gram-neurochatting-page .gram-nc-prompt-active-name {
  color: #0369a1;
}

html.theme-dark .gram-neurochatting-page .gram-nc-prompt-active-name {
  color: #93c5fd;
}

.gram-neurochatting-page .gram-nc-prompt-view-pop {
  position: fixed;
  inset: 0;
  z-index: 11500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
}

.gram-neurochatting-page .gram-nc-prompt-view-pop[hidden] {
  display: none !important;
}

.gram-neurochatting-page .gram-nc-prompt-view-modal {
  width: min(400px, 100%);
  max-height: min(48vh, 360px);
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  overflow: hidden;
}

.gram-neurochatting-page.gram-nct-glass .gram-nc-prompt-view-modal {
  border: 1px solid rgba(56, 189, 248, 0.28);
  background: rgba(21, 34, 56, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.1),
    0 20px 48px rgba(0, 0, 0, 0.45),
    0 0 32px rgba(56, 189, 248, 0.1);
}

html:not(.theme-dark) .gram-neurochatting-page.gram-nct-glass .gram-nc-prompt-view-modal {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(148, 163, 184, 0.38);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
}

.gram-neurochatting-page .gram-nc-prompt-view-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  font-size: 13px;
}

.gram-neurochatting-page.gram-nct-glass .gram-nc-prompt-view-head {
  border-bottom: 1px solid rgba(56, 189, 248, 0.16);
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.1), rgba(15, 23, 42, 0.02));
}

html:not(.theme-dark) .gram-neurochatting-page.gram-nct-glass .gram-nc-prompt-view-head {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.08), rgba(255, 255, 255, 0.5));
  border-bottom-color: rgba(148, 163, 184, 0.3);
}

.gram-neurochatting-page .gram-nc-prompt-view-body {
  margin: 0;
  flex: 1;
  overflow: auto;
  padding: 10px;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.gram-neurochatting-page .gram-nc-prompt-view-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.gram-neurochatting-page .gram-nc-prompt-view-close:hover {
  background: color-mix(in srgb, var(--text-muted) 12%, transparent);
  color: var(--text);
}

.gram-neurochatting-page .gram-nct-autoreply-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: none;
}

.gram-neurochatting-page .gram-nct-autoreply-block .gram-mr-prompt-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex-wrap: nowrap;
  width: 100%;
}

.gram-neurochatting-page .gram-nct-autoreply-block .gram-mr-prompt-select {
  flex: 1;
  min-width: 180px;
  max-width: none;
}

.gram-neurochatting-page .gram-nct-autoreply-block .gram-gpt-select-btn {
  justify-content: space-between;
}

.gram-neurochatting-page .gram-nct-autoreply-block #nctArPromptCreate {
  flex-shrink: 0;
  align-self: stretch;
  white-space: nowrap;
}

.gram-neurochatting-page .gram-nct-ai-window {
  max-width: none;
  overflow: visible;
}

.gram-neurochatting-page .gram-nct-ai-window .gram-gpt-window-head {
  align-items: flex-start;
  gap: 12px;
  overflow: visible;
  position: relative;
  z-index: 2;
}

.gram-neurochatting-page .gram-nct-ai-window .gram-gpt-window-body {
  width: 100%;
}

.gram-neurochatting-page .gram-mr-ar-textarea {
  resize: none;
  min-height: 140px;
  max-height: 220px;
  height: 140px;
  width: 100%;
  max-width: 100%;
  overflow-y: auto;
}

.gram-nct-rotation {
  margin-top: 12px;
}

.gram-nct-rotation-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gram-amber, #d97706);
  margin-bottom: 8px;
}

.gram-nct-aud-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.gram-nct-aud-tab {
  border: 1px solid var(--gram-border, #dbe3ee);
  background: transparent;
  color: inherit;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  cursor: pointer;
}

.gram-nct-aud-tab.active {
  background: var(--gram-primary, #6366f1);
  border-color: transparent;
  color: #fff;
}

.gram-nct-link-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  align-items: center;
}

.gram-nct-link-chip,
.gram-nct-chip-count,
.gram-nct-chip-more {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.1);
}

.gram-nct-kw-input-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.gram-neurochatting-page .gram-nct-kw-tags {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.gram-neurochatting-page .gram-nct-kw-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.14);
  border: 1px solid rgba(99, 102, 241, 0.28);
  color: #4338ca;
  font-size: 12px;
  flex-shrink: 0;
  white-space: nowrap;
}

html.theme-dark .gram-neurochatting-page .gram-nct-kw-tag {
  background: rgba(99, 102, 241, 0.22);
  border-color: rgba(129, 140, 248, 0.35);
  color: #c7d2fe;
}

.gram-nct-kw-remove {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  opacity: 0.7;
}

.gram-nct-thematic-hint {
  margin-top: 8px;
}

.gram-nct-aud-list {
  margin-top: 10px;
  max-height: 220px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gram-nct-aud-item {
  text-align: left;
  border: 1px solid var(--gram-border, #e5e7eb);
  border-radius: 10px;
  padding: 10px 12px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.gram-nct-aud-item:hover {
  border-color: var(--gram-primary, #6366f1);
}

.gram-nct-aud-item-title {
  display: block;
  font-weight: 600;
  font-size: 13px;
}

.gram-nct-aud-item-meta {
  display: block;
  font-size: 12px;
  opacity: 0.7;
  margin-top: 2px;
}

.gram-nct-aud-empty {
  font-size: 13px;
  opacity: 0.7;
  padding: 12px 4px;
}

.gram-nct-reply-pills {
  margin-bottom: 14px;
}

.gram-nct-ar-toggle {
  margin-left: auto;
}

.cabinet-notif-stack .gram-gpt-window + .gram-gpt-window {
  margin-top: 12px;
}

/* —— Массреакции —— */
.gram-massreactions-page .gram-ai-defender-block.gram-gpt-window {
  overflow: visible;
}

.gram-massreactions-page .gram-ai-defender-block {
  margin-bottom: 16px;
  overflow: visible;
}

.gram-massreactions-page .gram-ai-defender-block .gram-gpt-window-head {
  align-items: flex-start;
  gap: 12px;
  overflow: visible;
  position: relative;
  z-index: 2;
}

.gram-massreactions-page .gram-ai-defender-block .gram-gpt-window-title-row .gram-info-tip {
  position: relative;
  z-index: 5;
}

.gram-massreactions-page .gram-ai-defender-block .gram-gpt-window-title-row .gram-info-tip-pop {
  top: calc(100% + 8px);
  bottom: auto;
  left: 0;
  right: auto;
  transform: translateY(4px);
  z-index: 30;
  pointer-events: auto;
}

.gram-massreactions-page .gram-ai-defender-block .gram-info-tip:hover .gram-info-tip-pop,
.gram-massreactions-page .gram-ai-defender-block .gram-info-tip.is-open .gram-info-tip-pop,
.gram-massreactions-page .gram-ai-defender-block .gram-info-tip:focus-within .gram-info-tip-pop {
  transform: translateY(0);
}

.gram-massreactions-page .gram-ai-defender-new {
  display: none;
}

.gram-massreactions-page .gram-ai-defender-block .gram-gpt-window-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}

.gram-massreactions-page .gram-ai-defender-block .gram-gpt-window-title-row .gram-info-tip-inline {
  margin-top: 1px;
  flex-shrink: 0;
}

.gram-massreactions-page .gram-ai-defender-block:has(.gram-ai-defender-body[hidden]) .gram-info-tip {
  visibility: visible;
}

.gram-massreactions-page .gram-ai-defender-block.is-off .gram-gpt-window-head {
  border-bottom: none;
}

.gram-massreactions-page .gram-ai-defender-block.is-off .gram-info-tip,
.gram-massreactions-page .gram-ai-defender-block.is-off .gram-info-tip-link {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.gram-massreactions-page .gram-ai-defender-block.is-off {
  overflow: visible;
  position: relative;
  z-index: 5;
}

html.theme-dark .gram-massreactions-page .gram-ml-emoji.is-active {
  border-color: rgba(96, 165, 250, 0.9);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.38), rgba(37, 99, 235, 0.42));
  box-shadow:
    0 0 0 2px rgba(59, 130, 246, 0.55),
    0 0 14px rgba(59, 130, 246, 0.28);
  transform: scale(1.06);
}

.gram-massreactions-page .gram-mr-mode-grid {
  margin: 4px 0 14px;
  align-items: stretch;
}

.gram-massreactions-page .gram-mr-mode-card {
  background: #f8fafc;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 12px;
  padding: 14px;
  min-width: 0;
  box-shadow: none;
}

html.theme-dark .gram-massreactions-page .gram-mr-mode-card {
  background: rgba(15, 23, 42, 0.35);
  border-color: rgba(71, 100, 150, 0.28);
  box-shadow: none;
}

.gram-mr-mode-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.gram-mr-mode-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  flex: 1;
}

.gram-massreactions-page .gram-mr-mode-card .gram-mr-mode-body {
  min-width: 0;
}

.gram-massreactions-page .gram-mr-mode-card .gram-gpt-pill-field {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  margin: 0;
}

.gram-massreactions-page .gram-mr-mode-card .gram-gpt-field-title {
  display: none;
}

.gram-massreactions-page .gram-mr-mode-card .gram-gpt-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
}

.gram-massreactions-page .gram-mr-mode-card .gram-gpt-pill {
  flex: 1 1 calc(50% - 3px);
  justify-content: center;
  padding: 8px 12px;
  font-size: 12px;
  min-width: 0;
  text-align: center;
}

.gram-massreactions-page .gram-trr-module-summary .gram-trr-module-meta,
.gram-massreactions-page .gram-trr-module-summary .gram-trr-module-warn {
  display: none;
}

.gram-massreactions-page .gram-gpt-param-input[type="number"] {
  -moz-appearance: textfield;
}

.gram-massreactions-page .gram-gpt-param-input[type="number"]::-webkit-outer-spin-button,
.gram-massreactions-page .gram-gpt-param-input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

#massreactionsRunAccountsPanel .gram-spam-account-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

#massreactionsRunAccountsPanel .gram-spam-account-stat-card {
  flex: none;
  max-width: none;
  background: var(--surface-hover, #f8fafc);
  border: 1px solid var(--border, rgba(148, 163, 184, 0.35));
}

html:not(.theme-dark) #massreactionsRunAccountsPanel .gram-spam-account-stat-card {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

html:not(.theme-dark) #massreactionsRunAccountsPanel .gram-spam-account-stat-card.is-stopped {
  background: #fef2f2;
  border-color: #fecaca;
}

html:not(.theme-dark) #massreactionsRunAccountsPanel .gram-spam-account-stat-card.is-done {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

html.theme-dark #massreactionsRunAccountsPanel .gram-spam-account-stat-card {
  background: rgba(15, 23, 42, 0.35);
  border-color: rgba(71, 100, 150, 0.35);
}

html.theme-dark #massreactionsRunAccountsPanel .gram-spam-account-stat-card.is-done {
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.1);
}

.gram-massreactions-page .gram-mr-react-settings-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(244, 114, 182, 0.28);
  border-radius: 10px;
  background: rgba(253, 242, 248, 0.45);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

html.theme-dark .gram-massreactions-page .gram-mr-react-settings-toggle {
  background: rgba(30, 20, 40, 0.45);
  border-color: rgba(244, 114, 182, 0.22);
}

.gram-massreactions-page .gram-mr-react-settings-toggle:hover {
  border-color: rgba(244, 114, 182, 0.45);
  box-shadow: 0 0 16px rgba(244, 114, 182, 0.12);
}

.gram-massreactions-page .gram-mr-react-settings-toggle.is-open {
  border-color: rgba(244, 114, 182, 0.45);
  box-shadow: 0 0 0 1px rgba(244, 114, 182, 0.12);
}

.gram-massreactions-page .gram-mr-react-settings-chevron {
  font-size: 11px;
  color: #ec4899;
  transition: transform 0.15s ease;
}

.gram-massreactions-page .gram-mr-react-settings-toggle.is-open .gram-mr-react-settings-chevron {
  transform: rotate(180deg);
}

.gram-massreactions-page .gram-mr-react-settings-panel {
  margin-top: 10px;
}

.gram-massreactions-page .gram-mr-react-settings-panel[hidden] {
  display: none !important;
}

.gram-massreactions-page .gram-mr-mode-sliders {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.gram-massreactions-page .gram-mr-mode-sliders .gram-field-wrap {
  margin: 0;
}

.gram-massreactions-page .gram-mr-mode-card .gram-ml-slider-card {
  background: #f8fafc;
  border-color: rgba(226, 232, 240, 0.95);
}

html.theme-dark .gram-massreactions-page .gram-mr-mode-card .gram-ml-slider-card {
  background: rgba(15, 23, 42, 0.35);
  border-color: rgba(71, 100, 150, 0.28);
}

.gram-massreactions-page .gram-mr-prob-wrap[hidden] {
  display: none !important;
}

.gram-massreactions-page .gram-mr-react-opts {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 4px;
}

.gram-massreactions-page .gram-mr-react-opts .gram-gpt-toggle {
  align-items: flex-start;
  gap: 10px;
}

.gram-massreactions-page .gram-mr-react-opts .gram-gpt-toggle-text {
  font-size: 12px;
  line-height: 1.4;
  font-weight: 500;
}

.gram-massreactions-page .gram-mr-react-opt-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gram-massreactions-page .gram-mr-first-comments-wrap[hidden] {
  display: none !important;
}

.gram-massreactions-page .gram-mr-first-comments-wrap .gram-field-wrap {
  margin: 0;
}

.gram-massreactions-page .gram-mr-react-hint {
  margin: 4px 0 0;
  font-size: 11px;
  line-height: 1.35;
  opacity: 0.72;
}

.gram-massreactions-page .gram-mr-mode-row {
  margin-top: 0;
}

.gram-massreactions-page .gram-mr-mode-row .gram-gpt-pill-field,
.gram-massreactions-page .gram-mr-order-row .gram-gpt-pill-field {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.gram-massreactions-page .gram-mr-mode-row .gram-gpt-field-title,
.gram-massreactions-page .gram-mr-order-row .gram-gpt-field-title {
  margin: 0;
  font-size: 11px;
  white-space: nowrap;
}

.gram-massreactions-page .gram-mr-mode-row .gram-gpt-pill,
.gram-massreactions-page .gram-mr-order-row .gram-gpt-pill {
  padding: 6px 12px;
  font-size: 12px;
}

html.theme-light .gram-massreactions-page .gram-gpt-pill:not(.active),
html:not(.theme-dark) .gram-massreactions-page .gram-gpt-pill:not(.active) {
  background: #f8fafc;
  border-color: rgba(148, 163, 184, 0.55);
  color: #475569;
}

.gram-massreactions-page .gram-mr-mode-card .gram-gpt-pill.active,
.gram-massreactions-page .gram-mr-mode-row .gram-gpt-pill.active,
.gram-massreactions-page .gram-mr-order-row .gram-gpt-pill.active,
.gram-massreactions-page .gram-mr-ar-pills .gram-gpt-pill.active {
  background: linear-gradient(135deg, #22d3ee, #2563eb);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

html.theme-dark .gram-massreactions-page .gram-gpt-pill:not(.active) {
  background: #1a2740;
  border-color: rgba(96, 165, 250, 0.28);
  color: #cbd5e1;
}

html.theme-dark .gram-massreactions-page .gram-gpt-pill.active {
  background: linear-gradient(135deg, #38bdf8, #3b82f6);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.gram-massreactions-page .gram-mr-options {
  grid-template-columns: 1fr;
}

.gram-massreactions-page .gram-mr-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 4px;
}

.gram-massreactions-page .gram-mr-slider-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  max-width: 100%;
}

.gram-massreactions-page .gram-mr-slider-grid:has(.gram-mr-prob-wrap[hidden]) {
  grid-template-columns: minmax(0, 1fr);
}

.gram-massreactions-page .gram-mr-slider-grid > .gram-field-wrap {
  margin: 0;
}

.gram-massreactions-page .gram-mr-limit-sliders {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  grid-column: 1 / -1;
}

.gram-massreactions-page .gram-mr-limit-sliders .gram-field-wrap {
  margin: 0;
}

.gram-massreactions-page .gram-mr-order-row {
  max-width: 100%;
}

.gram-massreactions-page .gram-mr-order-row .gram-gpt-pill-field {
  margin-bottom: 0;
}

.gram-massreactions-page .gram-gpt-window-title-row {
  flex: 1;
  min-width: 0;
  align-items: center;
}

.gram-massreactions-page .gram-gpt-window-title-row .gram-gpt-chip {
  margin-left: auto;
}

.gram-mr-targets-count {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #2563eb;
  background: rgba(37, 99, 235, 0.1);
}

html.theme-dark .gram-mr-targets-count {
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.18);
}

.gram-massreactions-page .gram-mr-autoreply-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: none;
}

.gram-massreactions-page .gram-mr-ar-mode {
  margin: 0;
}

.gram-massreactions-page .gram-mr-ar-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.gram-massreactions-page .gram-mr-ar-pills .gram-gpt-pill {
  flex: 0 1 auto;
  padding: 7px 12px;
  font-size: 12px;
  min-width: 0;
}

.gram-massreactions-page .gram-mr-ai-window {
  max-width: none;
  overflow: visible;
}

.gram-massreactions-page .gram-mr-ai-window .gram-gpt-window-head {
  align-items: flex-start;
  gap: 12px;
  overflow: visible;
  position: relative;
  z-index: 2;
}

.gram-massreactions-page .gram-mr-ai-window .gram-gpt-window-title-row .gram-info-tip {
  position: relative;
  z-index: 5;
}

.gram-massreactions-page .gram-mr-ai-window .gram-gpt-window-title-row .gram-info-tip-pop {
  top: calc(100% + 8px);
  bottom: auto;
  left: 0;
  right: auto;
  transform: translateY(4px);
  z-index: 30;
  pointer-events: auto;
  width: min(280px, calc(100vw - 48px));
}

.gram-massreactions-page .gram-mr-ai-window .gram-info-tip:hover .gram-info-tip-pop,
.gram-massreactions-page .gram-mr-ai-window .gram-info-tip.is-open .gram-info-tip-pop,
.gram-massreactions-page .gram-mr-ai-window .gram-info-tip:focus-within .gram-info-tip-pop {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.gram-massreactions-page .gram-mr-ai-window .gram-gpt-window-title-row .gram-info-tip-inline {
  margin-left: 4px;
}

.gram-massreactions-page .gram-mr-ai-window .gram-gpt-window-body {
  width: 100%;
}

.gram-massreactions-page .gram-mr-ar-toolbar {
  margin-bottom: 8px;
}

.gram-massreactions-page .gram-mr-attach-strip {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin-top: 8px;
  margin-bottom: 8px;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  flex-shrink: 0;
  align-self: flex-start;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}

.gram-massreactions-page #panelDistGrid.gram-dist-grid {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
  grid-template-columns: unset;
}

.gram-massreactions-page #panelDistGrid.gram-dist-grid .dist-box {
  flex: 0 0 180px;
  min-width: 160px;
  max-width: 180px;
}

.gram-massreactions-page .gram-mr-attach-strip .gram-spam-attach-chip {
  flex: 0 0 auto;
  width: max-content;
  max-width: 200px;
  min-width: 0;
}

.gram-massreactions-page .gram-mr-attach-strip .gram-spam-attach-chip span {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 110px;
}

.gram-massreactions-page .gram-mr-attach-strip .gram-spam-attach-chip.is-uploading {
  opacity: 0.75;
}

.gram-massreactions-page .gram-mr-ar-fields {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(248, 250, 252, 0.7);
}

html.theme-dark .gram-massreactions-page .gram-mr-ar-fields {
  background: rgba(15, 23, 42, 0.35);
  border-color: rgba(71, 100, 150, 0.28);
}

.gram-massreactions-page .gram-mr-ar-textarea {
  resize: none;
  min-height: 140px;
  max-height: 220px;
  width: 100%;
  max-width: 100%;
}

.gram-massreactions-page .gram-mr-prob-wrap[hidden] {
  display: none !important;
}

.gram-massreactions-page .gram-mr-prompt-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex-wrap: wrap;
}

.gram-massreactions-page .gram-mr-prompt-select {
  flex: 1;
  min-width: 180px;
  max-width: none;
}

.gram-massreactions-page .gram-gpt-select-menu .gram-mr-prompt-edit {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.gram-massreactions-page .gram-gpt-select-menu.is-portal {
  max-height: min(280px, 50vh);
  overflow-y: auto;
}

.gram-massreactions-page .gram-mr-ar-panel {
  margin-top: 0;
}

@media (max-width: 720px) {
  .gram-massreactions-page .gram-mr-slider-grid {
    grid-template-columns: 1fr;
    max-width: none;
  }
}

/* Massreactions — glass / glow (как масслукинг, отдельные селекторы) */
.gram-massreactions-page.gram-mr-glass .gram-gpt-window {
  border: 1px solid rgba(71, 100, 150, 0.32);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.06),
    0 8px 32px rgba(2, 8, 23, 0.18);
  overflow: visible;
}

html.theme-dark .gram-massreactions-page.gram-mr-glass .gram-gpt-window {
  background: #152238;
  border-color: rgba(56, 189, 248, 0.24);
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.1),
    0 8px 28px rgba(0, 0, 0, 0.35),
    0 0 24px rgba(56, 189, 248, 0.05);
}

html:not(.theme-dark) .gram-massreactions-page.gram-mr-glass .gram-gpt-window {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(148, 163, 184, 0.35);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.85),
    0 8px 32px rgba(15, 23, 42, 0.08),
    0 0 20px rgba(56, 189, 248, 0.06);
}

.gram-massreactions-page.gram-mr-glass .gram-gpt-window-head {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.1) 0%, rgba(15, 23, 42, 0.02) 100%);
  border-bottom-color: rgba(56, 189, 248, 0.16);
}

html:not(.theme-dark) .gram-massreactions-page.gram-mr-glass .gram-gpt-window-head {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.08) 0%, rgba(255, 255, 255, 0.45) 100%);
  border-bottom-color: rgba(148, 163, 184, 0.3);
}

.gram-massreactions-page.gram-mr-glass .gram-gpt-notice {
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 10px;
  background: rgba(14, 165, 233, 0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.gram-massreactions-page.gram-mr-glass .gram-mr-mode-card.gram-ml-mode-card {
  background: rgba(21, 34, 56, 0.72);
  border-color: rgba(56, 189, 248, 0.22);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow:
    inset 0 1px 0 rgba(56, 189, 248, 0.08),
    0 4px 18px rgba(2, 8, 23, 0.14);
}

html:not(.theme-dark) .gram-massreactions-page.gram-mr-glass .gram-mr-mode-card.gram-ml-mode-card {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(148, 163, 184, 0.35);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
}

.gram-massreactions-page .gram-mr-mode-card.gram-ml-story-react-card {
  margin-top: 0;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(244, 114, 182, 0.35);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(253, 242, 248, 0.55));
  box-shadow: 0 0 0 1px rgba(244, 114, 182, 0.08);
  min-width: 0;
}

html.theme-dark .gram-massreactions-page .gram-mr-mode-card.gram-ml-story-react-card {
  background: linear-gradient(145deg, rgba(21, 34, 56, 0.95), rgba(30, 20, 40, 0.55));
  border-color: rgba(244, 114, 182, 0.28);
}

.gram-massreactions-page.gram-mr-glass .gram-ml-story-react-card {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.gram-massreactions-page.gram-mr-glass .gram-ml-story-react-card.is-on {
  box-shadow:
    0 0 0 1px rgba(244, 114, 182, 0.38),
    0 0 28px rgba(244, 114, 182, 0.2),
    0 8px 24px rgba(15, 23, 42, 0.12);
}

.gram-massreactions-page.gram-mr-glass .gram-ml-story-react-card .gram-ml-story-emoji-block {
  margin-top: 10px;
  padding-top: 0;
  border-top: none;
}

.gram-massreactions-page.gram-mr-glass .gram-gpt-param-card {
  background: rgba(15, 23, 42, 0.2);
  border-color: rgba(71, 100, 150, 0.28);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

html:not(.theme-dark) .gram-massreactions-page.gram-mr-glass .gram-gpt-param-card {
  background: rgba(248, 250, 252, 0.85);
  border-color: rgba(148, 163, 184, 0.32);
}

.gram-massreactions-page.gram-mr-glass .gram-gpt-action-bar {
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(14, 165, 233, 0.1) 0%, rgba(15, 23, 42, 0.22) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.07);
}

html:not(.theme-dark) .gram-massreactions-page.gram-mr-glass .gram-gpt-action-bar {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96) 0%, rgba(241, 245, 249, 0.88) 100%);
  border-color: rgba(148, 163, 184, 0.35);
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.08);
}

.gram-massreactions-page.gram-mr-glass #massreactionsRunPanel.gram-spam-results-panel {
  border-color: rgba(56, 189, 248, 0.24);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.08),
    0 12px 36px rgba(2, 8, 23, 0.2);
}

html:not(.theme-dark) .gram-massreactions-page.gram-mr-glass #massreactionsRunPanel.gram-spam-results-panel {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.08);
}

.gram-massreactions-page.gram-mr-glass .gram-spam-run-tabs {
  gap: 4px;
  padding: 4px;
  margin: 8px 12px 0;
  border-radius: 12px;
  border: 1px solid rgba(56, 189, 248, 0.18);
  background: rgba(15, 23, 42, 0.22);
}

html:not(.theme-dark) .gram-massreactions-page.gram-mr-glass .gram-spam-run-tabs {
  background: rgba(241, 245, 249, 0.92);
  border-color: rgba(148, 163, 184, 0.35);
}

.gram-massreactions-page.gram-mr-glass .gram-spam-run-tab {
  border-radius: 9px;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.gram-massreactions-page.gram-mr-glass .gram-spam-run-tab.active {
  background: rgba(14, 165, 233, 0.14);
  color: #38bdf8;
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.22);
}

html:not(.theme-dark) .gram-massreactions-page.gram-mr-glass .gram-spam-run-tab.active {
  background: #fff;
  color: #0284c7;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.gram-massreactions-page.gram-mr-glass #moduleLiveLog.gram-log-panel {
  border-color: rgba(56, 189, 248, 0.22);
  box-shadow: inset 0 0 24px rgba(56, 189, 248, 0.03);
}

html:has(.gram-massreactions-page.gram-mr-glass) .panel-modal-card.gram-modal-card {
  border: 1px solid rgba(56, 189, 248, 0.28);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.1),
    0 24px 64px rgba(0, 0, 0, 0.45),
    0 0 40px rgba(56, 189, 248, 0.08);
}

html.theme-dark:has(.gram-massreactions-page.gram-mr-glass) .panel-modal-card.gram-modal-card {
  background: rgba(21, 34, 56, 0.94);
  border-color: rgba(56, 189, 248, 0.24);
}

html:not(.theme-dark):has(.gram-massreactions-page.gram-mr-glass) .panel-modal-card.gram-modal-card {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(148, 163, 184, 0.38);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.9),
    0 24px 48px rgba(15, 23, 42, 0.12),
    0 0 32px rgba(56, 189, 248, 0.08);
}

/* —— Журнал задач: вкладки Активные / История (GramGPT-style) —— */
.gram-journal-tr {
  gap: 10px;
}

.gram-journal-tr .journal-tr-head {
  margin-bottom: 2px;
}

.gram-journal-tr .journal-tr-head-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gram-journal-tr .journal-tr-head-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(14, 165, 233, 0.16);
  color: #38bdf8;
  font-size: 16px;
  flex-shrink: 0;
}

.gram-journal-tr .journal-tr-head-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
}

.gram-journal-tr .journal-tr-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(56, 189, 248, 0.22);
  background: rgba(14, 165, 233, 0.08);
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-secondary, #94a3b8);
}

.gram-journal-tr .journal-tr-banner b {
  color: var(--text, #e2e8f0);
  font-weight: 600;
}

.gram-journal-tr .journal-tr-banner-icon {
  color: #38bdf8;
  font-size: 14px;
  margin-top: 2px;
  flex-shrink: 0;
}

.gram-journal-tr .journal-tr-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--border, rgba(71, 100, 150, 0.35));
  background: rgba(15, 23, 42, 0.28);
}

html:not(.theme-dark) .gram-journal-tr .journal-tr-tabs {
  background: rgba(241, 245, 249, 0.9);
  border-color: rgba(148, 163, 184, 0.35);
}

.gram-journal-tr .journal-tr-tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--text-muted, #64748b);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.gram-journal-tr .journal-tr-tab i {
  font-size: 13px;
}

.gram-journal-tr .journal-tr-tab.is-active {
  background: rgba(14, 165, 233, 0.14);
  color: #38bdf8;
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.22);
}

html:not(.theme-dark) .gram-journal-tr .journal-tr-tab.is-active {
  background: #fff;
  color: #0284c7;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.gram-journal-tr .journal-tr-tab-badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #38bdf8;
  color: #0f172a;
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

.gram-journal-tr .journal-tr-card {
  padding: 10px 12px 12px;
}

.gram-journal-tr .journal-tr-filters-wrap {
  margin-bottom: 8px;
}

.gram-journal-tr .journal-tr-filters-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted, #64748b);
  font-size: 11px;
  cursor: pointer;
}

.gram-journal-tr .journal-tr-filters-toggle:hover {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
}

.gram-journal-tr .journal-tr-filters-chevron {
  font-size: 10px;
  transition: transform 0.15s ease;
}

.gram-journal-tr .journal-tr-filters-wrap.is-open .journal-tr-filters-chevron {
  transform: rotate(180deg);
}

.gram-journal-tr .journal-tr-filters-body {
  display: none;
  margin-top: 8px;
}

.gram-journal-tr .journal-tr-filters-wrap.is-open .journal-tr-filters-body {
  display: block;
}

.gram-journal-tr .journal-tr-pane.is-hidden {
  display: none;
}

.gram-journal-tr .journal-tr-active-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gram-journal-tr .journal-tr-active-card {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(71, 100, 150, 0.32);
  background: #152238;
}

html:not(.theme-dark) .gram-journal-tr .journal-tr-active-card {
  background: #f8fafc;
  border-color: rgba(148, 163, 184, 0.35);
}

.gram-journal-tr .journal-tr-active-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.gram-journal-tr .journal-tr-active-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.gram-journal-tr .journal-tr-active-card.is-expanded {
  border-color: rgba(56, 189, 248, 0.45);
}

.gram-journal-tr #journalActiveDetail {
  margin-top: 10px;
}

.gram-spam-account-stats-totals {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted, #94a3b8);
  text-align: right;
}

.gram-journal-tr .journal-tr-active-card-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.gram-journal-tr .journal-tr-active-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text, #e2e8f0);
}

.gram-journal-tr .journal-tr-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  text-transform: lowercase;
}

.gram-journal-tr .journal-tr-status-run {
  background: rgba(234, 179, 8, 0.16);
  color: #facc15;
  border: 1px solid rgba(234, 179, 8, 0.35);
}

.gram-journal-tr .journal-tr-stop-btn {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.gram-journal-tr .journal-tr-stop-btn:hover {
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(239, 68, 68, 0.65);
}

.gram-journal-tr .journal-tr-active-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-muted, #94a3b8);
}

.gram-journal-tr .journal-tr-active-meta i {
  margin-right: 4px;
  opacity: 0.85;
}

.gram-journal-tr .journal-tr-progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.gram-journal-tr .journal-tr-progress-track {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.55);
  overflow: hidden;
}

html:not(.theme-dark) .gram-journal-tr .journal-tr-progress-track {
  background: rgba(148, 163, 184, 0.35);
}

.gram-journal-tr .journal-tr-progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0ea5e9, #38bdf8);
  transition: width 0.35s ease;
}

.gram-journal-tr .journal-tr-progress-fill.is-run {
  background: linear-gradient(90deg, #38bdf8, #22d3ee);
}

.gram-journal-tr .journal-tr-progress-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted, #94a3b8);
  white-space: nowrap;
}

.gram-journal-tr .journal-tr-table-wrap {
  overflow-x: auto;
}

.gram-journal-tr .journal-tr-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.gram-journal-tr .journal-tr-table th {
  padding: 8px 10px;
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted, #64748b);
  border-bottom: 1px solid rgba(71, 100, 150, 0.28);
}

.gram-journal-tr .journal-tr-table td {
  padding: 10px;
  border-bottom: 1px solid rgba(71, 100, 150, 0.18);
  vertical-align: middle;
}

.gram-journal-tr .journal-tr-hist-row.is-expanded td {
  background: rgba(14, 165, 233, 0.06);
}

.gram-journal-tr .journal-tr-hist-op {
  font-weight: 500;
  color: var(--text, #e2e8f0);
}

.gram-journal-tr .journal-tr-th-acc,
.gram-journal-tr .journal-tr-hist-acc {
  width: 72px;
  text-align: center;
}

.gram-journal-tr .journal-tr-th-eye,
.gram-journal-tr .journal-tr-hist-eye {
  width: 44px;
  text-align: center;
}

.gram-journal-tr .journal-tr-hist-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.gram-journal-tr .journal-tr-hist-badge-ok {
  background: rgba(16, 185, 129, 0.16);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.gram-journal-tr .journal-tr-hist-badge-muted {
  background: rgba(148, 163, 184, 0.14);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.28);
}

.gram-journal-tr .journal-tr-hist-badge-bad {
  background: rgba(239, 68, 68, 0.14);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.32);
}

.gram-journal-tr .journal-tr-hist-badge-run {
  background: rgba(234, 179, 8, 0.14);
  color: #facc15;
  border: 1px solid rgba(234, 179, 8, 0.32);
}

.gram-journal-tr .journal-tr-hist-eye-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(71, 100, 150, 0.35);
  background: transparent;
  color: var(--text-muted, #94a3b8);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.gram-journal-tr .journal-tr-hist-eye-btn:hover,
.gram-journal-tr .journal-tr-hist-eye-btn.is-active {
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(14, 165, 233, 0.1);
}

.gram-journal-tr .journal-tr-detail-card {
  margin-top: 10px;
  border-radius: 10px;
  border: 1px solid rgba(71, 100, 150, 0.35);
  background: #152238;
  overflow: hidden;
}

html:not(.theme-dark) .gram-journal-tr .journal-tr-detail-card {
  background: #f8fafc;
}

.gram-journal-tr .journal-tr-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(71, 100, 150, 0.25);
}

.gram-journal-tr .journal-tr-detail-title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
}

.gram-journal-tr .journal-tr-detail-close {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted, #94a3b8);
  cursor: pointer;
}

.gram-journal-tr .journal-tr-detail-close:hover {
  color: #f87171;
  background: rgba(239, 68, 68, 0.1);
}

.gram-journal-tr .journal-tr-detail-list {
  max-height: 280px;
  overflow-y: auto;
  padding: 6px 8px;
}

.gram-journal-tr .journal-tr-acc-row {
  display: grid;
  grid-template-columns: 24px 1fr minmax(120px, 42%);
  gap: 8px 10px;
  align-items: start;
  padding: 8px 6px;
  border-radius: 8px;
}

.gram-journal-tr .journal-tr-acc-row + .journal-tr-acc-row {
  border-top: 1px solid rgba(71, 100, 150, 0.16);
}

.gram-journal-tr .journal-tr-acc-icon {
  padding-top: 2px;
  font-size: 14px;
}

.gram-journal-tr .journal-tr-acc-row-ok .journal-tr-acc-icon {
  color: #34d399;
}

.gram-journal-tr .journal-tr-acc-row-warn .journal-tr-acc-icon {
  color: #fb923c;
}

.gram-journal-tr .journal-tr-acc-row-bad .journal-tr-acc-icon {
  color: #f87171;
}

.gram-journal-tr .journal-tr-acc-row-muted .journal-tr-acc-icon {
  color: #64748b;
}

.gram-journal-tr .journal-tr-acc-name {
  font-size: 12px;
  font-weight: 600;
}

.gram-journal-tr .journal-tr-acc-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.gram-journal-tr .journal-tr-acc-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 10px;
  background: rgba(15, 23, 42, 0.35);
  color: var(--text-muted, #94a3b8);
}

.gram-journal-tr .journal-tr-acc-badge-ok {
  color: #38bdf8;
}

.gram-journal-tr .journal-tr-acc-badge-warn {
  color: #fb923c;
}

.gram-journal-tr .journal-tr-acc-badge-folder {
  color: #a78bfa;
}

.gram-journal-tr .journal-tr-acc-result {
  font-size: 11px;
  text-align: right;
  word-break: break-word;
}

.gram-journal-tr .journal-tr-acc-link {
  color: #38bdf8;
  text-decoration: none;
}

.gram-journal-tr .journal-tr-acc-link:hover {
  text-decoration: underline;
}

.gram-journal-tr .journal-tr-acc-warn {
  color: #fb923c;
  display: inline-flex;
  align-items: flex-start;
  gap: 4px;
  text-align: left;
}

.gram-journal-tr .journal-tr-acc-muted {
  color: var(--text-muted, #64748b);
}

.gram-journal-tr .journal-tr-detail-log {
  padding: 0 8px 8px;
  border-top: 1px solid rgba(71, 100, 150, 0.2);
}

.gram-journal-tr .journal-tr-detail-log .gram-gpt-window {
  margin-top: 6px;
}

.gram-journal-tr .journal-tr-detail-empty,
.gram-journal-tr .journal-tr-empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--text-muted, #64748b);
  font-size: 12px;
}

.gram-journal-tr .journal-tr-empty i {
  display: block;
  font-size: 22px;
  margin-bottom: 8px;
  opacity: 0.55;
}

.gram-journal-tr .journal-tr-detail-loading {
  padding: 20px;
  text-align: center;
  color: var(--text-muted, #94a3b8);
  font-size: 12px;
}

.gram-journal-tr .journal-tr-pagination {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(71, 100, 150, 0.2);
}

@media (max-width: 640px) {
  .gram-journal-tr .journal-tr-acc-row {
    grid-template-columns: 20px 1fr;
  }

  .gram-journal-tr .journal-tr-acc-result {
    grid-column: 2 / -1;
    text-align: left;
  }
}

/* —— Личный кабинет: layout как журнал задач (без правок gram-journal-layout.js) —— */
.gram-cabinet-journal.settings-page {
  max-width: 860px;
}

.gram-cabinet-journal .gram-cabinet-head-icon {
  background: rgba(139, 92, 246, 0.16);
  color: #a78bfa;
}

.gram-cabinet-journal .cabinet-tr-tabs {
  flex-wrap: wrap;
}

.gram-cabinet-journal .cabinet-tr-tabs .journal-tr-tab {
  flex: 1 1 calc(33.333% - 4px);
  min-width: 88px;
  padding: 7px 8px;
  font-size: 11px;
}

.gram-cabinet-journal .cabinet-tr-tabs .journal-tr-tab span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gram-cabinet-journal .journal-tr-card {
  padding: 10px 12px 12px;
}

.gram-cabinet-journal .gram-cabinet-main {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.gram-cabinet-journal .gram-settings-stack {
  gap: 10px;
}

.gram-cabinet-journal .gram-cabinet-main .gram-gpt-window {
  border-radius: 10px;
  border-color: rgba(71, 100, 150, 0.32);
  background: rgba(15, 23, 42, 0.22);
}

html.theme-dark .gram-cabinet-journal .gram-cabinet-main .gram-gpt-window {
  background: #152238;
  border-color: rgba(56, 189, 248, 0.2);
}

html:not(.theme-dark) .gram-cabinet-journal .gram-cabinet-main .gram-gpt-window {
  background: #f8fafc;
  border-color: rgba(148, 163, 184, 0.35);
}

.gram-cabinet-journal .gram-cabinet-main .cabinet-plan-card {
  border-radius: 10px;
}

.gram-cabinet-journal .loading-state,
.gram-cabinet-journal .empty-state {
  padding: 16px 4px;
}

@media (min-width: 720px) {
  .gram-cabinet-journal .cabinet-tr-tabs .journal-tr-tab {
    flex: 1 1 0;
    padding: 8px 10px;
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .gram-cabinet-journal .cabinet-tr-tabs .journal-tr-tab {
    flex: 1 1 calc(50% - 4px);
  }

  .gram-cabinet-journal .cabinet-tr-tabs .journal-tr-tab span {
    display: none;
  }

  .gram-cabinet-journal .cabinet-tr-tabs .journal-tr-tab i {
    font-size: 15px;
  }
}

/* ── Администрирование (владелец) ── */
.hidden { display: none !important; }

.gram-admin-page.gram-admin-glass {
  position: relative;
  isolation: isolate;
  padding-bottom: 28px;
  overflow: hidden;
}

.gram-admin-page.gram-admin-glass::before {
  content: "";
  position: absolute;
  inset: -35% -15% auto;
  height: 440px;
  background: radial-gradient(ellipse at 28% 18%, rgba(56, 189, 248, 0.16) 0%, transparent 62%);
  pointer-events: none;
  z-index: 0;
}

.gram-admin-page.gram-admin-glass::after {
  content: "";
  position: absolute;
  inset: auto -10% -25% 35%;
  height: 380px;
  background: radial-gradient(ellipse at 72% 85%, rgba(99, 102, 241, 0.13) 0%, transparent 58%);
  pointer-events: none;
  z-index: 0;
}

.gram-admin-page.gram-admin-glass > * {
  position: relative;
  z-index: 1;
}

/* Admin glass — как масслукинг (gram-ml-glass) */
.gram-admin-page.gram-admin-glass .gram-gpt-window,
.gram-admin-page.gram-admin-glass .gram-admin-card {
  border: 1px solid rgba(71, 100, 150, 0.36);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.32);
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 0 1px rgba(56, 189, 248, 0.08),
    0 12px 40px rgba(2, 8, 23, 0.22),
    0 0 48px rgba(56, 189, 248, 0.06);
  overflow: visible;
  transition: border-color 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease;
}

html.theme-dark .gram-admin-page.gram-admin-glass .gram-gpt-window,
html.theme-dark .gram-admin-page.gram-admin-glass .gram-admin-card {
  background: rgba(21, 34, 56, 0.72);
  border-color: rgba(56, 189, 248, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(56, 189, 248, 0.12),
    0 0 0 1px rgba(56, 189, 248, 0.12),
    0 12px 36px rgba(0, 0, 0, 0.38),
    0 0 56px rgba(56, 189, 248, 0.08);
}

html:not(.theme-dark) .gram-admin-page.gram-admin-glass .gram-gpt-window,
html:not(.theme-dark) .gram-admin-page.gram-admin-glass .gram-admin-card {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(148, 163, 184, 0.35);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.85),
    0 8px 32px rgba(15, 23, 42, 0.08),
    0 0 20px rgba(56, 189, 248, 0.06);
}

.gram-admin-page.gram-admin-glass .gram-gpt-window-head {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.1) 0%, rgba(15, 23, 42, 0.02) 100%);
  border-bottom: 1px solid rgba(56, 189, 248, 0.16);
  border-radius: 12px 12px 0 0;
}

html:not(.theme-dark) .gram-admin-page.gram-admin-glass .gram-gpt-window-head {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.08) 0%, rgba(255, 255, 255, 0.45) 100%);
  border-bottom-color: rgba(148, 163, 184, 0.3);
}

.gram-admin-page.gram-admin-glass .gram-gpt-window-title {
  font-size: 15px;
  font-weight: 600;
}

#adminMenuGroup {
  margin-top: 8px;
  padding: 10px 8px 8px;
  border-radius: 14px;
  border: 1px solid rgba(56, 189, 248, 0.18);
  background: rgba(15, 23, 42, 0.22);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow:
    inset 0 1px 0 rgba(56, 189, 248, 0.08),
    0 4px 18px rgba(2, 8, 23, 0.12);
}

html:not(.theme-dark) #adminMenuGroup {
  background: rgba(255, 255, 255, 0.55);
  border-color: rgba(148, 163, 184, 0.32);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
}

html.theme-dark #adminMenuGroup {
  background: rgba(21, 34, 56, 0.55);
  border-color: rgba(56, 189, 248, 0.22);
}

#adminMenuGroup .group-title {
  padding: 0 8px 6px;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(56, 189, 248, 0.12);
}

#adminMenuGroup .menu-item {
  border: 1px solid transparent;
  border-radius: 10px;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

#adminMenuGroup .menu-item:hover {
  border-color: rgba(56, 189, 248, 0.22);
  background: rgba(14, 165, 233, 0.08);
}

#adminMenuGroup .menu-item.active {
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(14, 165, 233, 0.12);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.12);
}

.gram-admin-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(56, 189, 248, 0.2);
  background: linear-gradient(145deg, rgba(14, 165, 233, 0.08) 0%, rgba(15, 23, 42, 0.22) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.06),
    0 8px 28px rgba(2, 8, 23, 0.14);
}

html:not(.theme-dark) .gram-admin-head {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.78) 0%, rgba(248, 250, 252, 0.92) 100%);
  border-color: rgba(148, 163, 184, 0.32);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

html.theme-dark .gram-admin-head {
  background: linear-gradient(145deg, rgba(21, 34, 56, 0.85) 0%, rgba(15, 23, 42, 0.55) 100%);
  border-color: rgba(56, 189, 248, 0.22);
}

.gram-admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gram-admin-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(71, 100, 150, 0.28);
  background: rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

html:not(.theme-dark) .gram-admin-tab {
  background: rgba(255, 255, 255, 0.65);
  border-color: rgba(148, 163, 184, 0.32);
}

.gram-admin-tab:hover {
  color: var(--text);
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.1);
}

.gram-admin-tab.is-active {
  color: #fff;
  border-color: rgba(99, 102, 241, 0.55);
  background: linear-gradient(135deg, #7c3aed 0%, #6366f1 100%);
  box-shadow:
    0 0 0 1px rgba(99, 102, 241, 0.35),
    0 6px 20px rgba(99, 102, 241, 0.35),
    0 0 28px rgba(99, 102, 241, 0.25);
  animation: gramAdminTabGlow 2.8s ease-in-out infinite;
}

.gram-admin-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gram-admin-refresh {
  gap: 6px;
}

.gram-admin-kpi {
  margin-bottom: 16px;
}

.gram-admin-kpi-mini {
  margin-bottom: 12px;
}

.gram-admin-kpi-hint {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.gram-admin-page .stat-card.gram-admin-stat {
  border: 1px solid rgba(71, 100, 150, 0.28);
  border-radius: 14px;
  background: rgba(21, 34, 56, 0.55);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  box-shadow:
    inset 0 1px 0 rgba(56, 189, 248, 0.1),
    0 4px 22px rgba(2, 8, 23, 0.14),
    0 0 32px rgba(56, 189, 248, 0.04);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.gram-admin-page .stat-card.gram-admin-stat:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.38);
  box-shadow:
    inset 0 1px 0 rgba(56, 189, 248, 0.14),
    0 10px 28px rgba(2, 8, 23, 0.2),
    0 0 40px rgba(56, 189, 248, 0.12);
}

html:not(.theme-dark) .gram-admin-page .stat-card.gram-admin-stat {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(148, 163, 184, 0.32);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
}

html.theme-dark .gram-admin-page .stat-card.gram-admin-stat {
  background: rgba(21, 34, 56, 0.72);
  border-color: rgba(56, 189, 248, 0.2);
}

.gram-admin-grid-2 {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.gram-admin-grid-clients {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: 16px;
  margin-top: 12px;
}

@media (max-width: 1100px) {
  .gram-admin-grid-2,
  .gram-admin-grid-clients {
    grid-template-columns: 1fr;
  }
}

.gram-admin-card-body {
  padding: 0 16px 16px;
}

.gram-admin-chart-wrap {
  min-height: 220px;
  padding: 4px 0 8px;
}

.gram-admin-table-wrap {
  max-height: 280px;
  overflow: auto;
  border: 1px solid rgba(56, 189, 248, 0.14);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.15);
}

html:not(.theme-dark) .gram-admin-table-wrap {
  background: rgba(248, 250, 252, 0.65);
  border-color: rgba(148, 163, 184, 0.28);
}

.gram-admin-page .gram-table-wrap .data-table th {
  border-bottom: 1px solid rgba(56, 189, 248, 0.14);
}

.gram-admin-page .gram-table-wrap .data-table td {
  border-bottom: 1px solid rgba(71, 100, 150, 0.12);
}

.gram-admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.gram-admin-toolbar .search-box {
  flex: 1 1 200px;
}

.gram-admin-user-detail {
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(56, 189, 248, 0.2);
  background: rgba(21, 34, 56, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow:
    inset 0 1px 0 rgba(56, 189, 248, 0.08),
    0 4px 18px rgba(2, 8, 23, 0.12);
}

html:not(.theme-dark) .gram-admin-user-detail {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(148, 163, 184, 0.32);
}

.gram-admin-detail-title {
  margin: 0 0 10px;
  font-size: 16px;
}

.gram-admin-dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 14px;
  margin: 0 0 12px;
  font-size: 13px;
}

.gram-admin-dl dt {
  color: var(--text-muted);
  margin: 0;
}

.gram-admin-dl dd {
  margin: 0;
  word-break: break-word;
}

.gram-admin-dl-compact {
  margin-top: 12px;
}

.gram-admin-user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gram-admin-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding-top: 10px;
}

.gram-admin-code {
  font-size: 12px;
  word-break: break-all;
}

.gram-admin-footnote {
  margin: 12px 0 0;
  font-size: 12px;
}

.gram-admin-segments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 16px;
}

.gram-admin-seg {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(71, 100, 150, 0.28);
  background: rgba(21, 34, 56, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
  text-align: left;
  min-width: 120px;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

html:not(.theme-dark) .gram-admin-seg {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(148, 163, 184, 0.32);
}

.gram-admin-seg strong {
  font-size: 18px;
  color: var(--text);
}

.gram-admin-seg span {
  font-size: 12px;
  color: var(--text-muted);
}

.gram-admin-seg.is-active {
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(14, 165, 233, 0.12);
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.25),
    0 0 16px rgba(56, 189, 248, 0.12);
}

.gram-admin-textarea {
  width: 100%;
  min-height: 160px;
  resize: vertical;
}

.gram-admin-notify-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}


.gram-admin-notify-shell {
  width: 100% !important;
  max-width: 1000px !important;
  margin: 0 auto !important;
  box-sizing: border-box !important;
}
.gram-admin-notify-premium-card {
  position: relative !important;
  isolation: isolate !important;
  overflow: hidden !important;
  border-radius: 22px !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  background: linear-gradient(165deg, rgba(28, 48, 64, 0.72) 0%, rgba(18, 24, 38, 0.98) 32%, rgba(10, 14, 24, 0.99) 100%) !important;
  box-shadow:
    0 0 0 1px rgba(0, 136, 204, 0.22),
    0 32px 80px rgba(0, 0, 0, 0.62),
    0 0 100px rgba(0, 136, 204, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
  backdrop-filter: blur(18px) !important;
  -webkit-backdrop-filter: blur(18px) !important;
  padding: 1.25rem 1.35rem 1.35rem !important;
}
.gram-admin-notify-premium-card::before {
  content: "" !important;
  position: absolute !important;
  inset: 0 auto auto 0 !important;
  width: 280px !important;
  height: 200px !important;
  pointer-events: none !important;
  z-index: 0 !important;
  background: radial-gradient(ellipse at 18% 12%, rgba(0, 136, 204, 0.42), transparent 68%) !important;
}
.gram-admin-notify-premium-card > * {
  position: relative !important;
  z-index: 1 !important;
}
.gram-admin-notify-premium-head {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  margin: 0 0 1rem !important;
  padding: 0 0.15rem 0.9rem !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}
.gram-admin-notify-premium-ico {
  width: 44px !important;
  height: 44px !important;
  border-radius: 50% !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 auto !important;
  color: #fff !important;
  font-size: 1.15rem !important;
  background: linear-gradient(145deg, #0088cc, #006699) !important;
  box-shadow: 0 0 24px rgba(0, 136, 204, 0.45) !important;
}
.gram-admin-notify-premium-head-copy {
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
  min-width: 0 !important;
}
.gram-admin-notify-premium-head-copy strong {
  font-size: 1.15rem !important;
  font-weight: 700 !important;
  color: #f1f5f9 !important;
  letter-spacing: -0.01em !important;
}
.gram-admin-notify-premium-head-copy span {
  font-size: 0.8rem !important;
  color: #94a3b8 !important;
}
html:not(.theme-dark) .gram-admin-notify-premium-card {
  background: linear-gradient(165deg, #eff8ff 0%, #fff 22%, #f8fafc 100%) !important;
  border-color: rgba(15, 23, 42, 0.1) !important;
  box-shadow:
    0 28px 72px rgba(15, 23, 42, 0.18),
    0 0 64px rgba(0, 136, 204, 0.16) !important;
}
html:not(.theme-dark) .gram-admin-notify-premium-card::before {
  background: radial-gradient(ellipse at 18% 12%, rgba(0, 136, 204, 0.22), transparent 68%) !important;
}
html:not(.theme-dark) .gram-admin-notify-premium-head-copy strong {
  color: #0f172a !important;
}
.gram-admin-page .gram-admin-notify-premium.buy-premium-dialog {
  width: 100% !important;
  max-width: none !important;
  gap: 0.85rem !important;
}
.gram-admin-page .gram-admin-notify-premium .pd-inner-card {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  min-height: 0 !important;
}
.gram-admin-page .gram-admin-notify-premium .pd-body {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.85rem !important;
}
.gram-admin-page .gram-admin-notify-premium .pd-plan-card,
.gram-admin-page .gram-admin-notify-premium .pd-pay-card {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.7rem !important;
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid rgba(255, 255, 255, 0.09) !important;
  border-radius: 16px !important;
  padding: 0.95rem 1rem !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
}
html:not(.theme-dark) .gram-admin-page .gram-admin-notify-premium .pd-plan-card,
html:not(.theme-dark) .gram-admin-page .gram-admin-notify-premium .pd-pay-card {
  background: #fff !important;
  border-color: rgba(15, 23, 42, 0.08) !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
}
.gram-admin-page .gram-admin-notify-premium .pd-section-label {
  color: var(--tg-fg-mute, #94a3b8) !important;
  font-size: 0.7rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
}
.gram-admin-page .gram-admin-notify-premium .pd-field-label {
  color: var(--tg-fg-mute, #94a3b8) !important;
  font-size: 0.75rem !important;
  font-weight: 500 !important;
  display: block !important;
  margin-bottom: 0.3rem !important;
}
.gram-admin-page .gram-admin-notify-premium .pd-input {
  width: 100% !important;
  box-sizing: border-box !important;
  height: auto !important;
  min-height: 2.55rem !important;
  border-radius: 0.75rem !important;
  border: 1px solid rgba(255, 255, 255, 0.09) !important;
  background: rgba(0, 0, 0, 0.28) !important;
  color: var(--tg-fg, #e2e8f0) !important;
  padding: 0.7rem 0.875rem !important;
  font: inherit !important;
  font-size: 0.875rem !important;
}
html:not(.theme-dark) .gram-admin-page .gram-admin-notify-premium .pd-input {
  background: #f8fafc !important;
  border-color: rgba(15, 23, 42, 0.1) !important;
  color: #0f172a !important;
}
.gram-admin-page .gram-admin-notify-premium .pd-input:focus {
  border-color: #0088cc !important;
  box-shadow: 0 0 0 3px rgba(0, 136, 204, 0.18) !important;
  outline: none !important;
}
.gram-admin-page .gram-admin-notify-premium textarea.pd-input {
  height: auto !important;
  min-height: 160px !important;
  resize: vertical !important;
}
.gram-admin-page .gram-admin-notify-premium .pd-btn-pay {
  border-radius: 999px !important;
  min-height: 2.75rem !important;
  height: 2.75rem !important;
  padding: 0 1.35rem !important;
  font-weight: 600 !important;
  background: #0088cc !important;
  border: none !important;
  box-shadow: 0 8px 24px rgba(0, 136, 204, 0.35) !important;
  color: #fff !important;
}
.gram-admin-page .gram-admin-notify-premium .pd-btn-cancel,
.gram-admin-page .gram-admin-notify-premium .gram-gpt-btn-soft.pd-btn-cancel {
  border-radius: 999px !important;
  min-height: 2.4rem !important;
  height: auto !important;
  padding: 0.45rem 1rem !important;
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #e2e8f0 !important;
  box-shadow: none !important;
}
html:not(.theme-dark) .gram-admin-page .gram-admin-notify-premium .pd-btn-cancel,
html:not(.theme-dark) .gram-admin-page .gram-admin-notify-premium .gram-gpt-btn-soft.pd-btn-cancel {
  background: #f1f5f9 !important;
  border-color: rgba(15, 23, 42, 0.12) !important;
  color: #334155 !important;
}
.gram-admin-page .gram-admin-notify-premium .gram-admin-seg {
  border-radius: 12px !important;
  border: 1px solid rgba(0, 136, 204, 0.18) !important;
  background: rgba(0, 0, 0, 0.22) !important;
}
.gram-admin-page .gram-admin-notify-premium .gram-admin-seg.is-active {
  border-color: rgba(0, 136, 204, 0.55) !important;
  background: rgba(0, 136, 204, 0.16) !important;
  box-shadow: 0 0 0 1px rgba(0, 136, 204, 0.25) !important;
}
html:not(.theme-dark) .gram-admin-page .gram-admin-notify-premium .gram-admin-seg {
  background: #f8fafc !important;
  border-color: rgba(15, 23, 42, 0.1) !important;
}
.gram-admin-page .gram-admin-notify-premium .gram-table-wrap {
  border-radius: 12px !important;
  border: 1px solid rgba(148, 163, 184, 0.18) !important;
  overflow: auto !important;
}
.gram-admin-notify-premium-card {
  /* keep shell stronger than admin glass */
  isolation: isolate !important;
}
.gram-admin-notify-lead {
  margin: 0.25rem 0 0 !important;
}
.gram-admin-bc-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.gram-admin-page .gram-admin-notify-premium .gram-admin-bc-btn-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) auto !important;
  gap: 8px !important;
  margin-bottom: 8px !important;
  align-items: center !important;
}
.gram-admin-bc-camp-row {
  cursor: pointer;
}
.gram-admin-bc-camp-row:hover td {
  background: rgba(0, 136, 204, 0.08);
}
.gram-admin-bc-camp-row.is-selected td {
  background: rgba(0, 136, 204, 0.14);
  box-shadow: inset 3px 0 0 #0088cc;
}
.gram-admin-bc-clickers {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
}
.gram-admin-bc-clickers-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: baseline;
  margin-bottom: 10px;
}
@media (max-width: 720px) {
  .gram-admin-page .gram-admin-notify-premium .gram-admin-bc-btn-row {
    grid-template-columns: 1fr !important;
  }
}

.gram-admin-bc-result {
  margin-top: 12px;
}

.gram-admin-bots-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.gram-admin-bot-panel {
  padding: 16px 18px 18px;
}

.gram-admin-bot-head-text h4 {
  margin: 0 0 4px;
}

.gram-admin-bot-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.gram-admin-bot-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}

@media (max-width: 1100px) {
  .gram-admin-bot-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.gram-admin-bot-kpi {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(56, 189, 248, 0.18);
  background: rgba(14, 165, 233, 0.05);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

html.theme-dark .gram-admin-bot-kpi {
  background: rgba(21, 34, 56, 0.55);
  border-color: rgba(56, 189, 248, 0.22);
}

.gram-admin-bot-kpi-val {
  display: block;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
}

.gram-admin-bot-kpi-lbl {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.gram-admin-bot-kpi-hint {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  opacity: 0.85;
}

.gram-admin-bot-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.gram-admin-bot-section {
  margin-top: 8px;
}

.gram-admin-bot-section-title {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.gram-admin-bot-note {
  margin: 10px 0 0;
  font-size: 11px;
}

.gram-admin-page .data-table tr.is-due {
  background: rgba(251, 191, 36, 0.08);
}

.gram-admin-bot-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 4px;
}

.gram-admin-bot-error {
  border-color: rgba(239, 68, 68, 0.35);
}

/* Admin glass v2 — перебиваем глобальные panel-card, видимые обводки */
html.theme-dark .gram-admin-page.gram-admin-glass .panel-card.gram-gpt-window,
html.theme-dark .gram-admin-page.gram-admin-glass .gram-admin-card.panel-card {
  background: #152238 !important;
  border: 1px solid rgba(56, 189, 248, 0.32) !important;
  box-shadow:
    inset 0 1px 0 rgba(56, 189, 248, 0.12),
    0 0 0 1px rgba(56, 189, 248, 0.1),
    0 8px 28px rgba(0, 0, 0, 0.35),
    0 0 24px rgba(56, 189, 248, 0.06) !important;
}

html:not(.theme-dark) .gram-admin-page.gram-admin-glass .panel-card.gram-gpt-window,
html:not(.theme-dark) .gram-admin-page.gram-admin-glass .gram-admin-card.panel-card {
  background: rgba(255, 255, 255, 0.88) !important;
  border: 1px solid rgba(148, 163, 184, 0.42) !important;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.9),
    0 8px 32px rgba(15, 23, 42, 0.1),
    0 0 20px rgba(56, 189, 248, 0.08) !important;
}

.gram-admin-page.gram-admin-glass .gram-gpt-window-body,
.gram-admin-page.gram-admin-glass .gram-admin-card-body {
  padding: 14px 16px 16px;
}

.gram-admin-page.gram-admin-glass .gram-gpt-window-head {
  padding: 12px 16px;
}

.gram-admin-glass-tile,
.gram-admin-page.gram-admin-glass .gram-admin-glass-tile {
  border: 1px solid rgba(56, 189, 248, 0.28) !important;
  box-shadow:
    inset 0 1px 0 rgba(56, 189, 248, 0.1),
    0 0 0 1px rgba(56, 189, 248, 0.08),
    0 8px 24px rgba(2, 8, 23, 0.18) !important;
}

html.theme-dark .gram-admin-page.gram-admin-glass .gram-admin-glass-tile {
  background: #152238 !important;
}

.gram-admin-glass-inset {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(56, 189, 248, 0.2);
  background: rgba(14, 165, 233, 0.06);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

html.theme-dark .gram-admin-glass-inset {
  background: rgba(21, 34, 56, 0.55);
  border-color: rgba(56, 189, 248, 0.22);
}

.gram-admin-manual-pay-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0 8px;
}

@media (max-width: 900px) {
  .gram-admin-manual-pay-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.gram-admin-payments-wrap {
  max-height: 360px;
}

.gram-admin-page .gram-admin-payments-table tbody tr:hover {
  background: rgba(56, 189, 248, 0.06);
}

html.theme-dark .gram-admin-page .gram-admin-payments-table thead th {
  background: rgba(21, 34, 56, 0.85);
  border-bottom: 1px solid rgba(56, 189, 248, 0.2);
}

html.theme-dark .gram-admin-page .gram-table-wrap .data-table td {
  border-bottom: 1px solid rgba(56, 189, 248, 0.08);
}

html.theme-dark .gram-admin-page .stat-card.gram-admin-stat {
  border: 1px solid rgba(56, 189, 248, 0.28) !important;
  background: rgba(21, 34, 56, 0.85) !important;
  box-shadow:
    inset 0 1px 0 rgba(56, 189, 248, 0.1),
    0 4px 18px rgba(2, 8, 23, 0.14) !important;
}

/* Рассылка в ЛС + Парсер ЦА — TR glass · масслукинг */
.gram-spam-page.gram-ml-glass .gram-gpt-window,
.gram-parsing-page.gram-ml-glass .gram-gpt-window {
  border: 1px solid rgba(71, 100, 150, 0.32);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.06),
    0 8px 32px rgba(2, 8, 23, 0.18);
  overflow: visible;
}

html.theme-dark .gram-spam-page.gram-ml-glass .gram-gpt-window,
html.theme-dark .gram-parsing-page.gram-ml-glass .gram-gpt-window {
  background: #152238;
  border-color: rgba(56, 189, 248, 0.24);
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.1),
    0 8px 28px rgba(0, 0, 0, 0.35),
    0 0 24px rgba(56, 189, 248, 0.05);
}

html:not(.theme-dark) .gram-spam-page.gram-ml-glass .gram-gpt-window,
html:not(.theme-dark) .gram-parsing-page.gram-ml-glass .gram-gpt-window {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(148, 163, 184, 0.35);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.85),
    0 8px 32px rgba(15, 23, 42, 0.08),
    0 0 20px rgba(56, 189, 248, 0.06);
}

.gram-spam-page.gram-ml-glass .gram-gpt-window-head,
.gram-parsing-page.gram-ml-glass .gram-gpt-window-head {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.1) 0%, rgba(15, 23, 42, 0.02) 100%);
  border-bottom-color: rgba(56, 189, 248, 0.16);
}

html:not(.theme-dark) .gram-spam-page.gram-ml-glass .gram-gpt-window-head,
html:not(.theme-dark) .gram-parsing-page.gram-ml-glass .gram-gpt-window-head {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.08) 0%, rgba(255, 255, 255, 0.45) 100%);
  border-bottom-color: rgba(148, 163, 184, 0.3);
}

.gram-spam-page.gram-ml-glass .gram-gpt-notice,
.gram-parsing-page.gram-ml-glass .gram-gpt-notice {
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 10px;
  background: rgba(14, 165, 233, 0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.gram-spam-page.gram-ml-glass .gram-gpt-param-card,
.gram-parsing-page.gram-ml-glass .gram-gpt-param-card {
  background: rgba(15, 23, 42, 0.2);
  border-color: rgba(71, 100, 150, 0.28);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

html:not(.theme-dark) .gram-spam-page.gram-ml-glass .gram-gpt-param-card,
html:not(.theme-dark) .gram-parsing-page.gram-ml-glass .gram-gpt-param-card {
  background: rgba(248, 250, 252, 0.85);
  border-color: rgba(148, 163, 184, 0.32);
}

.gram-spam-page.gram-ml-glass .gram-gpt-action-bar,
.gram-parsing-page.gram-ml-glass .gram-gpt-action-bar {
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(14, 165, 233, 0.1) 0%, rgba(15, 23, 42, 0.22) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.07);
}

html:not(.theme-dark) .gram-spam-page.gram-ml-glass .gram-gpt-action-bar,
html:not(.theme-dark) .gram-parsing-page.gram-ml-glass .gram-gpt-action-bar {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96) 0%, rgba(241, 245, 249, 0.88) 100%);
  border-color: rgba(148, 163, 184, 0.35);
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.08);
}

.gram-spam-page.gram-ml-glass #spamRunPanel.gram-spam-results-panel,
.gram-parsing-page.gram-ml-glass #parsingRunPanel.gram-parsing-results-panel {
  border-color: rgba(56, 189, 248, 0.24);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.08),
    0 12px 36px rgba(2, 8, 23, 0.2);
}

html:not(.theme-dark) .gram-spam-page.gram-ml-glass #spamRunPanel.gram-spam-results-panel,
html:not(.theme-dark) .gram-parsing-page.gram-ml-glass #parsingRunPanel.gram-parsing-results-panel {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.08);
}

.gram-spam-page .gram-trr-module-summary .gram-trr-module-meta,
.gram-spam-page .gram-trr-module-summary .gram-trr-module-warn {
  display: none;
}

.gram-spam-page.gram-ml-glass .gram-spam-run-tabs {
  gap: 4px;
  padding: 4px;
  margin: 8px 12px 0;
  border-radius: 12px;
  border: 1px solid rgba(56, 189, 248, 0.18);
  background: rgba(15, 23, 42, 0.22);
}

html:not(.theme-dark) .gram-spam-page.gram-ml-glass .gram-spam-run-tabs {
  background: rgba(241, 245, 249, 0.92);
  border-color: rgba(148, 163, 184, 0.35);
}

.gram-spam-page.gram-ml-glass .gram-spam-run-tab {
  border-radius: 9px;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.gram-spam-page.gram-ml-glass .gram-spam-run-tab.active {
  background: rgba(14, 165, 233, 0.14);
  color: #38bdf8;
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.22);
}

html:not(.theme-dark) .gram-spam-page.gram-ml-glass .gram-spam-run-tab.active {
  background: #fff;
  color: #0284c7;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.gram-spam-page.gram-ml-glass #moduleLiveLog.gram-log-panel {
  border-color: rgba(56, 189, 248, 0.22);
  box-shadow: inset 0 0 24px rgba(56, 189, 248, 0.03);
}

.gram-spam-page.gram-ml-glass .gram-run-stat-cards {
  margin: 0;
}

.gram-spam-page.gram-ml-glass .gram-gpt-form {
  overflow: visible;
}

.gram-spam-page .gram-ai-defender-block {
  margin-bottom: 16px;
  overflow: visible;
  position: relative;
  z-index: 4;
}

.gram-spam-page .gram-gpt-row-main {
  position: relative;
  z-index: 1;
}

.gram-spam-page .gram-ai-defender-block.gram-gpt-window,
.gram-spam-page .gram-ai-defender-block .gram-gpt-window-head,
.gram-spam-page .gram-ai-defender-block .gram-gpt-window-body {
  overflow: visible;
}

.gram-spam-page .gram-ai-defender-block .gram-gpt-window-head {
  align-items: flex-start;
  gap: 12px;
  position: relative;
  z-index: 2;
}

.gram-spam-page .gram-ai-defender-block .gram-gpt-window-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  overflow: visible;
  position: relative;
  z-index: 2;
}

.gram-spam-page .gram-ai-defender-block .gram-gpt-window-title-row .gram-info-tip {
  position: relative;
  z-index: 5;
}

.gram-spam-page .gram-ai-defender-block .gram-gpt-window-title-row .gram-info-tip-pop {
  top: calc(100% + 8px);
  bottom: auto;
  left: 0;
  right: auto;
  transform: translateY(4px);
  z-index: 500;
  pointer-events: auto;
}

.gram-spam-page .gram-ai-defender-block .gram-info-tip-pop.gram-info-tip-pop--end {
  left: 0;
  right: auto;
  width: min(300px, calc(100vw - 48px));
}

.gram-spam-page .gram-ai-defender-block .gram-info-tip:hover .gram-info-tip-pop,
.gram-spam-page .gram-ai-defender-block .gram-info-tip.is-open .gram-info-tip-pop,
.gram-spam-page .gram-ai-defender-block .gram-info-tip:focus-within .gram-info-tip-pop {
  transform: translateY(0);
}

.gram-spam-page .gram-ai-defender-block .gram-gpt-window-title-row .gram-info-tip-inline {
  margin-top: 1px;
  flex-shrink: 0;
}

.gram-spam-page .gram-ai-defender-block:has(.gram-info-tip:hover),
.gram-spam-page .gram-ai-defender-block:has(.gram-info-tip.is-open),
.gram-spam-page .gram-ai-defender-block:has(.gram-info-tip:focus-within) {
  position: relative;
  z-index: 30;
}

.gram-spam-page .gram-ai-defender-block:has(.gram-ai-defender-body[hidden]) .gram-info-tip {
  visibility: visible;
}

.gram-spam-page .gram-ai-defender-block.is-off .gram-gpt-window-head {
  border-bottom: none;
}

.gram-spam-page .gram-ai-defender-block.is-off .gram-info-tip,
.gram-spam-page .gram-ai-defender-block.is-off .gram-info-tip-link {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.gram-spam-page .gram-ai-defender-block.is-off {
  overflow: visible;
  position: relative;
  z-index: 5;
}

.gram-spam-page .gram-ai-defender-new {
  display: none;
}

.gram-spam-page .gram-gpt-param-input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.gram-spam-page .gram-gpt-param-input[type="number"]::-webkit-outer-spin-button,
.gram-spam-page .gram-gpt-param-input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.gram-spam-page #moduleLiveLog .gram-log-footer {
  flex-wrap: wrap;
  row-gap: 8px;
  align-items: flex-start;
}

.gram-spam-page #moduleLiveLog .gram-log-footer-meta {
  flex: 1 1 180px;
  min-width: 0;
}

.gram-spam-page #moduleLiveLog .gram-log-footer-actions {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  margin-left: auto;
}

.gram-spam-page #moduleLiveLog .gram-log-icon-btn .gram-log-btn-label {
  display: none !important;
}

.gram-spam-page #moduleLiveLog .gram-log-result-hint {
  word-break: break-word;
}

.gram-spam-page #moduleLiveLog .gram-log-icon-btn.gram-log-report-ready {
  border-radius: 999px;
  padding: 4px 10px;
  gap: 6px;
}

.gram-spam-page.gram-ml-glass .gram-spam-text-window.gram-gpt-window {
  border-color: rgba(244, 114, 182, 0.38);
  box-shadow:
    0 0 0 1px rgba(244, 114, 182, 0.12),
    0 8px 32px rgba(2, 8, 23, 0.18),
    0 0 24px rgba(244, 114, 182, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

html.theme-dark .gram-spam-page.gram-ml-glass .gram-spam-text-window.gram-gpt-window {
  background: linear-gradient(145deg, rgba(21, 34, 56, 0.95), rgba(30, 20, 40, 0.55));
  border-color: rgba(244, 114, 182, 0.32);
  box-shadow:
    0 0 0 1px rgba(244, 114, 182, 0.14),
    0 8px 28px rgba(0, 0, 0, 0.35),
    0 0 28px rgba(244, 114, 182, 0.1);
}

html:not(.theme-dark) .gram-spam-page.gram-ml-glass .gram-spam-text-window.gram-gpt-window {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(253, 242, 248, 0.55));
  border-color: rgba(244, 114, 182, 0.35);
  box-shadow:
    0 0 0 1px rgba(244, 114, 182, 0.1),
    0 8px 32px rgba(15, 23, 42, 0.08);
}

.gram-spam-page.gram-ml-glass .gram-spam-text-window .gram-gpt-window-head {
  background: linear-gradient(135deg, rgba(244, 114, 182, 0.12) 0%, rgba(15, 23, 42, 0.02) 100%);
  border-bottom-color: rgba(244, 114, 182, 0.2);
}

html:not(.theme-dark) .gram-spam-page.gram-ml-glass .gram-spam-text-window .gram-gpt-window-head {
  background: linear-gradient(135deg, rgba(244, 114, 182, 0.1) 0%, rgba(255, 255, 255, 0.5) 100%);
  border-bottom-color: rgba(244, 114, 182, 0.22);
}

.gram-parsing-page.gram-ml-glass .gram-parsing-modes-window.gram-gpt-window {
  border-color: rgba(244, 114, 182, 0.38);
  box-shadow:
    0 0 0 1px rgba(244, 114, 182, 0.12),
    0 8px 32px rgba(2, 8, 23, 0.18),
    0 0 24px rgba(244, 114, 182, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

html.theme-dark .gram-parsing-page.gram-ml-glass .gram-parsing-modes-window.gram-gpt-window {
  background: linear-gradient(145deg, rgba(21, 34, 56, 0.95), rgba(30, 20, 40, 0.55));
  border-color: rgba(244, 114, 182, 0.32);
  box-shadow:
    0 0 0 1px rgba(244, 114, 182, 0.14),
    0 8px 28px rgba(0, 0, 0, 0.35),
    0 0 28px rgba(244, 114, 182, 0.1);
}

html:not(.theme-dark) .gram-parsing-page.gram-ml-glass .gram-parsing-modes-window.gram-gpt-window {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(253, 242, 248, 0.55));
  border-color: rgba(244, 114, 182, 0.35);
  box-shadow:
    0 0 0 1px rgba(244, 114, 182, 0.1),
    0 8px 32px rgba(15, 23, 42, 0.08);
}

.gram-parsing-page.gram-ml-glass .gram-parsing-modes-window .gram-gpt-window-head {
  background: linear-gradient(135deg, rgba(244, 114, 182, 0.12) 0%, rgba(15, 23, 42, 0.02) 100%);
  border-bottom-color: rgba(244, 114, 182, 0.2);
}

html:not(.theme-dark) .gram-parsing-page.gram-ml-glass .gram-parsing-modes-window .gram-gpt-window-head {
  background: linear-gradient(135deg, rgba(244, 114, 182, 0.1) 0%, rgba(255, 255, 255, 0.5) 100%);
  border-bottom-color: rgba(244, 114, 182, 0.22);
}

.gram-parsing-page.gram-ml-glass .gram-parsing-modes-window .gram-gpt-window-body {
  overflow: visible;
}

.gram-parsing-page.gram-ml-glass .gram-parsing-modes {
  flex-wrap: wrap;
  align-items: flex-start;
  width: 100%;
}

.gram-parsing-page.gram-ml-glass .gram-gpt-form {
  overflow: visible;
}

.gram-parsing-page .gram-ai-defender-block.gram-gpt-window,
.gram-parsing-page .gram-ai-defender-block .gram-gpt-window-head {
  overflow: visible;
}

.gram-parsing-page .gram-ai-defender-block .gram-gpt-window-title-row {
  overflow: visible;
  position: relative;
  z-index: 2;
}

.gram-parsing-page .gram-ai-defender-block:has(.gram-info-tip:hover),
.gram-parsing-page .gram-ai-defender-block:has(.gram-info-tip.is-open),
.gram-parsing-page .gram-ai-defender-block:has(.gram-info-tip:focus-within) {
  position: relative;
  z-index: 30;
}

.gram-parsing-page .gram-ai-defender-block .gram-gpt-window-title-row .gram-info-tip {
  position: relative;
  z-index: 5;
}

.gram-parsing-page .gram-ai-defender-block .gram-gpt-window-title-row .gram-info-tip-pop {
  top: calc(100% + 8px);
  bottom: auto;
  left: 0;
  right: auto;
  z-index: 500;
  transform: translateY(4px);
  pointer-events: auto;
}

.gram-parsing-page .gram-ai-defender-block .gram-info-tip:hover .gram-info-tip-pop,
.gram-parsing-page .gram-ai-defender-block .gram-info-tip.is-open .gram-info-tip-pop,
.gram-parsing-page .gram-ai-defender-block .gram-info-tip:focus-within .gram-info-tip-pop {
  transform: translateY(0);
}

.gram-parsing-page .gram-parsing-modes-window:has(.gram-info-tip:hover),
.gram-parsing-page .gram-parsing-modes-window:has(.gram-info-tip.is-open),
.gram-parsing-page .gram-parsing-modes-window:has(.gram-info-tip:focus-within) {
  position: relative;
  z-index: 28;
}

.gram-parsing-page .gram-parsing-modes-window .gram-gpt-window-title-row .gram-info-tip-pop {
  z-index: 500;
}

.gram-parsing-streams-warn {
  margin: 8px 0 0;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  color: #b45309;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.28);
}

html.theme-dark .gram-parsing-streams-warn {
  color: #fcd34d;
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.24);
}

#adminMenuGroup .menu-icon {
  color: inherit;
}

#adminMenuGroup .menu-item.active {
  background: linear-gradient(90deg, rgba(124, 58, 237, 0.18), rgba(99, 102, 241, 0.08));
}

.cell-muted {
  color: var(--text-muted);
  font-size: 13px;
}

.gram-admin-notify-bot-row {
  margin-bottom: 0.75rem;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(56, 189, 248, 0.14);
  background: rgba(14, 165, 233, 0.05);
}

html:not(.theme-dark) .gram-admin-traffic-form,
html:not(.theme-dark) .gram-admin-notify-bot-row {
  background: rgba(248, 250, 252, 0.85);
  border-color: rgba(148, 163, 184, 0.28);
}

.gram-admin-traffic-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.75rem;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid rgba(56, 189, 248, 0.16);
  background: rgba(14, 165, 233, 0.06);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.gram-admin-traffic-form .gram-input {
  flex: 1 1 140px;
  min-width: 120px;
}

.gram-admin-traffic-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.gram-admin-updated {
  font-size: 12px;
}

/* —— TRR (light by default, dark in theme-dark) —— */
.gram-trr-page {
  --trr-bg: #f8fafc;
  --trr-card: #ffffff;
  --trr-border: rgba(148, 163, 184, 0.45);
  --trr-text: #0f172a;
  --trr-muted: #64748b;
  --trr-heading: #0f172a;
  --trr-strong: #1e293b;
  --trr-accent: #0891b2;
  --trr-inset: rgba(241, 245, 249, 0.95);
  --trr-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  --tg-blue: #08c;
  --tg-blue-soft: rgba(0, 136, 204, 0.12);
  --tg-border: rgba(15, 23, 42, 0.08);
  --tg-bg-soft: #f1f5f9;
  color-scheme: light;
  color: var(--trr-text);
  background: var(--trr-bg);
  border-radius: 20px;
  padding: 22px 24px 28px;
  border: 1px solid var(--trr-border);
  box-shadow: var(--trr-shadow);
  max-width: 1200px;
  margin: 0 auto;
  box-sizing: border-box;
}

html.theme-dark .gram-trr-page {
  --trr-bg: #0f1419;
  --trr-card: #152238;
  --trr-border: rgba(71, 100, 150, 0.35);
  --trr-text: #e2e8f0;
  --trr-muted: #94a3b8;
  --trr-heading: #f8fafc;
  --trr-strong: #f1f5f9;
  --trr-accent: #22d3ee;
  --trr-inset: rgba(15, 20, 25, 0.55);
  --trr-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  --tg-blue: #08c;
  --tg-blue-soft: rgba(0, 136, 204, 0.14);
  --tg-border: rgba(255, 255, 255, 0.09);
  --tg-bg-soft: rgba(0, 0, 0, 0.28);
  color-scheme: dark;
}

.gram-trr-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  padding: 0.15rem 0.1rem 0.35rem;
}

.gram-trr-head-main {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.gram-trr-head-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--trr-accent) 22%, transparent);
  color: var(--trr-accent);
  font-size: 20px;
}

.gram-trr-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--trr-heading);
}

.gram-trr-beta {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  vertical-align: middle;
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.gram-trr-subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--trr-muted);
}

.gram-trr-head-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.gram-trr-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--trr-border);
  background: var(--trr-inset);
  font-size: 11px;
  color: var(--trr-muted);
}

.gram-trr-meta-pill strong {
  color: var(--trr-strong);
  font-size: 13px;
}

.gram-trr-meta-pill .pi-bolt {
  color: #fbbf24;
  font-size: 12px;
}

.gram-trr-meta-pill.is-muted strong {
  font-size: 11px;
  font-weight: 600;
}

.gram-trr-notice {
  display: flex;
  gap: 14px;
  padding: 14px 16px;
  margin-bottom: 18px;
  border-radius: 14px;
  border: 1px solid rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.08);
  font-size: 12px;
  line-height: 1.5;
}

.gram-trr-notice .pi-info-circle {
  color: #fbbf24;
  font-size: 18px;
  margin-top: 2px;
}

.gram-trr-notice strong {
  display: block;
  margin-bottom: 4px;
  color: var(--trr-strong);
}

html.theme-dark .gram-trr-notice strong {
  color: #fde68a;
}

.gram-trr-notice p {
  margin: 0;
  color: var(--trr-muted);
}

.gram-trr-grid {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(340px, 1.15fr);
  gap: 18px;
  margin-bottom: 18px;
}

@media (max-width: 960px) {
  .gram-trr-grid {
    grid-template-columns: 1fr;
  }
}

.gram-trr-card {
  background: var(--trr-card);
  border: 1px solid var(--trr-border);
  border-radius: 18px;
  padding: 1.05rem 1.2rem 1.25rem;
  min-width: 0;
}

.gram-trr-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.gram-trr-card-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--trr-strong);
}

.gram-trr-meta-hint {
  font-size: 11px;
  color: var(--trr-muted);
}

.gram-trr-detail-empty {
  text-align: center;
  padding: 28px 16px;
  color: var(--trr-muted);
}

.gram-trr-ph-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 10px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(34, 211, 238, 0.12);
  color: var(--trr-accent);
  font-size: 22px;
}

.gram-trr-detail-empty strong {
  display: block;
  color: var(--trr-text);
  margin-bottom: 4px;
}

.gram-trr-source-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.gram-trr-source-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid var(--trr-border);
  background: var(--trr-inset);
  color: var(--trr-muted);
  font-size: 12px;
  cursor: pointer;
}

.gram-trr-source-tab.is-active {
  border-color: color-mix(in srgb, var(--trr-accent) 45%, transparent);
  background: color-mix(in srgb, var(--trr-accent) 12%, transparent);
  color: var(--trr-accent);
}

.gram-trr-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.gram-trr-search-wrap {
  flex: 1 1 180px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--trr-border);
  background: var(--trr-inset);
}

.gram-trr-search-wrap .pi-search {
  color: var(--trr-muted);
  font-size: 13px;
}

.gram-trr-search {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--trr-text);
  padding: 8px 0;
  font-size: 13px;
  outline: none;
}

.gram-trr-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.gram-trr-select {
  flex: 1;
  min-width: 0;
  padding: 7px 10px;
  font-size: 12px;
  background: var(--trr-inset);
  border-color: var(--trr-border);
  color: var(--trr-text);
}

.gram-trr-list {
  max-height: 360px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gram-trr-acc-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: var(--trr-inset);
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.gram-trr-acc-row:hover {
  border-color: color-mix(in srgb, var(--trr-accent) 25%, transparent);
}

.gram-trr-acc-row.is-selected {
  border-color: color-mix(in srgb, var(--trr-accent) 50%, transparent);
  background: color-mix(in srgb, var(--trr-accent) 10%, transparent);
}

.gram-trr-acc-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(71, 100, 150, 0.25);
  color: var(--trr-muted);
}

.gram-trr-acc-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gram-trr-acc-main {
  flex: 1;
  min-width: 0;
}

.gram-trr-acc-main strong {
  display: block;
  font-size: 13px;
  color: var(--trr-strong);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gram-trr-acc-main .cell-muted {
  font-size: 11px;
  color: var(--trr-muted);
}

.gram-trr-acc-badge {
  flex-shrink: 0;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(71, 100, 150, 0.25);
  color: var(--trr-muted);
}

.gram-trr-tone-ok {
  background: rgba(34, 197, 94, 0.18);
  color: #4ade80;
}

.gram-trr-tone-warn {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
}

.gram-trr-tone-bad {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
}

.gram-trr-score-block {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 18px;
  margin-bottom: 0;
  padding: 0.95rem 1.05rem;
  border-radius: 16px;
  border: 1px solid var(--tg-border);
  background:
    linear-gradient(165deg, rgba(0, 136, 204, 0.08), transparent 55%),
    var(--tg-bg-soft);
}

.gram-trr-score-ring {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 3px solid rgba(34, 211, 238, 0.45);
  background: rgba(34, 211, 238, 0.08);
}

.gram-trr-score-ring strong {
  font-size: 26px;
  line-height: 1;
  color: var(--trr-heading);
}

.gram-trr-score-ring span {
  font-size: 10px;
  color: var(--trr-muted);
  margin-top: 2px;
}

.gram-trr-tone-ok.gram-trr-score-ring {
  border-color: rgba(34, 197, 94, 0.5);
  background: rgba(34, 197, 94, 0.08);
}

.gram-trr-tone-warn.gram-trr-score-ring {
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.08);
}

.gram-trr-tone-bad.gram-trr-score-ring {
  border-color: rgba(239, 68, 68, 0.5);
  background: rgba(239, 68, 68, 0.08);
}

.gram-trr-score-copy h4 {
  margin: 0 0 4px;
  font-size: 14px;
  color: var(--trr-strong);
}

.gram-trr-zone {
  display: inline-block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 600;
}

.gram-trr-zone-ok {
  color: #4ade80;
}

.gram-trr-zone-warn {
  color: #fbbf24;
}

.gram-trr-zone-bad {
  color: #f87171;
}

.gram-trr-forecast {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.gram-trr-forecast-item {
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--trr-inset);
  border: 1px solid var(--trr-border);
}

.gram-trr-forecast-item span {
  display: block;
  font-size: 10px;
  color: var(--trr-muted);
  margin-bottom: 2px;
}

.gram-trr-forecast-item strong {
  font-size: 15px;
  color: var(--trr-strong);
}

.gram-trr-detail-placeholder {
  padding: 12px;
  border-radius: 10px;
  background: var(--trr-inset);
  font-size: 12px;
  color: var(--trr-muted);
  margin-bottom: 12px;
}

.gram-trr-factors h5,
.gram-trr-history h5 {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--trr-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.gram-trr-factors ul,
.gram-trr-history ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.gram-trr-factor,
.gram-trr-history li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(71, 100, 150, 0.2);
  font-size: 12px;
}

.gram-trr-footnote {
  margin: 10px 0 0;
  font-size: 11px;
  color: var(--trr-muted);
}

.gram-trr-list-loading,
.gram-trr-list-empty {
  padding: 24px;
  text-align: center;
  color: var(--trr-muted);
  font-size: 13px;
}

.gram-trr-bench-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  min-height: 80px;
}

@media (max-width: 720px) {
  .gram-trr-bench-grid {
    grid-template-columns: 1fr;
  }

  .gram-trr-forecast {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.gram-trr-page .cell-muted {
  color: var(--trr-muted);
}

.gram-trr-detail-inner {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0.1rem 0 0.25rem;
}

.gram-trr-modules {
  padding: 0.95rem 1.05rem 1.05rem;
  border-radius: 16px;
  border: 1px solid var(--tg-border);
  background: var(--trr-card);
}

.gram-trr-modules h5 {
  margin: 0 0 0.4rem;
  font-size: 12px;
  color: var(--trr-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.gram-trr-mod-hint {
  margin: 0 0 0.75rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--trr-muted);
}

.gram-trr-mod-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

@media (max-width: 720px) {
  .gram-trr-mod-grid {
    grid-template-columns: 1fr;
  }
}

.gram-trr-mod-col {
  padding: 0.7rem 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--tg-border);
  background: var(--tg-bg-soft);
  min-width: 0;
}

.gram-trr-mod-col > span {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--trr-muted);
}

.gram-trr-mod-col.is-ok {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.08);
}

.gram-trr-mod-col.is-warn {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.08);
}

.gram-trr-mod-col.is-bad {
  border-color: rgba(248, 113, 113, 0.4);
  background: rgba(248, 113, 113, 0.08);
}

.gram-trr-mod-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.gram-trr-mod-list li {
  padding: 0.28rem 0;
  font-size: 0.8rem;
  line-height: 1.35;
  color: var(--trr-strong);
  border-bottom: 1px solid rgba(71, 100, 150, 0.15);
}

.gram-trr-mod-list li:last-child {
  border-bottom: none;
}

.gram-trr-mod-empty {
  margin: 0;
  font-size: 0.8rem;
}

.gram-trr-mod-note {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  margin: 0.65rem 0 0;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--trr-muted);
}

.gram-trr-mod-note .pi {
  margin-top: 0.15rem;
  color: var(--trr-accent);
}

.gram-trr-factors,
.gram-trr-acc-history {
  padding: 0.85rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--tg-border);
  background: var(--tg-bg-soft);
}

.gram-trr-acc-history ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.gram-trr-acc-history li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(71, 100, 150, 0.2);
  font-size: 12px;
}

.gram-trr-page .gram-trr-benchmark,
.gram-trr-page .gram-trr-history {
  margin-top: 18px;
}

.gram-trr-bench-col h4 {
  margin: 0 0 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.gram-trr-bench-best {
  color: #4ade80;
}

.gram-trr-bench-worst {
  color: #f87171;
}

.gram-trr-bench-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.gram-trr-bench-col li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(71, 100, 150, 0.2);
  font-size: 12px;
}

.gram-trr-bench-code {
  font-weight: 700;
  min-width: 28px;
  color: var(--trr-text);
}

.gram-trr-bench-pct {
  color: var(--trr-accent);
  min-width: 48px;
}

.gram-trr-panel-tools[hidden],
.gram-trr-upload[hidden] {
  display: none !important;
}

.gram-trr-upload {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 200px;
}

.gram-trr-upload-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 28px 16px;
  border-radius: 12px;
  border: 2px dashed var(--trr-border);
  background: var(--trr-inset);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.gram-trr-upload-drop.is-drag {
  border-color: var(--trr-accent);
  background: color-mix(in srgb, var(--trr-accent) 8%, transparent);
}

.gram-trr-upload-drop .pi {
  font-size: 28px;
  color: var(--trr-accent);
}

.gram-trr-upload-drop strong {
  font-size: 13px;
  color: var(--trr-strong);
}

.gram-trr-upload-drop span {
  font-size: 11px;
  color: var(--trr-muted);
}

.gram-trr-upload-files {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--trr-muted);
}

.gram-trr-upload-files li {
  list-style: none;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--trr-inset);
  border: 1px solid var(--trr-border);
}

.gram-apick-trr {
  flex-shrink: 0;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  background: color-mix(in srgb, var(--trr-accent, #0891b2) 14%, transparent);
  color: var(--trr-accent, #0891b2);
  border: 1px solid color-mix(in srgb, var(--trr-accent, #0891b2) 28%, transparent);
}

.gram-apick-trr.is-ok {
  background: rgba(34, 197, 94, 0.14);
  color: #16a34a;
  border-color: rgba(34, 197, 94, 0.28);
}

html.theme-dark .gram-apick-trr.is-ok {
  color: #4ade80;
}

.gram-apick-trr.is-warn {
  background: rgba(245, 158, 11, 0.14);
  color: #d97706;
  border-color: rgba(245, 158, 11, 0.28);
}

html.theme-dark .gram-apick-trr.is-warn {
  color: #fbbf24;
}

.gram-apick-trr.is-bad {
  background: rgba(239, 68, 68, 0.14);
  color: #dc2626;
  border-color: rgba(239, 68, 68, 0.28);
}

html.theme-dark .gram-apick-trr.is-bad {
  color: #f87171;
}

.gram-trr-audit-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.gram-trr-audit-desc {
  margin: 0;
  font-size: 12px;
  color: var(--trr-muted);
}

.gram-trr-audit-note {
  margin: 0 0 10px;
  font-size: 11px;
  color: var(--trr-muted);
}

.gram-trr-audit-grid {
  max-height: 360px;
  overflow: auto;
}

.gram-trr-audit-table-wrap {
  overflow-x: auto;
}

.gram-trr-audit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.gram-trr-audit-table th,
.gram-trr-audit-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--trr-border);
  text-align: left;
  vertical-align: middle;
}

.gram-trr-audit-table th {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--trr-muted);
  font-weight: 600;
}

.gram-trr-audit-act {
  text-align: right;
  white-space: nowrap;
}

.gram-trr-audit-check {
  font-size: 11px;
  padding: 5px 10px;
}

.gram-trr-audit-proxy.is-ok {
  color: #16a34a;
  font-weight: 600;
}

html.theme-dark .gram-trr-audit-proxy.is-ok {
  color: #4ade80;
}

.gram-trr-audit-proxy.is-bad {
  color: #dc2626;
  font-weight: 600;
}

html.theme-dark .gram-trr-audit-proxy.is-bad {
  color: #f87171;
}

.gram-trr-stale-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  margin-bottom: 10px;
  border-radius: 10px;
  border: 1px solid rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.1);
  font-size: 12px;
  color: var(--trr-text);
}

.gram-trr-stale-banner .pi-clock {
  color: #d97706;
  margin-right: 6px;
}

.gram-trr-stale-tag {
  color: #d97706;
  font-weight: 600;
}

html.theme-dark .gram-trr-stale-tag {
  color: #fbbf24;
}

.gram-trr-acc-row.is-stale {
  border-color: rgba(245, 158, 11, 0.35);
}

.gram-trr-module-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 8px 0 0;
  font-size: 12px;
}

.gram-trr-module-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--gram-accent, #0891b2) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--gram-accent, #0891b2) 25%, transparent);
}

.gram-trr-module-pill strong {
  font-size: 13px;
}

.gram-trr-module-meta {
  color: var(--text-muted, #64748b);
}

.gram-trr-module-warn {
  color: #d97706;
  font-weight: 600;
}

.gram-trr-bench-filter {
  max-width: 180px;
  min-width: 140px;
  font-size: 12px;
  padding: 6px 10px;
}

.gram-trr-bench-compare {
  margin-bottom: 12px;
}

.gram-trr-bench-compare-title {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--trr-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.gram-trr-bench-compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.gram-trr-bench-compare-table th,
.gram-trr-bench-compare-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--trr-border);
  text-align: left;
}

.gram-trr-bench-grid-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.gram-trr-history-actions {
  display: flex;
  gap: 6px;
}

.gram-trr-history-btn {
  font-size: 11px;
  padding: 5px 10px;
}

.gram-trr-history-wrap {
  max-height: 280px;
  overflow: auto;
}

.gram-trr-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.gram-trr-history-table th,
.gram-trr-history-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--trr-border);
  text-align: left;
}

.gram-trr-audit-recs {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.gram-trr-audit-rec {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(245, 158, 11, 0.3);
  background: rgba(245, 158, 11, 0.08);
  font-size: 11px;
  line-height: 1.4;
}

.gram-trr-audit-rec .pi-exclamation-triangle {
  color: #d97706;
  margin-top: 2px;
}

.gram-trr-audit-row-warn {
  background: rgba(245, 158, 11, 0.05);
}

.gram-trr-audit-rec-cell {
  max-width: 180px;
  font-size: 11px;
  color: var(--trr-muted);
}

.menu-item[data-page="trr"] .menu-icon {
  color: #fbbf24;
}

.menu-item[data-page="trr"].active {
  background: linear-gradient(90deg, rgba(34, 211, 238, 0.14), rgba(21, 34, 56, 0.08));
}

/* Module gate — glass overlay (preview / buy / dev) */
.gram-module-gate-page {
  position: relative;
  min-height: calc(100vh - 120px);
  margin: -16px -20px -24px;
  padding: 24px 20px 32px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: inherit;
}

html.theme-dark .gram-module-gate-page {
  background: linear-gradient(165deg, #0b1220 0%, #101a2e 42%, #152238 100%);
}

html:not(.theme-dark) .gram-module-gate-page {
  background: linear-gradient(165deg, #eef4ff 0%, #f4f8ff 38%, #fafbfd 100%);
}

.gram-module-gate-ambient {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.gram-module-gate-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.45;
}

.gram-module-gate-orb-a {
  width: min(420px, 55vw);
  height: min(420px, 55vw);
  top: -12%;
  left: -8%;
  background: #22d3ee;
}

.gram-module-gate-orb-b {
  width: min(380px, 50vw);
  height: min(380px, 50vw);
  bottom: -10%;
  right: -6%;
  background: #818cf8;
}

html.theme-dark .gram-module-gate-orb-a {
  opacity: 0.32;
  background: #0891b2;
}

html.theme-dark .gram-module-gate-orb-b {
  opacity: 0.28;
  background: #6366f1;
}

.gram-module-gate-tone-emerald .gram-module-gate-orb-a { background: #34d399; }
.gram-module-gate-tone-violet .gram-module-gate-orb-b { background: #a78bfa; }
.gram-module-gate-tone-amber .gram-module-gate-orb-a { background: #fbbf24; }

.gram-module-gate-wrap {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 168px);
  padding: 16px;
}

.gram-module-gate {
  position: relative;
  max-width: 560px;
  width: 100%;
  padding: 28px 28px 24px;
  border-radius: 20px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(24px) saturate(1.35);
  -webkit-backdrop-filter: blur(24px) saturate(1.35);
  box-shadow:
    0 0 0 1px rgba(34, 211, 238, 0.12),
    0 0 48px rgba(34, 211, 238, 0.18),
    0 24px 64px rgba(15, 23, 42, 0.28);
}

html.theme-dark .gram-module-gate {
  background: rgba(21, 34, 56, 0.55);
  border-color: rgba(148, 163, 184, 0.28);
  box-shadow:
    0 0 0 1px rgba(34, 211, 238, 0.16),
    0 0 56px rgba(34, 211, 238, 0.22),
    0 28px 72px rgba(0, 0, 0, 0.45);
}

html:not(.theme-dark) .gram-module-gate {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(148, 163, 184, 0.35);
  box-shadow:
    0 0 0 1px rgba(59, 130, 246, 0.1),
    0 0 40px rgba(59, 130, 246, 0.12),
    0 20px 48px rgba(15, 23, 42, 0.1);
}

.gram-module-gate-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 8px 24px rgba(34, 211, 238, 0.25);
}

.gram-module-gate h2 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 600;
}

.gram-module-gate-title {
  font-weight: 600;
  margin: 0 0 6px;
  font-size: 15px;
}

.gram-module-gate-text {
  margin: 0 0 16px;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

.gram-module-gate-media {
  margin: 0 0 18px;
  text-align: left;
}

.gram-module-gate-video {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 12px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);
}

.gram-module-gate-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.gram-module-gate-cover {
  display: block;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 12px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
  text-decoration: none;
}

.gram-module-gate-cover img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.gram-module-gate-cover-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  color: #fff;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.05) 0%, rgba(15, 23, 42, 0.55) 100%);
  transition: background 0.2s ease;
}

.gram-module-gate-cover:hover .gram-module-gate-cover-play {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.15) 0%, rgba(15, 23, 42, 0.65) 100%);
}

.gram-module-gate-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.gram-module-gate-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  color: inherit;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(255, 255, 255, 0.08);
  transition: border-color 0.15s ease, background 0.15s ease;
}

html.theme-dark .gram-module-gate-link {
  background: rgba(15, 23, 42, 0.35);
}

.gram-module-gate-link:hover {
  border-color: rgba(34, 211, 238, 0.45);
  background: rgba(34, 211, 238, 0.1);
}

.gram-module-gate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 4px;
}

.gram-panel-login .empty-icon {
  font-size: 2rem;
  opacity: 0.7;
  margin-bottom: 8px;
}

.cabinet-plans-subtabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.cabinet-plans-subtab {
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: transparent;
  color: inherit;
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
  font: inherit;
}

.cabinet-plans-subtab.is-active {
  background: rgba(99, 102, 241, 0.18);
  border-color: rgba(99, 102, 241, 0.45);
}

.cabinet-module-period {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.cabinet-module-period-btn {
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: transparent;
  color: inherit;
  border-radius: 8px;
  padding: 6px 14px;
  cursor: pointer;
  font: inherit;
}

.cabinet-module-period-btn.is-active {
  background: rgba(34, 211, 238, 0.12);
  border-color: rgba(34, 211, 238, 0.4);
}

.cabinet-module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.cabinet-module-card {
  padding: 16px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.cabinet-module-full-hint {
  margin: 0 0 12px;
}

.gram-demo-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  padding: 10px 14px;
  margin-bottom: 12px;
  border-radius: 12px;
  font-size: 13px;
  border: 1px solid rgba(56, 189, 248, 0.18);
  background: rgba(15, 23, 42, 0.35);
}

html:not(.theme-dark) .gram-demo-summary {
  background: rgba(248, 250, 252, 0.9);
}

.gram-demo-settings-fold {
  margin-bottom: 12px;
}

.gram-demo-settings-fold > summary {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

.gram-demo-settings-fold > summary::-webkit-details-marker {
  display: none;
}

.gram-demo-detail-screen {
  margin-top: 4px;
}

.gram-demo-back {
  margin-bottom: 12px;
}

.gram-demo-detail-title {
  margin: 0 0 12px;
}

.gram-demo-line {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.55;
}

.gram-demo-line .cell-muted {
  display: inline-block;
  min-width: 72px;
}

.gram-demo-ok {
  color: #34d399;
}

.gram-demo-actions {
  margin-top: 16px;
}

.gram-demo-hash-fold {
  margin: 8px 0 12px;
  font-size: 13px;
}

.gram-demo-hash-fold > summary {
  cursor: pointer;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.gram-demo-kpi-main {
  grid-template-columns: repeat(4, minmax(140px, 1fr));
}

.gram-demo-kpi-secondary {
  margin: 10px 0 0;
  font-size: 12px;
}

.gram-demo-detail {
  position: relative;
  top: auto;
  align-self: start;
  min-width: 280px;
  max-width: 100%;
  overflow: visible;
}

.gram-demo-detail-panel {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.gram-demo-detail-enter .gram-demo-detail-panel {
  animation: gramDemoDetailIn 0.22s ease-out both;
}

.gram-demo-detail-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}

.gram-demo-field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
}

.gram-demo-field-grid--1 {
  grid-template-columns: 1fr;
}

.gram-demo-field {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(56, 189, 248, 0.12);
  background: rgba(15, 23, 42, 0.25);
}

html:not(.theme-dark) .gram-demo-field {
  background: rgba(248, 250, 252, 0.85);
}

.gram-demo-field-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.gram-demo-field-value {
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
}

.gram-demo-hash {
  display: block;
  font-size: 11px;
  line-height: 1.45;
  word-break: break-all;
  white-space: pre-wrap;
  margin-bottom: 6px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(2, 8, 23, 0.35);
  border: 1px solid rgba(56, 189, 248, 0.14);
}

html:not(.theme-dark) .gram-demo-hash {
  background: rgba(241, 245, 249, 0.95);
}

.gram-demo-copy {
  font-size: 11px;
  padding: 4px 8px;
}

.gram-demo-claims-fold {
  margin-top: 0;
}

.gram-demo-claims-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  font-size: 14px;
}

.gram-demo-claims-summary::-webkit-details-marker {
  display: none;
}

.gram-demo-claims-count {
  margin-left: auto;
  font-weight: 400;
}

.gram-demo-table tr {
  transition: background 0.15s ease;
}

.gram-demo-table tr.selected {
  background: rgba(56, 189, 248, 0.12);
  box-shadow: inset 3px 0 0 rgba(56, 189, 248, 0.75);
}

.gram-demo-filter.is-active {
  box-shadow: inset 0 -2px 0 rgba(56, 189, 248, 0.85);
}

@media (max-width: 1100px) {
  .gram-demo-kpi-main {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }

  .gram-demo-field-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gram-demo-detail-enter .gram-demo-detail-panel {
    animation: none !important;
  }
}

.gram-demo-limits {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gram-demo-limit-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid rgba(56, 189, 248, 0.22);
  background: rgba(21, 34, 56, 0.45);
}

html:not(.theme-dark) .gram-demo-limit-chip {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(148, 163, 184, 0.35);
}

.gram-demo-layout {
  align-items: start;
}

.gram-demo-main-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.gram-demo-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.gram-demo-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.gram-demo-filter {
  border: 1px solid rgba(56, 189, 248, 0.18);
  background: rgba(15, 23, 42, 0.35);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
}

html:not(.theme-dark) .gram-demo-filter {
  background: rgba(255, 255, 255, 0.65);
}

.gram-demo-filter:hover,
.gram-demo-filter.is-active {
  color: var(--text-primary);
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(56, 189, 248, 0.12);
}

.gram-demo-uid-jump {
  width: 140px;
  min-width: 120px;
}

.gram-demo-detail-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.gram-demo-detail-section {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(56, 189, 248, 0.12);
}

.gram-demo-detail-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.gram-demo-section-hint {
  margin: 0 0 10px;
  font-size: 12px;
}

.gram-demo-detail-note {
  margin: 10px 0 0;
  min-height: 18px;
}

.gram-admin-bc-buttons {
  margin: 12px 0;
}

.gram-admin-bc-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.gram-admin-bc-btn-row .gram-input:first-child {
  flex: 1 1 160px;
}

.gram-admin-bc-btn-row .gram-input:nth-child(2) {
  width: 120px;
}

.gram-inbox-layout {
  align-items: stretch;
  min-height: 420px;
}

.gram-inbox-sidebar {
  min-width: 0;
}

.gram-inbox-threads {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 480px;
  overflow-y: auto;
}

.gram-inbox-thread {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(56, 189, 248, 0.14);
  background: rgba(15, 23, 42, 0.35);
  color: inherit;
  cursor: pointer;
}

html:not(.theme-dark) .gram-inbox-thread {
  background: rgba(255, 255, 255, 0.72);
}

.gram-inbox-thread.is-active,
.gram-inbox-thread:hover {
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(56, 189, 248, 0.1);
}

.gram-inbox-thread-name {
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.gram-inbox-thread-preview {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.gram-inbox-thread-time {
  font-size: 11px;
  color: var(--text-muted);
}

.gram-inbox-unread {
  display: inline-flex;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.85);
  color: #fff;
  font-size: 11px;
  align-items: center;
  justify-content: center;
}

.gram-inbox-chat {
  display: flex;
  flex-direction: column;
  min-height: 420px;
}

.gram-inbox-chat-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(56, 189, 248, 0.12);
}

.gram-inbox-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 240px;
  max-height: 420px;
  margin-bottom: 12px;
}

.gram-inbox-msg {
  max-width: 88%;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 13px;
}

.gram-inbox-msg.is-in {
  align-self: flex-start;
  background: rgba(51, 65, 85, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.gram-inbox-msg.is-out {
  align-self: flex-end;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.28);
}

.gram-inbox-msg-meta {
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.gram-inbox-compose {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
}

.gram-inbox-compose textarea {
  flex: 1 1 100%;
  min-height: 72px;
}

.gram-inbox-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

/* ── Admin premium glass v2 (GramGPT-style) ── */
@keyframes gramAdminFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes gramDemoDetailIn {
  from {
    opacity: 0;
    transform: translateX(12px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes gramAdminTabGlow {
  0%,
  100% {
    box-shadow:
      0 0 0 1px rgba(99, 102, 241, 0.35),
      0 6px 20px rgba(99, 102, 241, 0.35),
      0 0 28px rgba(99, 102, 241, 0.22);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(129, 140, 248, 0.45),
      0 8px 26px rgba(99, 102, 241, 0.42),
      0 0 40px rgba(56, 189, 248, 0.18);
  }
}

@keyframes gramAdminRefreshPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.35);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(56, 189, 248, 0);
  }
}

.gram-admin-body.gram-admin-enter {
  animation: gramAdminFadeIn 0.38s ease-out both;
}

.gram-admin-body.gram-admin-enter .gram-gpt-window,
.gram-admin-body.gram-admin-enter .gram-admin-card,
.gram-admin-body.gram-admin-enter .stat-card.gram-admin-stat {
  animation: gramAdminFadeIn 0.42s ease-out both;
}

.gram-admin-body.gram-admin-enter .acc-stats-grid > .stat-card:nth-child(1) { animation-delay: 0.03s; }
.gram-admin-body.gram-admin-enter .acc-stats-grid > .stat-card:nth-child(2) { animation-delay: 0.06s; }
.gram-admin-body.gram-admin-enter .acc-stats-grid > .stat-card:nth-child(3) { animation-delay: 0.09s; }
.gram-admin-body.gram-admin-enter .acc-stats-grid > .stat-card:nth-child(4) { animation-delay: 0.12s; }
.gram-admin-body.gram-admin-enter .acc-stats-grid > .stat-card:nth-child(5) { animation-delay: 0.15s; }
.gram-admin-body.gram-admin-enter .acc-stats-grid > .stat-card:nth-child(6) { animation-delay: 0.18s; }

.gram-admin-page.gram-admin-glass .gram-gpt-window:hover,
.gram-admin-page.gram-admin-glass .gram-admin-card:hover {
  border-color: rgba(56, 189, 248, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 0 1px rgba(56, 189, 248, 0.14),
    0 16px 44px rgba(2, 8, 23, 0.26),
    0 0 64px rgba(56, 189, 248, 0.1);
}

.gram-admin-page .gram-admin-refresh:hover {
  animation: gramAdminRefreshPulse 1.6s ease-out infinite;
}

.gram-admin-page .gram-admin-seg,
.gram-admin-page .gram-demo-filter,
.gram-admin-page .gram-admin-tab {
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.gram-admin-page .gram-admin-seg:hover,
.gram-admin-page .gram-demo-filter:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.12);
}

.gram-admin-page .p-btn-primary {
  box-shadow: 0 4px 18px rgba(99, 102, 241, 0.28);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.gram-admin-page .p-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(99, 102, 241, 0.38);
}

#adminMenuGroup {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 0 24px rgba(56, 189, 248, 0.04),
    0 8px 32px rgba(2, 8, 23, 0.18),
    0 0 40px rgba(56, 189, 248, 0.06);
}

html.theme-dark #adminMenuGroup {
  background: rgba(21, 34, 56, 0.68);
  backdrop-filter: blur(16px) saturate(1.12);
  -webkit-backdrop-filter: blur(16px) saturate(1.12);
}

#adminMenuGroup .menu-item.active {
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.2),
    0 0 24px rgba(56, 189, 248, 0.14);
}

@media (prefers-reduced-motion: reduce) {
  .gram-admin-body.gram-admin-enter,
  .gram-admin-body.gram-admin-enter .gram-gpt-window,
  .gram-admin-body.gram-admin-enter .gram-admin-card,
  .gram-admin-body.gram-admin-enter .stat-card.gram-admin-stat,
  .gram-admin-tab.is-active,
  .gram-admin-page .gram-admin-refresh:hover {
    animation: none !important;
  }

  .gram-admin-page .stat-card.gram-admin-stat:hover,
  .gram-admin-page .gram-admin-seg:hover,
  .gram-admin-page .gram-demo-filter:hover,
  .gram-admin-page .p-btn-primary:hover {
    transform: none;
  }
}

.gram-admin-stats-tabs {
  display: flex;
  gap: 8px;
  margin: 16px 0 12px;
}

.gram-admin-stats-tab {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.2);
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.gram-admin-stats-tab.is-active {
  color: var(--text-primary);
  border-color: rgba(56, 189, 248, 0.55);
  background: rgba(56, 189, 248, 0.12);
}

.gram-admin-stats-charts {
  margin-bottom: 4px;
}

.gram-admin-kpi-click {
  cursor: pointer;
}

.gram-admin-kpi-click:hover {
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 4px 18px rgba(56, 189, 248, 0.12);
}

.gram-admin-kpi-click:focus-visible {
  outline: 2px solid rgba(56, 189, 248, 0.55);
  outline-offset: 2px;
}

.gram-admin-traffic-partner-fold {
  margin-top: 12px;
}

.gram-admin-traffic-partner-fold > summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.gram-admin-traffic-partner-grid {
  margin-top: 8px;
}

.gram-admin-bc-hint {
  margin: 0 0 8px;
  font-size: 12px;
}

.gram-demo-journey {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.55;
}

.gram-demo-journey-empty {
  margin: 0;
  font-size: 13px;
}

.gram-admin-bc-btn-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr auto;
  gap: 8px;
  margin-bottom: 8px;
}

@media (max-width: 900px) {
  .gram-admin-bc-btn-row {
    grid-template-columns: 1fr;
  }
}

/* Админ-хаб партнёров */
.gram-amb-admin-hub .gram-amb-admin-nav {
  flex-wrap: wrap;
}

.gram-amb-admin-hero .gram-amb-hub-period {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.gram-partners-split {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 16px;
  align-items: start;
}

.gram-partners-detail {
  padding: 16px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.35);
}

html:not(.theme-dark) .gram-partners-detail {
  background: rgba(255, 255, 255, 0.65);
  border-color: rgba(148, 163, 184, 0.35);
}

.gram-partners-row {
  cursor: pointer;
}

.gram-partners-row.is-selected td {
  background: rgba(139, 92, 246, 0.12);
}

.gram-partners-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
  align-items: center;
}

.gram-partners-funnel {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.gram-partners-funnel-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  justify-content: space-between;
  font-size: 0.92rem;
}

.gram-partners-funnel-row small {
  color: var(--text-muted, #94a3b8);
}

.gram-partners-timeline {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 0.9rem;
}

.gram-partners-contest {
  padding: 10px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.gram-partners-contest:last-child {
  border-bottom: none;
}

.gram-partners-lb {
  margin: 8px 0 0;
  padding-left: 18px;
}

@media (max-width: 960px) {
  .gram-partners-split {
    grid-template-columns: 1fr;
  }
}

/* Админ-хаб рассылок */
.gram-comms-hub .gram-comms-hub-nav {
  flex-wrap: wrap;
}

.gram-comms-hub-hero .gram-amb-hub-hero-inner {
  align-items: flex-start;
}

.gram-comms-kpi-row .gram-amb-hub-kpi {
  min-width: 120px;
}

.gram-comms-kpi-hint {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted, #94a3b8);
  margin-top: 2px;
}

.gram-comms-bot-grid {
  display: grid;
  gap: 10px;
}

.gram-comms-bot-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  cursor: pointer;
}

.gram-comms-bot-row.is-soon {
  opacity: 0.55;
  cursor: default;
}

.gram-comms-audience-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.gram-comms-audience-row.is-soon {
  opacity: 0.55;
}

.gram-comms-bot-actions {
  margin-top: 14px;
}

.gram-comms-seg-group {
  margin-bottom: 18px;
}

.gram-comms-seg-group h4 {
  margin: 0 0 8px;
  font-size: 0.92rem;
  color: var(--text-muted, #94a3b8);
}

.gram-comms-seg-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gram-comms-seg {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.25);
  color: inherit;
  cursor: pointer;
  font: inherit;
}

.gram-comms-seg.is-soon {
  opacity: 0.55;
  cursor: default;
}

.gram-comms-seg.is-live {
  border-color: rgba(139, 92, 246, 0.35);
}

.gram-comms-seg-fold {
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  padding-bottom: 10px;
}

.gram-comms-seg-fold summary {
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 8px;
  list-style: disclosure-closed;
}

.gram-comms-seg-fold[open] summary {
  list-style: disclosure-open;
}

.gram-comms-seg-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.gram-comms-seg-toolbar .gram-input {
  flex: 1;
  min-width: 200px;
}

.gram-comms-soon-note {
  margin-top: 12px;
  font-size: 0.85rem;
}

.gram-comms-create-split {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
  gap: 16px;
  align-items: start;
}

.gram-comms-var-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 8px;
}

.gram-comms-var-chip {
  font: inherit;
  font-size: 0.78rem;
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid rgba(139, 92, 246, 0.35);
  background: rgba(139, 92, 246, 0.12);
  color: inherit;
  cursor: pointer;
}

.gram-comms-var-chip:hover {
  background: rgba(139, 92, 246, 0.22);
}

.gram-comms-bc-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.gram-comms-layout-btns {
  display: flex;
  gap: 6px;
}

.gram-comms-preview-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.gram-comms-preview-device {
  margin: 0 auto;
}

.gram-comms-preview--phone {
  width: min(280px, 100%);
}

.gram-comms-preview--desktop {
  width: min(420px, 100%);
}

.gram-comms-preview-screen {
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.45);
  padding: 14px;
  min-height: 180px;
}

html:not(.theme-dark) .gram-comms-preview-screen {
  background: rgba(255, 255, 255, 0.85);
}

.gram-comms-preview-msg {
  font-size: 0.92rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.gram-comms-preview-keyboard {
  margin-top: 12px;
  display: grid;
  gap: 6px;
}

.gram-comms-preview-kb-row {
  display: grid;
  gap: 6px;
}

.gram-comms-preview-kb-row.cols-1 {
  grid-template-columns: 1fr;
}

.gram-comms-preview-kb-row.cols-2 {
  grid-template-columns: 1fr 1fr;
}

.gram-comms-preview-kb-row.cols-3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.gram-comms-preview-kb-btn {
  display: block;
  text-align: center;
  padding: 8px 6px;
  border-radius: 8px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  font-size: 0.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gram-comms-preview-note {
  margin-top: 10px;
  font-size: 0.82rem;
}

.gram-comms-camp-row {
  cursor: pointer;
}
.gram-comms-camp-row:hover td {
  background: rgba(0, 136, 204, 0.08);
}
.gram-comms-camp-row.is-selected td {
  background: rgba(0, 136, 204, 0.14);
  box-shadow: inset 3px 0 0 #0088cc;
}
.gram-comms-clickers-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
  margin-bottom: 10px;
}
.gram-comms-bc-presets {
  margin: 8px 0;
}

.gram-comms-saved-links-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.gram-comms-saved-links-row select {
  flex: 1;
  min-width: 180px;
}

.gram-comms-link-form {
  display: grid;
  gap: 10px;
  max-width: 520px;
}

@media (max-width: 960px) {
  .gram-comms-create-split {
    grid-template-columns: 1fr;
  }
}

.gram-comms-schedule-block {
  margin: 16px 0;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.gram-comms-schedule-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 8px 0 12px;
  font-size: 13px;
}

.gram-comms-ab-block {
  margin: 10px 0 14px;
}

.gram-comms-funnel-row {
  display: grid;
  grid-template-columns: 120px 56px 1fr;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 13px;
}

.gram-comms-funnel-bar {
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.gram-comms-funnel-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #3d8bfd, #6ea8fe);
}

.gram-comms-pn-form {
  display: grid;
  gap: 10px;
}

.gram-comms-pn-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(21, 34, 56, 0.96);
  border-bottom: 1px solid rgba(110, 168, 254, 0.35);
  font-size: 14px;
}

.gram-comms-pn-banner .gram-comms-pn-close {
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}

.gram-comms-an-row {
  cursor: pointer;
}

.gram-comms-an-row:hover td {
  background: rgba(255, 255, 255, 0.03);
}

/* Поиск каналов + База парсинга */
.gram-channel-search-page.gram-cs-glass,
.gram-parsing-base-page.gram-pb-glass {
  position: relative;
  padding: 4px 0 24px;
}

.gram-cs-glass::before,
.gram-pb-glass::before {
  content: "";
  position: absolute;
  inset: -40px 10% auto;
  height: 220px;
  background: radial-gradient(ellipse at center, rgba(34, 211, 238, 0.14), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.gram-cs-glass > *,
.gram-pb-glass > * {
  position: relative;
  z-index: 1;
}

/* Поиск каналов — glass на окнах GramModuleLayout (каркас как масслукинг) */
.gram-channel-search-page.gram-ml-glass .gram-gpt-window {
  border: 1px solid rgba(71, 100, 150, 0.32);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.06),
    0 8px 32px rgba(2, 8, 23, 0.18);
  overflow: visible;
}

html.theme-dark .gram-channel-search-page.gram-ml-glass .gram-gpt-window {
  background: #152238;
  border-color: rgba(56, 189, 248, 0.24);
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.1),
    0 8px 28px rgba(0, 0, 0, 0.35),
    0 0 24px rgba(56, 189, 248, 0.05);
}

html:not(.theme-dark) .gram-channel-search-page.gram-ml-glass .gram-gpt-window {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(148, 163, 184, 0.35);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.85),
    0 8px 32px rgba(15, 23, 42, 0.08),
    0 0 20px rgba(56, 189, 248, 0.06);
}

.gram-channel-search-page.gram-ml-glass .gram-gpt-window-head {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.1) 0%, rgba(15, 23, 42, 0.02) 100%);
  border-bottom-color: rgba(56, 189, 248, 0.16);
}

html:not(.theme-dark) .gram-channel-search-page.gram-ml-glass .gram-gpt-window-head {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.08) 0%, rgba(255, 255, 255, 0.45) 100%);
  border-bottom-color: rgba(148, 163, 184, 0.3);
}

.gram-channel-search-page.gram-ml-glass .gram-gpt-notice {
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 10px;
  background: rgba(14, 165, 233, 0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.gram-channel-search-page.gram-ml-glass .gram-mr-mode-card.gram-ml-mode-card {
  background: rgba(21, 34, 56, 0.72);
  border-color: rgba(56, 189, 248, 0.22);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow:
    inset 0 1px 0 rgba(56, 189, 248, 0.08),
    0 4px 18px rgba(2, 8, 23, 0.14);
}

html:not(.theme-dark) .gram-channel-search-page.gram-ml-glass .gram-mr-mode-card.gram-ml-mode-card {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(148, 163, 184, 0.35);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
}

/* Поиск каналов — карточки режима/целей как в массреакциях */
.gram-channel-search-page .gram-mr-mode-card {
  border-radius: 12px;
  padding: 14px;
  min-width: 0;
  border: 1px solid rgba(71, 100, 150, 0.28);
  background: rgba(15, 23, 42, 0.35);
  box-shadow: 0 4px 18px rgba(2, 8, 23, 0.14);
}

html:not(.theme-dark) .gram-channel-search-page .gram-mr-mode-card.gram-cs-mode-pick-card {
  background: #f8fafc;
  border-color: rgba(226, 232, 240, 0.95);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
}

/* Правая карточка «Фильтры» — розовое свечение как реакции в масслукинге */
.gram-channel-search-page .gram-cs-filters-card.gram-ml-story-react-card {
  border: 1px solid rgba(244, 114, 182, 0.35);
  background: linear-gradient(145deg, rgba(21, 34, 56, 0.95), rgba(30, 20, 40, 0.55));
  box-shadow: 0 0 0 1px rgba(244, 114, 182, 0.08);
}

html:not(.theme-dark) .gram-channel-search-page .gram-cs-filters-card.gram-ml-story-react-card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(253, 242, 248, 0.72));
  border-color: rgba(244, 114, 182, 0.42);
  box-shadow: 0 0 0 1px rgba(244, 114, 182, 0.12);
}

.gram-channel-search-page .gram-cs-filters-card.gram-ml-story-react-card.is-on {
  border-color: rgba(244, 114, 182, 0.5);
  box-shadow:
    0 0 0 1px rgba(244, 114, 182, 0.38),
    0 0 28px rgba(244, 114, 182, 0.2),
    0 8px 24px rgba(15, 23, 42, 0.12);
}

html:not(.theme-dark) .gram-channel-search-page .gram-cs-filters-card.gram-ml-story-react-card.is-on {
  border-color: rgba(236, 72, 153, 0.58);
  box-shadow:
    0 0 0 1px rgba(244, 114, 182, 0.48),
    0 0 36px rgba(244, 114, 182, 0.32),
    0 0 16px rgba(236, 72, 153, 0.18),
    0 8px 28px rgba(15, 23, 42, 0.1);
}

.gram-channel-search-page .gram-cs-filters-card .gram-mr-mode-head .gram-card-icon {
  background: linear-gradient(135deg, rgba(244, 114, 182, 0.25), rgba(236, 72, 153, 0.15));
}

.gram-channel-search-page .gram-cs-mode-grid {
  align-items: stretch;
  margin-bottom: 0;
}

.gram-channel-search-page .gram-mr-mode-card .gram-mr-mode-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Сегмент выбора режима — только 2 кнопки на всю ширину */
.gram-channel-search-page .gram-cs-mode-seg {
  margin-bottom: 0;
  flex-shrink: 0;
}

.gram-channel-search-page .gram-cs-mode-seg .gram-gpt-pill {
  flex: 1 1 calc(50% - 3px);
  justify-content: center;
  padding: 8px 12px;
  font-size: 12px;
  min-width: 0;
  text-align: center;
}

/* Контент под режимом — отделён линией как в масслукинге */
.gram-channel-search-page .gram-cs-mode-seg ~ [data-cs-mode-panel] {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(71, 100, 150, 0.22);
}

html:not(.theme-dark) .gram-channel-search-page .gram-cs-mode-seg ~ [data-cs-mode-panel] {
  border-top-color: rgba(148, 163, 184, 0.28);
}

.gram-channel-search-page .gram-mr-mode-card .gram-gpt-pill.active {
  background: linear-gradient(135deg, #22d3ee, #2563eb);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

html.theme-dark .gram-channel-search-page .gram-mr-mode-card .gram-gpt-pill.active {
  background: linear-gradient(135deg, #38bdf8, #3b82f6);
}

/* Поля с подписями внутри карточек */
.gram-channel-search-page .gram-mr-mode-card .gram-field-wrap {
  display: block;
  margin-bottom: 12px;
}

.gram-channel-search-page .gram-mr-mode-card .gram-field-wrap:last-child {
  margin-bottom: 0;
}

.gram-channel-search-page .gram-mr-mode-card .gram-gpt-field-title {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted, #94a3b8);
}

.gram-channel-search-page .gram-cs-kw-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.gram-channel-search-page .gram-cs-kw-tabs .gram-gpt-pill {
  flex: 1 1 calc(50% - 3px);
  justify-content: center;
  padding: 7px 10px;
  font-size: 12px;
}

/* Правая карточка «Фильтры» */
.gram-channel-search-page .gram-cs-filters-card .gram-gpt-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
}

.gram-channel-search-page .gram-cs-filter-group {
  margin-bottom: 12px;
}

.gram-channel-search-page .gram-cs-filter-hint {
  margin: 2px 0 8px;
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-muted, #94a3b8);
  opacity: 0.92;
}

.gram-channel-search-page .gram-cs-filters-card .gram-mr-mode-body {
  flex: 1;
}

.gram-channel-search-page .gram-cs-filters-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.gram-channel-search-page .gram-cs-filter-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(236, 72, 153, 0.18);
  background: rgba(236, 72, 153, 0.06);
}

html:not(.theme-dark) .gram-channel-search-page .gram-cs-filter-info {
  border-color: rgba(236, 72, 153, 0.22);
  background: rgba(236, 72, 153, 0.05);
}

.gram-channel-search-page .gram-cs-filter-info-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--text-secondary, #cbd5e1);
}

.gram-channel-search-page .gram-cs-filter-info-item i {
  margin-top: 1px;
  color: #22d3ee;
  font-size: 13px;
  flex-shrink: 0;
}

html:not(.theme-dark) .gram-channel-search-page .gram-cs-filter-info-item {
  color: #475569;
}

.gram-channel-search-page .gram-cs-filter-group:last-of-type {
  margin-bottom: 8px;
}

.gram-channel-search-page #csLimitPresets .gram-gpt-pill {
  flex: 0 1 calc(16.666% - 5px);
  min-width: 42px;
  justify-content: center;
  padding: 6px 6px;
  font-size: 11px;
}

.gram-channel-search-page #csCommentsFilter .gram-gpt-pill {
  flex: 1 1 calc(33.333% - 4px);
  justify-content: center;
  padding: 7px 8px;
  font-size: 12px;
}

.gram-channel-search-page .gram-cs-limit-input {
  margin-top: 8px;
  width: 100%;
}

.gram-channel-search-page .gram-cs-check-row {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 4px;
}

/* Сетка параметров — 4 карточки в одну строку */
.gram-channel-search-page .gram-ml-param-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.gram-channel-search-page .gram-ml-param-grid .gram-gpt-param-card {
  padding: 10px 11px;
  min-height: 0;
}

.gram-channel-search-page .gram-ml-param-grid .gram-gpt-param-head {
  gap: 6px;
  margin-bottom: 8px;
}

.gram-channel-search-page .gram-ml-param-grid .gram-gpt-param-label {
  min-height: 0;
  -webkit-line-clamp: 3;
  font-size: 10px;
  line-height: 1.3;
}

.gram-channel-search-page .gram-ml-param-grid .gram-gpt-param-icon {
  width: 24px;
  height: 24px;
  font-size: 11px;
}

.gram-channel-search-page .gram-ml-param-grid .gram-gpt-param-input {
  font-size: 13px;
  padding: 7px 9px;
}

.gram-channel-search-page.gram-ml-glass .gram-ml-param-grid .gram-gpt-param-card {
  border: 1px solid rgba(71, 100, 150, 0.32);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(2, 8, 23, 0.1);
}

html:not(.theme-dark) .gram-channel-search-page.gram-ml-glass .gram-ml-param-grid .gram-gpt-param-card {
  border-color: rgba(148, 163, 184, 0.35);
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06);
}

/* Кнопки результатов поиска — как на референсе, наш масштаб */
.gram-channel-search-page .gram-spam-results-btn {
  padding: 8px 14px;
  font-size: 12px;
  border-radius: 10px;
}

.gram-channel-search-page .gram-spam-results-btn.is-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
}

.gram-channel-search-page .gram-spam-results-btn.is-copy {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
}

.gram-channel-search-page .gram-spam-results-btn:hover {
  filter: brightness(1.08);
}

@media (max-width: 900px) {
  .gram-channel-search-page .gram-ml-param-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .gram-channel-search-page .gram-ml-param-grid {
    grid-template-columns: 1fr;
  }
}

.gram-channel-search-page.gram-ml-glass .gram-gpt-param-card {
  background: rgba(15, 23, 42, 0.2);
  border-color: rgba(71, 100, 150, 0.28);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

html:not(.theme-dark) .gram-channel-search-page.gram-ml-glass .gram-gpt-param-card {
  background: rgba(248, 250, 252, 0.85);
  border-color: rgba(148, 163, 184, 0.32);
}

.gram-channel-search-page.gram-ml-glass .gram-gpt-action-bar {
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(14, 165, 233, 0.1) 0%, rgba(15, 23, 42, 0.22) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.07);
}

html:not(.theme-dark) .gram-channel-search-page.gram-ml-glass .gram-gpt-action-bar {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96) 0%, rgba(241, 245, 249, 0.88) 100%);
  border-color: rgba(148, 163, 184, 0.35);
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.08);
}

.gram-channel-search-page.gram-ml-glass #channelSearchRunPanel.gram-spam-results-panel {
  border-color: rgba(56, 189, 248, 0.24);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.08),
    0 12px 36px rgba(2, 8, 23, 0.2);
}

html:not(.theme-dark) .gram-channel-search-page.gram-ml-glass #channelSearchRunPanel.gram-spam-results-panel {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.08);
}

.gram-channel-search-page .gram-cs-check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 10px;
}

.gram-channel-search-page .gram-cs-result-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
}

.gram-channel-search-page .gram-cs-result-item:hover {
  background: rgba(34, 211, 238, 0.08);
}

.gram-cs-head,
.gram-pb-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.gram-cs-head-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.gram-cs-mode-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.gram-cs-mode-tab {
  flex: 1;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.35);
  color: var(--text-muted, #94a3b8);
  border-radius: 12px;
  padding: 12px 14px;
  font-weight: 600;
  cursor: pointer;
}

.gram-cs-mode-tab.is-active {
  color: #fff;
  border-color: rgba(34, 211, 238, 0.55);
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.35), rgba(99, 102, 241, 0.28));
  box-shadow: 0 0 24px rgba(34, 211, 238, 0.18);
}

.gram-cs-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: 14px;
  margin-bottom: 14px;
}

@media (max-width: 960px) {
  .gram-cs-grid {
    grid-template-columns: 1fr;
  }
}

.gram-cs-card {
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(12px);
}

.gram-cs-card-glow {
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.12), 0 12px 40px rgba(14, 165, 233, 0.12);
}

.gram-cs-card-title {
  margin: 0;
  padding: 14px 16px 0;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.gram-cs-card-body {
  padding: 14px 16px 16px;
}

.gram-cs-kw-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.gram-cs-input-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.gram-cs-input-row .gram-input,
.gram-cs-textarea {
  flex: 1;
  min-height: 44px;
}

.gram-channel-search-page .gram-cs-field-title-row {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.gram-channel-search-page .gram-mr-mode-card .gram-field-wrap {
  overflow: visible;
}

/* Убрать стрелки-«черточки» у всех числовых полей модуля */
.gram-channel-search-page input[type="number"]::-webkit-outer-spin-button,
.gram-channel-search-page input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}

.gram-channel-search-page input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* Инфо-подсказка не должна обрезаться карточкой */
.gram-channel-search-page .gram-gpt-window-body,
.gram-channel-search-page .gram-mr-mode-card,
.gram-channel-search-page .gram-mr-mode-card .gram-mr-mode-body,
.gram-channel-search-page .gram-field-wrap,
.gram-channel-search-page [data-cs-mode-panel],
.gram-channel-search-page [data-cs-kw-panel] {
  overflow: visible;
}

.gram-channel-search-page .gram-field-wrap:has(.gram-info-tip:hover),
.gram-channel-search-page .gram-field-wrap:has(.gram-info-tip.is-open),
.gram-channel-search-page .gram-field-wrap:has(.gram-info-tip:focus-within) {
  position: relative;
  z-index: 80;
}

.gram-channel-search-page .gram-info-tip:hover,
.gram-channel-search-page .gram-info-tip.is-open,
.gram-channel-search-page .gram-info-tip:focus-within {
  z-index: 90;
}

.gram-channel-search-page .gram-info-tip-pop {
  z-index: 100;
  top: auto;
  bottom: calc(100% + 6px);
  right: auto;
  left: 0;
  transform: translateY(4px);
}

.gram-channel-search-page .gram-info-tip:hover .gram-info-tip-pop,
.gram-channel-search-page .gram-info-tip.is-open .gram-info-tip-pop,
.gram-channel-search-page .gram-info-tip:focus-within .gram-info-tip-pop {
  transform: translateY(0);
}

.gram-channel-search-page .gram-cs-prompt-textarea {
  height: 100px;
  min-height: 100px;
  max-height: 100px;
  resize: none;
}

.gram-channel-search-page .gram-cs-tag-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px dashed rgba(248, 113, 113, 0.45);
  background: rgba(248, 113, 113, 0.1);
  color: #f87171;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.gram-channel-search-page .gram-cs-tag-clear:hover {
  background: rgba(248, 113, 113, 0.18);
  border-color: rgba(248, 113, 113, 0.65);
}

html:not(.theme-dark) .gram-channel-search-page .gram-cs-tag-clear {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(254, 226, 226, 0.65);
  color: #dc2626;
}

.gram-channel-search-page .gram-cs-kw-textarea {
  height: 72px;
  min-height: 72px;
  max-height: 72px;
  resize: none;
}

.gram-channel-search-page .gram-cs-seed-textarea {
  flex: 1;
  height: 80px;
  min-height: 80px;
  max-height: 80px;
  resize: none;
}

.gram-channel-search-page .gram-cs-input-row .gram-cs-add-btn {
  flex-shrink: 0;
  align-self: stretch;
  min-width: 108px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  white-space: nowrap;
}

.gram-channel-search-page .gram-cs-seed-row {
  align-items: stretch;
}

.gram-cs-textarea {
  resize: vertical;
}

.gram-cs-tags-host {
  max-width: 100%;
  min-width: 0;
}

.gram-cs-tags {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  margin: 8px 0 12px;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  align-items: center;
  padding-bottom: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 189, 248, 0.35) transparent;
}

.gram-cs-tags::-webkit-scrollbar {
  height: 5px;
}

.gram-cs-tags::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.35);
}

.gram-cs-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.12);
  border: 1px solid rgba(34, 211, 238, 0.25);
  font-size: 12px;
  flex-shrink: 0;
  white-space: nowrap;
}

.gram-cs-tag-rm {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.gram-cs-tag.is-suggestion {
  cursor: pointer;
  border-style: dashed;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.gram-cs-tag.is-suggestion:hover {
  background: rgba(34, 211, 238, 0.22);
  border-color: rgba(34, 211, 238, 0.45);
  transform: translateY(-1px);
}

.gram-cs-tag.is-suggestion.is-added {
  opacity: 0.55;
  cursor: default;
  transform: none;
}

.gram-cs-tag-add-hint {
  margin-left: 4px;
  font-size: 10px;
  opacity: 0.75;
}

.gram-cs-tag.is-kw {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.35);
  color: #86efac;
}

html:not(.theme-dark) .gram-cs-tag.is-kw {
  color: #166534;
  background: rgba(34, 197, 94, 0.12);
}

.gram-cs-clear-all-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 6px 10px;
  border: 1px solid rgba(248, 113, 113, 0.35);
  border-radius: 8px;
  background: rgba(248, 113, 113, 0.08);
  color: #fca5a5;
  font-size: 12px;
  cursor: pointer;
}

.gram-cs-clear-all-btn:hover {
  background: rgba(248, 113, 113, 0.16);
}

.gram-cs-range {
  width: 100%;
  accent-color: #22d3ee;
}

.gram-cs-gen-box {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(34, 211, 238, 0.2);
  background: rgba(15, 23, 42, 0.45);
}

html:not(.theme-dark) .gram-cs-gen-box {
  background: rgba(248, 250, 252, 0.9);
  border-color: rgba(14, 165, 233, 0.2);
}

.gram-cs-gen-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.gram-cs-gen-title {
  font-size: 13px;
  font-weight: 600;
}

.gram-cs-gen-lang {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 10px;
  background: rgba(34, 211, 238, 0.15);
}

.gram-cs-gen-all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  cursor: pointer;
}

.gram-cs-gen-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 220px;
  overflow-y: auto;
  margin-bottom: 12px;
  padding-right: 4px;
}

.gram-cs-gen-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.15);
  background: rgba(15, 23, 42, 0.35);
  cursor: pointer;
  font-size: 13px;
}

html:not(.theme-dark) .gram-cs-gen-item {
  background: rgba(255, 255, 255, 0.7);
}

.gram-cs-gen-item.is-exists {
  opacity: 0.65;
  cursor: default;
}

.gram-cs-gen-text {
  flex: 1;
  min-width: 0;
}

.gram-cs-gen-exists {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(250, 204, 21, 0.18);
  color: #fde047;
  white-space: nowrap;
}

html:not(.theme-dark) .gram-cs-gen-exists {
  color: #a16207;
}

.gram-cs-gen-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gram-cs-gen-actions .gram-cta {
  flex: 1;
  min-width: 140px;
  justify-content: center;
}

.gram-channel-search-page .gram-cs-activity-row .gram-gpt-pill,
.gram-chat-search-page .gram-cs-activity-row .gram-gpt-pill {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  padding: 8px 10px;
  white-space: nowrap;
}

.gram-channel-search-page .gram-cs-activity-row .gram-gpt-pill i,
.gram-chat-search-page .gram-cs-activity-row .gram-gpt-pill i {
  margin-right: 4px;
}

.gram-cs-results {
  border-radius: 16px;
  padding: 14px 16px;
}

.gram-cs-results-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.gram-cs-res-tab.is-active {
  color: #e2e8f0;
  background: rgba(34, 211, 238, 0.12);
}

.gram-cs-result-link {
  color: #22d3ee;
  font-weight: 600;
  text-decoration: none;
}

.gram-pb-total {
  margin-left: auto;
  text-align: center;
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px solid rgba(34, 211, 238, 0.25);
  background: rgba(15, 23, 42, 0.45);
}

.gram-pb-filter-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.gram-pb-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px;
}

/* База парсинга — glass как в поиске каналов (вариант 2) */
.gram-parsing-base-page.gram-pb-glass .panel-card {
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 14px;
  background: rgba(21, 34, 56, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow:
    inset 0 1px 0 rgba(56, 189, 248, 0.08),
    0 10px 32px rgba(2, 8, 23, 0.18);
  padding: 16px;
  margin-bottom: 16px;
}

html.theme-dark .gram-parsing-base-page.gram-pb-glass .panel-card {
  background: #152238;
}

html:not(.theme-dark) .gram-parsing-base-page.gram-pb-glass .panel-card {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(148, 163, 184, 0.35);
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.08);
}

.gram-parsing-base-page .gram-pb-filter-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
}

.gram-parsing-base-page .gram-pb-filter-grid label > span {
  font-weight: 600;
  color: var(--text-muted, #94a3b8);
}

.gram-parsing-base-page .gram-pb-filter-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.gram-parsing-base-page .gram-pb-total strong {
  display: block;
  font-size: 20px;
  color: #22d3ee;
}

.gram-parsing-base-page .gram-pb-total span {
  font-size: 11px;
  color: var(--text-muted, #94a3b8);
}

html:not(.theme-dark) .gram-parsing-base-page .gram-pb-total {
  background: rgba(255, 255, 255, 0.7);
  border-color: rgba(148, 163, 184, 0.35);
}

.gram-parsing-base-page .gram-pb-mod,
.gram-parsing-base-page .gram-pb-type {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  background: rgba(34, 211, 238, 0.12);
  border: 1px solid rgba(34, 211, 238, 0.22);
}

.gram-parsing-base-page .gram-pb-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 32px;
  color: var(--text-muted, #94a3b8);
}

.gram-parsing-base-page .gram-pb-empty i {
  font-size: 28px;
  color: #0088cc;
}

.gram-parsing-base-page.gram-parsing-page--users .gram-pb-glass::before {
  background: radial-gradient(ellipse at center, rgba(0, 136, 204, 0.16), transparent 70%);
}

.gram-parsing-base-page.gram-parsing-page--users .gram-pb-total strong {
  color: #0088cc;
}

.gram-parsing-base-page.gram-parsing-page--users .gram-pb-mod,
.gram-parsing-base-page.gram-parsing-page--users .gram-pb-type {
  background: rgba(0, 136, 204, 0.12);
  border-color: rgba(0, 136, 204, 0.24);
  color: #0088cc;
}

.gram-parsing-base-page.gram-parsing-page--users .gram-gpt-btn-primary {
  background: linear-gradient(135deg, #0088cc, #00aced) !important;
  border-color: rgba(0, 136, 204, 0.35) !important;
  color: #fff !important;
}

.gram-parsing-base-page.gram-gpt-layout {
  width: 100%;
  max-width: 100%;
  gap: 12px;
}

.gram-parsing-base-page .gram-gpt-notice {
  margin: 0;
}

.gram-parsing-base-page .gram-pb-stat-row.gram-run-stat-cards {
  grid-template-columns: minmax(140px, 220px);
  margin: 0;
  padding: 0;
  border-bottom: none;
}

.gram-parsing-base-page .gram-pb-stat-row .gram-run-stat-card.gram-tone-cyan .gram-run-stat-icon {
  background: linear-gradient(135deg, #0088cc, #00aced);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 136, 204, 0.24);
}

.gram-parsing-base-page .gram-pb-filters-window .gram-gpt-window-body,
.gram-parsing-base-page .gram-pb-table-window .gram-gpt-window-body {
  padding: 14px 16px 16px;
}

.gram-parsing-base-page .gram-pb-table-wrap {
  overflow-x: auto;
}

.gram-parsing-base-page .gram-pb-table-window .gram-gpt-window-body {
  padding-bottom: 10px;
}

.gram-parsing-base-page .gram-pb-pager {
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  margin-top: 8px;
  padding-top: 12px;
}

html.theme-dark .gram-parsing-base-page .gram-pb-pager {
  border-top-color: rgba(0, 136, 204, 0.12);
}

.gram-parsing-base-page.gram-parsing-page--users .gram-gpt-btn-success {
  background: linear-gradient(135deg, #22c55e, #16a34a) !important;
  color: #fff !important;
}

.gram-parsing-base-page .gram-pb-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.gram-parsing-base-page .gram-pb-head-copy {
  flex: 1;
  min-width: 0;
}

.gram-parsing-base-page .gram-pb-total {
  text-align: center;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid rgba(0, 136, 204, 0.22);
  background: rgba(0, 136, 204, 0.08);
}

.gram-parsing-base-page .gram-pb-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.gram-parsing-base-page .gram-pb-status-found {
  background: rgba(34, 197, 94, 0.14);
  color: #16a34a;
}

.gram-parsing-base-page .gram-pb-status-dead {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
}

.gram-parsing-base-page .gram-pb-status-pending {
  background: rgba(245, 158, 11, 0.14);
  color: #d97706;
}

.gram-parsing-base-page .gram-pb-link {
  color: #0088cc;
  text-decoration: none;
  word-break: break-word;
}

.gram-parsing-base-page .gram-pb-kw {
  max-width: 180px;
  word-break: break-word;
  font-size: 12px;
  color: #64748b;
}

.gram-parsing-base-page .gram-pb-actions {
  display: flex;
  gap: 6px;
}

.gram-parsing-base-page .gram-pb-act {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(255, 255, 255, 0.5);
  color: #0088cc;
  cursor: pointer;
  text-decoration: none;
}

.gram-parsing-base-page .gram-pb-empty-hint {
  font-size: 12px;
  color: #64748b;
}

html.theme-dark .gram-parsing-base-page .gram-pb-act {
  background: rgba(15, 23, 42, 0.6);
  border-color: rgba(56, 189, 248, 0.18);
  color: #38bdf8;
}

@media (max-width: 860px) {
  .gram-pb-filter-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .gram-pb-filter-grid {
    grid-template-columns: 1fr;
  }
}

.gram-parsing-base-page .gram-pb-mode-tabs {
  display: flex;
  gap: 8px;
  margin: 0 0 14px;
  flex-wrap: wrap;
}

.gram-parsing-base-page .gram-pb-mode-tab {
  border: 1px solid rgba(0, 136, 204, 0.28);
  background: rgba(0, 136, 204, 0.06);
  color: #0f172a;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.gram-parsing-base-page .gram-pb-mode-tab.active {
  background: linear-gradient(135deg, #0088cc, #00aced);
  border-color: transparent;
  color: #fff;
}

html.theme-dark .gram-parsing-base-page .gram-pb-mode-tab {
  color: #e2e8f0;
  background: rgba(56, 189, 248, 0.08);
  border-color: rgba(56, 189, 248, 0.22);
}

.gram-parsing-base-page .gram-pb-list-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.gram-parsing-base-page .gram-pb-list-tab {
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(248, 250, 252, 0.9);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
}

.gram-parsing-base-page .gram-pb-list-tab em {
  font-style: normal;
  opacity: 0.65;
  margin-left: 4px;
}

.gram-parsing-base-page .gram-pb-list-tab.active {
  border-color: rgba(0, 136, 204, 0.45);
  background: rgba(0, 136, 204, 0.12);
  color: #0088cc;
  font-weight: 600;
}

html.theme-dark .gram-parsing-base-page .gram-pb-list-tab {
  background: rgba(15, 23, 42, 0.7);
  border-color: rgba(148, 163, 184, 0.25);
  color: #e2e8f0;
}

.gram-parsing-base-page .gram-pb-list-manage-actions,
.gram-parsing-base-page .gram-pb-to-list-bar,
.gram-parsing-base-page .gram-pb-add-manual {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
  margin-top: 12px;
}

.gram-parsing-base-page .gram-pb-add-manual {
  align-items: stretch;
  flex-direction: column;
}

.gram-parsing-base-page .gram-pb-add-manual .gram-pb-q,
.gram-parsing-base-page .gram-pb-to-list-bar .gram-input {
  flex: 1;
  min-width: 180px;
}

.gram-parsing-base-page .gram-pb-check {
  width: 36px;
  text-align: center;
}

.gram-parsing-base-page .gram-pb-list-tabs-empty {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 10px;
}

/* —— Checkout (панель + сайт) —— */
body.gram-checkout-open {
  overflow: hidden;
}

.gram-checkout-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px 32px;
  overflow-y: auto;
  background: rgba(2, 8, 23, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.gram-checkout-overlay[hidden] {
  display: none !important;
  pointer-events: none;
}

.gram-checkout-page-root {
  min-height: calc(100vh - 120px);
  padding: 24px 0 48px;
}

.gram-checkout-shell {
  width: min(980px, 100%);
  margin: 0 auto;
  border-radius: 20px;
  border: 1px solid rgba(71, 100, 150, 0.35);
  background: linear-gradient(160deg, rgba(15, 23, 42, 0.96), rgba(10, 16, 30, 0.92));
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.08),
    0 24px 64px rgba(0, 0, 0, 0.45);
  padding: 22px 24px 24px;
}

html.theme-light .gram-checkout-shell {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96));
  border-color: rgba(148, 163, 184, 0.4);
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.12);
}

.gram-checkout-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.gram-checkout-back {
  border: 0;
  background: rgba(148, 163, 184, 0.12);
  color: inherit;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  cursor: pointer;
  margin-right: 4px;
}

.gram-checkout-brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(59, 130, 246, 0.18);
  color: #60a5fa;
}

.gram-checkout-brand-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.gram-checkout-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 20px;
  align-items: start;
}

.gram-checkout-title {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 700;
}

.gram-checkout-field {
  margin-bottom: 14px;
}

.gram-checkout-label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #94a3b8);
}

.gram-checkout-input {
  width: 100%;
}

.gram-checkout-hint,
.gram-checkout-promo-hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--text-muted, #94a3b8);
}

.gram-checkout-account {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.gram-checkout-product-kind {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.gram-checkout-product-kind-icon {
  color: #60a5fa;
  font-size: 16px;
}

.gram-checkout-product-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.gram-checkout-change {
  font-size: 12px;
  color: #60a5fa;
  text-decoration: none;
}

.gram-checkout-product-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(71, 100, 150, 0.28);
  background: rgba(15, 23, 42, 0.35);
}

html.theme-light .gram-checkout-product-card {
  background: rgba(248, 250, 252, 0.9);
  border-color: rgba(148, 163, 184, 0.35);
}

.gram-checkout-product-card-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.gram-checkout-product-card-main strong {
  font-size: 15px;
}

.gram-checkout-product-period {
  font-size: 12px;
  color: var(--text-muted, #94a3b8);
}

.gram-checkout-product-price {
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
}

.gram-checkout-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.gram-checkout-summary {
  border-radius: 16px;
  border: 1px solid rgba(71, 100, 150, 0.28);
  background: rgba(15, 23, 42, 0.42);
  padding: 14px;
}

html.theme-light .gram-checkout-summary {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(148, 163, 184, 0.35);
}

.gram-checkout-summary-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.gram-checkout-summary-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(59, 130, 246, 0.18);
  color: #60a5fa;
}

.gram-checkout-summary-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}

.gram-checkout-totals {
  margin: 0;
}

.gram-checkout-totals div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  font-size: 13px;
}

.gram-checkout-totals dt {
  margin: 0;
  color: var(--text-muted, #94a3b8);
  font-weight: 500;
}

.gram-checkout-totals dd {
  margin: 0;
  font-weight: 600;
}

.gram-checkout-fee dd {
  color: #fbbf24;
}

.gram-checkout-total {
  margin-top: 6px;
  padding-top: 8px !important;
  border-top: 1px solid rgba(71, 100, 150, 0.25);
}

.gram-checkout-total dd {
  font-size: 22px;
  color: #60a5fa;
}

.gram-checkout-pay-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gram-checkout-pay {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(71, 100, 150, 0.28);
  background: rgba(15, 23, 42, 0.28);
  color: inherit;
  text-align: left;
  cursor: pointer;
}

html.theme-light .gram-checkout-pay {
  background: rgba(255, 255, 255, 0.75);
  border-color: rgba(148, 163, 184, 0.35);
}

.gram-checkout-pay.is-active {
  border-color: rgba(59, 130, 246, 0.55);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.25), 0 0 20px rgba(59, 130, 246, 0.12);
}

.gram-checkout-pay.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.gram-checkout-pay-radio {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid rgba(148, 163, 184, 0.55);
  flex-shrink: 0;
}

.gram-checkout-pay.is-active .gram-checkout-pay-radio {
  border-color: #60a5fa;
  box-shadow: inset 0 0 0 4px #60a5fa;
}

.gram-checkout-pay-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.gram-checkout-pay-main strong {
  font-size: 13px;
}

.gram-checkout-pay-main small {
  font-size: 11px;
  color: var(--text-muted, #94a3b8);
}

.gram-checkout-pay-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 999px;
  white-space: nowrap;
}

.gram-checkout-pay-badge--warn {
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
}

.gram-checkout-pay-badge--ok {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}

.gram-checkout-terms {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted, #94a3b8);
  cursor: pointer;
}

.gram-checkout-terms input {
  margin-top: 2px;
}

.gram-checkout-terms a {
  color: #60a5fa;
}

.gram-checkout-submit {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
  box-shadow: 0 0 24px rgba(37, 99, 235, 0.35);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.gram-checkout-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

@media (max-width: 860px) {
  .gram-checkout-grid {
    grid-template-columns: 1fr;
  }
}

html.theme-light .gram-checkout-shell {
  color: #0f172a;
}

html.theme-light .gram-checkout-shell .gram-checkout-title,
html.theme-light .gram-checkout-shell .gram-checkout-account,
html.theme-light .gram-checkout-shell .gram-checkout-product-kind,
html.theme-light .gram-checkout-shell .gram-checkout-product-card-main strong,
html.theme-light .gram-checkout-shell .gram-checkout-pay-main strong,
html.theme-light .gram-checkout-shell .gram-checkout-summary-head h3,
html.theme-light .gram-checkout-shell .gram-checkout-brand-name {
  color: #0f172a;
}

html.theme-light .gram-checkout-shell .gram-checkout-label,
html.theme-light .gram-checkout-shell .gram-checkout-hint,
html.theme-light .gram-checkout-shell .gram-checkout-promo-hint,
html.theme-light .gram-checkout-shell .gram-checkout-product-period,
html.theme-light .gram-checkout-shell .gram-checkout-totals dt {
  color: #64748b;
}

html.theme-light .gram-checkout-shell .gram-checkout-input {
  color: #0f172a;
  background: #fff;
  border-color: rgba(148, 163, 184, 0.45);
}

html.theme-light .gram-checkout-shell .gram-checkout-product-price,
html.theme-light .gram-checkout-shell .gram-checkout-totals dd {
  color: #1e293b;
}

html.theme-light .gram-checkout-shell .gram-checkout-total dd {
  color: #2563eb;
}

.gram-neurocommenting-page #moduleLiveLog .gram-log-level-error .gram-log-msg {
  color: #b91c1c;
}

html.theme-dark .gram-neurocommenting-page #moduleLiveLog .gram-log-level-error .gram-log-msg {
  color: #fca5a5;
}

html.theme-dark .gram-neurocommenting-page #moduleLiveLog .gram-log-icon-error {
  color: #f87171;
}

.gram-nc-run-panel .gram-spam-result-msg.is-deleted {
  color: #dc2626;
  font-weight: 600;
}

html.theme-dark .gram-nc-run-panel .gram-spam-result-msg.is-deleted {
  color: #f87171;
}

.gram-nc-autosave-status {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  min-width: 92px;
  min-height: 38px;
  padding: 0 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted, #94a3b8);
  pointer-events: none;
}

.gram-nc-autosave-status.is-ok {
  color: #16a34a;
}

.gram-nc-autosave-status.is-err {
  color: #dc2626;
}

.gram-nc-action-bar {
  position: relative;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.gram-nc-action-bar-center {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.gram-nc-action-bar #panelLaunchBtn,
.gram-nc-action-bar #panelCancelBtn {
  flex: 0 1 auto;
  min-width: 220px;
  padding: 13px 32px;
  font-size: 15px;
  font-weight: 700;
}

.gram-module-page .gram-gpt-window,
.gram-neurocommenting-page.gram-nc-glass .gram-gpt-window,
.gram-neurocommenting-page.gram-nc-glass .gram-nc-mode-card:not(.gram-nc-comment-card),
.gram-neurocommenting-page.gram-nc-glass .gram-nc-prompt-card,
.gram-neurocommenting-page.gram-nc-glass .gram-gpt-param-card {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* === Парсер участников (вечер 11.07, эталон) === */

/* ——— Парсер участников (GramGPT layout) ——— */
.content-wrapper:has(.gram-parsing-page--users) {
  padding: 10px 16px 18px;
  display: flex;
  justify-content: center;
}

.content-glass:has(.gram-parsing-page--users) {
  padding: 12px 16px 18px;
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: linear-gradient(135deg, rgba(0, 136, 204, 0.016) 0%, rgba(124, 58, 237, 0.012) 25%, rgba(0, 136, 204, 0.012) 50%, rgba(0, 136, 204, 0.016) 75%, rgba(0, 136, 204, 0.012) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

html.theme-dark .content-glass:has(.gram-parsing-page--users) {
  background:
    radial-gradient(1100px 480px at 82% -12%, rgba(0, 136, 204, 0.1), transparent 60%),
    radial-gradient(840px 420px at 6% -8%, rgba(0, 136, 204, 0.07), transparent 58%),
    linear-gradient(180deg, #0a0f1a 0%, #070a12 100%);
  border-color: rgba(0, 136, 204, 0.12);
  box-shadow: none;
}

.gram-parsing-page--users.gram-gpt-layout {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  gap: 12px;
}

.gram-parsing-page--users .gram-gpt-form {
  gap: 12px;
}

.gram-parsing-page--users.gram-parsing-preset-page .gram-parsing-users-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.gram-parsing-page--users .gram-parsing-users-speed-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

@media (max-width: 980px) {
  .gram-parsing-page--users .gram-parsing-users-speed-row {
    grid-template-columns: 1fr;
  }
}

.gram-parsing-users-limit-in-groups {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
}

html.theme-dark .gram-parsing-users-limit-in-groups {
  border-top-color: rgba(148, 163, 184, 0.16);
}

.gram-parsing-page--users .gram-parsing-users-limit-in-groups .gram-parsing-limit-row {
  justify-content: flex-start;
  gap: 14px;
  margin: 0;
}

.gram-parsing-page--users .gram-parsing-users-limit-in-groups .gram-parsing-limit-copy {
  flex: 0 1 auto;
  max-width: calc(100% - 130px);
}

.gram-parsing-page--users .gram-parsing-users-col-left > .gram-gpt-window:last-child {
  margin-top: auto;
  flex: 0 0 auto;
  min-height: 138px;
}

.gram-parsing-page--users .gram-parsing-users-col-right > .gram-gpt-window:last-child {
  margin-top: auto;
  flex: 0 0 auto;
  min-height: 138px;
}

.gram-parsing-page--users .gram-parsing-acc-count {
  margin-left: 8px;
  background: rgba(255, 255, 255, 0.28);
  color: #fff;
}

html.theme-dark .gram-parsing-page--users .gram-parsing-acc-count {
  background: rgba(15, 23, 42, 0.35);
  color: #e2e8f0;
}

.gram-parsing-groups-count {
  margin-left: auto;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #0088cc;
  background: rgba(0, 136, 204, 0.1);
  border: 1px solid rgba(0, 136, 204, 0.22);
}

html.theme-dark .gram-parsing-groups-count {
  color: #00aced;
  background: rgba(0, 136, 204, 0.14);
  border-color: rgba(0, 136, 204, 0.24);
}

.gram-parsing-page--users .gram-gpt-window-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gram-parsing-page--users .gram-gpt-window-title {
  flex: 1;
  min-width: 0;
}

.gram-parsing-users-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  height: 100%;
}

.gram-parsing-filters-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  overflow: visible;
}

.gram-parsing-page--users .gram-parsing-filters-row > .gram-gpt-window:first-child,
.gram-parsing-page--users .gram-parsing-filters-row > .gram-gpt-window:first-child .gram-gpt-window-body {
  overflow: visible;
}

.gram-parsing-page--users .gram-parsing-filters-row {
  flex: 0 0 auto;
}

.gram-parsing-page--users .gram-parsing-filters-row > .gram-gpt-window {
  height: auto;
}

.gram-parsing-page--users .gram-parsing-users-col-right > .gram-gpt-window:has(.gram-parsing-story-row) {
  flex: 0 0 auto;
}

.gram-parsing-page--users.gram-ml-glass .gram-gpt-window {
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.05);
  overflow: visible;
  backdrop-filter: blur(12px) saturate(112%);
  -webkit-backdrop-filter: blur(12px) saturate(112%);
  transition: border-color 0.2s ease, border-style 0.2s ease, box-shadow 0.2s ease;
}

.gram-parsing-page--users.gram-ml-glass .gram-gpt-window:hover {
  border-color: rgba(0, 136, 204, 0.4);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

html.theme-dark .gram-parsing-page--users.gram-ml-glass .gram-gpt-window {
  background:
    linear-gradient(180deg, rgba(0, 136, 204, 0.06) 0%, rgba(0, 136, 204, 0) 100%),
    rgba(16, 23, 38, 0.42);
  border-color: rgba(0, 136, 204, 0.12);
  box-shadow:
    inset 0 1px 0 rgba(0, 136, 204, 0.06),
    0 22px 48px -32px rgba(2, 10, 25, 0.9);
  backdrop-filter: blur(12px) saturate(118%);
  -webkit-backdrop-filter: blur(12px) saturate(118%);
}

html.theme-dark .gram-parsing-page--users.gram-ml-glass .gram-gpt-window:hover {
  border-color: rgba(0, 136, 204, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(0, 136, 204, 0.1),
    0 24px 52px -28px rgba(2, 10, 25, 0.95);
}

.gram-parsing-page--users .gram-gpt-window-head {
  padding: 12px 14px;
  background: transparent !important;
  border-bottom-color: rgba(148, 163, 184, 0.18);
  box-shadow: none;
}

html.theme-dark .gram-parsing-page--users .gram-gpt-window-head {
  background: transparent !important;
  border-bottom-color: rgba(0, 136, 204, 0.1);
  box-shadow: none;
}

.gram-parsing-page--users .gram-gpt-window-head .gram-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 16px;
  background: linear-gradient(135deg, #0088cc, #00aced) !important;
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(0, 136, 204, 0.28);
}

.gram-parsing-page--users .gram-gpt-window-body {
  padding: 12px 14px 14px;
}

.gram-parsing-page--users .gram-gpt-accounts-bar {
  border: 1px solid rgba(0, 136, 204, 0.12);
  border-radius: 16px;
  background:
    radial-gradient(circle at top right, rgba(0, 136, 204, 0.08), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.88) 0%, rgba(248, 250, 252, 0.92) 100%);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.gram-parsing-page--users .gram-gpt-accounts-bar:hover {
  border-color: rgba(0, 136, 204, 0.35);
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.08);
}

html.theme-dark .gram-parsing-page--users .gram-gpt-accounts-bar {
  background:
    radial-gradient(circle at top right, rgba(0, 136, 204, 0.16), transparent 46%),
    linear-gradient(180deg, #101a28 0%, #0b1320 100%);
  border-color: rgba(0, 136, 204, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(120, 170, 255, 0.08),
    0 24px 60px -34px rgba(2, 10, 25, 0.95);
}

html.theme-dark .gram-parsing-page--users .gram-gpt-accounts-bar:hover {
  border-color: rgba(0, 136, 204, 0.5);
}

.gram-parsing-page--users .gram-gpt-window:has(.gram-gpt-templates) {
  border: 1px solid rgba(0, 136, 204, 0.12);
  border-radius: 16px;
  background:
    radial-gradient(circle at top right, rgba(0, 136, 204, 0.08), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.88) 0%, rgba(248, 250, 252, 0.92) 100%);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.05);
  backdrop-filter: blur(12px) saturate(112%);
  -webkit-backdrop-filter: blur(12px) saturate(112%);
}

html.theme-dark .gram-parsing-page--users .gram-gpt-window:has(.gram-gpt-templates) {
  background:
    radial-gradient(circle at top right, rgba(0, 136, 204, 0.16), transparent 46%),
    linear-gradient(180deg, #101a28 0%, #0b1320 100%);
  border-color: rgba(0, 136, 204, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(120, 170, 255, 0.08),
    0 24px 60px -34px rgba(2, 10, 25, 0.95);
}

.gram-parsing-page--users .gram-gpt-accounts-bar .gram-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, #0088cc, #00aced) !important;
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(0, 136, 204, 0.28);
}

.gram-parsing-groups-hint {
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 1.45;
  color: #64748b;
}

html.theme-dark .gram-parsing-groups-hint {
  color: #94a3b8;
}

.gram-parsing-page--users .gram-parsing-groups-field .gram-field-label {
  display: none;
}

.gram-parsing-page--users .gram-textarea-tall {
  min-height: 220px;
}

.gram-parsing-page--users .gram-input,
.gram-parsing-page--users .settings-textarea,
.gram-parsing-page--users .gram-textarea-tall,
.gram-parsing-page--users textarea {
  border-color: rgba(148, 163, 184, 0.35);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

html.theme-dark .gram-parsing-page--users .gram-input,
html.theme-dark .gram-parsing-page--users .settings-textarea,
html.theme-dark .gram-parsing-page--users .gram-textarea-tall,
html.theme-dark .gram-parsing-page--users textarea {
  border-color: rgba(96, 150, 220, 0.12);
  background: rgba(15, 23, 42, 0.45);
  color: #e2e8f0;
  box-shadow: inset 0 1px 0 rgba(120, 170, 255, 0.04);
}

.gram-parsing-page--users .gram-input:focus,
.gram-parsing-page--users .settings-textarea:focus,
.gram-parsing-page--users .gram-textarea-tall:focus,
.gram-parsing-page--users textarea:focus {
  outline: none;
  border-color: rgba(0, 136, 204, 0.55);
  box-shadow: 0 0 0 3px rgba(0, 136, 204, 0.14);
}

.gram-parsing-limit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.gram-parsing-limit-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.gram-parsing-limit-title {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
}

html.theme-dark .gram-parsing-limit-title {
  color: #e2e8f0;
}

.gram-parsing-limit-hint {
  font-size: 12px;
  line-height: 1.4;
  color: #64748b;
}

html.theme-dark .gram-parsing-limit-hint {
  color: #94a3b8;
}

.gram-parsing-limit-input {
  width: 108px;
  flex: 0 0 auto;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  text-align: right;
  color: #0f172a;
}

html.theme-dark .gram-parsing-limit-input {
  background: rgba(15, 23, 42, 0.55);
  border-color: rgba(56, 189, 248, 0.24);
  color: #e2e8f0;
}

.gram-parsing-filter-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: visible;
}

.gram-parsing-filter-check {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  min-height: 28px;
}

.gram-parsing-filter-check-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.gram-parsing-filter-check-box {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border-radius: 5px;
  border: 1.5px solid #cbd5e1;
  background: #fff;
  position: relative;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

html.theme-dark .gram-parsing-filter-check-box {
  background: rgba(15, 23, 42, 0.55);
  border-color: rgba(148, 163, 184, 0.45);
}

.gram-parsing-filter-check-input:checked + .gram-parsing-filter-check-box {
  background: #0088cc;
  border-color: #0088cc;
  box-shadow: 0 0 0 3px rgba(0, 136, 204, 0.18);
}

.gram-parsing-filter-check-input:checked + .gram-parsing-filter-check-box::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: 2px solid #fff;
  border-top: 0;
  border-left: 0;
  transform: rotate(45deg);
}

.gram-parsing-filter-check-label {
  font-size: 13px;
  line-height: 1.35;
  color: #334155;
}

html.theme-dark .gram-parsing-filter-check-label {
  color: #cbd5e1;
}

.gram-parsing-active-filter {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 1;
}

.gram-parsing-active-filter:has([data-parsing-activity-popover]:not([hidden])) {
  z-index: 700;
}

.gram-parsing-active-main {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
  cursor: pointer;
}

.gram-parsing-activity-gear {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(100, 116, 139, 0.35);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.04);
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
  position: relative;
  z-index: 2;
}

html.theme-dark .gram-parsing-activity-gear {
  background: rgba(148, 163, 184, 0.08);
  border-color: rgba(148, 163, 184, 0.25);
  color: #94a3b8;
}

.gram-parsing-activity-gear:hover {
  color: #0ea5e9;
  border-color: rgba(14, 165, 233, 0.45);
}

.gram-parsing-activity-popover.is-fixed.is-portaled {
  position: fixed !important;
  z-index: 10000 !important;
  right: auto !important;
  bottom: auto !important;
  box-shadow: 0 16px 40px rgba(2, 8, 23, 0.45);
}

.gram-parsing-activity-popover {
  position: absolute;
  left: 0;
  right: auto;
  top: auto;
  bottom: calc(100% + 8px);
  z-index: 800;
  min-width: 280px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(100, 116, 139, 0.28);
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
}

html.theme-dark .gram-parsing-activity-popover {
  background: #1e293b;
  border-color: rgba(148, 163, 184, 0.22);
}

.gram-parsing-activity-popover-title {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 8px;
}

.gram-parsing-activity-mode-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 220px;
  overflow: auto;
}

.gram-parsing-activity-mode-opt {
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  color: #334155;
  cursor: pointer;
}

html.theme-dark .gram-parsing-activity-mode-opt {
  color: #e2e8f0;
}

.gram-parsing-activity-mode-opt:hover {
  background: rgba(14, 165, 233, 0.08);
}

.gram-parsing-activity-mode-opt.is-active {
  background: rgba(14, 165, 233, 0.12);
  color: #0284c7;
  font-weight: 600;
}

.gram-parsing-activity-mode-opt.is-active::before {
  content: "✓ ";
  font-size: 11px;
  opacity: 0.85;
}

.gram-parsing-activity-current {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(100, 116, 139, 0.2);
  font-size: 11px;
  color: #64748b;
}

.gram-parsing-page--users #moduleLiveLog .gram-log-parsing-toolbar {
  justify-content: flex-start;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  background: transparent;
}

html:not(.theme-dark) .gram-parsing-page--users #moduleLiveLog .gram-log-parsing-toolbar {
  background: transparent;
  border-bottom-color: rgba(148, 163, 184, 0.2);
}

html.theme-dark .gram-parsing-page--users #moduleLiveLog .gram-log-parsing-toolbar {
  background: rgba(15, 23, 42, 0.35);
  border-bottom-color: rgba(148, 163, 184, 0.16);
}

.gram-parsing-page--users #moduleLiveLog .gram-log-parsing-toolbar .gram-spam-results-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-start;
  margin-left: 0;
  margin-right: auto;
  width: auto;
}

.gram-parsing-page--users #moduleLiveLog .gram-spam-results-btn {
  padding: 10px 16px;
  font-size: 13px;
  border-radius: 10px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: #fff !important;
  border: none;
  white-space: nowrap;
  line-height: 1.2;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.18);
}

.gram-parsing-page--users #moduleLiveLog .gram-spam-results-btn.is-copy {
  background: linear-gradient(135deg, #0088cc, #00aced) !important;
  box-shadow: 0 4px 14px rgba(0, 136, 204, 0.28);
}

.gram-parsing-page--users #moduleLiveLog .gram-spam-results-btn.is-export {
  background: linear-gradient(135deg, #22c55e, #16a34a) !important;
  box-shadow: 0 4px 14px rgba(34, 197, 94, 0.24);
}

.gram-parsing-page--users #moduleLiveLog .gram-spam-results-btn:hover:not(:disabled) {
  filter: brightness(1.08);
}

.gram-parsing-page--users #moduleLiveLog .gram-spam-results-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.gram-parsing-page--users #moduleLiveLog .gram-log-export-wrap {
  position: relative;
}

.gram-parsing-page--users #moduleLiveLog .gram-log-export-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 210px;
  padding: 6px;
  border-radius: 12px;
  background: #1e293b;
  border: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow: 0 14px 32px rgba(2, 8, 23, 0.45);
  z-index: 40;
}

html:not(.theme-dark) .gram-parsing-page--users #moduleLiveLog .gram-log-export-menu {
  background: #0f172a;
  border-color: rgba(148, 163, 184, 0.35);
}

.gram-parsing-page--users #moduleLiveLog .gram-log-export-menu button {
  width: 100%;
  border: 0;
  background: transparent;
  color: #e2e8f0 !important;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
}

.gram-parsing-page--users #moduleLiveLog .gram-log-export-menu button:hover:not(:disabled) {
  background: rgba(59, 130, 246, 0.16);
  color: #fff !important;
}

.gram-parsing-page--users #moduleLiveLog .gram-log-export-caret {
  font-size: 11px;
  opacity: 0.9;
}

.gram-parsing-page--users #moduleLiveLog .gram-log-footer {
  align-items: center;
}

.gram-parsing-activity-popover.is-fixed {
  position: fixed !important;
  z-index: 9999 !important;
  right: auto !important;
  bottom: auto !important;
}

.gram-parsing-filter-check-label--premium {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1.35;
}

.gram-parsing-premium-star {
  font-size: 12px;
  line-height: 1;
  flex: 0 0 auto;
}

.gram-parsing-premium-word {
  font-weight: 600;
  color: #0088cc;
}

html.theme-dark .gram-parsing-premium-word {
  color: #00aced;
}

.gram-parsing-story-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.gram-parsing-story-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.gram-parsing-story-title {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
}

html.theme-dark .gram-parsing-story-title {
  color: #e2e8f0;
}

.gram-parsing-story-hint {
  font-size: 12px;
  line-height: 1.4;
  color: #64748b;
}

html.theme-dark .gram-parsing-story-hint {
  color: #94a3b8;
}

.gram-parsing-story-toggle {
  flex: 0 0 auto;
}

.gram-parsing-page--users .gram-parsing-story-toggle .gram-gpt-toggle-track {
  width: 44px;
  height: 24px;
}

.gram-parsing-page--users .gram-parsing-story-toggle .gram-gpt-toggle-thumb {
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
}

.gram-parsing-page--users .gram-parsing-story-toggle.gram-gpt-toggle:has(input:checked) .gram-gpt-toggle-track {
  background: linear-gradient(135deg, #0088cc, #0077b3);
}

.gram-parsing-page--users .gram-parsing-story-toggle.gram-gpt-toggle:has(input:checked) .gram-gpt-toggle-thumb {
  transform: translateX(20px);
}

.gram-parsing-sliders {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.gram-parsing-page--users .gram-parsing-slider-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.gram-parsing-page--users .gram-parsing-slider-label {
  font-size: 12px;
  font-weight: 500;
  color: #334155;
}

html.theme-dark .gram-parsing-page--users .gram-parsing-slider-label {
  color: #cbd5e1;
}

.gram-parsing-page--users .gram-parsing-slider-value {
  font-size: 12px;
  font-weight: 700;
  color: #0088cc;
  font-variant-numeric: tabular-nums;
}

html.theme-dark .gram-parsing-page--users .gram-parsing-slider-value {
  color: #00aced;
}

.gram-parsing-page--users .gram-parsing-slider-track {
  position: relative;
  height: 5px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.25);
}

html.theme-dark .gram-parsing-page--users .gram-parsing-slider-track {
  background: rgba(51, 65, 85, 0.75);
}

.gram-parsing-page--users .gram-parsing-slider-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #0088cc 0%, #00aced 100%);
  pointer-events: none;
}

.gram-parsing-page--users .gram-parsing-slider-input {
  position: absolute;
  inset: -6px 0;
  width: 100%;
  margin: 0;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.gram-parsing-page--users .gram-parsing-slider-input::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid #fff;
  background: #00aced;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.22);
}

.gram-parsing-page--users .gram-parsing-slider-input::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid #fff;
  background: #00aced;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.22);
}

@media (max-width: 980px) {
  .gram-parsing-page--users.gram-parsing-preset-page .gram-parsing-users-grid,
  .gram-parsing-filters-row {
    grid-template-columns: 1fr;
  }
}

.gram-parsing-page--users .gram-parsing-users-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 8px 0 4px;
  min-height: 52px;
}

.gram-parsing-page--users .gram-parsing-launch-btn {
  min-width: 220px;
  padding: 14px 28px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #0088cc, #00aced) !important;
  color: #fff !important;
  box-shadow:
    0 8px 24px rgba(0, 136, 204, 0.38),
    0 0 28px rgba(0, 172, 237, 0.22);
  transition: filter 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.gram-parsing-page--users .gram-parsing-launch-btn:hover {
  filter: brightness(1.06);
  box-shadow:
    0 12px 32px rgba(0, 136, 204, 0.4),
    0 0 28px rgba(0, 136, 204, 0.18);
}

.gram-parsing-page--users .gram-parsing-users-actions #panelCancelBtn:not([hidden]) {
  min-width: 220px;
  padding: 14px 28px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 12px;
}

.gram-parsing-page--users .dist-box-editable {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.gram-parsing-page--users .gram-gpt-dist-grid {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: visible;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  margin-top: 8px;
  gap: 8px;
  padding-bottom: 4px;
}

.gram-parsing-page--users .gram-gpt-dist-grid .dist-box {
  flex: 0 0 180px;
  min-width: 160px;
  max-width: 180px;
  max-height: 128px;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

html.theme-dark .gram-parsing-page--users .gram-gpt-dist-grid .dist-box {
  border-color: rgba(0, 136, 204, 0.12);
  background:
    linear-gradient(180deg, rgba(0, 136, 204, 0.06) 0%, rgba(0, 136, 204, 0) 100%),
    rgba(16, 23, 38, 0.55);
  box-shadow:
    inset 0 1px 0 rgba(0, 136, 204, 0.06),
    0 16px 36px -28px rgba(2, 10, 25, 0.9);
}

.gram-parsing-page--users .dist-box-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.gram-parsing-page--users .dist-box-head h4 {
  margin: 0;
  min-width: 0;
  font-size: 10px;
}

.gram-parsing-page--users .dist-box-edit-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.06);
  color: #64748b;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

html.theme-dark .gram-parsing-page--users .dist-box-edit-btn {
  border-color: rgba(56, 189, 248, 0.24);
  color: #94a3b8;
  background: rgba(15, 23, 42, 0.35);
}

.gram-parsing-page--users .dist-box-edit-btn:hover {
  border-color: #0088cc;
  color: #0088cc;
  background: rgba(0, 136, 204, 0.1);
}

.gram-parsing-page--users .dist-box-ta {
  width: 100%;
  height: 48px;
  min-height: 48px;
  max-height: 48px;
  resize: none;
  overflow-y: auto;
  padding: 4px 5px;
  border-radius: 7px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(255, 255, 255, 0.88);
  font-size: 9px;
  line-height: 1.3;
  font-family: inherit;
  color: #0f172a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.gram-parsing-page--users .dist-box-ta[readonly] {
  cursor: default;
  opacity: 0.88;
}

.gram-parsing-page--users .dist-box-ta.is-editing,
.gram-parsing-page--users .dist-box-ta:focus {
  opacity: 1;
  outline: none;
  border-color: rgba(0, 136, 204, 0.55);
  box-shadow: 0 0 0 3px rgba(0, 136, 204, 0.14);
}

html.theme-dark .gram-parsing-page--users .dist-box-ta {
  background: rgba(15, 23, 42, 0.45);
  border-color: rgba(96, 150, 220, 0.12);
  color: #e2e8f0;
  box-shadow: inset 0 1px 0 rgba(120, 170, 255, 0.04);
}

.gram-parsing-page--users .gram-parsing-live-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0 16px;
}

.gram-parsing-live-stat {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.3);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

html.theme-dark .gram-parsing-live-stat {
  background: rgba(30, 41, 59, 0.6);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow:
    inset 0 1px 0 rgba(120, 170, 255, 0.06),
    0 22px 48px -32px rgba(2, 10, 25, 0.9);
  backdrop-filter: blur(12px) saturate(118%);
  -webkit-backdrop-filter: blur(12px) saturate(118%);
}

.gram-parsing-live-stat-icon {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

.gram-parsing-live-stat-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.gram-parsing-live-stat-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
}

html.theme-dark .gram-parsing-live-stat-label {
  color: #94a3b8;
}

.gram-parsing-live-stat-value {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: #0f172a;
}

html.theme-dark .gram-parsing-live-stat-value {
  color: #f1f5f9;
}

.gram-parsing-live-stat--collected .gram-parsing-live-stat-value {
  color: #0088cc;
}

html.theme-dark .gram-parsing-live-stat--collected .gram-parsing-live-stat-value {
  color: #00aced;
}

@media (max-width: 720px) {
  .gram-parsing-page--users .gram-parsing-live-stats {
    grid-template-columns: 1fr;
  }
}

.gram-parsing-page--users .gram-log-panel--parsing-users {
  margin-top: 0;
}

.gram-parsing-page--users .gram-log-panel--parsing-users .gram-log-thread-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(248, 250, 252, 0.72);
  overflow-x: auto;
}

html.theme-dark .gram-parsing-page--users .gram-log-panel--parsing-users .gram-log-thread-row {
  background: #111820;
  border-bottom-color: rgba(51, 65, 85, 0.65);
}

.gram-parsing-page--users .gram-log-panel--parsing-users .gram-log-thread-row .gram-log-threads {
  display: flex;
  flex-wrap: nowrap;
  max-width: none;
  width: 100%;
  gap: 4px;
}

.gram-parsing-page--users .gram-log-panel--parsing-users .gram-log-filters--parsing .gram-log-filter {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.gram-parsing-page--users .gram-log-panel--parsing-users .gram-log-line--parsing {
  grid-template-columns: 52px 34px 14px minmax(96px, 168px) minmax(0, 1fr);
  gap: 4px 8px;
  align-items: center;
}

.gram-parsing-page--users .gram-log-panel--parsing-users .gram-log-thread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  padding: 1px 6px;
  border-radius: 6px;
  border: 1px solid rgba(14, 165, 233, 0.24);
  background: rgba(14, 165, 233, 0.08);
  color: #0284c7;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}

.gram-parsing-page--users .gram-log-panel--parsing-users .gram-log-thread-badge.is-empty {
  visibility: hidden;
}

html.theme-dark .gram-parsing-page--users .gram-log-panel--parsing-users .gram-log-thread-badge {
  border-color: rgba(56, 189, 248, 0.28);
  background: rgba(56, 189, 248, 0.1);
  color: #38bdf8;
}

.gram-parsing-page--users .gram-log-panel--parsing-users .gram-log-pill.gram-log-id {
  max-width: 168px;
}

.gram-parsing-page--users .gram-log-panel--parsing-users .gram-log-row-ok {
  background: rgba(34, 197, 94, 0.08);
}

html.theme-dark .gram-parsing-page--users .gram-log-panel--parsing-users .gram-log-row-ok {
  background: rgba(34, 197, 94, 0.12);
}

.gram-parsing-page--users .gram-log-panel--parsing-users .gram-log-stats--parsing {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.gram-parsing-page--users .gram-log-panel--parsing-users .gram-log-stream {
  min-height: 220px;
  max-height: min(46vh, 420px);
  overflow-anchor: none;
}

.gram-parsing-filter-hint {
  margin: -8px 0 14px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.45;
  color: #92400e;
  background: rgba(251, 191, 36, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.28);
}

html.theme-dark .gram-parsing-filter-hint {
  color: #fcd34d;
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(251, 191, 36, 0.22);
}

.gram-parsing-filter-hint[hidden] {
  display: none !important;
}

.gram-parsing-page--users .gram-log-panel--parsing-users .gram-log-thread-group {
  margin-left: 2px;
}

@media (max-width: 720px) {
  .gram-parsing-page--users .gram-log-panel--parsing-users .gram-log-line--parsing {
    grid-template-columns: 48px 30px 12px minmax(72px, 120px) minmax(0, 1fr);
  }
}

/* Модалка выбора аккаунтов — стекло из AccountsPicker / PanelModalShell */
html:has(.gram-parsing-page--users) .panel-modal-overlay {
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  background: rgba(2, 6, 23, 0.72);
}

html:has(.gram-parsing-page--users) .panel-modal-card.gram-modal-card,
html:has(.gram-parsing-page--users) .panel-modal-card.gram-modal-picker {
  border: 1px solid rgba(0, 136, 204, 0.22);
  border-radius: 28px;
  background:
    radial-gradient(circle at top right, rgba(0, 136, 204, 0.12) 0%, transparent 38%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.98) 0%, rgba(15, 23, 42, 0.95) 100%);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow:
    0 28px 72px rgba(2, 6, 23, 0.52),
    0 10px 28px rgba(0, 136, 204, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

html:not(.theme-dark):has(.gram-parsing-page--users) .panel-modal-card.gram-modal-card,
html:not(.theme-dark):has(.gram-parsing-page--users) .panel-modal-card.gram-modal-picker {
  background:
    radial-gradient(circle at top right, rgba(0, 136, 204, 0.08) 0%, transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.97) 100%);
  border-color: rgba(0, 136, 204, 0.18);
  box-shadow:
    0 26px 64px rgba(15, 23, 42, 0.24),
    0 1px 0 rgba(255, 255, 255, 0.8);
}

html:has(.gram-parsing-page--users) .gram-apick-col {
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(8, 15, 30, 0.96), rgba(13, 23, 42, 0.92));
  border: 1px solid rgba(148, 163, 184, 0.12);
  box-shadow: 0 24px 52px rgba(2, 6, 23, 0.38);
  overflow: hidden;
}

html:not(.theme-dark):has(.gram-parsing-page--users) .gram-apick-col {
  background: linear-gradient(180deg, #f8fafc, #f1f5f9);
  border-color: #e2e8f0;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.05);
}

html:has(.gram-parsing-page--users) .gram-apick-col-selected {
  border-color: rgba(0, 136, 204, 0.3);
}

html.theme-dark:has(.gram-parsing-page--users) .gram-apick-col-selected {
  background: linear-gradient(180deg, rgba(28, 25, 66, 0.92), rgba(11, 19, 36, 0.94));
  border-color: rgba(96, 165, 250, 0.2);
}

html:has(.gram-parsing-page--users) .gram-apick-col-head {
  background: linear-gradient(180deg, rgba(20, 30, 48, 0.96), rgba(16, 24, 40, 0.88));
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

html:not(.theme-dark):has(.gram-parsing-page--users) .gram-apick-col-head {
  background: linear-gradient(180deg, #fff, #f8fafc);
  border-bottom-color: #e2e8f0;
}

html:has(.gram-parsing-page--users) .gram-apick-search {
  border-color: rgba(96, 150, 220, 0.18);
  background: rgba(15, 23, 42, 0.35);
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(120, 170, 255, 0.04);
}

html.theme-dark:has(.gram-parsing-page--users) .gram-apick-search {
  border-color: rgba(96, 150, 220, 0.16);
  background: rgba(8, 15, 30, 0.72);
}

html:not(.theme-dark):has(.gram-parsing-page--users) .gram-apick-search {
  border-color: #e2e8f0;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

html:has(.gram-parsing-page--users) .gram-apick-search-input {
  color: #e2e8f0;
}

html:not(.theme-dark):has(.gram-parsing-page--users) .gram-apick-search-input {
  color: #0f172a;
}

/* === Парсер участников — палитра GramGPT v474 === */

.gram-parsing-page--users .gram-gpt-btn-primary {
  background: linear-gradient(135deg, #0088cc, #0077b3) !important;
  color: #fff !important;
  border: none;
  box-shadow: 0 4px 14px rgba(0, 136, 204, 0.28);
}

.gram-parsing-page--users .gram-gpt-btn-primary:hover {
  filter: brightness(1.06);
  box-shadow: 0 6px 18px rgba(0, 136, 204, 0.36);
}

html:has(.gram-parsing-page--users) .panel-modal-card .gram-gpt-btn-primary {
  background: linear-gradient(135deg, #0088cc, #0077b3) !important;
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(0, 136, 204, 0.28);
}

.gram-parsing-confirm-modal.panel-modal-card {
  max-width: min(420px, 92vw);
  border: 1px solid rgba(0, 136, 204, 0.22);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 24px 56px rgba(15, 23, 42, 0.18), 0 8px 20px rgba(0, 136, 204, 0.12);
}

html.theme-dark .gram-parsing-confirm-modal.panel-modal-card {
  background: rgba(15, 23, 42, 0.94);
  border-color: rgba(56, 189, 248, 0.2);
}

.gram-parsing-confirm-modal .gram-modal-icon-blue {
  background: linear-gradient(135deg, #0088cc, #00aced);
  color: #fff;
  box-shadow: 0 4px 14px rgba(0, 136, 204, 0.28);
}

.gram-parsing-confirm-modal .gram-parsing-confirm-text {
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
  color: #334155;
}

html.theme-dark .gram-parsing-confirm-modal .gram-parsing-confirm-text {
  color: #cbd5e1;
}

.gram-parsing-confirm-modal .panel-modal-footer {
  gap: 10px;
  justify-content: flex-end;
}

html:has(.gram-parsing-page--users) .gram-parsing-confirm-modal.panel-modal-card {
  border-radius: 28px;
  background:
    radial-gradient(circle at top right, rgba(0, 136, 204, 0.1) 0%, transparent 38%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.98) 0%, rgba(15, 23, 42, 0.95) 100%);
}

html:not(.theme-dark):has(.gram-parsing-page--users) .gram-parsing-confirm-modal.panel-modal-card {
  background:
    radial-gradient(circle at top right, rgba(0, 136, 204, 0.08) 0%, transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.97) 100%);
}

.gram-parsing-page--users .gram-module-hero-icon.gram-tone-emerald {
  background: linear-gradient(135deg, #0088cc, #00aced);
  color: #fff;
  box-shadow: 0 4px 14px rgba(0, 136, 204, 0.28);
}

.gram-parsing-page--users .gram-parsing-live-stat-icon.gram-tone-blue {
  background: linear-gradient(135deg, #0088cc, #00aced);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 136, 204, 0.24);
}

.gram-parsing-page--users .gram-parsing-live-stat-icon.gram-tone-green {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.22);
}

.gram-parsing-page--users .gram-parsing-filter-check-input:checked + .gram-parsing-filter-check-box {
  background: #0088cc;
  border-color: #0088cc;
  box-shadow: 0 0 0 3px rgba(0, 136, 204, 0.18);
}

html:not(.theme-dark) .gram-parsing-page--users .gram-parsing-filter-check-box {
  background: #fff;
  border-color: #cbd5e1;
}

html:not(.theme-dark) .gram-parsing-page--users .gram-parsing-filter-check-input:checked + .gram-parsing-filter-check-box {
  background: #0088cc;
  border-color: #0088cc;
  box-shadow: 0 0 0 3px rgba(0, 136, 204, 0.16);
}

.gram-parsing-page--users .gram-parsing-story-toggle.gram-gpt-toggle:has(input:checked) .gram-gpt-toggle-track {
  background: linear-gradient(135deg, #0088cc, #0077b3) !important;
}

html:not(.theme-dark) .gram-parsing-page--users .gram-parsing-slider-track {
  background: rgba(148, 163, 184, 0.28);
}

html:not(.theme-dark) .gram-parsing-page--users .gram-parsing-slider-input::-webkit-slider-thumb {
  background: #0088cc;
}

html:not(.theme-dark) .gram-parsing-page--users .gram-parsing-slider-input::-moz-range-thumb {
  background: #0088cc;
}

html:not(.theme-dark) .gram-parsing-page--users.gram-ml-glass .gram-gpt-window {
  border: 1px solid rgba(0, 136, 204, 0.14);
  background:
    radial-gradient(circle at top right, rgba(0, 136, 204, 0.06), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(248, 250, 252, 0.88) 100%);
  box-shadow:
    0 18px 45px rgba(15, 23, 42, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

html:not(.theme-dark) .gram-parsing-page--users.gram-ml-glass .gram-gpt-window:hover {
  border-color: rgba(0, 136, 204, 0.32);
  box-shadow:
    0 20px 48px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

html:not(.theme-dark) .gram-parsing-page--users .gram-parsing-live-stat {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(0, 136, 204, 0.12);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.05);
}

html.theme-dark .gram-parsing-page--users.gram-ml-glass .gram-gpt-window {
  border-color: rgba(0, 136, 204, 0.14);
}

.gram-parsing-page--users .gram-parsing-groups-count {
  color: #0088cc;
  background: rgba(0, 136, 204, 0.1);
  border-color: rgba(0, 136, 204, 0.22);
}

html.theme-dark .gram-parsing-page--users .gram-parsing-groups-count {
  color: #00aced;
  background: rgba(0, 136, 204, 0.14);
  border-color: rgba(0, 136, 204, 0.24);
}

.gram-parsing-page--users .gram-log-panel--parsing-users .gram-log-thread-badge {
  border-color: rgba(0, 136, 204, 0.24);
  background: rgba(0, 136, 204, 0.08);
  color: #0088cc;
}

html.theme-dark .gram-parsing-page--users .gram-log-panel--parsing-users .gram-log-thread-badge {
  border-color: rgba(0, 136, 204, 0.28);
  background: rgba(0, 136, 204, 0.12);
  color: #00aced;
}

/* === Парсер участников — v476: кнопки, шапки, dist === */

.gram-parsing-page--users.gram-module-page.gram-gpt-layout .gram-gpt-window-head {
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

html.theme-dark .gram-parsing-page--users.gram-module-page.gram-gpt-layout .gram-gpt-window-head {
  background: transparent !important;
  border-bottom-color: rgba(96, 150, 220, 0.1) !important;
}

html:not(.theme-dark) .gram-parsing-page--users.gram-module-page.gram-gpt-layout .gram-gpt-window-head {
  background: transparent !important;
  border-bottom-color: rgba(148, 163, 184, 0.18) !important;
}

.gram-parsing-page--users .gram-gpt-btn-primary,
.gram-parsing-page--users .gram-parsing-launch-btn.gram-gpt-btn-success {
  background: linear-gradient(135deg, #0088cc, #00aced) !important;
  color: #fff !important;
  border: none;
  box-shadow:
    0 4px 14px rgba(0, 136, 204, 0.32),
    0 0 20px rgba(0, 172, 237, 0.18);
}

.gram-parsing-page--users .gram-gpt-btn-primary:hover,
.gram-parsing-page--users .gram-parsing-launch-btn.gram-gpt-btn-success:hover {
  filter: brightness(1.06);
  box-shadow:
    0 6px 20px rgba(0, 136, 204, 0.42),
    0 0 28px rgba(0, 172, 237, 0.24);
}

.gram-parsing-page--users .gram-gpt-dist-grid .dist-box ul,
.gram-parsing-page--users .gram-gpt-dist-grid .dist-box-preview {
  margin: 0;
  padding: 0;
  list-style: none;
  flex: 1 1 auto;
  min-height: 0;
  max-height: 68px;
  overflow: hidden;
}

.gram-parsing-page--users .gram-gpt-dist-grid .dist-box li {
  padding: 2px 0;
  font-size: 11px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #64748b;
}

.gram-parsing-page--users .gram-gpt-dist-grid .dist-box li.dist-box-more {
  font-style: italic;
  opacity: 0.85;
}

.gram-parsing-page--users .gram-gpt-dist-grid .dist-box.dist-box--editable:has(.dist-box-edit:not([hidden])) {
  max-height: 168px;
}

.gram-parsing-page--users .gram-gpt-dist-grid .dist-box-links-input {
  width: 100%;
  min-height: 72px;
  max-height: 72px;
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(96, 150, 220, 0.12);
  background: rgba(15, 23, 42, 0.45);
  color: #e2e8f0;
  font-size: 11px;
  line-height: 1.4;
  resize: none;
  overflow-y: auto;
}

html.theme-dark .gram-parsing-page--users .gram-gpt-dist-grid .dist-box li {
  color: #94a3b8;
}

.gram-parsing-page--users .gram-gpt-dist-grid .dist-box-head h4 {
  font-size: 12px;
  font-weight: 600;
  color: #0f172a;
}

html.theme-dark .gram-parsing-page--users .gram-gpt-dist-grid .dist-box-head h4 {
  color: #e2e8f0;
}

.gram-parsing-page--users .gram-gpt-dist-grid .dist-box-toggle {
  border-color: rgba(0, 136, 204, 0.35);
  background: rgba(0, 136, 204, 0.12);
  color: #00aced;
}

.gram-parsing-page--users .gram-gpt-dist-grid .dist-box-toggle:hover,
.gram-parsing-page--users .gram-gpt-dist-grid .dist-box-toggle.is-open {
  border-color: rgba(0, 136, 204, 0.55);
  background: rgba(0, 136, 204, 0.22);
  box-shadow: 0 0 12px rgba(0, 136, 204, 0.2);
}

html:not(.theme-dark) .gram-parsing-page--users .gram-gpt-dist-grid .dist-box-links-input {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(148, 163, 184, 0.35);
  color: #0f172a;
}

.gram-parsing-filter-hint {
  display: none !important;
}

.gram-parsing-filter-hint[hidden] {
  display: none !important;
}

/* —— Задачи: кнопка в менеджере аккаунтов + модалка (стиль парсера) —— */
.acc-tasks-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  min-height: 36px;
  border-radius: 12px;
  border: 1px solid rgba(0, 136, 204, 0.28);
  background: linear-gradient(135deg, rgba(0, 136, 204, 0.12), rgba(0, 172, 237, 0.08));
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  color: #0369a1;
  transition: border-color 0.15s, box-shadow 0.2s, transform 0.1s;
  position: relative;
}

html.theme-dark .acc-tasks-btn {
  color: #7dd3fc;
  border-color: rgba(56, 189, 248, 0.28);
  background: linear-gradient(135deg, rgba(14, 116, 144, 0.22), rgba(0, 136, 204, 0.1));
}

.acc-tasks-btn:hover {
  border-color: rgba(0, 136, 204, 0.45);
  box-shadow: 0 4px 16px rgba(0, 136, 204, 0.18);
}

.acc-tasks-btn.is-running {
  border-color: rgba(0, 172, 237, 0.55);
  box-shadow:
    0 0 0 1px rgba(0, 172, 237, 0.2),
    0 0 20px rgba(0, 136, 204, 0.28);
  animation: acc-tasks-glow 2s ease-in-out infinite;
}

@keyframes acc-tasks-glow {
  0%, 100% { box-shadow: 0 0 0 1px rgba(0, 172, 237, 0.18), 0 0 14px rgba(0, 136, 204, 0.2); }
  50% { box-shadow: 0 0 0 1px rgba(0, 172, 237, 0.35), 0 0 24px rgba(0, 172, 237, 0.35); }
}

.acc-tasks-badge {
  min-width: 20px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #fff;
  background: linear-gradient(135deg, #0088cc, #00aced);
}

.gram-tasks-modal-card.panel-modal-card {
  max-width: min(920px, 96vw);
  border-radius: 18px;
  border: 1px solid rgba(0, 136, 204, 0.22);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.gram-tasks-modal-card .gram-modal-icon-blue {
  background: linear-gradient(135deg, #0088cc, #00aced);
  color: #fff;
  box-shadow: 0 4px 14px rgba(0, 136, 204, 0.28);
}

.gram-tasks-modal-card .gram-parsing-live-stat-icon.gram-tone-blue {
  background: linear-gradient(135deg, #0088cc, #00aced);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 136, 204, 0.24);
}

html.theme-dark .gram-tasks-modal-card.panel-modal-card {
  background: rgba(15, 23, 42, 0.88);
  border-color: rgba(56, 189, 248, 0.18);
}

.gram-tasks-modal-card .panel-modal-body {
  padding: 12px 16px 8px;
  max-height: min(72vh, 680px);
  overflow: auto;
}

.gram-tasks-modal-card .gram-tasks-modal-inner {
  padding: 0;
  margin: 0;
  background: transparent;
  box-shadow: none;
}

.gram-tasks-modal-card .journal-tr-banner {
  border-radius: 12px;
  border-color: rgba(0, 136, 204, 0.2);
  background: rgba(0, 136, 204, 0.08);
}

.gram-tasks-modal-card .journal-tr-tabs {
  margin-top: 12px;
}

.gram-tasks-modal-card .journal-tr-tab.is-active {
  border-color: rgba(0, 136, 204, 0.45);
  background: rgba(0, 136, 204, 0.1);
}

.gram-tasks-modal-card .journal-gpt-card,
.gram-tasks-modal-card .journal-tr-card {
  border-radius: 14px;
  border-color: rgba(148, 163, 184, 0.22);
}

.gram-tasks-modal-footer.panel-modal-footer {
  justify-content: flex-end;
  padding: 10px 16px 14px;
}

.gram-tasks-modal-card .gram-tasks-modal-inner {
  gap: 12px;
}

.gram-tasks-modal-card .gram-tasks-notice {
  margin-bottom: 0;
}

.gram-tasks-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.gram-tasks-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(255, 255, 255, 0.55);
  font-size: 14px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

html.theme-dark .gram-tasks-tab {
  background: rgba(30, 41, 59, 0.55);
  border-color: rgba(148, 163, 184, 0.18);
  color: #cbd5e1;
}

.gram-tasks-tab.is-active {
  border-color: rgba(0, 136, 204, 0.45);
  background: linear-gradient(135deg, rgba(0, 136, 204, 0.14), rgba(0, 172, 237, 0.08));
  color: #0088cc;
  box-shadow: 0 4px 14px rgba(0, 136, 204, 0.14);
}

html.theme-dark .gram-tasks-tab.is-active {
  color: #7dd3fc;
}

.gram-tasks-tab-badge {
  min-width: 20px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #0088cc, #00aced);
}

.gram-tasks-window .gram-gpt-window-body {
  gap: 12px;
}

.gram-tasks-pane.is-hidden {
  display: none !important;
}

.gram-tasks-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 28px 16px;
  color: #64748b;
  text-align: center;
}

.gram-tasks-empty i {
  font-size: 28px;
  opacity: 0.45;
}

.gram-tasks-active-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gram-tasks-active-card {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(255, 255, 255, 0.6);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

html.theme-dark .gram-tasks-active-card {
  background: rgba(30, 41, 59, 0.55);
  border-color: rgba(148, 163, 184, 0.16);
}

.gram-tasks-active-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.gram-tasks-active-name {
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
}

html.theme-dark .gram-tasks-active-name {
  color: #f1f5f9;
}

.gram-tasks-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.gram-tasks-status-pill.is-run {
  color: #0369a1;
  background: rgba(0, 136, 204, 0.12);
}

.gram-tasks-active-card-actions {
  display: flex;
  gap: 8px;
}

.gram-tasks-eye-btn,
.gram-tasks-stop-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(255, 255, 255, 0.8);
  color: #64748b;
  cursor: pointer;
}

.gram-tasks-eye-btn.is-active {
  border-color: rgba(0, 136, 204, 0.4);
  color: #0088cc;
}

.gram-tasks-stop-btn {
  color: #dc2626;
  border-color: rgba(248, 113, 113, 0.35);
}

.gram-tasks-active-meta {
  display: flex;
  gap: 14px;
  margin-top: 10px;
  font-size: 12px;
  color: #64748b;
}

.gram-tasks-progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.gram-tasks-progress-track {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  overflow: hidden;
}

.gram-tasks-progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0088cc, #00aced);
}

.gram-tasks-progress-count {
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #0088cc;
}

.gram-tasks-table-wrap {
  overflow-x: auto;
}

.gram-tasks-table {
  width: 100%;
  border-collapse: collapse;
}

.gram-tasks-table thead th {
  padding: 10px 12px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

.gram-tasks-table tbody td {
  padding: 10px 12px;
  font-size: 13px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  vertical-align: middle;
}

.gram-tasks-hist-row.is-expanded {
  background: rgba(0, 136, 204, 0.06);
}

.gram-tasks-detail-card {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(0, 136, 204, 0.18);
  background: rgba(0, 136, 204, 0.04);
}

.gram-tasks-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.gram-tasks-detail-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.gram-tasks-detail-close {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.15);
  cursor: pointer;
}

.gram-tasks-detail-stats {
  margin-bottom: 12px;
}

.gram-tasks-stat-status {
  display: block;
  font-size: 14px !important;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0;
  text-transform: none;
}

.gram-tasks-stat-status-done {
  color: #16a34a;
}

.gram-tasks-stat-status-cancelled {
  color: #64748b;
}

.gram-tasks-stat-status-error {
  color: #dc2626;
}

.gram-tasks-stat-status-running {
  color: #0088cc;
}

html.theme-dark .gram-tasks-stat-status-done {
  color: #4ade80;
}

html.theme-dark .gram-tasks-stat-status-cancelled {
  color: #94a3b8;
}

html.theme-dark .gram-tasks-stat-status-error {
  color: #f87171;
}

html.theme-dark .gram-tasks-stat-status-running {
  color: #38bdf8;
}

.gram-tasks-detail-meta {
  margin-bottom: 12px;
  font-size: 12px;
  color: #64748b;
}

.gram-tasks-detail-label {
  display: block;
  margin-bottom: 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
}

.gram-tasks-detail-list {
  max-height: 220px;
  overflow: auto;
}

.gram-tasks-detail-card .journal-tr-acc-row {
  border-radius: 10px;
  margin-bottom: 6px;
}

.gram-tasks-filters-wrap.is-open .gram-tasks-filters-body {
  display: block;
}

.gram-tasks-filters-body {
  display: none;
  margin-top: 10px;
}

/* Рассылка в ЛС — стиль как парсер участников, архитектура GramGPT (gram-spam-preset-page) */
.gram-spam-preset-page.gram-gpt-layout {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  gap: 12px;
}

.gram-spam-preset-page .gram-gpt-form {
  gap: 12px;
}

.gram-spam-preset-page .gram-spam-users-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.gram-spam-preset-page .gram-spam-users-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.gram-spam-preset-page .gram-spam-users-col-left > .gram-gpt-window:last-child {
  margin-top: auto;
  flex: 0 0 auto;
  min-height: 138px;
}

.gram-spam-preset-page.gram-ml-glass .gram-gpt-window {
  border: 1px solid rgba(71, 100, 150, 0.32);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.06),
    0 8px 32px rgba(2, 8, 23, 0.18);
  overflow: visible;
}

html.theme-dark .gram-spam-preset-page.gram-ml-glass .gram-gpt-window {
  background: #152238;
  border-color: rgba(56, 189, 248, 0.24);
}

html:not(.theme-dark) .gram-spam-preset-page.gram-ml-glass .gram-gpt-window {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(148, 163, 184, 0.35);
}

.gram-spam-preset-page .gram-gpt-window-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.gram-spam-preset-page .gram-spam-head-badges {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.gram-spam-preset-page .gram-spam-tempo-chip,
.gram-spam-preset-page .gram-spam-mode-chip {
  margin-left: auto;
}

.gram-spam-preset-page .gram-spam-target-chip,
.gram-spam-preset-page .gram-spam-mode-chip,
.gram-spam-preset-page .gram-spam-tempo-chip {
  font-size: 11px;
  font-weight: 600;
}

.gram-spam-preset-page .gram-spam-source-tabs {
  margin-bottom: 12px;
}

.gram-spam-preset-page .gram-spam-source-tab {
  flex: 1;
  justify-content: center;
  min-height: 38px;
}

.gram-spam-preset-page .gram-spam-contacts-hint {
  margin-top: 0;
  margin-bottom: 12px;
}

.gram-spam-preset-page .gram-spam-mode-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 0;
}

.gram-spam-preset-page .gram-spam-tempo-collapse {
  border: none;
  margin: 0 0 12px;
  padding: 0;
}

.gram-spam-preset-page .gram-spam-tempo-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 0 10px;
  list-style: none;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  margin-bottom: 10px;
}

.gram-spam-preset-page .gram-spam-tempo-summary::-webkit-details-marker {
  display: none;
}

.gram-spam-preset-page .gram-spam-tempo-label {
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.gram-spam-preset-page .gram-spam-tempo-hint {
  font-size: 11px;
  color: var(--text-muted, #64748b);
  flex: 1;
  min-width: 0;
}

.gram-spam-preset-page .gram-spam-tempo-chevron {
  font-size: 12px;
  color: var(--text-muted, #64748b);
  transition: transform 0.15s ease;
}

.gram-spam-preset-page .gram-spam-tempo-collapse[open] .gram-spam-tempo-chevron {
  transform: rotate(180deg);
}

.gram-spam-preset-page .gram-spam-limits-block {
  padding-top: 4px;
}

.gram-spam-preset-page .gram-spam-limits-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
}

.gram-spam-preset-page .gram-spam-limits-title .gram-card-icon {
  width: 28px;
  height: 28px;
  font-size: 13px;
}

.gram-spam-preset-page .gram-spam-options-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.gram-spam-preset-page .gram-gpt-text-preview-panel {
  min-height: 120px;
  max-height: 220px;
  overflow-y: auto;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.04);
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

html.theme-dark .gram-spam-preset-page .gram-gpt-text-preview-panel {
  background: rgba(15, 23, 42, 0.35);
  border-color: rgba(148, 163, 184, 0.18);
}

.gram-spam-preset-page .gram-gpt-text-preview-panel.is-empty {
  color: var(--text-muted, #64748b);
}

.gram-spam-preset-page .gram-spam-messages-body .gram-spam-text-field textarea,
.gram-spam-preset-page .gram-spam-messages-body .gram-textarea-tall {
  min-height: 160px;
}

.gram-spam-preset-page .gram-spam-manual-targets .gram-textarea-tall {
  min-height: 140px;
}

.gram-spam-preset-page .gram-gpt-window-head .gram-gpt-window-title-row {
  flex: 1;
  min-width: 0;
}

.gram-spam-preset-page > .gram-ai-defender-block {
  margin-bottom: 12px;
}

.gram-spam-preset-page .gram-parsing-users-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 8px 0 4px;
  min-height: 52px;
}

.gram-spam-preset-page .gram-parsing-launch-btn {
  min-width: 220px;
  padding: 14px 28px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #0088cc, #00aced) !important;
  color: #fff !important;
  box-shadow:
    0 8px 24px rgba(0, 136, 204, 0.38),
    0 0 28px rgba(0, 172, 237, 0.22);
}

.gram-spam-preset-page .gram-parsing-users-actions #panelCancelBtn:not([hidden]) {
  min-width: 220px;
  padding: 14px 28px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 12px;
}

.gram-spam-preset-page .gram-spam-live-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0 16px;
}

.gram-spam-preset-page .gram-parsing-live-stat {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.3);
}

html.theme-dark .gram-spam-preset-page .gram-parsing-live-stat {
  background: rgba(30, 41, 59, 0.6);
  border-color: rgba(255, 255, 255, 0.1);
}

.gram-spam-preset-page .gram-gpt-btn-primary,
.gram-spam-preset-page .gram-parsing-launch-btn.gram-gpt-btn-success {
  background: linear-gradient(135deg, #0088cc, #00aced) !important;
  color: #fff !important;
}

@media (max-width: 980px) {
  .gram-spam-preset-page .gram-spam-users-grid {
    grid-template-columns: 1fr;
  }

  .gram-spam-preset-page .gram-spam-tempo-hint {
    display: none;
  }
}

@media (max-width: 720px) {
  .gram-spam-preset-page .gram-spam-live-stats,
  .gram-spam-preset-page .gram-spam-options-grid,
  .gram-spam-preset-page .gram-spam-mode-grid {
    grid-template-columns: 1fr;
  }
}

/* Спамер по ЛС (spam_pm) — стиль парсера участников, архитектура GramGPT */
.gram-spam-pm-page.gram-gpt-layout {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  gap: 12px;
}

/* mock-v2: силуэт как мокап — узкая колонка настроек + широкий холст */
.gram-spam-pm-page.gram-spam-pm-mock-v2.gram-gpt-layout {
  max-width: 100% !important;
  width: 100% !important;
}

.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-hero {
  border-color: rgba(245, 166, 35, 0.28);
  background: linear-gradient(135deg, rgba(245, 166, 35, 0.08), rgba(16, 23, 38, 0.55));
}

html:not(.theme-dark) .gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-hero {
  background: linear-gradient(135deg, rgba(245, 166, 35, 0.1), rgba(255, 255, 255, 0.94));
}

.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-hero-title {
  color: #f5a623 !important;
}

.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-hero-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-hero-actions .gram-spam-collect-actions {
  display: inline-flex;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  min-height: 0;
}

.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-hero-actions #panelLaunchBtn {
  background: linear-gradient(135deg, #f5a623, #e08e0b) !important;
  border: 0 !important;
  color: #111 !important;
  font-weight: 700 !important;
  box-shadow: 0 6px 18px rgba(245, 166, 35, 0.35) !important;
}

.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-hero-actions #panelCollectRepliesBtn {
  border: 1px solid rgba(245, 166, 35, 0.45) !important;
  background: transparent !important;
  color: #f5a623 !important;
}

.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(245, 166, 35, 0.28);
  background: rgba(245, 166, 35, 0.08);
  color: #fbbf24;
  font-size: 11px;
  font-weight: 600;
}

.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-mode-opts {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-chain-summary {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 10px;
}

.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-chain-sum-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(245, 166, 35, 0.2);
  background: rgba(15, 23, 42, 0.55);
}

.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-chain-sum-num {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f5a623;
  color: #111;
  font-size: 11px;
  font-weight: 700;
}

.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-hero {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 4px 0 8px !important;
}

.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-hero-secondary,
.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-mock-hide {
  display: none !important;
}

.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-form[data-spam-mode="direct"] .gram-spam-pm-chain-panel,
.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-chain-panel {
  display: block !important;
}

.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-direct-panel,
.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-form[data-spam-mode="trigger"] .gram-spam-pm-direct-panel,
.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-form[data-spam-mode="direct"] .gram-spam-pm-direct-panel {
  display: none !important;
}

.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-form[data-spam-mode="direct"] .gram-spam-pm-trigger-row {
  display: none !important;
}

.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-editor-placeholder,
.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-col-chain .gram-spam-pm-editor-placeholder {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
}

.gram-spam-pm-page.gram-spam-pm-mock-v2.gram-gpt-layout {
  max-width: 100% !important;
  width: 100% !important;
}

.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-hero-actions .gram-spam-collect-actions,
.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-hero-actions #panelLaunchBtn,
.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-hero-actions #panelCollectRepliesBtn {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-col-chain .gram-spam-pm-placeholder-drop {
  display: none !important;
}

.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-parsing-live-stats {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 10px !important;
}

.gram-spam-pm-page.gram-spam-pm-mock-v2.gram-parsing-preset-page .gram-parsing-users-grid.gram-spam-pm-main-grid,
.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-main-grid {
  display: grid !important;
  grid-template-columns: minmax(280px, 0.32fr) minmax(0, 0.42fr) minmax(260px, 0.26fr) !important;
  gap: 14px !important;
  align-items: start !important;
}

.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-main-grid > .gram-parsing-users-col {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  min-width: 0 !important;
}

.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-gpt-window {
  border: 1px solid rgba(245, 166, 35, 0.16) !important;
  background: rgba(16, 23, 38, 0.62) !important;
  border-radius: 16px !important;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28) !important;
}

.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-phone {
  display: flex;
  justify-content: center;
  padding: 8px 4px;
}

.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-phone-bezel {
  width: 100%;
  max-width: 280px;
  border-radius: 28px;
  padding: 10px;
  background: linear-gradient(160deg, #1a1a1e, #0b0b0d);
  border: 1px solid rgba(245, 166, 35, 0.22);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-phone-notch {
  width: 92px;
  height: 10px;
  border-radius: 999px;
  background: #000;
  margin: 2px auto 10px;
}

.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-phone-screen {
  min-height: 320px;
  border-radius: 18px;
  background: #0f172a;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-filters-row {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 12px !important;
  margin: 0 !important;
}

.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-mode-tabs {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 8px !important;
  width: 100% !important;
}

.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-mode-tab.active,
.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-source-tab.active {
  background: rgba(245, 166, 35, 0.16) !important;
  border-color: rgba(245, 166, 35, 0.55) !important;
  color: #f5a623 !important;
}

@media (max-width: 1200px) {
  .gram-spam-pm-page.gram-spam-pm-mock-v2.gram-parsing-preset-page .gram-parsing-users-grid.gram-spam-pm-main-grid,
  .gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-main-grid {
    grid-template-columns: minmax(260px, 0.36fr) minmax(0, 0.64fr) !important;
  }
  .gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-col-preview {
    grid-column: 1 / -1 !important;
  }
}

@media (max-width: 980px) {
  .gram-spam-pm-page.gram-spam-pm-mock-v2.gram-parsing-preset-page .gram-parsing-users-grid.gram-spam-pm-main-grid,
  .gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-main-grid {
    grid-template-columns: 1fr !important;
  }
}

.gram-spam-pm-page .gram-gpt-form {
  gap: 12px;
}

.gram-spam-pm-page > .gram-ai-defender-block {
  margin-bottom: 12px;
}

.gram-spam-pm-page .gram-spam-pm-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.gram-spam-pm-page .gram-spam-pm-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.gram-spam-pm-page .gram-spam-pm-col-left > .gram-gpt-window:last-child {
  margin-top: auto;
  flex: 0 0 auto;
  min-height: 138px;
}

.gram-spam-pm-page.gram-ml-glass .gram-gpt-window {
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.05);
  overflow: visible;
  backdrop-filter: blur(12px) saturate(112%);
  -webkit-backdrop-filter: blur(12px) saturate(112%);
  transition: border-color 0.2s ease, border-style 0.2s ease, box-shadow 0.2s ease;
}

html.theme-dark .gram-spam-pm-page.gram-ml-glass .gram-gpt-window {
  background:
    linear-gradient(180deg, rgba(0, 136, 204, 0.06) 0%, rgba(0, 136, 204, 0) 100%),
    rgba(16, 23, 38, 0.42);
  border-color: rgba(0, 136, 204, 0.12);
  box-shadow:
    inset 0 1px 0 rgba(0, 136, 204, 0.06),
    0 22px 48px -32px rgba(2, 10, 25, 0.9);
  backdrop-filter: blur(12px) saturate(118%);
  -webkit-backdrop-filter: blur(12px) saturate(118%);
}

html:not(.theme-dark) .gram-spam-pm-page.gram-ml-glass .gram-gpt-window {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(0, 136, 204, 0.12);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.05);
}

.gram-spam-pm-page .gram-gpt-window-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.gram-spam-pm-page .gram-spam-pm-head-badges {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.gram-spam-pm-page .gram-spam-pm-tempo-chip,
.gram-spam-pm-page .gram-spam-pm-mode-chip {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
}

.gram-spam-pm-page .gram-spam-source-tabs {
  margin-bottom: 12px;
}

.gram-spam-pm-page .gram-spam-source-tab {
  flex: 1;
  justify-content: center;
  min-height: 38px;
}

.gram-spam-pm-page .gram-spam-contacts-hint {
  margin-bottom: 12px;
}

.gram-spam-pm-page .gram-spam-mode-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 0;
}

.gram-spam-pm-page .gram-spam-pm-tempo-collapse {
  border: none;
  margin: 0 0 12px;
  padding: 0;
}

.gram-spam-pm-page .gram-spam-pm-tempo-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 0 10px;
  list-style: none;
  cursor: pointer;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  margin-bottom: 10px;
}

.gram-spam-pm-page .gram-spam-pm-tempo-summary::-webkit-details-marker {
  display: none;
}

.gram-spam-pm-page .gram-spam-pm-tempo-label {
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.gram-spam-pm-page .gram-spam-pm-tempo-hint {
  font-size: 11px;
  color: var(--text-muted, #64748b);
  flex: 1;
}

.gram-spam-pm-page .gram-spam-pm-tempo-chevron {
  transition: transform 0.15s ease;
}

.gram-spam-pm-page .gram-spam-pm-tempo-collapse[open] .gram-spam-pm-tempo-chevron {
  transform: rotate(180deg);
}

.gram-spam-pm-page .gram-spam-pm-limits-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
}

.gram-spam-pm-page .gram-spam-pm-options-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.gram-spam-pm-page .gram-gpt-text-preview-panel {
  min-height: 120px;
  max-height: 220px;
  overflow-y: auto;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(255, 255, 255, 0.88);
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

html.theme-dark .gram-spam-pm-page .gram-gpt-text-preview-panel {
  border-color: rgba(96, 150, 220, 0.12);
  background: rgba(15, 23, 42, 0.45);
  color: #e2e8f0;
}

.gram-spam-pm-page .gram-spam-pm-section-hint {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--text-muted, #64748b);
}

.gram-spam-pm-page .gram-spam-pm-messages-body .gram-textarea-tall {
  min-height: 160px;
}

.gram-spam-pm-page .gram-parsing-users-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 8px 0 4px;
  min-height: 52px;
}

.gram-spam-pm-page .gram-parsing-launch-btn {
  min-width: 220px;
  padding: 14px 28px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #0088cc, #00aced) !important;
  color: #fff !important;
}

.gram-spam-pm-page .gram-spam-pm-launch-panel {
  margin-top: 12px;
}

.gram-spam-pm-page .gram-spam-pm-launch-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.gram-spam-pm-page .gram-spam-pm-launch-body .gram-log-panel {
  margin-top: 0;
}

@media (max-width: 980px) {
  .gram-spam-pm-page .gram-spam-pm-grid {
    grid-template-columns: 1fr;
  }

  .gram-spam-pm-page .gram-spam-pm-tempo-hint {
    display: none;
  }
}

@media (max-width: 720px) {
  .gram-spam-pm-page .gram-spam-pm-launch-stats,
  .gram-spam-pm-page .gram-spam-pm-options-grid,
  .gram-spam-pm-page .gram-spam-mode-grid {
    grid-template-columns: 1fr;
  }
}

/* spam_pm + парсер участников: glass, лог, action bar — как у parsing users */
.gram-parsing-page--users.gram-spam-pm-page.gram-ml-glass .gram-gpt-window {
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.05);
  overflow: visible;
  backdrop-filter: blur(12px) saturate(112%);
  -webkit-backdrop-filter: blur(12px) saturate(112%);
  transition: border-color 0.2s ease, border-style 0.2s ease, box-shadow 0.2s ease;
}

html.theme-dark .gram-parsing-page--users.gram-spam-pm-page.gram-ml-glass .gram-gpt-window {
  background:
    linear-gradient(180deg, rgba(0, 136, 204, 0.06) 0%, rgba(0, 136, 204, 0) 100%),
    rgba(16, 23, 38, 0.42);
  border-color: rgba(0, 136, 204, 0.12);
  box-shadow:
    inset 0 1px 0 rgba(0, 136, 204, 0.06),
    0 22px 48px -32px rgba(2, 10, 25, 0.9);
  backdrop-filter: blur(12px) saturate(118%);
  -webkit-backdrop-filter: blur(12px) saturate(118%);
}

html.theme-dark .gram-parsing-page--users.gram-spam-pm-page.gram-ml-glass .gram-gpt-window:hover {
  border-color: rgba(0, 136, 204, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(0, 136, 204, 0.1),
    0 24px 52px -28px rgba(2, 10, 25, 0.95);
}

html:not(.theme-dark) .gram-parsing-page--users.gram-spam-pm-page.gram-ml-glass .gram-gpt-window {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(0, 136, 204, 0.12);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.05);
}

html:not(.theme-dark) .gram-parsing-page--users.gram-spam-pm-page.gram-ml-glass .gram-gpt-window:hover {
  border-color: rgba(0, 136, 204, 0.4);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
}

.gram-parsing-page--users.gram-spam-pm-page .gram-parsing-users-col-left > .gram-gpt-window:last-child {
  margin-top: auto;
  flex: 0 0 auto;
  min-height: 138px;
}

.gram-parsing-page--users.gram-spam-pm-page .gram-spam-pm-mode-panel {
  min-width: 0;
}

.gram-parsing-page--users.gram-spam-pm-page .gram-spam-mode-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 0;
}

.gram-parsing-page--users.gram-spam-pm-page .gram-spam-source-tabs {
  margin-bottom: 12px;
}

.gram-parsing-page--users.gram-spam-pm-page .gram-spam-source-tab {
  flex: 1;
  justify-content: center;
  min-height: 38px;
}

.gram-parsing-page--users.gram-spam-pm-page #moduleLiveLog .gram-log-panel--parsing-users {
  margin-top: 0;
}

html:has(.gram-parsing-page--users.gram-spam-pm-page) .panel-modal-overlay {
  backdrop-filter: blur(6px);
}

/* spam_pm A+B+C — GramGPT UI на базе парсера */
.gram-parsing-page--users.gram-spam-pm-page .gram-spam-pm-tempo-collapse {
  border: none;
  margin: 0;
  padding: 0;
}

.gram-parsing-page--users.gram-spam-pm-page .gram-spam-pm-tempo-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  list-style: none;
  cursor: pointer;
}

.gram-parsing-page--users.gram-spam-pm-page .gram-spam-pm-tempo-summary::-webkit-details-marker {
  display: none;
}

.gram-parsing-page--users.gram-spam-pm-page .gram-spam-pm-tempo-inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 0;
}

.gram-parsing-page--users.gram-spam-pm-page .gram-spam-pm-tempo-block {
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 10px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

html.theme-dark .gram-parsing-page--users.gram-spam-pm-page .gram-spam-pm-tempo-block {
  border-color: rgba(0, 136, 204, 0.12);
  background:
    linear-gradient(180deg, rgba(0, 136, 204, 0.06) 0%, rgba(0, 136, 204, 0) 100%),
    rgba(16, 23, 38, 0.55);
  box-shadow:
    inset 0 1px 0 rgba(0, 136, 204, 0.06),
    0 16px 36px -28px rgba(2, 10, 25, 0.9);
}

.gram-parsing-page--users.gram-spam-pm-page .gram-spam-pm-tempo-block-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.gram-parsing-page--users.gram-spam-pm-page .gram-spam-pm-tempo-block-title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
}

.gram-parsing-page--users.gram-spam-pm-page .gram-spam-pm-delay-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.gram-parsing-page--users.gram-spam-pm-page .gram-spam-pm-delay-row:last-child {
  border-bottom: none;
}

.gram-parsing-page--users.gram-spam-pm-page .gram-spam-pm-delay-label {
  font-size: 12px;
  font-weight: 500;
  color: #334155;
}

html.theme-dark .gram-parsing-page--users.gram-spam-pm-page .gram-spam-pm-delay-label {
  color: #cbd5e1;
}

.gram-parsing-page--users.gram-spam-pm-page .gram-spam-pm-delay-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.gram-parsing-page--users.gram-spam-pm-page .gram-spam-pm-delay-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  background: rgba(255, 255, 255, 0.55);
  color: inherit;
  cursor: pointer;
}

html.theme-dark .gram-parsing-page--users.gram-spam-pm-page .gram-spam-pm-delay-btn {
  border-color: rgba(0, 136, 204, 0.12);
  background:
    linear-gradient(180deg, rgba(0, 136, 204, 0.06) 0%, rgba(0, 136, 204, 0) 100%),
    rgba(16, 23, 38, 0.55);
  color: #e2e8f0;
}

.gram-parsing-page--users.gram-spam-pm-page .gram-spam-pm-delay-val {
  min-width: 28px;
  text-align: center;
  font-weight: 700;
  font-size: 12px;
  color: #0088cc;
  font-variant-numeric: tabular-nums;
}

html.theme-dark .gram-parsing-page--users.gram-spam-pm-page .gram-spam-pm-delay-val {
  color: #00aced;
}

.gram-parsing-page--users.gram-spam-pm-page .gram-spam-pm-preview-flow {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 160px;
}

.gram-parsing-page--users.gram-spam-pm-page .gram-spam-pm-preview-user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
}

.gram-parsing-page--users.gram-spam-pm-page .gram-spam-pm-preview-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 136, 204, 0.14);
  color: #00aced;
  font-size: 12px;
  font-weight: 700;
}

.gram-parsing-page--users.gram-spam-pm-page .gram-spam-pm-preview-bubble {
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.4;
}

.gram-parsing-page--users.gram-spam-pm-page .gram-spam-pm-preview-bubble.is-out {
  align-self: flex-start;
  background: rgba(0, 136, 204, 0.1);
  border: 1px solid rgba(0, 136, 204, 0.22);
}

.gram-parsing-page--users.gram-spam-pm-page .gram-spam-pm-preview-bubble.is-in {
  align-self: flex-end;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.gram-parsing-page--users.gram-spam-pm-page .gram-spam-pm-preview-wait,
.gram-parsing-page--users.gram-spam-pm-page .gram-spam-pm-preview-status {
  font-size: 12px;
  color: var(--text-muted, #94a3b8);
  display: flex;
  align-items: center;
  gap: 6px;
}

.gram-parsing-page--users.gram-spam-pm-page .gram-spam-pm-greeting-tabs {
  margin-bottom: 10px;
}

.gram-parsing-page--users.gram-spam-pm-page .gram-spam-pm-greeting-block {
  min-width: 0;
}

.gram-parsing-page--users.gram-spam-pm-page .gram-spam-pm-greeting-card {
  margin-bottom: 0;
}

.gram-parsing-page--users.gram-spam-pm-page .gram-spam-pm-greeting-text {
  display: block;
  width: 100%;
  min-height: 150px;
  resize: vertical;
}

.gram-parsing-page--users.gram-spam-pm-page .gram-spam-pm-fallback-block {
  margin-top: 12px;
}

.gram-parsing-page--users.gram-spam-pm-page .gram-spam-pm-var-bar,
.gram-parsing-page--users.gram-spam-pm-page .gram-spam-pm-format-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 8px;
}

.gram-parsing-page--users.gram-spam-pm-page .gram-spam-pm-var-chip,
.gram-parsing-page--users.gram-spam-pm-page .gram-spam-pm-format-chip,
.gram-parsing-page--users.gram-spam-pm-page .gram-spam-pm-format-btn {
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  padding: 4px 8px;
  font-size: 11px;
  cursor: pointer;
}

html.theme-dark .gram-parsing-page--users.gram-spam-pm-page .gram-spam-pm-var-chip,
html.theme-dark .gram-parsing-page--users.gram-spam-pm-page .gram-spam-pm-format-chip,
html.theme-dark .gram-parsing-page--users.gram-spam-pm-page .gram-spam-pm-format-btn {
  border-color: rgba(96, 150, 220, 0.12);
  background: rgba(15, 23, 42, 0.45);
  color: #e2e8f0;
}

.gram-parsing-page--users.gram-spam-pm-page .gram-spam-pm-format-chip.active {
  border-color: rgba(0, 136, 204, 0.55);
  background: rgba(0, 136, 204, 0.12);
  color: #0088cc;
}

html.theme-dark .gram-parsing-page--users.gram-spam-pm-page .gram-spam-pm-format-chip.active {
  color: #00aced;
}

.gram-parsing-page--users.gram-spam-pm-page .gram-spam-pm-msg-type.active {
  background: linear-gradient(135deg, #0088cc, #00aced);
  border-color: transparent;
  color: #fff;
  box-shadow: none;
}

.gram-parsing-page--users.gram-spam-pm-page .gram-spam-pm-msg-card {
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

html.theme-dark .gram-parsing-page--users.gram-spam-pm-page .gram-spam-pm-msg-card {
  border-color: rgba(0, 136, 204, 0.12);
  background:
    linear-gradient(180deg, rgba(0, 136, 204, 0.06) 0%, rgba(0, 136, 204, 0) 100%),
    rgba(16, 23, 38, 0.55);
  box-shadow:
    inset 0 1px 0 rgba(0, 136, 204, 0.06),
    0 16px 36px -28px rgba(2, 10, 25, 0.9);
}

.gram-parsing-page--users.gram-spam-pm-page .gram-spam-pm-msg-card-head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 10px;
}

.gram-parsing-page--users.gram-spam-pm-page .gram-spam-pm-msg-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.gram-parsing-page--users.gram-spam-pm-page .gram-spam-pm-msg-status {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}

html.theme-dark .gram-parsing-page--users.gram-spam-pm-page .gram-spam-pm-msg-status {
  color: #94a3b8;
}

.gram-parsing-page--users.gram-spam-pm-page .gram-spam-pm-msg-label {
  display: block;
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
}

.gram-parsing-page--users.gram-spam-pm-page .gram-spam-pm-msg-num {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 136, 204, 0.14);
  color: #00aced;
  font-size: 12px;
  font-weight: 700;
}

.gram-parsing-page--users.gram-spam-pm-page .gram-spam-pm-msg-types {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  flex: 1;
  overflow-x: auto;
  padding-bottom: 2px;
}

.gram-parsing-page--users.gram-spam-pm-page .gram-spam-pm-msg-type {
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  padding: 4px 6px;
  font-size: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

html.theme-dark .gram-parsing-page--users.gram-spam-pm-page .gram-spam-pm-msg-type {
  border-color: rgba(96, 150, 220, 0.12);
  background: rgba(15, 23, 42, 0.45);
  color: #e2e8f0;
}

.gram-parsing-page--users.gram-spam-pm-page .gram-spam-pm-msg-card-actions {
  display: inline-flex;
  gap: 4px;
}

.gram-parsing-page--users.gram-spam-pm-page .gram-spam-pm-msg-move,
.gram-parsing-page--users.gram-spam-pm-page .gram-spam-pm-msg-del {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.12);
  cursor: pointer;
}

.gram-parsing-page--users.gram-spam-pm-page .gram-spam-pm-add-msg {
  width: 100%;
  justify-content: center;
  margin-top: 8px;
  border: 1px dashed rgba(0, 136, 204, 0.45);
  border-radius: 10px;
  padding: 10px 14px;
  color: #0088cc;
  background: transparent;
}

html.theme-dark .gram-parsing-page--users.gram-spam-pm-page .gram-spam-pm-add-msg {
  color: #00aced;
  border-color: rgba(0, 136, 204, 0.35);
}

.gram-parsing-page--users.gram-spam-pm-page .gram-spam-pm-work-pills {
  margin-bottom: 10px;
}

/* spam_pm: pills и режимы — parser cyan, без радуги */
html:not(.theme-dark) .gram-parsing-page--users.gram-spam-pm-page .gram-gpt-pill:not(.active) {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(0, 136, 204, 0.18);
  color: #475569;
}

html.theme-dark .gram-parsing-page--users.gram-spam-pm-page .gram-gpt-pill:not(.active) {
  background: rgba(16, 23, 38, 0.55);
  border-color: rgba(0, 136, 204, 0.12);
  color: #cbd5e1;
}

.gram-parsing-page--users.gram-spam-pm-page .gram-gpt-pill.active {
  background: rgba(0, 136, 204, 0.1);
  border-color: rgba(0, 136, 204, 0.45);
  color: #0088cc;
  box-shadow: none;
}

html.theme-dark .gram-parsing-page--users.gram-spam-pm-page .gram-gpt-pill.active {
  background: rgba(0, 136, 204, 0.14);
  border-color: rgba(0, 136, 204, 0.45);
  color: #00aced;
  box-shadow: none;
}

.gram-parsing-page--users.gram-spam-pm-page .gram-spam-source-tabs.gram-gpt-pill-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.gram-parsing-page--users.gram-spam-pm-page .gram-spam-source-tab {
  width: 100%;
  justify-content: center;
}

html:not(.theme-dark) .gram-parsing-page--users.gram-spam-pm-page .gram-gpt-mode-card {
  background: rgba(255, 255, 255, 0.55);
  border-color: rgba(148, 163, 184, 0.3);
}

html.theme-dark .gram-parsing-page--users.gram-spam-pm-page .gram-gpt-mode-card {
  background: rgba(16, 23, 38, 0.35);
  border-color: rgba(0, 136, 204, 0.12);
}

.gram-parsing-page--users.gram-spam-pm-page .gram-gpt-mode-card.active {
  border-color: rgba(0, 136, 204, 0.55);
  box-shadow: 0 0 0 1px rgba(0, 136, 204, 0.2);
  background: rgba(0, 136, 204, 0.06);
}

html.theme-dark .gram-parsing-page--users.gram-spam-pm-page .gram-gpt-mode-card.active {
  background: rgba(0, 136, 204, 0.08);
}

.gram-parsing-page--users.gram-spam-pm-page .gram-gpt-mode-icon {
  background: linear-gradient(135deg, #0088cc, #00aced) !important;
  color: #fff !important;
}

.gram-parsing-page--users.gram-spam-pm-page .gram-spam-pm-mode-panel + .gram-spam-pm-mode-panel {
  margin-top: 0;
}

.gram-parsing-page--users.gram-spam-pm-page .gram-parsing-users-col-right > .gram-gpt-window,
.gram-parsing-page--users.gram-spam-pm-page .gram-spam-pm-mode-panel > .gram-gpt-window {
  margin-bottom: 12px;
}

@media (max-width: 720px) {
  .gram-parsing-page--users.gram-spam-pm-page .gram-spam-pm-msg-types {
    width: 100%;
  }
}

/* ===== gram-tasks-page (served via gram-ui until panel reload; source: gram-tasks-page.css) ===== */
/* Страница «Задачи» — split как GramGPT, токены как спамер (#152238 / #0088cc). Спамер не трогаем. */

html body .gram-tasks-page,
html.theme-dark body .gram-tasks-page,
html:not(.theme-dark) body .gram-tasks-page {
  --tasks-card-bg: #ffffff;
  --tasks-card-border: rgba(148, 163, 184, 0.28);
  --tasks-muted: #64748b;
  --tasks-text: #0f172a;
  --tasks-accent: #0088cc;
  --tasks-page-bg: transparent;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: calc(100vh - 7rem);
  box-sizing: border-box;
}

html.theme-dark body .gram-tasks-page {
  --tasks-card-bg: #152238;
  --tasks-card-border: rgba(71, 100, 150, 0.28);
  --tasks-muted: #94a3b8;
  --tasks-text: #e2e8f0;
}

.gram-tasks-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.gram-tasks-page-title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--tasks-text);
  letter-spacing: -0.02em;
}

.gram-tasks-page-sub {
  margin: 0.35rem 0 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--tasks-muted);
  max-width: 40rem;
}

.gram-tasks-page-live {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--tasks-accent);
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(0, 136, 204, 0.12);
}

.gram-tasks-page-live .pi {
  font-size: 0.45rem;
}

.gram-tasks-page-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.gram-tasks-page-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.gram-tasks-page-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 36px;
  padding: 0 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--tasks-card-border);
  background: var(--tasks-card-bg);
  color: var(--tasks-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.gram-tasks-page-tab.is-active {
  background: var(--tasks-accent);
  border-color: var(--tasks-accent);
  color: #fff;
}

.gram-tasks-page-tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  font-size: 0.7rem;
  font-weight: 700;
}

.gram-tasks-page-tab:not(.is-active) .gram-tasks-page-tab-badge {
  background: rgba(0, 136, 204, 0.15);
  color: var(--tasks-accent);
}

.gram-tasks-page-filters-wrap {
  margin-left: auto;
  position: relative;
}

.gram-tasks-page-filters-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 36px;
  padding: 0 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--tasks-card-border);
  background: var(--tasks-card-bg);
  color: var(--tasks-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.gram-tasks-page-filters-body {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 40;
  min-width: min(420px, 86vw);
  padding: 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--tasks-card-border);
  background: var(--tasks-card-bg);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}

.gram-tasks-page-filters-wrap.is-open .gram-tasks-page-filters-body {
  display: block;
}

.gram-tasks-page-split {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  gap: 0.75rem;
  flex: 1 1 auto;
  min-height: 420px;
  align-items: stretch;
}

.gram-tasks-page-list,
.gram-tasks-page-detail {
  border: 1px solid var(--tasks-card-border);
  border-radius: 14px;
  background: var(--tasks-card-bg);
  min-height: 420px;
  max-height: calc(100vh - 14rem);
  overflow: auto;
  box-sizing: border-box;
}

.gram-tasks-page-list[hidden] {
  display: none !important;
}

.gram-tasks-page-list-inner {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.75rem;
}

.gram-tasks-page .gram-tasks-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 280px;
  color: var(--tasks-muted);
  text-align: center;
  padding: 1.5rem;
}

.gram-tasks-page .gram-tasks-empty .pi {
  font-size: 1.75rem;
  opacity: 0.55;
}

.gram-tasks-page-detail-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-height: 100%;
  min-height: 380px;
  margin: 1rem;
  border: 2px dashed rgba(148, 163, 184, 0.28);
  border-radius: 12px;
  color: var(--tasks-muted);
  text-align: center;
  box-sizing: border-box;
}

html.theme-dark .gram-tasks-page-detail-empty {
  border-color: rgba(71, 100, 150, 0.35);
}

.gram-tasks-page-detail-empty .pi {
  font-size: 1.35rem;
  opacity: 0.7;
}

.gram-tasks-page-detail-empty p {
  margin: 0;
  font-size: 0.9rem;
}

/* --- карточки списка --- */
.gram-tasks-page .gram-tasks-active-card,
.gram-tasks-page .gram-tasks-hist-card {
  border: 1px solid var(--tasks-card-border);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.03);
  padding: 0.75rem 0.85rem;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

html.theme-dark .gram-tasks-page .gram-tasks-active-card,
html.theme-dark .gram-tasks-page .gram-tasks-hist-card {
  background: rgba(0, 0, 0, 0.18);
}

.gram-tasks-page .gram-tasks-active-card.is-expanded,
.gram-tasks-page .gram-tasks-hist-card.is-expanded,
.gram-tasks-page .gram-tasks-active-card:hover,
.gram-tasks-page .gram-tasks-hist-card:hover {
  border-color: rgba(0, 136, 204, 0.55);
  box-shadow: 0 0 0 1px rgba(0, 136, 204, 0.2);
}

.gram-tasks-hist-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.65rem;
  align-items: start;
}

.gram-tasks-hist-card-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #fff;
  background: linear-gradient(135deg, #0088cc, #0077b3);
  flex-shrink: 0;
}

.gram-tasks-hist-card-main {
  min-width: 0;
}

.gram-tasks-hist-card-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 650;
  color: var(--tasks-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gram-tasks-hist-card-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  color: var(--tasks-muted);
}

.gram-tasks-hist-card-time {
  font-size: 0.75rem;
  color: var(--tasks-muted);
  white-space: nowrap;
}

.gram-tasks-page .gram-tasks-active-card-actions .gram-tasks-eye-btn {
  display: none;
}

.gram-tasks-page .gram-tasks-detail-card {
  padding: 1rem 1.1rem 1.25rem;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.gram-tasks-page .gram-tasks-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.gram-tasks-page .gram-tasks-detail-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--tasks-text);
}

.gram-tasks-page .gram-tasks-detail-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--tasks-card-border);
  background: transparent;
  color: var(--tasks-muted);
  cursor: pointer;
}

.gram-tasks-page .journal-pagination {
  padding: 0.5rem 0.75rem 0.85rem;
}

@media (max-width: 960px) {
  .gram-tasks-page-split {
    grid-template-columns: 1fr;
  }

  .gram-tasks-page-list,
  .gram-tasks-page-detail {
    max-height: none;
    min-height: 280px;
  }
}

/* ========== prompt editor: Save = accounts blue; slider = minutes-of-work ========== */
.gram-prompt-modal-sheet .gram-prompt-foot .gram-gpt-btn-primary,
.gram-prompt-modal-profile .gram-prompt-foot .gram-gpt-btn-primary {
  background: linear-gradient(135deg, #0088cc, #00aced) !important;
  border-color: transparent !important;
  color: #fff !important;
  box-shadow: 0 4px 14px rgba(0, 136, 204, 0.35) !important;
}

.gram-prompt-modal-sheet .gram-prompt-len-slider {
  overflow: visible !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.gram-prompt-modal-sheet .gram-prompt-len-slider .gram-parsing-slider-head {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  margin-bottom: 8px !important;
}

.gram-prompt-modal-sheet .gram-prompt-len-slider .gram-parsing-slider-label {
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  color: inherit !important;
}

.gram-prompt-modal-sheet .gram-prompt-len-slider .gram-parsing-slider-value {
  font-size: 13px !important;
  font-weight: 700 !important;
  color: #0088cc !important;
}

.gram-prompt-modal-sheet .gram-prompt-len-slider .gram-parsing-slider-track {
  position: relative !important;
  overflow: visible !important;
  height: 5px !important;
  border-radius: 999px !important;
  background: rgba(148, 163, 184, 0.28) !important;
}

.gram-prompt-modal-sheet .gram-prompt-len-slider .gram-parsing-slider-fill {
  position: absolute !important;
  top: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  z-index: 1 !important;
  pointer-events: none !important;
  border-radius: inherit !important;
  background: #0088cc !important;
}

.gram-prompt-modal-sheet .gram-prompt-len-slider .gram-parsing-slider-track::after {
  content: "" !important;
  position: absolute !important;
  left: var(--ml-thumb-pct, 0%) !important;
  top: 50% !important;
  width: 16px !important;
  height: 16px !important;
  margin-left: -8px !important;
  margin-top: -8px !important;
  border-radius: 50% !important;
  border: 2px solid #fff !important;
  background: #0088cc !important;
  box-shadow: 0 0 0 1px rgba(0, 136, 204, 0.35), 0 2px 8px rgba(0, 136, 204, 0.45) !important;
  z-index: 7 !important;
  pointer-events: none !important;
  box-sizing: border-box !important;
}

.gram-prompt-modal-sheet .gram-prompt-len-slider .gram-parsing-slider-input,
.gram-prompt-modal-sheet .gram-prompt-len-slider .gram-spam-pm-dual-input {
  position: absolute !important;
  inset: -8px 0 !important;
  width: 100% !important;
  height: 21px !important;
  margin: 0 !important;
  background: transparent !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  cursor: pointer !important;
  z-index: 5 !important;
  opacity: 1 !important;
}

.gram-prompt-modal-sheet .gram-prompt-len-slider .gram-parsing-slider-input::-webkit-slider-runnable-track,
.gram-prompt-modal-sheet .gram-prompt-len-slider .gram-spam-pm-dual-input::-webkit-slider-runnable-track {
  height: 5px !important;
  background: transparent !important;
  border: none !important;
}

.gram-prompt-modal-sheet .gram-prompt-len-slider .gram-parsing-slider-input::-webkit-slider-thumb,
.gram-prompt-modal-sheet .gram-prompt-len-slider .gram-spam-pm-dual-input::-webkit-slider-thumb {
  pointer-events: auto !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  width: 16px !important;
  height: 16px !important;
  margin-top: -5.5px !important;
  border-radius: 50% !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  opacity: 0 !important;
  position: relative !important;
  z-index: 6 !important;
}

.gram-prompt-modal-sheet .gram-prompt-len-slider .gram-parsing-slider-input::-moz-range-track,
.gram-prompt-modal-sheet .gram-prompt-len-slider .gram-spam-pm-dual-input::-moz-range-track {
  height: 5px !important;
  background: transparent !important;
  border: none !important;
}

.gram-prompt-modal-sheet .gram-prompt-len-slider .gram-parsing-slider-input::-moz-range-thumb,
.gram-prompt-modal-sheet .gram-prompt-len-slider .gram-spam-pm-dual-input::-moz-range-thumb {
  pointer-events: auto !important;
  width: 16px !important;
  height: 16px !important;
  border-radius: 50% !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  opacity: 0 !important;
  position: relative !important;
  z-index: 6 !important;
}

/* ========== ND inbox v512: Telegram dark / light ========== */
html.theme-dark .gram-neurodialogues-page .gram-nd-inbox-shell {
  --nd-tg-sidebar: #17212b;
  --nd-tg-chat: #0e1621;
  --nd-tg-border: #0e1621;
  --nd-tg-hover: #202b36;
  --nd-tg-active: #2b5278;
  --nd-tg-text: #f5f5f5;
  --nd-tg-muted: #708499;
  --nd-tg-bubble-in: #182533;
  --nd-tg-bubble-out: #2b5278;
  --nd-tg-composer: #17212b;
  --nd-tg-input: #242f3d;
  --nd-tg-accent: #2aabee;
  border: none !important;
  border-radius: 0 !important;
  background: var(--nd-tg-chat) !important;
  box-shadow: none !important;
  min-height: min(640px, 70vh) !important;
}
html:not(.theme-dark) .gram-neurodialogues-page .gram-nd-inbox-shell {
  --nd-tg-sidebar: #ffffff;
  --nd-tg-chat: #e6ebee;
  --nd-tg-border: #dfe5eb;
  --nd-tg-hover: #f4f4f5;
  --nd-tg-active: #e7f0f8;
  --nd-tg-text: #0f1419;
  --nd-tg-muted: #707579;
  --nd-tg-bubble-in: #ffffff;
  --nd-tg-bubble-out: #effdde;
  --nd-tg-composer: #ffffff;
  --nd-tg-input: #f4f4f5;
  --nd-tg-accent: #3390ec;
  border: 1px solid var(--nd-tg-border) !important;
  border-radius: 12px !important;
  background: var(--nd-tg-chat) !important;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06) !important;
  min-height: min(640px, 70vh) !important;
}
.gram-neurodialogues-page .gram-nd-inbox-body {
  min-height: min(640px, 70vh) !important;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr) !important;
}
.gram-neurodialogues-page .gram-nd-sidebar {
  background: var(--nd-tg-sidebar) !important;
  border-right: 1px solid color-mix(in srgb, var(--nd-tg-border) 80%, transparent) !important;
  padding: 8px 0 0 !important;
  gap: 0 !important;
}
.gram-neurodialogues-page .gram-nd-search-row {
  padding: 8px 12px 6px !important;
  gap: 6px !important;
}
.gram-neurodialogues-page .gram-nd-search-wrap {
  border-radius: 22px !important;
  border: none !important;
  background: var(--nd-tg-input) !important;
  padding: 0 14px !important;
}
.gram-neurodialogues-page .gram-nd-search-input {
  color: var(--nd-tg-text) !important;
  font-size: 14px !important;
  padding: 9px 0 !important;
}
.gram-neurodialogues-page .gram-nd-acc-select-wrap {
  padding: 4px 12px 8px !important;
}
.gram-neurodialogues-page .gram-nd-acc-select {
  border-radius: 10px !important;
  border: none !important;
  background: var(--nd-tg-input) !important;
  color: var(--nd-tg-text) !important;
  font-size: 13px !important;
}
.gram-neurodialogues-page .gram-nd-dialog-list {
  padding: 0 !important;
}
.gram-neurodialogues-page .gram-nd-dialog {
  padding: 9px 12px !important;
  gap: 10px !important;
  border-bottom: none !important;
  border-radius: 0 !important;
  transition: background 0.1s ease !important;
}
.gram-neurodialogues-page .gram-nd-dialog:hover {
  background: var(--nd-tg-hover) !important;
}
.gram-neurodialogues-page .gram-nd-dialog.is-active {
  background: var(--nd-tg-active) !important;
}
.gram-neurodialogues-page .gram-nd-dialog-name {
  color: var(--nd-tg-text) !important;
  font-size: 16px !important;
  font-weight: 500 !important;
}
.gram-neurodialogues-page .gram-nd-dialog.has-unread .gram-nd-dialog-name {
  font-weight: 600 !important;
}
.gram-neurodialogues-page .gram-nd-dialog-preview,
.gram-neurodialogues-page .gram-nd-dialog-time,
.gram-neurodialogues-page .gram-nd-dialog-acc {
  color: var(--nd-tg-muted) !important;
}
.gram-neurodialogues-page .gram-nd-dialog.has-unread .gram-nd-dialog-preview {
  color: var(--nd-tg-text) !important;
}
.gram-neurodialogues-page .gram-nd-dialog-bottom {
  display: flex !important;
  width: 100% !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  min-width: 0 !important;
}
.gram-neurodialogues-page .gram-nd-dialog-trail {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  flex-shrink: 0 !important;
  margin-left: auto !important;
}
.gram-neurodialogues-page .gram-nd-dialog-checks {
  color: #5ac8fa !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  letter-spacing: -1px !important;
}
.gram-neurodialogues-page .gram-nd-dialog-unread {
  background: #8e8e93 !important;
  min-width: 22px !important;
  height: 22px !important;
  border-radius: 11px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 22px !important;
  margin-left: 0 !important;
}
.gram-neurodialogues-page .gram-nd-dialog.has-unread .gram-nd-dialog-unread {
  background: var(--nd-tg-accent, #2aabee) !important;
}
.gram-neurodialogues-page .gram-nd-paused {
  color: #e2a33b !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  background: color-mix(in srgb, #e2a33b 16%, transparent);
  padding: 1px 6px;
  border-radius: 8px;
}
.gram-neurodialogues-page .gram-nd-dialog-avatar,
.gram-neurodialogues-page .gram-nd-chat-head-avatar {
  width: 54px !important;
  height: 54px !important;
  font-size: 18px !important;
  background: color-mix(in srgb, var(--nd-tg-accent) 55%, #1b2734) !important;
  color: #fff !important;
}
.gram-neurodialogues-page .gram-nd-chat {
  background: var(--nd-tg-chat) !important;
}
.gram-neurodialogues-page .gram-nd-chat-head {
  background: var(--nd-tg-sidebar) !important;
  border-bottom: 1px solid color-mix(in srgb, var(--nd-tg-border) 70%, transparent) !important;
  padding: 10px 16px !important;
}
.gram-neurodialogues-page .gram-nd-chat-head-main strong {
  color: var(--nd-tg-text) !important;
  font-size: 15px !important;
  font-weight: 600 !important;
}
.gram-neurodialogues-page .gram-nd-chat-head-acc {
  color: var(--nd-tg-muted) !important;
}
.gram-neurodialogues-page .gram-nd-chat-messages {
  background-color: var(--nd-tg-chat) !important;
  background-image: none !important;
  padding: 12px 16px 20px !important;
  gap: 4px !important;
}
html.theme-dark .gram-neurodialogues-page .gram-nd-chat-messages {
  background-image:
    radial-gradient(ellipse at 12% 0%, rgba(42, 171, 238, 0.05), transparent 42%),
    radial-gradient(ellipse at 88% 100%, rgba(42, 171, 238, 0.04), transparent 40%) !important;
}
html:not(.theme-dark) .gram-neurodialogues-page .gram-nd-chat-messages {
  background-image:
    radial-gradient(ellipse at 20% 0%, rgba(51, 144, 236, 0.06), transparent 45%) !important;
}
.gram-neurodialogues-page .gram-nd-bubble {
  max-width: min(75%, 420px) !important;
  padding: 6px 10px 4px !important;
  border-radius: 12px !important;
  font-size: 14.5px !important;
  line-height: 1.35 !important;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08) !important;
  color: var(--nd-tg-text) !important;
}
.gram-neurodialogues-page .gram-nd-bubble.is-user {
  align-self: flex-start !important;
  background: var(--nd-tg-bubble-in) !important;
  border-top-left-radius: 4px !important;
}
.gram-neurodialogues-page .gram-nd-bubble.is-ai,
.gram-neurodialogues-page .gram-nd-bubble.is-other {
  align-self: flex-end !important;
  background: var(--nd-tg-bubble-out) !important;
  border-top-right-radius: 4px !important;
}
html:not(.theme-dark) .gram-neurodialogues-page .gram-nd-bubble.is-ai,
html:not(.theme-dark) .gram-neurodialogues-page .gram-nd-bubble.is-other {
  color: #000 !important;
}
.gram-neurodialogues-page .gram-nd-bubble-time {
  color: var(--nd-tg-muted) !important;
  font-size: 11px !important;
  opacity: 0.85 !important;
}
.gram-neurodialogues-page .gram-nd-reply-form {
  background: var(--nd-tg-composer) !important;
  border-top: 1px solid color-mix(in srgb, var(--nd-tg-border) 70%, transparent) !important;
  padding: 8px 10px 10px !important;
}
.gram-neurodialogues-page .gram-nd-reply-input {
  border: none !important;
  border-radius: 22px !important;
  background: var(--nd-tg-input) !important;
  color: var(--nd-tg-text) !important;
  padding: 11px 16px !important;
  min-height: 42px !important;
  resize: none !important;
}
.gram-neurodialogues-page .gram-nd-reply-send {
  width: 42px !important;
  height: 42px !important;
  border-radius: 50% !important;
  background: var(--nd-tg-accent) !important;
  border: none !important;
  color: #fff !important;
}
.gram-neurodialogues-page .gram-nd-chat-placeholder {
  color: var(--nd-tg-muted) !important;
}
.gram-neurodialogues-page .gram-nd-chat-placeholder strong {
  color: var(--nd-tg-text) !important;
}
/* BuyPremiumDialog GramGPT-style */
#panelModal:has(.buy-premium-dialog) .panel-modal-card.gram-gpt-profile-sheet{
  width:min(440px,calc(100vw - 28px))!important;
  max-width:440px!important;
  border-radius:22px;
  overflow:hidden;
  position:relative;
  background:linear-gradient(165deg,rgba(48,36,28,.55) 0%,rgba(18,24,38,.96) 28%,rgba(14,18,30,.98) 100%);
  border:1px solid rgba(255,255,255,.1);
  box-shadow:
    0 0 0 1px rgba(251,191,36,.06),
    0 28px 72px rgba(0,0,0,.55),
    0 0 80px rgba(245,158,11,.12),
    inset 0 1px 0 rgba(255,255,255,.06);
  backdrop-filter:blur(18px);
}
#panelModal:has(.buy-premium-dialog) .panel-modal-card.gram-gpt-profile-sheet::before{
  content:"";
  position:absolute;inset:0 auto auto 0;width:220px;height:160px;pointer-events:none;z-index:0;
  background:radial-gradient(ellipse at 20% 10%,rgba(245,158,11,.28),transparent 70%);
}
#panelModal:has(.buy-premium-dialog) .panel-modal-card.gram-gpt-profile-sheet>*{position:relative;z-index:1}
#panelModal:has(.buy-premium-dialog) .gram-modal-icon-orange{
  background:linear-gradient(145deg,#f59e0b,#ea580c);
  box-shadow:0 0 24px rgba(245,158,11,.45);
  border-radius:50%;
}
#panelModal:has(.buy-premium-dialog) .panel-modal-header{
  background:transparent;border-bottom:none;padding:1.15rem 1.25rem .35rem;
}
#panelModal:has(.buy-premium-dialog) .panel-modal-body{padding:.5rem 1.15rem 1rem}
#panelModal:has(.buy-premium-dialog) .panel-modal-footer.buy-premium-footer{
  background:transparent;border-top:none;padding:.25rem 1.15rem 1.15rem;gap:.75rem;justify-content:stretch;
}
#panelModal:has(.buy-premium-dialog) .pd-btn-cancel,
#panelModal:has(.buy-premium-dialog) .gpt-ep-cancel.pd-btn-cancel{
  flex:1;border-radius:999px;height:2.75rem;
  background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.1);color:#e2e8f0;
}
#panelModal:has(.buy-premium-dialog) .pd-btn-pay{
  flex:1.15;border-radius:999px;height:2.75rem;font-weight:600;
  background:#0088cc!important;border:none!important;
  box-shadow:0 8px 24px rgba(0,136,204,.35);
}
html:not(.theme-dark) #panelModal:has(.buy-premium-dialog) .panel-modal-card.gram-gpt-profile-sheet{
  background:linear-gradient(165deg,#fff7ed 0%,#fff 24%,#f8fafc 100%);
  border-color:rgba(15,23,42,.1);
  box-shadow:0 24px 64px rgba(15,23,42,.16),0 0 48px rgba(245,158,11,.08);
}
html:not(.theme-dark) #panelModal:has(.buy-premium-dialog) .panel-modal-card.gram-gpt-profile-sheet::before{
  background:radial-gradient(ellipse at 20% 10%,rgba(245,158,11,.18),transparent 70%);
}

.buy-premium-dialog{
  --tg-blue:#08c;--tg-blue-soft:rgba(0,136,204,.12);--tg-blue-ring:rgba(0,136,204,.35);
  --tg-fg:var(--text,#e7eef5);--tg-fg-mute:var(--text-muted,#8b97a6);
  --tg-bg-card:rgba(255,255,255,.045);--tg-bg-soft:rgba(0,0,0,.28);
  --tg-border:rgba(255,255,255,.09);--tg-border-strong:rgba(255,255,255,.14);
  display:flex;flex-direction:column;gap:.75rem;
}
html:not(.theme-dark) .buy-premium-dialog{
  --tg-fg:#1e293b;--tg-fg-mute:#64748b;--tg-bg-card:#fff;--tg-bg-soft:#f1f5f9;
  --tg-border:rgba(15,23,42,.08);--tg-border-strong:rgba(15,23,42,.14);
}
.buy-premium-dialog .pd-prep-line{
  display:flex;align-items:center;gap:.55rem;color:var(--tg-fg-mute);font-size:.875rem;padding:0 .15rem;
}
.buy-premium-dialog .pd-prep-line[hidden],
.buy-premium-dialog .pd-loading[hidden],
.buy-premium-dialog .pd-body[hidden],
.buy-premium-dialog .pd-status[hidden],
.buy-premium-dialog #pdGiftSelect[hidden]{display:none!important}
.buy-premium-dialog:not(.is-preparing) .pd-prep-line{display:none!important}
.buy-premium-dialog .pd-inner-card{
  background:var(--tg-bg-soft);
  border:1px solid var(--tg-border);
  border-radius:18px;
  padding:1rem;
  min-height:4.5rem;
}
.buy-premium-dialog:not(.is-preparing) .pd-inner-card{
  background:transparent;border:none;padding:0;min-height:0;
}
.buy-premium-dialog .pd-loading{
  display:flex;align-items:center;justify-content:center;gap:.625rem;
  color:var(--tg-fg-mute);font-size:.875rem;padding:1.75rem 1rem;
}
.buy-premium-dialog .pd-body{display:flex;flex-direction:column;gap:.85rem}
.buy-premium-dialog .pd-plan-card,
.buy-premium-dialog .pd-pay-card{
  display:flex;flex-direction:column;gap:.7rem;
  background:rgba(255,255,255,.03);
  border:1px solid var(--tg-border);
  border-radius:16px;
  padding:.85rem;
}
html:not(.theme-dark) .buy-premium-dialog .pd-plan-card,
html:not(.theme-dark) .buy-premium-dialog .pd-pay-card{
  background:#fff;border-color:rgba(15,23,42,.08);
  box-shadow:0 1px 2px rgba(15,23,42,.04);
}
.buy-premium-dialog .pd-section{display:flex;flex-direction:column;gap:.625rem}
.buy-premium-dialog .pd-section-label{color:var(--tg-fg-mute);font-size:.7rem;font-weight:600;letter-spacing:.06em;text-transform:uppercase}
.buy-premium-dialog .pd-price{
  background:transparent;border:none;border-radius:0;padding:.15rem .1rem;
}
.buy-premium-dialog .pd-price-row{display:flex;align-items:center;justify-content:space-between;gap:1rem}
.buy-premium-dialog .pd-price-label{color:var(--tg-fg);font-size:.9rem;font-weight:600}
.buy-premium-dialog .pd-price-value{color:#fbbf24;font-size:1.35rem;font-weight:700;letter-spacing:-.01em}
html:not(.theme-dark) .buy-premium-dialog .pd-price-value{color:#b45309}
.buy-premium-dialog .pd-card-grid{display:grid;gap:.625rem;grid-template-columns:repeat(2,1fr)}
.buy-premium-dialog .pd-field-number{grid-column:1/-1}
.buy-premium-dialog .pd-field{display:flex;flex-direction:column;gap:.3125rem}
.buy-premium-dialog .pd-field-label{color:var(--tg-fg-mute);font-size:.75rem;font-weight:500}
.buy-premium-dialog .pd-input{
  background:rgba(0,0,0,.28);border:1px solid var(--tg-border);border-radius:.75rem;
  color:var(--tg-fg);font-size:.875rem;height:2.55rem;padding:0 .875rem;width:100%;
}
html:not(.theme-dark) .buy-premium-dialog .pd-input{background:#f8fafc}
.buy-premium-dialog .pd-input:focus{border-color:var(--tg-blue);box-shadow:0 0 0 3px var(--tg-blue-soft);outline:none}
.buy-premium-dialog .pd-note{
  display:flex;align-items:flex-start;gap:.625rem;border:1px solid transparent;
  border-radius:.85rem;font-size:.8125rem;line-height:1.45;padding:.75rem .875rem;
}
.buy-premium-dialog .pd-note-ok{background:rgba(16,185,129,.08);border-color:rgba(16,185,129,.22);color:#6ee7b7}
html:not(.theme-dark) .buy-premium-dialog .pd-note-ok{color:#059669}
.buy-premium-dialog .pd-note-warn{background:rgba(245,158,11,.07);border-color:rgba(245,158,11,.22);color:#fbbf24}
html:not(.theme-dark) .buy-premium-dialog .pd-note-warn{color:#92601a}
.buy-premium-dialog .pd-status{
  display:flex;align-items:center;gap:.625rem;border:1px solid transparent;
  border-radius:.85rem;font-size:.8125rem;font-weight:500;padding:.625rem .875rem;
}
.buy-premium-dialog .pd-status.is-info{background:var(--tg-blue-soft);border-color:var(--tg-blue-ring);color:var(--tg-blue)}
.buy-premium-dialog .pd-status.is-warn{background:rgba(245,158,11,.08);border-color:rgba(245,158,11,.2);color:#fbbf24}
.buy-premium-dialog .pd-status.is-ok{background:rgba(16,185,129,.08);border-color:rgba(16,185,129,.2);color:#34d399}
.buy-premium-dialog .pd-status.is-err{background:rgba(239,68,68,.08);border-color:rgba(239,68,68,.2);color:#f87171}
.gram-nd-bubble-ticks{display:inline-block;margin-left:6px;font-size:11px;letter-spacing:-1px;opacity:.85}
.gram-nd-bubble.is-ai .gram-nd-bubble-ticks{color:#5ac8fa}


/* Sidebar «скоро» badge + AM tool dialog (BuyPremium shell) */
.submenu-link.is-soon-module{position:relative;display:flex;align-items:center;gap:8px;}
.submenu-link .submenu-soon-badge{margin-left:auto;flex-shrink:0;font-size:10px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;padding:2px 7px;border-radius:999px;background:rgba(245,158,11,.16);color:#fbbf24;border:1px solid rgba(245,158,11,.28);line-height:1.2;}
html:not(.theme-dark) .submenu-link .submenu-soon-badge{background:rgba(245,158,11,.12);color:#b45309;border-color:rgba(180,83,9,.22);}
.submenu-link.is-soon-locked{opacity:.62;cursor:not-allowed;pointer-events:auto;}
.submenu-link.is-soon-locked:hover{background:transparent!important;}
.submenu-link.is-soon-module .submenu-run-dot{margin-left:0;}
.acc-am-tool-dialog .gram-modal-section{margin:0;}
.acc-am-tool-dialog .gram-textarea.pd-input{height:auto;min-height:7rem;padding:.75rem .875rem;}
.acc-am-tool-dialog .pd-status[hidden]{display:none!important;}


/* nd no-photo avatar contrast */
.gram-nd-dialog-avatar:not(.has-photo),
.gram-nd-chat-head-avatar:not(.has-photo) {
  color: #fff !important;
  border: 1px solid rgba(255,255,255,.4);
  box-shadow: 0 2px 8px rgba(0,136,204,.28);
  background: linear-gradient(145deg, #0088cc, #006699) !important;
}
html:not(.theme-dark) .gram-nd-dialog-avatar:not(.has-photo),
html:not(.theme-dark) .gram-nd-chat-head-avatar:not(.has-photo) {
  border: 1px solid rgba(0,102,153,.35);
  background: linear-gradient(145deg, #0088cc, #005f8a) !important;
}


/* ========== Import accounts modal — BuyPremium shell, cyan accents (keep orange icon) ========== */
#panelModal:has(.acc-import-dialog) .panel-modal-card.gram-gpt-profile-sheet{
  width:min(440px,calc(100vw - 28px))!important;
  max-width:440px!important;
  border-radius:22px;
  overflow:hidden;
  position:relative;
  background:linear-gradient(165deg,rgba(28,48,64,.55) 0%,rgba(18,24,38,.96) 28%,rgba(14,18,30,.98) 100%);
  border:1px solid rgba(255,255,255,.1);
  box-shadow:
    0 0 0 1px rgba(0,136,204,.08),
    0 28px 72px rgba(0,0,0,.55),
    0 0 80px rgba(0,136,204,.14),
    inset 0 1px 0 rgba(255,255,255,.06);
  backdrop-filter:blur(18px);
}
#panelModal:has(.acc-import-dialog) .panel-modal-card.gram-gpt-profile-sheet::before{
  content:"";
  position:absolute;inset:0 auto auto 0;width:220px;height:160px;pointer-events:none;z-index:0;
  background:radial-gradient(ellipse at 20% 10%,rgba(0,136,204,.26),transparent 70%);
}
#panelModal:has(.acc-import-dialog) .panel-modal-card.gram-gpt-profile-sheet>*{position:relative;z-index:1}
#panelModal:has(.acc-import-dialog) .gram-modal-icon-orange{
  background:linear-gradient(145deg,#f59e0b,#ea580c);
  box-shadow:0 0 24px rgba(245,158,11,.45);
  border-radius:50%;
}
#panelModal:has(.acc-import-dialog) .panel-modal-header{
  background:transparent;border-bottom:none;padding:1.15rem 1.25rem .35rem;
}
#panelModal:has(.acc-import-dialog) .panel-modal-body{padding:.5rem 1.15rem 1rem}
#panelModal:has(.acc-import-dialog) .panel-modal-footer.buy-premium-footer{
  background:transparent;border-top:none;padding:.25rem 1.15rem 1.15rem;gap:.75rem;justify-content:stretch;
}
#panelModal:has(.acc-import-dialog) .pd-btn-cancel,
#panelModal:has(.acc-import-dialog) .gpt-ep-cancel.pd-btn-cancel{
  flex:1;border-radius:999px;height:2.75rem;
  background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.1);color:#e2e8f0;
}
#panelModal:has(.acc-import-dialog) .pd-btn-pay{
  flex:1.15;border-radius:999px;height:2.75rem;font-weight:600;
  background:#0088cc!important;border:none!important;
  box-shadow:0 8px 24px rgba(0,136,204,.35);
}
#panelModal:has(.acc-import-dialog) .pd-btn-pay:disabled{
  opacity:.45;box-shadow:none;cursor:not-allowed;
}
html:not(.theme-dark) #panelModal:has(.acc-import-dialog) .panel-modal-card.gram-gpt-profile-sheet{
  background:linear-gradient(165deg,#eff8ff 0%,#fff 24%,#f8fafc 100%);
  border-color:rgba(15,23,42,.1);
  box-shadow:0 24px 64px rgba(15,23,42,.16),0 0 48px rgba(0,136,204,.1);
}
html:not(.theme-dark) #panelModal:has(.acc-import-dialog) .panel-modal-card.gram-gpt-profile-sheet::before{
  background:radial-gradient(ellipse at 20% 10%,rgba(0,136,204,.16),transparent 70%);
}
html:not(.theme-dark) #panelModal:has(.acc-import-dialog) .pd-btn-cancel,
html:not(.theme-dark) #panelModal:has(.acc-import-dialog) .gpt-ep-cancel.pd-btn-cancel{
  background:#f1f5f9;border-color:rgba(15,23,42,.12);color:#334155;
}

.acc-import-dialog .pd-body{display:flex;flex-direction:column;gap:.85rem}
.acc-import-dialog .acc-import-drop{
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:.65rem;min-height:148px;padding:1.15rem 1rem;cursor:pointer;text-align:center;
  border-radius:16px;border:1.5px dashed rgba(0,136,204,.45);
  background:rgba(0,136,204,.06);color:var(--tg-fg-mute,#8b97a6);
  transition:border-color .15s,background .15s,box-shadow .15s;
}
.acc-import-dialog .acc-import-drop:hover,
.acc-import-dialog .acc-import-drop.drag{
  border-color:#0088cc;background:rgba(0,136,204,.12);
  box-shadow:0 0 0 3px rgba(0,136,204,.12);
}
.acc-import-dialog .acc-import-drop.has-file{
  border-style:solid;border-color:rgba(16,185,129,.4);background:rgba(16,185,129,.08);
}
.acc-import-dialog .acc-import-drop-idle{
  display:flex;flex-direction:column;align-items:center;gap:.4rem;
}
.acc-import-dialog .acc-import-drop-idle[hidden],
.acc-import-dialog .acc-import-drop-picked[hidden]{display:none!important}
.acc-import-dialog .acc-import-drop-icon{
  width:48px;height:48px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;
  background:linear-gradient(145deg,#0088cc,#006699);color:#fff;font-size:1.25rem;
  box-shadow:0 8px 20px rgba(0,136,204,.35);
}
.acc-import-dialog .acc-import-drop-idle strong{color:var(--tg-fg,#e7eef5);font-size:.95rem;font-weight:600}
.acc-import-dialog .acc-import-drop-idle span{font-size:.78rem;line-height:1.4}
.acc-import-dialog .acc-import-drop-picked{
  display:flex;align-items:center;gap:.75rem;width:100%;text-align:left;
}
.acc-import-dialog .acc-import-drop-picked-icon{
  width:44px;height:44px;flex-shrink:0;border-radius:12px;display:inline-flex;align-items:center;justify-content:center;
  background:rgba(0,136,204,.18);color:#5ac8fa;font-size:1.2rem;
}
.acc-import-dialog .acc-import-drop-picked-meta{flex:1;min-width:0;display:flex;flex-direction:column;gap:.15rem}
.acc-import-dialog .acc-import-drop-picked-meta strong{
  color:var(--tg-fg,#e7eef5);font-size:.9rem;font-weight:600;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.acc-import-dialog .acc-import-drop-picked-meta span{font-size:.75rem;color:var(--tg-fg-mute,#8b97a6)}
.acc-import-dialog .acc-import-drop-badge{
  flex-shrink:0;display:inline-flex;align-items:center;gap:.35rem;
  font-size:.72rem;font-weight:600;color:#34d399;padding:.35rem .55rem;
  border-radius:999px;background:rgba(16,185,129,.12);border:1px solid rgba(16,185,129,.28);
}
html:not(.theme-dark) .acc-import-dialog .acc-import-drop{
  background:rgba(0,136,204,.05);border-color:rgba(0,136,204,.35);color:#64748b;
}
html:not(.theme-dark) .acc-import-dialog .acc-import-drop-idle strong{color:#0f172a}
html:not(.theme-dark) .acc-import-dialog .acc-import-drop-picked-meta strong{color:#0f172a}
html:not(.theme-dark) .acc-import-dialog .acc-import-drop-picked-icon{color:#0088cc;background:rgba(0,136,204,.12)}
html:not(.theme-dark) .acc-import-dialog .acc-import-drop-badge{color:#059669}


/* ========== AM tool started + GramGPT live bar + progress (BuyPremium shell, tone by icon) ========== */
#panelModal:has(.acc-tool-started-dialog) .panel-modal-card.gram-gpt-profile-sheet,
#panelModal:has(.acc-tool-progress-dialog) .panel-modal-card.gram-gpt-profile-sheet{
  width:min(440px,calc(100vw - 28px))!important;
  max-width:440px!important;
  border-radius:22px;
  overflow:hidden;
  position:relative;
  background:linear-gradient(165deg,rgba(18,24,38,.96) 0%,rgba(14,18,30,.98) 100%);
  border:1px solid rgba(255,255,255,.1);
  box-shadow:0 28px 72px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.06);
  backdrop-filter:blur(18px);
}
#panelModal:has(.acc-tool-started-dialog) .panel-modal-card.gram-gpt-profile-sheet::before,
#panelModal:has(.acc-tool-progress-dialog) .panel-modal-card.gram-gpt-profile-sheet::before{
  content:"";position:absolute;inset:0 auto auto 0;width:220px;height:160px;pointer-events:none;z-index:0;
  background:radial-gradient(ellipse at 20% 10%,color-mix(in srgb, var(--atl-tone,#0088cc) 28%, transparent),transparent 70%);
}
#panelModal:has(.acc-tool-started-dialog) .panel-modal-card.gram-gpt-profile-sheet>*,
#panelModal:has(.acc-tool-progress-dialog) .panel-modal-card.gram-gpt-profile-sheet>*{position:relative;z-index:1}
#panelModal:has(.acc-tool-started-dialog) .panel-modal-header,
#panelModal:has(.acc-tool-progress-dialog) .panel-modal-header{
  background:transparent;border-bottom:none;padding:1.15rem 1.25rem .35rem;
}
#panelModal:has(.acc-tool-started-dialog) .panel-modal-body,
#panelModal:has(.acc-tool-progress-dialog) .panel-modal-body{padding:.5rem 1.15rem 1rem}
#panelModal:has(.acc-tool-started-dialog) .panel-modal-footer.buy-premium-footer,
#panelModal:has(.acc-tool-progress-dialog) .panel-modal-footer.buy-premium-footer{
  background:transparent;border-top:none;padding:.25rem 1.15rem 1.15rem;gap:.75rem;justify-content:stretch;
}
#panelModal:has(.acc-tool-progress-dialog) .pd-btn-cancel{
  flex:1;border-radius:999px;height:2.75rem;
  background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.1);color:#e2e8f0;
}
#panelModal:has(.acc-tool-started-dialog) .pd-btn-pay,
#panelModal:has(.acc-tool-progress-dialog) .pd-btn-pay{
  flex:1;border-radius:999px;height:2.75rem;font-weight:600;
  background:var(--atl-tone,#0088cc)!important;border:none!important;
  box-shadow:0 8px 24px color-mix(in srgb, var(--atl-tone,#0088cc) 40%, transparent);
}
#panelModal:has(.acc-tool-started-dialog[data-tone]) ,
#panelModal:has(.acc-tool-progress-dialog[data-tone]) { --atl-tone:#0088cc; }
#panelModal:has(.acc-tool-started-dialog[data-tone="emerald"]),
#panelModal:has(.acc-tool-progress-dialog[data-tone="emerald"]),
#panelModal:has(.acc-tool-started-dialog[data-tone="green"]),
#panelModal:has(.acc-tool-progress-dialog[data-tone="green"]){ --atl-tone:#22c55e; }
#panelModal:has(.acc-tool-started-dialog[data-tone="violet"]),
#panelModal:has(.acc-tool-progress-dialog[data-tone="violet"]){ --atl-tone:#8b5cf6; }
#panelModal:has(.acc-tool-started-dialog[data-tone="orange"]),
#panelModal:has(.acc-tool-progress-dialog[data-tone="orange"]){ --atl-tone:#f59e0b; }
#panelModal:has(.acc-tool-started-dialog[data-tone="amber"]),
#panelModal:has(.acc-tool-progress-dialog[data-tone="amber"]){ --atl-tone:#fbbf24; }
#panelModal:has(.acc-tool-started-dialog[data-tone="cyan"]),
#panelModal:has(.acc-tool-progress-dialog[data-tone="cyan"]){ --atl-tone:#0088cc; }
#panelModal:has(.acc-tool-started-dialog[data-tone="blue"]),
#panelModal:has(.acc-tool-progress-dialog[data-tone="blue"]){ --atl-tone:#3b82f6; }
#panelModal:has(.acc-tool-started-dialog[data-tone="pink"]),
#panelModal:has(.acc-tool-progress-dialog[data-tone="pink"]){ --atl-tone:#ec4899; }
#panelModal:has(.acc-tool-started-dialog[data-tone="red"]),
#panelModal:has(.acc-tool-progress-dialog[data-tone="red"]){ --atl-tone:#ef4444; }
#panelModal:has(.acc-tool-started-dialog[data-tone="indigo"]),
#panelModal:has(.acc-tool-progress-dialog[data-tone="indigo"]){ --atl-tone:#6366f1; }

#panelModal:has(.acc-tool-started-dialog) .gram-modal-icon,
#panelModal:has(.acc-tool-progress-dialog) .gram-modal-icon{
  background:linear-gradient(145deg,var(--atl-tone),color-mix(in srgb, var(--atl-tone) 70%, #000))!important;
  box-shadow:0 0 24px color-mix(in srgb, var(--atl-tone) 45%, transparent)!important;
  border-radius:14px!important;
}

.acc-tool-started-card{
  display:flex;align-items:flex-start;gap:.85rem;
}
.acc-tool-started-icon{
  width:44px;height:44px;flex-shrink:0;border-radius:12px;display:inline-flex;align-items:center;justify-content:center;
  background:linear-gradient(145deg,var(--atl-tone,#22c55e),color-mix(in srgb, var(--atl-tone,#22c55e) 70%, #000));
  color:#fff;font-size:1.15rem;
  box-shadow:0 0 22px color-mix(in srgb, var(--atl-tone,#22c55e) 45%, transparent);
}
.acc-tool-started-copy{min-width:0}
.acc-tool-started-copy strong{display:block;color:var(--tg-fg,#e7eef5);font-size:1.05rem;font-weight:700;margin-bottom:.35rem}
.acc-tool-started-copy p{margin:0;color:var(--tg-fg-mute,#8b97a6);font-size:.84rem;line-height:1.45}

.acc-tool-progress-dialog .bulk-progress-top{
  display:flex;align-items:center;justify-content:space-between;gap:.75rem;margin-bottom:.55rem;
}
.acc-tool-progress-dialog .bulk-progress-status{color:var(--tg-fg,#e7eef5);font-weight:600;font-size:.9rem}
.acc-tool-progress-dialog .bulk-progress-counter{color:var(--tg-fg-mute,#8b97a6);font-size:.8rem}
.acc-tool-progress-dialog .bulk-progress-track{
  height:8px;border-radius:999px;background:rgba(255,255,255,.06);overflow:hidden;
}
.acc-tool-progress-dialog .bulk-progress-fill{
  height:100%;border-radius:999px;background:var(--atl-tone,#0088cc);
  box-shadow:0 0 12px color-mix(in srgb, var(--atl-tone,#0088cc) 45%, transparent);
  transition:width .25s ease;
}
.acc-tool-progress-dialog .bulk-progress-pct{
  margin-top:.45rem;font-size:.8rem;color:var(--tg-fg-mute,#8b97a6);text-align:right;
}
.acc-tool-progress-dialog .bulk-progress-current,
.acc-tool-progress-dialog .bulk-progress-sub{margin-top:.4rem;font-size:.8rem;color:var(--tg-fg-mute,#8b97a6)}
.acc-tool-progress-dialog .bulk-progress-accounts-card{margin-top:0}

html:not(.theme-dark) #panelModal:has(.acc-tool-started-dialog) .panel-modal-card.gram-gpt-profile-sheet,
html:not(.theme-dark) #panelModal:has(.acc-tool-progress-dialog) .panel-modal-card.gram-gpt-profile-sheet{
  background:linear-gradient(165deg,#fff 0%,#f8fafc 100%);
  border-color:rgba(15,23,42,.1);
  box-shadow:0 24px 64px rgba(15,23,42,.16);
}
html:not(.theme-dark) .acc-tool-started-copy strong{color:#0f172a}
html:not(.theme-dark) .acc-tool-started-copy p{color:#64748b}
html:not(.theme-dark) #panelModal:has(.acc-tool-progress-dialog) .pd-btn-cancel{
  background:#f1f5f9;border-color:rgba(15,23,42,.12);color:#334155;
}
html:not(.theme-dark) .acc-tool-progress-dialog .bulk-progress-track{background:rgba(15,23,42,.08)}

/* GramGPT-style tool live bar */
.accounts-tool-live-bar.is-gpt{
  --atl-tone:#fbbf24;
  display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;
  margin:0 0 12px;padding:10px 12px;border-radius:12px;
  background:rgba(18,24,38,.92);
  border:1px solid color-mix(in srgb, var(--atl-tone) 55%, transparent);
  box-shadow:0 0 0 1px color-mix(in srgb, var(--atl-tone) 12%, transparent), 0 8px 24px rgba(0,0,0,.25);
}
.accounts-tool-live-bar.is-gpt[data-tone="emerald"],
.accounts-tool-live-bar.is-gpt[data-tone="green"]{ --atl-tone:#22c55e; }
.accounts-tool-live-bar.is-gpt[data-tone="violet"]{ --atl-tone:#8b5cf6; }
.accounts-tool-live-bar.is-gpt[data-tone="orange"]{ --atl-tone:#f59e0b; }
.accounts-tool-live-bar.is-gpt[data-tone="amber"]{ --atl-tone:#fbbf24; }
.accounts-tool-live-bar.is-gpt[data-tone="cyan"]{ --atl-tone:#0088cc; }
.accounts-tool-live-bar.is-gpt[data-tone="blue"]{ --atl-tone:#3b82f6; }
.accounts-tool-live-bar.is-gpt[data-tone="pink"]{ --atl-tone:#ec4899; }
.accounts-tool-live-bar.is-gpt[data-tone="red"]{ --atl-tone:#ef4444; }
.accounts-tool-live-bar.is-gpt[data-tone="indigo"]{ --atl-tone:#6366f1; }

.accounts-tool-live-bar.is-gpt .atl-left{
  display:flex;align-items:center;gap:10px;flex-wrap:wrap;min-width:0;
}
.accounts-tool-live-bar.is-gpt .atl-spin{color:var(--atl-tone);font-size:1rem}
.accounts-tool-live-bar.is-gpt .atl-run{color:#e2e8f0;font-size:.9rem}
.accounts-tool-live-bar.is-gpt .atl-run b{font-weight:700}
.accounts-tool-live-bar.is-gpt .atl-open{
  border:0;border-radius:8px;padding:6px 12px;font-size:.8rem;font-weight:700;cursor:pointer;
  background:var(--atl-tone);color:#111827;
}
.accounts-tool-live-bar.is-gpt .atl-x{
  width:28px;height:28px;border-radius:8px;border:1px solid rgba(255,255,255,.12);
  background:transparent;color:#94a3b8;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;
}
.accounts-tool-live-bar.is-gpt .atl-x:hover{color:#e2e8f0;border-color:rgba(255,255,255,.22)}
.accounts-tool-live-bar.is-gpt .atl-right{
  display:flex;align-items:center;gap:10px;min-width:min(280px,100%);flex:1;justify-content:flex-end;
  padding:6px 10px;border-radius:10px;background:rgba(0,0,0,.28);
  border:1px solid rgba(255,255,255,.06);
}
.accounts-tool-live-bar.is-gpt .atl-title{
  color:#cbd5e1;font-size:.8rem;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:160px;
}
.accounts-tool-live-bar.is-gpt .atl-track{
  flex:1;min-width:72px;max-width:140px;height:6px;border-radius:999px;background:rgba(255,255,255,.08);overflow:hidden;
}
.accounts-tool-live-bar.is-gpt .atl-track > span{
  display:block;height:100%;border-radius:999px;background:color-mix(in srgb, var(--atl-tone) 75%, #64748b);
}
.accounts-tool-live-bar.is-gpt .atl-pct{color:#94a3b8;font-size:.78rem;min-width:2.4em;text-align:right}

html:not(.theme-dark) .accounts-tool-live-bar.is-gpt{
  background:#fff;border-color:color-mix(in srgb, var(--atl-tone) 45%, #cbd5e1);
  box-shadow:0 4px 16px rgba(15,23,42,.08);
}
html:not(.theme-dark) .accounts-tool-live-bar.is-gpt .atl-run{color:#0f172a}
html:not(.theme-dark) .accounts-tool-live-bar.is-gpt .atl-right{background:#f8fafc;border-color:rgba(15,23,42,.08)}
html:not(.theme-dark) .accounts-tool-live-bar.is-gpt .atl-title{color:#334155}
html:not(.theme-dark) .accounts-tool-live-bar.is-gpt .atl-track{background:rgba(15,23,42,.08)}
html:not(.theme-dark) .accounts-tool-live-bar.is-gpt .atl-x{border-color:rgba(15,23,42,.12);color:#64748b}


/* ========== Account-manager result modal (Premium) ========== */
#panelModal:has(.acc-tool-result-dialog) .panel-modal-card.gram-gpt-profile-sheet,
#panelModal:has(.acc-tool-started-dialog) .panel-modal-card.gram-gpt-profile-sheet,
#panelModal:has(.acc-tool-progress-dialog) .panel-modal-card.gram-gpt-profile-sheet{
  --atl-tone:#0088cc;
}
#panelModal:has(.acc-tool-result-dialog) .panel-modal-card.gram-gpt-profile-sheet{
  border-color: color-mix(in srgb, var(--atl-tone) 45%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--atl-tone) 18%, transparent), 0 24px 64px rgba(0,0,0,.45);
}
#panelModal:has(.acc-tool-result-dialog) .panel-modal-card.gram-gpt-profile-sheet::before{
  content:""; position:absolute; inset:0; border-radius:inherit; pointer-events:none;
  background: radial-gradient(120% 80% at 0% 0%, color-mix(in srgb, var(--atl-tone) 22%, transparent), transparent 55%);
}
#panelModal:has(.acc-tool-result-dialog) .panel-modal-card.gram-gpt-profile-sheet>*{position:relative;z-index:1}
#panelModal:has(.acc-tool-result-dialog) .panel-modal-header{
  border-bottom:1px solid rgba(255,255,255,.06);
}
#panelModal:has(.acc-tool-result-dialog) .panel-modal-body{padding:.5rem 1.15rem 1rem}
#panelModal:has(.acc-tool-result-dialog) .panel-modal-footer.buy-premium-footer{
  display:flex; gap:10px; justify-content:flex-end; flex-wrap:wrap;
}
#panelModal:has(.acc-tool-result-dialog) .pd-btn-pay{
  background:var(--atl-tone)!important; border-color:transparent!important; color:#0b1220!important;
}
#panelModal:has(.acc-tool-result-dialog[data-tone="emerald"]),
#panelModal:has(.acc-tool-result-dialog[data-tone="green"]){ --atl-tone:#22c55e; }
#panelModal:has(.acc-tool-result-dialog[data-tone="violet"]){ --atl-tone:#8b5cf6; }
#panelModal:has(.acc-tool-result-dialog[data-tone="orange"]){ --atl-tone:#f59e0b; }
#panelModal:has(.acc-tool-result-dialog[data-tone="amber"]){ --atl-tone:#fbbf24; }
#panelModal:has(.acc-tool-result-dialog[data-tone="cyan"]){ --atl-tone:#0088cc; }
#panelModal:has(.acc-tool-result-dialog[data-tone="blue"]){ --atl-tone:#3b82f6; }
#panelModal:has(.acc-tool-result-dialog[data-tone="pink"]){ --atl-tone:#ec4899; }
#panelModal:has(.acc-tool-result-dialog[data-tone="red"]){ --atl-tone:#ef4444; }
#panelModal:has(.acc-tool-result-dialog[data-tone="indigo"]){ --atl-tone:#6366f1; }

#panelModal:has(.acc-tool-result-dialog) .gram-modal-icon{
  background: color-mix(in srgb, var(--atl-tone) 22%, transparent);
  color: var(--atl-tone);
}

.acc-tool-result-banner{
  display:flex; align-items:flex-start; gap:12px;
}
.acc-tool-result-icon{
  width:40px;height:40px;border-radius:12px;display:inline-flex;align-items:center;justify-content:center;
  background:color-mix(in srgb, var(--atl-tone,#22c55e) 22%, transparent); color:var(--atl-tone,#22c55e); flex-shrink:0;
}
.acc-tool-result-banner.is-fail{ --atl-tone:#ef4444; }
.acc-tool-result-banner.is-mixed{ --atl-tone:#f59e0b; }
.acc-tool-result-banner.is-ok{ --atl-tone:#22c55e; }
.acc-tool-result-copy{min-width:0}
.acc-tool-result-copy strong{display:block;color:var(--tg-fg,#e7eef5);font-size:1.05rem;font-weight:700;margin-bottom:.35rem}
.acc-tool-result-copy p{margin:0;color:var(--tg-fg-mute,#8b97a6);font-size:.84rem;line-height:1.45}
.acc-tool-result-dialog .bulk-result-list{
  max-height:min(42vh,360px); overflow:auto; margin-top:.35rem;
}
.acc-tool-result-dialog .bulk-result-row,
.acc-tool-result-dialog .bulk-result-item{
  border-color: rgba(255,255,255,.06);
}

html:not(.theme-dark) #panelModal:has(.acc-tool-result-dialog) .panel-modal-card.gram-gpt-profile-sheet{
  background:#fff; box-shadow:0 24px 64px rgba(15,23,42,.16);
}
html:not(.theme-dark) .acc-tool-result-copy strong{color:#0f172a}
html:not(.theme-dark) .acc-tool-result-copy p{color:#64748b}

/* Live bars: full-width stack above table card (reuse tool is-gpt) */
.gram-accounts-page > .accounts-check-live-bar.is-gpt,
.gram-accounts-page > .accounts-tool-live-bar.is-gpt{
  width:100%;
  max-width:100%;
  box-sizing:border-box;
  clear:both;
  position:relative;
  z-index:2;
  margin:0 0 12px;
  flex:none;
}


/* ========== Check results modal (Premium) ========== */
#panelModal:has(.acc-check-result-dialog) .panel-modal-card.gram-gpt-profile-sheet{
  --atl-tone:#0088cc;
  border-color: color-mix(in srgb, var(--atl-tone) 45%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--atl-tone) 18%, transparent), 0 24px 64px rgba(0,0,0,.45);
}
#panelModal:has(.acc-check-result-dialog) .panel-modal-card.gram-gpt-profile-sheet::before{
  content:""; position:absolute; inset:0; border-radius:inherit; pointer-events:none;
  background: radial-gradient(120% 80% at 0% 0%, color-mix(in srgb, var(--atl-tone) 22%, transparent), transparent 55%);
}
#panelModal:has(.acc-check-result-dialog) .panel-modal-card.gram-gpt-profile-sheet>*{position:relative;z-index:1}
#panelModal:has(.acc-check-result-dialog) .panel-modal-body{padding:.5rem 1.15rem 1rem}
#panelModal:has(.acc-check-result-dialog) .panel-modal-footer.buy-premium-footer{
  display:flex; gap:10px; justify-content:flex-end; flex-wrap:wrap; align-items:center;
}
#panelModal:has(.acc-check-result-dialog) .pd-btn-pay{
  background:var(--atl-tone)!important; border-color:transparent!important; color:#0b1220!important;
}
#panelModal:has(.acc-check-result-dialog) .gram-modal-icon{
  background: color-mix(in srgb, var(--atl-tone) 22%, transparent);
  color: var(--atl-tone);
}
.acc-check-result-hint{
  margin:0; color:var(--tg-fg-mute,#8b97a6); font-size:.84rem; line-height:1.45;
}
.acc-check-result-hint b{color:var(--tg-fg,#e7eef5); font-weight:700}
.acc-check-result-dialog .check-results-grid{
  display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-top:.35rem;
}
.acc-check-result-dialog .check-result-card{
  display:flex; flex-direction:column; align-items:flex-start; gap:6px;
  padding:12px 14px; border-radius:12px; cursor:pointer; text-align:left;
  border:1px solid rgba(255,255,255,.08);
  background:rgba(0,0,0,.22);
  transition: border-color .15s ease, transform .15s ease, background .15s ease;
}
.acc-check-result-dialog .check-result-card:hover{
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--card-tone, #0088cc) 55%, transparent);
  background: color-mix(in srgb, var(--card-tone, #0088cc) 12%, transparent);
}
.acc-check-result-dialog .check-result-card i{font-size:1.1rem; color:var(--card-tone,#0088cc)}
.acc-check-result-dialog .check-result-value{
  font-size:1.45rem; font-weight:800; line-height:1; color:var(--card-tone,#e7eef5);
}
.acc-check-result-dialog .check-result-label{
  font-size:.78rem; font-weight:600; color:var(--tg-fg-mute,#94a3b8);
}
.acc-check-result-dialog .check-tone-ok{ --card-tone:#22c55e; }
.acc-check-result-dialog .check-tone-warn{ --card-tone:#f59e0b; }
.acc-check-result-dialog .check-tone-bad{ --card-tone:#ef4444; }
.acc-check-result-dialog .check-tone-freeze{ --card-tone:#3b82f6; }

html:not(.theme-dark) #panelModal:has(.acc-check-result-dialog) .panel-modal-card.gram-gpt-profile-sheet{
  background:#fff; box-shadow:0 24px 64px rgba(15,23,42,.16);
}
html:not(.theme-dark) .acc-check-result-hint{color:#64748b}
html:not(.theme-dark) .acc-check-result-hint b{color:#0f172a}
html:not(.theme-dark) .acc-check-result-dialog .check-result-card{
  background:#f8fafc; border-color:rgba(15,23,42,.08);
}
html:not(.theme-dark) .acc-check-result-dialog .check-result-label{color:#64748b}


/* ========== Check progress: accounts list always visible when filled ========== */
#panelModal:has(.acc-tool-progress-dialog) #bulkProgressAccounts:not([hidden]){
  display:flex !important;
  flex-direction:column;
  gap:8px;
  max-height:min(42vh,280px);
  overflow:auto;
  min-height:48px;
  margin-top:.35rem;
}
#panelModal:has(.acc-tool-progress-dialog) .bulk-progress-accounts-card .pd-section-label{
  margin-bottom:.25rem;
}
#panelModal:has(.acc-tool-progress-dialog[data-tone="cyan"]) {
  --atl-tone:#0088cc;
}

/* ========== Accounts proxy pool modal (Premium) ========== */
#panelModal:has(.acc-proxy-pool-dialog) .panel-modal-card.gram-gpt-profile-sheet{
  --atl-tone:#2AABEE;
  border-color: color-mix(in srgb, var(--atl-tone) 45%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--atl-tone) 18%, transparent), 0 24px 64px rgba(0,0,0,.45);
}
#panelModal:has(.acc-proxy-pool-dialog) .panel-modal-card.gram-gpt-profile-sheet::before{
  content:""; position:absolute; inset:0; border-radius:inherit; pointer-events:none;
  background: radial-gradient(120% 80% at 0% 0%, color-mix(in srgb, var(--atl-tone) 22%, transparent), transparent 55%);
}
#panelModal:has(.acc-proxy-pool-dialog) .panel-modal-card.gram-gpt-profile-sheet>*{position:relative;z-index:1}
#panelModal:has(.acc-proxy-pool-dialog) .panel-modal-body{padding:.5rem 1.15rem .85rem}
#panelModal:has(.acc-proxy-pool-dialog) .panel-modal-footer.buy-premium-footer{
  display:flex; gap:10px; justify-content:flex-end; flex-wrap:wrap; align-items:center;
}
#panelModal:has(.acc-proxy-pool-dialog) .pd-btn-pay{
  background:var(--atl-tone)!important; border-color:transparent!important; color:#0b1220!important;
}
#panelModal:has(.acc-proxy-pool-dialog) .gram-modal-icon{
  background: color-mix(in srgb, var(--atl-tone) 22%, transparent);
  color: var(--atl-tone);
}
.acc-proxy-pool-dialog .ppm-wrap{
  max-height:min(70vh,640px); overflow:auto; padding:0; margin:0; background:transparent; border:0; box-shadow:none;
}
.acc-proxy-pool-dialog .pd-plan-card,
.acc-proxy-pool-dialog .pd-pay-card{margin-bottom:.65rem}
.acc-proxy-pool-dialog .ppm-stats{display:flex; gap:8px; flex-wrap:wrap; margin-top:.35rem}
.acc-proxy-pool-dialog .ppm-stat{
  display:inline-flex; align-items:center; gap:8px; padding:8px 12px; border-radius:10px;
  border:1px solid rgba(255,255,255,.08); background:rgba(0,0,0,.22); color:#e2e8f0; font-weight:700; font-size:.85rem;
  cursor:default;
}
.acc-proxy-pool-dialog button.ppm-stat{cursor:pointer}
.acc-proxy-pool-dialog .ppm-stat-geo.is-on{
  border-color: color-mix(in srgb, #22c55e 55%, transparent);
  color:#86efac;
}
.acc-proxy-pool-dialog .ppm-progress{
  margin-top:10px; padding:10px 12px; border-radius:10px;
  border:1px solid rgba(255,255,255,.08); background:rgba(0,0,0,.2);
}
.acc-proxy-pool-dialog .ppm-progress-top{
  display:flex; justify-content:space-between; gap:8px; font-size:.8rem; color:#cbd5e1; margin-bottom:6px;
}
.acc-proxy-pool-dialog .ppm-progress-track{
  height:6px; border-radius:999px; background:rgba(255,255,255,.08); overflow:hidden;
}
.acc-proxy-pool-dialog .ppm-progress-track > span{
  display:block; height:100%; border-radius:999px; background:linear-gradient(90deg,#0088cc,#2AABEE);
}
.acc-proxy-pool-dialog .ppm-list-card{margin-top:.35rem}
.acc-proxy-pool-dialog .ppm-ta-wrap textarea{
  width:100%; min-height:110px; border-radius:10px; resize:vertical;
  background:rgba(0,0,0,.28); border:1px solid rgba(255,255,255,.1); color:#e2e8f0; padding:10px 12px;
}
.acc-proxy-pool-dialog .ppm-note{color:#94a3b8; font-size:.78rem; margin:.5rem 0 0}
.acc-proxy-pool-dialog .ppm-format{color:#64748b; font-size:.72rem}

html:not(.theme-dark) #panelModal:has(.acc-proxy-pool-dialog) .panel-modal-card.gram-gpt-profile-sheet{
  background:#fff; box-shadow:0 24px 64px rgba(15,23,42,.16);
}
html:not(.theme-dark) .acc-proxy-pool-dialog .ppm-stat{
  background:#f8fafc; border-color:rgba(15,23,42,.08); color:#0f172a;
}
html:not(.theme-dark) .acc-proxy-pool-dialog .ppm-ta-wrap textarea{
  background:#fff; border-color:rgba(15,23,42,.12); color:#0f172a;
}
html:not(.theme-dark) .acc-proxy-pool-dialog .ppm-progress{
  background:#f8fafc; border-color:rgba(15,23,42,.08);
}
html:not(.theme-dark) .acc-proxy-pool-dialog .ppm-progress-top{color:#334155}
html:not(.theme-dark) .acc-proxy-pool-dialog .ppm-progress-track{background:rgba(15,23,42,.08)}


/* ========== Accounts proxy modal = like Proxy Manager (Premium) ========== */
.acc-proxy-pool-dialog .acc-proxy-hint{
  margin:0 0 .65rem; color:var(--tg-fg-mute,#94a3b8); font-size:.82rem; line-height:1.45;
}
.acc-proxy-pool-dialog .acc-proxy-hint b{color:var(--tg-fg,#e7eef5)}
.acc-proxy-pool-dialog .acc-proxy-ta{
  width:100%; min-height:160px; box-sizing:border-box; resize:vertical;
  border-radius:12px; padding:12px 14px; margin:0;
  background:rgba(0,0,0,.28); border:1px solid rgba(255,255,255,.1); color:#e2e8f0;
  font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace; font-size:.82rem; line-height:1.45;
}
.acc-proxy-pool-dialog .acc-proxy-actions{
  display:flex; flex-wrap:wrap; gap:8px; margin-top:12px; align-items:center;
}
.acc-proxy-pool-dialog .acc-proxy-actions .pd-btn-pay{flex:1 1 auto; min-width:120px}
.acc-proxy-pool-dialog .acc-proxy-geo.is-on{
  border-color:rgba(34,197,94,.45)!important; color:#86efac!important;
}
.acc-proxy-pool-dialog #ppmStatus{margin-top:10px; min-height:1.2em}
.acc-proxy-pool-dialog .ppm-progress{margin-top:12px}

html:not(.theme-dark) .acc-proxy-pool-dialog .acc-proxy-hint{color:#64748b}
html:not(.theme-dark) .acc-proxy-pool-dialog .acc-proxy-hint b{color:#0f172a}
html:not(.theme-dark) .acc-proxy-pool-dialog .acc-proxy-ta{
  background:#fff; border-color:rgba(15,23,42,.12); color:#0f172a;
}

/* Check progress accounts list — force visible rows */
#panelModal:has(.acc-tool-progress-dialog) #bulkProgressAccounts:not([hidden]) .bulk-progress-acc-row{
  display:flex !important;
  flex-direction:column;
  gap:4px;
  padding:8px 10px;
  border-radius:10px;
  border:1px solid rgba(148,163,184,.22);
  background:rgba(15,23,42,.35);
  color:#e2e8f0;
}
html:not(.theme-dark) #panelModal:has(.acc-tool-progress-dialog) #bulkProgressAccounts:not([hidden]) .bulk-progress-acc-row{
  background:#f8fafc; border-color:rgba(15,23,42,.1); color:#0f172a;
}


/* ========== Proxy pool modal: Telegram cyan + horizontal ========== */
#panelModal:has(.acc-proxy-pool-dialog) .panel-modal-card.gram-gpt-profile-sheet{
  --atl-tone:#2AABEE;
  width:min(920px,94vw)!important;
  max-width:920px!important;
  border-color: color-mix(in srgb, #2AABEE 50%, transparent);
}
#panelModal:has(.acc-proxy-pool-dialog[data-tone="amber"]),
#panelModal:has(.acc-proxy-pool-dialog[data-tone="cyan"]){
  --atl-tone:#2AABEE;
}
#panelModal:has(.acc-proxy-pool-dialog) .pd-btn-pay,
#panelModal:has(.acc-proxy-pool-dialog) .gram-gpt-btn-primary.pd-btn-pay{
  background:#2AABEE!important;
  border-color:transparent!important;
  color:#fff!important;
}
#panelModal:has(.acc-proxy-pool-dialog) .gram-modal-icon{
  background:rgba(42,171,238,.2);
  color:#2AABEE;
}
.acc-proxy-pool-dialog.is-horizontal .acc-proxy-body-h{
  display:grid;
  grid-template-columns:minmax(0,1.55fr) minmax(220px,0.9fr);
  gap:14px;
  align-items:stretch;
}
.acc-proxy-pool-dialog .acc-proxy-main,
.acc-proxy-pool-dialog .acc-proxy-side{
  margin:0;
  min-width:0;
}
.acc-proxy-pool-dialog .acc-proxy-meta{
  margin:0 0 10px;
  color:var(--tg-fg-mute,#94a3b8);
  font-size:.82rem;
}
.acc-proxy-pool-dialog .acc-proxy-meta b{color:var(--tg-fg,#e7eef5)}
.acc-proxy-pool-dialog .acc-proxy-actions-col{
  display:flex;
  flex-direction:column;
  gap:8px;
  margin-top:10px;
}
.acc-proxy-pool-dialog .acc-proxy-actions-col > button{
  width:100%;
  justify-content:center;
}
.acc-proxy-pool-dialog .ppm-progress-track > span{
  background:linear-gradient(90deg,#0088cc,#2AABEE)!important;
}
.acc-proxy-pool-dialog .acc-proxy-ta{
  min-height:220px;
}

@media (max-width:720px){
  .acc-proxy-pool-dialog.is-horizontal .acc-proxy-body-h{
    grid-template-columns:1fr;
  }
}

html:not(.theme-dark) .acc-proxy-pool-dialog .acc-proxy-meta{color:#64748b}
html:not(.theme-dark) .acc-proxy-pool-dialog .acc-proxy-meta b{color:#0f172a}

/* Check accounts list: ensure seed rows visible */
#panelModal:has(.acc-tool-progress-dialog) #bulkProgressAccounts:not([hidden]){
  display:flex!important;
  flex-direction:column;
  gap:8px;
  max-height:min(48vh,320px);
  overflow:auto;
  min-height:64px;
}


/* ========== Proxy modal: unified sizes ========== */
#panelModal:has(.acc-proxy-pool-dialog) .panel-modal-body{
  padding:.75rem 1.15rem .9rem;
}
#panelModal:has(.acc-proxy-pool-dialog) .panel-modal-title{
  font-size:1.05rem!important;
  font-weight:700!important;
}
#panelModal:has(.acc-proxy-pool-dialog) .gram-modal-sub{
  font-size:.82rem!important;
}
#panelModal:has(.acc-proxy-pool-dialog) .gram-modal-icon{
  width:40px!important;
  height:40px!important;
  font-size:1.05rem!important;
}

.acc-proxy-pool-dialog .pd-section-label{
  font-size:.72rem!important;
  letter-spacing:.06em;
  margin:0 0 8px!important;
  opacity:.9;
}
.acc-proxy-pool-dialog .acc-proxy-hint,
.acc-proxy-pool-dialog .acc-proxy-meta{
  margin:0 0 10px!important;
  font-size:.82rem!important;
  line-height:1.4!important;
}
.acc-proxy-pool-dialog .acc-proxy-hint code{
  font-size:.78rem;
}

.acc-proxy-pool-dialog.is-horizontal .acc-proxy-body-h{
  display:grid;
  grid-template-columns:minmax(0,1.45fr) minmax(240px,280px);
  gap:14px;
  align-items:stretch;
}
.acc-proxy-pool-dialog .acc-proxy-main,
.acc-proxy-pool-dialog .acc-proxy-side{
  display:flex;
  flex-direction:column;
  min-height:260px;
}
.acc-proxy-pool-dialog .acc-proxy-ta{
  flex:1 1 auto;
  width:100%;
  min-height:200px!important;
  max-height:none;
  box-sizing:border-box;
  font-size:.82rem!important;
  line-height:1.45!important;
  padding:12px 14px!important;
  border-radius:12px!important;
}

/* Shared button rhythm: 40px */
#panelModal:has(.acc-proxy-pool-dialog) .acc-proxy-actions-col > button,
#panelModal:has(.acc-proxy-pool-dialog) .acc-proxy-footer .acc-proxy-close,
#panelModal:has(.acc-proxy-pool-dialog) .acc-proxy-actions-col .pd-btn-pay,
#panelModal:has(.acc-proxy-pool-dialog) .acc-proxy-actions-col .pd-btn-cancel{
  height:40px!important;
  min-height:40px!important;
  max-height:40px!important;
  padding:0 14px!important;
  border-radius:10px!important;
  font-size:.875rem!important;
  font-weight:700!important;
  line-height:1!important;
  box-sizing:border-box!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:8px!important;
  width:100%!important;
}

.acc-proxy-pool-dialog .acc-proxy-actions-col{
  display:flex;
  flex-direction:column;
  gap:8px!important;
  margin-top:4px!important;
  margin-bottom:0!important;
}
.acc-proxy-pool-dialog .ppm-progress{
  margin:0 0 10px!important;
  padding:10px 12px!important;
}
.acc-proxy-pool-dialog .ppm-progress-top{
  font-size:.82rem!important;
}
.acc-proxy-pool-dialog #ppmStatus{
  margin-top:auto!important;
  min-height:1.25em;
  font-size:.82rem!important;
}

#panelModal:has(.acc-proxy-pool-dialog) .panel-modal-footer.acc-proxy-footer{
  display:flex!important;
  justify-content:flex-end!important;
  align-items:center!important;
  gap:10px!important;
  padding:.75rem 1.15rem 1rem!important;
}
#panelModal:has(.acc-proxy-pool-dialog) .panel-modal-footer.acc-proxy-footer .acc-proxy-close{
  width:auto!important;
  min-width:140px!important;
  flex:0 0 auto!important;
}

@media (max-width:720px){
  .acc-proxy-pool-dialog.is-horizontal .acc-proxy-body-h{
    grid-template-columns:1fr;
  }
  .acc-proxy-pool-dialog .acc-proxy-main,
  .acc-proxy-pool-dialog .acc-proxy-side{
    min-height:0;
  }
}

/* —— Set-channel modal: buy-premium shell, NO orange —— */
#panelModal:has(.sc-ch-premium-dialog) .panel-modal-card.gram-gpt-profile-sheet{
  width:min(560px,calc(100vw - 28px))!important;
  max-width:560px!important;
  background:linear-gradient(165deg,rgba(30,42,72,.55) 0%,rgba(16,23,38,.96) 28%,rgba(12,16,28,.98) 100%)!important;
  border:1px solid rgba(0,136,204,.18)!important;
  box-shadow:
    0 0 0 1px rgba(0,136,204,.08),
    0 28px 72px rgba(0,0,0,.55),
    0 0 80px rgba(0,136,204,.14),
    inset 0 1px 0 rgba(255,255,255,.06)!important;
}
#panelModal:has(.sc-ch-premium-dialog) .panel-modal-card.gram-gpt-profile-sheet::before{
  background:radial-gradient(ellipse at 20% 10%,rgba(0,136,204,.28),transparent 70%)!important;
}
#panelModal:has(.sc-ch-premium-dialog) .gram-modal-icon-violet,
#panelModal:has(.sc-ch-premium-dialog) .gram-modal-icon-orange{
  background:linear-gradient(145deg,#38bdf8,#0088cc)!important;
  box-shadow:0 0 24px rgba(0,136,204,.45)!important;
  border-radius:50%;
}
html:not(.theme-dark) #panelModal:has(.sc-ch-premium-dialog) .panel-modal-card.gram-gpt-profile-sheet{
  background:linear-gradient(165deg,#eff6ff 0%,#fff 24%,#f8fafc 100%)!important;
  border-color:rgba(15,23,42,.1)!important;
  box-shadow:0 24px 64px rgba(15,23,42,.16),0 0 48px rgba(0,136,204,.1)!important;
}
html:not(.theme-dark) #panelModal:has(.sc-ch-premium-dialog) .panel-modal-card.gram-gpt-profile-sheet::before{
  background:radial-gradient(ellipse at 20% 10%,rgba(0,136,204,.16),transparent 70%)!important;
}
.sc-ch-premium-dialog .gram-modal-section{
  background:rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.09);
  border-radius:14px;
  padding:12px 14px;
  margin:0 0 10px;
}
html:not(.theme-dark) .sc-ch-premium-dialog .gram-modal-section{
  background:#fff;
  border-color:rgba(15,23,42,.08);
}
.sc-ch-premium-dialog .gram-modal-section-head{
  color:#e2e8f0;
  margin-bottom:10px;
}
.sc-ch-premium-dialog .gram-modal-section-head i{
  color:#38bdf8;
}
.sc-ch-premium-dialog .sc-ch-mode-seg{
  margin-bottom:10px;
}
.sc-ch-premium-dialog .sc-ch-pin{
  background:rgba(0,136,204,.1)!important;
  border-color:rgba(0,136,204,.28)!important;
}
.sc-ch-premium-dialog .pd-input,
.sc-ch-premium-dialog .gram-input{
  border-radius:10px;
}
.sc-ch-premium-dialog .sc-ch-image-drop{
  border-color:rgba(0,136,204,.28);
  background:rgba(0,136,204,.06);
}
.sc-ch-premium-dialog .sc-ch-image-drop i{color:#0088cc}
.sc-ch-premium-dialog .sc-ch-avatar-preview.has-img{
  border-color:rgba(0,136,204,.5);
}
html:not(.theme-dark) .sc-ch-premium-dialog .sc-ch-avatar-preview{
  background:rgba(0,136,204,.06);
  border-color:rgba(0,136,204,.35);
  color:#0088cc;
}
html:not(.theme-dark) .sc-ch-premium-dialog .sc-ch-image-drop{
  color:#0f172a;
}
.sc-ch-buttons-btn{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  width:100%;
  min-height:44px;
  padding:10px 14px;
  border-radius:10px;
  border:1px solid rgba(0,136,204,.35);
  background:rgba(0,136,204,.1);
  color:#e2e8f0;
  font-size:13px;
  font-weight:600;
  cursor:pointer;
  box-sizing:border-box;
}
.sc-ch-buttons-btn:hover{
  border-color:rgba(0,136,204,.55);
  background:rgba(0,136,204,.16);
}
.sc-ch-buttons-btn .pi{color:#38bdf8}
html:not(.theme-dark) .sc-ch-buttons-btn{
  color:#0f172a;
  background:rgba(0,136,204,.06);
}
html:not(.theme-dark) .sc-ch-buttons-btn .pi{color:#0088cc}
html:not(.theme-dark) .sc-ch-buttons-btn:hover{
  background:rgba(0,136,204,.12);
}
.sc-ch-buttons-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:1.25rem;
  height:1.25rem;
  padding:0 6px;
  border-radius:999px;
  background:#0088cc;
  color:#fff;
  font-size:11px;
  font-weight:700;
}
/* слой на весь #panelModal — не внутри card (там buy-premium даёт position:relative детям) */
#panelModal.panel-modal:has(.sc-ch-premium-dialog){
  position:fixed!important;
}
#panelModal > .sc-ch-buttons-overlay{
  position:absolute!important;
  inset:0!important;
  z-index:80!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  padding:16px!important;
  box-sizing:border-box!important;
  pointer-events:auto!important;
}
#panelModal > .sc-ch-buttons-overlay[hidden]{display:none!important}
#panelModal > .sc-ch-buttons-overlay .sc-ch-buttons-overlay-backdrop{
  position:absolute!important;
  inset:0!important;
  background:rgba(2,8,20,.55)!important;
  backdrop-filter:blur(4px)!important;
}
#panelModal > .sc-ch-buttons-overlay .sc-ch-buttons-panel{
  position:relative!important;
  z-index:1!important;
  width:min(360px,calc(100vw - 48px))!important;
  max-height:min(78vh,560px)!important;
  display:flex!important;
  flex-direction:column!important;
  gap:10px!important;
  padding:14px 14px 12px!important;
  border-radius:16px!important;
  border:1px solid rgba(0,136,204,.22)!important;
  background:rgba(16,23,38,.96)!important;
  box-shadow:0 20px 48px rgba(0,0,0,.45),0 0 0 1px rgba(0,136,204,.1)!important;
  margin:0!important;
}
html:not(.theme-dark) #panelModal > .sc-ch-buttons-overlay .sc-ch-buttons-panel{
  background:#fff!important;
  border-color:rgba(15,23,42,.12)!important;
  box-shadow:0 20px 48px rgba(15,23,42,.18)!important;
}
.sc-ch-buttons-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.sc-ch-buttons-head h3{
  margin:0;
  font-size:15px;
  font-weight:700;
  color:#e2e8f0;
}
html:not(.theme-dark) .sc-ch-buttons-head h3{color:#0f172a}
.sc-ch-buttons-body{
  display:flex;
  flex-direction:column;
  gap:12px;
  overflow:auto;
  min-height:0;
  flex:1 1 auto;
  padding-right:2px;
}
.sc-ch-btn-row-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom:8px;
  font-size:11px;
  font-weight:700;
  letter-spacing:.04em;
  color:#94a3b8;
}
.sc-ch-btn-add{
  border:0;
  background:transparent;
  color:#38bdf8;
  font-size:12px;
  font-weight:600;
  cursor:pointer;
  padding:0;
}
.sc-ch-btn-item{
  display:flex;
  align-items:flex-start;
  gap:8px;
  margin-bottom:8px;
}
.sc-ch-btn-fields{
  flex:1 1 auto;
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:6px;
}
.sc-ch-btn-fields .pd-input{
  width:100%;
  box-sizing:border-box;
  border-radius:10px;
  border:1px solid rgba(0,136,204,.28);
  background:rgba(15,23,42,.55);
  color:#e2e8f0;
  padding:8px 10px;
  font-size:13px;
}
html:not(.theme-dark) .sc-ch-btn-fields .pd-input{
  background:#fff;
  color:#0f172a;
  border-color:rgba(15,23,42,.14);
}
.sc-ch-btn-del{
  flex:0 0 34px;
  width:34px;
  height:34px;
  border-radius:10px;
  border:1px solid rgba(148,163,184,.28);
  background:rgba(255,255,255,.04);
  color:#94a3b8;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.sc-ch-buttons-add-row{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  width:100%;
  min-height:40px;
  border-radius:10px;
  border:1px dashed rgba(0,136,204,.35);
  background:rgba(0,136,204,.06);
  color:#94a3b8;
  font-size:13px;
  font-weight:600;
  cursor:pointer;
}
.sc-ch-buttons-foot{
  display:flex;
  gap:8px;
  justify-content:stretch;
}
.sc-ch-buttons-foot .gram-gpt-btn{flex:1}
.sc-ch-track-check{
  display:flex;
  align-items:center;
  gap:8px;
  margin:0;
  padding:10px 12px;
  border-radius:10px;
  border:1px solid rgba(0,136,204,.28);
  background:rgba(0,136,204,.08);
  font-size:13px;
  font-weight:600;
  color:#e2e8f0;
  cursor:pointer;
}
html:not(.theme-dark) .sc-ch-track-check{color:#0f172a;background:rgba(0,136,204,.06)}
.sc-ch-track-check input{accent-color:#0088cc;width:16px;height:16px}
.sc-ch-track-hint{
  margin:0;
  font-size:11px;
  line-height:1.4;
  color:#94a3b8;
}
.sc-ch-click-stats-modal{display:flex;flex-direction:column;gap:10px}
.sc-ch-click-stats-lead{margin:0!important}
.sc-ch-click-create{display:flex;flex-direction:column;gap:8px}
.sc-ch-click-create-ta{min-height:96px;resize:vertical;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:12px;line-height:1.45}
.sc-ch-click-create-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.sc-ch-click-copy{min-width:36px;padding:6px 10px!important}
.sc-ch-click-stats-post-label{
  display:block;margin:0;font-size:12px;font-weight:600;color:#94a3b8;
}
.sc-ch-click-stats-post{width:100%;box-sizing:border-box}
.sc-ch-click-stats{
  margin:10px 0 0;
  border:1px solid rgba(0,136,204,.22);
  border-radius:12px;
  background:rgba(15,23,42,.45);
  overflow:hidden;
}
.sc-ch-click-stats.is-modal{
  margin:0;
  padding:12px;
}
.sc-ch-click-stats.is-modal .sc-ch-click-stats-body{padding:0}
.sc-ch-click-stats.is-modal .sc-ch-click-stats-table-wrap{max-height:320px}
html:not(.theme-dark) .sc-ch-click-stats{
  background:#fff;
  border-color:rgba(148,163,184,.28);
}
.sc-ch-click-stats-sum{
  list-style:none;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  padding:10px 12px;
  cursor:pointer;
  color:#e2e8f0;
  font-size:13px;
  font-weight:600;
  user-select:none;
}
html:not(.theme-dark) .sc-ch-click-stats-sum{color:#0f172a}
.sc-ch-click-stats-sum::-webkit-details-marker{display:none}
.sc-ch-click-stats-sum-l{display:inline-flex;align-items:center;gap:8px}
.sc-ch-click-stats-sum-l .pi{color:#08c}
.sc-ch-click-stats-chevron{color:#94a3b8;transition:transform .15s ease}
.sc-ch-click-stats[open] .sc-ch-click-stats-chevron{transform:rotate(180deg)}
.sc-ch-click-stats-body{padding:0 12px 12px}
.sc-ch-click-stats-cards{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr)) auto;
  gap:8px;
  align-items:stretch;
  margin-bottom:10px;
}
.sc-ch-click-stat{
  display:flex;
  align-items:center;
  gap:8px;
  min-height:52px;
  padding:8px 10px;
  border-radius:10px;
  border:1px solid rgba(0,136,204,.18);
  background:rgba(21,34,56,.85);
  box-sizing:border-box;
}
html:not(.theme-dark) .sc-ch-click-stat{
  background:#f8fafc;
  border-color:rgba(148,163,184,.28);
}
.sc-ch-click-stat-ico{
  width:28px;height:28px;border-radius:8px;
  display:inline-flex;align-items:center;justify-content:center;
  flex:0 0 auto;font-size:13px;color:#fff;
}
.sc-ch-click-stat-ico.tone-blue{background:linear-gradient(135deg,#38bdf8,#0284c7)}
.sc-ch-click-stat-ico.tone-violet{background:linear-gradient(135deg,#a78bfa,#7c3aed)}
.sc-ch-click-stat-ico.tone-emerald{background:linear-gradient(135deg,#4ade80,#16a34a)}
.sc-ch-click-stat-copy{display:flex;flex-direction:column;gap:1px;min-width:0}
.sc-ch-click-stat-copy strong{font-size:15px;line-height:1.2;color:#f1f5f9}
html:not(.theme-dark) .sc-ch-click-stat-copy strong{color:#0f172a}
.sc-ch-click-stat-copy span{font-size:11px;color:#94a3b8}
.sc-ch-click-stats-refresh{
  width:36px;height:36px;border:1px solid rgba(0,136,204,.22);
  border-radius:999px;background:rgba(15,23,42,.6);color:#94a3b8;
  display:inline-flex;align-items:center;justify-content:center;cursor:pointer;
}
.sc-ch-click-stats-refresh:hover{color:#e2e8f0}
.sc-ch-click-stats-table-wrap{overflow:auto;max-height:220px;border-radius:10px;border:1px solid rgba(148,163,184,.18)}
.sc-ch-click-stats-table{width:100%;border-collapse:collapse;font-size:12px}
.sc-ch-click-stats-table th,.sc-ch-click-stats-table td{
  padding:8px 10px;text-align:left;border-bottom:1px solid rgba(148,163,184,.14);color:#e2e8f0;
}
html:not(.theme-dark) .sc-ch-click-stats-table th,
html:not(.theme-dark) .sc-ch-click-stats-table td{color:#0f172a}
.sc-ch-click-stats-table th{font-size:11px;color:#94a3b8;font-weight:600}
.sc-ch-click-stats-table tr.is-empty td{color:#94a3b8;text-align:center}
.sc-ch-click-badge{
  display:inline-flex;min-width:22px;height:22px;padding:0 6px;align-items:center;justify-content:center;
  border-radius:999px;background:rgba(34,197,94,.18);color:#4ade80;font-weight:700;font-size:12px;
}
html:not(.theme-dark) .sc-ch-click-badge{background:rgba(22,163,74,.12);color:#15803d}
.sc-ch-click-badge--lg{min-width:28px;height:26px;padding:0 8px;font-size:13px}
.sc-ch-click-user{color:#38bdf8;text-decoration:none;font-weight:600}
.sc-ch-click-user:hover{text-decoration:underline}
.sc-ch-click-tool-dialog .sc-ch-click-create-ta{min-height:72px}
.sc-ch-click-tool-dialog .gram-modal-section{
  background:rgba(15,23,42,.35);
  border:1px solid rgba(0,136,204,.16);
  border-radius:14px;
  padding:12px;
}
html:not(.theme-dark) .sc-ch-click-tool-dialog .gram-modal-section{
  background:#f8fafc;
  border-color:rgba(0,136,204,.14);
}
.sc-ch-click-redir-cards{
  grid-template-columns:repeat(2,minmax(0,1fr)) auto;
}
.sc-ch-click-selected{
  display:flex;align-items:center;gap:10px;
  margin:0 0 10px;padding:10px 12px;border-radius:12px;
  border:1px solid rgba(0,136,204,.28);
  background:rgba(0,136,204,.12);
}
.sc-ch-click-selected[hidden]{display:none!important}
.sc-ch-click-selected-ico{
  width:28px;height:28px;border-radius:8px;flex:0 0 auto;
  display:inline-flex;align-items:center;justify-content:center;
  background:linear-gradient(135deg,#38bdf8,#0088cc);color:#fff;font-size:13px;
}
.sc-ch-click-selected-copy{display:flex;flex-direction:column;gap:2px;min-width:0}
.sc-ch-click-selected-copy strong{font-size:13px;color:#e2e8f0;font-weight:600}
.sc-ch-click-selected-copy strong b{color:#38bdf8;font-size:15px}
html:not(.theme-dark) .sc-ch-click-selected-copy strong{color:#0f172a}
html:not(.theme-dark) .sc-ch-click-selected-copy strong b{color:#0369a1}
.sc-ch-click-selected-copy span{
  font-size:11px;color:#94a3b8;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.sc-ch-click-redir-table{max-height:260px;margin-top:2px}
.sc-ch-click-redir-table-el{table-layout:fixed}
.sc-ch-click-redir-table-el .sc-ch-col-target{width:28%}
.sc-ch-click-redir-table-el .sc-ch-col-link{width:42%}
.sc-ch-click-redir-table-el .sc-ch-col-clicks{width:18%}
.sc-ch-click-redir-table-el .sc-ch-col-copy{width:12%}
.sc-ch-click-redir-table-el td,
.sc-ch-click-redir-table-el th{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:middle}
.sc-ch-click-td-clicks{text-align:center!important}
.sc-ch-click-td-copy{text-align:right!important;padding-right:8px!important}
.sc-ch-click-track-a{color:#38bdf8;text-decoration:none;font-weight:600}
.sc-ch-click-track-a:hover{text-decoration:underline}
.sc-ch-click-redir-row{cursor:pointer}
.sc-ch-click-redir-row:hover td{background:rgba(0,136,204,.08)}
.sc-ch-click-redir-row.is-selected td{
  background:rgba(0,136,204,.16);
  box-shadow:inset 3px 0 0 #0088cc;
}
.sc-ch-click-redir-row.is-selected .sc-ch-click-badge{
  background:rgba(0,136,204,.28);color:#7dd3fc;transform:scale(1.08);
}
html:not(.theme-dark) .sc-ch-click-redir-row:hover td{background:rgba(0,136,204,.06)}
html:not(.theme-dark) .sc-ch-click-redir-row.is-selected td{background:rgba(0,136,204,.1)}
html:not(.theme-dark) .sc-ch-click-redir-row.is-selected .sc-ch-click-badge{
  background:rgba(0,136,204,.16);color:#0369a1;
}
#panelModal:has(.sc-ch-click-tool-dialog) .panel-modal-card.gram-gpt-profile-sheet{
  width:min(560px,calc(100vw - 28px))!important;
  max-width:560px!important;
  border-radius:22px;
  overflow:hidden;
  position:relative;
  background:linear-gradient(165deg,rgba(28,48,64,.55) 0%,rgba(18,24,38,.96) 28%,rgba(14,18,30,.98) 100%);
  border:1px solid rgba(255,255,255,.1);
  box-shadow:
    0 0 0 1px rgba(0,136,204,.08),
    0 28px 72px rgba(0,0,0,.55),
    0 0 80px rgba(0,136,204,.14),
    inset 0 1px 0 rgba(255,255,255,.06);
  backdrop-filter:blur(18px);
}
#panelModal:has(.sc-ch-click-tool-dialog) .panel-modal-card.gram-gpt-profile-sheet::before{
  content:"";
  position:absolute;inset:0 auto auto 0;width:220px;height:160px;pointer-events:none;z-index:0;
  background:radial-gradient(ellipse at 20% 10%,rgba(0,136,204,.26),transparent 70%);
}
#panelModal:has(.sc-ch-click-tool-dialog) .panel-modal-card.gram-gpt-profile-sheet>*{position:relative;z-index:1}
#panelModal:has(.sc-ch-click-tool-dialog) .panel-modal-header{
  background:transparent;border-bottom:none;padding:1.15rem 1.25rem .35rem;
}
#panelModal:has(.sc-ch-click-tool-dialog) .panel-modal-body{
  padding:.5rem 1.15rem 1rem;
  max-height:min(78vh,720px);overflow:auto;
}
#panelModal:has(.sc-ch-click-tool-dialog) .panel-modal-footer.buy-premium-footer{
  background:transparent;border-top:none;padding:.25rem 1.15rem 1.15rem;gap:.75rem;justify-content:stretch;
}
#panelModal:has(.sc-ch-click-tool-dialog) .pd-btn-cancel,
#panelModal:has(.sc-ch-click-tool-dialog) .gpt-ep-cancel.pd-btn-cancel{
  flex:1;border-radius:999px;height:2.75rem;
  background:rgba(255,255,255,.04);border:1px solid rgba(255,255,255,.1);color:#e2e8f0;
}
#panelModal:has(.sc-ch-click-tool-dialog) .pd-btn-pay{
  flex:1.15;border-radius:999px;height:2.75rem;font-weight:600;
  background:#0088cc!important;border:none!important;
  box-shadow:0 8px 24px rgba(0,136,204,.35);
}
html:not(.theme-dark) #panelModal:has(.sc-ch-click-tool-dialog) .panel-modal-card.gram-gpt-profile-sheet{
  background:linear-gradient(165deg,#eff8ff 0%,#fff 24%,#f8fafc 100%);
  border-color:rgba(15,23,42,.1);
  box-shadow:0 24px 64px rgba(15,23,42,.16),0 0 48px rgba(0,136,204,.1);
}
html:not(.theme-dark) #panelModal:has(.sc-ch-click-tool-dialog) .panel-modal-card.gram-gpt-profile-sheet::before{
  background:radial-gradient(ellipse at 20% 10%,rgba(0,136,204,.16),transparent 70%);
}
html:not(.theme-dark) #panelModal:has(.sc-ch-click-tool-dialog) .pd-btn-cancel,
html:not(.theme-dark) #panelModal:has(.sc-ch-click-tool-dialog) .gpt-ep-cancel.pd-btn-cancel{
  background:#f1f5f9;border-color:rgba(15,23,42,.12);color:#334155;
}
#panelModal:has(.sc-ch-premium-dialog) .panel-modal-footer.buy-premium-footer .sc-ch-btn-preview{
  flex:1;
  border-radius:999px;
  height:2.75rem;
}

/* —— CRM replies + chat_filter results (v544) —— */
.gram-crm-replies-layout { display: flex; flex-direction: column; gap: 12px; }
.gram-crm-replies-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.gram-crm-replies-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.gram-crm-replies-picker { display: grid; gap: 8px; }
.gram-crm-replies-grid { display: grid; gap: 12px; }
.gram-crm-reply-acc .gram-gpt-window-body { max-height: 360px; }
.gram-crm-reply-user { border: 1px solid var(--gram-border, var(--border)); border-radius: 12px; padding: 8px 10px; margin-bottom: 8px; background: color-mix(in srgb, var(--surface) 92%, #10b981 8%); }
.gram-crm-reply-user summary { cursor: pointer; list-style: none; display: flex; gap: 8px; align-items: baseline; }
.gram-crm-reply-msgs { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.gram-crm-reply-msg { border-radius: 10px; padding: 8px 10px; font-size: 13px; }
.gram-crm-reply-msg span { display: block; font-size: 11px; color: var(--text-muted); margin-bottom: 2px; }
.gram-crm-reply-msg--in { background: color-mix(in srgb, #10b981 14%, var(--surface)); }
.gram-crm-reply-msg--out { background: color-mix(in srgb, #3b82f6 12%, var(--surface)); }
.gram-crm-replies-log { max-height: 140px; overflow: auto; font-size: 12px; padding: 10px; border-radius: 12px; background: color-mix(in srgb, var(--surface) 85%, #000 15%); border: 1px solid var(--gram-border, var(--border)); white-space: pre-wrap; }
.gram-cf-filters-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.gram-cf-results-panel .gram-gpt-window-head { flex-wrap: wrap; gap: 8px; }
.gram-cf-results-stats { margin-left: auto; font-size: 12px; color: var(--text-muted); }
.gram-cf-results-table-wrap { max-height: 480px; overflow: auto; }
.gram-cf-results-table td, .gram-cf-results-table th { font-size: 12px; vertical-align: top; }
.gram-cf-badge { display: inline-flex; padding: 2px 8px; border-radius: 999px; font-size: 11px; }
.gram-cf-badge--ok { background: color-mix(in srgb, #10b981 22%, transparent); color: #059669; }
.gram-cf-badge--dead { background: color-mix(in srgb, #ef4444 18%, transparent); color: #dc2626; }
.gram-cf-badge--wait { background: color-mix(in srgb, #f59e0b 18%, transparent); color: #d97706; }
.gram-cf-row.is-passed td:first-child { box-shadow: inset 3px 0 0 #10b981; }
@media (max-width: 900px) {
  .gram-cf-filters-grid { grid-template-columns: 1fr; }
}

/* —— chat_filter + CRM replies spam_pm shell (v545) —— */
.gram-chat-filter-page .gram-cf-pill-block{display:flex;flex-direction:column;gap:6px;margin:0 0 12px}
.gram-chat-filter-page .gram-cf-pill-block .gram-gpt-pill-row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
.gram-chat-filter-page .gram-cf-results-cards{display:flex;flex-direction:column;gap:8px;max-height:520px;overflow:auto}
.gram-chat-filter-page .gram-cf-result-card{display:flex;flex-direction:column;gap:4px;text-decoration:none;color:inherit}
.gram-chat-filter-page .gram-cf-result-about{font-size:12px;color:var(--text-muted);line-height:1.35}
.gram-chat-filter-page .gram-cf-result-card.is-passed{box-shadow:inset 3px 0 0 #10b981}
.gram-crm-replies-page{display:flex;flex-direction:column;gap:12px}
.gram-crm-replies-stat-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-bottom:10px}
.gram-crm-replies-results .gram-gpt-window-head{flex-wrap:wrap;gap:8px}
.gram-crm-reply-user-card{border:1px solid var(--gram-border,var(--border));border-radius:14px;padding:12px;margin-bottom:10px;background:color-mix(in srgb,var(--surface) 92%,#10b981 8%)}
.gram-crm-reply-user-head{display:flex;align-items:center;gap:10px;margin-bottom:10px}
.gram-crm-reply-avatar{width:36px;height:36px;border-radius:10px;display:inline-flex;align-items:center;justify-content:center;background:linear-gradient(135deg,#0088cc,#00aced);color:#fff;font-weight:700}
.gram-crm-reply-thread{display:flex;flex-direction:column;gap:6px}
.gram-crm-reply-bubble{max-width:92%;border-radius:12px;padding:8px 10px;font-size:13px}
.gram-crm-reply-bubble-meta{display:block;font-size:11px;color:var(--text-muted);margin-bottom:2px}
.gram-crm-reply-bubble--in{align-self:flex-start;background:color-mix(in srgb,#10b981 16%,var(--surface))}
.gram-crm-reply-bubble--out{align-self:flex-end;background:color-mix(in srgb,#0088cc 14%,var(--surface))}
.gram-crm-acc-modal-card{max-width:520px;width:min(520px,94vw)}
.gram-crm-acc-row{display:grid;grid-template-columns:auto 1fr auto;gap:10px;align-items:center;padding:10px 8px;border-bottom:1px solid var(--gram-border,var(--border));cursor:pointer}
@media (max-width:900px){
  .gram-chat-filter-page .gram-cf-pill-block .gram-gpt-pill-row,
  .gram-crm-replies-stat-cards{grid-template-columns:1fr}
}

/* —— chat_filter stylish table (v546) —— */
.gram-chat-filter-page .gram-cf-table-wrap{
  max-height:min(560px,58vh);
  overflow:auto;
  border-radius:12px;
  border:1px solid color-mix(in srgb,var(--gram-border,var(--border)) 80%,transparent);
  background:color-mix(in srgb,var(--surface) 94%,#000 6%);
}
.gram-chat-filter-page .gram-cf-table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  font-size:12.5px;
}
.gram-chat-filter-page .gram-cf-table thead th{
  position:sticky;
  top:0;
  z-index:1;
  text-align:left;
  font-weight:600;
  font-size:11px;
  letter-spacing:.02em;
  text-transform:uppercase;
  color:var(--text-muted);
  padding:10px 12px;
  background:color-mix(in srgb,var(--surface) 88%,#0088cc 12%);
  border-bottom:1px solid var(--gram-border,var(--border));
  white-space:nowrap;
}
.gram-chat-filter-page .gram-cf-table tbody td{
  padding:10px 12px;
  border-bottom:1px solid color-mix(in srgb,var(--gram-border,var(--border)) 70%,transparent);
  vertical-align:middle;
  color:var(--text);
}
.gram-chat-filter-page .gram-cf-tr:hover td{
  background:color-mix(in srgb,var(--surface) 90%,#0088cc 10%);
}
.gram-chat-filter-page .gram-cf-tr.is-passed td:first-child{
  box-shadow:inset 3px 0 0 #10b981;
}
.gram-chat-filter-page .gram-cf-td-link a{
  color:#0088cc;
  text-decoration:none;
  word-break:break-all;
  font-weight:500;
}
.gram-chat-filter-page .gram-cf-td-link a:hover{text-decoration:underline}
.gram-chat-filter-page .gram-cf-empty-row td{
  text-align:center;
  color:var(--text-muted);
  padding:28px 12px;
  font-size:13px;
}
.gram-chat-filter-page .gram-cf-results-search{max-width:180px}
.gram-chat-filter-page .gram-cf-passed-only{font-size:12px;white-space:nowrap}
.gram-crm-replies-page .gram-cf-results-search{max-width:200px;margin-left:auto}

/* CRM shell — sizes/glass as spam_pm */
.gram-crm-page.gram-gpt-layout {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  gap: 12px;
}
.gram-crm-page.gram-ml-glass .gram-gpt-window {
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.05);
  overflow: visible;
  backdrop-filter: blur(12px) saturate(112%);
  -webkit-backdrop-filter: blur(12px) saturate(112%);
}
html.theme-dark .gram-crm-page.gram-ml-glass .gram-gpt-window {
  background:
    linear-gradient(180deg, rgba(0, 136, 204, 0.06) 0%, rgba(0, 136, 204, 0) 100%),
    rgba(16, 23, 38, 0.42);
  border-color: rgba(0, 136, 204, 0.12);
  box-shadow:
    inset 0 1px 0 rgba(0, 136, 204, 0.06),
    0 22px 48px -32px rgba(2, 10, 25, 0.9);
  backdrop-filter: blur(12px) saturate(118%);
  -webkit-backdrop-filter: blur(12px) saturate(118%);
}
html:not(.theme-dark) .gram-crm-page.gram-ml-glass .gram-gpt-window {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(0, 136, 204, 0.12);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.05);
}
.gram-crm-page .gram-crm-tabs {
  gap: 8px;
  margin-bottom: 12px;
}
.gram-crm-page .gram-crm-tab {
  min-height: 38px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 12px;
  border-color: rgba(0, 136, 204, 0.18);
}
.gram-crm-page .gram-crm-tab.is-active {
  border-color: rgba(0, 136, 204, 0.55);
  background: rgba(0, 136, 204, 0.12);
  color: var(--text);
}
.gram-crm-page .gram-crm-period-row {
  gap: 8px;
  margin-bottom: 12px;
}
.gram-crm-page .gram-crm-period {
  min-height: 32px;
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  border-color: rgba(0, 136, 204, 0.18);
}
.gram-crm-page .gram-crm-period.is-active {
  border-color: rgba(0, 136, 204, 0.55);
  background: rgba(0, 136, 204, 0.12);
  color: var(--text);
}
.gram-crm-page .gram-crm-card {
  border-radius: 12px;
  border-color: rgba(0, 136, 204, 0.12);
  background: color-mix(in srgb, var(--surface) 88%, #0088cc 8%);
}
.gram-crm-page .gram-gpt-btn-primary {
  background: linear-gradient(135deg, #0088cc, #0077b3);
  color: #fff;
  border: none;
  box-shadow: 0 4px 14px rgba(0, 136, 204, 0.28);
}

/* —— chat_filter compact equal cards + spam list results (v548) —— */
.gram-chat-filter-page .gram-cf-cards-grid{
  align-items:stretch!important;
}
.gram-chat-filter-page .gram-cf-cards-grid > .gram-parsing-users-col{
  display:flex!important;
  flex-direction:column!important;
}
.gram-chat-filter-page .gram-cf-cards-grid > .gram-parsing-users-col > .gram-gpt-window{
  flex:1 1 auto!important;
  display:flex!important;
  flex-direction:column!important;
  height:auto!important;
  min-height:0!important;
  max-height:none!important;
}
.gram-chat-filter-page .gram-cf-cards-grid > .gram-parsing-users-col > .gram-gpt-window > .gram-gpt-window-body{
  flex:1 1 auto!important;
}
.gram-chat-filter-page .gram-cf-cards-grid #sf_identifiers{
  min-height:120px!important;
  max-height:160px!important;
  height:140px!important;
  resize:vertical;
}
.gram-chat-filter-page .gram-cf-results-panel{
  margin-top:12px;
}
.gram-chat-filter-page .gram-cf-results-panel .gram-spam-results-toolbar{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 12px;
  border-bottom:1px solid var(--border,rgba(148,163,184,.35));
}
.gram-chat-filter-page .gram-cf-results-panel .gram-spam-results-toolbar-left{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:10px;
}
.gram-chat-filter-page .gram-cf-results-panel.is-collapsed .gram-spam-results-body{
  display:none;
}
.gram-chat-filter-page .gram-cf-results-panel.is-collapsed .gram-spam-results-collapse i{
  transform:rotate(180deg);
}
.gram-chat-filter-page .gram-cf-passed-only{font-size:12px;white-space:nowrap}
.gram-chat-filter-page .gram-spam-collect-actions{
  justify-content:center!important;
}
.gram-chat-filter-page .gram-gpt-dist{
  margin-top:10px;
}

/* —— chat_filter выдача = spam glass + cyan brand —— */
.gram-chat-filter-page #chatFilterRunPanel.gram-spam-results-panel{
  border-radius:14px!important;
  border:1px solid rgba(56,189,248,.24)!important;
  background:rgba(255,255,255,.72)!important;
  backdrop-filter:blur(14px)!important;
  -webkit-backdrop-filter:blur(14px)!important;
  box-shadow:0 0 0 1px rgba(56,189,248,.08),0 12px 36px rgba(2,8,23,.12)!important;
  overflow:hidden!important;
  transition:border-color .15s ease,box-shadow .15s ease!important;
}
html.theme-dark .gram-chat-filter-page #chatFilterRunPanel.gram-spam-results-panel{
  border-color:rgba(0,136,204,.22)!important;
  background:rgba(16,23,38,.55)!important;
  box-shadow:0 12px 32px rgba(0,0,0,.32),0 1px 0 rgba(255,255,255,.04) inset!important;
}
.gram-chat-filter-page #chatFilterRunPanel.gram-spam-results-panel:hover{
  border-color:rgba(0,136,204,.45)!important;
  box-shadow:0 12px 32px rgba(15,23,42,.1),0 0 0 1px rgba(0,136,204,.18),0 0 22px rgba(0,136,204,.16)!important;
}
.gram-chat-filter-page #chatFilterRunPanel .gram-spam-results-head{
  border-bottom:1px solid rgba(0,136,204,.12)!important;
  background:transparent!important;
}
html.theme-dark .gram-chat-filter-page #chatFilterRunPanel .gram-spam-results-head{
  border-bottom-color:rgba(255,255,255,.06)!important;
}
.gram-chat-filter-page #chatFilterRunPanel .gram-card-icon.gram-tone-cyan,
.gram-chat-filter-page #chatFilterRunPanel .gram-card-icon.gram-tone-blue{
  background:linear-gradient(135deg,#0088cc,#00aced)!important;
  color:#fff!important;
  box-shadow:0 4px 12px rgba(0,136,204,.28)!important;
}
.gram-chat-filter-page #chatFilterRunPanel .gram-run-stat-cards{
  margin:12px 12px 0!important;
}
.gram-chat-filter-page #chatFilterRunPanel .gram-spam-results-toolbar{
  border-bottom:1px solid rgba(0,136,204,.12)!important;
  background:transparent!important;
}
html.theme-dark .gram-chat-filter-page #chatFilterRunPanel .gram-spam-results-toolbar{
  border-bottom-color:rgba(255,255,255,.06)!important;
}
.gram-chat-filter-page #chatFilterRunPanel .gram-cf-filters-row{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
  padding:10px 12px;
  border-bottom:1px solid rgba(0,136,204,.12);
}
html.theme-dark .gram-chat-filter-page #chatFilterRunPanel .gram-cf-filters-row{
  border-bottom-color:rgba(255,255,255,.06);
}
.gram-chat-filter-page #chatFilterRunPanel .gram-cf-filter-select{
  height:34px;
  padding:0 28px 0 10px;
  border-radius:10px;
  border:1px solid rgba(0,136,204,.22);
  background:rgba(15,23,42,.45);
  color:#e2e8f0;
  font-size:12px;
  font-weight:600;
  outline:none;
  cursor:pointer;
  appearance:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:right 8px center;
}
html:not(.theme-dark) .gram-chat-filter-page #chatFilterRunPanel .gram-cf-filter-select{
  background-color:#fff;
  color:#0f172a;
  border-color:rgba(148,163,184,.35);
}
.gram-chat-filter-page #chatFilterRunPanel .gram-cf-filter-select:focus{
  border-color:#0088cc;
  box-shadow:0 0 0 2px rgba(0,136,204,.2);
}
.gram-chat-filter-page #chatFilterRunPanel .gram-cf-filter-topic-wrap{
  flex:1 1 140px;
  min-width:120px;
}
.gram-chat-filter-page #chatFilterRunPanel .gram-cf-filter-topic{
  width:100%;
  height:34px;
  padding:0 10px;
  border-radius:10px;
  border:1px solid rgba(0,136,204,.22);
  background:rgba(15,23,42,.45);
  color:#e2e8f0;
  font-size:12px;
  outline:none;
  box-sizing:border-box;
}
html:not(.theme-dark) .gram-chat-filter-page #chatFilterRunPanel .gram-cf-filter-topic{
  background:#fff;
  color:#0f172a;
  border-color:rgba(148,163,184,.35);
}
.gram-chat-filter-page #chatFilterRunPanel .gram-cf-filter-topic:focus{
  border-color:#0088cc;
  box-shadow:0 0 0 2px rgba(0,136,204,.2);
}
.gram-chat-filter-page #chatFilterRunPanel .gram-cf-filter-topic::placeholder{
  color:#64748b;
}
.gram-chat-filter-page #chatFilterRunPanel .gram-spam-results-btn.is-copy{
  padding:10px 16px!important;
  font-size:13px!important;
  border-radius:10px!important;
  font-weight:600!important;
  gap:8px!important;
  color:#fff!important;
  border:none!important;
  background:linear-gradient(135deg,#0088cc,#00aced)!important;
  box-shadow:0 4px 14px rgba(0,136,204,.28)!important;
}
.gram-chat-filter-page #chatFilterRunPanel .gram-spam-results-btn.is-copy:hover{
  filter:brightness(1.08);
}
.gram-chat-filter-page #chatFilterRunPanel .gram-spam-results-list{
  min-height:180px;
  max-height:min(520px,58vh);
  background:transparent!important;
  padding:0 0 8px!important;
}
.gram-chat-filter-page #chatFilterRunPanel .gram-cf-table-wrap{
  width:100%;
  overflow:auto;
  -webkit-overflow-scrolling:touch;
}
.gram-chat-filter-page #chatFilterRunPanel .gram-cf-table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  font-size:12.5px;
  line-height:1.35;
}
.gram-chat-filter-page #chatFilterRunPanel .gram-cf-table thead th{
  position:sticky;
  top:0;
  z-index:1;
  text-align:left;
  font-size:10px;
  font-weight:700;
  letter-spacing:.04em;
  text-transform:uppercase;
  color:#64748b;
  padding:10px 12px;
  border-bottom:1px solid rgba(0,136,204,.14);
  background:rgba(248,250,252,.96);
  white-space:nowrap;
}
html.theme-dark .gram-chat-filter-page #chatFilterRunPanel .gram-cf-table thead th{
  color:#94a3b8;
  background:rgba(15,23,42,.92);
  border-bottom-color:rgba(255,255,255,.08);
}
.gram-chat-filter-page #chatFilterRunPanel .gram-cf-table tbody td{
  padding:11px 12px;
  border-bottom:1px solid rgba(148,163,184,.14);
  color:#0f172a;
  vertical-align:middle;
}
html.theme-dark .gram-chat-filter-page #chatFilterRunPanel .gram-cf-table tbody td{
  color:#e2e8f0;
  border-bottom-color:rgba(255,255,255,.06);
}
.gram-chat-filter-page #chatFilterRunPanel .gram-cf-tr:hover td{
  background:rgba(0,136,204,.06);
}
html.theme-dark .gram-chat-filter-page #chatFilterRunPanel .gram-cf-tr:hover td{
  background:rgba(0,136,204,.1);
}
.gram-chat-filter-page #chatFilterRunPanel .gram-cf-tr.is-passed td:first-child{
  box-shadow:inset 3px 0 0 #10b981;
}
.gram-chat-filter-page #chatFilterRunPanel .gram-cf-col-num{
  width:44px;
  text-align:center!important;
  color:#64748b!important;
  font-variant-numeric:tabular-nums;
}
.gram-chat-filter-page #chatFilterRunPanel .gram-cf-col-title{
  font-weight:700;
  max-width:220px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.gram-chat-filter-page #chatFilterRunPanel .gram-cf-col-user{
  white-space:nowrap;
  color:#38bdf8;
  max-width:140px;
  overflow:hidden;
  text-overflow:ellipsis;
}
.gram-chat-filter-page #chatFilterRunPanel .gram-cf-col-topic{
  max-width:220px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  color:#64748b;
}
html.theme-dark .gram-chat-filter-page #chatFilterRunPanel .gram-cf-col-topic{
  color:#94a3b8;
}
.gram-chat-filter-page #chatFilterRunPanel .gram-cf-col-act{
  width:44px;
  text-align:center!important;
}
.gram-chat-filter-page #chatFilterRunPanel .gram-cf-pill{
  display:inline-flex;
  align-items:center;
  padding:2px 8px;
  border-radius:999px;
  font-size:10px;
  font-weight:700;
  letter-spacing:.02em;
  white-space:nowrap;
  background:rgba(148,163,184,.16);
  color:#64748b;
}
.gram-chat-filter-page #chatFilterRunPanel .gram-cf-pill.is-ok,
.gram-chat-filter-page #chatFilterRunPanel .gram-cf-pill.is-write-ok{
  background:rgba(16,185,129,.14);
  color:#059669;
}
.gram-chat-filter-page #chatFilterRunPanel .gram-cf-pill.is-err,
.gram-chat-filter-page #chatFilterRunPanel .gram-cf-pill.is-write-err{
  background:rgba(239,68,68,.12);
  color:#dc2626;
}
.gram-chat-filter-page #chatFilterRunPanel .gram-cf-pill.is-pending,
.gram-chat-filter-page #chatFilterRunPanel .gram-cf-pill.is-write-muted{
  background:rgba(148,163,184,.14);
  color:#94a3b8;
}
html.theme-dark .gram-chat-filter-page #chatFilterRunPanel .gram-cf-pill.is-ok,
html.theme-dark .gram-chat-filter-page #chatFilterRunPanel .gram-cf-pill.is-write-ok{
  color:#6ee7b7;
}
html.theme-dark .gram-chat-filter-page #chatFilterRunPanel .gram-cf-pill.is-err,
html.theme-dark .gram-chat-filter-page #chatFilterRunPanel .gram-cf-pill.is-write-err{
  color:#fca5a5;
}
.gram-chat-filter-page #chatFilterRunPanel .gram-cf-act{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:30px;
  height:30px;
  border-radius:10px;
  color:#38bdf8;
  text-decoration:none;
}
.gram-chat-filter-page #chatFilterRunPanel .gram-cf-act:hover{
  background:rgba(0,136,204,.12);
  color:#00aced;
}
.gram-chat-filter-page #chatFilterRunPanel .gram-cf-act.is-disabled{
  opacity:.35;
  pointer-events:none;
}
/* === spam_pm mock-v2 ref override (append-only; do not edit above) === */
.gram-spam-pm-page.gram-spam-pm-mock-v2.gram-gpt-layout {
  max-width: 100% !important;
  width: 100% !important;
  position: relative !important;
  gap: 12px !important;
}
.gram-spam-pm-page.gram-spam-pm-mock-v2.gram-gpt-layout::before {
  content: "" !important;
  pointer-events: none !important;
  position: absolute !important;
  inset: -48px -24px auto !important;
  height: 300px !important;
  z-index: 0 !important;
  background:
    radial-gradient(ellipse at 28% 0%, rgba(245, 166, 35, 0.2), transparent 55%),
    radial-gradient(ellipse at 82% 8%, rgba(245, 166, 35, 0.1), transparent 50%) !important;
}
.gram-spam-pm-page.gram-spam-pm-mock-v2 > *,
.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-hero-head,
.gram-spam-pm-page.gram-spam-pm-mock-v2 #panelAccountsBar,
.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-form,
.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-parsing-live-stats,
.gram-spam-pm-page.gram-spam-pm-mock-v2 #moduleLiveLog {
  position: relative !important;
  z-index: 1 !important;
}

/* Hero */
.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-hero {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  gap: 16px !important;
  flex-wrap: wrap !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  padding: 4px 0 12px !important;
  border-radius: 0 !important;
}
.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-hero:hover {
  border: 0 !important;
  box-shadow: none !important;
}
.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-hero-title {
  margin: 0 !important;
  color: #fff !important;
  font-size: 30px !important;
  font-weight: 800 !important;
  letter-spacing: -0.02em !important;
}
.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-hero-sub {
  display: block !important;
  margin: 6px 0 0 !important;
  color: #94a3b8 !important;
  font-size: 13px !important;
  line-height: 1.45 !important;
  max-width: 560px !important;
}
.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-hero-chips {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  margin-top: 12px !important;
}
.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-hero-chip {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 5px 10px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(245, 166, 35, 0.28) !important;
  background: rgba(245, 166, 35, 0.08) !important;
  color: #fbbf24 !important;
  font-size: 11px !important;
  font-weight: 600 !important;
}
.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-hero-actions {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  flex-wrap: wrap !important;
  visibility: visible !important;
  opacity: 1 !important;
}
.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-hero-actions .gram-spam-pm-hero-secondary {
  display: none !important;
}
.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-hero-actions .gram-spam-collect-actions {
  display: inline-flex !important;
  align-items: center !important;
  gap: 10px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  min-height: 0 !important;
  visibility: visible !important;
  opacity: 1 !important;
}
html body .gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-hero-actions #panelLaunchBtn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  visibility: visible !important;
  opacity: 1 !important;
  min-height: 46px !important;
  padding: 0 20px !important;
  border: 0 !important;
  border-radius: 12px !important;
  background: linear-gradient(135deg, #f5a623, #e08e0b) !important;
  color: #111 !important;
  font-weight: 700 !important;
  box-shadow: 0 8px 22px rgba(245, 166, 35, 0.45) !important;
}
html body .gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-hero-actions #panelCollectRepliesBtn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  visibility: visible !important;
  opacity: 1 !important;
  min-height: 46px !important;
  padding: 0 16px !important;
  border: 1px solid rgba(245, 166, 35, 0.45) !important;
  border-radius: 12px !important;
  background: rgba(15, 23, 42, 0.55) !important;
  color: #f5a623 !important;
  box-shadow: none !important;
}

/* 3-col grid ≈ 32 | 42 | 26 */
html body .gram-spam-pm-page.gram-spam-pm-mock-v2.gram-parsing-preset-page .gram-parsing-users-grid.gram-spam-pm-main-grid,
html body .gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-main-grid {
  display: grid !important;
  grid-template-columns: minmax(260px, 0.32fr) minmax(0, 0.42fr) minmax(240px, 0.26fr) !important;
  gap: 14px !important;
  align-items: start !important;
}
.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-main-grid > .gram-parsing-users-col {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  min-width: 0 !important;
}

/* Glass windows + amber accents */
.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-gpt-window {
  border: 1px solid rgba(245, 166, 35, 0.16) !important;
  background: rgba(16, 23, 38, 0.62) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border-radius: 16px !important;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28) !important;
}
.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-gpt-window-head .pi,
.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-card-icon {
  color: #f5a623 !important;
  background: rgba(245, 166, 35, 0.12) !important;
}
.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-mode-tab.active,
.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-source-tab.active {
  background: rgba(245, 166, 35, 0.18) !important;
  border-color: rgba(245, 166, 35, 0.55) !important;
  color: #f5a623 !important;
  box-shadow: inset 0 0 0 1px rgba(245, 166, 35, 0.25) !important;
}
.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-mode-tabs {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 8px !important;
  width: 100% !important;
}
.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-mode-opts {
  margin-top: 12px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
}
.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-parsing-slider-fill,
.gram-spam-pm-page.gram-spam-pm-mock-v2 [data-delay-fill],
.gram-spam-pm-page.gram-spam-pm-mock-v2 [data-spam-pm-flood-fill],
.gram-spam-pm-page.gram-spam-pm-mock-v2 [data-spam-pm-timeout-fill] {
  background: linear-gradient(90deg, #f5a623, #ffcf70) !important;
}
.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-dual-track .gram-spam-pm-dual-input::-webkit-slider-thumb,
.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-dual-track .gram-spam-pm-dual-input::-moz-range-thumb {
  background: #f5a623 !important;
  border-color: #fff !important;
}
.gram-spam-pm-page.gram-spam-pm-mock-v2 #panelAccountsOpenBtn,
.gram-spam-pm-page.gram-spam-pm-mock-v2 #panelDistributeBtn {
  background: rgba(245, 166, 35, 0.14) !important;
  border: 1px solid rgba(245, 166, 35, 0.45) !important;
  color: #f5a623 !important;
}

/* Chain + phone */
.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-col-chain .gram-spam-pm-editor-placeholder {
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow: visible !important;
  gap: 10px !important;
}
.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-col-chain .gram-spam-pm-placeholder-drop {
  display: none !important;
}
.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-chain-summary {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  margin: 0 !important;
}
.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-chain-summary[hidden] {
  display: none !important;
}
.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-chain-sum-card {
  display: flex !important;
  align-items: flex-start !important;
  gap: 10px !important;
  padding: 12px !important;
  border-radius: 12px !important;
  border: 1px solid rgba(245, 166, 35, 0.22) !important;
  background: rgba(15, 23, 42, 0.55) !important;
}
.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-chain-sum-num {
  flex: 0 0 auto !important;
  width: 22px !important;
  height: 22px !important;
  border-radius: 50% !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: #f5a623 !important;
  color: #111 !important;
  font-size: 11px !important;
  font-weight: 700 !important;
}
.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-chain-sum-tag {
  font-size: 10px !important;
  font-weight: 700 !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
  color: #fbbf24 !important;
}
.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-chain-sum-text {
  font-size: 13px !important;
  line-height: 1.4 !important;
  color: #e2e8f0 !important;
  word-break: break-word !important;
}
.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-chain-sum-wait {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  font-size: 11px !important;
  color: #94a3b8 !important;
  padding: 2px 0 !important;
}
.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-col-chain .gram-spam-pm-chain-add-btn {
  border: 1.5px dashed rgba(245, 166, 35, 0.4) !important;
  background: transparent !important;
  color: #f5a623 !important;
  box-shadow: none !important;
}
.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-col-chain .gram-spam-pm-chain-edit-btn,
.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-col-chain .gram-spam-pm-placeholder-btn.is-ready {
  border: 1.5px solid rgba(245, 166, 35, 0.55) !important;
  background: rgba(245, 166, 35, 0.1) !important;
  color: #f5a623 !important;
  box-shadow: none !important;
}
.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-phone {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  padding: 8px 4px !important;
  gap: 10px !important;
}
.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-phone-bezel {
  width: 100% !important;
  max-width: 280px !important;
  border-radius: 28px !important;
  padding: 10px !important;
  background: linear-gradient(160deg, #1a1a1e, #0b0b0d) !important;
  border: 1px solid rgba(245, 166, 35, 0.22) !important;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45) !important;
}
.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-phone-notch {
  width: 92px !important;
  height: 10px !important;
  border-radius: 999px !important;
  background: #000 !important;
  margin: 2px auto 10px !important;
}
.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-phone-screen {
  min-height: 320px !important;
  border-radius: 18px !important;
  background: #0f172a !important;
  padding: 10px !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
}
.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-phone-note {
  margin: 0 !important;
  font-size: 11px !important;
  line-height: 1.4 !important;
  color: #64748b !important;
  text-align: center !important;
  max-width: 260px !important;
}
.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-preview-bubble.is-out {
  background: rgba(245, 166, 35, 0.18) !important;
  border: 1px solid rgba(245, 166, 35, 0.28) !important;
}

/* Stats + log */
.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-parsing-live-stats {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 10px !important;
  margin: 14px 0 !important;
}
.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-parsing-live-stat {
  min-width: 0 !important;
  border-radius: 14px !important;
  border: 1px solid rgba(245, 166, 35, 0.2) !important;
  background: rgba(16, 23, 38, 0.55) !important;
  backdrop-filter: blur(10px) !important;
}
.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-parsing-live-stat-icon {
  background: rgba(245, 166, 35, 0.16) !important;
  color: #f5a623 !important;
}
.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-stat-err {
  background: rgba(239, 68, 68, 0.16) !important;
  color: #f87171 !important;
}
.gram-spam-pm-page.gram-spam-pm-mock-v2 #moduleLiveLog {
  border: 1px solid rgba(245, 166, 35, 0.16) !important;
  border-radius: 16px !important;
  overflow: hidden !important;
}
.gram-spam-pm-page.gram-spam-pm-mock-v2 #panelAccountsBar {
  border: 1px solid rgba(245, 166, 35, 0.16) !important;
  background: rgba(16, 23, 38, 0.55) !important;
  border-radius: 14px !important;
}
.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-filters-row {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 12px !important;
  margin: 0 !important;
  flex: 0 0 auto !important;
  height: auto !important;
}
.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-filters-row .gram-parsing-filter-list {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 8px 12px !important;
}
.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-delays-tail,
.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-tempo-tail {
  margin: 0 !important;
  width: 100% !important;
  display: block !important;
}

@media (max-width: 1200px) {
  html body .gram-spam-pm-page.gram-spam-pm-mock-v2.gram-parsing-preset-page .gram-parsing-users-grid.gram-spam-pm-main-grid,
  html body .gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-main-grid {
    grid-template-columns: minmax(260px, 0.38fr) minmax(0, 0.62fr) !important;
  }
  .gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-col-preview {
    grid-column: 1 / -1 !important;
  }
  .gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-parsing-live-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}
@media (max-width: 980px) {
  html body .gram-spam-pm-page.gram-spam-pm-mock-v2.gram-parsing-preset-page .gram-parsing-users-grid.gram-spam-pm-main-grid,
  html body .gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-main-grid {
    grid-template-columns: 1fr !important;
  }
  .gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-parsing-live-stats {
    grid-template-columns: 1fr 1fr !important;
  }
  .gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-filters-row .gram-parsing-filter-list {
    grid-template-columns: 1fr !important;
  }
}
/* === /spam_pm mock-v2 ref override === */

/* === spam_pm mock-v2 2-zone body (form | phone) === */
.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-body {
  display: grid !important;
  grid-template-columns: 0.38fr 0.62fr !important;
  gap: 14px !important;
  align-items: start !important;
  width: 100% !important;
}
.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-body-form,
.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-body-preview {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  min-width: 0 !important;
}
/* kill старые 3-col сетки внутри mock-v2 */
.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-main-grid,
.gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-parsing-users-grid {
  display: contents !important;
}
@media (max-width: 980px) {
  .gram-spam-pm-page.gram-spam-pm-mock-v2 .gram-spam-pm-body {
    grid-template-columns: 1fr !important;
  }
}
/* === /spam_pm mock-v2 2-zone body === */


/* === spam-pm-v2 island (from spam-pm-v2.css) === */
/* Spam PM v2 island — только .spam-pm-v2-* / host. Не трогает глобальные .gram-* */

.spam-pm-v2-host {
  width: 100%;
  min-width: 0;
}

.spam-pm-v2-legacy {
  display: none !important;
}

.spam-pm-v2-root {
  --sp2-amber: #f5a623;
  --sp2-amber-soft: rgba(245, 166, 35, 0.14);
  --sp2-amber-line: rgba(245, 166, 35, 0.35);
  --sp2-amber-glow: rgba(245, 166, 35, 0.4);
  --sp2-bg: transparent;
  --sp2-card: rgba(16, 23, 38, 0.62);
  --sp2-card-border: rgba(245, 166, 35, 0.16);
  --sp2-text: #f8fafc;
  --sp2-muted: #94a3b8;
  --sp2-line: rgba(148, 163, 184, 0.14);
  --sp2-ok: #22c55e;
  --sp2-err: #ef4444;
  --sp2-radius: 16px;
  --sp2-radius-sm: 12px;
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: var(--sp2-text);
  font-family: Inter, system-ui, sans-serif;
  box-sizing: border-box;
  padding: 4px 0 8px;
}

.spam-pm-v2-root *,
.spam-pm-v2-root *::before,
.spam-pm-v2-root *::after {
  box-sizing: border-box;
}

.spam-pm-v2-root::before {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: -48px -24px auto;
  height: 280px;
  background:
    radial-gradient(ellipse at 28% 0%, rgba(245, 166, 35, 0.18), transparent 55%),
    radial-gradient(ellipse at 82% 8%, rgba(245, 166, 35, 0.1), transparent 50%);
  z-index: 0;
}

.spam-pm-v2-root > * {
  position: relative;
  z-index: 1;
}

/* —— header —— */
.spam-pm-v2-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 4px 0 2px;
}

.spam-pm-v2-header-text {
  min-width: 0;
  flex: 1 1 280px;
}

.spam-pm-v2-title {
  margin: 0;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: #fff;
}

.spam-pm-v2-sub {
  margin: 8px 0 0;
  max-width: 560px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--sp2-muted);
}

.spam-pm-v2-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.spam-pm-v2-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(245, 166, 35, 0.28);
  background: rgba(245, 166, 35, 0.08);
  color: #fbbf24;
  font-size: 11px;
  font-weight: 600;
}

.spam-pm-v2-chip .pi {
  font-size: 11px;
}

.spam-pm-v2-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.spam-pm-v2-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: 0;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.spam-pm-v2-btn:active {
  transform: translateY(1px);
}

.spam-pm-v2-btn-start {
  background: linear-gradient(135deg, #f5a623, #e08e0b);
  color: #111;
  box-shadow: 0 8px 22px var(--sp2-amber-glow);
}

.spam-pm-v2-btn-collect {
  background: rgba(245, 166, 35, 0.06);
  color: var(--sp2-amber);
  border: 1px solid rgba(245, 166, 35, 0.45);
}

.spam-pm-v2-btn-ghost {
  background: transparent;
  color: var(--sp2-amber);
  border: 0;
  min-height: 36px;
  padding: 0 8px;
  font-weight: 600;
  font-size: 13px;
}

.spam-pm-v2-btn-outline {
  width: 100%;
  background: rgba(245, 166, 35, 0.08);
  color: var(--sp2-amber);
  border: 1.5px solid rgba(245, 166, 35, 0.5);
  min-height: 44px;
}

.spam-pm-v2-btn-amber-soft {
  background: rgba(245, 166, 35, 0.12);
  color: var(--sp2-amber);
  border: 1px solid rgba(245, 166, 35, 0.35);
  min-height: 40px;
  width: 100%;
}

/* —— accounts —— */
.spam-pm-v2-accounts {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--sp2-radius);
  border: 1px solid var(--sp2-card-border);
  background: var(--sp2-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

.spam-pm-v2-accounts-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--sp2-text);
}

.spam-pm-v2-accounts-label .pi {
  color: var(--sp2-amber);
}

.spam-pm-v2-accounts-pick {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--sp2-amber-line);
  background: rgba(245, 166, 35, 0.08);
  color: var(--sp2-amber);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.spam-pm-v2-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--sp2-amber);
  color: #111;
  font-size: 11px;
  font-weight: 800;
}

/* —— body 2-col —— */
.spam-pm-v2-body {
  display: grid;
  grid-template-columns: 0.38fr 0.62fr;
  gap: 14px;
  align-items: start;
  width: 100%;
}

.spam-pm-v2-form,
.spam-pm-v2-preview {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.spam-pm-v2-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 280px);
  gap: 14px;
  align-items: start;
}

/* —— cards —— */
.spam-pm-v2-card {
  border-radius: var(--sp2-radius);
  border: 1px solid var(--sp2-card-border);
  background: var(--sp2-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24);
  overflow: hidden;
}

.spam-pm-v2-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--sp2-line);
}

.spam-pm-v2-card-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--sp2-amber-soft);
  color: var(--sp2-amber);
  flex: 0 0 auto;
}

.spam-pm-v2-card-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--sp2-text);
  flex: 1 1 auto;
  min-width: 0;
}

.spam-pm-v2-card-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.spam-pm-v2-count-chip {
  margin-left: auto;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0, 136, 204, 0.16);
  color: #7dd3fc;
  font-size: 11px;
  font-weight: 700;
}

/* tabs */
.spam-pm-v2-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.spam-pm-v2-tab {
  min-height: 38px;
  border-radius: 10px;
  border: 1px solid var(--sp2-line);
  background: rgba(15, 23, 42, 0.45);
  color: var(--sp2-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.spam-pm-v2-tab.is-active {
  border-color: rgba(245, 166, 35, 0.55);
  background: rgba(245, 166, 35, 0.14);
  color: var(--sp2-amber);
  box-shadow: inset 0 0 0 1px rgba(245, 166, 35, 0.2);
}

.spam-pm-v2-hint {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(0, 136, 204, 0.28);
  background: rgba(0, 136, 204, 0.08);
  color: #cbd5e1;
  font-size: 12px;
  line-height: 1.4;
}

.spam-pm-v2-field-label {
  display: block;
  margin: 0 0 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sp2-muted);
}

.spam-pm-v2-textarea {
  width: 100%;
  min-height: 84px;
  resize: vertical;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(8, 12, 22, 0.72);
  color: var(--sp2-text);
  font-size: 13px;
  line-height: 1.4;
  font-family: inherit;
}

.spam-pm-v2-textarea:focus {
  outline: none;
  border-color: var(--sp2-amber-line);
  box-shadow: 0 0 0 2px rgba(245, 166, 35, 0.15);
}

/* mode opts */
.spam-pm-v2-checks {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.spam-pm-v2-check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #e2e8f0;
  cursor: pointer;
  user-select: none;
}

.spam-pm-v2-check input {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1.5px solid rgba(245, 166, 35, 0.45);
  background: rgba(8, 12, 22, 0.7);
  display: inline-grid;
  place-content: center;
  flex: 0 0 auto;
  margin: 0;
  cursor: pointer;
}

.spam-pm-v2-check input:checked {
  background: var(--sp2-amber);
  border-color: var(--sp2-amber);
}

.spam-pm-v2-check input:checked::after {
  content: "";
  width: 8px;
  height: 5px;
  border-left: 2px solid #111;
  border-bottom: 2px solid #111;
  transform: rotate(-45deg) translateY(-1px);
}

/* delays */
.spam-pm-v2-sliders {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.spam-pm-v2-slider-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.spam-pm-v2-slider-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.spam-pm-v2-slider-label {
  font-size: 12px;
  font-weight: 600;
  color: #e2e8f0;
}

.spam-pm-v2-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--sp2-amber), #ffcf70) 0 / var(--sp2-fill, 45%) 100% no-repeat,
    rgba(148, 163, 184, 0.18);
  outline: none;
}

.spam-pm-v2-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--sp2-amber);
  box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.25);
  cursor: pointer;
}

.spam-pm-v2-range::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--sp2-amber);
  cursor: pointer;
}

.spam-pm-v2-slider-val {
  min-width: 64px;
  text-align: right;
  font-size: 12px;
  font-weight: 700;
  color: #fbbf24;
  font-variant-numeric: tabular-nums;
}

/* filters list */
.spam-pm-v2-filter-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.spam-pm-v2-filter-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.spam-pm-v2-filter-item .spam-pm-v2-check {
  flex: 1 1 auto;
}

.spam-pm-v2-gear {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--sp2-line);
  background: rgba(15, 23, 42, 0.5);
  color: var(--sp2-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* chain */
.spam-pm-v2-chain-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.spam-pm-v2-msg {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 20px;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border-radius: var(--sp2-radius-sm);
  border: 1px solid rgba(245, 166, 35, 0.18);
  background: rgba(8, 12, 22, 0.55);
}

.spam-pm-v2-msg-num {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--sp2-amber-soft);
  color: var(--sp2-amber);
  font-size: 12px;
  font-weight: 800;
}

.spam-pm-v2-msg-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.spam-pm-v2-msg-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fbbf24;
}

.spam-pm-v2-msg-text {
  font-size: 13px;
  line-height: 1.4;
  color: #e2e8f0;
  word-break: break-word;
}

.spam-pm-v2-msg-drag {
  color: #64748b;
  font-size: 14px;
  padding-top: 4px;
  cursor: grab;
}

.spam-pm-v2-wait {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11px;
  color: var(--sp2-muted);
  padding: 2px 0;
}

.spam-pm-v2-chain-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

/* phone */
.spam-pm-v2-phone-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 8px 4px 4px;
}

.spam-pm-v2-phone {
  width: 100%;
  max-width: 260px;
  border-radius: 28px;
  padding: 10px;
  background: linear-gradient(160deg, #1a1a1e, #0b0b0d);
  border: 1px solid rgba(245, 166, 35, 0.22);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

.spam-pm-v2-phone-notch {
  width: 92px;
  height: 10px;
  border-radius: 999px;
  background: #000;
  margin: 2px auto 10px;
}

.spam-pm-v2-phone-screen {
  min-height: 340px;
  border-radius: 18px;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.spam-pm-v2-phone-user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #e2e8f0;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.spam-pm-v2-phone-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(245, 166, 35, 0.2);
  color: var(--sp2-amber);
  font-size: 10px;
  font-weight: 800;
}

.spam-pm-v2-bubble {
  align-self: flex-end;
  max-width: 92%;
  padding: 8px 10px;
  border-radius: 12px 12px 4px 12px;
  background: rgba(245, 166, 35, 0.18);
  border: 1px solid rgba(245, 166, 35, 0.28);
  color: #f8fafc;
  font-size: 12px;
  line-height: 1.35;
}

.spam-pm-v2-bubble-in {
  align-self: flex-start;
  border-radius: 12px 12px 12px 4px;
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(148, 163, 184, 0.18);
}

.spam-pm-v2-phone-note {
  margin: 0;
  text-align: center;
  font-size: 11px;
  color: var(--sp2-muted);
  max-width: 260px;
  line-height: 1.35;
}

/* —— footer stats —— */
.spam-pm-v2-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.spam-pm-v2-stat {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  padding: 12px;
  border-radius: var(--sp2-radius-sm);
  border: 1px solid rgba(245, 166, 35, 0.18);
  background: rgba(16, 23, 38, 0.55);
  backdrop-filter: blur(10px);
}

.spam-pm-v2-stat-ico {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(245, 166, 35, 0.16);
  color: var(--sp2-amber);
  flex: 0 0 auto;
}

.spam-pm-v2-stat-ico.is-err {
  background: rgba(239, 68, 68, 0.16);
  color: var(--sp2-err);
}

.spam-pm-v2-stat-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.spam-pm-v2-stat-copy strong {
  font-size: 15px;
  line-height: 1.2;
  color: #f1f5f9;
}

.spam-pm-v2-stat-copy span {
  font-size: 11px;
  color: var(--sp2-muted);
}

/* —— log —— */
.spam-pm-v2-log {
  border-radius: var(--sp2-radius);
  border: 1px solid rgba(245, 166, 35, 0.16);
  background: rgba(16, 23, 38, 0.55);
  overflow: hidden;
}

.spam-pm-v2-log-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-bottom: 1px solid var(--sp2-line);
}

.spam-pm-v2-log-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.spam-pm-v2-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.12);
  color: var(--sp2-ok);
  font-size: 11px;
  font-weight: 700;
}

.spam-pm-v2-live::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sp2-ok);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.spam-pm-v2-log-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-left: 8px;
}

.spam-pm-v2-log-pill {
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--sp2-line);
  background: transparent;
  color: var(--sp2-muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.spam-pm-v2-log-pill.is-active {
  border-color: rgba(245, 166, 35, 0.4);
  color: var(--sp2-amber);
  background: rgba(245, 166, 35, 0.08);
}

.spam-pm-v2-log-tools {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.spam-pm-v2-log-search {
  min-width: 160px;
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--sp2-line);
  background: rgba(8, 12, 22, 0.65);
  color: var(--sp2-text);
  font-size: 12px;
}

.spam-pm-v2-log-body {
  padding: 0;
  max-height: 220px;
  overflow: auto;
}

.spam-pm-v2-log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.spam-pm-v2-log-table th {
  text-align: left;
  padding: 8px 14px;
  color: var(--sp2-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--sp2-line);
  background: rgba(8, 12, 22, 0.45);
}

.spam-pm-v2-log-table td {
  padding: 10px 14px;
  color: #e2e8f0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.spam-pm-v2-ok {
  color: var(--sp2-ok);
  font-weight: 600;
}

/* —— status bar —— */
.spam-pm-v2-statusbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--sp2-line);
  background: rgba(8, 12, 22, 0.65);
  font-size: 12px;
  color: var(--sp2-muted);
}

.spam-pm-v2-statusbar b {
  color: #e2e8f0;
  font-weight: 700;
}

.spam-pm-v2-statusbar .is-ok {
  color: var(--sp2-ok);
}

.spam-pm-v2-statusbar .is-err {
  color: var(--sp2-err);
}

.spam-pm-v2-statusbar-sep {
  width: 1px;
  height: 12px;
  background: rgba(148, 163, 184, 0.25);
}

@media (max-width: 1100px) {
  .spam-pm-v2-preview {
    grid-template-columns: 1fr;
  }

  .spam-pm-v2-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .spam-pm-v2-body {
    grid-template-columns: 1fr;
  }

  .spam-pm-v2-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .spam-pm-v2-title {
    font-size: 24px;
  }
}

/* === /spam-pm-v2 island === */


/* === spam-pm-v2 bridge (show legacy guts in island) === */
.spam-pm-v2-host.is-bridged .spam-pm-v2-legacy {
  display: block !important;
}
.spam-pm-v2-host.is-bridged .spam-pm-v2-legacy-chrome,
.spam-pm-v2-host.is-bridged .gram-spam-pm-hero-head {
  display: none !important;
}
.spam-pm-v2-root .gram-spam-collect-actions {
  display: inline-flex !important;
  gap: 10px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
.spam-pm-v2-root #panelLaunchBtn {
  background: linear-gradient(135deg, #f5a623, #e08e0b) !important;
  border: 0 !important;
  color: #111 !important;
  font-weight: 700 !important;
  box-shadow: 0 8px 22px rgba(245, 166, 35, 0.45) !important;
  border-radius: 12px !important;
  min-height: 44px !important;
}
.spam-pm-v2-root #panelCollectRepliesBtn {
  background: rgba(245, 166, 35, 0.06) !important;
  border: 1px solid rgba(245, 166, 35, 0.45) !important;
  color: #f5a623 !important;
  border-radius: 12px !important;
  min-height: 44px !important;
}
.spam-pm-v2-root #panelAccountsBar.spam-pm-v2-accounts-live,
.spam-pm-v2-root #panelAccountsBar {
  width: 100% !important;
  margin: 0 !important;
}
.spam-pm-v2-root #panelSettingsForm.spam-pm-v2-form-live {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  width: 100% !important;
  min-width: 0 !important;
}
.spam-pm-v2-root #spamPmLiveStats,
.spam-pm-v2-root #moduleLiveLog {
  width: 100% !important;
}
/* === /spam-pm-v2 bridge === */


/* === spam_pm classic restore (user screenshots) === */
.gram-spam-pm-page.gram-gpt-layout.gram-parsing-page--users > .gram-spam-pm-hero-head,
.gram-spam-pm-page.gram-gpt-layout.gram-parsing-page--users > .gram-gpt-notice:not([hidden]),
.gram-spam-pm-page.gram-gpt-layout.gram-parsing-page--users > #panelAccountsBar {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}
.gram-spam-pm-page.gram-gpt-layout.gram-parsing-page--users .gram-spam-pm-hero {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}
.gram-spam-pm-page.gram-gpt-layout.gram-parsing-page--users .gram-spam-pm-hero-actions,
.gram-spam-pm-page.gram-gpt-layout.gram-parsing-page--users .gram-spam-collect-actions {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}
.gram-spam-pm-page.gram-gpt-layout.gram-parsing-page--users #panelLaunchBtn,
.gram-spam-pm-page.gram-gpt-layout.gram-parsing-page--users #panelCollectRepliesBtn {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}
.gram-spam-pm-page.gram-gpt-layout.gram-parsing-page--users .gram-spam-pm-defender-window {
  display: block !important;
  visibility: visible !important;
}
.gram-spam-pm-page.gram-gpt-layout.gram-parsing-page--users .gram-parsing-users-grid {
  display: grid !important;
}
.gram-spam-pm-page.gram-gpt-layout.gram-parsing-page--users .gram-spam-pm-speed-row {
  display: grid !important;
}
/* === /spam_pm classic restore === */

/* ═══════════════════════════════════════════════════════════
   spam_pm CLASSIC — REF amber glass (etalon mock)
   scope: only classic Спамер по ЛС (parsing-preset, not other modules)
   colors + glass only; layout/logic untouched
   ═══════════════════════════════════════════════════════════ */

html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) {
  --sp-ref-amber: #f5a623;
  --sp-ref-amber-hi: #ffb040;
  --sp-ref-amber-end: #e08e0b;
  --sp-ref-amber-soft: rgba(245, 166, 35, 0.14);
  --sp-ref-amber-line: rgba(245, 166, 35, 0.42);
  --sp-ref-amber-glow: rgba(245, 166, 35, 0.35);
  --sp-ref-glass: rgba(16, 23, 38, 0.48);
  --sp-ref-glass-border: rgba(255, 255, 255, 0.1);
}

html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) .main-wrap {
  background:
    radial-gradient(ellipse 120% 90% at 100% 0%, rgba(245, 166, 35, 0.12) 0%, transparent 45%),
    radial-gradient(ellipse 80% 60% at 0% 100%, rgba(90, 70, 40, 0.18) 0%, transparent 50%),
    radial-gradient(ellipse 130% 100% at top right, #243349 0%, #131c2b 40%, #0a0f18 75%, #070b12 100%) !important;
}

html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) .content-glass {
  position: relative !important;
  background: rgba(255, 255, 255, 0.02) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 28px !important;
  backdrop-filter: blur(24px) saturate(1.3) !important;
  -webkit-backdrop-filter: blur(24px) saturate(1.3) !important;
  box-shadow: 0 20px 60px -15px rgba(0, 0, 0, 0.55) !important;
  overflow: hidden !important;
}

html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) .content-glass::before {
  content: "" !important;
  pointer-events: none !important;
  position: absolute !important;
  inset: 0 !important;
  z-index: 0 !important;
  border-radius: inherit !important;
  background: radial-gradient(55% 50% at 100% 0%, rgba(245, 166, 35, 0.1) 0%, transparent 60%) !important;
}

html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) .content-glass::after {
  content: "" !important;
  pointer-events: none !important;
  position: absolute !important;
  right: -5rem !important;
  top: -6rem !important;
  width: 16rem !important;
  height: 16rem !important;
  border-radius: 9999px !important;
  opacity: 0.65 !important;
  z-index: 0 !important;
  background: radial-gradient(circle at 34% 30%, #7c879a 0%, #4a5464 32%, #2b3341 62%, #1b212c 82%, #141922 100%) !important;
  box-shadow: 0 0 80px 28px rgba(120, 140, 175, 0.1), inset -16px -12px 36px rgba(0, 0, 0, 0.5) !important;
}

html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) .content-glass > * {
  position: relative !important;
  z-index: 1 !important;
}

html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) {
  --primary: #f5a623 !important;
  --sp-ref-amber: #f5a623;
  --sp-ref-amber-hi: #ffb040;
  --sp-ref-amber-end: #e08e0b;
}

/* glass windows / cards */
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-gpt-window,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-defender-window,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-gpt-accounts-bar,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-log-panel,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-parsing-live-stat,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-gpt-action-bar,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-collect-actions,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .dist-box {
  background:
    linear-gradient(180deg, rgba(245, 166, 35, 0.07) 0%, rgba(245, 166, 35, 0) 55%),
    rgba(16, 23, 38, 0.48) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 16px !important;
  backdrop-filter: blur(14px) saturate(120%) !important;
  -webkit-backdrop-filter: blur(14px) saturate(120%) !important;
  box-shadow:
    inset 0 1px 0 rgba(245, 166, 35, 0.06),
    0 10px 32px rgba(0, 0, 0, 0.28) !important;
}

html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-gpt-window:hover,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-defender-window:hover {
  border-color: rgba(245, 166, 35, 0.35) !important;
  box-shadow:
    inset 0 1px 0 rgba(245, 166, 35, 0.1),
    0 12px 36px rgba(0, 0, 0, 0.35) !important;
}

/* kill cyan glass overrides */
html.theme-dark body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-gpt-window,
html.theme-dark body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page).gram-ml-glass .gram-gpt-window {
  background:
    linear-gradient(180deg, rgba(245, 166, 35, 0.07) 0%, rgba(245, 166, 35, 0) 55%),
    rgba(16, 23, 38, 0.48) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

/* primary / launch buttons */
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) #panelLaunchBtn,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-parsing-launch-btn,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-gpt-btn-primary,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-gpt-btn-success.gram-parsing-launch-btn,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-placeholder-btn.is-ready {
  background: linear-gradient(to bottom, #f7c948, #f5a623) !important;
  color: #1a1205 !important;
  border: none !important;
  box-shadow: 0 10px 24px rgba(245, 166, 35, 0.35) !important;
}

html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) #panelLaunchBtn .pi,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-parsing-launch-btn .pi,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-gpt-btn-primary .pi,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-placeholder-btn.is-ready .pi {
  color: #1a1205 !important;
}

/* secondary / collect glass */
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) #panelCollectRepliesBtn,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) #panelDistributeBtn,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-gpt-btn-purple,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-gpt-btn-ghost,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-placeholder-btn:not(.is-ready) {
  background: rgba(255, 255, 255, 0.05) !important;
  color: #f8fafc !important;
  border: none !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
}

/* pills / tabs — inactive glass, active = Start gold */
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-gpt-pill:not(.active),
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-source-tab:not(.active),
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-mode-pill:not(.active):not(.is-active) {
  background: rgba(255, 255, 255, 0.05) !important;
  color: #f8fafc !important;
  border: none !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12) !important;
}

html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-gpt-pill.active,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-source-tab.active,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-gpt-mode-card.active,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-mode-tile.is-active,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-after-card.active,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-def-card.active {
  background: linear-gradient(to bottom, #f7c948, #f5a623) !important;
  color: #1a1205 !important;
  border-color: transparent !important;
  box-shadow: 0 8px 18px rgba(245, 166, 35, 0.28) !important;
}

html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-gpt-pill.active .pi,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-source-tab.active .pi,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-gpt-mode-card.active .pi,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-after-card.active .pi,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-def-card.active .pi {
  color: #1a1205 !important;
}

/* icons / accents cyan → amber */
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-card-icon,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-tone-cyan,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-tone-blue,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-tone-orange,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-tone-emerald {
  background: rgba(245, 166, 35, 0.16) !important;
  color: #f5a623 !important;
  box-shadow: none !important;
}

html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-parsing-slider-fill,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-dual-fill,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) [data-delay-fill],
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) [data-spam-pm-timeout-fill],
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) [data-spam-pm-flood-fill] {
  background: linear-gradient(90deg, #f5a623, #ffcf70) !important;
}

html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-parsing-slider-value,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-delay-val,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-parsing-groups-count,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-targets-count,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-dist-count {
  color: #f5a623 !important;
}

/* checkboxes / toggles */
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-parsing-filter-check-input:checked + .gram-parsing-filter-check-box,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) input[type="checkbox"]:checked + .gram-ai-defender-switch,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-def-toggle input:checked + .gram-ai-defender-switch {
  background: linear-gradient(135deg, #f5a623, #e08e0b) !important;
  border-color: transparent !important;
}

/* inputs */
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) textarea,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) input[type="text"],
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) input[type="number"],
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) input[type="search"],
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) select {
  background: rgba(8, 12, 20, 0.55) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #e2e8f0 !important;
}

html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) textarea:focus,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) input:focus,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) select:focus {
  border-color: rgba(245, 166, 35, 0.55) !important;
  box-shadow: 0 0 0 2px rgba(245, 166, 35, 0.18) !important;
}

/* placeholder chain / editor ready */
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-placeholder-drop {
  border-color: rgba(245, 166, 35, 0.3) !important;
  background: rgba(16, 23, 38, 0.45) !important;
}

html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-placeholder-drop.is-ready {
  border-color: rgba(245, 166, 35, 0.45) !important;
  background: rgba(245, 166, 35, 0.08) !important;
}

html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-placeholder-drop .pi {
  color: #f5a623 !important;
}

/* msg cards / after cards inactive */
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-msg-card,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-after-card:not(.active),
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-def-card:not(.active) {
  background: rgba(15, 23, 42, 0.55) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

/* preview bubbles */
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-preview-bubble.is-out {
  background: rgba(245, 166, 35, 0.12) !important;
  border-color: rgba(245, 166, 35, 0.28) !important;
}

/* sidebar active while on classic spam_pm */
html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) #sidebar .submenu-link[data-task="spam_pm"].active,
html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) #sidebar .submenu-link.active[data-task="spam_pm"] {
  background: rgba(245, 166, 35, 0.14) !important;
  color: #f5a623 !important;
  border-color: rgba(245, 166, 35, 0.45) !important;
  box-shadow: inset 3px 0 0 #f5a623 !important;
}

html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) #sidebar .submenu-link[data-task="spam_pm"].active .pi,
html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) #sidebar .submenu-link.active[data-task="spam_pm"] .pi {
  color: #f5a623 !important;
}

/* beat leftover cyan !important from older spam_pm passes */
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-gpt-btn-primary,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-parsing-launch-btn.gram-gpt-btn-success {
  background: linear-gradient(to bottom, #f7c948, #f5a623) !important;
  color: #1a1205 !important;
}


/* ═══════════════════════════════════════════════════════════
   spam_pm CLASSIC — amber pass v576
   kill leftover cyan (modes / chain meta / thumbs / sidebar / journal)
   ═══════════════════════════════════════════════════════════ */
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-gpt-mode-card:not(.active),
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-mode-tile:not(.is-active) {
  background: rgba(15, 23, 42, 0.55) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #e2e8f0 !important;
  box-shadow: none !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-gpt-mode-icon,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-gpt-mode-icon.gram-tone-violet,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-gpt-mode-icon.gram-tone-blue,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-gpt-mode-card:not(.active) .gram-gpt-mode-icon {
  background: rgba(245, 166, 35, 0.16) !important;
  color: #f5a623 !important;
  box-shadow: none !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-gpt-mode-card.active {
  background: linear-gradient(to bottom, #f7c948, #f5a623) !important;
  border-color: transparent !important;
  color: #1a1205 !important;
  box-shadow: 0 8px 18px rgba(245, 166, 35, 0.28) !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-gpt-mode-card.active .gram-gpt-mode-icon,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-gpt-mode-card.active .pi {
  background: rgba(26, 18, 5, 0.12) !important;
  color: #1a1205 !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-placeholder-text,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-placeholder-preview,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-placeholder-drop.is-ready .gram-spam-pm-placeholder-text {
  color: #e2e8f0 !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-placeholder-drop.is-ready > .pi.pi-check-circle {
  color: #f5a623 !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-after-card:not(.active) .gram-spam-pm-after-card-icon,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-after-card-icon {
  background: rgba(245, 166, 35, 0.14) !important;
  color: #f5a623 !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-after-card.active {
  background: linear-gradient(to bottom, #f7c948, #f5a623) !important;
  border-color: transparent !important;
  color: #1a1205 !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-after-card.active .gram-spam-pm-after-card-icon,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-after-card.active .pi {
  background: rgba(26, 18, 5, 0.12) !important;
  color: #1a1205 !important;
}
/* slider thumbs: dual + plain parsing range */
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-dual-input::-webkit-slider-thumb,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-parsing-slider-input::-webkit-slider-thumb,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) input[type="range"]::-webkit-slider-thumb {
  background: #f5a623 !important;
  border: 1px solid #fff !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.28) !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-dual-input::-moz-range-thumb,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-parsing-slider-input::-moz-range-thumb,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) input[type="range"]::-moz-range-thumb {
  background: #f5a623 !important;
  border: 1px solid #fff !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.28) !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-parsing-slider-track::after,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-dual-track::after,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-ml-slider-track::after {
  background: #f5a623 !important;
  border-color: #fff !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.28) !important;
}
/* stats dark glass (beat inject + base tone gradients) */
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) #spamPmLiveStats .gram-parsing-live-stat,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-live-stats .gram-parsing-live-stat {
  background: rgba(16, 23, 38, 0.55) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  backdrop-filter: blur(10px) saturate(120%) !important;
  -webkit-backdrop-filter: blur(10px) saturate(120%) !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28) !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) #spamPmLiveStats .gram-parsing-live-stat-icon,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-live-stats .gram-parsing-live-stat-icon,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) #spamPmLiveStats .gram-parsing-live-stat-icon.gram-tone-blue,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) #spamPmLiveStats .gram-parsing-live-stat-icon.gram-tone-orange,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) #spamPmLiveStats .gram-parsing-live-stat-icon.gram-tone-green {
  background: rgba(245, 166, 35, 0.14) !important;
  color: #f5a623 !important;
  box-shadow: none !important;
}
/* sidebar active — solid amber, not cyan pill */
html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) #sidebar .submenu-link[data-task="spam_pm"].active,
html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) #sidebar a.submenu-link.active[data-task="spam_pm"],
html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) #sidebar .submenu-item:has(> .submenu-link[data-task="spam_pm"].active) > .submenu-link {
  background: rgba(245, 166, 35, 0.18) !important;
  background-image: none !important;
  color: #f5a623 !important;
  border: 1px solid rgba(245, 166, 35, 0.45) !important;
  box-shadow: inset 3px 0 0 #f5a623 !important;
}
/* Journal button + modal */
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) #panelSpamPmJournalBtn {
  background: rgba(255, 255, 255, 0.05) !important;
  color: #f8fafc !important;
  border: none !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14) !important;
  backdrop-filter: blur(10px) !important;
  -webkit-backdrop-filter: blur(10px) !important;
}
html body .gram-spam-pm-page .gram-spam-pm-journal-modal[hidden] {
  display: none !important;
}
html body .gram-spam-pm-page .gram-spam-pm-journal-modal:not([hidden]) {
  display: block !important;
  position: fixed !important;
  inset: 0 !important;
  z-index: 12000 !important;
}
html body .gram-spam-pm-page .gram-spam-pm-journal-modal__backdrop {
  position: absolute !important;
  inset: 0 !important;
  background: rgba(2, 8, 18, 0.72) !important;
  backdrop-filter: blur(6px) !important;
  -webkit-backdrop-filter: blur(6px) !important;
}
html body .gram-spam-pm-page .gram-spam-pm-journal-modal__panel {
  position: absolute !important;
  left: 50% !important;
  top: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: min(920px, calc(100vw - 32px)) !important;
  height: min(78vh, 720px) !important;
  display: flex !important;
  flex-direction: column !important;
  border-radius: 16px !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  background:
    linear-gradient(180deg, rgba(245, 166, 35, 0.08) 0%, rgba(245, 166, 35, 0) 45%),
    rgba(16, 23, 38, 0.92) !important;
  backdrop-filter: blur(18px) saturate(120%) !important;
  -webkit-backdrop-filter: blur(18px) saturate(120%) !important;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55) !important;
  overflow: hidden !important;
}
html body .gram-spam-pm-page .gram-spam-pm-journal-modal__head {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  padding: 14px 16px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  flex: 0 0 auto !important;
}
html body .gram-spam-pm-page .gram-spam-pm-journal-modal__title {
  margin: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  color: #f8fafc !important;
}
html body .gram-spam-pm-page .gram-spam-pm-journal-modal__title .pi {
  color: #f5a623 !important;
}
html body .gram-spam-pm-page .gram-spam-pm-journal-modal__x {
  width: 36px !important;
  height: 36px !important;
  border-radius: 10px !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  background: rgba(255, 255, 255, 0.05) !important;
  color: #cbd5e1 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
}
html body .gram-spam-pm-page .gram-spam-pm-journal-modal__body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  padding: 12px !important;
  display: flex !important;
  flex-direction: column !important;
}
html body .gram-spam-pm-page .gram-spam-pm-journal-modal__body #moduleLiveLog {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: 100% !important;
  margin: 0 !important;
}


/* ═══════════════════════════════════════════════════════════
   spam_pm CLASSIC — amber pass v577
   muted sliders · white hero title · thin readable modes
   ═══════════════════════════════════════════════════════════ */
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-hero-title,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-page-title.gram-spam-pm-hero-title,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) h2.gram-page-title {
  color: #ffffff !important;
  background: none !important;
  -webkit-text-fill-color: #ffffff !important;
  text-shadow: none !important;
}

/* modes: thin outline, readable text (no solid gold brick) */
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-gpt-mode-card,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-gpt-mode-card:not(.active) {
  background: rgba(15, 23, 42, 0.45) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #e2e8f0 !important;
  box-shadow: none !important;
  font-weight: 500 !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-gpt-mode-card .gram-gpt-mode-title,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-gpt-mode-card .gram-gpt-mode-desc {
  color: #e2e8f0 !important;
  opacity: 1 !important;
  -webkit-text-fill-color: #e2e8f0 !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-gpt-mode-card .gram-gpt-mode-desc {
  color: #94a3b8 !important;
  -webkit-text-fill-color: #94a3b8 !important;
  font-weight: 400 !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-gpt-mode-card.active {
  background: rgba(245, 166, 35, 0.1) !important;
  border: 1px solid rgba(245, 166, 35, 0.55) !important;
  color: #f8fafc !important;
  box-shadow: inset 0 0 0 1px rgba(245, 166, 35, 0.18), 0 0 18px rgba(245, 166, 35, 0.12) !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-gpt-mode-card.active .gram-gpt-mode-title,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-gpt-mode-card.active .pi {
  color: #f8fafc !important;
  -webkit-text-fill-color: #f8fafc !important;
  font-weight: 600 !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-gpt-mode-card.active .gram-gpt-mode-desc {
  color: #cbd5e1 !important;
  -webkit-text-fill-color: #cbd5e1 !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-gpt-mode-card.active .gram-gpt-mode-icon,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-gpt-mode-card:not(.active) .gram-gpt-mode-icon {
  background: rgba(245, 166, 35, 0.14) !important;
  color: #f5a623 !important;
  box-shadow: none !important;
}

/* sliders: muted, do not shout */
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-parsing-slider-fill,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-dual-fill,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) [data-delay-fill],
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) [data-spam-pm-timeout-fill],
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) [data-spam-pm-flood-fill] {
  background: rgba(245, 166, 35, 0.38) !important;
  box-shadow: none !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-parsing-slider-track,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-dual-track {
  background: rgba(148, 163, 184, 0.22) !important;
  height: 4px !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-dual-input::-webkit-slider-thumb,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-parsing-slider-input::-webkit-slider-thumb,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) input[type="range"]::-webkit-slider-thumb {
  width: 12px !important;
  height: 12px !important;
  margin-top: -4px !important;
  background: #c9a06a !important;
  border: 1px solid rgba(255, 255, 255, 0.55) !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35) !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-dual-input::-moz-range-thumb,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-parsing-slider-input::-moz-range-thumb,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) input[type="range"]::-moz-range-thumb {
  width: 12px !important;
  height: 12px !important;
  background: #c9a06a !important;
  border: 1px solid rgba(255, 255, 255, 0.55) !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35) !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-parsing-slider-track::after,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-dual-track::after,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-ml-slider-track::after {
  width: 12px !important;
  height: 12px !important;
  margin-left: -6px !important;
  margin-top: -6px !important;
  background: #c9a06a !important;
  border: 1px solid rgba(255, 255, 255, 0.55) !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35) !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-parsing-slider-value,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-delay-val {
  color: #94a3b8 !important;
  font-weight: 500 !important;
}


/* ═══════════════════════════════════════════════════════════
   spam_pm CLASSIC — amber pass v578
   restore slider amber · kill focus square · stronger glass/gradient
   ═══════════════════════════════════════════════════════════ */

/* restore bright amber sliders (override muted v577) */
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-parsing-slider-fill,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-dual-fill,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) [data-delay-fill],
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) [data-spam-pm-timeout-fill],
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) [data-spam-pm-flood-fill] {
  background: linear-gradient(90deg, #f5a623, #ffcf70) !important;
  box-shadow: none !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-parsing-slider-track,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-dual-track {
  background: rgba(148, 163, 184, 0.28) !important;
  height: 6px !important;
  outline: none !important;
  box-shadow: none !important;
  border: 0 !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-dual-input::-webkit-slider-thumb,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-parsing-slider-input::-webkit-slider-thumb,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) input[type="range"]::-webkit-slider-thumb {
  width: 14px !important;
  height: 14px !important;
  margin-top: -4.5px !important;
  background: #f5a623 !important;
  border: 1px solid #fff !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.28) !important;
  outline: none !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-dual-input::-moz-range-thumb,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-parsing-slider-input::-moz-range-thumb,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) input[type="range"]::-moz-range-thumb {
  width: 14px !important;
  height: 14px !important;
  background: #f5a623 !important;
  border: 1px solid #fff !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.28) !important;
  outline: none !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-parsing-slider-track::after,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-dual-track::after,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-ml-slider-track::after {
  width: 14px !important;
  height: 14px !important;
  margin-left: -7px !important;
  margin-top: -7px !important;
  background: #f5a623 !important;
  border: 1px solid #fff !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.28) !important;
  outline: none !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-parsing-slider-value,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-delay-val {
  color: #f5a623 !important;
  font-weight: 600 !important;
}

/* kill focus/active rectangle around dual/range sliders */
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-dual-input,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-parsing-slider-input,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) input[type="range"],
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-dual-input:focus,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-dual-input:focus-visible,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-dual-input:active,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-parsing-slider-input:focus,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-parsing-slider-input:focus-visible,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-parsing-slider-input:active,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) input[type="range"]:focus,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) input[type="range"]:focus-visible,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) input[type="range"]:active {
  outline: none !important;
  box-shadow: none !important;
  border: 0 !important;
  background: transparent !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-dual-input::-moz-focus-outer,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-parsing-slider-input::-moz-focus-outer,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) input[type="range"]::-moz-focus-outer {
  border: 0 !important;
  outline: none !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-dual-input::-webkit-slider-runnable-track,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-parsing-slider-input::-webkit-slider-runnable-track,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) input[type="range"]::-webkit-slider-runnable-track {
  outline: none !important;
  box-shadow: none !important;
  border: 0 !important;
  background: transparent !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-dual-slider:focus-within,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-parsing-slider:focus-within,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-dual-track:focus-within,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-parsing-slider-track:focus-within {
  outline: none !important;
  box-shadow: none !important;
  border-color: transparent !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-dual-input::-webkit-slider-thumb:focus,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-dual-input::-webkit-slider-thumb:active,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-parsing-slider-input::-webkit-slider-thumb:focus,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-parsing-slider-input::-webkit-slider-thumb:active {
  outline: none !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.28) !important;
}

/* stronger glass + gradient like ref */
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-gpt-window,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-defender-window,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-gpt-accounts-bar,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-log-panel,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-parsing-live-stat,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-gpt-action-bar,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-collect-actions,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .dist-box {
  background:
    linear-gradient(165deg, rgba(245, 166, 35, 0.11) 0%, rgba(245, 166, 35, 0.02) 42%, rgba(245, 166, 35, 0) 70%),
    rgba(16, 23, 38, 0.42) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 16px !important;
  backdrop-filter: blur(18px) saturate(130%) !important;
  -webkit-backdrop-filter: blur(18px) saturate(130%) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 0 0 1px rgba(245, 166, 35, 0.04),
    0 12px 36px rgba(0, 0, 0, 0.32) !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-gpt-window:hover,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-defender-window:hover {
  border-color: rgba(245, 166, 35, 0.32) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 14px 40px rgba(0, 0, 0, 0.38) !important;
}
html.theme-dark html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-gpt-window,
html.theme-dark html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-gpt-window {
  background:
    linear-gradient(165deg, rgba(245, 166, 35, 0.11) 0%, rgba(245, 166, 35, 0.02) 42%, rgba(245, 166, 35, 0) 70%),
    rgba(16, 23, 38, 0.42) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}


/* ═══════════════════════════════════════════════════════════
   spam_pm CLASSIC — shell pass v579
   gaps + rounding + sidebar from spam_pm_v3 etalon (shell only)
   ═══════════════════════════════════════════════════════════ */

html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) {
  --sp-classic-aside: 236px;
  --sp-classic-shell-inset: 10px;
  --sp-classic-sidebar-slot: calc(var(--sp-classic-aside) + var(--sp-classic-shell-inset) * 2);
}

@media (min-width: 1025px) {
  html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) #sidebar.sidebar,
  html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) aside#sidebar {
    position: fixed !important;
    left: var(--sp-classic-shell-inset) !important;
    top: var(--sp-classic-shell-inset) !important;
    width: var(--sp-classic-aside) !important;
    max-width: var(--sp-classic-aside) !important;
    height: calc(100vh - var(--sp-classic-shell-inset) * 2) !important;
    min-height: calc(100vh - var(--sp-classic-shell-inset) * 2) !important;
    max-height: calc(100vh - var(--sp-classic-shell-inset) * 2) !important;
    transform: translateX(0) !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    border-right: none !important;
    background: transparent !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    z-index: 200 !important;
    box-sizing: border-box !important;
  }
  html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) .main-wrap {
    margin-left: var(--sp-classic-sidebar-slot) !important;
    padding: var(--sp-classic-shell-inset) var(--sp-classic-shell-inset) var(--sp-classic-shell-inset) 0 !important;
    box-sizing: border-box !important;
  }
}

html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) #sidebar .sidebar-border-gradient {
  display: none !important;
}

html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) #sidebar .sidebar-inner {
  flex: 1 1 auto !important;
  height: 100% !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  border-radius: 26px !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  background: rgba(15, 23, 42, 0.6) !important;
  backdrop-filter: blur(12px) saturate(1.2) !important;
  -webkit-backdrop-filter: blur(12px) saturate(1.2) !important;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35) !important;
}

html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) #sidebar .sidebar-logo {
  flex: 0 0 auto !important;
  padding: 20px 20px 16px !important;
}

html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) #sidebar .sidebar-nav {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  padding: 0 12px !important;
}

html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) #sidebar .menu-item,
html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) #sidebar .submenu-link {
  border-radius: 8px !important;
}

/* active: amber ring like v3 — not cyan pill */
html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) #sidebar .submenu-link[data-task="spam_pm"].active,
html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) #sidebar .submenu-link.active[data-task="spam_pm"],
html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) #sidebar.sidebar-modules-flat .menu-group:has(#moduleSearch) .submenu-link[data-task="spam_pm"].active {
  background: rgba(245, 166, 35, 0.1) !important;
  background-image: none !important;
  color: #f5a623 !important;
  border: none !important;
  box-shadow: inset 0 0 0 1px rgba(245, 166, 35, 0.3) !important;
  font-weight: 500 !important;
}
html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) #sidebar .submenu-link[data-task="spam_pm"].active .submenu-link-text,
html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) #sidebar .submenu-link[data-task="spam_pm"].active .pi,
html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) #sidebar .submenu-link[data-task="spam_pm"].active .submenu-module-icon,
html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) #sidebar .submenu-link[data-task="spam_pm"].active .submenu-module-icon i {
  color: #f5a623 !important;
}

html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) .main-wrap {
  height: 100vh !important;
  max-height: 100vh !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  background:
    radial-gradient(ellipse 130% 100% at top right, #243349 0%, #131c2b 40%, #0a0f18 75%, #070b12 100%) !important;
}

html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) .content-wrapper {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  padding: 0 !important;
}

html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) .content-glass {
  position: relative !important;
  overflow: hidden !important;
  min-height: min-content !important;
  height: auto !important;
  max-height: none !important;
  padding: 0 !important;
  margin: 0 !important;
  border-radius: 28px !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  background: rgba(255, 255, 255, 0.02) !important;
  backdrop-filter: blur(24px) saturate(1.2) !important;
  -webkit-backdrop-filter: blur(24px) saturate(1.2) !important;
  box-shadow: 0 20px 60px -15px rgba(0, 0, 0, 0.7) !important;
}

html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) .content-glass::before {
  content: "" !important;
  pointer-events: none !important;
  position: absolute !important;
  inset: 0 !important;
  z-index: 0 !important;
  border-radius: inherit !important;
  background: radial-gradient(60% 60% at 100% 0%, rgba(245, 166, 35, 0.1) 0%, rgba(90, 120, 170, 0.08) 30%, transparent 65%) !important;
}

html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) .content-glass::after {
  content: "" !important;
  pointer-events: none !important;
  position: absolute !important;
  right: -6rem !important;
  top: -7rem !important;
  left: auto !important;
  bottom: auto !important;
  z-index: 0 !important;
  width: 18rem !important;
  height: 18rem !important;
  border-radius: 9999px !important;
  opacity: 0.7 !important;
  filter: blur(1px) !important;
  background: radial-gradient(circle at 34% 30%, #7c879a 0%, #4a5464 32%, #2b3341 62%, #1b212c 82%, #141922 100%) !important;
  box-shadow:
    0 0 90px 30px rgba(120, 140, 175, 0.1),
    inset -18px -14px 40px rgba(0, 0, 0, 0.55) !important;
}

html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) .content-glass > *,
html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) #pageContent {
  position: relative !important;
  z-index: 1 !important;
}

/* mild inner pad like v3 island — keeps content off glass edge */
html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) #pageContent.main-container,
html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) #pageContent {
  padding: 0 16px 12px !important;
  box-sizing: border-box !important;
}


/* ═══════════════════════════════════════════════════════════
   spam_pm CLASSIC — shell pass v580
   hide header-glass + tighten gaps (mirror spam_pm_v3 etalon)
   ═══════════════════════════════════════════════════════════ */

/* шапка панели (баланс / pageTitle) — как в spam 3 */
html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) .header-glass {
  display: none !important;
}

/* зазоры: content заполняет main без лишних gutter */
@media (min-width: 1025px) {
  html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) {
    --sp-classic-aside: 236px;
    --sp-classic-shell-inset: 10px;
    --sp-classic-sidebar-slot: calc(var(--sp-classic-aside) + var(--sp-classic-shell-inset) * 2);
  }
  html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) #sidebar.sidebar,
  html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) aside#sidebar {
    position: fixed !important;
    left: var(--sp-classic-shell-inset) !important;
    top: var(--sp-classic-shell-inset) !important;
    width: var(--sp-classic-aside) !important;
    max-width: var(--sp-classic-aside) !important;
    height: calc(100vh - var(--sp-classic-shell-inset) * 2) !important;
    min-height: calc(100vh - var(--sp-classic-shell-inset) * 2) !important;
    max-height: calc(100vh - var(--sp-classic-shell-inset) * 2) !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    border-right: none !important;
    background: transparent !important;
  }
  html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) .main-wrap {
    margin-left: var(--sp-classic-sidebar-slot) !important;
    padding: var(--sp-classic-shell-inset) var(--sp-classic-shell-inset) var(--sp-classic-shell-inset) 0 !important;
    width: auto !important;
    max-width: none !important;
    box-sizing: border-box !important;
  }
}

html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) .main-wrap {
  height: 100vh !important;
  max-height: 100vh !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}

html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) .content-wrapper {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  width: 100% !important;
  max-width: none !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  box-sizing: border-box !important;
}

html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) .content-glass {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
  border-radius: 28px !important;
  flex: 0 0 auto !important;
  min-height: min-content !important;
  height: auto !important;
}

html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) #pageContent.main-container,
html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) #pageContent {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 16px 12px !important;
  box-sizing: border-box !important;
}

html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) .gram-spam-pm-page,
html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) .gram-spam-pm-page.gram-gpt-layout {
  max-width: none !important;
  width: 100% !important;
}


/* ═══════════════════════════════════════════════════════════
   spam_pm CLASSIC — shell pass v581
   sidebar slightly wider (Менеджер аккаунтов fits)
   ═══════════════════════════════════════════════════════════ */
html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) {
  --sp-classic-aside: 260px;
}
@media (min-width: 1025px) {
  html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) {
    --sp-classic-aside: 260px;
  }
}


/* ═══════════════════════════════════════════════════════════
   spam_pm CLASSIC — shell pass v582
   one shared cosmos bg (sidebar + workspace + gaps)
   ═══════════════════════════════════════════════════════════ */

html:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)),
html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) {
  background: radial-gradient(ellipse 130% 100% at top right, #243349 0%, #131c2b 40%, #0a0f18 75%, #070b12 100%) !important;
  background-attachment: fixed !important;
}

html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) .app-shell,
html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) .main-wrap,
html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) .main-wrap.panel-background,
html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) .content-wrapper {
  background: radial-gradient(ellipse 130% 100% at top right, #243349 0%, #131c2b 40%, #0a0f18 75%, #070b12 100%) !important;
  background-attachment: fixed !important;
}

html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) #sidebar.sidebar,
html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) #sidebar.sidebar-glass,
html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) aside#sidebar {
  background: transparent !important;
  background-image: none !important;
  border: none !important;
  border-right: none !important;
  box-shadow: none !important;
}

html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) #sidebar .sidebar-inner {
  background: rgba(15, 23, 42, 0.55) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  backdrop-filter: blur(12px) saturate(1.2) !important;
  -webkit-backdrop-filter: blur(12px) saturate(1.2) !important;
}

html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) .content-glass {
  background: rgba(255, 255, 255, 0.02) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  backdrop-filter: blur(24px) saturate(1.2) !important;
  -webkit-backdrop-filter: blur(24px) saturate(1.2) !important;
}


/* ═══════════════════════════════════════════════════════════
   spam_pm CLASSIC — top-strip B (v583)
   compact: [Аккаунты]  Шаблоны ▾  Defender [○]
   ═══════════════════════════════════════════════════════════ */
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 8px 10px !important;
  margin: 0 0 12px !important;
  padding: 8px 10px !important;
  border-radius: 14px !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  background:
    linear-gradient(180deg, rgba(245, 166, 35, 0.07) 0%, rgba(245, 166, 35, 0) 70%),
    rgba(16, 23, 38, 0.48) !important;
  backdrop-filter: blur(14px) saturate(120%) !important;
  -webkit-backdrop-filter: blur(14px) saturate(120%) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 8px 24px rgba(0, 0, 0, 0.28) !important;
  box-sizing: border-box !important;
}

/* kill nested card chrome inside strip */
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip > #panelAccountsBar,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip > .gram-spam-pm-tpl-details,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip > .gram-spam-pm-defender-window {
  flex: 0 0 auto !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  overflow: visible !important;
}

html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip > #panelAccountsBar .gram-gpt-window-body,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip > .gram-spam-pm-defender-window > .gram-gpt-window-head {
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip > #panelAccountsBar .gram-gpt-accounts-head {
  display: flex !important;
  align-items: center !important;
  gap: 0 !important;
  margin: 0 !important;
}

html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip > #panelAccountsBar .gram-card-icon,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip > #panelAccountsBar .gram-gpt-accounts-title,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip > #panelAccountsBar .gram-gpt-accounts-heading {
  display: none !important;
}

html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip > #panelAccountsBar .gram-gpt-accounts-summary:not([hidden]),
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip > #panelAccountsBar .gram-parsing-streams-warn:not([hidden]) {
  flex-basis: 100% !important;
  width: 100% !important;
  margin: 4px 0 0 !important;
  font-size: 12px !important;
}

html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip #panelAccountsOpenBtn {
  min-height: 36px !important;
  height: 36px !important;
  padding: 0 12px !important;
  border-radius: 10px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  gap: 6px !important;
  background: linear-gradient(to bottom, #f7c948, #f5a623) !important;
  color: #1a1205 !important;
  border: none !important;
  box-shadow: 0 4px 12px rgba(245, 166, 35, 0.28) !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip #panelAccountsOpenBtn .pi {
  color: #1a1205 !important;
  font-size: 12px !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip #panelAccountsCount {
  margin-left: 4px !important;
  min-width: 18px !important;
  height: 18px !important;
  padding: 0 5px !important;
  border-radius: 999px !important;
  background: rgba(26, 18, 5, 0.18) !important;
  color: #1a1205 !important;
  font-size: 11px !important;
}

/* templates compact */
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip > .gram-spam-pm-tpl-details {
  flex: 1 1 auto !important;
  min-width: 0 !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip > .gram-spam-pm-tpl-details > summary {
  list-style: none !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  min-height: 36px !important;
  padding: 0 10px !important;
  margin: 0 !important;
  border-radius: 10px !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  background: rgba(255, 255, 255, 0.04) !important;
  color: #e2e8f0 !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  width: auto !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip > .gram-spam-pm-tpl-details > summary::-webkit-details-marker {
  display: none !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip > .gram-spam-pm-tpl-details > summary .gram-card-icon {
  display: none !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip > .gram-spam-pm-tpl-details > summary .gram-spam-pm-tpl-chevron {
  margin-left: 2px !important;
  font-size: 11px !important;
  color: #94a3b8 !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip > .gram-spam-pm-tpl-details[open] > summary {
  border-color: rgba(245, 166, 35, 0.4) !important;
  color: #f5a623 !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip > .gram-spam-pm-tpl-details .gram-spam-pm-tpl-body {
  flex-basis: 100% !important;
  width: 100% !important;
  margin-top: 8px !important;
  padding: 0 !important;
}

/* defender compact head */
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip > .gram-spam-pm-defender-window {
  margin-left: auto !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip > .gram-spam-pm-defender-window .gram-spam-pm-def-head {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  min-height: 36px !important;
  padding: 0 4px 0 8px !important;
  margin: 0 !important;
  border: 0 !important;
  background: transparent !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip > .gram-spam-pm-defender-window .gram-spam-pm-def-head .gram-card-icon {
  display: none !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip > .gram-spam-pm-defender-window .gram-gpt-window-title {
  margin: 0 !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  color: #e2e8f0 !important;
  white-space: nowrap !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip > .gram-spam-pm-defender-window .gram-spam-pm-def-toggle {
  margin-left: 0 !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip > .gram-spam-pm-defender-window > .gram-gpt-window-body {
  flex-basis: 100% !important;
  width: 100% !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip > .gram-spam-pm-defender-window .gram-spam-pm-defender-body[hidden] {
  display: none !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip > .gram-spam-pm-defender-window .gram-spam-pm-defender-body:not([hidden]) {
  display: block !important;
  margin-top: 8px !important;
  width: 100% !important;
}

@media (max-width: 720px) {
  html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip > .gram-spam-pm-defender-window {
    margin-left: 0 !important;
  }
}


/* top-strip B open-fix v583b — expand panels full width under strip */
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip > .gram-spam-pm-tpl-details[open] {
  flex: 1 1 100% !important;
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 8px !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip > .gram-spam-pm-tpl-details[open] > .gram-spam-pm-tpl-body {
  flex: 1 1 100% !important;
  width: 100% !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip > .gram-spam-pm-defender-window:has(.gram-spam-pm-defender-body:not([hidden])) {
  flex: 1 1 100% !important;
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 8px !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip > .gram-spam-pm-defender-window:has(.gram-spam-pm-defender-body:not([hidden])) > .gram-gpt-window-body {
  flex: 1 1 100% !important;
  width: 100% !important;
}


/* ═══════════════════════════════════════════════════════════
   spam_pm CLASSIC — pass v585
   templates dropdown · defender outline · editor modal glass center
   ═══════════════════════════════════════════════════════════ */

/* 1) Шаблоны — dropdown list under button */
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip {
  overflow: visible !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip > .gram-spam-pm-tpl-details {
  position: relative !important;
  overflow: visible !important;
  z-index: 40 !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip > .gram-spam-pm-tpl-details[open] {
  flex: 0 0 auto !important;
  display: block !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip > .gram-spam-pm-tpl-details[open] > .gram-spam-pm-tpl-body {
  position: absolute !important;
  top: calc(100% + 8px) !important;
  left: 0 !important;
  right: auto !important;
  width: min(360px, 86vw) !important;
  flex: none !important;
  margin: 0 !important;
  padding: 10px !important;
  z-index: 60 !important;
  border-radius: 14px !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  background:
    linear-gradient(180deg, rgba(245, 166, 35, 0.1) 0%, rgba(245, 166, 35, 0) 55%),
    rgba(16, 23, 38, 0.94) !important;
  backdrop-filter: blur(16px) saturate(120%) !important;
  -webkit-backdrop-filter: blur(16px) saturate(120%) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45) !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-spam-pm-tpl-body > .gram-gpt-window {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  margin: 0 !important;
  padding: 0 !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-spam-pm-tpl-body > .gram-gpt-window > .gram-gpt-window-head {
  display: none !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-spam-pm-tpl-body > .gram-gpt-window > .gram-gpt-window-body {
  padding: 0 !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-gpt-tpl-grid {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-gpt-tpl-label {
  display: block !important;
  margin: 0 0 6px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
  color: #94a3b8 !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-gpt-select-btn,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip #tplName {
  min-height: 36px !important;
  border-radius: 10px !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  background: rgba(8, 12, 20, 0.55) !important;
  color: #e2e8f0 !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-gpt-select-menu {
  display: block !important;
  position: relative !important;
  max-height: 200px !important;
  overflow: auto !important;
  margin-top: 6px !important;
  padding: 4px !important;
  border-radius: 10px !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  background: rgba(8, 12, 20, 0.72) !important;
  list-style: none !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-gpt-select-menu[hidden] {
  display: none !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-gpt-select-menu li,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-gpt-select-menu [role="option"] {
  padding: 8px 10px !important;
  border-radius: 8px !important;
  color: #e2e8f0 !important;
  font-size: 13px !important;
  cursor: pointer !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-gpt-select-menu li:hover,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-gpt-select-menu [role="option"]:hover {
  background: rgba(245, 166, 35, 0.14) !important;
  color: #f5a623 !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip #tplLoadBtn,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip #tplSaveBtn {
  min-height: 34px !important;
  border-radius: 10px !important;
  border: 1px solid rgba(245, 166, 35, 0.4) !important;
  background: rgba(245, 166, 35, 0.12) !important;
  color: #f5a623 !important;
}

/* 2) Defender — kill dark outline */
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-spam-pm-def-toggle,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-ai-defender-toggle {
  outline: none !important;
  box-shadow: none !important;
  border: 0 !important;
  background: transparent !important;
  padding: 0 !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-ai-defender-switch {
  outline: none !important;
  border: 0 !important;
  box-shadow: none !important;
  background: rgba(148, 163, 184, 0.35) !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-ai-defender-switch::after {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25) !important;
  border: 0 !important;
  outline: none !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-spam-pm-def-toggle input:checked + .gram-ai-defender-switch,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-ai-defender-toggle input:checked + .gram-ai-defender-switch {
  background: linear-gradient(135deg, #f5a623, #e08e0b) !important;
  box-shadow: none !important;
  outline: none !important;
  border: 0 !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip > .gram-spam-pm-defender-window .gram-spam-pm-def-head {
  outline: none !important;
  box-shadow: none !important;
  border: 0 !important;
}

/* 3) Editor modal — glass + true viewport center (modal on body) */
html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) .gram-spam-pm-editor-modal:not([hidden]),
body > .gram-spam-pm-editor-modal:not([hidden]) {
  position: fixed !important;
  inset: 0 !important;
  z-index: 14000 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 24px !important;
  box-sizing: border-box !important;
}
html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) .gram-spam-pm-editor-modal[hidden],
body > .gram-spam-pm-editor-modal[hidden] {
  display: none !important;
}
html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) .gram-spam-pm-editor-modal-overlay,
body > .gram-spam-pm-editor-modal .gram-spam-pm-editor-modal-overlay {
  position: absolute !important;
  inset: 0 !important;
  background: rgba(2, 8, 18, 0.72) !important;
  backdrop-filter: blur(6px) !important;
  -webkit-backdrop-filter: blur(6px) !important;
}
html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) .gram-spam-pm-editor-modal-panel,
body > .gram-spam-pm-editor-modal .gram-spam-pm-editor-modal-panel {
  position: relative !important;
  z-index: 1 !important;
  width: min(760px, calc(100vw - 32px)) !important;
  max-height: min(86vh, 900px) !important;
  margin: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  border-radius: 18px !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  background:
    linear-gradient(165deg, rgba(245, 166, 35, 0.12) 0%, rgba(245, 166, 35, 0.02) 40%, rgba(16, 23, 38, 0.92) 100%),
    rgba(16, 23, 38, 0.88) !important;
  backdrop-filter: blur(18px) saturate(125%) !important;
  -webkit-backdrop-filter: blur(18px) saturate(125%) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 24px 70px rgba(0, 0, 0, 0.55) !important;
}
html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) .gram-spam-pm-editor-modal-head,
body > .gram-spam-pm-editor-modal .gram-spam-pm-editor-modal-head {
  flex: 0 0 auto !important;
  background: transparent !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}
html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) .gram-spam-pm-editor-modal-title,
body > .gram-spam-pm-editor-modal .gram-spam-pm-editor-modal-title {
  color: #f8fafc !important;
}
html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) .gram-spam-pm-editor-modal-body,
body > .gram-spam-pm-editor-modal .gram-spam-pm-editor-modal-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: auto !important;
  background: transparent !important;
}
html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) .gram-spam-pm-editor-modal-foot,
body > .gram-spam-pm-editor-modal .gram-spam-pm-editor-modal-foot {
  flex: 0 0 auto !important;
  background: transparent !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}
html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) .gram-spam-pm-editor-modal-foot .gram-gpt-btn-primary,
body > .gram-spam-pm-editor-modal .gram-spam-pm-editor-modal-foot .gram-gpt-btn-primary {
  background: linear-gradient(to bottom, #f7c948, #f5a623) !important;
  color: #1a1205 !important;
  border: none !important;
  box-shadow: 0 8px 20px rgba(245, 166, 35, 0.3) !important;
}
html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) .gram-spam-pm-editor-modal-x,
body > .gram-spam-pm-editor-modal .gram-spam-pm-editor-modal-x {
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #cbd5e1 !important;
}

/* ═══════════════════════════════════════════════════════════
   spam_pm CLASSIC — pass v586
   content-glass: overflow for tpl dropdown + kill containing-block
   so editor modal fixed = viewport center; defender outline harden
   ═══════════════════════════════════════════════════════════ */

/* templates dropdown must escape glass clip */
html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) .content-glass {
  overflow: visible !important;
}

/* when editor open: backdrop-filter creates fixed containing block → modal «внизу» */
html body:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-editor-modal:not([hidden])) .content-glass {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  filter: none !important;
  transform: none !important;
  contain: none !important;
}

/* defender — no extra dark ring / focus box */
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip > .gram-spam-pm-defender-window,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip > .gram-spam-pm-defender-window:focus,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip > .gram-spam-pm-defender-window:focus-within {
  outline: none !important;
  box-shadow: none !important;
  border-color: transparent !important;
  background: transparent !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-spam-pm-def-toggle:focus,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-spam-pm-def-toggle:focus-within,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-ai-defender-switch:focus {
  outline: none !important;
  box-shadow: none !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-spam-pm-def-toggle input:focus + .gram-ai-defender-switch {
  outline: none !important;
  box-shadow: none !important;
}

/* editor modal stays in form — viewport center when containing-block killed */
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-editor-modal:not([hidden]) {
  position: fixed !important;
  inset: 0 !important;
  z-index: 14000 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 24px !important;
  box-sizing: border-box !important;
}


/* ═══════════════════════════════════════════════════════════
   spam_pm CLASSIC — pass v587
   templates layout · defender outline kill · account picker amber glass
   ═══════════════════════════════════════════════════════════ */

/* 1) Шаблоны — column layout + dropdown anchor (override v583b inline expand) */
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip > .gram-spam-pm-tpl-details[open] {
  flex: 0 0 auto !important;
  display: block !important;
  flex-wrap: nowrap !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip > .gram-spam-pm-tpl-details[open] > .gram-spam-pm-tpl-body {
  position: absolute !important;
  top: calc(100% + 8px) !important;
  left: 0 !important;
  right: auto !important;
  flex: none !important;
  width: min(360px, calc(100vw - 32px)) !important;
  min-width: min(100%, 280px) !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-gpt-tpl-group {
  width: 100% !important;
  min-width: 0 !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-gpt-tpl-controls {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 8px !important;
  width: 100% !important;
  min-width: 0 !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-gpt-tpl-controls .gram-gpt-custom-select,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-gpt-tpl-controls #tplSelectWrap,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-gpt-tpl-controls .gram-gpt-input,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-gpt-tpl-controls .gram-gpt-btn {
  width: 100% !important;
  max-width: none !important;
  flex: none !important;
  box-sizing: border-box !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-gpt-tpl-controls .gram-gpt-select-btn {
  width: 100% !important;
  justify-content: space-between !important;
  text-align: left !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-gpt-select-menu:not([hidden]) {
  width: 100% !important;
  box-sizing: border-box !important;
  border-color: rgba(245, 166, 35, 0.22) !important;
  background: rgba(8, 12, 20, 0.82) !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-gpt-select-menu li:hover,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-gpt-select-menu li[aria-selected="true"] {
  background: rgba(245, 166, 35, 0.14) !important;
  color: #f5a623 !important;
}

/* 2) AI Defender — stronger outline/focus kill + amber track */
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip > .gram-spam-pm-defender-window,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip > .gram-spam-pm-defender-window .gram-spam-pm-def-head {
  outline: none !important;
  box-shadow: none !important;
  border: 0 !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-spam-pm-def-toggle,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-ai-defender-toggle {
  -webkit-tap-highlight-color: transparent !important;
  outline: none !important;
  box-shadow: none !important;
  border: 0 !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-spam-pm-def-toggle:focus-visible,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-ai-defender-toggle:focus-visible,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-spam-pm-def-toggle:focus-within,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-ai-defender-toggle:focus-within {
  outline: none !important;
  box-shadow: none !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-spam-pm-def-toggle input,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-ai-defender-toggle input {
  outline: none !important;
  box-shadow: none !important;
  border: 0 !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-spam-pm-def-toggle input:focus,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-spam-pm-def-toggle input:focus-visible,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-ai-defender-toggle input:focus,
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-ai-defender-toggle input:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-ai-defender-switch {
  background: rgba(245, 166, 35, 0.28) !important;
  outline: none !important;
  border: none !important;
  box-shadow: none !important;
}
html body .gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-ai-defender-switch::after {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18) !important;
  outline: none !important;
  border: 0 !important;
}

/* 3) Account picker — amber glass when classic spam_pm page is open (CSS-only) */
html:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) .panel-modal-overlay {
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  background: rgba(2, 6, 23, 0.72);
}
html:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) #panelModal .panel-modal-card.gram-modal-picker {
  border: 1px solid rgba(245, 166, 35, 0.24) !important;
  border-radius: 28px !important;
  background:
    radial-gradient(circle at top right, rgba(245, 166, 35, 0.14) 0%, transparent 38%),
    linear-gradient(180deg, rgba(16, 23, 38, 0.98) 0%, rgba(12, 18, 32, 0.95) 100%) !important;
  backdrop-filter: blur(18px) saturate(120%) !important;
  -webkit-backdrop-filter: blur(18px) saturate(120%) !important;
  box-shadow:
    0 28px 72px rgba(2, 6, 23, 0.52),
    0 10px 28px rgba(245, 166, 35, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
}
html:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) #panelModal .panel-modal-card.gram-modal-picker .gram-modal-icon-blue {
  background: linear-gradient(135deg, #f5a623, #e08e0b) !important;
}
html:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) #panelModal .panel-modal-card.gram-modal-picker .panel-modal-header {
  border-bottom-color: rgba(245, 166, 35, 0.12) !important;
}
html:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) #panelModal .panel-modal-card.gram-modal-picker .panel-modal-footer {
  border-top-color: rgba(245, 166, 35, 0.1) !important;
}
html:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) #panelModal .panel-modal-card.gram-modal-picker .gram-gpt-btn-primary,
html:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) #panelModal .panel-modal-card.gram-modal-picker #apickConfirm {
  background: linear-gradient(135deg, #f5a623, #e08e0b) !important;
  box-shadow: 0 4px 14px rgba(245, 166, 35, 0.28) !important;
  color: #fff !important;
}
html:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) #panelModal .gram-apick-col {
  border-radius: 18px !important;
  background: linear-gradient(180deg, rgba(8, 15, 30, 0.96), rgba(13, 23, 42, 0.92)) !important;
  border: 1px solid rgba(245, 166, 35, 0.12) !important;
  box-shadow: 0 24px 52px rgba(2, 6, 23, 0.38) !important;
}
html:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) #panelModal .gram-apick-col-selected {
  border-color: rgba(245, 166, 35, 0.32) !important;
  box-shadow: inset 0 0 0 1px rgba(245, 166, 35, 0.1) !important;
}
html:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) #panelModal .gram-apick-col-head {
  background: linear-gradient(180deg, rgba(20, 30, 48, 0.96), rgba(16, 24, 40, 0.88)) !important;
  border-bottom: 1px solid rgba(245, 166, 35, 0.08) !important;
}
html:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) #panelModal .gram-apick-col-count-on {
  background: rgba(245, 166, 35, 0.22) !important;
  color: #f5a623 !important;
}
html:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) #panelModal .gram-apick-search {
  border-color: rgba(245, 166, 35, 0.18) !important;
  background: rgba(8, 15, 30, 0.72) !important;
  border-radius: 12px !important;
  box-shadow: inset 0 1px 0 rgba(245, 166, 35, 0.04) !important;
}
html:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) #panelModal .gram-apick-card:hover {
  border-color: rgba(245, 166, 35, 0.28) !important;
  background: rgba(245, 166, 35, 0.08) !important;
}
html:has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) #panelModal .gram-apick-arrow {
  color: #f5a623 !important;
}
html:not(.theme-dark):has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) #panelModal .panel-modal-card.gram-modal-picker {
  background:
    radial-gradient(circle at top right, rgba(245, 166, 35, 0.1) 0%, transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.97) 100%) !important;
  border-color: rgba(245, 166, 35, 0.2) !important;
}
html:not(.theme-dark):has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) #panelModal .gram-apick-col {
  background: linear-gradient(180deg, #f8fafc, #f1f5f9) !important;
  border-color: rgba(245, 166, 35, 0.16) !important;
}
html:not(.theme-dark):has(.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) #panelModal .gram-apick-search {
  border-color: rgba(245, 166, 35, 0.2) !important;
  background: rgba(255, 255, 255, 0.92) !important;
}


/* ═══════════════════════════════════════════════════════════
   spam_pm CLASSIC — pass v588
   beat inline #spamPmClassicStyles395 + cyan gram-parsing-page--users
   templates · defender · account picker (top-strip only)
   ═══════════════════════════════════════════════════════════ */

/* 1) Шаблоны — summary/icon/body vs inline spamPmAfterReplyCssText */
html body .gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip > .gram-spam-pm-tpl-details {
  border: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  overflow: visible !important;
}
html body .gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip > .gram-spam-pm-tpl-details > summary {
  list-style: none !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  min-height: 36px !important;
  padding: 0 10px !important;
  margin: 0 !important;
  border-radius: 10px !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  background: rgba(255, 255, 255, 0.04) !important;
  color: #e2e8f0 !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  width: auto !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  box-shadow: none !important;
  outline: none !important;
}
html body .gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip > .gram-spam-pm-tpl-details > summary .gram-card-icon {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}
html body .gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip > .gram-spam-pm-tpl-details[open] > summary {
  border-color: rgba(245, 166, 35, 0.4) !important;
  color: #f5a623 !important;
  background: rgba(245, 166, 35, 0.08) !important;
}
html body .gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip > .gram-spam-pm-tpl-details[open] > .gram-spam-pm-tpl-body {
  position: absolute !important;
  top: calc(100% + 8px) !important;
  left: 0 !important;
  right: auto !important;
  flex: none !important;
  flex-basis: auto !important;
  width: min(360px, calc(100vw - 32px)) !important;
  min-width: min(100%, 280px) !important;
  margin: 0 !important;
  padding: 10px !important;
  box-sizing: border-box !important;
  z-index: 60 !important;
  border-radius: 14px !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  background:
    linear-gradient(180deg, rgba(245, 166, 35, 0.1) 0%, rgba(245, 166, 35, 0) 55%),
    rgba(16, 23, 38, 0.94) !important;
  backdrop-filter: blur(16px) saturate(120%) !important;
  -webkit-backdrop-filter: blur(16px) saturate(120%) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45) !important;
}
html body .gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip > .gram-spam-pm-tpl-details[open] .gram-gpt-window {
  margin-top: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
html body .gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-gpt-tpl-controls {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 8px !important;
  width: 100% !important;
}
html body .gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-gpt-tpl-controls .gram-gpt-custom-select,
html body .gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-gpt-tpl-controls #tplSelectWrap,
html body .gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-gpt-tpl-controls .gram-gpt-input,
html body .gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-gpt-tpl-controls .gram-gpt-btn,
html body .gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-gpt-tpl-controls .gram-gpt-select-btn {
  width: 100% !important;
  max-width: none !important;
  flex: none !important;
  box-sizing: border-box !important;
}
html body .gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-gpt-select-btn,
html body .gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip #tplName {
  min-height: 36px !important;
  border-radius: 10px !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  background: rgba(8, 12, 20, 0.55) !important;
  color: #e2e8f0 !important;
}
html body .gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip #tplLoadBtn,
html body .gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip #tplSaveBtn {
  min-height: 34px !important;
  border-radius: 10px !important;
  border: 1px solid rgba(245, 166, 35, 0.4) !important;
  background: rgba(245, 166, 35, 0.12) !important;
  color: #f5a623 !important;
}
html body .gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-gpt-select-menu:not([hidden]) {
  width: 100% !important;
  border-color: rgba(245, 166, 35, 0.22) !important;
  background: rgba(8, 12, 20, 0.82) !important;
}
html body .gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-gpt-select-menu li:hover,
html body .gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-gpt-select-menu li[aria-selected="true"] {
  background: rgba(245, 166, 35, 0.14) !important;
  color: #f5a623 !important;
}

/* 2) AI Defender — amber toggle, kill outline (beat inline + base cyan) */
html body .gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip > .gram-spam-pm-defender-window,
html body .gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip > .gram-spam-pm-defender-window .gram-spam-pm-def-head,
html body .gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip > .gram-spam-pm-defender-window > .gram-gpt-window-head {
  outline: none !important;
  box-shadow: none !important;
  border: 0 !important;
  background: transparent !important;
}
html body .gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-spam-pm-def-toggle,
html body .gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-ai-defender-toggle {
  -webkit-tap-highlight-color: transparent !important;
  outline: none !important;
  box-shadow: none !important;
  border: 0 !important;
  background: transparent !important;
}
html body .gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-spam-pm-def-toggle:focus,
html body .gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-spam-pm-def-toggle:focus-visible,
html body .gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-spam-pm-def-toggle:focus-within,
html body .gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-ai-defender-toggle:focus,
html body .gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-ai-defender-toggle:focus-visible,
html body .gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-ai-defender-toggle:focus-within,
html body .gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-ai-defender-switch:focus,
html body .gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-spam-pm-def-toggle input:focus,
html body .gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-spam-pm-def-toggle input:focus-visible,
html body .gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-ai-defender-toggle input:focus,
html body .gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-ai-defender-toggle input:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}
html body .gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-ai-defender-switch {
  background: rgba(245, 166, 35, 0.28) !important;
  outline: none !important;
  border: none !important;
  box-shadow: none !important;
}
html body .gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-spam-pm-def-toggle input:checked + .gram-ai-defender-switch,
html body .gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-ai-defender-toggle input:checked + .gram-ai-defender-switch {
  background: linear-gradient(135deg, #f5a623, #e08e0b) !important;
  box-shadow: none !important;
  outline: none !important;
  border: 0 !important;
}
html body .gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-ai-defender-switch::after {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18) !important;
  outline: none !important;
  border: 0 !important;
}

/* 3) Account picker — amber glass (beat html:has(.gram-parsing-page--users) cyan ~32305) */
html:has(.gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) .panel-modal-overlay {
  backdrop-filter: blur(18px) !important;
  -webkit-backdrop-filter: blur(18px) !important;
  background: rgba(2, 6, 23, 0.72) !important;
}
html:has(.gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) #panelModal .panel-modal-card.gram-modal-picker,
html:has(.gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) .panel-modal-card.gram-modal-picker {
  border: 1px solid rgba(245, 166, 35, 0.24) !important;
  border-radius: 28px !important;
  background:
    radial-gradient(circle at top right, rgba(245, 166, 35, 0.14) 0%, transparent 38%),
    linear-gradient(180deg, rgba(16, 23, 38, 0.98) 0%, rgba(12, 18, 32, 0.95) 100%) !important;
  backdrop-filter: blur(18px) saturate(120%) !important;
  -webkit-backdrop-filter: blur(18px) saturate(120%) !important;
  box-shadow:
    0 28px 72px rgba(2, 6, 23, 0.52),
    0 10px 28px rgba(245, 166, 35, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
}
html:has(.gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) #panelModal .panel-modal-card.gram-modal-picker .gram-modal-icon-blue,
html:has(.gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) .panel-modal-card.gram-modal-picker .gram-modal-icon-blue {
  background: linear-gradient(135deg, #f5a623, #e08e0b) !important;
}
html:has(.gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) #panelModal .panel-modal-card.gram-modal-picker .panel-modal-header {
  border-bottom-color: rgba(245, 166, 35, 0.12) !important;
}
html:has(.gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) #panelModal .panel-modal-card.gram-modal-picker .panel-modal-footer {
  border-top-color: rgba(245, 166, 35, 0.1) !important;
}
html:has(.gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) #panelModal .panel-modal-card.gram-modal-picker .gram-gpt-btn-primary,
html:has(.gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) #panelModal .panel-modal-card.gram-modal-picker #apickConfirm {
  background: linear-gradient(135deg, #f5a623, #e08e0b) !important;
  box-shadow: 0 4px 14px rgba(245, 166, 35, 0.28) !important;
  color: #fff !important;
}
html:has(.gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) #panelModal .gram-apick-col {
  border-radius: 18px !important;
  background: linear-gradient(180deg, rgba(8, 15, 30, 0.96), rgba(13, 23, 42, 0.92)) !important;
  border: 1px solid rgba(245, 166, 35, 0.12) !important;
  box-shadow: 0 24px 52px rgba(2, 6, 23, 0.38) !important;
}
html:has(.gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) #panelModal .gram-apick-col-selected {
  border-color: rgba(245, 166, 35, 0.32) !important;
  box-shadow: inset 0 0 0 1px rgba(245, 166, 35, 0.1) !important;
}
html:has(.gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) #panelModal .gram-apick-col-head {
  background: linear-gradient(180deg, rgba(20, 30, 48, 0.96), rgba(16, 24, 40, 0.88)) !important;
  border-bottom: 1px solid rgba(245, 166, 35, 0.08) !important;
}
html:has(.gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) #panelModal .gram-apick-col-count-on {
  background: rgba(245, 166, 35, 0.22) !important;
  color: #f5a623 !important;
}
html:has(.gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) #panelModal .gram-apick-search {
  border-color: rgba(245, 166, 35, 0.18) !important;
  background: rgba(8, 15, 30, 0.72) !important;
  border-radius: 12px !important;
}
html:has(.gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) #panelModal .gram-apick-card:hover {
  border-color: rgba(245, 166, 35, 0.28) !important;
  background: rgba(245, 166, 35, 0.08) !important;
}
html:has(.gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) #panelModal .gram-apick-arrow {
  color: #f5a623 !important;
}
html:not(.theme-dark):has(.gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page)) #panelModal .panel-modal-card.gram-modal-picker {
  background:
    radial-gradient(circle at top right, rgba(245, 166, 35, 0.1) 0%, transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.97) 100%) !important;
  border-color: rgba(245, 166, 35, 0.2) !important;
}


/* ═══════════════════════════════════════════════════════════
   spam_pm CLASSIC — pass v589
   templates select-menu: absolute popover (fix v585 relative inline)
   both tpl groups visible · overflow visible on strip/form
   ═══════════════════════════════════════════════════════════ */

html body .gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip,
html body .gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) form.gram-spam-pm-form {
  overflow: visible !important;
}
html body .gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip > .gram-spam-pm-tpl-details[open] > .gram-spam-pm-tpl-body {
  overflow: visible !important;
  max-height: none !important;
}
html body .gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-spam-pm-tpl-body > .gram-gpt-window,
html body .gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-spam-pm-tpl-body > .gram-gpt-window > .gram-gpt-window-body,
html body .gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-gpt-templates {
  overflow: visible !important;
}
html body .gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-gpt-tpl-grid {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  width: 100% !important;
}
html body .gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-gpt-tpl-group {
  width: 100% !important;
  min-width: 0 !important;
}
html body .gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip #tplSelectWrap,
html body .gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-gpt-tpl-controls .gram-gpt-custom-select {
  position: relative !important;
  width: 100% !important;
  z-index: 1 !important;
}
html body .gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip #tplSelectMenu[hidden] {
  display: none !important;
}
html body .gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip #tplSelectMenu:not([hidden]),
html body .gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip .gram-gpt-select-menu:not([hidden]) {
  display: block !important;
  position: absolute !important;
  top: calc(100% + 6px) !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  margin: 0 !important;
  z-index: 90 !important;
  max-height: 200px !important;
  overflow: auto !important;
  padding: 4px !important;
  border-radius: 10px !important;
  border: 1px solid rgba(245, 166, 35, 0.22) !important;
  background: rgba(8, 12, 20, 0.92) !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45) !important;
  list-style: none !important;
  box-sizing: border-box !important;
}


/* ═══════════════════════════════════════════════════════════
   spam_pm CLASSIC — pass v590
   kill v583b full-width open · tpl panel under button · hide when closed
   orphan #tplSelectMenu (body portal) when details closed
   ═══════════════════════════════════════════════════════════ */

/* details = ширина кнопки, не вся полоса (override v583b) */
html body .gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip > .gram-spam-pm-tpl-details,
html body .gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip > .gram-spam-pm-tpl-details[open] {
  position: relative !important;
  flex: 0 0 auto !important;
  width: auto !important;
  max-width: 100% !important;
  display: block !important;
  flex-wrap: nowrap !important;
  overflow: visible !important;
  z-index: 50 !important;
}

/* закрыто — тело скрыто полностью */
html body .gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip > .gram-spam-pm-tpl-details:not([open]) > .gram-spam-pm-tpl-body {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* открыто — панель строго под summary (не left всей полосы) */
html body .gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip > .gram-spam-pm-tpl-details[open] > .gram-spam-pm-tpl-body {
  display: block !important;
  position: absolute !important;
  top: calc(100% + 8px) !important;
  left: 0 !important;
  right: auto !important;
  flex: none !important;
  flex-basis: auto !important;
  width: min(360px, calc(100vw - 32px)) !important;
  min-width: 280px !important;
  max-width: min(360px, calc(100vw - 32px)) !important;
  margin: 0 !important;
  padding: 10px !important;
  box-sizing: border-box !important;
  z-index: 100 !important;
  overflow: visible !important;
  max-height: none !important;
  visibility: visible !important;
  pointer-events: auto !important;
  border-radius: 14px !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  background:
    linear-gradient(180deg, rgba(245, 166, 35, 0.1) 0%, rgba(245, 166, 35, 0) 55%),
    rgba(16, 23, 38, 0.96) !important;
  backdrop-filter: blur(16px) saturate(120%) !important;
  -webkit-backdrop-filter: blur(16px) saturate(120%) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45) !important;
}

/* сетка: Загрузить + Сохранить */
html body .gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip > .gram-spam-pm-tpl-details[open] .gram-gpt-tpl-grid {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  width: 100% !important;
}

/* select wrap — якорь для absolute menu */
html body .gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip > .gram-spam-pm-tpl-details[open] #tplSelectWrap {
  position: relative !important;
  width: 100% !important;
  overflow: visible !important;
}

/* меню внутри wrap — popover, не inline в потоке (override v585 relative) */
html body .gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip > .gram-spam-pm-tpl-details[open] #tplSelectMenu[hidden] {
  display: none !important;
}
html body .gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip > .gram-spam-pm-tpl-details[open] #tplSelectMenu:not([hidden]) {
  display: block !important;
  position: absolute !important;
  top: calc(100% + 6px) !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  margin: 0 !important;
  z-index: 110 !important;
  max-height: 200px !important;
  overflow: auto !important;
  box-sizing: border-box !important;
  border: 1px solid rgba(245, 166, 35, 0.22) !important;
  background: rgba(8, 12, 20, 0.94) !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45) !important;
}

/* orphan portal на body: спрятать, пока Шаблоны закрыты */
html:has(.gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip > .gram-spam-pm-tpl-details:not([open])) body > #tplSelectMenu,
html:has(.gram-parsing-page--users.gram-spam-pm-page.gram-parsing-preset-page.gram-ml-glass:not(.gram-masslooking-page):not(.gram-neurocommenting-page):not(.gram-autoposting-page):not(.gram-massteging-page):not(.gram-neurodialogues-page):not(.gram-chat-filter-page) .gram-spam-pm-top-strip > .gram-spam-pm-tpl-details:not([open])) #tplSelectMenu.is-portal {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* —— Rocket Agency (exchange) — violet style append v591 —— */

.gram-ra-page {
  width: 100%;
  box-sizing: border-box;
  padding: 0;
}

.gram-ra-hero-head {
  margin-bottom: 16px;
}

.gram-ra-hero {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  border-radius: 18px;
  border: 1px solid rgba(167, 139, 250, 0.26);
  background:
    radial-gradient(circle at top right, rgba(167, 139, 250, 0.18) 0%, transparent 38%),
    linear-gradient(180deg, rgba(16, 23, 38, 0.62) 0%, rgba(10, 14, 26, 0.4) 100%);
  box-shadow: 0 18px 45px rgba(2, 6, 23, 0.34);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 16px 18px;
}

.gram-ra-hero-title {
  color: #fff !important;
  font-size: 26px !important;
  font-weight: 900 !important;
  letter-spacing: -0.02em !important;
  margin: 0 !important;
}

.gram-ra-hero-sub {
  margin: 8px 0 0 !important;
  font-size: 13px !important;
  line-height: 1.45 !important;
  color: rgba(226, 232, 240, 0.9) !important;
}

.gram-ra-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.gram-ra-hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(167, 139, 250, 0.28);
  background: rgba(167, 139, 250, 0.12);
  color: #e9d5ff;
  font-size: 12px;
  font-weight: 700;
}

.gram-ra-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.44fr);
  gap: 14px;
  align-items: start;
}

.gram-ra-card {
  border-radius: 18px;
  border: 1px solid rgba(167, 139, 250, 0.24);
  background: rgba(16, 23, 38, 0.48);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 10px 28px rgba(2, 6, 23, 0.22);
}

.gram-ra-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 10px;
}

.gram-ra-card-icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: rgba(167, 139, 250, 0.18);
  border: 1px solid rgba(167, 139, 250, 0.24);
  flex: 0 0 auto;
}

.gram-ra-card-title {
  font-size: 14px !important;
  font-weight: 800 !important;
  color: #fff !important;
  margin: 0 !important;
}

.gram-ra-card-sub {
  font-size: 12px !important;
  color: rgba(226, 232, 240, 0.72) !important;
  line-height: 1.35 !important;
}

.gram-ra-left {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.gram-ra-right {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.gram-ra-card-hero {
  padding: 6px 0 14px;
}

.gram-ra-card-hero .gram-ra-card-head {
  padding: 14px 16px 6px;
}

.gram-ra-services {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 8px 16px 4px;
}

.gram-ra-service {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  background: rgba(2, 6, 23, 0.18);
  color: #e2e8f0;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease, background 0.12s ease;
  text-align: left;
  font-weight: 800;
}

.gram-ra-service i {
  color: #e9d5ff;
  opacity: 0.95;
}

.gram-ra-service-rate {
  font-weight: 900;
  color: #ddd6fe;
  opacity: 0.95;
  font-size: 12px;
}

.gram-ra-service.is-active {
  border-color: rgba(167, 139, 250, 0.58);
  background: rgba(167, 139, 250, 0.12);
  box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.22), 0 14px 38px rgba(124, 58, 237, 0.18);
  transform: translateY(-1px);
}

.gram-ra-check {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px 0;
  color: rgba(226, 232, 240, 0.92);
}

.gram-ra-check input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.gram-ra-check-ui {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  border: 1px solid rgba(167, 139, 250, 0.35);
  background: rgba(167, 139, 250, 0.1);
  flex: 0 0 auto;
  position: relative;
}

.gram-ra-check input:checked + .gram-ra-check-ui {
  border-color: rgba(167, 139, 250, 0.75);
  background: rgba(167, 139, 250, 0.22);
}

.gram-ra-check input:checked + .gram-ra-check-ui::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.95), rgba(124, 58, 237, 0.95));
  clip-path: polygon(14% 52%, 0% 67%, 41% 100%, 100% 25%, 86% 10%, 41% 72%);
  opacity: 0.95;
}

.gram-ra-check-text {
  font-size: 13px;
  font-weight: 800;
}

.gram-ra-muted {
  margin: 10px 16px 0;
  padding: 0;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(226, 232, 240, 0.72);
}

.gram-ra-form {
  padding: 6px 16px 2px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.gram-ra-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.gram-ra-field-label {
  font-size: 12px;
  font-weight: 800;
  color: rgba(226, 232, 240, 0.82);
}

.gram-ra-form input,
.gram-ra-form textarea {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(167, 139, 250, 0.32);
  background: rgba(2, 6, 23, 0.28);
  color: #fff;
  outline: none;
  box-sizing: border-box;
  font: inherit;
}

.gram-ra-form textarea {
  resize: vertical;
}

.gram-ra-hint {
  margin: 10px 16px 14px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(167, 139, 250, 0.22);
  background: rgba(167, 139, 250, 0.08);
  color: rgba(226, 232, 240, 0.86);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 700;
}

.gram-ra-right .gram-ra-card-calc {
  padding-bottom: 16px;
}

.gram-ra-card-calc .gram-ra-card-head {
  padding: 14px 16px 10px;
}

.gram-ra-card-calc {
  padding-bottom: 14px;
}

.gram-ra-price {
  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gram-ra-price-main {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.gram-ra-price-value {
  font-size: 40px;
  font-weight: 1000;
  color: #fff;
  letter-spacing: -0.02em;
}

.gram-ra-price-rub {
  font-size: 14px;
  color: rgba(226, 232, 240, 0.85);
  font-weight: 900;
}

.gram-ra-price-subline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(167, 139, 250, 0.22);
  background: rgba(2, 6, 23, 0.18);
}

.gram-ra-price-sublabel {
  color: rgba(226, 232, 240, 0.78);
  font-weight: 800;
  font-size: 12px;
}

.gram-ra-price-subvalue {
  color: #fff;
  font-weight: 900;
  font-size: 13px;
}

.gram-ra-breakdown {
  padding: 4px 16px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gram-ra-break {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  color: rgba(226, 232, 240, 0.9);
}

.gram-ra-break span {
  color: rgba(226, 232, 240, 0.78);
  font-weight: 700;
}

.gram-ra-break strong {
  color: #fff;
  font-weight: 1000;
}

.gram-ra-break-total {
  padding-top: 8px;
  border-top: 1px solid rgba(167, 139, 250, 0.22);
}

.gram-ra-cta {
  padding: 14px 16px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gram-ra-submit {
  background: linear-gradient(135deg, #a78bfa, #7c3aed) !important;
  box-shadow: 0 10px 28px rgba(124, 58, 237, 0.28) !important;
  border-color: rgba(167, 139, 250, 0.55) !important;
  color: #fff !important;
  min-height: 48px !important;
}

.gram-ra-cta-note {
  color: rgba(226, 232, 240, 0.7);
  font-size: 12px;
  line-height: 1.4;
}

@media (max-width: 980px) {
  .gram-ra-grid {
    grid-template-columns: 1fr;
  }
  .gram-ra-form {
    grid-template-columns: 1fr;
  }
}

/* Purple overrides for old exchange UI, so everything matches Agency style */
.gram-ex-page {
  color: #e9d5ff;
}

.gram-ex-page .gram-page-head .gram-module-hero-icon,
.gram-ex-page .gram-module-hero-icon {
  background: linear-gradient(135deg, #a78bfa, #7c3aed) !important;
}

.gram-ex-page .gram-ex-card,
.gram-ex-page .gram-gpt-window,
.gram-ex-page .gram-ex-wallet,
.gram-ex-page .gram-ex-exec,
.gram-ex-page #gramExCreateForm,
.gram-ex-page #gramExProfileForm {
  border-color: rgba(167, 139, 250, 0.26) !important;
  background: rgba(16, 23, 38, 0.46) !important;
  box-shadow: 0 10px 28px rgba(2, 6, 23, 0.22) !important;
}

.gram-ex-page .gram-ex-tab.is-active {
  background: rgba(167, 139, 250, 0.14) !important;
  border-color: rgba(167, 139, 250, 0.55) !important;
  color: #e9d5ff !important;
}

.gram-ex-page .gram-ex-card:hover {
  border-color: rgba(167, 139, 250, 0.62) !important;
}

.gram-ex-page .gram-gpt-btn-primary {
  background: linear-gradient(135deg, #a78bfa, #7c3aed) !important;
  box-shadow: 0 10px 28px rgba(124, 58, 237, 0.28) !important;
}

.gram-ex-page .gram-gpt-window.gram-tone-indigo,
.gram-ex-page .gram-gpt-window.gram-tone-cyan,
.gram-ex-page .gram-gpt-window.gram-tone-blue {
  border-color: rgba(167, 139, 250, 0.22) !important;
}

/* —— Rocket Agency full-screen + glass (v592 append) —— */

.gram-ra-page {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  min-height: calc(100vh - 120px) !important;
  border-radius: 18px !important;
  background:
    radial-gradient(circle at 15% 0%, rgba(167, 139, 250, 0.18) 0%, transparent 35%),
    radial-gradient(circle at 85% 0%, rgba(124, 58, 237, 0.16) 0%, transparent 40%),
    linear-gradient(180deg, rgba(16, 23, 38, 0.58) 0%, rgba(10, 14, 26, 0.42) 100%) !important;
  backdrop-filter: blur(16px) saturate(120%) !important;
  -webkit-backdrop-filter: blur(16px) saturate(120%) !important;
  border: 1px solid rgba(167, 139, 250, 0.22) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 18px 45px rgba(2, 6, 23, 0.22) !important;
}

.gram-ra-grid {
  width: 100% !important;
  max-width: none !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.48fr) !important;
  gap: 16px !important;
}

.gram-ra-hero {
  border-radius: 22px !important;
}

.gram-ra-left,
.gram-ra-right {
  min-width: 0 !important;
}

.gram-ra-card {
  border-radius: 22px !important;
}

@media (max-width: 1100px) {
  .gram-ra-grid {
    grid-template-columns: 1fr !important;
  }
}

/* —— Rocket Agency: hide header + spam_pm-like sidebar highlight (v593 append) —— */

/* 1) Скрыть внутреннюю шапку страницы Rocket Agency */
html body:has(.gram-ra-page) .gram-ra-hero-head {
  display: none !important;
}

/* 2) Если открыта старшая часть exchange (detail), тоже скрываем page-head */
html body:has(.gram-ex-page) .gram-ex-page .gram-page-head {
  display: none !important;
}

/* 3) Активный пункт в сайдбаре для exchange — как у spam_pm (но в нашей фиолетовой палитре) */
html body:has(.gram-ra-page) #sidebar .menu-item[data-page="exchange"].active,
html body:has(.gram-ra-page) #sidebar a.menu-item[data-page="exchange"].active {
  background: rgba(167, 139, 250, 0.14) !important;
  color: #e9d5ff !important;
  box-shadow: inset 3px 0 0 rgba(167, 139, 250, 0.95) !important;
}

html body:has(.gram-ra-page) #sidebar .menu-item[data-page="exchange"].active .pi,
html body:has(.gram-ra-page) #sidebar a.menu-item[data-page="exchange"].active .pi {
  color: #e9d5ff !important;
}

/* —— Rocket Agency sidebar highlight (v594 append) —— */
html body:has(.gram-ex-page) #sidebar .menu-item[data-page="exchange"].active,
html body:has(.gram-ex-page) #sidebar a.menu-item[data-page="exchange"].active {
  background: rgba(167, 139, 250, 0.14) !important;
  color: #e9d5ff !important;
  box-shadow: inset 3px 0 0 rgba(167, 139, 250, 0.95) !important;
}

html body:has(.gram-ex-page) #sidebar .menu-item[data-page="exchange"].active .pi,
html body:has(.gram-ex-page) #sidebar a.menu-item[data-page="exchange"].active .pi {
  color: #e9d5ff !important;
}

/* ═══════════════════════════════════════════════════════════
   GLOBAL shell — spam_pm glass everywhere (v595 append)
   floating glass sidebar · hide header-glass · cosmos bg
   dark theme only; does not delete prior spam_pm-scoped rules
   ═══════════════════════════════════════════════════════════ */

html.theme-dark,
html.theme-dark body {
  background: radial-gradient(ellipse 130% 100% at top right, #243349 0%, #131c2b 40%, #0a0f18 75%, #070b12 100%) !important;
  background-attachment: fixed !important;
}

html.theme-dark body .app-shell,
html.theme-dark body .main-wrap,
html.theme-dark body .main-wrap.panel-background,
html.theme-dark body .content-wrapper {
  background: radial-gradient(ellipse 130% 100% at top right, #243349 0%, #131c2b 40%, #0a0f18 75%, #070b12 100%) !important;
  background-attachment: fixed !important;
}

/* hide top header (title / balance / profile) everywhere in dark */
html.theme-dark body .header-glass {
  display: none !important;
}

html.theme-dark body #sidebar.sidebar,
html.theme-dark body #sidebar.sidebar-glass,
html.theme-dark body aside#sidebar {
  background: transparent !important;
  background-image: none !important;
  border: none !important;
  border-right: none !important;
  box-shadow: none !important;
}

html.theme-dark body #sidebar .sidebar-border-gradient {
  display: none !important;
}

html.theme-dark body #sidebar .sidebar-inner {
  flex: 1 1 auto !important;
  height: 100% !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  border-radius: 26px !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  background: rgba(15, 23, 42, 0.6) !important;
  backdrop-filter: blur(12px) saturate(1.2) !important;
  -webkit-backdrop-filter: blur(12px) saturate(1.2) !important;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35) !important;
}

html.theme-dark body #sidebar .sidebar-logo {
  flex: 0 0 auto !important;
  padding: 20px 20px 16px !important;
}

html.theme-dark body #sidebar .sidebar-nav {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  padding: 0 12px !important;
}

html.theme-dark body #sidebar .menu-item,
html.theme-dark body #sidebar .submenu-link {
  border-radius: 8px !important;
}

/* active items — amber ring like spam_pm */
html.theme-dark body #sidebar .menu-item.active,
html.theme-dark body #sidebar a.menu-item.active {
  background: rgba(245, 166, 35, 0.1) !important;
  background-image: none !important;
  color: #f5a623 !important;
  border: none !important;
  box-shadow: inset 0 0 0 1px rgba(245, 166, 35, 0.3) !important;
}

html.theme-dark body #sidebar .menu-item.active .pi,
html.theme-dark body #sidebar .menu-item.active .menu-label {
  color: #f5a623 !important;
}

html.theme-dark body #sidebar .submenu-link.active {
  background: rgba(245, 166, 35, 0.1) !important;
  background-image: none !important;
  color: #f5a623 !important;
  border: none !important;
  box-shadow: inset 0 0 0 1px rgba(245, 166, 35, 0.3) !important;
  font-weight: 500 !important;
}

html.theme-dark body #sidebar .submenu-link.active .submenu-link-text,
html.theme-dark body #sidebar .submenu-link.active .pi,
html.theme-dark body #sidebar .submenu-link.active .submenu-module-icon,
html.theme-dark body #sidebar .submenu-link.active .submenu-module-icon i {
  color: #f5a623 !important;
}

html.theme-dark body .content-glass {
  position: relative !important;
  background: rgba(255, 255, 255, 0.02) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 28px !important;
  backdrop-filter: blur(24px) saturate(1.3) !important;
  -webkit-backdrop-filter: blur(24px) saturate(1.3) !important;
  box-shadow: 0 20px 60px -15px rgba(0, 0, 0, 0.55) !important;
}

html.theme-dark body .main-wrap {
  height: 100vh !important;
  max-height: 100vh !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}

html.theme-dark body .content-wrapper {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  width: 100% !important;
  max-width: none !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  box-sizing: border-box !important;
}

@media (min-width: 1025px) {
  html.theme-dark body {
    --tr-shell-aside: 260px;
    --tr-shell-inset: 10px;
    --tr-shell-sidebar-slot: calc(var(--tr-shell-aside) + var(--tr-shell-inset) * 2);
  }

  html.theme-dark body #sidebar.sidebar,
  html.theme-dark body #sidebar.sidebar-glass,
  html.theme-dark body aside#sidebar {
    position: fixed !important;
    left: var(--tr-shell-inset) !important;
    top: var(--tr-shell-inset) !important;
    width: var(--tr-shell-aside) !important;
    max-width: var(--tr-shell-aside) !important;
    height: calc(100vh - var(--tr-shell-inset) * 2) !important;
    min-height: calc(100vh - var(--tr-shell-inset) * 2) !important;
    max-height: calc(100vh - var(--tr-shell-inset) * 2) !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    border-right: none !important;
    background: transparent !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    z-index: 200 !important;
    box-sizing: border-box !important;
  }

  html.theme-dark body .main-wrap {
    margin-left: var(--tr-shell-sidebar-slot) !important;
    padding: var(--tr-shell-inset) var(--tr-shell-inset) var(--tr-shell-inset) 0 !important;
    width: auto !important;
    max-width: none !important;
    box-sizing: border-box !important;
  }

  html.theme-dark body .content-glass {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    border-radius: 28px !important;
  }
}

/* ═══════════════════════════════════════════════════════════
   Rocket Agency — premium product cards (v599 append)
   ═══════════════════════════════════════════════════════════ */

.gram-ra-page .gram-ra-services {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 12px !important;
  padding: 10px 16px 8px !important;
}

.gram-ra-page .gram-ra-service.gram-ra-product {
  position: relative !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  gap: 12px !important;
  min-height: 148px !important;
  padding: 16px 16px 14px !important;
  border-radius: 18px !important;
  border: 1px solid rgba(167, 139, 250, 0.22) !important;
  background:
    linear-gradient(155deg, rgba(167, 139, 250, 0.14) 0%, rgba(15, 10, 30, 0.55) 42%, rgba(2, 6, 23, 0.72) 100%) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 12px 28px rgba(2, 6, 23, 0.35) !important;
  overflow: hidden !important;
  transform: none !important;
  font-weight: 600 !important;
}

.gram-ra-page .gram-ra-product-glow {
  position: absolute !important;
  right: -30% !important;
  top: -40% !important;
  width: 70% !important;
  height: 70% !important;
  border-radius: 50% !important;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.28) 0%, transparent 68%) !important;
  pointer-events: none !important;
}

.gram-ra-page .gram-ra-product-icon {
  position: relative !important;
  z-index: 1 !important;
  width: 42px !important;
  height: 42px !important;
  border-radius: 14px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.35), rgba(124, 58, 237, 0.45)) !important;
  border: 1px solid rgba(233, 213, 255, 0.28) !important;
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.25) !important;
}

.gram-ra-page .gram-ra-product-icon .pi {
  font-size: 1.1rem !important;
  color: #f5f3ff !important;
  opacity: 1 !important;
}

.gram-ra-page .gram-ra-product-body {
  position: relative !important;
  z-index: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  min-width: 0 !important;
  width: 100% !important;
  padding-right: 22px !important;
}

.gram-ra-page .gram-ra-product-title {
  font-size: 1rem !important;
  font-weight: 800 !important;
  letter-spacing: -0.01em !important;
  color: #f8fafc !important;
}

.gram-ra-page .gram-ra-product-desc {
  font-size: 0.75rem !important;
  line-height: 1.35 !important;
  font-weight: 500 !important;
  color: rgba(203, 213, 225, 0.78) !important;
}

.gram-ra-page .gram-ra-service.gram-ra-product .gram-ra-service-rate {
  margin-top: 6px !important;
  font-size: 0.78rem !important;
  font-weight: 800 !important;
  color: #ddd6fe !important;
}

.gram-ra-page .gram-ra-service.gram-ra-product .gram-ra-service-soon {
  color: #f5a623 !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
  font-size: 0.7rem !important;
}

.gram-ra-page .gram-ra-product-check {
  position: absolute !important;
  top: 12px !important;
  right: 12px !important;
  z-index: 2 !important;
  width: 22px !important;
  height: 22px !important;
  border-radius: 999px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  background: rgba(15, 23, 42, 0.45) !important;
  color: transparent !important;
  font-size: 0.65rem !important;
}

.gram-ra-page .gram-ra-service.gram-ra-product:hover {
  border-color: rgba(167, 139, 250, 0.45) !important;
  transform: translateY(-2px) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 18px 40px rgba(76, 29, 149, 0.28) !important;
}

.gram-ra-page .gram-ra-service.gram-ra-product.is-active {
  border-color: rgba(196, 181, 253, 0.75) !important;
  background:
    linear-gradient(155deg, rgba(167, 139, 250, 0.28) 0%, rgba(76, 29, 149, 0.35) 45%, rgba(15, 10, 30, 0.8) 100%) !important;
  box-shadow:
    inset 0 0 0 1px rgba(196, 181, 253, 0.25),
    0 18px 44px rgba(124, 58, 237, 0.35) !important;
  transform: translateY(-2px) !important;
}

.gram-ra-page .gram-ra-service.gram-ra-product.is-active .gram-ra-product-check {
  background: linear-gradient(135deg, #a78bfa, #7c3aed) !important;
  border-color: transparent !important;
  color: #fff !important;
}

.gram-ra-page .gram-ra-service.gram-ra-product.is-stub {
  opacity: 0.82 !important;
}

.gram-ra-page .gram-ra-service.gram-ra-product.is-stub:hover {
  transform: none !important;
}

@media (max-width: 720px) {
  .gram-ra-page .gram-ra-services {
    grid-template-columns: 1fr !important;
  }
}

/* —— Rocket Agency cases glass (v601 append) —— */
.gram-ra-page .gram-ra-cases {
  margin-top: 18px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}
.gram-ra-page .gram-ra-cases-head {
  margin: 0 0 14px !important;
}
.gram-ra-page .gram-ra-cases-title {
  margin: 0 !important;
  font-size: 20px !important;
  font-weight: 800 !important;
  color: #fff !important;
  letter-spacing: -0.01em !important;
}
.gram-ra-page .gram-ra-cases-sub {
  margin: 6px 0 0 !important;
  font-size: 13px !important;
  color: #94a3b8 !important;
  line-height: 1.4 !important;
}
.gram-ra-page .gram-ra-cases-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)) !important;
  gap: 14px !important;
}
.gram-ra-page .gram-ra-case {
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
  min-height: 100% !important;
  padding: 0 !important;
  overflow: hidden !important;
  border-radius: 18px !important;
  border: 1px solid rgba(56, 189, 248, 0.35) !important;
  background:
    linear-gradient(180deg, rgba(30, 41, 79, 0.62) 0%, rgba(16, 23, 38, 0.82) 100%) !important;
  backdrop-filter: blur(16px) saturate(1.15) !important;
  -webkit-backdrop-filter: blur(16px) saturate(1.15) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 14px 36px rgba(2, 6, 23, 0.4),
    0 0 0 1px rgba(56, 189, 248, 0.08) !important;
}
.gram-ra-page .gram-ra-case-media {
  position: relative !important;
  width: 100% !important;
  aspect-ratio: 1 / 1 !important;
  overflow: hidden !important;
  background:
    radial-gradient(circle at 50% 30%, rgba(56, 189, 248, 0.28), transparent 55%),
    #0b1220 !important;
}
.gram-ra-page .gram-ra-case-photo {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center top !important;
  margin: 0 !important;
  border: 0 !important;
}
.gram-ra-page .gram-ra-case-body {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  padding: 14px 14px 16px !important;
  flex: 1 1 auto !important;
}
.gram-ra-page .gram-ra-case-img {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 1 / 1 !important;
  object-fit: cover !important;
  object-position: center top !important;
  margin: 0 !important;
  border: 0 !important;
  vertical-align: top !important;
}
.gram-ra-page .gram-ra-case-head {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
}
.gram-ra-page .gram-ra-case-av {
  width: 58px !important;
  height: 58px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  flex: 0 0 auto !important;
  border: 2px solid #38bdf8 !important;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.22), 0 0 18px rgba(56, 189, 248, 0.3) !important;
  background: #0f172a !important;
}
.gram-ra-page .gram-ra-case-name {
  margin: 0 !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  color: #fff !important;
  line-height: 1.25 !important;
}
.gram-ra-page .gram-ra-case-profit {
  margin: 4px 0 0 !important;
  font-size: 16px !important;
  font-weight: 800 !important;
  color: #38bdf8 !important;
}
.gram-ra-page .gram-ra-case-badge {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 34px !important;
  padding: 8px 10px !important;
  border-radius: 10px !important;
  background: linear-gradient(90deg, #22d3ee, #3b82f6 55%, #6366f1) !important;
  color: #fff !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
  text-align: center !important;
}
.gram-ra-page .gram-ra-case-steps {
  margin: 0 !important;
  padding: 0 0 0 18px !important;
  color: #e2e8f0 !important;
  font-size: 12px !important;
  line-height: 1.45 !important;
  flex: 1 1 auto !important;
}
.gram-ra-page .gram-ra-case-steps li {
  margin: 0 0 6px !important;
}
.gram-ra-page .gram-ra-case-foot {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 8px !important;
}
.gram-ra-page .gram-ra-case-stat {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 36px !important;
  padding: 6px !important;
  border-radius: 10px !important;
  background: linear-gradient(90deg, #22d3ee, #3b82f6) !important;
  color: #fff !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  letter-spacing: 0.02em !important;
  text-transform: uppercase !important;
  text-align: center !important;
}
html:not(.theme-dark) .gram-ra-page .gram-ra-case {
  background: linear-gradient(180deg, rgba(255,255,255,0.92), rgba(241,245,249,0.95)) !important;
  border-color: rgba(14, 165, 233, 0.28) !important;
}
html:not(.theme-dark) .gram-ra-page .gram-ra-case-name,
html:not(.theme-dark) .gram-ra-page .gram-ra-cases-title {
  color: #0f172a !important;
}
html:not(.theme-dark) .gram-ra-page .gram-ra-case-steps {
  color: #334155 !important;
}

/* —— CRM Dark shell · spam_pm glass (v600) —— */
.gram-crm-page .gram-crm-tabs--legacy {
  opacity: 0.88;
  margin-top: -4px;
  margin-bottom: 8px;
}

/* CRM page: no infinite sheet — viewport lock */
html body:has(.gram-crm-page.gram-spam-pm-page) .content-glass,
html body:has(.gram-crm-page.gram-spam-pm-page) .content-wrapper,
html.theme-dark body:has(.gram-crm-page.gram-spam-pm-page) .content-glass,
html.theme-dark body:has(.gram-crm-page.gram-spam-pm-page) .content-wrapper {
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  min-height: 0 !important;
}

html body:has(.gram-crm-page.gram-spam-pm-page) #pageContent,
html.theme-dark body:has(.gram-crm-page.gram-spam-pm-page) #pageContent {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}

.gram-crm-page.gram-spam-pm-page {
  display: flex !important;
  flex-direction: column !important;
  max-height: calc(100dvh - 18px) !important;
  height: calc(100dvh - 18px) !important;
  min-height: 0 !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

.gram-crm-page.gram-spam-pm-page .gram-spam-pm-hero-head {
  padding-bottom: 4px !important;
  margin-bottom: 4px !important;
}

.gram-crm-page.gram-spam-pm-page .gram-spam-pm-hero-sub {
  font-size: 12px !important;
}

.gram-crm-page .gram-crm-hero-head,
.gram-crm-page > .gram-gpt-notice,
.gram-crm-page > .gram-crm-tabs,
.gram-crm-page > .gram-crm-period-row {
  flex-shrink: 0;
}

.gram-crm-page .gram-crm-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}

.gram-crm-page .gram-crm-inbox-wrap,
.gram-crm-page .gram-crm-funnel-page,
.gram-crm-page .gram-crm-clients-page,
.gram-crm-page .gram-crm-shell-page,
.gram-crm-page .gram-crm-settings-page,
.gram-crm-page .gram-crm-dash-page,
.gram-crm-page .gram-crm-leads-page,
.gram-crm-page .gram-crm-history-page,
.gram-crm-page .gram-crm-replies-page {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
}

.gram-crm-page .gram-crm-inbox-wrap {
  overflow: hidden;
  gap: 10px;
}

.gram-crm-page .gram-crm-inbox-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, #0088cc 30%, var(--gram-border, var(--border)));
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  backdrop-filter: blur(12px) saturate(1.15);
  -webkit-backdrop-filter: blur(12px) saturate(1.15);
}

.gram-crm-page .gram-crm-inbox-acc {
  color: #60a5fa;
}

.gram-crm-shell-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 16px;
  margin-bottom: 12px;
}

.gram-crm-shell-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.gram-crm-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  background: #64748b;
  flex-shrink: 0;
}
.gram-crm-dot--blue,
.gram-crm-dot.gram-crm-stage--base,
.gram-crm-dot.gram-crm-stage--contacted { background: #3b82f6; }
.gram-crm-dot--amber,
.gram-crm-dot.gram-crm-stage--hot,
.gram-crm-dot.gram-crm-stage--warm { background: #f59e0b; }
.gram-crm-dot--violet,
.gram-crm-dot.gram-crm-stage--replied { background: #a78bfa; }
.gram-crm-dot--green,
.gram-crm-dot.gram-crm-stage--won { background: #22c55e; }
.gram-crm-dot.gram-crm-stage--cold { background: #38bdf8; }
.gram-crm-dot.gram-crm-stage--refused { background: #ef4444; }

.gram-crm-inbox {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 12px;
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  max-height: none;
  align-items: stretch;
  overflow: hidden;
}

.gram-crm-inbox-aside,
.gram-crm-inbox-chat {
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, #0088cc 28%, var(--gram-border, var(--border)));
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  backdrop-filter: blur(14px) saturate(1.15);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.gram-crm-inbox-aside-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 8px;
  flex-shrink: 0;
}

.gram-crm-inbox-aside > .gram-input,
.gram-crm-inbox-filters {
  margin: 0 14px 8px;
  flex-shrink: 0;
}

.gram-crm-inbox-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.gram-crm-inbox-list {
  flex: 1;
  overflow: auto;
  padding: 4px 8px 12px;
  min-height: 0;
}

.gram-crm-inbox-item {
  width: 100%;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  text-align: left;
  padding: 10px 10px;
  margin-bottom: 4px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.gram-crm-inbox-item:hover {
  background: color-mix(in srgb, #0088cc 10%, transparent);
}

.gram-crm-inbox-item.is-active {
  background: color-mix(in srgb, #0088cc 16%, var(--surface));
  border-color: color-mix(in srgb, #0088cc 40%, transparent);
}

.gram-crm-inbox-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #0088cc, #00aced);
}

.gram-crm-inbox-avatar--lg {
  width: 42px;
  height: 42px;
  font-size: 14px;
}

.gram-crm-inbox-item-main {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gram-crm-inbox-item-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.gram-crm-inbox-item-top time {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.gram-crm-inbox-item-preview,
.gram-crm-inbox-item-meta {
  font-size: 12px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gram-crm-inbox-chat {
  padding: 0;
}

.gram-crm-inbox-chat-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.gram-crm-inbox-chat-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--gram-border, var(--border));
  flex-shrink: 0;
}

.gram-crm-inbox-chat-who {
  flex: 1;
  min-width: 120px;
  display: flex;
  flex-direction: column;
}

.gram-crm-inbox-chat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.gram-crm-inbox-thread {
  flex: 1;
  overflow: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.gram-crm-inbox-bubble {
  max-width: 78%;
  border-radius: 14px;
  padding: 8px 12px;
  font-size: 13px;
  background: color-mix(in srgb, var(--surface) 88%, #64748b 12%);
}

.gram-crm-inbox-bubble p {
  margin: 0;
}

.gram-crm-inbox-bubble-meta {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.gram-crm-inbox-bubble--in {
  align-self: flex-start;
  background: color-mix(in srgb, #10b981 14%, var(--surface));
}

.gram-crm-inbox-bubble--out {
  align-self: flex-end;
  background: color-mix(in srgb, #0088cc 16%, var(--surface));
}

.gram-crm-inbox-ai {
  padding: 8px 14px;
  border-top: 1px solid var(--gram-border, var(--border));
}

.gram-crm-inbox-ai-label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.gram-crm-inbox-ai-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.gram-crm-inbox-ai-chip {
  border-radius: 999px;
  border: 1px solid var(--gram-border, var(--border));
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  color: var(--text);
  font-size: 12px;
  padding: 6px 10px;
  cursor: pointer;
}

.gram-crm-inbox-ai-compose {
  border-color: color-mix(in srgb, #a78bfa 50%, var(--gram-border, var(--border))) !important;
}

.gram-crm-inbox-composer {
  display: flex;
  gap: 8px;
  padding: 10px 14px 14px;
  border-top: 1px solid var(--gram-border, var(--border));
  flex-shrink: 0;
}

.gram-crm-inbox-composer .gram-input {
  flex: 1;
}

.gram-crm-inbox-empty {
  margin: auto;
  text-align: center;
  color: var(--text-muted);
  padding: 40px 20px;
}

.gram-crm-inbox-empty .pi {
  font-size: 28px;
  opacity: 0.5;
  display: block;
  margin-bottom: 8px;
}

.gram-crm-funnel-page .gram-crm-board {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.gram-crm-funnel-page .gram-crm-board-col-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gram-crm-clients-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.gram-crm-clients-toolbar > .gram-input {
  max-width: 420px;
}

.gram-crm-clients-uname {
  color: #60a5fa;
}

.gram-crm-clients-table-wrap {
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.gram-crm-cal-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.gram-crm-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 6px;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}

.gram-crm-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.gram-crm-cal-cell {
  min-height: 72px;
  border-radius: 12px;
  border: 1px solid var(--gram-border, var(--border));
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  color: inherit;
  text-align: right;
  padding: 8px;
  cursor: pointer;
}

.gram-crm-cal-cell.is-empty {
  visibility: hidden;
  pointer-events: none;
}

.gram-crm-cal-cell.is-today span {
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #3b82f6;
  color: #fff;
  font-weight: 700;
}

.gram-crm-emp-card,
.gram-crm-settings-main {
  border-radius: 16px;
  border: 1px solid var(--gram-border, var(--border));
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 16px;
}

.gram-crm-emp-invite {
  display: flex;
  gap: 8px;
  margin: 10px 0 16px;
}

.gram-crm-emp-invite .gram-input {
  flex: 1;
}

.gram-crm-settings-page {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 12px;
  overflow: hidden;
}

.gram-crm-settings-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid var(--gram-border, var(--border));
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  overflow: auto;
}

.gram-crm-settings-link {
  text-align: left;
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.gram-crm-settings-link.is-active,
.gram-crm-settings-link:hover {
  background: color-mix(in srgb, #0088cc 14%, transparent);
  color: var(--text);
}

@media (max-width: 960px) {
  .gram-crm-inbox,
  .gram-crm-settings-page {
    grid-template-columns: 1fr;
  }
  .gram-crm-page.gram-spam-pm-page {
    height: auto !important;
    max-height: none !important;
    overflow: auto !important;
  }
  .gram-crm-inbox-aside {
    max-height: 320px;
  }
}

/* —— CRM spam_pm glass align (v602) —— */
.gram-crm-page .is-crm-hidden,
.gram-crm-page .gram-crm-period-row.is-crm-hidden,
.gram-crm-page .gram-crm-period-row[hidden] {
  display: none !important;
}

.gram-crm-page .gram-crm-nav-block {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}

.gram-crm-page .gram-crm-notice-compact {
  margin: 0 0 8px !important;
  padding: 8px 12px !important;
  font-size: 12px !important;
}

.gram-crm-page .gram-crm-tabs {
  margin: 0 !important;
  gap: 6px !important;
}

.gram-crm-page .gram-crm-tabs .gram-crm-tab {
  padding: 6px 12px !important;
  font-size: 12px !important;
}

.gram-crm-page .gram-crm-tabs--legacy .gram-crm-tab {
  padding: 4px 10px !important;
  font-size: 11px !important;
  opacity: 0.85;
}

html.theme-dark .gram-crm-page.gram-ml-glass .gram-gpt-window {
  border: 1px solid rgba(56, 189, 248, 0.24) !important;
  border-radius: 14px !important;
  background: #152238 !important;
  backdrop-filter: blur(12px) saturate(1.15) !important;
  -webkit-backdrop-filter: blur(12px) saturate(1.15) !important;
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.1),
    0 8px 28px rgba(0, 0, 0, 0.35),
    0 0 24px rgba(56, 189, 248, 0.05) !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  min-height: 0 !important;
  height: 100% !important;
}

html.theme-dark .gram-crm-page.gram-ml-glass .gram-gpt-window-head {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.12) 0%, rgba(15, 23, 42, 0.02) 100%) !important;
  border-bottom: 1px solid rgba(56, 189, 248, 0.16) !important;
  flex-shrink: 0 !important;
}

.gram-crm-page.gram-ml-glass .gram-gpt-window-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 12px 14px 14px !important;
}

.gram-crm-page .gram-crm-funnel-page,
.gram-crm-page .gram-crm-clients-page,
.gram-crm-page .gram-crm-inbox-wrap,
.gram-crm-page .gram-crm-shell-page,
.gram-crm-page .gram-crm-leads-page,
.gram-crm-page .gram-crm-settings-page,
.gram-crm-page .gram-crm-dash-page,
.gram-crm-page .gram-crm-history-page,
.gram-crm-page .gram-crm-replies-page {
  height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}

.gram-crm-page .gram-crm-funnel-page > .gram-gpt-window,
.gram-crm-page .gram-crm-clients-page > .gram-gpt-window,
.gram-crm-page .gram-crm-inbox-wrap > .gram-gpt-window,
.gram-crm-page .gram-crm-shell-page > .gram-gpt-window,
.gram-crm-page .gram-crm-leads-page > .gram-gpt-window,
.gram-crm-page .gram-crm-settings-page > .gram-gpt-window {
  flex: 1 1 auto !important;
}

.gram-crm-page .gram-crm-board {
  display: flex !important;
  gap: 10px !important;
  align-items: stretch !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: 100% !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  padding-bottom: 6px !important;
}

.gram-crm-page .gram-crm-board-col {
  flex: 0 0 220px !important;
  width: 220px !important;
  min-width: 220px !important;
  max-width: 220px !important;
  display: flex !important;
  flex-direction: column !important;
  min-height: 0 !important;
  height: 100% !important;
  max-height: 100% !important;
  border-radius: 12px !important;
  border: 1px solid rgba(56, 189, 248, 0.18) !important;
  background: rgba(15, 23, 42, 0.45) !important;
  overflow: hidden !important;
}

.gram-crm-page .gram-crm-board-col-head {
  flex-shrink: 0 !important;
  padding: 10px 12px !important;
  border-bottom: 1px solid rgba(56, 189, 248, 0.12) !important;
}

.gram-crm-page .gram-crm-board-drop {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  padding: 8px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
}

.gram-crm-page .gram-crm-board-card {
  flex-shrink: 0 !important;
  width: 100% !important;
  box-sizing: border-box !important;
  border-radius: 10px !important;
  border: 1px solid rgba(71, 100, 150, 0.35) !important;
  background: rgba(21, 34, 56, 0.92) !important;
  padding: 10px !important;
}

.gram-crm-page .gram-crm-inbox {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;
}

.gram-crm-page .gram-crm-inbox-toolbar {
  flex-shrink: 0 !important;
  margin-bottom: 10px !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  backdrop-filter: none !important;
}

.gram-crm-page .gram-crm-inbox-aside,
.gram-crm-page .gram-crm-inbox-chat {
  background: rgba(15, 23, 42, 0.4) !important;
  border-color: rgba(56, 189, 248, 0.2) !important;
}

.gram-crm-page .gram-crm-clients-toolbar {
  flex-shrink: 0 !important;
}

.gram-crm-page .gram-crm-clients-table-wrap,
.gram-crm-page .gram-crm-leads-results {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: auto !important;
}

.gram-crm-page .gram-crm-leads-filters {
  flex-shrink: 0 !important;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.gram-crm-page .gram-crm-leads-page .gram-crm-live-stats {
  flex-shrink: 0 !important;
  margin-bottom: 8px !important;
}

.gram-crm-page .gram-crm-settings-inner {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 12px;
  flex: 1;
  min-height: 0;
}

.gram-crm-page .gram-crm-settings-main {
  border: 0 !important;
  background: transparent !important;
  backdrop-filter: none !important;
  padding: 0 !important;
}

.gram-crm-page .gram-crm-pager {
  flex-shrink: 0 !important;
  margin-top: 8px !important;
}

.gram-crm-page .gram-crm-dash-page .gram-crm-spam-grid {
  display: grid !important;
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

/* —— CRM unified view = dashboard skin (v603) —— */
.gram-crm-page .gram-crm-view {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: 100% !important;
  overflow: hidden !important;
  gap: 10px !important;
}

.gram-crm-page .gram-crm-view > .gram-crm-live-stats,
.gram-crm-page .gram-crm-view > .gram-gpt-notice {
  flex-shrink: 0 !important;
}

.gram-crm-page .gram-crm-view-main {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: auto !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
}

.gram-crm-page .gram-crm-view-main > .gram-gpt-window,
.gram-crm-page .gram-crm-view-main > .gram-crm-spam-grid {
  flex: 1 1 auto !important;
  min-height: 0 !important;
}

.gram-crm-page .gram-crm-view .gram-crm-spam-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  gap: 12px !important;
  align-items: stretch !important;
  height: 100% !important;
  min-height: 0 !important;
}

.gram-crm-page .gram-crm-view .gram-crm-spam-grid > .gram-parsing-users-col {
  display: flex !important;
  flex-direction: column !important;
  min-height: 0 !important;
  height: 100% !important;
}

.gram-crm-page .gram-crm-view .gram-crm-spam-grid > .gram-parsing-users-col > .gram-gpt-window {
  flex: 1 1 auto !important;
  height: 100% !important;
  min-height: 0 !important;
}

/* spam_pm brand chrome — only CRM */
html.theme-dark .gram-crm-page.gram-spam-pm-page .gram-spam-pm-hero {
  border: 1px solid rgba(0, 136, 204, 0.22) !important;
  background: rgba(16, 23, 38, 0.55) !important;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.28) !important;
  border-radius: 14px !important;
  padding: 12px 14px !important;
}

html.theme-dark .gram-crm-page.gram-spam-pm-page .gram-spam-pm-hero-title {
  color: #0088cc !important;
}

html.theme-dark .gram-crm-page.gram-ml-glass .gram-gpt-window {
  border: 1px solid rgba(0, 136, 204, 0.22) !important;
  background: rgba(16, 23, 38, 0.62) !important;
  border-radius: 14px !important;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28) !important;
}

html.theme-dark .gram-crm-page .gram-crm-tab.is-active,
html.theme-dark .gram-crm-page .gram-crm-tab.active,
html.theme-dark .gram-crm-page .gram-crm-period.is-active,
html.theme-dark .gram-crm-page .gram-crm-period.active,
html.theme-dark .gram-crm-page .gram-gpt-pill.active {
  border-color: rgba(0, 136, 204, 0.55) !important;
  background: rgba(0, 136, 204, 0.14) !important;
  color: #3ad !important;
  box-shadow: none !important;
}

.gram-crm-page .gram-crm-funnel-fill {
  background: linear-gradient(90deg, #0088cc, #00aced) !important;
}

.gram-crm-page .gram-crm-inbox-toolbar {
  flex-shrink: 0 !important;
}

.gram-crm-page .gram-crm-inbox-chat {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: 100% !important;
  border: 0 !important;
  background: transparent !important;
  backdrop-filter: none !important;
  box-shadow: none !important;
}

.gram-crm-page .gram-crm-inbox-list {
  flex: 1 1 auto !important;
  min-height: 120px !important;
  max-height: none !important;
  overflow: auto !important;
}

.gram-crm-page .gram-crm-inbox-filters {
  margin: 8px 0 !important;
}

.gram-crm-page #crmInboxSearch {
  margin-bottom: 8px !important;
}

@media (max-width: 960px) {
  .gram-crm-page .gram-crm-view .gram-crm-spam-grid {
    grid-template-columns: 1fr !important;
  }
}

/* —— CRM · spam_pm gold palette + modern nav (v604) —— */
.gram-crm-page.gram-spam-pm-page .gram-crm-nav-block {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  margin: 0 0 12px !important;
  padding: 12px 12px 10px !important;
  border-radius: 16px !important;
  border: 1px solid rgba(245, 166, 35, 0.22) !important;
  background: rgba(16, 23, 38, 0.55) !important;
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
  backdrop-filter: blur(14px) saturate(1.15);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
}

html:not(.theme-dark) .gram-crm-page.gram-spam-pm-page .gram-crm-nav-block {
  background: rgba(255, 255, 255, 0.82) !important;
  border-color: rgba(245, 166, 35, 0.28) !important;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08) !important;
}

.gram-crm-page .gram-crm-tabs--primary {
  gap: 8px !important;
  margin: 0 !important;
}

.gram-crm-page .gram-crm-tabs--legacy {
  gap: 6px !important;
  margin: 0 !important;
  opacity: 1 !important;
  padding-top: 8px !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html:not(.theme-dark) .gram-crm-page .gram-crm-tabs--legacy {
  border-top-color: rgba(148, 163, 184, 0.28) !important;
}

.gram-crm-page .gram-crm-tabs--period {
  gap: 6px !important;
  margin: 0 !important;
  padding-top: 8px !important;
  border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
}

html:not(.theme-dark) .gram-crm-page .gram-crm-tabs--period {
  border-top-color: rgba(148, 163, 184, 0.22) !important;
}

.gram-crm-page .gram-crm-tabs--primary .gram-crm-tab {
  padding: 9px 16px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  border-radius: 999px !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  background: rgba(15, 23, 42, 0.55) !important;
  color: #e2e8f0 !important;
}

html:not(.theme-dark) .gram-crm-page .gram-crm-tabs--primary .gram-crm-tab {
  background: rgba(248, 250, 252, 0.9) !important;
  border-color: rgba(148, 163, 184, 0.35) !important;
  color: #334155 !important;
}

.gram-crm-page .gram-crm-tabs--legacy .gram-crm-tab {
  padding: 6px 12px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  border-radius: 999px !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: rgba(8, 12, 20, 0.4) !important;
  color: #94a3b8 !important;
}

html:not(.theme-dark) .gram-crm-page .gram-crm-tabs--legacy .gram-crm-tab {
  background: rgba(241, 245, 249, 0.85) !important;
  border-color: rgba(148, 163, 184, 0.28) !important;
  color: #64748b !important;
}

.gram-crm-page .gram-crm-tabs--period .gram-crm-period {
  padding: 5px 12px !important;
  font-size: 12px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: rgba(8, 12, 20, 0.35) !important;
  color: #94a3b8 !important;
}

html:not(.theme-dark) .gram-crm-page .gram-crm-tabs--period .gram-crm-period {
  background: rgba(241, 245, 249, 0.8) !important;
  border-color: rgba(148, 163, 184, 0.28) !important;
  color: #64748b !important;
}

/* Active = spam_pm gold */
html body .gram-crm-page.gram-spam-pm-page .gram-crm-tab.is-active,
html body .gram-crm-page.gram-spam-pm-page .gram-crm-tab.active,
html body .gram-crm-page.gram-spam-pm-page .gram-crm-period.is-active,
html body .gram-crm-page.gram-spam-pm-page .gram-crm-period.active,
html body .gram-crm-page.gram-spam-pm-page .gram-gpt-pill.active,
html body .gram-crm-page.gram-spam-pm-page .gram-crm-chip.is-active,
html.theme-dark body .gram-crm-page.gram-spam-pm-page .gram-crm-tab.is-active,
html.theme-dark body .gram-crm-page.gram-spam-pm-page .gram-crm-tab.active,
html.theme-dark body .gram-crm-page.gram-spam-pm-page .gram-crm-period.is-active,
html.theme-dark body .gram-crm-page.gram-spam-pm-page .gram-crm-period.active,
html.theme-dark body .gram-crm-page.gram-spam-pm-page .gram-gpt-pill.active {
  background: linear-gradient(to bottom, #f7c948, #f5a623) !important;
  color: #1a1205 !important;
  border-color: transparent !important;
  box-shadow: 0 8px 18px rgba(245, 166, 35, 0.28) !important;
}

html body .gram-crm-page.gram-spam-pm-page .gram-crm-tab.is-active .pi,
html body .gram-crm-page.gram-spam-pm-page .gram-crm-tab.active .pi,
html body .gram-crm-page.gram-spam-pm-page .gram-gpt-pill.active .pi,
html body .gram-crm-page.gram-spam-pm-page .gram-crm-chip.is-active .pi {
  color: #1a1205 !important;
}

/* Hero / notice / CTA — spam amber */
html.theme-dark .gram-crm-page.gram-spam-pm-page .gram-spam-pm-hero {
  border: 1px solid rgba(245, 166, 35, 0.28) !important;
  background: rgba(16, 23, 38, 0.55) !important;
  box-shadow:
    0 10px 32px rgba(0, 0, 0, 0.28),
    0 0 24px rgba(245, 166, 35, 0.06) !important;
}

html.theme-dark .gram-crm-page.gram-spam-pm-page .gram-spam-pm-hero-title {
  color: #f5a623 !important;
}

.gram-crm-page.gram-spam-pm-page .gram-crm-notice-compact,
.gram-crm-page.gram-spam-pm-page .gram-gpt-notice {
  border: 1px solid rgba(245, 166, 35, 0.28) !important;
  background: rgba(245, 166, 35, 0.08) !important;
}

.gram-crm-page.gram-spam-pm-page .gram-crm-notice-compact .pi,
.gram-crm-page.gram-spam-pm-page .gram-gpt-notice .pi {
  color: #f5a623 !important;
}

.gram-crm-page.gram-spam-pm-page .gram-gpt-btn-primary {
  background: linear-gradient(to bottom, #f7c948, #f5a623) !important;
  color: #1a1205 !important;
  border-color: transparent !important;
  box-shadow: 0 8px 18px rgba(245, 166, 35, 0.28) !important;
}

.gram-crm-page.gram-spam-pm-page .gram-gpt-btn-primary .pi {
  color: #1a1205 !important;
}

/* Windows + live-stats icons like spam */
html.theme-dark .gram-crm-page.gram-ml-glass .gram-gpt-window {
  border: 1px solid rgba(245, 166, 35, 0.22) !important;
  background: rgba(16, 23, 38, 0.62) !important;
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.28),
    0 0 20px rgba(245, 166, 35, 0.05) !important;
}

html.theme-dark .gram-crm-page.gram-ml-glass .gram-gpt-window-head {
  background: linear-gradient(135deg, rgba(245, 166, 35, 0.12) 0%, rgba(15, 23, 42, 0.02) 100%) !important;
  border-bottom-color: rgba(245, 166, 35, 0.18) !important;
}

html body .gram-crm-page.gram-spam-pm-page .gram-parsing-live-stat-icon.gram-tone-cyan,
html body .gram-crm-page.gram-spam-pm-page .gram-parsing-live-stat-icon.gram-tone-blue,
html body .gram-crm-page.gram-spam-pm-page .gram-parsing-live-stat-icon.gram-tone-orange,
html body .gram-crm-page.gram-spam-pm-page .gram-parsing-live-stat-icon.gram-tone-emerald,
html body .gram-crm-page.gram-spam-pm-page .gram-parsing-live-stat-icon.gram-tone-green,
html body .gram-crm-page.gram-spam-pm-page .gram-parsing-live-stat-icon.gram-tone-violet,
html body .gram-crm-page.gram-spam-pm-page .gram-parsing-live-stat-icon.gram-tone-purple,
html body .gram-crm-page.gram-spam-pm-page .gram-parsing-live-stat-icon.gram-tone-amber,
html body .gram-crm-page.gram-spam-pm-page .gram-parsing-live-stat-icon.gram-tone-slate,
html body .gram-crm-page.gram-spam-pm-page .gram-card-icon.gram-tone-cyan,
html body .gram-crm-page.gram-spam-pm-page .gram-card-icon.gram-tone-blue,
html body .gram-crm-page.gram-spam-pm-page .gram-card-icon.gram-tone-orange,
html body .gram-crm-page.gram-spam-pm-page .gram-card-icon.gram-tone-emerald,
html body .gram-crm-page.gram-spam-pm-page .gram-card-icon.gram-tone-green,
html body .gram-crm-page.gram-spam-pm-page .gram-card-icon.gram-tone-violet,
html body .gram-crm-page.gram-spam-pm-page .gram-card-icon.gram-tone-purple,
html body .gram-crm-page.gram-spam-pm-page .gram-card-icon.gram-tone-amber {
  background: rgba(245, 166, 35, 0.16) !important;
  color: #f5a623 !important;
  box-shadow: none !important;
}

html.theme-dark .gram-crm-page .gram-parsing-live-stat {
  border-color: rgba(245, 166, 35, 0.18) !important;
  box-shadow:
    inset 0 1px 0 rgba(245, 166, 35, 0.08),
    0 22px 48px -32px rgba(2, 10, 25, 0.9) !important;
}

.gram-crm-page .gram-crm-funnel-fill {
  background: linear-gradient(90deg, #f5a623, #ffcf70) !important;
}

.gram-crm-page .gram-crm-lead-card:hover,
.gram-crm-page .gram-crm-inbox-item.is-active,
.gram-crm-page .gram-crm-inbox-toolbar {
  border-color: rgba(245, 166, 35, 0.4) !important;
}

.gram-crm-page .gram-crm-inbox-acc {
  color: #f5a623 !important;
}

/* —— CRM scroll fix (v605) —— */
.gram-crm-page .gram-crm-nav-block {
  flex-shrink: 0 !important;
}

.gram-crm-page .gram-crm-body > .gram-crm-view,
.gram-crm-page .gram-crm-body > .gram-crm-inbox-wrap,
.gram-crm-page .gram-crm-body > .gram-crm-funnel-page,
.gram-crm-page .gram-crm-body > .gram-crm-clients-page,
.gram-crm-page .gram-crm-body > .gram-crm-shell-page,
.gram-crm-page .gram-crm-body > .gram-crm-settings-page,
.gram-crm-page .gram-crm-body > .gram-crm-dash-page,
.gram-crm-page .gram-crm-body > .gram-crm-leads-page,
.gram-crm-page .gram-crm-body > .gram-crm-history-page,
.gram-crm-page .gram-crm-body > .gram-crm-replies-page {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: auto !important;
  max-height: 100% !important;
}

.gram-crm-page .gram-crm-view-main {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

.gram-crm-page .gram-crm-view-main > .gram-gpt-window,
.gram-crm-page .gram-crm-view-main > .gram-crm-spam-grid {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: auto !important;
  max-height: 100% !important;
}

.gram-crm-page .gram-crm-view .gram-crm-spam-grid {
  height: auto !important;
  max-height: 100% !important;
  min-height: 0 !important;
  flex: 1 1 auto !important;
}

.gram-crm-page .gram-crm-view .gram-crm-spam-grid > .gram-parsing-users-col {
  height: auto !important;
  max-height: 100% !important;
  min-height: 0 !important;
}

.gram-crm-page .gram-crm-view .gram-crm-spam-grid > .gram-parsing-users-col > .gram-gpt-window {
  height: auto !important;
  max-height: 100% !important;
  min-height: 0 !important;
}

html.theme-dark .gram-crm-page.gram-ml-glass .gram-gpt-window {
  height: auto !important;
  max-height: 100% !important;
  min-height: 0 !important;
}

.gram-crm-page.gram-ml-glass .gram-gpt-window-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

.gram-crm-page .gram-crm-inbox-toolbar,
.gram-crm-page #crmInboxSearch,
.gram-crm-page .gram-crm-inbox-filters {
  flex-shrink: 0 !important;
}

.gram-crm-page .gram-crm-inbox-list,
.gram-crm-page #crmInboxList {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

.gram-crm-page .gram-crm-inbox-chat {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: auto !important;
  max-height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

.gram-crm-page .gram-crm-inbox-chat-inner {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: auto !important;
  max-height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

.gram-crm-page .gram-crm-inbox-thread {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

.gram-crm-page .gram-crm-inbox-composer,
.gram-crm-page .gram-crm-inbox-chat-head,
.gram-crm-page .gram-crm-inbox-ai {
  flex-shrink: 0 !important;
}

.gram-crm-page .gram-crm-hist-list,
.gram-crm-page .gram-crm-lead-cards,
.gram-crm-page .gram-crm-board-drop,
.gram-crm-page .gram-crm-clients-table-wrap,
.gram-crm-page .gram-crm-leads-results,
.gram-crm-page .gram-crm-table-wrap {
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  min-height: 0 !important;
}

/* —— CRM unlock page scroll (v606) —— */
html body:has(.gram-crm-page.gram-spam-pm-page) .content-glass,
html body:has(.gram-crm-page.gram-spam-pm-page) .content-wrapper,
html.theme-dark body:has(.gram-crm-page.gram-spam-pm-page) .content-glass,
html.theme-dark body:has(.gram-crm-page.gram-spam-pm-page) .content-wrapper {
  overflow-x: hidden !important;
  overflow-y: auto !important;
  display: block !important;
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;
  -webkit-overflow-scrolling: touch !important;
}

html body:has(.gram-crm-page.gram-spam-pm-page) #pageContent,
html.theme-dark body:has(.gram-crm-page.gram-spam-pm-page) #pageContent {
  flex: none !important;
  display: block !important;
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

.gram-crm-page.gram-spam-pm-page {
  display: block !important;
  height: auto !important;
  max-height: none !important;
  min-height: 0 !important;
  overflow: visible !important;
}

.gram-crm-page .gram-crm-body {
  display: block !important;
  flex: none !important;
  height: auto !important;
  max-height: none !important;
  min-height: 0 !important;
  overflow: visible !important;
}

.gram-crm-page .gram-crm-body > .gram-crm-view,
.gram-crm-page .gram-crm-body > .gram-crm-inbox-wrap,
.gram-crm-page .gram-crm-body > .gram-crm-funnel-page,
.gram-crm-page .gram-crm-body > .gram-crm-clients-page,
.gram-crm-page .gram-crm-body > .gram-crm-shell-page,
.gram-crm-page .gram-crm-body > .gram-crm-settings-page,
.gram-crm-page .gram-crm-body > .gram-crm-dash-page,
.gram-crm-page .gram-crm-body > .gram-crm-leads-page,
.gram-crm-page .gram-crm-body > .gram-crm-history-page,
.gram-crm-page .gram-crm-body > .gram-crm-replies-page,
.gram-crm-page .gram-crm-view,
.gram-crm-page .gram-crm-inbox-wrap,
.gram-crm-page .gram-crm-funnel-page,
.gram-crm-page .gram-crm-clients-page,
.gram-crm-page .gram-crm-shell-page,
.gram-crm-page .gram-crm-settings-page,
.gram-crm-page .gram-crm-dash-page,
.gram-crm-page .gram-crm-leads-page,
.gram-crm-page .gram-crm-history-page,
.gram-crm-page .gram-crm-replies-page {
  display: block !important;
  flex: none !important;
  height: auto !important;
  max-height: none !important;
  min-height: 0 !important;
  overflow: visible !important;
}

.gram-crm-page .gram-crm-view-main {
  display: block !important;
  flex: none !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

.gram-crm-page .gram-crm-view-main > .gram-gpt-window,
.gram-crm-page .gram-crm-view-main > .gram-crm-spam-grid,
.gram-crm-page .gram-crm-view .gram-crm-spam-grid,
.gram-crm-page .gram-crm-view .gram-crm-spam-grid > .gram-parsing-users-col,
.gram-crm-page .gram-crm-view .gram-crm-spam-grid > .gram-parsing-users-col > .gram-gpt-window,
html.theme-dark .gram-crm-page.gram-ml-glass .gram-gpt-window {
  height: auto !important;
  max-height: none !important;
  min-height: 0 !important;
  flex: none !important;
  overflow: visible !important;
}

.gram-crm-page.gram-ml-glass .gram-gpt-window-body {
  overflow: visible !important;
  height: auto !important;
  max-height: none !important;
  flex: none !important;
  display: block !important;
}

.gram-crm-page .gram-crm-inbox,
.gram-crm-page .gram-crm-inbox-chat,
.gram-crm-page .gram-crm-inbox-chat-inner {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

.gram-crm-page .gram-crm-inbox-list,
.gram-crm-page #crmInboxList {
  max-height: min(52vh, 520px) !important;
  overflow-y: auto !important;
}

.gram-crm-page .gram-crm-inbox-thread {
  max-height: min(48vh, 480px) !important;
  overflow-y: auto !important;
}

.gram-crm-page .gram-crm-board {
  height: auto !important;
  max-height: none !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
}

.gram-crm-page .gram-crm-board-col {
  height: auto !important;
  max-height: min(60vh, 640px) !important;
}

.gram-crm-page .gram-crm-board-drop {
  max-height: min(52vh, 560px) !important;
  overflow-y: auto !important;
}

/* —— CRM lead tags (spam_pm card) —— */
.gram-crm-page .gram-crm-lead-tags,
.gram-crm-page .gram-crm-modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 2px;
}
.gram-crm-page .gram-crm-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: #0f172a;
  background: #f5a623;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

/* —— CRM stylish cards + tag editor (v609) —— */
.gram-crm-page .gram-crm-lead-cards {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
  gap: 12px !important;
}

.gram-crm-page .gram-crm-lead-card,
.gram-crm-page .gram-crm-board-card {
  position: relative !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  padding: 14px !important;
  border-radius: 16px !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: linear-gradient(160deg, rgba(24, 32, 48, 0.95), rgba(15, 23, 38, 0.88)) !important;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28) !important;
  overflow: hidden !important;
}

.gram-crm-page .gram-crm-lead-card::before,
.gram-crm-page .gram-crm-board-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--crm-accent, #f5a623);
  box-shadow: 0 0 12px color-mix(in srgb, var(--crm-accent, #f5a623) 55%, transparent);
}

.gram-crm-page .gram-crm-lead-card-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.gram-crm-page .gram-crm-lead-avatar {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  background: linear-gradient(145deg, var(--crm-accent, #f5a623), color-mix(in srgb, var(--crm-accent, #f5a623) 55%, #fff));
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.gram-crm-page .gram-crm-lead-avatar--lg {
  width: 48px;
  height: 48px;
  font-size: 14px;
  border-radius: 14px;
}

.gram-crm-page .gram-crm-lead-card-main {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gram-crm-page .gram-crm-lead-card-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.gram-crm-page .gram-crm-modal-card--pro {
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  background: linear-gradient(165deg, rgba(22, 30, 46, 0.98), rgba(12, 18, 30, 0.96)) !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45) !important;
  border-radius: 18px !important;
  overflow: hidden;
}

.gram-crm-page .gram-crm-modal-card--pro .gram-crm-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(135deg, color-mix(in srgb, var(--crm-accent, #f5a623) 16%, transparent), transparent 70%);
}

.gram-crm-page .gram-crm-modal-head-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.gram-crm-page .gram-crm-modal-head-main h3 {
  margin: 0 0 2px;
  font-size: 18px;
}

.gram-crm-page .gram-crm-tag-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 14px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(8, 12, 20, 0.35);
}

.gram-crm-page .gram-crm-tag-add-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.gram-crm-page .gram-crm-tag-add-row .gram-input {
  flex: 1 1 140px;
  min-width: 120px;
}

.gram-crm-page .gram-crm-swatches {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

.gram-crm-page .gram-crm-swatch {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.gram-crm-page .gram-crm-swatch.is-active {
  border-color: #fff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25);
}

.gram-crm-page .gram-crm-tag--edit .gram-crm-tag-x {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 0 0 2px;
  opacity: 0.85;
}

.gram-crm-page .gram-crm-tag--edit .gram-crm-tag-x:hover {
  opacity: 1;
}

/* —— CRM lead modal sheet (v610) —— */
.gram-crm-page .gram-crm-modal .gram-crm-sheet {
  width: min(560px, 100%) !important;
  max-height: min(90vh, 820px) !important;
  display: flex !important;
  flex-direction: column !important;
  border-radius: 20px !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  background:
    radial-gradient(ellipse 80% 50% at 0% 0%, color-mix(in srgb, var(--crm-accent, #f5a623) 22%, transparent), transparent 55%),
    linear-gradient(165deg, #161e2e 0%, #0c121e 100%) !important;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.5) !important;
  overflow: hidden !important;
}

.gram-crm-page .gram-crm-sheet-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.gram-crm-page .gram-crm-sheet-hero-main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.gram-crm-page .gram-crm-lead-avatar--xl {
  width: 56px !important;
  height: 56px !important;
  border-radius: 16px !important;
  font-size: 16px !important;
}

.gram-crm-page .gram-crm-sheet-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.gram-crm-page .gram-crm-sheet-title-row h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.gram-crm-page .gram-crm-sheet-sub {
  margin: 4px 0 0;
  font-size: 12px;
  color: rgba(226, 232, 240, 0.65);
}

.gram-crm-page .gram-crm-sheet-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: auto !important;
  padding: 14px 16px 12px !important;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gram-crm-page .gram-crm-sheet-meta {
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(226, 232, 240, 0.78);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.gram-crm-page .gram-crm-sheet-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.gram-crm-page .gram-crm-sheet-block {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(8, 12, 20, 0.42);
}

.gram-crm-page .gram-crm-sheet-block--wide {
  grid-column: 1 / -1;
}

.gram-crm-page .gram-crm-sheet-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.55);
}

.gram-crm-page .gram-crm-sheet-inline {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 8px;
}

.gram-crm-page .gram-crm-tag-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}

.gram-crm-page .gram-crm-tag-color-wrap {
  position: relative;
}

.gram-crm-page .gram-crm-tag-color-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background:
    linear-gradient(145deg, var(--pick, #f5a623), color-mix(in srgb, var(--pick, #f5a623) 55%, #0f172a));
  cursor: pointer;
  box-shadow: inset 0 0 0 2px rgba(15, 23, 42, 0.25);
}

.gram-crm-page .gram-crm-tag-palette {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(5, 22px);
  gap: 6px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(12, 18, 30, 0.96);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

.gram-crm-page .gram-crm-tag-palette[hidden] {
  display: none !important;
}

.gram-crm-page .gram-crm-sheet-foot {
  flex-shrink: 0;
  padding: 12px 16px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(8, 12, 20, 0.55);
}

.gram-crm-page .gram-crm-sheet-foot .gram-crm-modal-actions {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

@media (max-width: 640px) {
  .gram-crm-page .gram-crm-sheet-grid {
    grid-template-columns: 1fr;
  }
  .gram-crm-page .gram-crm-sheet-inline {
    grid-template-columns: 1fr;
  }
  .gram-crm-page .gram-crm-tag-composer {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }
}
/* —— CRM page scroll fix (v607): scroll = content-wrapper, not clipped by main-wrap —— */
html body:has(.gram-crm-page.gram-spam-pm-page) .main-wrap,
html body:has(.gram-crm-page.gram-spam-pm-page) .main-wrap.panel-background,
html.theme-dark body:has(.gram-crm-page.gram-spam-pm-page) .main-wrap,
html.theme-dark body:has(.gram-crm-page.gram-spam-pm-page) .main-wrap.panel-background {
  height: 100vh !important;
  max-height: 100vh !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}

html body:has(.gram-crm-page.gram-spam-pm-page) .content-wrapper,
html body:has(.gram-crm-page.gram-spam-pm-page) main.content-wrapper,
html.theme-dark body:has(.gram-crm-page.gram-spam-pm-page) .content-wrapper,
html.theme-dark body:has(.gram-crm-page.gram-spam-pm-page) main.content-wrapper {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  display: block !important;
}

html body:has(.gram-crm-page.gram-spam-pm-page) .content-glass,
html.theme-dark body:has(.gram-crm-page.gram-spam-pm-page) .content-glass {
  height: auto !important;
  max-height: none !important;
  min-height: 0 !important;
  overflow: visible !important;
  display: block !important;
}

html body:has(.gram-crm-page.gram-spam-pm-page) #pageContent,
html.theme-dark body:has(.gram-crm-page.gram-spam-pm-page) #pageContent {
  height: auto !important;
  max-height: none !important;
  min-height: 0 !important;
  overflow: visible !important;
  display: block !important;
  flex: none !important;
}

.gram-crm-page.gram-spam-pm-page {
  height: auto !important;
  max-height: none !important;
  min-height: 0 !important;
  overflow: visible !important;
  display: block !important;
}

.gram-crm-page .gram-crm-body,
.gram-crm-page .gram-crm-view,
.gram-crm-page .gram-crm-view-main,
.gram-crm-page .gram-crm-inbox-wrap,
.gram-crm-page .gram-crm-funnel-page,
.gram-crm-page .gram-crm-clients-page,
.gram-crm-page .gram-crm-shell-page,
.gram-crm-page .gram-crm-settings-page,
.gram-crm-page .gram-crm-dash-page,
.gram-crm-page .gram-crm-leads-page,
.gram-crm-page .gram-crm-history-page,
.gram-crm-page .gram-crm-replies-page {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  display: block !important;
  flex: none !important;
}

.gram-crm-page .gram-crm-view .gram-crm-spam-grid {
  display: grid !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

.gram-crm-page.gram-ml-glass .gram-gpt-window,
.gram-crm-page.gram-ml-glass .gram-gpt-window-body,
html.theme-dark .gram-crm-page.gram-ml-glass .gram-gpt-window {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

/* —— CRM variant C · list + right drawer (v611) —— */
.gram-crm-page.gram-crm-c {
  --crm-neon: #c8ff3d;
  --crm-neon-ink: #0b1200;
  --crm-panel: #151a22;
  --crm-panel-2: #1b222d;
}

html.theme-dark .gram-crm-page.gram-crm-c .gram-spam-pm-hero-title {
  color: var(--crm-neon) !important;
}

html body .gram-crm-page.gram-crm-c .gram-crm-tab.is-active,
html body .gram-crm-page.gram-crm-c .gram-crm-tab.active,
html body .gram-crm-page.gram-crm-c .gram-crm-period.is-active,
html body .gram-crm-page.gram-crm-c .gram-gpt-pill.active,
html.theme-dark body .gram-crm-page.gram-crm-c .gram-gpt-pill.active {
  background: var(--crm-neon) !important;
  color: var(--crm-neon-ink) !important;
  border-color: transparent !important;
  box-shadow: 0 0 18px rgba(200, 255, 61, 0.28) !important;
}

html body .gram-crm-page.gram-crm-c .gram-gpt-btn-primary {
  background: var(--crm-neon) !important;
  color: var(--crm-neon-ink) !important;
  border-color: transparent !important;
  box-shadow: 0 8px 22px rgba(200, 255, 61, 0.25) !important;
}

.gram-crm-page.gram-crm-c .gram-crm-nav-block--c {
  gap: 8px !important;
  padding: 10px 12px !important;
  border-radius: 18px !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: rgba(18, 24, 34, 0.72) !important;
}

.gram-crm-page.gram-crm-c .gram-crm-nav-secondary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.gram-crm-page.gram-crm-c .gram-crm-tabs--legacy .gram-crm-tab {
  opacity: 0.78;
}

.gram-crm-page.gram-crm-c .gram-parsing-live-stat {
  border-radius: 18px !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: linear-gradient(160deg, #1c2431, #141a24) !important;
  padding: 14px 16px !important;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28) !important;
}

.gram-crm-page.gram-crm-c .gram-crm-leads-workspace {
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(165deg, #171d28 0%, #10151e 100%);
  padding: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
}

.gram-crm-page.gram-crm-c .gram-crm-leads-toolbar-c {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.gram-crm-page.gram-crm-c .gram-crm-leads-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #f8fafc;
}

.gram-crm-page.gram-crm-c .gram-crm-leads-filters-c {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.gram-crm-page.gram-crm-c .gram-crm-lead-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gram-crm-page.gram-crm-c .gram-crm-lead-row-card {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  text-align: left;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: #1a212c;
  color: inherit;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.gram-crm-page.gram-crm-c .gram-crm-lead-row-card:hover {
  border-color: color-mix(in srgb, var(--crm-accent, var(--crm-neon)) 45%, transparent);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

.gram-crm-page.gram-crm-c .gram-crm-lead-row-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.gram-crm-page.gram-crm-c .gram-crm-lead-row-main strong {
  font-size: 14px;
  color: #f8fafc;
}

.gram-crm-page.gram-crm-c .gram-crm-lead-row-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

/* Right drawer instead of center popup */
.gram-crm-page .gram-crm-modal.gram-crm-drawer {
  justify-content: flex-end !important;
  align-items: stretch !important;
  padding: 10px !important;
  background: rgba(4, 8, 14, 0.55) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
}

.gram-crm-page .gram-crm-modal.gram-crm-drawer .gram-crm-sheet {
  width: min(440px, 100%) !important;
  max-width: 440px !important;
  height: 100% !important;
  max-height: none !important;
  margin: 0 !important;
  border-radius: 22px !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  background:
    radial-gradient(ellipse 90% 40% at 100% 0%, rgba(200, 255, 61, 0.12), transparent 55%),
    linear-gradient(180deg, #171d28 0%, #10151e 100%) !important;
  box-shadow: -18px 0 50px rgba(0, 0, 0, 0.45) !important;
}

.gram-crm-page .gram-crm-modal.gram-crm-drawer .gram-crm-sheet-hero {
  padding: 18px 18px 14px !important;
}

.gram-crm-page .gram-crm-modal.gram-crm-drawer .gram-crm-sheet-foot .gram-gpt-btn-primary {
  min-width: 140px;
}

@media (max-width: 720px) {
  .gram-crm-page .gram-crm-modal.gram-crm-drawer .gram-crm-sheet {
    width: 100% !important;
    max-width: none !important;
  }
  .gram-crm-page.gram-crm-c .gram-crm-lead-row-card {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .gram-crm-page.gram-crm-c .gram-crm-lead-row-side {
    grid-column: 2;
    flex-direction: row;
    justify-content: flex-start;
  }
}

/* —— CRM C · neon chips + drawer scroll (v611b) —— */
html body .gram-crm-page.gram-crm-c .gram-crm-chip.is-active,
html.theme-dark body .gram-crm-page.gram-crm-c .gram-crm-chip.is-active {
  background: var(--crm-neon, #c8ff3d) !important;
  color: var(--crm-neon-ink, #0b1200) !important;
  border-color: transparent !important;
  box-shadow: 0 0 14px rgba(200, 255, 61, 0.22) !important;
}

html body .gram-crm-page.gram-crm-c .gram-crm-chip.is-active .pi {
  color: var(--crm-neon-ink, #0b1200) !important;
}

.gram-crm-page .gram-crm-modal.gram-crm-drawer .gram-crm-sheet {
  display: flex !important;
  flex-direction: column !important;
}

.gram-crm-page .gram-crm-modal.gram-crm-drawer .gram-crm-sheet-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
}

.gram-crm-page.gram-crm-c .gram-crm-lead-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #0b1200;
  background: color-mix(in srgb, var(--crm-accent, var(--crm-neon, #c8ff3d)) 85%, #fff);
  box-shadow: 0 0 16px color-mix(in srgb, var(--crm-accent, #c8ff3d) 35%, transparent);
}

/* —— CRM Overview + split leads (v613) · like ref dashboards —— */
.gram-crm-page.gram-crm-c .gram-crm-breadcrumb {
  margin: 0 0 4px;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(248, 250, 252, 0.45);
}

.gram-crm-page.gram-crm-c .gram-crm-kpi-row {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.gram-crm-page.gram-crm-c .gram-crm-kpi {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  min-height: 112px;
  padding: 18px 18px 16px;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28);
}

.gram-crm-page.gram-crm-c .gram-crm-kpi-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  opacity: 0.85;
  margin-bottom: 6px;
}

.gram-crm-page.gram-crm-c .gram-crm-kpi-value {
  display: block;
  font-size: 28px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.gram-crm-page.gram-crm-c .gram-crm-kpi-trend {
  display: inline-block;
  margin-top: 8px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.18);
}

.gram-crm-page.gram-crm-c .gram-crm-kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: rgba(0, 0, 0, 0.16);
}

.gram-crm-page.gram-crm-c .gram-crm-kpi--teal {
  background: linear-gradient(145deg, #2de2c5, #12b8a8);
  color: #06241f;
}
.gram-crm-page.gram-crm-c .gram-crm-kpi--yellow {
  background: linear-gradient(145deg, #ffe566, #f5c518);
  color: #2a2100;
}
.gram-crm-page.gram-crm-c .gram-crm-kpi--pink {
  background: linear-gradient(145deg, #f0a3ff, #d48cff);
  color: #2a0a33;
}
.gram-crm-page.gram-crm-c .gram-crm-kpi--lime {
  background: linear-gradient(145deg, #d8ff5c, #c8ff3d);
  color: #142000;
}

.gram-crm-page.gram-crm-c .gram-crm-overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  gap: 16px;
  align-items: start;
}

.gram-crm-page.gram-crm-c .gram-crm-overview-mid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(220px, 0.9fr);
  gap: 14px;
  margin-bottom: 14px;
}

.gram-crm-page.gram-crm-c .gram-crm-overview-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.gram-crm-page.gram-crm-c .gram-crm-panel {
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(165deg, #1a212c 0%, #121820 100%);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
  padding: 16px;
}

.gram-crm-page.gram-crm-c .gram-crm-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.gram-crm-page.gram-crm-c .gram-crm-panel-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #f8fafc;
}

.gram-crm-page.gram-crm-c .gram-crm-donut-wrap {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.gram-crm-page.gram-crm-c .gram-crm-donut {
  position: relative;
  width: 150px;
  height: 150px;
}

.gram-crm-page.gram-crm-c .gram-crm-donut svg {
  width: 100%;
  height: 100%;
}

.gram-crm-page.gram-crm-c .gram-crm-donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.gram-crm-page.gram-crm-c .gram-crm-donut-center strong {
  font-size: 22px;
  color: #f8fafc;
}

.gram-crm-page.gram-crm-c .gram-crm-donut-center span {
  font-size: 11px;
  color: rgba(248, 250, 252, 0.55);
}

.gram-crm-page.gram-crm-c .gram-crm-donut-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gram-crm-page.gram-crm-c .gram-crm-donut-legend li {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: rgba(248, 250, 252, 0.78);
}

.gram-crm-page.gram-crm-c .gram-crm-donut-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.gram-crm-page.gram-crm-c .gram-crm-stage-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 140px;
  padding: 8px 4px 0;
}

.gram-crm-page.gram-crm-c .gram-crm-stage-bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  justify-content: flex-end;
}

.gram-crm-page.gram-crm-c .gram-crm-stage-bar-fill {
  width: 100%;
  max-width: 28px;
  border-radius: 999px;
  min-height: 8px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
}

.gram-crm-page.gram-crm-c .gram-crm-stage-bar span {
  font-size: 10px;
  color: rgba(248, 250, 252, 0.5);
}

.gram-crm-page.gram-crm-c .gram-crm-progress-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gram-crm-page.gram-crm-c .gram-crm-progress-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: rgba(248, 250, 252, 0.7);
}

.gram-crm-page.gram-crm-c .gram-crm-progress-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.gram-crm-page.gram-crm-c .gram-crm-progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #a78bfa, #60a5fa);
}

.gram-crm-page.gram-crm-c .gram-crm-progress-track--alt i {
  background: linear-gradient(90deg, #c8ff3d, #22c55e);
}

.gram-crm-page.gram-crm-c .gram-crm-overview-table td,
.gram-crm-page.gram-crm-c .gram-crm-overview-table th {
  padding: 10px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 13px;
}

.gram-crm-page.gram-crm-c .gram-crm-overview-table tr.gram-crm-lead-row {
  cursor: pointer;
}

.gram-crm-page.gram-crm-c .gram-crm-overview-table tr.gram-crm-lead-row:hover {
  background: rgba(200, 255, 61, 0.06);
}

.gram-crm-page.gram-crm-c .gram-crm-overview-rail {
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: 12px;
}

.gram-crm-page.gram-crm-c .gram-crm-rail-feed {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 320px;
  overflow: auto;
}

.gram-crm-page.gram-crm-c .gram-crm-rail-item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.gram-crm-page.gram-crm-c .gram-crm-rail-dot {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(200, 255, 61, 0.16);
  color: #c8ff3d;
}

.gram-crm-page.gram-crm-c .gram-crm-rail-item strong {
  display: block;
  font-size: 13px;
  color: #f8fafc;
}

.gram-crm-page.gram-crm-c .gram-crm-rail-item p {
  margin: 2px 0;
  font-size: 12px;
  color: rgba(248, 250, 252, 0.6);
}

.gram-crm-page.gram-crm-c .gram-crm-rail-item time {
  font-size: 11px;
  color: rgba(248, 250, 252, 0.4);
}

.gram-crm-page.gram-crm-c .gram-crm-rail-stats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gram-crm-page.gram-crm-c .gram-crm-rail-stats li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  color: rgba(248, 250, 252, 0.7);
}

.gram-crm-page.gram-crm-c .gram-crm-rail-stats em {
  font-style: normal;
  color: #c8ff3d;
  font-weight: 700;
  font-size: 12px;
}

/* Leads split: list + persistent right card */
.gram-crm-page.gram-crm-c .gram-crm-leads-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
  gap: 16px;
  align-items: stretch;
}

.gram-crm-page.gram-crm-c .gram-crm-leads-side {
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  padding: 0 !important;
  overflow: hidden;
}

.gram-crm-page.gram-crm-c .gram-crm-leads-side .gram-crm-sheet--panel {
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  max-height: none !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 22px !important;
  box-shadow: none !important;
  background: transparent !important;
}

.gram-crm-page.gram-crm-c .gram-crm-side-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 420px;
  padding: 24px;
  text-align: center;
  color: rgba(248, 250, 252, 0.55);
}

.gram-crm-page.gram-crm-c .gram-crm-side-empty .pi {
  font-size: 28px;
  color: var(--crm-neon, #c8ff3d);
}

.gram-crm-page.gram-crm-c .gram-crm-lead-row-card.is-selected {
  border-color: rgba(200, 255, 61, 0.55) !important;
  box-shadow: 0 0 0 1px rgba(200, 255, 61, 0.35), 0 12px 28px rgba(0, 0, 0, 0.3) !important;
  background: linear-gradient(160deg, #222a38, #171d28) !important;
}

.gram-crm-page.gram-crm-c .gram-crm-lead-avatar--sm {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  font-size: 11px;
}

@media (max-width: 1100px) {
  .gram-crm-page.gram-crm-c .gram-crm-overview,
  .gram-crm-page.gram-crm-c .gram-crm-leads-split,
  .gram-crm-page.gram-crm-c .gram-crm-overview-mid {
    grid-template-columns: 1fr;
  }
  .gram-crm-page.gram-crm-c .gram-crm-overview-rail,
  .gram-crm-page.gram-crm-c .gram-crm-leads-side {
    position: static;
    max-height: none;
  }
  .gram-crm-page.gram-crm-c .gram-crm-kpi-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .gram-crm-page.gram-crm-c .gram-crm-kpi-row,
  .gram-crm-page.gram-crm-c .gram-crm-donut-wrap {
    grid-template-columns: 1fr;
  }
}

.gram-crm-page.gram-crm-c .gram-crm-leads-side .gram-crm-sheet--panel {
  display: flex !important;
  flex-direction: column !important;
}
.gram-crm-page.gram-crm-c .gram-crm-leads-side .gram-crm-sheet-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
}
.gram-crm-page.gram-crm-c .gram-crm-leads-side .gram-crm-sheet-foot {
  flex: 0 0 auto;
}

/* —— CRM tabs skin unify (v615) —— */
.gram-crm-page.gram-crm-c .gram-crm-tab-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.gram-crm-page.gram-crm-c .gram-crm-split-2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.gram-crm-page.gram-crm-c .gram-crm-panel-body {
  min-width: 0;
}

.gram-crm-page.gram-crm-c .gram-crm-panel--toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.gram-crm-page.gram-crm-c .gram-crm-leads-workspace.gram-crm-panel {
  padding: 16px;
}

.gram-crm-page.gram-crm-c .gram-crm-board-col {
  border-radius: 18px !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: linear-gradient(165deg, #1a212c 0%, #121820 100%) !important;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22) !important;
  padding: 10px !important;
}

.gram-crm-page.gram-crm-c .gram-crm-board-col-head {
  border-radius: 12px;
  padding: 8px 10px;
  background: rgba(200, 255, 61, 0.06);
}

.gram-crm-page.gram-crm-c .gram-crm-inbox-item {
  border-radius: 14px !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  background: #171d28 !important;
  margin-bottom: 8px;
}

.gram-crm-page.gram-crm-c .gram-crm-inbox-item.is-active {
  border-color: rgba(200, 255, 61, 0.45) !important;
  box-shadow: 0 0 0 1px rgba(200, 255, 61, 0.28), 0 10px 24px rgba(0, 0, 0, 0.28) !important;
}

.gram-crm-page.gram-crm-c .gram-crm-inbox-chat,
.gram-crm-page.gram-crm-c .gram-crm-inbox-list {
  min-height: 420px;
}

.gram-crm-page.gram-crm-c .gram-crm-hist-row {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: #171d28;
  padding: 12px 14px;
  margin-bottom: 8px;
}

.gram-crm-page.gram-crm-c .gram-crm-settings-inner {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 14px;
}

.gram-crm-page.gram-crm-c .gram-crm-settings-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gram-crm-page.gram-crm-c .gram-crm-settings-link {
  text-align: left;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: #171d28;
  color: rgba(248, 250, 252, 0.75);
  padding: 10px 12px;
  cursor: pointer;
}

.gram-crm-page.gram-crm-c .gram-crm-settings-link.is-active {
  background: var(--crm-neon, #c8ff3d);
  color: var(--crm-neon-ink, #0b1200);
  border-color: transparent;
  font-weight: 700;
}

.gram-crm-page.gram-crm-c .gram-crm-cal-cell.is-today {
  background: rgba(200, 255, 61, 0.2) !important;
  box-shadow: 0 0 0 1px rgba(200, 255, 61, 0.45);
}

.gram-crm-page.gram-crm-c .gram-crm-reply-acc,
.gram-crm-page.gram-crm-c .gram-crm-reply-user-card {
  border-radius: 16px !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: #171d28 !important;
}

@media (max-width: 1100px) {
  .gram-crm-page.gram-crm-c .gram-crm-split-2,
  .gram-crm-page.gram-crm-c .gram-crm-settings-inner {
    grid-template-columns: 1fr;
  }
}

/* —— CRM unique tab layouts (v616) —— */
.gram-crm-page.gram-crm-c .gram-crm-section-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(165deg, #1a212c, #121820);
}

.gram-crm-page.gram-crm-c .gram-crm-section-bar-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.gram-crm-page.gram-crm-c .gram-crm-section-ico {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(200, 255, 61, 0.14);
  color: var(--crm-neon, #c8ff3d);
  flex: 0 0 auto;
}

.gram-crm-page.gram-crm-c .gram-crm-section-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #f8fafc;
}

.gram-crm-page.gram-crm-c .gram-crm-section-bar-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.gram-crm-page.gram-crm-c .gram-crm-section-body {
  margin-top: 12px;
}

/* Messenger inbox */
.gram-crm-page.gram-crm-c .gram-crm-messenger {
  gap: 10px;
  min-height: calc(100vh - 220px);
}

.gram-crm-page.gram-crm-c .gram-crm-messenger-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #151b24;
}

.gram-crm-page.gram-crm-c .gram-crm-messenger-meta {
  margin-left: auto;
  font-size: 12px;
  color: rgba(248, 250, 252, 0.55);
}

.gram-crm-page.gram-crm-c .gram-crm-messenger-grid {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 12px;
  flex: 1;
  min-height: 520px;
}

.gram-crm-page.gram-crm-c .gram-crm-messenger-list-pane,
.gram-crm-page.gram-crm-c .gram-crm-messenger-chat-pane {
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(165deg, #1a212c, #121820);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.gram-crm-page.gram-crm-c .gram-crm-messenger-list-pane {
  padding: 12px;
  gap: 8px;
}

.gram-crm-page.gram-crm-c .gram-crm-messenger-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gram-crm-page.gram-crm-c .gram-crm-messenger-chat-pane .gram-crm-inbox-chat {
  flex: 1;
  min-height: 0;
  height: 100%;
}

.gram-crm-page.gram-crm-c .gram-crm-inbox-list {
  flex: 1;
  overflow: auto;
  min-height: 0;
}

/* Kanban funnel / tasks */
.gram-crm-page.gram-crm-c .gram-crm-kanban-page {
  gap: 12px;
}

.gram-crm-page.gram-crm-c .gram-crm-kanban-board {
  overflow-x: auto;
  padding-bottom: 8px;
}

.gram-crm-page.gram-crm-c .gram-crm-kanban-board .gram-crm-board {
  min-height: 520px;
}

/* Clients dense table */
.gram-crm-page.gram-crm-c .gram-crm-table-shell {
  margin-top: 12px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(165deg, #1a212c, #121820);
  padding: 14px;
}

.gram-crm-page.gram-crm-c .gram-crm-dense-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(248, 250, 252, 0.45);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.gram-crm-page.gram-crm-c .gram-crm-dense-table td {
  padding: 11px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 13px;
}

.gram-crm-page.gram-crm-c .gram-crm-dense-table tr.gram-crm-lead-row:hover {
  background: rgba(200, 255, 61, 0.05);
}

/* Leads split without KPI bloat */
.gram-crm-page.gram-crm-c .gram-crm-leads-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
  gap: 14px;
  align-items: start;
}

.gram-crm-page.gram-crm-c .gram-crm-leads-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.gram-crm-page.gram-crm-c .gram-crm-leads-side {
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(165deg, #1a212c, #121820);
  min-height: 520px;
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 120px);
  overflow: hidden;
}

.gram-crm-page.gram-crm-c .gram-crm-leads-results {
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: #141a22;
  padding: 10px;
  max-height: calc(100vh - 280px);
  overflow: auto;
}

/* Timeline history */
.gram-crm-page.gram-crm-c .gram-crm-timeline-page {
  gap: 12px;
}

.gram-crm-page.gram-crm-c .gram-crm-timeline {
  position: relative;
  padding-left: 8px;
}

.gram-crm-page.gram-crm-c .gram-crm-timeline .gram-crm-hist-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 12px;
  position: relative;
  margin-left: 12px;
  border-left: 2px solid rgba(200, 255, 61, 0.25);
  border-radius: 0 14px 14px 0;
  padding-left: 16px;
}

.gram-crm-page.gram-crm-c .gram-crm-timeline .gram-crm-hist-row::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 18px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--crm-neon, #c8ff3d);
  box-shadow: 0 0 10px rgba(200, 255, 61, 0.45);
}

/* Calendar */
.gram-crm-page.gram-crm-c .gram-crm-cal-shell {
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(165deg, #1a212c, #121820);
  padding: 16px;
}

.gram-crm-page.gram-crm-c .gram-crm-cal-grid {
  min-height: 420px;
}

/* Employees */
.gram-crm-page.gram-crm-c .gram-crm-emp-layout {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
  gap: 14px;
}

.gram-crm-page.gram-crm-c .gram-crm-emp-card {
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(165deg, #1a212c, #121820);
  padding: 16px;
}

.gram-crm-page.gram-crm-c .gram-crm-emp-card h4 {
  margin: 0 0 8px;
  color: #f8fafc;
}

/* Replies console */
.gram-crm-page.gram-crm-c .gram-crm-console-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12px;
  color: rgba(248, 250, 252, 0.6);
}

.gram-crm-page.gram-crm-c .gram-crm-console-top {
  display: grid;
  grid-template-columns: minmax(200px, 260px) minmax(220px, 320px) minmax(0, 1fr);
  gap: 12px;
}

.gram-crm-page.gram-crm-c .gram-crm-console-accounts,
.gram-crm-page.gram-crm-c .gram-crm-console-controls,
.gram-crm-page.gram-crm-c .gram-crm-console-log-wrap,
.gram-crm-page.gram-crm-c .gram-crm-console-results {
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(165deg, #1a212c, #121820);
  padding: 12px;
}

.gram-crm-page.gram-crm-c .gram-crm-console-log-label {
  font-size: 12px;
  color: rgba(248, 250, 252, 0.5);
  margin-bottom: 6px;
}

.gram-crm-page.gram-crm-c .gram-crm-console-results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.gram-crm-page.gram-crm-c .gram-crm-settings-main {
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #171d28;
  padding: 16px;
}

@media (max-width: 1100px) {
  .gram-crm-page.gram-crm-c .gram-crm-messenger-grid,
  .gram-crm-page.gram-crm-c .gram-crm-leads-split,
  .gram-crm-page.gram-crm-c .gram-crm-emp-layout,
  .gram-crm-page.gram-crm-c .gram-crm-console-top {
    grid-template-columns: 1fr;
  }
  .gram-crm-page.gram-crm-c .gram-crm-leads-side {
    position: static;
    max-height: none;
  }
}

/* —— CRM polish to Overview quality (v617) —— */

/* Shared glass depth like overview panels */
.gram-crm-page.gram-crm-c .gram-crm-section-bar {
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28) !important;
  background:
    radial-gradient(ellipse 80% 60% at 0% 0%, rgba(200, 255, 61, 0.08), transparent 50%),
    linear-gradient(165deg, #1c2431, #121820) !important;
}

.gram-crm-page.gram-crm-c .gram-crm-section-ico {
  box-shadow: 0 0 18px rgba(200, 255, 61, 0.22);
}

/* Leads list rows = overview customer density */
.gram-crm-page.gram-crm-c .gram-crm-lead-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gram-crm-page.gram-crm-c .gram-crm-lead-row-card {
  width: 100%;
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) auto !important;
  gap: 12px !important;
  align-items: center !important;
  text-align: left !important;
  padding: 14px 16px !important;
  border-radius: 18px !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  background:
    linear-gradient(160deg, rgba(28, 36, 49, 0.98), rgba(16, 21, 30, 0.95)) !important;
  color: inherit !important;
  cursor: pointer !important;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.26) !important;
  position: relative;
  overflow: hidden;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.gram-crm-page.gram-crm-c .gram-crm-lead-row-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--crm-accent, #c8ff3d);
  box-shadow: 0 0 14px color-mix(in srgb, var(--crm-accent, #c8ff3d) 50%, transparent);
}

.gram-crm-page.gram-crm-c .gram-crm-lead-row-card:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--crm-accent, #c8ff3d) 40%, transparent) !important;
}

.gram-crm-page.gram-crm-c .gram-crm-lead-row-card.is-selected {
  border-color: rgba(200, 255, 61, 0.55) !important;
  box-shadow: 0 0 0 1px rgba(200, 255, 61, 0.28), 0 16px 36px rgba(0, 0, 0, 0.35) !important;
  background: linear-gradient(160deg, #243044, #171d28) !important;
}

.gram-crm-page.gram-crm-c .gram-crm-lead-avatar {
  width: 44px !important;
  height: 44px !important;
  border-radius: 14px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  color: #0b1200 !important;
  background: color-mix(in srgb, var(--crm-accent, #c8ff3d) 88%, #fff) !important;
  box-shadow: 0 0 18px color-mix(in srgb, var(--crm-accent, #c8ff3d) 35%, transparent) !important;
}

.gram-crm-page.gram-crm-c .gram-crm-lead-avatar--sm {
  width: 34px !important;
  height: 34px !important;
  border-radius: 11px !important;
  font-size: 11px !important;
}

.gram-crm-page.gram-crm-c .gram-crm-lead-avatar--xl {
  width: 56px !important;
  height: 56px !important;
  border-radius: 16px !important;
  font-size: 16px !important;
}

.gram-crm-page.gram-crm-c .gram-crm-leads-side {
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.35) !important;
  background:
    radial-gradient(ellipse 90% 40% at 100% 0%, rgba(200, 255, 61, 0.1), transparent 55%),
    linear-gradient(180deg, #1a212c 0%, #10151e 100%) !important;
}

.gram-crm-page.gram-crm-c .gram-crm-side-empty {
  min-height: 480px;
  gap: 12px;
}

.gram-crm-page.gram-crm-c .gram-crm-side-empty-ico {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(200, 255, 61, 0.14);
  color: #c8ff3d;
  font-size: 28px;
  box-shadow: 0 0 24px rgba(200, 255, 61, 0.2);
}

.gram-crm-page.gram-crm-c .gram-crm-leads-side .gram-crm-sheet--panel {
  background: transparent !important;
}

.gram-crm-page.gram-crm-c .gram-crm-leads-side .gram-crm-sheet-hero {
  padding: 18px 16px 12px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.gram-crm-page.gram-crm-c .gram-crm-leads-side .gram-crm-sheet-block {
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  padding: 10px 12px;
  margin-bottom: 10px;
}

.gram-crm-page.gram-crm-c .gram-crm-leads-filters-c {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(18, 24, 34, 0.7);
}

/* Messenger = Overview glass */
.gram-crm-page.gram-crm-c .gram-crm-messenger-bar {
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
  background:
    radial-gradient(ellipse 70% 80% at 0% 50%, rgba(200, 255, 61, 0.07), transparent 55%),
    #151b24 !important;
}

.gram-crm-page.gram-crm-c .gram-crm-messenger-list-pane,
.gram-crm-page.gram-crm-c .gram-crm-messenger-chat-pane {
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3) !important;
  min-height: 560px !important;
}

.gram-crm-page.gram-crm-c .gram-crm-inbox-item {
  padding: 12px !important;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

.gram-crm-page.gram-crm-c .gram-crm-inbox-avatar {
  width: 42px !important;
  height: 42px !important;
  border-radius: 14px !important;
  background: linear-gradient(145deg, #c8ff3d, #84cc16) !important;
  color: #0b1200 !important;
  font-weight: 800 !important;
  box-shadow: 0 0 16px rgba(200, 255, 61, 0.25);
}

.gram-crm-page.gram-crm-c .gram-crm-inbox-avatar--lg {
  width: 48px !important;
  height: 48px !important;
}

.gram-crm-page.gram-crm-c .gram-crm-inbox-chat-head {
  padding: 14px 16px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.02);
}

.gram-crm-page.gram-crm-c .gram-crm-inbox-thread {
  padding: 16px !important;
  background:
    radial-gradient(ellipse 60% 40% at 50% 0%, rgba(200, 255, 61, 0.04), transparent 60%),
    #0f141c;
}

.gram-crm-page.gram-crm-c .gram-crm-inbox-bubble {
  border-radius: 16px !important;
  padding: 10px 12px !important;
  max-width: 78%;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
}

.gram-crm-page.gram-crm-c .gram-crm-inbox-bubble--in {
  background: #1c2431 !important;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.gram-crm-page.gram-crm-c .gram-crm-inbox-bubble--out {
  background: linear-gradient(145deg, rgba(200, 255, 61, 0.22), rgba(200, 255, 61, 0.1)) !important;
  border: 1px solid rgba(200, 255, 61, 0.28);
  margin-left: auto;
}

.gram-crm-page.gram-crm-c .gram-crm-inbox-composer {
  display: flex;
  gap: 8px;
  padding: 12px 14px !important;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  background: #151b24;
}

.gram-crm-page.gram-crm-c .gram-crm-inbox-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 420px;
  color: rgba(248, 250, 252, 0.55);
}

.gram-crm-page.gram-crm-c .gram-crm-inbox-empty .pi {
  font-size: 36px;
  color: #c8ff3d;
}

/* Kanban columns like overview cards */
.gram-crm-page.gram-crm-c .gram-crm-board {
  display: flex !important;
  gap: 12px !important;
  align-items: stretch !important;
  padding: 4px 2px 12px !important;
}

.gram-crm-page.gram-crm-c .gram-crm-board-col {
  flex: 0 0 260px !important;
  min-width: 240px !important;
  border-radius: 20px !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: linear-gradient(165deg, #1c2431, #121820) !important;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.28) !important;
  padding: 10px !important;
  display: flex !important;
  flex-direction: column !important;
  max-height: min(70vh, 720px) !important;
}

.gram-crm-page.gram-crm-c .gram-crm-board-col-head {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  border-radius: 14px !important;
  padding: 10px 12px !important;
  margin-bottom: 10px !important;
  background: color-mix(in srgb, var(--stage-accent, #c8ff3d) 16%, transparent) !important;
  border: 1px solid color-mix(in srgb, var(--stage-accent, #c8ff3d) 28%, transparent);
}

.gram-crm-page.gram-crm-c .gram-crm-board-col-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: #f8fafc;
}

.gram-crm-page.gram-crm-c .gram-crm-board-col-count {
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: #0b1200;
  background: var(--stage-accent, #c8ff3d);
}

.gram-crm-page.gram-crm-c .gram-crm-board-drop {
  flex: 1 !important;
  overflow-y: auto !important;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 120px;
}

.gram-crm-page.gram-crm-c .gram-crm-board-card {
  border-radius: 16px !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: linear-gradient(160deg, #222a38, #171d28) !important;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22) !important;
  padding: 12px !important;
  position: relative;
  overflow: hidden;
}

.gram-crm-page.gram-crm-c .gram-crm-board-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--crm-accent, var(--stage-accent, #c8ff3d));
}

/* Clients dense premium table */
.gram-crm-page.gram-crm-c .gram-crm-table-shell {
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3) !important;
}

.gram-crm-page.gram-crm-c .gram-crm-client-cell {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.gram-crm-page.gram-crm-c .gram-crm-dense-table tbody tr {
  transition: background 0.12s ease;
}

.gram-crm-page.gram-crm-c .gram-crm-dense-table .gram-crm-stage {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

/* Timeline = overview notifications */
.gram-crm-page.gram-crm-c .gram-crm-timeline {
  padding: 8px 4px 8px 0;
}

.gram-crm-page.gram-crm-c .gram-crm-timeline .gram-crm-hist-row.gram-crm-rail-item {
  display: grid !important;
  grid-template-columns: 40px minmax(0, 1fr) !important;
  gap: 12px !important;
  margin: 0 0 10px !important;
  margin-left: 0 !important;
  border-left: 0 !important;
  border-radius: 16px !important;
  padding: 14px !important;
  border: 1px solid rgba(255, 255, 255, 0.07) !important;
  background: linear-gradient(160deg, #1c2431, #141a24) !important;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.gram-crm-page.gram-crm-c .gram-crm-timeline .gram-crm-hist-row::before {
  display: none !important;
}

.gram-crm-page.gram-crm-c .gram-crm-hist-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.gram-crm-page.gram-crm-c .gram-crm-hist-top time {
  font-size: 11px;
  color: rgba(248, 250, 252, 0.4);
}

/* Console replies */
.gram-crm-page.gram-crm-c .gram-crm-console-accounts,
.gram-crm-page.gram-crm-c .gram-crm-console-controls,
.gram-crm-page.gram-crm-c .gram-crm-console-log-wrap,
.gram-crm-page.gram-crm-c .gram-crm-console-results {
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28) !important;
}

.gram-crm-page.gram-crm-c .gram-crm-replies-log {
  min-height: 140px;
  max-height: 220px;
  border-radius: 12px;
  background: #0c1016 !important;
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 10px;
  color: #a7f3d0;
  font-size: 12px;
}

.gram-crm-page.gram-crm-c .gram-crm-reply-user-card {
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.2) !important;
  padding: 12px !important;
}

/* Calendar / emp / settings depth */
.gram-crm-page.gram-crm-c .gram-crm-cal-shell,
.gram-crm-page.gram-crm-c .gram-crm-emp-card,
.gram-crm-page.gram-crm-c .gram-crm-settings-main,
.gram-crm-page.gram-crm-c .gram-crm-settings-nav {
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.26);
}

.gram-crm-page.gram-crm-c .gram-crm-cal-cell {
  border-radius: 14px !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  background: #171d28 !important;
  min-height: 64px;
}

.gram-crm-page.gram-crm-c .gram-crm-cal-cell.is-today {
  background: rgba(200, 255, 61, 0.18) !important;
  border-color: rgba(200, 255, 61, 0.45) !important;
  box-shadow: 0 0 18px rgba(200, 255, 61, 0.2);
}

.gram-crm-page.gram-crm-c .gram-crm-cal-cell:not(.is-empty):hover {
  border-color: rgba(200, 255, 61, 0.35) !important;
}

/* —— CRM workspace chrome visible (v20260906c) —— */
.gram-crm-page.gram-crm-c[data-crm-build="20260906c"] .gram-crm-ws {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
}

.gram-crm-page.gram-crm-c .gram-crm-ws-grid {
  display: grid !important;
  gap: 14px !important;
  align-items: stretch !important;
  min-height: 560px !important;
}

.gram-crm-page.gram-crm-c .gram-crm-ws-grid--leads {
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.9fr) !important;
}

.gram-crm-page.gram-crm-c .gram-crm-ws-grid--messenger {
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr) !important;
  flex: 1 1 auto !important;
  min-height: 620px !important;
}

.gram-crm-page.gram-crm-c .gram-crm-ws-pane {
  position: relative !important;
  border-radius: 20px !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  background:
    radial-gradient(ellipse 80% 50% at 0% 0%, rgba(200, 255, 61, 0.08), transparent 55%),
    linear-gradient(165deg, #1c2431 0%, #10151e 100%) !important;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34) !important;
  padding: 14px !important;
  min-width: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
}

.gram-crm-page.gram-crm-c .gram-crm-ws-pane-label {
  align-self: flex-start !important;
  font-size: 10px !important;
  font-weight: 800 !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase !important;
  color: #0b1200 !important;
  background: var(--crm-neon, #c8ff3d) !important;
  border-radius: 999px !important;
  padding: 4px 10px !important;
  box-shadow: 0 0 16px rgba(200, 255, 61, 0.35) !important;
}

.gram-crm-page.gram-crm-c .gram-crm-ws-pane--detail {
  position: sticky !important;
  top: 10px !important;
  max-height: calc(100vh - 110px) !important;
  overflow: hidden !important;
}

.gram-crm-page.gram-crm-c .gram-crm-leads-side-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: auto !important;
}

.gram-crm-page.gram-crm-c .gram-crm-funnel-strip {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
}

.gram-crm-page.gram-crm-c .gram-crm-funnel-chip {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 8px 12px !important;
  border-radius: 999px !important;
  border: 1px solid color-mix(in srgb, var(--stage-accent, #c8ff3d) 45%, transparent) !important;
  background: color-mix(in srgb, var(--stage-accent, #c8ff3d) 18%, #121820) !important;
  color: #f8fafc !important;
  font-size: 12px !important;
  font-weight: 600 !important;
}

.gram-crm-page.gram-crm-c .gram-crm-funnel-chip b {
  color: var(--stage-accent, #c8ff3d) !important;
  font-size: 14px !important;
}

.gram-crm-page.gram-crm-c .gram-crm-clients-head {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin-bottom: 4px !important;
}

.gram-crm-page.gram-crm-c .gram-crm-clients-head h3 {
  margin: 0 !important;
  font-size: 18px !important;
  color: #f8fafc !important;
}

.gram-crm-page.gram-crm-c .gram-crm-leads-split {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
}

@media (max-width: 1100px) {
  .gram-crm-page.gram-crm-c .gram-crm-ws-grid--leads,
  .gram-crm-page.gram-crm-c .gram-crm-ws-grid--messenger {
    grid-template-columns: 1fr !important;
  }
  .gram-crm-page.gram-crm-c .gram-crm-ws-pane--detail {
    position: static !important;
    max-height: none !important;
  }
}
