/* ===== Bot Reklama — Theme System ===== */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;600;700&family=Inter:wght@400;500;600;700&display=swap');

/* ===== Dark Theme (default) ===== */
:root {
  --bg-primary:    #0d1117;
  --bg-secondary:  #161b22;
  --bg-tertiary:   #21262d;
  --bg-card:       #161b22;
  --bg-hover:      #1f2937;

  --border:        #30363d;
  --border-light:  #484f58;

  --accent:        #3fb950;
  --accent-hover:  #2ea043;
  --accent-dim:    rgba(63,185,80,0.12);

  --success:       #3fb950;
  --success-dim:   rgba(63,185,80,0.12);
  --warning:       #d29922;
  --warning-dim:   rgba(210,153,34,0.12);
  --danger:        #f85149;
  --danger-dim:    rgba(248,81,73,0.12);
  --info:          #58a6ff;
  --info-dim:      rgba(88,166,255,0.12);

  --text-primary:   #e6edf3;
  --text-secondary: #8b949e;
  --text-muted:     #484f58;

  --sidebar-width: 224px;
  --header-height: 52px;
  --radius:    6px;
  --radius-sm: 4px;
  --radius-lg: 10px;
  --shadow:    0 4px 24px rgba(0,0,0,0.5);
  --transition: 0.15s ease;
  --glow:      0 0 0 2px rgba(63,185,80,0.15);
}

/* ===== Light Theme ===== */
[data-theme="light"] {
  --bg-primary:    #f6f8fa;
  --bg-secondary:  #ffffff;
  --bg-tertiary:   #f0f2f4;
  --bg-card:       #ffffff;
  --bg-hover:      #eaeef2;

  --border:        #d0d7de;
  --border-light:  #afb8c1;

  --accent:        #1a7f37;
  --accent-hover:  #116329;
  --accent-dim:    rgba(26,127,55,0.1);

  --success:       #1a7f37;
  --success-dim:   rgba(26,127,55,0.1);
  --warning:       #9a6700;
  --warning-dim:   rgba(154,103,0,0.1);
  --danger:        #cf222e;
  --danger-dim:    rgba(207,34,46,0.1);
  --info:          #0969da;
  --info-dim:      rgba(9,105,218,0.1);

  --text-primary:   #1f2328;
  --text-secondary: #656d76;
  --text-muted:     #9ca3af;

  --shadow:    0 1px 8px rgba(0,0,0,0.1);
  --glow:      0 0 0 2px rgba(26,127,55,0.2);
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; height: -webkit-fill-available; }

body {
  height: 100%;
  height: var(--vh, 100vh);
  font-family: 'Inter', 'JetBrains Mono', system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.6;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s, color 0.2s;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ===== Layout ===== */
.app {
  display: flex;
  height: 100vh;
  height: var(--vh, 100vh);
  overflow: hidden;
  position: relative;
}

/* ===== Sidebar ===== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-logo {
  padding: 14px 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.03em;
  font-family: 'JetBrains Mono', monospace;
}

/* Blinking cursor */
.sidebar-logo span::after {
  content: '▊';
  animation: cursor-blink 1.2s step-end infinite;
  color: var(--accent);
  margin-left: 2px;
  font-size: 11px;
  opacity: 0.7;
}

@keyframes cursor-blink {
  0%, 50% { opacity: 0.7; }
  51%, 100% { opacity: 0; }
}

.logo-icon {
  width: 30px;
  height: 30px;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.sidebar-nav {
  flex: 1;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition);
  position: relative;
}

.nav-item::before {
  content: '›';
  font-size: 14px;
  color: var(--text-muted);
  width: 10px;
  flex-shrink: 0;
  line-height: 1;
  transition: color var(--transition);
}

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

.nav-item.active {
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 600;
}
.nav-item.active::before {
  content: '▶';
  color: var(--accent);
  font-size: 10px;
}

.nav-icon { font-size: 14px; width: 17px; text-align: center; flex-shrink: 0; }

.nav-badge {
  margin-left: auto;
  background: var(--bg-tertiary);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
  border: 1px solid var(--border);
}

.nav-badge-live {
  background: var(--danger-dim);
  color: var(--danger);
  border-color: var(--danger);
  animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.sidebar-footer {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.user-info { display: flex; flex-direction: column; gap: 2px; }
.user-email { font-size: 11px; font-weight: 600; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-role { font-size: 10px; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; }

.ws-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}
.ws-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ws-dot.connected { background: var(--success); animation: pulse-dot 2.5s infinite; }
.ws-dot.disconnected { background: var(--danger); }
.ws-dot.connecting { background: var(--warning); animation: pulse-dot 1s infinite; }

@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 currentColor; }
  50% { opacity: 0.8; }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.15; }
}

