:root {
  --bg: #0b0f14;
  --bg-2: #121820;
  --bg-3: #1a222d;
  --border: #2a3544;
  --text: #e6edf3;
  --muted: #8b9cb3;
  --accent: #3dd6c6;
  --accent-dim: #2aa89b;
  --danger: #f85149;
  --warn: #d29922;
  --radius: 12px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

.hidden { display: none !important; }

.muted { color: var(--muted); font-size: 0.9rem; }
.error { color: var(--danger); margin-top: 0.75rem; font-size: 0.9rem; }

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent);
}

.logo-large { font-size: 2rem; text-align: center; margin-bottom: 0.5rem; }
.logo-mark { opacity: 0.7; margin-right: 0.25rem; }

.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 30% 20%, #152028 0%, var(--bg) 60%);
}

.login-card-wrap {
  position: relative;
  width: min(360px, 92vw);
}

.login-card {
  position: relative;
  z-index: 2;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 2rem 1.75rem;
  width: 100%;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: center;
}

.login-peek {
  position: absolute;
  left: 50%;
  right: auto;
  top: 0;
  width: 15rem;
  height: auto;
  transform: translate(-50%, -42%);
  z-index: 1;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.45));
  transition: transform 0.35s ease;
}

.login-card-wrap:focus-within .login-peek {
  transform: translate(-50%, -54%) scale(1.12);
}

.login-peek-bubble {
  position: absolute;
  top: -6.25rem;
  left: max(0px, calc(50% - 11rem));
  z-index: 3;
  opacity: 0;
  transform: scale(0.7) translateY(10px);
  transform-origin: bottom right;
  transition: opacity 0.25s ease, transform 0.35s cubic-bezier(0.34, 1.4, 0.64, 1);
  pointer-events: none;
}

.login-card-wrap:focus-within .login-peek-bubble {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.login-peek-bubble-text {
  position: relative;
  display: inline-block;
  background: #fff;
  color: #111;
  border: 3px solid #111;
  border-radius: 999px;
  padding: 0.55rem 1rem;
  font-weight: 800;
  font-size: 0.92rem;
  line-height: 1.15;
  white-space: nowrap;
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.28);
  letter-spacing: 0.01em;
}

.login-peek-bubble-text::before {
  content: "";
  position: absolute;
  bottom: -11px;
  right: 22px;
  width: 14px;
  height: 14px;
  background: #fff;
  border-right: 3px solid #111;
  border-bottom: 3px solid #111;
  transform: rotate(45deg);
  box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.12);
}

.login-peek-bubble-text::after {
  content: "";
  position: absolute;
  bottom: -22px;
  right: 10px;
  width: 10px;
  height: 10px;
  background: #fff;
  border: 3px solid #111;
  border-radius: 50%;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.18);
}

.login-card .muted {
  margin: 0;
  font-size: 0.9rem;
}

.login-card input {
  width: 100%;
  margin: 1.25rem 0 1rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  text-align: left;
}

.login-card #login-btn {
  width: 100%;
  padding: 0.8rem 1rem;
  font-size: 0.95rem;
}

.login-card .error {
  margin: 0.75rem 0 0;
  text-align: center;
}

.login-screen.login-alarm-active::after {
  content: "🚨 АЛАРМ";
  position: fixed;
  top: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  padding: 0.5rem 1.25rem;
  border-radius: 999px;
  background: rgba(220, 38, 38, 0.92);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  box-shadow: 0 0 24px rgba(255, 0, 0, 0.55);
  animation: login-alarm-badge 0.55s ease-in-out infinite;
  pointer-events: none;
}

.login-screen.login-alarm-active::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
  animation: login-alarm-flash 0.55s ease-in-out infinite;
}

@keyframes login-alarm-flash {
  0%, 100% { background: rgba(255, 0, 0, 0.06); box-shadow: inset 0 0 60px rgba(255, 0, 0, 0.15); }
  50% { background: rgba(255, 0, 0, 0.22); box-shadow: inset 0 0 120px rgba(255, 0, 0, 0.45); }
}

@keyframes login-alarm-badge {
  0%, 100% { opacity: 1; transform: translateX(-50%) scale(1); }
  50% { opacity: 0.75; transform: translateX(-50%) scale(1.04); }
}

.login-control-box {
  text-align: center;
}

.login-control-q {
  margin: 0.5rem 0 1.25rem;
  font-size: 1.35rem;
  font-weight: 700;
}

.login-control-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.login-control-actions .btn {
  min-width: 6.5rem;
}

.login-control-locked .login-control-actions .btn {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.matrix-welcome {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  overflow: hidden;
}

.matrix-welcome canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.matrix-welcome-text {
  position: relative;
  z-index: 1;
  margin: 0;
  color: #0f0;
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: 0 0 12px #0f0, 0 0 28px rgba(0, 255, 0, 0.55);
  animation: matrix-text-glow 1.6s ease-in-out infinite;
}

@keyframes matrix-text-glow {
  0%, 100% { opacity: 0.85; text-shadow: 0 0 12px #0f0, 0 0 28px rgba(0, 255, 0, 0.45); }
  50% { opacity: 1; text-shadow: 0 0 18px #0f0, 0 0 42px rgba(0, 255, 0, 0.75); }
}

.app {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { border-right: none; border-bottom: 1px solid var(--border); }
}

.sidebar {
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sidebar-tag {
  margin-top: -0.5rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar-art {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 5rem;
  padding: 0.25rem 0;
  overflow: hidden;
}

.sidebar-art-img {
  max-width: 100%;
  max-height: min(42vh, 320px);
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.35));
  pointer-events: none;
  user-select: none;
}

.nav-item {
  text-align: left;
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.nav-item:hover {
  background: var(--bg-3);
  color: var(--text);
}

.nav-item.active {
  background: rgba(61, 214, 198, 0.12);
  color: var(--accent);
  font-weight: 600;
}

.sidebar-block { display: flex; flex-direction: column; gap: 0.5rem; }
.status-block { margin-top: auto; }

.sidebar-footer {
  margin-top: auto;
  padding-top: 0.5rem;
}

.sidebar-logout-btn {
  width: 100%;
  justify-content: center;
  border-color: var(--border);
  color: var(--muted);
}

.sidebar-logout-btn:hover {
  color: var(--text);
  border-color: var(--accent-dim);
}

.selected-badge {
  font-size: 0.78rem;
  padding: 0.45rem 0.65rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  line-height: 1.35;
}

.selected-badge.active {
  border-color: var(--accent-dim);
  color: var(--accent);
}

.task-status {
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
}

.task-status.idle { background: var(--bg-3); color: var(--muted); }
.task-status.running { background: rgba(61, 214, 198, 0.15); color: var(--accent); }

.btn {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: 0.65rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.15s, transform 0.1s;
}

.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary { background: var(--accent); color: #0b0f14; }
.btn-primary:hover { background: var(--accent-dim); }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--text); border-color: var(--muted); }

.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.8rem; }

.btn-danger {
  background: rgba(248, 81, 73, 0.15);
  color: var(--danger);
  border: 1px solid rgba(248, 81, 73, 0.35);
  width: 100%;
}
.btn-danger:hover:not(:disabled) { background: rgba(248, 81, 73, 0.25); }

.main {
  min-height: 100vh;
  max-height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1.25rem 2rem 1.5rem;
}

@media (prefers-reduced-motion: reduce) {
  .main {
    scroll-behavior: auto;
  }
}

.main-scroll {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: min-content;
}

.log-dock {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.log-dock-compact-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 0.85rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  flex-shrink: 0;
}

.log-dock-compact-bar .task-status.running {
  color: var(--accent);
}

.log-dock-expandable {
  display: none;
  flex-direction: column;
  gap: 0;
  margin-top: 0;
}

.log-dock-expanded .log-dock-expandable {
  display: flex;
  animation: logDockReveal 0.28s ease-out;
}

@keyframes logDockReveal {
  from {
    opacity: 0.55;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .log-dock-expanded .log-dock-expandable {
    animation: none;
  }
}

.log-dock-expanded {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-2);
  overflow: hidden;
  padding-top: 0;
}

.log-dock-expanded .log-dock-compact-bar {
  border: none;
  border-radius: 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg-2);
}

.log-dock-expanded .batch-progress {
  border: none;
  border-radius: 0;
  box-shadow: none;
  margin: 0;
  border-bottom: 1px solid var(--border);
  height: 14rem;
  max-height: 14rem;
}

.log-dock-expanded .batch-progress.hidden + .log-panel {
  border-top: none;
}

.log-dock-expanded .log-panel {
  border: none;
  border-radius: 0;
  background: var(--bg-2);
}

.error-log-panel {
  border-top: 1px solid var(--border);
}

.error-log-header span {
  color: #e07a7a;
}

.wallet-hits-panel {
  margin-top: 1.1rem;
  border: 1px solid rgba(61, 214, 198, 0.32);
  border-radius: var(--radius);
  background: #0b1413;
  overflow: hidden;
}

.wallet-hits-header {
  color: var(--accent);
}

.wallet-hits-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.wallet-hits-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}

