@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Sora:wght@600;700;800&family=Fira+Code:wght@400;500&display=swap');

:root {
  --bg: #0b0d13;
  --surface: #12141c;
  --surface-2: #181b26;
  --surface-3: #202434;
  --border: #282d3f;
  --border-hover: #383f58;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-faint: #64748b;
  --accent: #10b981;
  --accent-dim: rgba(16, 185, 129, 0.12);
  --danger: #ef4444;
  --danger-dim: rgba(239, 68, 68, 0.12);
  --warning: #f59e0b;
  --warning-dim: rgba(245, 158, 11, 0.14);
  --info: #38bdf8;
  --info-dim: rgba(56, 189, 248, 0.12);
  --purple: #a855f7;
  --purple-dim: rgba(168, 85, 247, 0.12);
  --gold: #fbbf24;
  --gold-dim: rgba(251, 191, 36, 0.12);
  --radius: 10px;
  --radius-lg: 14px;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Sora', system-ui, sans-serif;
  --font-mono: 'Fira Code', monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: var(--font-sans);
}

body {
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .font-display {
  font-family: var(--font-display);
}

.font-mono {
  font-family: var(--font-mono);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: all 0.2s ease;
}
a:hover {
  text-decoration: underline;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--surface);
}
::-webkit-scrollbar-thumb {
  background: var(--border-hover);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #3b3d45;
}

/* Buttons - Tactile & Generous */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  min-height: 38px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  line-height: 1;
}
.btn-primary {
  background: var(--accent);
  color: #042f2e;
  border-color: #059669;
  font-weight: 700;
}
.btn-primary:hover {
  background: #34d399;
  border-color: #10b981;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.35);
  transform: translateY(-1px);
}
.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover {
  background: var(--surface-3);
  border-color: var(--border-hover);
  color: #fff;
  transform: translateY(-1px);
}
.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: #dc2626;
}
.btn-danger:hover {
  background: #f87171;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.35);
}
.btn-danger-soft {
  background: var(--danger-dim);
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.3);
}
.btn-danger-soft:hover {
  background: rgba(239, 68, 68, 0.22);
  color: #fff;
}
.btn-sm {
  min-height: 34px;
  padding: 6px 14px;
  font-size: 12.5px;
  border-radius: 7px;
}
.btn-icon {
  width: 34px;
  height: 34px;
  min-width: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.18s ease;
}
.btn-icon:hover {
  background: var(--surface-3);
  border-color: var(--border-hover);
  color: #fff;
}
.btn-icon-danger:hover {
  background: var(--danger-dim);
  border-color: rgba(239, 68, 68, 0.4);
  color: var(--danger);
}

/* Inputs */
.input-field {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: all 0.2s ease;
}
.input-field:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim);
}
.input-field::placeholder {
  color: var(--text-faint);
}

/* Pulsing Status Dot */
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.pulse-dot.online {
  background: var(--accent);
  animation: pulse-green 2s infinite;
}
.pulse-dot.offline {
  background: var(--text-faint);
}
.pulse-dot.connecting {
  background: var(--warning);
  animation: pulse-yellow 2s infinite;
}
@keyframes pulse-green {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(52, 211, 166, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(52, 211, 166, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(52, 211, 166, 0); }
}
@keyframes pulse-yellow {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(232, 173, 74, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(232, 173, 74, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(232, 173, 74, 0); }
}

/* ==================== TWO-COLUMN APP SHELL ==================== */
.shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* Slot Sidebar */
.slot-sidebar {
  width: 270px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: 100vh;
  position: sticky;
  top: 0;
}
.slot-sidebar-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.slot-list {
  padding: 12px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.slot-item {
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}
.slot-item:hover {
  border-color: var(--border-hover);
  transform: translateY(-1px);
}
.slot-item.active {
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), inset 0 0 0 1px var(--accent);
}
.slot-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}
.slot-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.slot-avatar-img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.slot-avatar-placeholder {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--surface-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.slot-pulse-badge {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid var(--surface-2);
  z-index: 2;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.6);
}
.slot-pulse-badge.online {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}
.slot-pulse-badge.offline {
  background: #64748b;
}

/* Token Modal Profile Preview Card */
.token-profile-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 16px;
}
.token-profile-avatar-wrap {
  position: relative;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
}
.token-profile-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
}
.token-profile-status {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--surface-2);
  box-shadow: 0 0 6px var(--accent);
}
.token-profile-info {
  flex: 1;
  min-width: 0;
}
.token-profile-name {
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.token-profile-sub {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.slot-meta {
  flex: 1;
  min-width: 0;
}
.slot-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.slot-status-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  margin-top: 3px;
}
.slot-footer {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
}
.slot-sidebar-bottom {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  margin-top: auto;
}

.discord-guild-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: all 0.22s ease;
  position: relative;
  overflow: hidden;
}

.discord-guild-card:hover {
  background: var(--surface-3);
  border-color: rgba(88, 101, 242, 0.45);
  box-shadow: 0 4px 16px rgba(88, 101, 242, 0.18);
  transform: translateY(-1px);
  text-decoration: none;
}

.guild-avatar-wrap {
  position: relative;
  width: 36px;
  height: 36px;
  min-width: 36px;
  flex-shrink: 0;
}

.guild-avatar {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: block;
}

.guild-online-indicator {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--surface-2);
  box-shadow: 0 0 6px var(--accent);
}