/* Live activity pulse for cards with active work */
@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(52,199,89,0.4); }
  50% { box-shadow: 0 0 0 6px rgba(52,199,89,0); }
  100% { box-shadow: 0 0 0 0 rgba(52,199,89,0); }
}
@keyframes live-border {
  0%, 100% { border-color: var(--success); }
  50% { border-color: rgba(52,199,89,0.3); }
}
.card-live {
  animation: live-pulse 2s ease-in-out infinite, live-border 2s ease-in-out infinite !important;
  border: 1px solid var(--success) !important;
  position: relative;
}
.card-live::before {
  content: 'LIVE';
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 9px;
  font-weight: 700;
  color: var(--success);
  letter-spacing: 1px;
  animation: blink 1.5s infinite;
  font-family: 'JetBrains Mono', monospace;
}
.live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse-dot 1.5s infinite;
  margin-right: 4px;
  vertical-align: middle;
}

/* Theme toggle button */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 11px;
  cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
  transition: all var(--transition);
}
.theme-toggle:hover { border-color: var(--border-light); color: var(--text-primary); }
.theme-toggle-icon { font-size: 14px; }

/* ===== Main ===== */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-primary);
  min-width: 0;
}

.header {
  height: var(--header-height);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  flex-shrink: 0;
  gap: 10px;
}

.header-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.02em;
  font-family: 'JetBrains Mono', monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-title::before {
  content: '$ ';
  color: var(--accent);
  font-weight: 400;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* ===== Pages ===== */
.page {
  display: none;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 18px;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
}
.page.active { display: block; }

/* ===== Cards ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 8px;
}

.card-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-family: 'JetBrains Mono', monospace;
}

/* ===== Stats Grid ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color var(--transition);
}
.stat-card:hover { border-color: var(--border-light); }

.stat-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.15;
  font-family: 'JetBrains Mono', monospace;
}

.stat-sub { font-size: 11px; color: var(--text-secondary); }
.stat-icon { font-size: 18px; align-self: flex-end; margin-top: -6px; opacity: 0.4; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
  border: 1px solid transparent;
  font-family: inherit;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: rgba(63,185,80,0.35);
}
.btn-primary:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

[data-theme="light"] .btn-primary:hover { color: #fff; }

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--border-light);
  color: var(--text-primary);
}

.btn-success {
  background: var(--success-dim);
  color: var(--success);
  border-color: rgba(63,185,80,0.3);
}
.btn-success:hover { background: var(--success); color: #fff; }

.btn-danger {
  background: var(--danger-dim);
  color: var(--danger);
  border-color: rgba(248,81,73,0.3);
}
.btn-danger:hover { background: var(--danger); color: #fff; }

.btn-warning {
  background: var(--warning-dim);
  color: var(--warning);
  border-color: rgba(210,153,34,0.3);
}
.btn-warning:hover { background: var(--warning); color: #fff; }

.btn-info {
  background: var(--info-dim);
  color: var(--info);
  border-color: rgba(88,166,255,0.3);
}
.btn-info:hover { background: var(--info); color: #fff; }

.btn-sm { padding: 4px 10px; font-size: 11px; }
.btn-icon { padding: 5px 8px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===== Table ===== */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

thead tr { background: var(--bg-tertiary); }

th {
  padding: 9px 12px;
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
  user-select: none;
}

th[onclick] { cursor: pointer; }
th[onclick]:hover { color: var(--text-primary); }

thead th.sort-active { color: var(--accent); }
thead th.sort-asc::after { content: ' ↑'; }
thead th.sort-desc::after { content: ' ↓'; }

td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  font-size: 12.5px;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--bg-hover); }