.wallet-hits-wrap {
  max-height: min(32rem, 60vh);
  overflow: auto;
}

.wallet-hits-table {
  margin: 0;
}

.wallet-hits-table th,
.wallet-hits-table td {
  font-size: 0.78rem;
}

.log-dock .log-panel {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.log-dock .btn-danger {
  width: auto;
}

.table-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border);
}

.table-pager-top {
  margin-top: 0;
  margin-bottom: 0.65rem;
  padding-top: 0;
  padding-bottom: 0.65rem;
  border-top: none;
  border-bottom: 1px solid var(--border);
}

.table-pager.hidden {
  display: none;
}

.pager-info {
  font-size: 0.82rem;
  color: var(--muted);
}

.pager-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.pager-label {
  font-size: 0.78rem;
  color: var(--muted);
}

.pager-size {
  width: auto;
  min-width: 4.5rem;
  padding: 0.3rem 0.45rem;
  font-size: 0.82rem;
}

.pager-num {
  font-size: 0.82rem;
  color: var(--muted);
  min-width: 4.5rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.pager-btn {
  min-width: 2rem;
  padding: 0.25rem 0.45rem;
}

.page { display: none; }
.page.active { display: block; }

.page-header { margin-bottom: 1.25rem; }
.page-header.centered { text-align: center; }
.page-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.page-header h1 { font-size: 1.5rem; font-weight: 600; }

/* Full-width panels */
.panel-full {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem 1.25rem;
  box-shadow: var(--shadow);
}

.sessions-toolbar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.sessions-sort {
  min-width: 8.5rem;
}

.data-table-sessions thead .sessions-sort-head {
  text-align: right;
  vertical-align: middle;
  min-width: 11rem;
}

.sessions-table-sort {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  justify-content: flex-end;
}

.data-table-sessions .sessions-table-sort .pager-label {
  font-size: 0.68rem;
  margin: 0;
}

.data-table-sessions .sessions-table-sort .sessions-sort {
  font-size: 0.72rem;
  padding: 0.18rem 0.35rem;
  min-width: 7.5rem;
}

.proxy-toolbar { margin-bottom: 0.75rem; }

.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
}

/* Data tables */
.data-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}

#sessions-table-wrap {
  overflow: auto;
  max-height: calc(100vh - 18rem);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  min-width: 720px;
}

.data-table thead {
  background: var(--bg-3);
  border-bottom: 1px solid var(--border);
}

.data-table th {
  text-align: left;
  padding: 0.65rem 0.85rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  white-space: nowrap;
}

