:root {
  --bg-primary: #0a0d14;
  --bg-secondary: #121726;
  --bg-card: rgba(22, 29, 47, 0.75);
  --bg-card-hover: rgba(30, 40, 64, 0.85);
  --border-color: rgba(255, 255, 255, 0.1);
  --border-glow: rgba(124, 58, 237, 0.4);
  
  --accent-purple: #8b5cf6;
  --accent-purple-glow: rgba(139, 92, 246, 0.25);
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;
  --accent-amber: #f59e0b;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  
  --shadow-card: 0 20px 40px -15px rgba(0, 0, 0, 0.6), 0 0 1px 1px rgba(255, 255, 255, 0.05);
  --shadow-btn: 0 4px 20px -2px rgba(139, 92, 246, 0.4);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(139, 92, 246, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(6, 182, 212, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(15, 23, 42, 0.6) 0%, transparent 100%);
  background-attachment: fixed;
  overflow-x: hidden;
  line-height: 1.6;
}

.container {
  width: 100%;
  max-width: 680px;
  margin: auto;
  padding: 32px 20px;
}

.brand-header {
  text-align: center;
  margin-bottom: 36px;
  animation: fadeInDown 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.3);
  padding: 6px 16px;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #c4b5fd;
  margin-bottom: 16px;
  letter-spacing: 0.03em;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-emerald);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent-emerald);
  animation: pulse 2s infinite;
}

.brand-title {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #ffffff 30%, #c4b5fd 70%, #67e8f9 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}

.brand-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
}

/* Glass Card */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 36px 32px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-purple), var(--accent-cyan), transparent);
}

/* Form controls */
.form-group {
  margin-bottom: 24px;
}

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.form-input {
  width: 100%;
  background: rgba(10, 13, 20, 0.7);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-size: 1rem;
  color: var(--text-main);
  transition: all 0.25s ease;
  outline: none;
}

.form-input:focus {
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 3px var(--accent-purple-glow);
  background: rgba(15, 20, 32, 0.9);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 15px 24px;
  font-size: 1.05rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: none;
  transition: all 0.25s ease;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-purple) 0%, #7c3aed 100%);
  color: #ffffff;
  box-shadow: var(--shadow-btn);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px -2px rgba(139, 92, 246, 0.55);
  background: linear-gradient(135deg, #9d74f8 0%, #8b5cf6 100%);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-success {
  background: linear-gradient(135deg, #059669 0%, var(--accent-emerald) 100%);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.45);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* Spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}

/* Alert notices */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: fadeIn 0.3s ease;
}

.alert-error {
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #fca5a5;
}

.alert-info {
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: #67e8f9;
}

.alert-success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

/* Result Card */
.result-box {
  margin-top: 24px;
  background: rgba(10, 13, 20, 0.8);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-md);
  padding: 24px;
  animation: fadeIn 0.4s ease;
}

.result-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.result-icon {
  width: 38px;
  height: 38px;
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-emerald);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.client-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.meta-item {
  background: rgba(255, 255, 255, 0.03);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.meta-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.meta-value {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--text-main);
  font-weight: 600;
}

.action-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

/* VPN URI Container */
.vpn-uri-container {
  background: rgba(6, 182, 212, 0.05);
  border: 1px solid rgba(6, 182, 212, 0.25);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-top: 18px;
  text-align: left;
  animation: fadeIn 0.3s ease;
}

.vpn-uri-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 8px;
}

.vpn-uri-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-cyan);
}

.vpn-open-link {
  font-size: 0.82rem;
  color: #a5f3fc;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
  transition: color 0.2s;
}

.vpn-open-link:hover {
  color: #ffffff;
}

.vpn-uri-box {
  display: flex;
  gap: 8px;
  align-items: center;
}

.vpn-uri-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: #e2e8f0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.vpn-uri-input:focus {
  border-color: var(--accent-cyan);
  background: rgba(0, 0, 0, 0.6);
}