.td-muted { color: var(--text-muted); font-size: 11.5px; }
.td-actions { display: flex; gap: 4px; flex-wrap: wrap; }

/* ===== Badges ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
  font-family: 'JetBrains Mono', monospace;
}

.badge-success { background: var(--success-dim); color: var(--success); }
.badge-danger  { background: var(--danger-dim);  color: var(--danger);  }
.badge-warning { background: var(--warning-dim); color: var(--warning); }
.badge-info    { background: var(--info-dim);    color: var(--info);    }
.badge-muted   { background: var(--bg-tertiary); color: var(--text-muted); }

/* ===== Status badges ===== */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

/* ===== AI status chips ===== */
.ai-status {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 10.5px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
}
.ai-status.safe    { background: var(--success-dim); color: var(--success); }
.ai-status.unsafe  { background: var(--danger-dim);  color: var(--danger);  }
.ai-status.pending { background: var(--warning-dim); color: var(--warning); }
.ai-status.unknown { background: var(--bg-tertiary); color: var(--text-muted); }

/* ===== Forms ===== */
.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }

.form-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.form-control {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  transition: border-color var(--transition), background var(--transition);
}
.form-control:focus {
  border-color: var(--accent);
  background: var(--bg-card);
}
.form-control::placeholder { color: var(--text-muted); }

textarea.form-control { resize: vertical; min-height: 80px; }
select.form-control { cursor: pointer; }

.form-hint { font-size: 11px; color: var(--text-muted); line-height: 1.5; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

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

/* ===== Filter bar ===== */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.filter-select {
  padding: 6px 24px 6px 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238b949e'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}
.filter-select:focus { border-color: var(--accent); outline: none; }
.filter-input {
  padding: 6px 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 12px;
  outline: none;
}
.filter-input:focus { border-color: var(--accent); }
.sort-active { color: var(--primary) !important; }

/* ===== Modal ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(2px);
}
.modal-overlay.active { display: flex; }

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 10px;
}

.modal-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-close {
  color: var(--text-muted);
  font-size: 16px;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.modal-close:hover { color: var(--text-primary); background: var(--bg-hover); }

.modal-body {
  overflow-y: auto;
  padding: 18px;
  flex: 1;
}

/* ===== Toast ===== */
#toast-container {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 20000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 320px;
  pointer-events: none;
}

.toast {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 12px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: flex-start;
  gap: 8px;
  pointer-events: all;
  animation: toast-in 0.2s ease;
  line-height: 1.5;
  max-width: 320px;
}
.toast.toast-success { border-left: 3px solid var(--success); }
.toast.toast-error   { border-left: 3px solid var(--danger);  }
.toast.toast-warning { border-left: 3px solid var(--warning); }
.toast.toast-info    { border-left: 3px solid var(--info);    }
.toast-title { font-weight: 600; color: var(--text-primary); }
.toast-msg { color: var(--text-secondary); font-size: 11.5px; }

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

/* ===== Loading ===== */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px;
  color: var(--text-muted);
  font-size: 13px;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Empty state ===== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 8px;
  text-align: center;
  color: var(--text-muted);
}
.empty-icon { font-size: 36px; margin-bottom: 6px; }
.empty-title { font-size: 15px; font-weight: 600; color: var(--text-secondary); }
.empty-desc { font-size: 12px; line-height: 1.6; max-width: 320px; }