.data-table td {
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr.session-row {
  cursor: pointer;
  transition: background 0.12s;
}

.data-table tbody tr.session-row:hover {
  background: rgba(61, 214, 198, 0.05);
}

.data-table tbody tr.session-row.selected {
  background: rgba(61, 214, 198, 0.1);
}

.data-table tbody tr.session-row.selected td.col-phone {
  color: var(--accent);
  font-weight: 600;
}

.data-table tbody tr.session-row.dead {
  cursor: default;
  opacity: 0.65;
}

.data-table tbody tr.loading {
  opacity: 0.7;
}

.col-select {
  width: 2rem;
  text-align: center;
  color: var(--accent);
  font-size: 0.75rem;
}

.col-phone {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.col-age {
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.82rem;
}

.col-name { min-width: 100px; }

.col-tag {
  color: var(--accent-dim);
  white-space: nowrap;
}

.col-proxy {
  font-family: "SF Mono", Consolas, monospace;
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
}

.col-status {
  white-space: nowrap;
  font-size: 0.82rem;
}

.data-table-sessions tbody td {
  font-size: 0.82rem;
  padding: 0.32rem 0.45rem;
  vertical-align: middle;
}

.data-table-sessions thead th {
  font-size: 0.72rem;
  padding: 0.38rem 0.45rem;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg-3);
  box-shadow: 0 1px 0 var(--border);
}

.data-table-sessions .col-phone {
  font-size: 0.78rem;
}

.data-table-sessions .col-proxy {
  font-size: 0.75rem;
  max-width: 9rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.data-table-sessions .col-actions .btn-row-action {
  padding: 0.12rem 0.28rem;
  font-size: 0.78rem;
}

.col-2fa,
.col-tg-sessions {
  text-align: center;
  width: 2.4rem;
  padding-left: 0.25rem !important;
  padding-right: 0.25rem !important;
}

.sec-2fa-yes {
  color: var(--accent);
  font-weight: 700;
}

.tg-sessions-count {
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.col-contacts {
  white-space: nowrap;
  font-size: 0.9rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.col-channels {
  white-space: nowrap;
  font-size: 0.9rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.channels-count.muted {
  color: var(--muted);
  font-weight: 500;
}

.cnt-visible { color: var(--accent-dim); }
.cnt-hidden { color: var(--danger); }

.col-actions {
  width: 1%;
  white-space: nowrap;
  text-align: right;
}

.btn-check-contacts.btn-danger {
  font-size: 0.75rem;
  padding: 0.25rem 0.55rem;
}

.status-ok { color: var(--accent-dim); }
.status-bad { color: var(--danger); }
.status-wait { color: var(--muted); }

.badge-inline {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
}

.badge-inline.free {
  background: var(--bg-3);
  color: var(--muted);
}

.badge-inline.busy {
  background: rgba(61, 214, 198, 0.12);
  color: var(--accent);
}

.dead-block {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.dead-block-header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.dead-count {
  font-size: 0.85rem;
}

.dead-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--danger);
  margin-bottom: 0;
}

.dead-sessions-preview-inner {
  position: relative;
}

.dead-sessions-fade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4.5rem;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    color-mix(in srgb, var(--bg) 0%, transparent) 0%,
    color-mix(in srgb, var(--bg) 55%, transparent) 45%,
    var(--bg) 100%
  );
  backdrop-filter: blur(2px);
}

.dead-expand-btn,
.dead-collapse-btn {
  margin-top: 0.65rem;
}

.dead-sessions-expanded {
  margin-top: 0.25rem;
}

.archive-block {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.archive-open-btn .archive-count-badge,
.archive-count-badge {
  color: #e3b341;
  font-weight: 600;
}

.status-archive {
  color: #e3b341;
  font-weight: 500;
}

.data-table-archive tbody tr {
  border-left: 3px solid rgba(227, 179, 65, 0.45);
}

.archive-modal-box {
  max-height: min(92vh, 900px);
  display: flex;
  flex-direction: column;
}

.archive-modal-hint {
  margin: 0 0 0.75rem;
}

.archive-modal-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  max-height: min(52vh, 520px);
  overflow: auto;
}

.archive-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.archive-hint {
  margin-bottom: 0.75rem;
}

.proxies-window { max-width: none; }

.proxy-stats {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  font-size: 0.85rem;
}

.proxy-stats span {
  padding: 0.35rem 0.65rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.proxy-textarea {
  width: 100%;
  min-height: 110px;
  margin: 0.35rem 0 0.75rem;
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: "SF Mono", Consolas, monospace;
  font-size: 0.82rem;
  resize: vertical;
}

.proxy-hint { margin: 0 0 1rem; }
.proxy-hint code {
  font-size: 0.78rem;
  color: var(--accent-dim);
}

.proxy-stats span.check-ok { color: var(--accent-dim); border-color: rgba(61, 214, 198, 0.35); }
.proxy-stats span.check-fail { color: var(--danger); border-color: rgba(248, 81, 73, 0.35); }

.proxy-check-ok { color: var(--accent-dim); font-size: 0.82rem; white-space: nowrap; }
.proxy-check-fail { color: var(--danger); font-size: 0.82rem; white-space: nowrap; }
.proxy-check-wait { color: var(--muted); font-size: 0.82rem; }

.danger-text { color: var(--danger) !important; }

/* Action pages */
.action-panel {
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
}

.action-session {
  margin-bottom: 1.25rem;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  font-size: 0.9rem;
  text-align: left;
}

.action-session .inline-session-picker-card {
  margin-bottom: 0;
}

.action-session .warn {
  color: var(--warn);
  font-size: 0.85rem;
}

.action-panel .btn-primary {
  width: 100%;
}

/* Inline action pages (Реакции и т.д.) */
.inline-action-wide {
  width: 100%;
}

.inline-action-manual {
  margin-bottom: 0.75rem;
  padding: 0.65rem 0.95rem;
  background: rgba(61, 214, 198, 0.06);
  border: 1px solid rgba(61, 214, 198, 0.22);
  border-radius: var(--radius);
  font-size: 0.82rem;
  line-height: 1.42;
  color: var(--text);
}

.inline-action-manual > strong {
  display: block;
  margin-bottom: 0.28rem;
  font-size: 0.86rem;
  color: var(--accent);
}

.inline-action-manual-list li strong {
  display: inline;
  color: var(--accent);
  font-weight: 600;
}

.inline-action-manual-list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
}

.inline-action-manual-list li {
  margin-bottom: 0.1rem;
}

.inline-action-manual-list li:last-child {
  margin-bottom: 0;
}

.inline-action-manual code {
  font-size: 0.82rem;
  padding: 0.1rem 0.35rem;
  background: var(--bg);
  border-radius: 4px;
}

.inline-action-card {
  max-width: 540px;
  margin: 0 auto;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.65rem 1.65rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
}

.inline-action-card-wide {
  max-width: none;
  margin: 0;
  padding: 1.25rem 1.5rem 1.35rem;
}

.inline-action-topbar {
  display: flex;
  align-items: stretch;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.15rem;
}

.inline-action-topbar .action-session-inline {
  flex: 1;
  min-width: 220px;
  margin-bottom: 0;
}

.inline-action-parallel {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  min-width: 180px;
}

.inline-action-parallel .batch-parallel-hint {
  margin: 0;
  font-size: 0.85rem;
}

.inline-action-form-wide .inline-action-columns {
  display: grid;
  grid-template-columns: 1fr minmax(200px, 22rem);
  gap: 1.25rem 1.75rem;
  align-items: start;
  margin-bottom: 1.15rem;
}

.inline-action-col-reactions {
  min-width: 0;
}

.reaction-picker-wrap-inline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
}

.reaction-picker-inline .reaction-picker-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-height: 2.25rem;
  align-items: center;
  margin: 0;
  flex: 1;
  min-width: 0;
}

.reaction-picker-inline .reaction-picker-pop {
  left: 0;
  bottom: calc(100% + 0.4rem);
  min-width: 14.5rem;
  max-width: 16.5rem;
  padding: 0.5rem;
}

.reaction-picker-inline .reaction-picker-grid {
  display: grid;
  grid-template-columns: repeat(8, 1.75rem);
  gap: 0.15rem;
  max-height: 9.5rem;
  overflow-y: auto;
  justify-content: start;
}

.reaction-picker-inline .reaction-pick-btn {
  width: 1.75rem;
  height: 1.75rem;
  font-size: 1.1rem;
  padding: 0;
}

.reaction-picker-inline .reaction-selected-chip {
  animation: reaction-chip-in 0.15s ease;
}

@media (max-width: 820px) {
  .inline-action-form-wide .inline-action-columns {
    grid-template-columns: 1fr;
  }
}

.inline-action-col-posts .dm-post-urls-list {
  max-height: 14rem;
  overflow-y: auto;
}

.inline-action-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.inline-action-footer-settings {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.85rem 1.25rem;
  flex: 1;
}

.inline-action-field {
  margin: 0;
  min-width: 7rem;
  gap: 0;
}

.inline-action-field label {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  flex-wrap: wrap;
  font-size: 0.78rem;
  line-height: 1.2;
  color: var(--muted);
  margin-bottom: 0.25rem;
  min-height: calc(0.78rem * 1.2);
}

.inline-action-field-label-spacer {
  visibility: hidden;
  user-select: none;
  pointer-events: none;
}

.inline-action-field input[type="number"] {
  width: 5.5rem;
  height: 2.15rem;
  padding: 0 0.5rem;
  box-sizing: border-box;
}