.guild-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.guild-name-row {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.guild-title {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.2px;
}

.guild-discord-icon {
  color: #5865F2;
  font-size: 11px;
  flex-shrink: 0;
}

.guild-presence-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.presence-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.presence-stat strong, .presence-stat span:not(.presence-dot) {
  font-weight: 600;
}

.presence-online {
  color: var(--accent);
}

.presence-offline {
  color: var(--text-muted);
}

.presence-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.presence-dot.online {
  background: var(--accent);
  box-shadow: 0 0 5px var(--accent);
}

.presence-dot.offline {
  background: #64748b;
}

.presence-sep {
  color: var(--text-faint);
  font-size: 8px;
}

.guild-card-arrow {
  font-size: 10px;
  color: var(--text-faint);
  transition: transform 0.2s ease, color 0.2s ease;
  margin-left: 2px;
  flex-shrink: 0;
}

.discord-guild-card:hover .guild-card-arrow {
  color: #5865F2;
  transform: translateX(2px);
}

/* Main Content Wrapper */
.main-content-wrapper {
  flex: 1;
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  box-sizing: border-box;
}

/* Sidebar Backdrop for Mobile Off-Canvas Drawer */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1040;
  transition: opacity 0.25s ease;
}
.sidebar-backdrop.active {
  display: block;
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.mobile-menu-toggle:hover {
  background: var(--surface-3);
  border-color: var(--border-hover);
  color: #fff;
}
.mobile-menu-toggle:active {
  transform: scale(0.95);
}

/* Topbar */
.topbar {
  min-height: 64px;
  height: auto;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 20;
  gap: 14px;
  box-sizing: border-box;
  width: 100%;
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand-avatar-wrap {
  position: relative;
  width: 36px;
  height: 36px;
  min-width: 36px;
  flex-shrink: 0;
}

.brand-avatar-img {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: cover;
  border: 1.5px solid rgba(52, 211, 166, 0.4);
  box-shadow: 0 2px 10px rgba(52, 211, 166, 0.2);
  display: block;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.brand-avatar-img:hover {
  transform: scale(1.06);
  box-shadow: 0 0 16px rgba(52, 211, 166, 0.45);
}

.brand-avatar-status {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--surface);
  box-shadow: 0 0 6px var(--accent);
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.brand-heading {
  font-size: 15.5px;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: #fff;
  line-height: 1.1;
  white-space: nowrap;
  margin: 0;
}

.brand-highlight {
  color: var(--accent);
}

.brand-chip {
  font-size: 9px;
  font-weight: 700;
  padding: 1.5px 5px;
  border-radius: 4px;
  background: rgba(52, 211, 166, 0.12);
  color: var(--accent);
  border: 1px solid rgba(52, 211, 166, 0.3);
  letter-spacing: 0.4px;
  text-transform: uppercase;
  font-family: var(--font-mono);
  display: inline-block;
  line-height: 1.2;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
  color: #000;
  box-shadow: 0 2px 8px rgba(52, 211, 166, 0.25);
  flex-shrink: 0;
}
.topbar h1 {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  white-space: nowrap;
}
.topbar-sub {
  font-size: 10.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  white-space: nowrap;
}

.topbar-center {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  min-width: max-content;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
  justify-content: flex-end;
  margin-left: auto;
}
.topbar-secondary-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 0 1 auto;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 2px 2px;
}
.topbar-secondary-actions::-webkit-scrollbar {
  display: none;
}
.topbar-secondary-actions .btn {
  padding: 5px 9px;
  font-size: 11.5px;
  flex-shrink: 0;
  min-height: 32px;
  white-space: nowrap;
}

/* ==================== CYBER BEACON FEATURE STATUS INDICATORS ==================== */
.btn-feature {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  position: relative;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 5px 10px !important;
}

.btn-feature .btn-label {
  display: inline-block;
  line-height: 1;
}

.cyber-beacon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 8px;
  height: 8px;
  margin-left: 2px;
  flex-shrink: 0;
}

.beacon-core {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 2;
}

.beacon-ping {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  z-index: 1;
  transition: opacity 0.3s ease;
}

/* OFF / INACTIVE STATE */
.cyber-beacon[data-status="off"] .beacon-core {
  background: rgba(255, 255, 255, 0.18);
  box-shadow: none;
}
.cyber-beacon[data-status="off"] .beacon-ping {
  display: none;
}

/* RPC ACTIVE (Purple Neon Theme) */
.btn-feature.active-rpc {
  border-color: rgba(168, 85, 247, 0.5) !important;
  background: rgba(168, 85, 247, 0.08) !important;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.18);
}
.btn-feature.active-rpc .feature-icon {
  filter: drop-shadow(0 0 6px rgba(168, 85, 247, 0.7));
}
.cyber-beacon[data-feature="rpc"][data-status="on"] .beacon-core {
  background: #a855f7;
  box-shadow: 0 0 6px #a855f7, 0 0 12px rgba(168, 85, 247, 0.8);
}
.cyber-beacon[data-feature="rpc"][data-status="on"] .beacon-ping {
  opacity: 1;
  background: rgba(168, 85, 247, 0.5);
  animation: beacon-radar-purple 2.2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

/* AUTO REPLY ACTIVE (Cyber Cyan Theme) */
.btn-feature.active-autoreply {
  border-color: rgba(6, 182, 212, 0.5) !important;
  background: rgba(6, 182, 212, 0.08) !important;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.18);
}
.btn-feature.active-autoreply .feature-icon {
  filter: drop-shadow(0 0 6px rgba(6, 182, 212, 0.7));
}
.cyber-beacon[data-feature="autoreply"][data-status="on"] .beacon-core {
  background: #06b6d4;
  box-shadow: 0 0 6px #06b6d4, 0 0 12px rgba(6, 182, 212, 0.8);
}
.cyber-beacon[data-feature="autoreply"][data-status="on"] .beacon-ping {
  opacity: 1;
  background: rgba(6, 182, 212, 0.5);
  animation: beacon-radar-cyan 2.2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

/* KEYWORDS ACTIVE (Emerald Neon Theme) */
.btn-feature.active-keywords {
  border-color: rgba(16, 185, 129, 0.5) !important;
  background: rgba(16, 185, 129, 0.08) !important;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.18);
}
.btn-feature.active-keywords .feature-icon {
  filter: drop-shadow(0 0 6px rgba(16, 185, 129, 0.7));
}
.cyber-beacon[data-feature="keywords"][data-status="on"] .beacon-core {
  background: #10b981;
  box-shadow: 0 0 6px #10b981, 0 0 12px rgba(16, 185, 129, 0.8);
}
.cyber-beacon[data-feature="keywords"][data-status="on"] .beacon-ping {
  opacity: 1;
  background: rgba(16, 185, 129, 0.5);
  animation: beacon-radar-emerald 2.2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

/* NOTIFY ACTIVE (Amber / Gold Alert Theme) */
.btn-feature.active-notify {
  border-color: rgba(245, 158, 11, 0.5) !important;
  background: rgba(245, 158, 11, 0.08) !important;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.18);
}
.btn-feature.active-notify .feature-icon {
  filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.7));
}
.cyber-beacon[data-feature="notify"][data-status="on"] .beacon-core {
  background: #f59e0b;
  box-shadow: 0 0 6px #f59e0b, 0 0 12px rgba(245, 158, 11, 0.8);
}
.cyber-beacon[data-feature="notify"][data-status="on"] .beacon-ping {
  opacity: 1;
  background: rgba(245, 158, 11, 0.5);
  animation: beacon-radar-amber 2.2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

/* BREATHING RADAR PULSE KEYFRAMES */
@keyframes beacon-radar-purple {
  0% { transform: scale(0.9); opacity: 0.8; }
  65% { transform: scale(2.6); opacity: 0; }
  100% { transform: scale(2.6); opacity: 0; }
}

@keyframes beacon-radar-cyan {
  0% { transform: scale(0.9); opacity: 0.8; }
  65% { transform: scale(2.6); opacity: 0; }
  100% { transform: scale(2.6); opacity: 0; }
}

@keyframes beacon-radar-amber {
  0% { transform: scale(0.9); opacity: 0.8; }
  65% { transform: scale(2.6); opacity: 0; }
  100% { transform: scale(2.6); opacity: 0; }
}

@keyframes beacon-radar-emerald {
  0% { transform: scale(0.9); opacity: 0.8; }
  65% { transform: scale(2.6); opacity: 0; }
  100% { transform: scale(2.6); opacity: 0; }
}
.topbar-primary-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.view-switcher {
  display: flex;
  align-items: center;
  gap: 3px;
  background: var(--surface-2);
  padding: 2px;
  border-radius: 7px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.view-switcher .nav-tab-btn {
  padding: 5px 10px;
  font-size: 11.5px;
}

.searchbar {
  position: relative;
  width: 140px;
  min-width: 105px;
  flex: 0 1 140px;
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}
.searchbar:focus-within {
  width: 175px;
  flex: 0 1 175px;
}
.searchbar i {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  font-size: 11px;
}
.searchbar input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 6px 10px 6px 30px;
  font-size: 11.5px;
  color: var(--text);
  outline: none;
  transition: all 0.2s ease;
}
.searchbar input:focus {
  border-color: var(--accent);
}

.seg-filter {
  display: flex;
  align-items: center;
  background: var(--surface-2);
  padding: 2px;
  border-radius: 7px;
  border: 1px solid var(--border);
  font-size: 11.5px;
  flex-shrink: 0;
}
.seg-btn {
  padding: 4px 8px;
  border-radius: 5px;
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 500;
  border: none;
  background: transparent;
  transition: all 0.15s ease;
}
.seg-btn.active {
  background: var(--surface-3);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

@media (min-width: 1650px) {
  .topbar-secondary-actions {
    max-width: none;
  }
  .searchbar {
    width: 220px;
  }
}

/* Stat Strip */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.stat-pill {
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.stat-pill-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.stat-pill-val {
  font-size: 24px;
  font-weight: 700;
  font-family: var(--font-display);
  color: #fff;
  margin-top: 4px;
}
.stat-pill-sub {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 500;
}
.badge-mini-mode {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
}
.badge-mini-mode.standard {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.25);
}
.badge-mini-mode.forum {
  background: rgba(168, 85, 247, 0.14);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}
.badge-mini-mode.forward {
  background: rgba(6, 182, 212, 0.14);
  color: #22d3ee;
  border: 1px solid rgba(6, 182, 212, 0.3);
}
.stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

/* Table Card */
.table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}
.table-toolbar {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.table-toolbar-left, .table-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.table-toolbar-left .btn, .table-toolbar-right .btn {
  padding: 6px 10px;
  font-size: 11.5px;
}
.batch-actions-strip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.28);
  padding: 2px 5px;
  border-radius: 8px;
  animation: batchCapsuleIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.08);
}
@keyframes batchCapsuleIn {
  from {
    opacity: 0;
    transform: translateX(-6px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}
.batch-actions-strip .btn {
  padding: 5px 9px;
  font-size: 11.5px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.batch-actions-strip .btn:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Responsive Table Container */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-lg);
}

/* Table Styles */
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}
th {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--surface);
  white-space: nowrap;
}
th.th-actions,
th:last-child {
  min-width: 130px !important;
  text-align: right !important;
  white-space: nowrap !important;
}
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}
tr:last-child td {
  border-bottom: none;
}
tr:hover td {
  background: rgba(255, 255, 255, 0.015);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
}
.badge-anti-nuke {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(52, 211, 166, 0.3);
}
.badge-variant {
  background: var(--surface-3);
  color: var(--accent);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
}