/* ===== Auth screen ===== */
.auth-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  z-index: 50000;
  overflow: hidden;
}

#matrix-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.5;
}

[data-theme="light"] #matrix-canvas { opacity: 0.08; }

.auth-box {
  position: relative;
  z-index: 1;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  width: 100%;
  max-width: 360px;
  margin: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.4);
}

[data-theme="light"] .auth-box {
  box-shadow: 0 4px 24px rgba(0,0,0,0.12);
}

.auth-logo { text-align: center; margin-bottom: 22px; }
.auth-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}
.auth-subtitle { font-size: 11px; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; }

.auth-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 18px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  padding: 3px;
}

.auth-tab {
  flex: 1;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: 3px;
  text-align: center;
  letter-spacing: 0.05em;
  font-family: 'JetBrains Mono', monospace;
}
.auth-tab.active {
  background: var(--bg-secondary);
  color: var(--accent);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.auth-tab:hover:not(.active) { color: var(--text-primary); }

/* ===== Campaign cards ===== */
.campaign-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
  transition: border-color var(--transition);
  overflow-x: hidden;
  box-sizing: border-box;
}
.campaign-card:hover { border-color: var(--border-light); }

.campaign-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.campaign-message {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin: 10px 0;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--border);
}

.campaign-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  font-size: 11.5px;
  color: var(--text-muted);
}
.meta-item { display: inline-flex; align-items: center; gap: 3px; }

/* Campaign actions row */
.campaign-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

/* ===== Account cards ===== */
.account-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
  transition: border-color var(--transition);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.account-card:hover { border-color: var(--border-light); }

.account-header { display: flex; align-items: flex-start; gap: 12px; }
.account-avatar {
  width: 40px; height: 40px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.account-info { flex: 1; min-width: 0; }
.account-phone { font-weight: 700; font-size: 13px; }
.account-username { font-size: 11.5px; color: var(--text-muted); }
.account-actions { display: flex; gap: 4px; flex-wrap: wrap; }

/* ===== Checkbox-wrap (checkable rows in lists) ===== */
.checkbox-wrap {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}
.checkbox-wrap span { min-width: 0; overflow: hidden; }

/* ===== Task items ===== */
.task-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.task-item:last-child { border-bottom: none; }
.task-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.task-type { font-size: 12px; font-weight: 600; color: var(--text-primary); }
.task-status { flex-shrink: 0; }

/* ===== Help block ===== */
.help-block {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.help-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.55;
}
.help-item-icon { font-size: 14px; flex-shrink: 0; margin-top: 1px; }
.help-item-text b { color: var(--text-primary); }

/* ===== Groups tabs ===== */
.groups-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 14px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  padding: 3px;
  width: fit-content;
  border: 1px solid var(--border);
}
.groups-tab-btn {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: 3px;
}
.groups-tab-btn.active { background: var(--bg-secondary); color: var(--accent); font-weight: 600; }
.groups-tab-btn:hover:not(.active) { color: var(--text-primary); }

/* ===== Activity feed ===== */
.activity-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 14px;
  height: calc(100vh - var(--header-height) - 36px);
}

.activity-feed-wrap {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  overflow: hidden;
}

.activity-feed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg-tertiary);
}
.activity-feed-header h3 {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.live-dot {
  width: 7px; height: 7px;
  background: var(--danger);
  border-radius: 50%;
  display: inline-block;
  animation: pulse-dot 1.5s infinite;
}

.activity-tabs {
  display: flex;
  gap: 2px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg-secondary);
  overflow-x: auto;
}