.inline-action-jitter-mount .jitter-field-row {
  height: 2.15rem;
  margin: 0;
  align-items: center;
  gap: 0.35rem;
}

.inline-action-field-jitter {
  min-width: auto;
}

.inline-action-options-row {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin: 0;
  align-items: flex-end;
}

.inline-action-run-btn {
  flex-shrink: 0;
  min-width: 10rem;
  height: 2.15rem;
  padding: 0 1.35rem;
  font-size: 0.95rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.inline-action-footer-single {
  justify-content: flex-end;
  border-top: none;
  padding-top: 0.75rem;
}

.inline-action-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.35rem 1rem;
  margin: 0.85rem 0 0.25rem;
  padding: 0.65rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.inline-action-settings-grid .form-row.inline,
.inline-action-settings-grid .dm-setting-row {
  margin: 0;
  font-size: 0.82rem;
  align-items: center;
  gap: 0.2rem 0.35rem;
}

.inline-action-settings-grid .dm-setting-row label {
  margin: 0;
}

.inline-action-settings-grid .dm-all-mutual-btn,
.inline-action-settings-grid .dm-all-mutual-btn:disabled {
  cursor: default;
  font-weight: 600;
  opacity: 0.9;
}

.inline-action-stack-dm {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 0.75rem;
}

.inline-action-stack-dm .inline-action-section {
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  margin-bottom: 0;
}

.inline-action-stack-dm .dm-message-block textarea {
  width: 100%;
  min-height: 5.5rem;
}

.inline-action-stack-dm .dm-post-files-block {
  margin-top: 0.65rem;
}

.inline-action-columns-dm {
  grid-template-columns: 1fr 1fr;
}

.inline-action-create-grid {
  display: grid;
  grid-template-columns: 1fr minmax(200px, 16rem);
  gap: 1.25rem 1.5rem;
  margin-bottom: 0.5rem;
}

.inline-action-create-avatar .avatar-preview {
  min-height: 7rem;
}

@media (max-width: 760px) {
  .inline-action-columns-dm,
  .inline-action-create-grid {
    grid-template-columns: 1fr;
  }
}

.inline-action-form {
  text-align: left;
}

.action-session-inline {
  margin-bottom: 1.15rem;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  font-size: 0.9rem;
}

.inline-session-picker-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
  width: 100%;
  padding: 0.85rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.inline-session-picker-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
}

.session-use-slider {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.session-use-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.84rem;
  color: var(--muted);
}

.session-use-head strong {
  color: var(--text);
}

.session-use-num {
  width: 4.4rem;
  padding: 0.25rem 0.4rem;
  text-align: center;
}

.session-use-range {
  width: 100%;
  accent-color: var(--accent, #2ec4b6);
  cursor: pointer;
}

.inline-session-picker-card.is-empty {
  border-color: rgba(240, 180, 80, 0.35);
  background: linear-gradient(180deg, rgba(240, 180, 80, 0.06), var(--bg));
}

.inline-session-picker-body {
  min-width: 0;
  flex: 1;
}

.inline-session-picker-title {
  font-weight: 600;
  line-height: 1.35;
}

.inline-session-picker-sub {
  font-size: 0.82rem;
  margin-top: 0.2rem;
  line-height: 1.35;
}

.action-session .inline-session-picker-card {
  margin-bottom: 0;
}

.session-picker-modal-box {
  max-width: 42rem;
}

.session-picker-hint {
  margin: -0.35rem 0 0.85rem;
}

.session-picker-toolbar {
  margin-bottom: 0.65rem;
}

.session-picker-table-wrap {
  max-height: min(52vh, 28rem);
  overflow: auto;
  margin-bottom: 0.85rem;
}

.data-table-session-picker .col-select {
  width: 2.25rem;
}

.session-picker-row {
  cursor: pointer;
}

.session-picker-row.is-picked {
  background: rgba(61, 214, 198, 0.06);
}

.session-picker-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.inline-action-section {
  margin-bottom: 1.25rem;
}

.inline-action-section:last-child {
  margin-bottom: 0;
}

.inline-section-label {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 0.25rem;
  color: var(--text);
}

.inline-section-label-row {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 0.25rem;
}

.inline-section-label-row .inline-section-label {
  margin: 0;
}

.inline-action-create-main .form-row > label,
.inline-action-create-avatar > .label,
.post-files-head .post-label {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.inline-action-settings .form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem 1rem;
}

.inline-action-settings .form-grid-full {
  grid-column: 1 / -1;
}

.inline-action-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.inline-action-submit {
  margin-top: 1.1rem;
}

.inline-action-submit .btn-primary {
  width: 100%;
  padding: 0.8rem 1rem;
  font-size: 1rem;
  font-weight: 600;
}

.reaction-picker-inline .reaction-selected-chip {
  animation: reaction-chip-in 0.15s ease;
}

@keyframes reaction-chip-in {
  from { transform: scale(0.7); opacity: 0.5; }
  to { transform: scale(1); opacity: 1; }
}

/* Invite page */
.invite-account-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.invite-multi-summary #invite-summary-line strong {
  color: var(--accent);
  font-weight: 600;
}

.invite-multi-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  width: 100%;
  font-size: 0.92rem;
}

.invite-stem-group {
  margin-bottom: 1.25rem;
}

.invite-stem-group:last-child {
  margin-bottom: 0.5rem;
}

.invite-stem-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
  padding: 0.65rem 0.9rem;
  margin-bottom: 0.55rem;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.invite-stem-head .phone {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
}

.invite-stem-head .meta {
  font-size: 0.82rem;
  color: var(--muted);
}

.invite-stem-channels {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.invite-stem-empty {
  padding: 0.5rem 0.85rem;
  font-size: 0.85rem;
}

.invite-stem-error .invite-stem-head {
  border-color: rgba(248, 81, 73, 0.35);
}

.invite-stem-no-channel .invite-stem-head {
  border-color: var(--border);
}

.invite-account-header .phone {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent);
}

.invite-account-header .meta {
  font-size: 0.85rem;
  color: var(--muted);
}

.invite-progress,
.action-task-progress {
  margin-bottom: 0.85rem;
  padding: 0.85rem 1rem;
  background: var(--bg);
  border: 1px solid var(--accent-dim);
  border-radius: 10px;
}

.action-task-progress.is-finished {
  border-color: rgba(61, 214, 198, 0.28);
  background: linear-gradient(180deg, rgba(61, 214, 198, 0.07), var(--bg));
}

.action-task-progress.is-finished.is-stopped {
  border-color: rgba(240, 180, 80, 0.35);
  background: linear-gradient(180deg, rgba(240, 180, 80, 0.08), var(--bg));
}

.action-task-progress-static.is-idle {
  border-color: var(--border);
  background: var(--bg);
}

.action-task-progress-static.is-idle .invite-progress-pct {
  color: var(--muted);
  font-size: 0.95rem;
}

.action-task-progress-static.is-idle .invite-progress-track {
  opacity: 0.45;
}

.action-task-progress-static.is-idle .invite-stat-hero {
  opacity: 0.72;
}