.btn-cyan {
  background: linear-gradient(135deg, #0891b2 0%, var(--accent-cyan) 100%);
  color: #ffffff;
  padding: 9px 16px;
  font-size: 0.85rem;
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.25);
  white-space: nowrap;
}

.btn-cyan:hover {
  box-shadow: 0 6px 18px rgba(6, 182, 212, 0.4);
  transform: translateY(-1px);
}

.btn-copied {
  background: linear-gradient(135deg, #059669 0%, #10b981 100%) !important;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4) !important;
}

/* QR Code Tabs */
.qr-tabs {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  padding: 3px;
  margin-bottom: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.qr-tab {
  background: transparent;
  border: none;
  color: var(--text-dim);
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.qr-tab:hover {
  color: var(--text-main);
}

.qr-tab.active {
  background: var(--accent-purple);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}


/* Instructions Accordion */
.instructions-section {
  margin-top: 36px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px 30px;
}

.instructions-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #e2e8f0;
}

.step-list {
  list-style: none;
  counter-reset: steps;
}

.step-item {
  position: relative;
  padding-left: 38px;
  margin-bottom: 18px;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.step-item::before {
  counter-increment: steps;
  content: counter(steps);
  position: absolute;
  left: 0;
  top: 0;
  width: 24px;
  height: 24px;
  background: rgba(139, 92, 246, 0.2);
  border: 1px solid var(--accent-purple);
  color: #c4b5fd;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: bold;
}

.step-item strong {
  color: var(--text-main);
}

.footer {
  margin-top: auto;
  text-align: center;
  padding: 24px;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.footer a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.footer a:hover {
  color: var(--accent-purple);
}

/* QR Code Modal / Box */
.qr-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  padding: 16px;
  border-radius: var(--radius-md);
  margin: 16px auto;
  width: fit-content;
}

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

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.9); }
}

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

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-16px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) {
  .container {
    padding: 16px 12px;
  }
  .glass-card {
    padding: 20px 14px;
  }
  .brand-title {
    font-size: 1.7rem;
  }
  .action-buttons {
    grid-template-columns: 1fr;
  }

  /* User Profile Bar on Mobile */
  .user-profile-bar {
    padding: 12px 14px;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .user-status-badges {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .stat-badge {
    font-size: 0.74rem;
    padding: 4px 8px;
  }

  /* Device Card on Mobile */
  .device-card {
    flex-direction: column;
    align-items: stretch;
    padding: 14px 12px;
    gap: 12px;
  }
  .device-left {
    width: 100%;
    gap: 10px;
  }
  .device-sub-info {
    font-size: 0.74rem;
    gap: 3px 6px;
  }
  .device-actions-row {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 6px;
  }
  .btn-action-small {
    justify-content: center;
    padding: 7px 4px;
    font-size: 0.76rem;
    white-space: nowrap;
  }
}

/* Telegram Auth & User Profile Components */

.btn-telegram {
  background: linear-gradient(135deg, #229ed9 0%, #1e87be 100%);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(34, 158, 217, 0.35);
}

.btn-telegram:hover {
  box-shadow: 0 8px 25px rgba(34, 158, 217, 0.5);
  transform: translateY(-2px);
}

.user-profile-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 22px;
  flex-wrap: wrap;
  gap: 12px;
}

.user-info-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #229ed9, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  color: #ffffff;
}

.user-name-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-main);
}

.user-tag-handle {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.user-status-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.stat-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 500;
}

.stat-badge-primary {
  background: rgba(139, 92, 246, 0.15);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.stat-badge-info {
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.3);
}

.stat-badge-active {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.stat-badge-expired {
  background: rgba(244, 63, 94, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

/* Device Cards List */
.devices-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.devices-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #f1f5f9;
}

.devices-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.device-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
  flex-wrap: wrap;
  gap: 14px;
  min-width: 0;
}

.device-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(139, 92, 246, 0.4);
}

.device-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1 1 auto;
}