.activity-tab-btn {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  flex-shrink: 0;
  border: 1px solid transparent;
}
.activity-tab-btn.active {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: rgba(63,185,80,0.25);
  font-weight: 600;
}
.activity-tab-btn:hover:not(.active) {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.activity-feed {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 1.5;
  border: 1px solid transparent;
}
.activity-item:hover { background: var(--bg-hover); }

.activity-icon { font-size: 11px; font-family: 'JetBrains Mono', monospace; flex-shrink: 0; margin-top: 2px; width: 14px; text-align: center; }
.activity-content { flex: 1; min-width: 0; }
.activity-text { color: var(--text-secondary); word-break: break-word; }
.activity-time { font-size: 10px; color: var(--text-muted); margin-top: 1px; font-family: 'JetBrains Mono', monospace; }

.activity-item.level-info    .activity-icon { color: var(--info); }
.activity-item.level-success  .activity-icon { color: var(--success); }
.activity-item.level-warning  .activity-icon { color: var(--warning); }
.activity-item.level-error    .activity-icon { color: var(--danger); }
.activity-item.level-ai       .activity-icon { color: #a78bfa; }
.activity-item.level-ai       .activity-text { color: #c4b5fd; }

.activity-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 100%;
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
  padding: 40px;
}
.activity-empty-icon { font-size: 28px; }

.activity-stats-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}

.activity-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.activity-stat-card h4 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 10px;
  font-family: 'JetBrains Mono', monospace;
}

.activity-counters { display: flex; flex-direction: column; gap: 6px; }
.activity-counter-row { display: flex; align-items: center; justify-content: space-between; font-size: 12px; }
.activity-counter-label { color: var(--text-secondary); }
.activity-counter-val { font-weight: 700; font-family: 'JetBrains Mono', monospace; color: var(--text-primary); }

/* ===== Content grid ===== */
.content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* ===== Settings ===== */
.settings-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}
.settings-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 14px;
  font-family: 'JetBrains Mono', monospace;
}

/* ===== Admin panel ===== */
.admin-user-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.admin-user-avatar { font-size: 24px; flex-shrink: 0; }
.admin-user-info { flex: 1; min-width: 0; }
.admin-user-email { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 4px; }
.admin-user-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.admin-user-stats { display: flex; flex-wrap: wrap; gap: 6px; }
.admin-user-stat { font-size: 11px; color: var(--text-muted); }
.admin-user-actions { display: flex; flex-direction: column; gap: 4px; flex-shrink: 0; }

/* ===== Sort controls ===== */
.sort-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-family: 'JetBrains Mono', monospace;
  flex-wrap: wrap;
}
.sort-bar label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; }
.sort-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 3px 8px;
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-secondary);
  cursor: pointer;
}
.sort-btn.active { color: var(--accent); border-color: var(--accent); }
.sort-btn:hover { color: var(--text-primary); border-color: var(--border-light); }

/* ===== Guide/manual ===== */
.guide-page { max-width: 720px; display: flex; flex-direction: column; gap: 14px; }

/* ===== Mobile menu button ===== */
.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 16px;
  flex-shrink: 0;
}
.mobile-menu-btn:hover { color: var(--text-primary); border-color: var(--border-light); }

/* Sidebar overlay (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}
.sidebar-overlay.active { display: block; }

/* ===== Page help block ===== */
.page-help {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

/* ===== Terminal decorations ===== */
.terminal-box {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  background: var(--bg-tertiary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  position: relative;
}
.terminal-box::before {
  content: attr(data-title);
  position: absolute;
  top: -8px; left: 12px;
  background: var(--bg-primary);
  padding: 0 6px;
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 0.06em;
  font-weight: 600;
}

/* ===== Misc ===== */
.page-top-action { margin-bottom: 12px; }
.section-gap { margin-bottom: 14px; }
.flex-gap { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Banner */
.banner {
  background: var(--info-dim);
  border: 1px solid var(--info);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  flex-wrap: wrap;
}

/* ===== Monitoring status ===== */
.monitor-status-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
}

/* ===== Pending search results ===== */
.pending-result-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
}
.pending-result-item:hover { background: var(--bg-hover); }
.pending-result-item:last-child { border-bottom: none; }

/* ===== Glitch animation (minimal, for auth title only) ===== */
@keyframes glitch {
  0%, 90%, 100% { transform: none; text-shadow: none; }
  92% { transform: translateX(-1px); text-shadow: 1px 0 var(--danger); }
  94% { transform: translateX(1px); text-shadow: -1px 0 var(--info); }
  96% { transform: none; }
}
.auth-title { animation: glitch 8s infinite; }

/* ===== Mobile hamburger toggle ===== */
@media (max-width: 768px) {
  .mobile-menu-btn { display: flex; }

  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 4px 0 24px rgba(0,0,0,0.3);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }

  .main { width: 100%; }
}