.action-task-progress-static.is-finished .action-task-finish-time {
  margin-right: 0;
}

.action-task-progress-footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--border);
}

.action-task-finish-badge {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.action-task-finish-badge.is-stopped {
  color: #e8b84a;
}

.action-task-finish-time {
  font-size: 0.75rem;
  margin-right: auto;
}

.action-task-progress .invite-stat-hero {
  min-width: 6.5rem;
  padding: 0.5rem 0.85rem;
}

.action-task-progress .invite-stat-value {
  font-size: 1.75rem;
}

.action-task-progress .invite-progress-pct {
  font-size: 1.1rem;
}

.action-task-progress .invite-progress-track {
  height: 6px;
  margin-bottom: 0.65rem;
}

.action-task-progress .invite-progress-stats {
  gap: 0.65rem;
  margin-bottom: 0.55rem;
}

.action-task-progress .action-task-stop-btn {
  width: 100%;
}

.action-task-progress .action-task-dismiss-btn {
  margin-left: auto;
}

.invite-progress-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.65rem;
}

.invite-progress-title {
  font-size: 0.85rem;
  color: var(--muted);
}

.invite-progress-pct {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.invite-progress-track {
  height: 8px;
  background: var(--bg-3);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.invite-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  border-radius: 999px;
  transition: width 0.35s ease;
}

.invite-progress-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}

.invite-stat-hero {
  flex: 0 0 auto;
  min-width: 7.5rem;
  padding: 0.65rem 1rem;
  background: linear-gradient(145deg, rgba(61, 214, 198, 0.14), rgba(42, 168, 155, 0.06));
  border: 1px solid rgba(61, 214, 198, 0.35);
  border-radius: 10px;
  text-align: center;
}

.invite-stat-value {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.invite-stat-label {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.invite-stat-chips {
  flex: 1 1 12rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-content: center;
}

.invite-chip {
  flex: 1 1 6.5rem;
  padding: 0.45rem 0.65rem;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-align: center;
}

.invite-chip-num {
  display: block;
  font-size: 1.15rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.invite-chip-label {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.68rem;
  color: var(--muted);
}

.invite-chip-muted .invite-chip-num {
  color: var(--muted);
}

.invite-chip-warn .invite-chip-num {
  color: var(--warn);
}

.invite-chip-subs {
  border-color: rgba(61, 214, 198, 0.25);
  background: rgba(61, 214, 198, 0.06);
}

.invite-chip-subs .invite-chip-num {
  color: var(--accent);
}

.invite-other-banner {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(248, 181, 73, 0.1);
  border: 1px solid rgba(248, 181, 73, 0.35);
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--muted);
  cursor: pointer;
}

.invite-other-banner strong {
  color: var(--accent);
}

.toast-stack {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-width: min(340px, calc(100vw - 2rem));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: var(--bg-2);
  border: 1px solid var(--accent-dim);
  border-left: 4px solid var(--accent-dim);
  border-radius: 10px;
  padding: 0.75rem 2rem 0.75rem 0.85rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  position: relative;
  animation: toast-in 0.25s ease;
}

.toast.toast-stopped {
  border-left-color: #f8b549;
  border-color: rgba(248, 181, 73, 0.4);
}

.toast-close {
  position: absolute;
  top: 0.4rem;
  right: 0.45rem;
  width: 1.5rem;
  height: 1.5rem;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 4px;
}

.toast-close:hover {
  color: var(--text);
  background: var(--bg-3);
}

.toast-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-dim);
  margin-bottom: 0.35rem;
}

.toast-phone {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.4rem;
}

.toast-stats {
  font-size: 0.88rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.toast-stats .cnt-visible { color: var(--accent-dim); }
.toast-stats .cnt-hidden { color: var(--danger); }
.toast-stats .cnt-muted { color: var(--muted); font-weight: 500; }

.toast-time {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.35rem;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: translateX(0); }
}

.channels-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.channel-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  overflow: hidden;
}

.channel-item.open {
  border-color: var(--accent-dim);
}

.channel-item-head {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  cursor: pointer;
  transition: background 0.12s;
}

.channel-item-main {
  flex: 1;
  min-width: 0;
}

.channel-item-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 0.75rem;
}

.channel-item-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.channel-members {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.channel-members.muted {
  color: var(--muted);
  font-weight: 500;
}

.channel-item-tag {
  font-size: 0.82rem;
  color: var(--accent-dim);
  margin-top: 0.15rem;
}

.channel-item-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.35rem;
  flex-shrink: 0;
}

.channel-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}

.btn-open-post,
.btn-open-repost {
  font-size: 0.72rem;
  padding: 0.2rem 0.45rem;
  white-space: nowrap;
  border-color: rgba(61, 214, 198, 0.35);
  color: var(--accent);
}

.btn-delete-channel,
.btn-delete-group,
.btn-delete-session {
  font-size: 0.72rem;
  padding: 0.2rem 0.45rem;
  color: var(--danger);
  border-color: rgba(248, 81, 73, 0.35);
}

.btn-delete-channel:hover,
.btn-delete-group:hover,
.btn-delete-session:hover {
  background: rgba(248, 81, 73, 0.12);
}

.entity-pick-wrap {
  display: flex;
  align-items: center;
  padding-top: 0.15rem;
  flex-shrink: 0;
  cursor: pointer;
}

.entity-pick-wrap input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent);
  cursor: pointer;
}

.entity-table .col-select {
  width: 2.35rem;
  text-align: center;
  vertical-align: middle;
}

.entity-table .col-select input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent);
  cursor: pointer;
}

.entity-table .col-phone {
  width: 9.5rem;
  vertical-align: middle;
}

.entity-table .col-entity {
  min-width: 12rem;
  vertical-align: middle;
}

.entity-table .col-actions {
  width: auto;
  white-space: nowrap;
  vertical-align: middle;
  padding-left: 0.45rem;
  padding-right: 0.65rem;
}

.entity-table .entity-row-actions {
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.28rem;
  justify-content: flex-end;
}

.entity-table .entity-row-actions .btn-sm {
  padding: 0.22rem 0.42rem;
  font-size: 0.72rem;
  line-height: 1.2;
  white-space: nowrap;
  flex-shrink: 0;
}

.entity-table tbody tr.entity-row:hover td {
  background: rgba(61, 214, 198, 0.05);
}

.entity-table tbody tr.entity-row.entity-row-selected td {
  background: rgba(45, 212, 191, 0.1);
}

.entity-table tbody tr.entity-row.entity-row-open td {
  border-bottom-color: transparent;
}

.entity-table tbody tr.entity-row-empty td {
  opacity: 0.92;
}

.entity-phone {
  font-weight: 600;
  color: var(--accent);
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}

.entity-account-name {
  font-size: 0.78rem;
  margin-top: 0.15rem;
  max-width: 9.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entity-cell-main {
  min-width: 0;
}

.entity-cell-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 0.75rem;
}

.entity-cell-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.entity-cell-meta {
  font-size: 0.82rem;
  color: var(--accent-dim);
  margin-top: 0.15rem;
}

.entity-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}