/* Modals */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.active {
  display: flex;
}
#channelPickerModal {
  z-index: 1060;
}
#serverPickerModal {
  z-index: 1150;
}

/* Sawbot-Style Server and Channel Picker */
.picker-guild-item {
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid transparent;
  transition: all 0.18s ease;
}
.picker-guild-item:hover {
  background: var(--surface-3);
  border-color: rgba(255, 255, 255, 0.08);
}
.picker-guild-item.active {
  background: rgba(52, 211, 166, 0.08);
  border-color: var(--accent);
}
.picker-guild-icon {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 8px;
  object-fit: cover;
  background: #1e1f22;
}
.picker-guild-icon-fallback {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 8px;
  background: linear-gradient(135deg, #3b82f6, #10b981);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -0.5px;
}
.picker-guild-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.picker-guild-sub {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.picker-guild-chevron {
  color: var(--text-faint);
  font-size: 11px;
  transition: transform 0.18s ease, color 0.18s ease;
  margin-right: 2px;
  flex-shrink: 0;
}
.picker-guild-item:hover .picker-guild-chevron,
.picker-guild-item.active .picker-guild-chevron {
  color: var(--accent);
  transform: translateX(2px);
}
.picker-channel-item {
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  transition: all 0.18s ease;
}
.picker-channel-item:hover {
  background: var(--surface-3);
  border-color: var(--accent);
  transform: translateX(3px);
}
.picker-channel-item.selected {
  background: rgba(52, 211, 166, 0.12);
  border-color: var(--accent);
}
.picker-channel-item.is-forum {
  border-left: 3px solid #c084fc;
}
.picker-channel-item.is-forum:hover {
  background: rgba(168, 85, 247, 0.08);
  border-color: #c084fc;
}
.picker-channel-item.is-forum.selected {
  background: rgba(168, 85, 247, 0.16);
  border-color: #c084fc;
}
.picker-channel-item.is-forum .picker-ch-checkbox {
  accent-color: #c084fc;
}
.picker-type-filter {
  display: inline-flex;
  align-items: center;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}
.picker-type-filter-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}
.picker-type-filter-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}
.picker-type-filter-btn.active {
  background: var(--surface-3);
  color: var(--accent);
  font-weight: 700;
}
.picker-type-filter-btn.active[data-type-filter="forum"] {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
}
.picker-ch-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
  margin-right: 8px;
  flex-shrink: 0;
}
.channel-picker-grid {
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 14px;
  height: 440px;
}
@media (max-width: 768px) {
  .channel-picker-grid {
    grid-template-columns: 1fr;
    height: auto;
    max-height: 62vh;
    overflow-y: auto;
    gap: 10px;
  }
  #pickerGuildsList {
    max-height: 150px !important;
    border-right: none !important;
    border-bottom: 1px solid var(--border) !important;
    padding-right: 0 !important;
    padding-bottom: 8px !important;
    margin-bottom: 8px;
  }
  #pickerChannelsWrap {
    min-height: 240px;
  }
}
.multi-ch-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  color: #fff;
  font-weight: 600;
}
.multi-ch-chip-remove {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 11px;
  transition: color 0.15s;
}
.multi-ch-chip-remove:hover {
  color: var(--danger);
}
.multi-server-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.35);
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11.5px;
  color: #e9d5ff;
  font-weight: 600;
  transition: all 0.18s ease;
}
.multi-server-chip:hover {
  background: rgba(168, 85, 247, 0.2);
  border-color: rgba(168, 85, 247, 0.6);
}
.multi-server-chip-remove {
  cursor: pointer;
  color: #c084fc;
  font-size: 11px;
  transition: color 0.15s, transform 0.15s;
  padding: 2px;
}
.multi-server-chip-remove:hover {
  color: var(--danger);
  transform: scale(1.15);
}
.picker-server-card {
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.picker-server-card:hover {
  background: var(--surface-3);
  border-color: rgba(168, 85, 247, 0.4);
}
.picker-server-card.selected {
  background: rgba(168, 85, 247, 0.12);
  border-color: #a855f7;
}
.bulk-scope-card.active {
  border-color: var(--accent) !important;
  background: rgba(52, 211, 166, 0.08) !important;
}
.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  animation: modal-slide 0.2s ease-out;
}
.modal-box form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
@keyframes modal-slide {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.modal-header h2 {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}
.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}
.modal-close:hover {
  color: #fff;
}
.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  background: var(--surface-2);
  flex-shrink: 0;
}