/* ===== Mobile responsive (≤640px) ===== */
@media (max-width: 640px) {
  body { font-size: 12px; }

  .page { padding: 12px; }
  .header { padding: 0 12px; }
  .header-title { font-size: 11.5px; }
  .header-actions { gap: 4px; }
  .header-actions .btn { font-size: 10px; padding: 4px 8px; }

  /* Sidebar footer — compact */
  .sidebar-footer { padding: 8px 10px; }

  /* Stats grid — 2 columns on small screens */
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-value { font-size: 20px; }

  /* Buttons */
  .btn { font-size: 11px; padding: 6px 10px; }
  .btn-sm { font-size: 10px; padding: 3px 8px; }

  /* Filter bar */
  .filter-bar { gap: 5px; }
  .filter-select { font-size: 11px; padding: 5px 22px 5px 8px; }

  /* Prevent iOS zoom on input focus — inputs need font-size >= 16px */
  .form-control,
  input[type="text"], input[type="email"], input[type="password"],
  input[type="number"], input[type="tel"], input[type="search"],
  textarea, select {
    font-size: 16px !important;
  }
  /* Keep modal and assistant chat inputs stable when keyboard opens */
  .modal { position: fixed; }
  #assistant-wrap { touch-action: pan-y; }

  /* ===== Mobile Table Card View ===== */
  .table-wrap { overflow-x: visible; border-radius: var(--radius-sm); }
  .table-wrap table { display: block; }
  .table-wrap thead { display: none; }
  .table-wrap tbody { display: block; }
  .table-wrap tbody tr {
    display: block;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    background: var(--bg-card);
    overflow: hidden;
  }
  .table-wrap tbody tr:hover { background: var(--bg-hover); }
  .table-wrap tbody td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 7px 10px;
    border-bottom: 1px solid var(--border);
    font-size: 11.5px;
    gap: 8px;
    min-height: 30px;
    word-break: break-word;
  }
  .table-wrap tbody td:last-child { border-bottom: none; }
  .table-wrap tbody td::before {
    content: attr(data-label);
    font-weight: 700;
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    flex-shrink: 0;
    min-width: 72px;
    padding-top: 2px;
    font-family: 'JetBrains Mono', monospace;
  }
  .table-wrap tbody td[data-label=""] { display: none; }
  .table-wrap tbody td:has(input[type="checkbox"]) {
    display: flex;
    padding: 10px 12px;
    justify-content: flex-start;
    align-items: center;
    background: var(--bg-tertiary);
    border-bottom: 2px solid var(--border);
  }
  .table-wrap tbody td:has(input[type="checkbox"]) input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--accent);
  }
  .table-wrap tbody td:has(input[type="checkbox"])::before { display: none; }
  /* Make entire row tappable on mobile — click row = toggle checkbox */
  .table-wrap tbody tr { cursor: pointer; }
  .td-actions { justify-content: flex-end; flex-wrap: wrap; gap: 3px; }
  /* Show inline meta in Группа cell, hide separate columns on mobile */
  .mobile-meta { display: block !important; margin-top: 3px; }
  .table-wrap tbody td[data-label="Участники"],
  .table-wrap tbody td[data-label="Страна"],
  .table-wrap tbody td[data-label="Риск бана"] { display: none; }

  /* Modal */
  .modal { width: 97%; max-width: 97vw; max-height: 90vh; }
  .modal-body { padding: 10px; overflow-x: hidden; word-break: break-word; }
  .modal-header { padding: 10px 12px; }
  .modal-header h3 { font-size: 13px; }

  /* Forms */
  .form-row { grid-template-columns: 1fr; }
  .form-actions { flex-direction: column; }
  .form-actions .btn { width: 100%; justify-content: center; }

  /* Auth */
  .auth-box { padding: 20px 14px; margin: 10px; }

  /* Toast */
  #toast-container { bottom: 10px; right: 6px; left: 6px; max-width: 100%; }
  .toast { min-width: 0; max-width: 100%; }

  /* Content grid */
  .content-grid { grid-template-columns: 1fr; }

  /* Settings */
  .settings-section { padding: 12px; }

  /* Activity — stack vertically */
  .activity-layout {
    grid-template-columns: 1fr;
    height: auto;
    gap: 10px;
  }
  .activity-feed-wrap { min-height: 320px; }
  .activity-feed { height: 280px; }
  .activity-tabs { padding: 5px 6px; gap: 2px; }
  .activity-tab-btn { font-size: 10.5px; padding: 4px 8px; }
  /* Stack counters and categories vertically on mobile */
  .activity-stats-panel { flex-direction: column; gap: 8px; overflow-x: unset; }
  .activity-stat-card { flex-shrink: unset; min-width: unset; width: 100%; }

  /* Campaign cards — mobile adapt */
  .campaign-card { padding: 12px; overflow-x: hidden; }
  .campaign-actions { gap: 4px; }
  .campaign-actions .btn { font-size: 10.5px; padding: 4px 9px; }
  .campaign-message { font-size: 11.5px; white-space: pre-wrap; word-break: break-word; overflow-wrap: break-word; max-width: 100%; box-sizing: border-box; }
  .campaign-meta { font-size: 10.5px; }

  /* Account cards */
  .account-actions { flex-wrap: wrap; gap: 3px; }
  .account-actions .btn { font-size: 10.5px; padding: 4px 8px; }

  /* Admin panel */
  .admin-user-card { flex-direction: column; gap: 8px; }
  .admin-user-actions { flex-direction: row; flex-wrap: wrap; }

  /* Page top action */
  .page-top-action { margin-bottom: 10px; }

  /* Groups tabs */
  .groups-tabs { width: 100%; }
  .groups-tab-btn { flex: 1; text-align: center; font-size: 11px; padding: 6px 6px; }
}