.entity-detail-row.hidden {
  display: none;
}

.entity-detail-row td {
  padding: 0;
  border-top: none;
  background: var(--bg-3);
}

.entity-detail-row .channel-item.entity-panels {
  border: none;
  border-radius: 0;
  background: transparent;
}

.entity-detail-row .channel-item.entity-panels.open {
  border-color: transparent;
}

.entity-delete-bar {
  display: none;
}

.entity-pick-wrap {
  display: none;
}

.btn-row-action.is-loading {
  opacity: 0.65;
  cursor: wait;
}

.channel-expand {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1;
}

.channel-item-meta {
  display: none;
}

.channel-item-head:hover {
  background: rgba(61, 214, 198, 0.05);
}

.btn-check-members {
  font-size: 0.72rem;
  padding: 0.2rem 0.45rem;
  white-space: nowrap;
}

.channel-invite-panel {
  display: none;
  padding: 0 1rem 1rem;
  border-top: 1px solid var(--border);
  background: var(--bg-3);
}

.channel-post-panel {
  display: none;
  padding: 0 1rem 1rem;
  border-top: 1px solid var(--border);
  background: var(--bg-3);
}

.channel-repost-panel {
  display: none;
  padding: 0 1rem 1rem;
  border-top: 1px solid var(--border);
  background: var(--bg-3);
}

.repost-hint {
  margin: 0.75rem 0 0;
  font-size: 0.82rem;
}

.repost-url {
  width: 100%;
  box-sizing: border-box;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  color: var(--text);
  font: inherit;
}

.repost-url:focus {
  outline: none;
  border-color: var(--accent);
}

.channel-item.open-invite .channel-invite-panel {
  display: block;
}

.channel-item.open-post .channel-post-panel {
  display: block;
}

.channel-item.open-repost .channel-repost-panel {
  display: block;
}

.channel-no-rights {
  margin: 1rem 0 0.5rem;
  font-size: 0.85rem;
}

.post-label {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0.85rem 0 0.4rem;
}

.post-text {
  width: 100%;
  min-height: 120px;
  padding: 0.65rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  line-height: 1.45;
  resize: vertical;
}

.post-text:focus {
  outline: none;
  border-color: var(--accent-dim);
}

.post-files-block {
  margin-top: 0.5rem;
}

.post-files-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.post-files-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.post-media-attachments {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: 0.55rem;
}

.post-media-attachment {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.post-media-attachment-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.post-media-attachment-thumb img,
.post-media-attachment-thumb video,
.post-preview-media-cell img,
.post-preview-media-cell video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.post-media-attachment-thumb.is-document,
.post-media-attachment-thumb.is-audio,
.post-media-attachment-thumb.is-voice {
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.5rem;
}

.post-media-attachment-icon,
.post-preview-file-icon {
  font-size: 1.45rem;
  line-height: 1;
}

.post-media-attachment-badge,
.post-preview-media-badge {
  position: absolute;
  right: 0.35rem;
  bottom: 0.35rem;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.55rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.post-media-attachment-bar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.post-media-attachment-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.72rem;
  color: var(--muted);
}

.post-media-attachment-bar select {
  max-width: 5.5rem;
  padding: 0.15rem 0.25rem;
  font-size: 0.68rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
}

.post-preview-actions {
  margin: 0.35rem 0 0.5rem;
}

.post-preview-modal-box {
  max-width: 22rem;
}

.post-preview-modal-body {
  padding: 0;
  overflow: hidden;
  border-radius: 0 0 var(--radius) var(--radius);
}

.post-preview-modal-body .post-preview-empty {
  font-size: 0.84rem;
  padding: 1rem;
}

.tg-preview {
  font-size: 0.82rem;
  line-height: 1.4;
}

.tg-preview-dm {
  background: linear-gradient(180deg, #17212b 0%, #0e1621 100%);
  border-radius: 10px;
  overflow: hidden;
}

.tg-preview-dm-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.65rem;
  background: #17212b;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.tg-preview-dm-back {
  color: #6ab2f2;
  font-size: 1.35rem;
  line-height: 1;
  margin-right: 0.15rem;
}

.tg-preview-dm-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: #2b5278;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.tg-preview-dm-peer {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.tg-preview-dm-name {
  font-weight: 600;
  color: #fff;
}

.tg-preview-dm-status {
  font-size: 0.68rem;
}

.tg-preview-dm-chat {
  min-height: 9rem;
  padding: 0.75rem 0.65rem 1rem;
  background:
    radial-gradient(circle at 20% 30%, rgba(43, 82, 120, 0.15) 0%, transparent 45%),
    radial-gradient(circle at 80% 70%, rgba(43, 82, 120, 0.12) 0%, transparent 40%),
    #0e1621;
}

.tg-preview-dm-row {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
}

.tg-preview-dm-row-out .post-preview-bubble {
  background: #2b5278;
  border: none;
  border-radius: 12px 12px 4px 12px;
  max-width: 13.5rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.tg-preview-dm-row-out .post-preview-caption {
  color: #fff;
}

.tg-preview-dm-time {
  font-size: 0.62rem;
  color: rgba(255, 255, 255, 0.45);
  padding-right: 0.15rem;
}

.tg-preview-dm-checks {
  color: #6ab2f2;
  letter-spacing: -0.12em;
}

.tg-preview-channel {
  background: var(--bg-2);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.tg-preview-channel-top {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-3);
}

.tg-preview-channel-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.tg-preview-channel-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.tg-preview-channel-name {
  font-weight: 600;
  color: var(--text);
}

.tg-preview-channel-sub {
  font-size: 0.68rem;
}

.tg-preview-channel-body {
  padding: 0.65rem 0.75rem 0.75rem;
}

.tg-preview-channel-body .post-preview-bubble {
  max-width: 14rem;
  border-radius: 10px;
  background: var(--bg-3);
}

.tg-preview-channel-foot {
  margin-top: 0.45rem;
  font-size: 0.68rem;
}

.tg-preview .post-preview-album {
  max-width: 100%;
}

.tg-preview .post-preview-album.cols-1 .post-preview-media-cell {
  aspect-ratio: 4 / 3;
  max-height: 7.5rem;
}

.tg-preview .post-preview-media-cell {
  aspect-ratio: 1;
  max-height: 4.25rem;
}

.tg-preview .post-preview-caption {
  padding: 0.45rem 0.55rem 0.5rem;
  font-size: 0.8rem;
  line-height: 1.4;
}

.tg-preview .post-preview-media-badge {
  width: 1.1rem;
  height: 1.1rem;
  font-size: 0.48rem;
}

.tg-preview .post-preview-file-icon {
  font-size: 1.1rem;
}

.tg-preview .post-preview-file-name {
  font-size: 0.62rem;
}

.post-preview-bubble {
  max-width: 22rem;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 12px 12px 12px 4px;
  overflow: hidden;
}

.post-preview-album {
  display: grid;
  gap: 2px;
  background: var(--border);
}

.post-preview-album.cols-1 {
  grid-template-columns: 1fr;
}

.post-preview-album.cols-2 {
  grid-template-columns: 1fr 1fr;
}

.post-preview-album.cols-3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.post-preview-media-cell {
  position: relative;
  aspect-ratio: 1;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0.35rem;
}

.post-preview-media-cell.is-file {
  flex-direction: column;
  gap: 0.25rem;
  text-align: center;
}

.post-preview-file-name {
  font-size: 0.68rem;
  color: var(--muted);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-preview-more {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
}

.post-preview-caption {
  padding: 0.55rem 0.7rem 0.65rem;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--text);
  word-break: break-word;
}

.dm-post-urls-list {
  list-style: none;
  margin: 0.35rem 0 0.5rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.dm-post-urls-text {
  width: 100%;
  margin: 0.35rem 0 0.5rem;
  min-height: 10rem;
  resize: vertical;
}

.dm-post-urls-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.dm-post-url-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dm-post-url-row .repost-url {
  flex: 1;
  min-width: 0;
}

.post-file-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.55rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.post-file-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.85rem;
}

.post-file-kind {
  flex-shrink: 0;
  max-width: 7rem;
  padding: 0.25rem 0.35rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.75rem;
}

.post-hint {
  margin-top: 0.45rem;
  font-size: 0.78rem;
}

.post-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin: 0.85rem 0;
}