/* Form Styles */
.form-group {
  margin-bottom: 18px;
}
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 7px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Dynamic Alt Message Row */
.alt-msg-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  align-items: flex-start;
}
.alt-msg-row textarea {
  flex: 1;
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: #fff;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toast-in 0.2s ease-out;
}
.toast.success { border-left: 3px solid var(--accent); }
.toast.error { border-left: 3px solid var(--danger); }
@keyframes toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Floating Discord Support Button */
.discord-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #5865F2;
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  box-shadow: 0 4px 16px rgba(88, 101, 242, 0.45);
  z-index: 99;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
}
.discord-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 24px rgba(88, 101, 242, 0.65);
  color: #fff;
  text-decoration: none;
}

/* ==================== FOLDER / CAMPAIGN TABS ==================== */
.folder-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 4px;
}
.folder-bar::-webkit-scrollbar {
  display: none;
}
.folder-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  white-space: nowrap;
}
.folder-tab:hover {
  background: var(--surface-2);
  border-color: var(--border-hover);
  color: #fff;
}
.folder-tab.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 10px rgba(52, 211, 166, 0.15);
}
.folder-tab-count {
  background: var(--surface-3);
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text);
}
.folder-tab.active .folder-tab-count {
  background: rgba(52, 211, 166, 0.25);
  color: var(--accent);
}
.folder-tab-add {
  border: 1px dashed var(--border-hover);
  background: transparent;
  color: var(--text-faint);
}
.folder-tab-add:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

/* ==================== DISCORD RPC STUDIO PREVIEW ==================== */
.modal-box-wide {
  max-width: 980px !important;
}
.rpc-studio-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 860px) {
  .rpc-studio-grid {
    grid-template-columns: 1fr;
  }
}