/* ===== Sort headers responsive ===== */
@media (max-width: 400px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

/* ===== Global overflow protection ===== */
*, *::before, *::after { box-sizing: border-box; }
img, video, canvas, svg, iframe { max-width: 100%; height: auto; }
.page, .modal-body, .card, .campaign-card, .account-card { overflow-x: hidden; overflow-wrap: break-word; word-break: break-word; }
pre, code { overflow-x: auto; white-space: pre-wrap; word-break: break-all; max-width: 100%; }
.task-item { overflow: hidden; word-break: break-word; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ===== Floating Voice Widget ===== */
#voice-float-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  cursor: pointer;
  z-index: 2000;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4), 0 0 0 0 rgba(63,185,80,0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.3s ease, border-color 0.3s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
#voice-float-btn:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(0,0,0,0.5), 0 0 0 6px rgba(63,185,80,0.18); }
#voice-float-btn.vf-wake-active::after {
  content: '';
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 0 rgba(63,185,80,0.6);
  animation: vf-wake-dot 2s ease-in-out infinite;
}
@keyframes vf-wake-dot {
  0%,100% { box-shadow: 0 0 0 0 rgba(63,185,80,0.6); }
  50%     { box-shadow: 0 0 0 5px rgba(63,185,80,0); }
}
#voice-float-btn.vf-listening {
  background: linear-gradient(135deg, var(--danger), #c0392b);
  border-color: var(--danger);
  animation: vf-pulse-red 1.4s ease-in-out infinite;
}
#voice-float-btn.vf-speaking {
  background: linear-gradient(135deg, var(--info), #1a6fd1);
  border-color: var(--info);
  animation: vf-speak 0.7s ease-in-out infinite alternate;
}
@keyframes vf-pulse-red {
  0%,100% { box-shadow: 0 4px 20px rgba(0,0,0,0.4), 0 0 0 0 rgba(248,81,73,0.5); }
  50%      { box-shadow: 0 4px 20px rgba(0,0,0,0.4), 0 0 0 14px rgba(248,81,73,0); }
}
@keyframes vf-speak {
  0%   { transform: scale(1); }
  100% { transform: scale(1.1); }
}

#voice-float-panel {
  position: fixed;
  bottom: 88px;
  right: 24px;
  width: 308px;
  max-width: calc(100vw - 32px);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  z-index: 1999;
  overflow: hidden;
  transform-origin: bottom right;
  animation: vf-panel-in 0.2s cubic-bezier(.34,1.56,.64,1);
}
@keyframes vf-panel-in {
  from { transform: scale(0.75) translateY(20px); opacity: 0; }
  to   { transform: scale(1) translateY(0);       opacity: 1; }
}
.vf-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border);
}
.vf-title {
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}
.vf-title-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--success);
  animation: vf-blink 1.2s step-end infinite;
}
@keyframes vf-blink { 0%,100%{opacity:1} 50%{opacity:0} }
.vf-close {
  background: none; border: none;
  color: var(--text-muted); cursor: pointer;
  font-size: 15px; padding: 2px 5px;
  border-radius: var(--radius-sm);
  transition: color 0.15s;
  line-height: 1;
}
.vf-close:hover { color: var(--text-primary); }