.post-options .form-row.inline {
  margin: 0;
  font-size: 0.85rem;
}

.btn-publish-post {
  margin-top: 0.25rem;
}

.channel-invite-panel .form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}

.channel-invite-panel .form-row.inline {
  margin-bottom: 0;
}

/* Log */
.log-panel {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.log-panel.full { max-width: none; margin: 0; }

.log-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--border);
  background: var(--bg-3);
}

.task-status.inline {
  margin-left: auto;
  flex: 0 1 auto;
}

.log-copy-btn {
  flex-shrink: 0;
  font-size: 0.8rem;
  padding: 0.2rem 0.45rem;
  opacity: 0.85;
}

.log-copy-btn:hover {
  opacity: 1;
}

.log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--muted);
  flex-shrink: 0;
}

.log-resize-handle {
  flex-shrink: 0;
  height: 10px;
  cursor: ns-resize;
  background: var(--bg-3);
  border-bottom: 1px solid var(--border);
  position: relative;
  touch-action: none;
}

.log-resize-handle::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 2.75rem;
  height: 4px;
  border-radius: 3px;
  background: var(--muted);
  opacity: 0.45;
}

.log-resize-handle:hover::after,
.log-resize-handle.active::after {
  opacity: 0.95;
  background: var(--accent);
}

#log-output {
  margin: 0;
  padding: 0.65rem 1rem;
  height: var(--log-height, 8.5rem);
  min-height: 4rem;
  max-height: 55vh;
  overflow: auto;
  flex-shrink: 0;
  font-family: "SF Mono", "Cascadia Code", Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.55;
  color: #b8c5d6;
  white-space: pre-wrap;
  word-break: break-word;
  background: var(--bg);
}

#error-log-output {
  margin: 0;
  padding: 0.65rem 1rem;
  height: var(--error-log-height, 6rem);
  min-height: 3rem;
  max-height: 28vh;
  overflow: auto;
  flex-shrink: 0;
  font-family: "SF Mono", "Cascadia Code", Consolas, monospace;
  font-size: 0.76rem;
  line-height: 1.5;
  color: #d4a0a0;
  white-space: pre-wrap;
  word-break: break-word;
  background: #120808;
}

@media (prefers-reduced-motion: reduce) {
  #error-log-output {
    scroll-behavior: auto;
  }
}

select, input[type="text"], input[type="number"], textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
}

.modal-box {
  position: relative;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  width: min(440px, 96vw);
  max-height: 90vh;
  overflow: auto;
  box-shadow: var(--shadow);
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}
.modal-close:hover { color: var(--text); }

.modal-box h2 { margin-bottom: 1rem; font-size: 1.15rem; }

.modal-box.modal-wide {
  width: min(640px, 96vw);
}

.modal-grid-create {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 1.25rem;
}

@media (max-width: 620px) {
  .modal-grid-create { grid-template-columns: 1fr; }
}

.avatar-col {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.avatar-preview {
  width: 100%;
  aspect-ratio: 1;
  max-height: 200px;
  border: 2px dashed var(--border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg);
}

.avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-preview .muted {
  font-size: 0.82rem;
  text-align: center;
  padding: 0.5rem;
}

.avatar-upload-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.session-chip {
  padding: 0.5rem 0.65rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.82rem;
  margin-bottom: 0.75rem;
  color: var(--muted);
}

.session-chip strong { color: var(--accent); }

.form-row {
  margin-bottom: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-row label { font-size: 0.85rem; color: var(--muted); }

.form-row.inline {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

.form-row.inline input[type="checkbox"] { width: auto; }

.form-hint { font-size: 0.75rem; color: var(--muted); }

.jitter-field-row {
  align-items: center;
  gap: 0.35rem;
}

.jitter-field-row label {
  margin: 0;
}

.field-help {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.05rem;
  height: 1.05rem;
  margin-left: 0.1rem;
  border-radius: 50%;
  border: 1px solid var(--muted);
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1;
  cursor: help;
  flex-shrink: 0;
  user-select: none;
}

.field-help:hover,
.field-help:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
  outline: none;
}

.field-help-tip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 7px);
  transform: translateX(-50%);
  width: max-content;
  max-width: 15rem;
  padding: 0.5rem 0.6rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.45;
  color: var(--text);
  text-align: left;
  white-space: normal;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 60;
  transition: opacity 0.12s ease, visibility 0.12s ease;
}

.field-help-tip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--border);
}

.field-help:hover .field-help-tip,
.field-help:focus-visible .field-help-tip {
  opacity: 1;
  visibility: visible;
}

.inline-action-options-row .jitter-field-row {
  margin: 0;
}

.modal-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.modal-actions .btn-primary { flex: 1; }
.modal-actions .btn-ghost { flex: 0 0 auto; }

/* —— Пanel alert (вместо browser alert) —— */
#panel-alert {
  z-index: 200;
}

.panel-alert-box {
  text-align: center;
  width: min(400px, 92vw);
  padding: 1.75rem 1.5rem 1.5rem;
}

.panel-alert-badge {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 1rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
}

.panel-alert-box.alert-error .panel-alert-badge {
  background: rgba(248, 81, 73, 0.15);
  color: var(--danger);
  border: 1px solid rgba(248, 81, 73, 0.35);
}

.panel-alert-box.alert-warn .panel-alert-badge {
  background: rgba(210, 153, 34, 0.15);
  color: var(--warn);
  border: 1px solid rgba(210, 153, 34, 0.35);
}

.panel-alert-box.alert-success .panel-alert-badge {
  background: rgba(61, 214, 198, 0.12);
  color: var(--accent);
  border: 1px solid rgba(61, 214, 198, 0.35);
}

.panel-alert-box.alert-info .panel-alert-badge {
  background: rgba(139, 156, 179, 0.12);
  color: var(--muted);
  border: 1px solid var(--border);
}