.discord-profile-card {
  background: #232428;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.06);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: #f2f3f5;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
}
.discord-banner {
  height: 96px;
  background: linear-gradient(135deg, #5865F2 0%, #3ba55d 100%);
  position: relative;
  background-size: cover;
  background-position: center;
}
.discord-body {
  padding: 0 16px 16px 16px;
  background: #232428;
  position: relative;
}
.discord-avatar-wrap {
  position: relative;
  width: 84px;
  height: 84px;
  margin-top: -42px;
  margin-bottom: 12px;
}
.discord-avatar-img {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: 6px solid #232428;
  background: #111214;
  object-fit: cover;
  display: block;
}
.discord-status-dot {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 3.5px solid #232428;
}
.discord-status-dot.online { background-color: #23a55a; }
.discord-status-dot.idle {
  background-color: #f0b232;
  mask-image: radial-gradient(circle at 3px 3px, transparent 4px, black 4px);
  -webkit-mask-image: radial-gradient(circle at 3px 3px, transparent 4px, black 4px);
}
.discord-status-dot.dnd {
  background-color: #f23f43;
  display: flex;
  align-items: center;
  justify-content: center;
}
.discord-status-dot.dnd::after {
  content: "";
  display: block;
  width: 8px;
  height: 2.5px;
  background: #232428;
  border-radius: 1px;
}
.discord-status-dot.invisible,
.discord-status-dot.offline {
  background-color: #80848e;
  border: 4px solid #232428;
  box-shadow: inset 0 0 0 2px #232428;
}

.discord-user-details {
  background: #111214;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
}
.discord-display-name {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}
.discord-username {
  font-size: 13px;
  color: #949ba4;
  margin-top: 2px;
}
.discord-badges {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}
.discord-badge-icon {
  background: #2b2d31;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  color: #5865F2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.discord-custom-status {
  font-size: 12px;
  color: #dbdee1;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Activity Box */
.discord-activity-box {
  background: #111214;
  border-radius: 10px;
  padding: 12px;
}
.discord-activity-header {
  font-size: 11px;
  font-weight: 700;
  color: #b5bac1;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.discord-activity-body {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.discord-assets-wrap {
  position: relative;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}
.discord-large-img {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
  background: #1e1f22;
  display: block;
}
.discord-small-img {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #111214;
  object-fit: cover;
  background: #2b2d31;
  display: block;
}
.discord-activity-info {
  flex: 1;
  min-width: 0;
}
.discord-act-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.discord-act-details {
  font-size: 12px;
  color: #dbdee1;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.discord-act-state {
  font-size: 12px;
  color: #949ba4;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.discord-act-time {
  font-size: 11px;
  color: #949ba4;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
}
.discord-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.discord-btn {
  background: #4e5058;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
}
.discord-btn:hover {
  background: #6d6f78;
  text-decoration: none;
  color: #fff;
}

/* ==================== AUTO RESPONDER TABLE ==================== */
.ar-rules-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.ar-rules-table th {
  background: var(--surface-3);
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.ar-rules-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.ar-rules-table tr:last-child td {
  border-bottom: none;
}
.kw-rule-trigger-input,
.ar-rule-trigger-input,
.ar-rules-table input[type="text"] {
  width: 100%;
  background: var(--surface-1) !important;
  border: 1px solid var(--border) !important;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 12px;
  color: #fff !important;
  font-family: var(--font-mono);
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.kw-rule-trigger-input:focus,
.ar-rule-trigger-input:focus,
.ar-rules-table input[type="text"]:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
  outline: none;
}
.kw-rule-response-input,
.ar-rule-response-input,
.ar-rules-table textarea {
  width: 100%;
  background: var(--surface-1) !important;
  border: 1px solid var(--border) !important;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 12px;
  color: #fff !important;
  resize: vertical;
  min-height: 44px;
  line-height: 1.45;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.kw-rule-response-input:focus,
.ar-rule-response-input:focus,
.ar-rules-table textarea:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
  outline: none;
}

.kw-rule-mode-select {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: all var(--transition-fast);
  cursor: pointer;
}
.kw-rule-mode-select:hover {
  border-color: rgba(16, 185, 129, 0.4);
  color: #fff;
}
.kw-rule-mode-select:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
  outline: none;
  color: #fff;
}

/* ==================== KEYWORD RESPONDER ADVANCED LAYOUT ==================== */
.kw-delays-grid {
  display: flex;
  gap: 10px;
  align-items: center;
}
.kw-config-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.kw-config-col {
  display: flex;
  flex-direction: column;
}
.kw-scope-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  background: var(--surface-1);
  padding: 10px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

/* Responsive Overhaul for Keywords Modal on Tablets and Mobile Screens */
@media (max-width: 640px) {
  .kw-delays-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
    gap: 8px;
  }
  .kw-config-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .kw-scope-grid {
    flex-direction: column;
    gap: 10px;
    padding: 10px 12px;
  }
  
  /* Rules Table converts to stacked card format on mobile */
  .ar-rules-table,
  .ar-rules-table tbody,
  .ar-rules-table tr,
  .ar-rules-table td {
    display: block !important;
    width: 100% !important;
  }
  .ar-rules-table thead {
    display: none !important;
  }
  .ar-rules-table tr {
    margin-bottom: 14px;
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  }
  .ar-rules-table td {
    padding: 4px 0 !important;
    border-bottom: none !important;
  }
  .ar-rules-table td:first-child::before {
    content: "TRIGGER KEYWORDS:";
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }
  .ar-rules-table td:nth-child(2)::before {
    content: "RESPONSE MESSAGE:";
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: var(--info);
    margin-bottom: 4px;
    margin-top: 6px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
  }
  .ar-rules-table td:last-child {
    display: flex !important;
    justify-content: flex-end !important;
    margin-top: 8px;
    padding-top: 8px !important;
    border-top: 1px dashed var(--border) !important;
  }
  .ar-rules-table td:last-child button {
    min-height: 40px;
    padding: 6px 14px;
    font-size: 11.5px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }
  .ar-rules-table td:last-child button::after {
    content: " Delete";
  }

  /* Server Picker Modal Toolbar on Mobile */
  .server-picker-toolbar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }
  .server-picker-btn-group {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 6px !important;
    width: 100% !important;
  }
  .server-picker-btn-group button {
    min-height: 42px;
    justify-content: center;
  }
}

/* ==================== SAWBOT-MATCHING STATUS & ERROR CARDS ==================== */
.status-action-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.35);
  max-width: 250px;
}
.status-action-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  color: #f87171;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.status-action-desc {
  font-size: 11.5px;
  color: #fca5a5;
  line-height: 1.4;
  word-break: break-word;
  font-family: var(--font-sans);
}
.status-ready-card {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  font-size: 12px;
  font-weight: 600;
  color: #34d399;
}

/* Enhanced 2-Row Real-Time Countdown Card */
.status-countdown-card {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.22);
  min-width: 150px;
  max-width: 220px;
  transition: all 0.2s ease;
}
.status-countdown-card:hover {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.4);
}
.status-countdown-card .status-row-top {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: #34d399;
  white-space: nowrap;
}
.status-countdown-card .status-row-bottom {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  color: #94a3b8;
  white-space: nowrap;
}
.status-countdown-card .countdown-clock-icon {
  font-size: 10px;
  color: #38bdf8;
}
.status-countdown-card .countdown-digit {
  font-family: var(--font-mono, monospace);
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: 0.3px;
}
.status-countdown-card .status-preparing-text {
  font-weight: 700;
  color: #fbbf24;
  letter-spacing: 0.2px;
}

.status-paused-card {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 6px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  font-size: 12px;
  font-weight: 600;
  color: #fbbf24;
}

/* Error Row Alert Wash */
tr.table-row-error td {
  background: rgba(239, 68, 68, 0.05) !important;
}
tr.table-row-error:hover td {
  background: rgba(239, 68, 68, 0.09) !important;
}