.device-left > div:last-child {
  min-width: 0;
  flex: 1 1 auto;
}

.device-icon-box {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: var(--radius-sm);
  background: rgba(6, 182, 212, 0.1);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.device-name-text {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-main);
  margin-bottom: 3px;
  word-break: break-word;
}

.device-sub-info {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  font-size: 0.8rem;
  color: var(--text-dim);
  align-items: center;
  line-height: 1.4;
  word-break: break-word;
}

.device-sub-info > span:not(.sub-sep) {
  white-space: nowrap;
}

.device-sub-info .sub-sep {
  opacity: 0.35;
  user-select: none;
}

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

.btn-action-small {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.btn-action-primary {
  background: rgba(139, 92, 246, 0.15);
  color: #c4b5fd;
  border-color: rgba(139, 92, 246, 0.3);
}

.btn-action-primary:hover {
  background: rgba(139, 92, 246, 0.3);
  color: #ffffff;
}

.btn-action-danger {
  background: rgba(244, 63, 94, 0.1);
  color: #fda4af;
  border-color: rgba(244, 63, 94, 0.25);
}

.btn-action-danger:hover {
  background: rgba(244, 63, 94, 0.25);
  color: #ffffff;
}

.btn-action-info {
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
  border-color: rgba(14, 165, 233, 0.3);
}

.btn-action-info:hover {
  background: rgba(14, 165, 233, 0.3);
  color: #ffffff;
}

.counter-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
}

.btn-counter {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 1.5rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  user-select: none;
}

.btn-counter:hover {
  background: rgba(139, 92, 246, 0.3);
  border-color: rgba(139, 92, 246, 0.5);
  transform: scale(1.05);
}

.btn-counter:active {
  transform: scale(0.95);
}


/* Modal Overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal-card {
  background: #111422;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  animation: fadeInDown 0.25s ease;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
}

.close-btn {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--text-dim);
  cursor: pointer;
  line-height: 1;
}

.close-btn:hover {
  color: #ffffff;
}

/* Toast Notification */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: 90%;
  max-width: 400px;
}

.toast-msg {
  background: rgba(18, 22, 36, 0.96);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(12px);
  color: #ffffff;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  animation: slideUpFade 0.3s ease forwards;
  pointer-events: auto;
  text-align: center;
}

.toast-msg.toast-success {
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.2);
}

.toast-msg.toast-error {
  border-color: rgba(244, 63, 94, 0.4);
  box-shadow: 0 10px 30px rgba(244, 63, 94, 0.2);
}

@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Split-Tunnel Routing Mode Selector */
.device-routing-box {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.routing-mode-chips {
  display: flex;
  gap: 6px;
  background: rgba(0, 0, 0, 0.35);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.chip-mode {
  flex: 1;
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

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

.chip-mode.active {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.85), rgba(6, 182, 212, 0.85));
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.routing-mode-tip {
  font-size: 0.76rem;
  color: var(--text-dim);
  margin-top: 6px;
  line-height: 1.35;
  padding-left: 2px;
}

/* Modal Routing Switch */
.modal-routing-box {
  margin-bottom: 16px;
}

.modal-mode-tip {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 8px;
  line-height: 1.4;
  text-align: center;
}

/* Split-Tunnel QR Fallback Card */
.split-qr-fallback {
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(6, 182, 212, 0.4);
  border-radius: var(--radius-md);
  padding: 20px 16px;
  margin: 10px auto;
  max-width: 340px;
  text-align: center;
}

.split-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.split-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-cyan);
  margin-bottom: 6px;
}

.split-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 8px;
}

.split-hint {
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* Device Mode Badges and Routing Note */
.device-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.device-mode-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge-bypass {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.badge-full {
  background: rgba(139, 92, 246, 0.15);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.35);
}

.device-routing-note {
  font-size: 0.76rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-left: 2px solid #fbbf24;
}

.btn-action-conf-only {
  flex: 1;
  justify-content: center;
  padding: 9px 16px !important;
}