.panel-alert-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.65rem;
  color: var(--text);
}

.panel-alert-msg {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  text-align: left;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem 1rem;
  max-height: 40vh;
  overflow: auto;
}

.panel-alert-input {
  display: block;
  width: 100%;
  margin-top: 0.85rem;
  padding: 0.7rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
}

.panel-alert-input:focus {
  outline: none;
  border-color: var(--accent);
}

.panel-alert-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.25rem;
  justify-content: center;
}

.panel-alert-actions .btn-primary {
  min-width: 7rem;
}

.panel-alert-actions .btn-ghost:not(.hidden) {
  min-width: 6rem;
}

.session-focus-bar {
  display: none;
}

.sessions-selection-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.5rem 0 0.75rem;
}

.sessions-action-spamblock {
  margin-left: auto;
}

.session-focus-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0.35rem 0 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius);
  border: 1px solid var(--accent);
  background: rgba(45, 212, 191, 0.12);
  box-shadow: 0 0 0 1px rgba(45, 212, 191, 0.15);
}

.session-focus-bar.hidden {
  display: none !important;
}

.session-focus-label {
  font-size: 0.9rem;
  color: var(--accent);
  margin-right: 0.25rem;
}

.post-button-block.hidden {
  display: none;
}

.post-button-block {
  margin: 0.75rem 0;
  padding: 0.65rem 0.75rem;
  border: 1px dashed var(--accent-dim);
  border-radius: 8px;
  background: rgba(45, 212, 191, 0.06);
}

.post-button-block .post-label {
  color: var(--accent);
  margin-top: 0;
}

.dm-message-block {
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

.dm-message-block textarea {
  width: 100%;
  min-height: 5rem;
  margin-bottom: 0.35rem;
}

.security-modal-box {
  max-width: 720px;
}

.security-sessions-table-wrap {
  max-height: 220px;
  overflow: auto;
  margin-bottom: 0.5rem;
}

.security-form {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.security-2fa-fields {
  margin: 0.5rem 0 0.75rem;
  padding: 0.65rem 0.75rem;
  border: 1px dashed var(--accent-dim);
  border-radius: 8px;
  background: rgba(45, 212, 191, 0.04);
}

.security-warn {
  color: #fbbf24;
}

.security-batch-note {
  margin: 0.5rem 0;
}

.data-table-security td:last-child {
  white-space: nowrap;
}

.status-current-session {
  color: var(--accent);
  font-size: 0.85em;
}

.col-actions {
  white-space: nowrap;
}

.col-actions .btn-row-action {
  font-size: 0.72rem;
  padding: 0.2rem 0.4rem;
  margin-left: 0.1rem;
  min-width: 1.65rem;
}

.post-button-row {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.35rem;
}

.post-button-row input {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
}

@media (min-width: 640px) {
  .post-button-row {
    flex-direction: row;
  }
  .post-button-row input {
    flex: 1;
  }
}

.create-mode-tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.create-mode-btn.active {
  background: var(--accent-dim);
  color: var(--bg);
  border-color: var(--accent);
}

.create-mass-target {
  margin-bottom: 0.75rem;
}

.mass-create-row {
  margin: 0.75rem 0;
  gap: 0.75rem;
}

.mass-avatar-pool {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem 0 0.75rem;
}

.mass-avatar-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.35rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.75rem;
}

.mass-avatar-chip img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
}

.invite-batch-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.75rem;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.invite-batch-count {
  flex: 1;
  min-width: 12rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.batch-progress {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-2);
  padding: 0.75rem 1rem 0.65rem;
  max-height: 14rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}

.batch-progress.hidden {
  display: none;
}

.batch-progress-head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.82rem;
  margin-bottom: 0.35rem;
}

.batch-items-wrap {
  overflow: auto;
  flex: 1;
}

.batch-items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.batch-items-table th,
.batch-items-table td {
  padding: 0.2rem 0.45rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.batch-status-running { color: var(--accent); }
.batch-status-ok { color: var(--accent); }
.batch-status-error { color: var(--danger); }
.batch-status-pending { color: var(--muted); }
.batch-status-skipped { color: var(--warn); }

.batch-detail {
  color: var(--muted);
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.col-select input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  cursor: pointer;
}

tr.session-row.selected {
  background: rgba(61, 214, 198, 0.08);
}

.reaction-picker-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.45rem;
  flex-wrap: wrap;
}

.reaction-picker-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-height: 2.25rem;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.reaction-selected-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: rgba(61, 214, 198, 0.12);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease;
}

.reaction-selected-chip:hover {
  transform: scale(1.08);
  background: rgba(61, 214, 198, 0.22);
}

.reaction-picker-trigger-wrap {
  position: relative;
  flex-shrink: 0;
}

.reaction-picker-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  border: 1px dashed var(--border);
  background: var(--bg-2);
  color: var(--text);
  font-size: 1.15rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}

.reaction-picker-trigger:hover,
.reaction-picker-trigger:focus-visible {
  border-color: var(--accent);
  background: rgba(61, 214, 198, 0.08);
  transform: scale(1.05);
  outline: none;
}

.reaction-picker-pop {
  position: absolute;
  left: 0;
  bottom: calc(100% + 0.45rem);
  z-index: 40;
  min-width: 16.5rem;
  padding: 0.55rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px) scale(0.97);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
  pointer-events: none;
}

.reaction-picker-pop.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.reaction-picker-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.2rem;
}

.reaction-pick-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.12s ease, transform 0.1s ease;
}

.reaction-pick-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: scale(1.15);
}

.reaction-pick-btn.active {
  background: rgba(61, 214, 198, 0.18);
  box-shadow: inset 0 0 0 1px rgba(61, 214, 198, 0.45);
}

.wallet-check-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.15rem 0 0.65rem;
}

.wallet-check-head-actions {
  display: flex;
  gap: 0.35rem;
}

.wallet-check-grid,
.report-reason-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}

.wallet-check-item {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 0.55rem;
  row-gap: 0.1rem;
  align-items: center;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
}

.wallet-check-item:has(input:checked) {
  border-color: rgba(61, 214, 198, 0.45);
  background: rgba(61, 214, 198, 0.08);
}

.wallet-check-item input {
  grid-row: 1 / span 2;
  width: auto;
  margin: 0;
}

.wallet-check-title {
  font-weight: 600;
  color: var(--text);
}

.wallet-check-sub {
  grid-column: 2;
  font-size: 0.75rem;
  color: var(--muted);
}

.panel-alert-extra {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin: 0.35rem 0 0.85rem;
}

.wallet-vote-choice {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
}

.page-wallets .wallet-hits-panel,
#page-wallets .wallet-hits-panel {
  margin: 0.85rem 0 1rem;
}

.wallets-results {
  margin-top: 1.15rem;
}

.wallets-results-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}

.wallets-results-wrap {
  max-height: 28rem;
}

.wallets-results-table td {
  font-size: 0.82rem;
}

@media (max-width: 980px) {
  .wallet-check-grid,
  .report-reason-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .wallet-check-grid,
  .report-reason-grid {
    grid-template-columns: 1fr;
  }
}