/* ==================== CHANNEL CELL LAYOUT ==================== */
.channel-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}
.channel-avatar {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #181b26;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #38bdf8;
  flex-shrink: 0;
  overflow: hidden;
}
.channel-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.channel-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.channel-primary-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.channel-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.channel-status-dot.dot-ready { background: #10b981; box-shadow: 0 0 6px rgba(16, 185, 129, 0.5); }
.channel-status-dot.dot-error { background: #ef4444; box-shadow: 0 0 6px rgba(239, 68, 68, 0.5); }
.channel-status-dot.dot-paused { background: #f59e0b; }
.channel-sub-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-faint);
}
.channel-sub-id {
  font-family: var(--font-mono);
  color: #64748b;
}

/* ==================== DELAY GOLD PILL ==================== */
.delay-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 6px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: #fbbf24;
  font-size: 12px;
  font-family: var(--font-mono);
  font-weight: 600;
  white-space: nowrap;
}

/* ==================== IMAGE CELL BUTTON ==================== */
.image-cell-btn {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.image-cell-btn:hover {
  background: var(--surface-3);
  color: #fff;
  border-color: var(--accent);
}
.image-cell-btn.has-image {
  color: var(--accent);
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.08);
}

/* ==================== DRAFT RESTORE NOTICE ==================== */
.draft-notice {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.draft-notice button {
  background: transparent;
  border: none;
  color: #f87171;
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 700;
  text-decoration: underline;
}

/* ==================== DRAG & PASTE IMAGE ZONE ==================== */
.drop-paste-zone {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 18px;
  text-align: center;
  background: var(--surface-2);
  transition: all 0.2s ease;
  cursor: pointer;
  margin-bottom: 16px;
}
.drop-paste-zone:hover, .drop-paste-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-dim);
}

/* ==================== SAWBOT-GRADE IMAGE PICKER & LIBRARY STYLES ==================== */
.task-img-picker-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  max-height: 175px;
  overflow-y: auto;
  padding: 6px 2px;
  margin-bottom: 8px;
}
.task-img-picker-item {
  width: 72px;
  height: 72px;
  border-radius: 9px;
  border: 2px solid var(--border);
  position: relative;
  cursor: pointer;
  overflow: hidden;
  background: var(--surface-2);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
.task-img-picker-item:hover {
  border-color: rgba(255, 255, 255, 0.45);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
.task-img-picker-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.task-img-picker-item.selected {
  border-color: var(--accent) !important;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.5) !important;
  transform: scale(1.02);
}
.task-img-picker-check {
  display: none;
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  color: #000;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 900;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  z-index: 2;
}
.task-img-picker-item.selected .task-img-picker-check {
  display: flex;
}

/* Image Asset Library Cards */
.img-asset-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  overflow: hidden;
  position: relative;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
.img-asset-card:hover {
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}
.img-asset-thumb {
  width: 100%;
  height: 95px;
  object-fit: cover;
  display: block;
  background: #111;
}
.img-asset-fallback {
  width: 100%;
  height: 95px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  font-size: 11px;
}
.img-asset-footer {
  padding: 6px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  background: var(--surface-1);
}
.img-asset-name {
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-muted);
  flex: 1;
}
.img-asset-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.img-asset-actions .btn {
  padding: 3px 6px;
  font-size: 10.5px;
  line-height: 1;
}

/* ==================== ANALYTICS DASHBOARD VIEW ==================== */
.analytics-view {
  display: none;
}
.analytics-view.active {
  display: block;
}
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.analytics-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.analytics-card-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.analytics-card-value {
  font-size: 28px;
  font-weight: 800;
  font-family: var(--font-display);
  color: #fff;
}
.analytics-card-sub {
  font-size: 11.5px;
  color: var(--text-faint);
}
.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  margin-bottom: 24px;
}
.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.chart-bars-wrap {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 180px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.chart-bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  justify-content: flex-end;
}
.chart-bar-fill {
  width: 100%;
  max-width: 24px;
  background: linear-gradient(180deg, var(--accent), rgba(16, 185, 129, 0.2));
  border-radius: 4px 4px 0 0;
  transition: height 0.4s ease;
  min-height: 4px;
}
.chart-bar-label {
  font-size: 10px;
  color: var(--text-faint);
  font-family: var(--font-mono);
}

/* Navigation Segment Control */
.nav-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}
.nav-tab-btn:hover {
  color: #fff;
}
.nav-tab-btn.active {
  background: var(--surface-2);
  color: #fff;
  border-color: var(--border);
}

/* ==========================================================================
   RESPONSIVE OVERHAUL & BREAKPOINTS
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. Breakpoint: Standard Laptops (max-width: 1366px)
      - Compact secondary buttons & view tabs so topbar never overlaps
   -------------------------------------------------------------------------- */
@media (max-width: 1366px) {
  .topbar {
    gap: 8px;
    padding: 0 16px;
  }
  .topbar-center {
    flex: 0 0 auto;
  }
  .topbar-secondary-actions .btn {
    padding: 5px 8px;
    font-size: 11px;
    gap: 4px;
  }
  .view-switcher .nav-tab-btn {
    padding: 5px 8px;
    font-size: 11px;
  }
}

/* --------------------------------------------------------------------------
   1. Breakpoint: Desktop Small / High-Res Tablets (max-width: 1200px)
   -------------------------------------------------------------------------- */