.vf-wave {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 14px;
  min-height: 52px;
}
.vf-bar {
  width: 3px; height: 4px;
  background: var(--accent);
  border-radius: 2px;
  transition: height 0.1s ease;
}
.vf-wave.active .vf-bar { animation: vf-bar-anim 1s ease-in-out infinite; }
.vf-bar:nth-child(1)  { animation-delay:0s }
.vf-bar:nth-child(2)  { animation-delay:.08s }
.vf-bar:nth-child(3)  { animation-delay:.16s }
.vf-bar:nth-child(4)  { animation-delay:.24s }
.vf-bar:nth-child(5)  { animation-delay:.32s }
.vf-bar:nth-child(6)  { animation-delay:.40s }
.vf-bar:nth-child(7)  { animation-delay:.32s }
.vf-bar:nth-child(8)  { animation-delay:.24s }
.vf-bar:nth-child(9)  { animation-delay:.16s }
.vf-bar:nth-child(10) { animation-delay:.08s }
@keyframes vf-bar-anim {
  0%,100% { height: 4px; }
  50%     { height: 26px; }
}
.vf-status {
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
  text-align: center;
  padding: 0 14px 10px;
  min-height: 22px;
}
.vf-subtitles {
  padding: 0 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 36px;
}
.vf-sub-user {
  font-size: 11px;
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  line-height: 1.4;
  word-break: break-word;
  min-height: 15px;
  opacity: 0.85;
}
.vf-sub-jarvis {
  font-size: 11px;
  color: var(--accent);
  font-family: 'Inter', sans-serif;
  line-height: 1.4;
  word-break: break-word;
  min-height: 15px;
  font-style: italic;
}

@media (max-width: 480px) {
  #voice-float-btn  { bottom: 16px; right: 14px; width: 48px; height: 48px; font-size: 20px; }
  #voice-float-panel{ bottom: 76px; right: 14px; width: calc(100vw - 28px); }
}