@media (max-width: 1200px) {
  .stat-strip {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
  .topbar {
    padding: 0 20px;
    gap: 12px;
  }
  .searchbar {
    width: 200px;
  }
  .topbar-center {
    gap: 10px;
  }
}

/* --------------------------------------------------------------------------
   2. Breakpoint: Tablets & Small Desktops (max-width: 1024px)
      - Off-Canvas Drawer for Slot Sidebar
      - Mobile Menu Toggle Visibility
      - Topbar Layout Wrapping
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  /* Off-Canvas Slot Sidebar Drawer */
  .slot-sidebar {
    position: fixed;
    left: -290px;
    top: 0;
    bottom: 0;
    width: 280px;
    height: 100vh;
    z-index: 1050;
    transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.7);
    background: var(--surface);
  }
  .slot-sidebar.open {
    left: 0 !important;
    transform: none !important;
  }

  /* Reveal Backdrop when drawer is open */
  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1040;
  }
  .sidebar-backdrop.active {
    display: block;
  }

  /* Shell adapts to single column layout */
  .shell {
    display: block;
    width: 100%;
  }
  .main-content-wrapper {
    width: 100%;
    min-width: 0;
  }

  /* Hamburger Toggle */
  .mobile-menu-toggle {
    display: inline-flex;
  }

  /* Topbar Responsive Reflow */
  .topbar {
    height: auto;
    min-height: 56px;
    padding: 12px 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    position: sticky;
    top: 0;
    z-index: 20;
  }
  .topbar-brand {
    order: 1;
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .topbar-actions {
    display: contents;
  }
  .topbar-primary-actions {
    order: 2;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
  }
  /* Secondary buttons in clean horizontal scrollable strip */
  .topbar-secondary-actions {
    order: 3;
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 4px 0;
    width: 100%;
    max-width: 100%;
  }
  .topbar-secondary-actions::-webkit-scrollbar {
    display: none;
  }
  .topbar-secondary-actions .btn {
    flex-shrink: 0;
  }

  /* Topbar Center (Search, Filter, Tabs) takes full row */
  .topbar-center {
    order: 4;
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .searchbar {
    width: 100%;
  }

  /* Table Toolbar wrap */
  .table-toolbar {
    flex-wrap: wrap;
    gap: 12px;
  }
  .table-toolbar-left, .table-toolbar-right {
    flex-wrap: wrap;
    gap: 8px;
  }
}

/* --------------------------------------------------------------------------
   3. Breakpoint: Mobile Landscape & Tablets (max-width: 768px)
      - Single/Two-column grids reflow
      - Modals fullscreen / padded sheet
      - Touch target enhancement (min 44px)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  /* Workspace Spacing */
  main {
    padding: 16px !important;
  }

  /* Stat Strip 2x2 */
  .stat-strip {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 18px;
  }
  .stat-pill {
    padding: 14px 16px;
  }
  .stat-pill-label {
    font-size: 10.5px;
  }
  .stat-pill-val {
    font-size: 20px;
  }
  .stat-icon {
    width: 38px;
    height: 38px;
    font-size: 15px;
  }

  /* Topbar Center Controls */
  .topbar-center {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .searchbar {
    width: 100%;
  }
  .seg-filter {
    width: 100%;
    justify-content: space-around;
  }
  .seg-btn {
    flex: 1;
    text-align: center;
    padding: 6px 10px;
  }
  .view-switcher {
    width: 100%;
    display: flex;
  }
  .view-switcher .nav-tab-btn {
    flex: 1;
    justify-content: center;
  }

  /* Table Toolbar Column Flow */
  .table-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 12px 14px;
  }
  .table-toolbar-left, .table-toolbar-right {
    width: 100%;
    justify-content: flex-start;
    gap: 8px;
  }
  .table-toolbar-left .btn, .table-toolbar-right .btn {
    font-size: 12px;
  }

  /* Modals on Mobile */
  .modal-overlay {
    padding: 10px;
    align-items: center;
    justify-content: center;
  }
  .modal-box {
    width: calc(100vw - 20px) !important;
    max-width: 100% !important;
    max-height: 90vh !important;
    margin: 0 auto !important;
    border-radius: 14px !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }
  .modal-box form {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }
  .modal-header {
    padding: 14px 18px;
    flex-shrink: 0 !important;
  }
  .modal-body {
    padding: 16px;
    overflow-y: auto !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    -webkit-overflow-scrolling: touch;
  }
  .modal-footer {
    padding: 12px 16px;
    flex-shrink: 0 !important;
    flex-wrap: wrap;
    gap: 8px;
  }
  .modal-footer .btn {
    flex: 1 1 calc(50% - 6px);
    min-height: 44px;
  }

  /* Collapse 2-column form grids to 1-column */
  .form-grid-2,
  div[style*="grid-template-columns: 1fr 1fr"],
  div[style*="grid-template-columns:1fr 1fr"],
  div[style*="grid-template-columns: 1fr 1.5fr"] {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  /* Discord RPC Studio Mobile Grid */
  .rpc-studio-grid {
    grid-template-columns: 1fr !important;
  }

  /* Touch Targets (Minimum 44px for key interactions) */
  .btn {
    min-height: 40px;
  }

  /* Discord Support FAB on mobile */
  .discord-fab {
    bottom: 16px !important;
    right: 16px !important;
    width: 44px !important;
    height: 44px !important;
  }
  .btn-sm {
    min-height: 38px;
    padding: 6px 12px;
  }
  .btn-icon {
    min-width: 38px;
    min-height: 38px;
  }
  .folder-tab {
    min-height: 38px;
    padding: 8px 14px;
  }
  .nav-tab-btn {
    min-height: 38px;
  }
  .input-field {
    min-height: 42px;
    font-size: 13.5px;
  }

  /* Floating Discord FAB */
  .discord-fab {
    bottom: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    font-size: 18px;
  }
}

/* --------------------------------------------------------------------------
   4. Breakpoint: Small Mobile Phones (max-width: 480px)
      - Single column stat strip
      - Full-width button wrapping
      - Compact headers
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
  main {
    padding: 12px !important;
  }

  /* Single Column Stat Strip */
  .stat-strip {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 16px;
  }

  /* Compact Brand */
  .topbar {
    padding: 10px 12px;
  }
  .topbar h1 {
    font-size: 14.5px;
  }
  .topbar-sub {
    font-size: 10px;
  }
  .brand-mark {
    width: 30px;
    height: 30px;
    font-size: 16px;
  }

  /* Toolbar buttons on phones */
  .table-toolbar-left .btn, .table-toolbar-right .btn {
    flex: 1 1 calc(50% - 4px);
    justify-content: center;
    font-size: 11.5px;
    padding: 8px 6px;
  }

  /* Analytics Grid on phones */
  .analytics-grid {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }
  .chart-bars-wrap {
    height: 140px;
  }
  .chart-bar-fill {
    max-width: 14px;
  }
  .chart-bar-label {
    font-size: 9px;
  }

  /* Modal boxes full width on tiny screens */
  .modal-overlay {
    padding: 0;
    align-items: flex-end;
  }
  .modal-box {
    width: 100vw !important;
    max-width: 100vw !important;
    max-height: 94vh !important;
    margin: 0 !important;
    border-radius: 16px 16px 0 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }
  .modal-box form {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }
  .modal-header {
    flex-shrink: 0 !important;
  }
  .modal-body {
    overflow-y: auto !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    -webkit-overflow-scrolling: touch;
  }
  .modal-footer {
    flex-shrink: 0 !important;
  }
  .modal-footer .btn {
    flex: 1 1 100%;
  }
}

/* ==================== LANGUAGE SWITCHER ==================== */
.lang-switcher {
  display: inline-flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(52, 211, 166, 0.2);
  border-radius: 20px;
  padding: 2px;
  gap: 2px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.lang-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  user-select: none;
  outline: none;
}

.lang-btn:hover {
  color: #fff;
}

.lang-btn.active {
  background: var(--accent);
  color: #0b1411;
  font-weight: 800;
  box-shadow: 0 0 10px rgba(52, 211, 166, 0.4);
}

/* Task Mode Segmented Switcher & Badges */
.task-mode-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: var(--surface-2);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.task-mode-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 40px;
}

.task-mode-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.task-mode-btn.active {
  background: var(--surface-1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  font-weight: 700;
}

.task-mode-btn[data-mode="send"].active {
  border-color: rgba(52, 211, 166, 0.35);
  color: var(--accent);
}

.task-mode-btn[data-mode="forum"].active {
  border-color: rgba(192, 132, 252, 0.35);
  color: #c084fc;
}

.task-mode-btn[data-mode="forward"].active {
  border-color: rgba(34, 211, 238, 0.35);
  color: #22d3ee;
}

.badge-mode {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.badge-mode-send {
  background: rgba(52, 211, 166, 0.12);
  color: var(--accent);
  border: 1px solid rgba(52, 211, 166, 0.25);
}

.badge-mode-forum {
  background: rgba(168, 85, 247, 0.12);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.25);
}

.badge-mode-forward {
  background: rgba(6, 182, 212, 0.12);
  color: #22d3ee;
  border: 1px solid rgba(6, 182, 212, 0.25);
}

.forward-preview-card {
  padding: 8px 12px;
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.25);
  border-radius: 6px;
  margin-top: 6px;
  font-size: 11.5px;
  color: #a5f3fc;
  display: flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 600px) {
  .task-mode-selector {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

/* ── TASK MODE FILTER BAR ───────────────────────── */
.task-mode-filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: var(--surface-1);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin-bottom: 14px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.task-mode-filter-bar::-webkit-scrollbar {
  display: none;
}
.mode-filter-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  min-height: 38px;
}
.mode-filter-btn:hover {
  color: #fff;
  background: var(--surface-2);
}
.mode-filter-btn.active {
  background: var(--surface-2);
  color: #fff;
  border-color: var(--border-light);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}
.mode-filter-btn[data-mode-filter="forum"].active {
  background: rgba(168, 85, 247, 0.12);
  color: #e9d5ff;
  border-color: rgba(168, 85, 247, 0.4);
}
.mode-filter-btn[data-mode-filter="forward"].active {
  background: rgba(6, 182, 212, 0.12);
  color: #a5f3fc;
  border-color: rgba(6, 182, 212, 0.4);
}
.mode-filter-btn[data-mode-filter="send"].active {
  background: rgba(16, 185, 129, 0.12);
  color: #a7f3d0;
  border-color: rgba(16, 185, 129, 0.4);
}
.mode-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-muted);
}
.mode-badge-forum {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
}
.mode-badge-forward {
  background: rgba(6, 182, 212, 0.2);
  color: #22d3ee;
}
.mode-badge-send {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

/* ── FORUM COVER IMAGE BOX (DISCORD STYLE) ───────── */
.forum-cover-box {
  width: 78px;
  height: 78px;
  min-width: 78px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1.5px dashed rgba(168, 85, 247, 0.4);
  position: relative;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  overflow: hidden;
}
.forum-cover-box:hover {
  border-color: #c084fc;
  background: rgba(168, 85, 247, 0.08);
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.25);
}
.forum-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.forum-cover-remove {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.85);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.15s ease;
  z-index: 2;
}
.forum-cover-remove:hover {
  transform: scale(1.15);
  color: #ef4444;
}

/* ── INTERACTIVE FORUM TAG CHIPS ─────────────────── */
.forum-tags-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 195px;
  overflow-y: auto;
  padding: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(168, 85, 247, 0.3) transparent;
}
.forum-tags-grid::-webkit-scrollbar {
  width: 5px;
}
.forum-tags-grid::-webkit-scrollbar-track {
  background: transparent;
}
.forum-tags-grid::-webkit-scrollbar-thumb {
  background: rgba(168, 85, 247, 0.25);
  border-radius: 4px;
}
.forum-tags-grid::-webkit-scrollbar-thumb:hover {
  background: rgba(168, 85, 247, 0.5);
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
  line-height: 1.2;
}
.tag-chip:hover {
  color: #fff;
  border-color: rgba(168, 85, 247, 0.4);
  background: rgba(168, 85, 247, 0.08);
}
.tag-chip.active,
.tag-chip.selected {
  background: rgba(168, 85, 247, 0.22);
  border-color: #c084fc;
  color: #f3e8ff;
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.3);
}
.tag-chip-emoji-img {
  width: 15px;
  height: 15px;
  object-fit: contain;
  vertical-align: middle;
  flex-shrink: 0;
  border-radius: 2px;
}
.tag-chip-emoji-text {
  font-size: 12.5px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.tag-chip .chip-name {
  white-space: nowrap;
}
.tag-chip .tag-emoji {
  font-size: 12.5px;
  display: inline-flex;
  align-items: center;
}
.tag-chip .tag-check,
.tag-chip .chip-check {
  display: none;
  font-size: 9.5px;
  color: #c084fc;
  flex-shrink: 0;
}
.tag-chip.active .tag-check,
.tag-chip.active .chip-check,
.tag-chip.selected .tag-check,
.tag-chip.selected .chip-check {
  display: inline-flex;
  align-items: center;
}

.tag-mode-btn {
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}
.tag-mode-btn.active {
  background: rgba(168, 85, 247, 0.2);
  border-color: #c084fc;
  color: #e9d5ff;
}

/* ── BATCH MODAL SEGMENTED MODE BUTTONS ──────────── */
.batch-mode-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.batch-mode-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 38px;
}
.batch-mode-btn:hover {
  color: #fff;
}
.batch-mode-btn.active {
  background: var(--surface-3);
  color: #fff;
  border-color: var(--accent);
}
.batch-mode-btn[data-batch-mode="forum"].active {
  border-color: #c084fc;
  color: #e9d5ff;
  background: rgba(168, 85, 247, 0.15);
}
.batch-mode-btn[data-batch-mode="forward"].active {
  border-color: #22d3ee;
  color: #a5f3fc;
  background: rgba(6, 182, 212, 0.15);
}


