@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* ===================================================
   DESIGN TOKENS & CSS VARIABLES
   =================================================== */
:root {
  /* Default: Dark Mode */
  --bg-main: #0B141A;
  --bg-card: rgba(17, 27, 33, 0.76);
  --bg-card-solid: #111B21;
  --bg-card-hover: rgba(24, 34, 41, 0.95);
  --bg-input: #1F2C34;
  --bg-nav: rgba(17, 27, 33, 0.88);
  --border-color: rgba(255, 255, 255, 0.09);
  --border-light: rgba(255, 255, 255, 0.04);
  --text-main: #F0F2F5;
  --text-muted: #94A3B8;
  --text-dim: #64748B;
  --code-bg: #070D11;
  --code-text: #E2E8F0;
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow-card: 0 20px 45px -12px rgba(0, 0, 0, 0.65);
  --glass-backdrop: blur(18px);
  --card-border: 1px solid rgba(255, 255, 255, 0.09);

  /* Default Theme: Emerald (Dark Green + Light Green + Black Double Shade) */
  --accent-rgb: 16, 185, 129;
  --primary: #10B981;
  --primary-hover: #059669;
  --primary-gradient: linear-gradient(135deg, #34D399 0%, #10B981 35%, #064E3B 75%, #021B13 100%);
  --primary-light: rgba(16, 185, 129, 0.16);
  --primary-glow: rgba(16, 185, 129, 0.38);
  --primary-text: #FFFFFF;
  --hero-glow: radial-gradient(circle, rgba(16, 185, 129, 0.20) 0%, rgba(6, 78, 59, 0.10) 45%, transparent 70%);

  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 30px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===================================================
   LIGHT MODE THEME
   =================================================== */
[data-theme="light"] {
  --bg-main: #F8FAFC;
  --bg-card: rgba(255, 255, 255, 0.90);
  --bg-card-solid: #FFFFFF;
  --bg-card-hover: #FFFFFF;
  --bg-input: #F1F5F9;
  --bg-nav: rgba(255, 255, 255, 0.92);
  --border-color: rgba(15, 23, 42, 0.08);
  --border-light: rgba(15, 23, 42, 0.04);
  --text-main: #0F172A;
  --text-muted: #475569;
  --text-dim: #94A3B8;
  --code-bg: #0F172A;
  --code-text: #F8FAFC;
  --shadow-sm: 0 4px 12px rgba(15, 23, 42, 0.05);
  --shadow-card: 0 20px 45px -12px rgba(15, 23, 42, 0.10);
  --card-border: 1px solid rgba(15, 23, 42, 0.08);
}

/* ===================================================
   ACCENT COLOR THEMES (RICH MULTI-SHADE GRADIENTS)
   =================================================== */
/* 1. EMERALD: Dark Green + Light Green + Midnight Black Mixed Double Shade */
[data-accent="emerald"] {
  --accent-rgb: 16, 185, 129;
  --primary: #10B981;
  --primary-hover: #059669;
  --primary-gradient: linear-gradient(135deg, #34D399 0%, #10B981 35%, #064E3B 75%, #021B13 100%);
  --primary-light: rgba(16, 185, 129, 0.16);
  --primary-glow: rgba(16, 185, 129, 0.38);
  --primary-text: #FFFFFF;
  --hero-glow: radial-gradient(circle, rgba(16, 185, 129, 0.22) 0%, rgba(6, 78, 59, 0.12) 45%, transparent 70%);
}

/* 2. GOLD & BRONZE: Orange + Brown + Gold Luxury Mixed Shade */
[data-accent="orange"] {
  --accent-rgb: 245, 158, 11;
  --primary: #F59E0B;
  --primary-hover: #D97706;
  --primary-gradient: linear-gradient(135deg, #FDE68A 0%, #F59E0B 32%, #B45309 68%, #78350F 88%, #291205 100%);
  --primary-light: rgba(245, 158, 11, 0.18);
  --primary-glow: rgba(245, 158, 11, 0.40);
  --primary-text: #FFFFFF;
  --hero-glow: radial-gradient(circle, rgba(245, 158, 11, 0.22) 0%, rgba(120, 53, 15, 0.12) 45%, transparent 70%);
}

/* 3. ROYAL VELVET: Electric Violet + Dark Black Mixed Shade */
[data-accent="purple"] {
  --accent-rgb: 168, 85, 247;
  --primary: #A855F7;
  --primary-hover: #9333EA;
  --primary-gradient: linear-gradient(135deg, #E9D5FF 0%, #A855F7 35%, #6B21A8 68%, #3B0764 88%, #0A0214 100%);
  --primary-light: rgba(168, 85, 247, 0.18);
  --primary-glow: rgba(168, 85, 247, 0.40);
  --primary-text: #FFFFFF;
  --hero-glow: radial-gradient(circle, rgba(168, 85, 247, 0.22) 0%, rgba(59, 7, 100, 0.12) 45%, transparent 70%);
}

/* 4. CYBER CYAN: Electric Cyan + Navy + Midnight Abyss Shade */
[data-accent="cyan"] {
  --accent-rgb: 6, 182, 212;
  --primary: #06B6D4;
  --primary-hover: #0891B2;
  --primary-gradient: linear-gradient(135deg, #A5F3FC 0%, #06B6D4 35%, #0E7490 68%, #082F49 88%, #020C17 100%);
  --primary-light: rgba(6, 182, 212, 0.18);
  --primary-glow: rgba(6, 182, 212, 0.40);
  --primary-text: #FFFFFF;
  --hero-glow: radial-gradient(circle, rgba(6, 182, 212, 0.22) 0%, rgba(8, 47, 73, 0.12) 45%, transparent 70%);
}

/* ===================================================
   BASE & RESET
   =================================================== */
html, body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden !important;
  margin: 0;
  padding: 0;
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  min-width: 0;
}

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

/* Modern Glowing Ambient Meshes */
.ambient-glow {
  position: fixed;
  top: -160px;
  left: 50%;
  transform: translateX(-50%);
  width: 1100px;
  height: 580px;
  background: var(--hero-glow);
  pointer-events: none;
  z-index: 0;
  transition: background 0.4s ease;
}

.ambient-glow-bottom {
  position: fixed;
  bottom: -220px;
  right: -100px;
  width: 650px;
  height: 650px;
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.09) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}

/* Container */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* ===================================================
   NAVIGATION & THEME CONTROLS
   =================================================== */
header.app-header {
  border-bottom: var(--card-border);
  background: var(--bg-nav);
  backdrop-filter: var(--glass-backdrop);
  -webkit-backdrop-filter: var(--glass-backdrop);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 78px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-main);
}

.logo-icon {
  width: 44px;
  height: 44px;
  background: var(--primary-gradient);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.4rem;
  box-shadow: 0 6px 18px var(--primary-glow);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
}

.logo:hover .logo-icon {
  transform: scale(1.08) rotate(-4deg);
}

/* Crisp Solid Brand Text (No -webkit-background-clip bug) */
.logo .brand-text {
  color: var(--text-main);
  font-weight: 800;
  letter-spacing: -0.4px;
  font-size: 1.22rem;
  line-height: 1.1;
}

.logo .badge {
  font-size: 0.72rem;
  padding: 3px 9px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 20px;
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  font-weight: 700;
  letter-spacing: 0.3px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Theme Switcher Widget */
.theme-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  border: var(--card-border);
  border-radius: var(--radius-xl);
  padding: 5px 10px;
}

.theme-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 20px;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.theme-toggle-btn:hover {
  color: var(--text-main);
}

.theme-toggle-btn.active {
  background: var(--primary);
  color: #FFFFFF;
  box-shadow: 0 2px 8px var(--primary-glow);
}

/* Accent Color Dots with Rich Gradients */
.accent-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 4px;
}

.accent-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.2);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  position: relative;
}

.accent-dot:hover {
  transform: scale(1.25);
}

.accent-dot.active {
  border-color: var(--text-main);
  transform: scale(1.2);
  box-shadow: 0 0 0 2px var(--bg-input), 0 0 0 4px var(--primary);
}

.accent-dot.emerald { 
  background: linear-gradient(135deg, #34D399 0%, #10B981 40%, #064E3B 75%, #021B13 100%); 
}
.accent-dot.orange  { 
  background: linear-gradient(135deg, #FDE68A 0%, #F59E0B 35%, #B45309 70%, #291205 100%); 
}
.accent-dot.purple  { 
  background: linear-gradient(135deg, #E9D5FF 0%, #A855F7 35%, #581C87 70%, #0A0214 100%); 
}
.accent-dot.cyan    { 
  background: linear-gradient(135deg, #A5F3FC 0%, #06B6D4 35%, #0E7490 70%, #020C17 100%); 
}

/* ===================================================
   BUTTONS & BADGES
   =================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  border: none;
  outline: none;
  font-family: inherit;
}

.btn-primary {
  background: var(--primary-gradient);
  color: #FFFFFF;
  font-weight: 700;
  box-shadow: 0 4px 16px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px var(--primary-glow);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-input);
  color: var(--text-main);
  border: var(--card-border);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: rgba(var(--accent-rgb), 0.35);
  transform: translateY(-1px);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.28);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.22);
}

.btn-sm {
  padding: 7px 14px;
  font-size: 0.82rem;
  border-radius: var(--radius-xs);
}

/* Status Badge with Live Pulse */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.status-badge.connected {
  background: rgba(16, 185, 129, 0.16);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.status-badge.disconnected {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  position: relative;
}

.status-badge.connected .status-dot::after {
  content: '';
  position: absolute;
  top: -3px;
  left: -3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.45;
  animation: pulse-ring 1.8s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
}

@keyframes pulse-ring {
  0% { transform: scale(0.6); opacity: 0.8; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* ===================================================
   GRAND HERO SECTION
   =================================================== */
.hero {
  padding: 70px 0 45px;
  text-align: center;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 18px;
  background: var(--primary-light);
  border: 1px solid rgba(var(--accent-rgb), 0.35);
  border-radius: 30px;
  font-size: 0.86rem;
  color: var(--primary);
  margin-bottom: 22px;
  font-weight: 600;
  box-shadow: 0 4px 15px var(--primary-glow);
  max-width: 100%;
  text-align: center;
}

.hero-pill span {
  display: inline;
  line-height: 1.45;
}

.show-mobile { display: none; }

.hero h1 {
  font-size: 3.4rem;
  font-weight: 900;
  letter-spacing: -1.5px;
  margin-bottom: 20px;
  line-height: 1.15;
}

.hero h1 .highlight {
  color: var(--primary);
  display: inline-block;
}

.hero p.hero-subtitle {
  font-size: 1.18rem;
  color: var(--text-muted);
  max-width: 720px;
  margin: 0 auto 34px;
  line-height: 1.7;
}

/* Metrics Bar */
.metrics-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.metric-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

.metric-pill i {
  color: var(--primary);
}

/* ===================================================
   GRAND ENTERPRISE FEATURES SECTION
   =================================================== */
.section-title {
  text-align: center;
  margin-bottom: 45px;
}

.section-title h2 {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.8px;
  margin-bottom: 12px;
}

.section-title p {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 600px;
  margin: 0 auto;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 70px;
}

.feature-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-backdrop);
  -webkit-backdrop-filter: var(--glass-backdrop);
  border: var(--card-border);
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: var(--shadow-card);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  position: relative;
  overflow: hidden;
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: rgba(var(--accent-rgb), 0.4);
  box-shadow: 0 20px 40px -10px var(--primary-glow);
}

.feature-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 20px;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.feature-card h3 {
  font-size: 1.22rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-main);
  letter-spacing: -0.3px;
}

.feature-card p {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.65;
}

/* ===================================================
   HOW IT WORKS (3 STEPS)
   =================================================== */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 70px;
}

.step-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-backdrop);
  border: var(--card-border);
  border-radius: var(--radius-lg);
  padding: 32px 26px;
  position: relative;
  text-align: center;
  box-shadow: var(--shadow-card);
  transition: transform 0.25s ease;
}

.step-card:hover {
  transform: translateY(-3px);
}

.step-number {
  font-family: 'JetBrains Mono', monospace;
  font-size: 2.8rem;
  font-weight: 900;
  color: var(--primary);
  opacity: 0.3;
  margin-bottom: 8px;
}

.step-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.step-card p {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

/* ===================================================
   CODE TERMINAL PREVIEW WINDOW
   =================================================== */
.terminal-wrapper {
  max-width: 900px;
  margin: 0 auto 70px;
}

.terminal-box {
  background: var(--code-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}

.terminal-header {
  background: rgba(255, 255, 255, 0.04);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.mac-dots {
  display: flex;
  gap: 8px;
}

.mac-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.mac-dot.red { background: #FF5F56; }
.mac-dot.yellow { background: #FFBD2E; }
.mac-dot.green { background: #27C93F; }

/* ===================================================
   AUTH CARD
   =================================================== */
.auth-container {
  max-width: 580px;
  margin: 0 auto 70px;
  background: var(--bg-card);
  backdrop-filter: var(--glass-backdrop);
  -webkit-backdrop-filter: var(--glass-backdrop);
  border: var(--card-border);
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: var(--shadow-card);
  transition: transform 0.3s ease;
}

.auth-tabs {
  display: flex;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 24px;
}

.auth-tab {
  flex: 1;
  text-align: center;
  padding: 11px;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-xs);
  transition: var(--transition);
}

.auth-tab.active {
  background: var(--primary);
  color: #FFFFFF;
  box-shadow: 0 2px 8px var(--primary-glow);
}

.form-group {
  margin-bottom: 18px;
  text-align: left;
}

.form-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-input);
  border: var(--card-border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.95rem;
  font-family: inherit;
  transition: var(--transition);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.22);
}

/* ===================================================
   DASHBOARD GRID & CARDS
   =================================================== */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
  padding: 30px 0 60px;
  width: 100%;
  max-width: 100%;
}

.dashboard-grid > * {
  min-width: 0;
  max-width: 100%;
}

.card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-backdrop);
  -webkit-backdrop-filter: var(--glass-backdrop);
  border: var(--card-border);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-card);
  position: relative;
  transition: transform 0.2s ease, border-color 0.2s ease;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  overflow-wrap: break-word;
}

.card-full {
  grid-column: span 12;
}

.card:hover {
  border-color: rgba(var(--accent-rgb), 0.28);
}

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

.card-title h3 {
  font-size: 1.18rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.3px;
}

.stats-grid {
  grid-column: span 12;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.stat-box {
  background: var(--bg-card);
  backdrop-filter: var(--glass-backdrop);
  border: var(--card-border);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.stat-box:hover {
  transform: translateY(-2px);
  border-color: rgba(var(--accent-rgb), 0.3);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  background: var(--primary-light);
  color: var(--primary);
  flex-shrink: 0;
}

.stat-info h4 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.stat-info p {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.device-card { grid-column: span 6; }
.api-card    { grid-column: span 6; }
.code-card   { grid-column: span 12; }
.test-card   { grid-column: span 6; }
.logs-card   { grid-column: span 6; }

.pairing-box {
  background: var(--bg-input);
  border: 1px dashed rgba(var(--accent-rgb), 0.35);
  border-radius: var(--radius-md);
  padding: 26px;
  text-align: center;
  margin-top: 14px;
}

.pairing-code-display {
  font-family: 'JetBrains Mono', monospace;
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 5px;
  margin: 18px 0;
  padding: 14px 24px;
  background: var(--primary-light);
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  border-radius: var(--radius-sm);
  display: inline-block;
  box-shadow: 0 4px 18px var(--primary-glow);
}

.qr-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 16px;
}

.qr-image {
  width: 210px;
  height: 210px;
  background: #fff;
  padding: 12px;
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.credential-field {
  margin-bottom: 16px;
}

.credential-field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  display: block;
  margin-bottom: 6px;
}

.copy-input-group {
  display: flex !important;
  gap: 8px;
  align-items: center;
  width: 100% !important;
  max-width: 100% !important;
}

.copy-input-group input {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  width: 0 !important;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  background: var(--bg-input);
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.copy-input-group .btn {
  flex-shrink: 0 !important;
  white-space: nowrap;
}

.code-tabs {
  display: flex;
  gap: 8px;
  border-bottom: var(--card-border);
  padding-bottom: 12px;
  margin-bottom: 16px;
  overflow-x: auto;
}

.code-tab-btn {
  background: var(--bg-input);
  color: var(--text-muted);
  border: var(--card-border);
  padding: 8px 16px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.code-tab-btn:hover { color: var(--text-main); }
.code-tab-btn.active {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
  box-shadow: 0 2px 8px var(--primary-glow);
}

pre.code-block {
  background: var(--code-bg);
  border: var(--card-border);
  border-radius: var(--radius-md);
  padding: 20px;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88rem;
  color: var(--code-text);
  line-height: 1.6;
  max-width: 100% !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.table-responsive { 
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto; 
  -webkit-overflow-scrolling: touch;
  margin-bottom: 10px;
  display: block !important;
  box-sizing: border-box !important;
}

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

table.data-table th {
  text-align: left;
  padding: 12px 14px;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: var(--card-border);
  white-space: nowrap;
}

table.data-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  margin-bottom: 18px;
  display: none;
  font-weight: 500;
}

.alert-success {
  background: rgba(16, 185, 129, 0.16);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.alert-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.35);
}

footer.app-footer {
  margin-top: auto;
  border-top: var(--card-border);
  padding: 30px 0;
  background: var(--bg-nav);
  width: 100%;
  overflow: hidden;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  text-align: left;
  padding: 20px 0 30px;
  width: 100%;
}
@media (max-width: 992px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
}
@media (max-width: 480px) {
  .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
    padding: 16px 0 20px !important;
  }
  .footer-grid * {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}

/* ===================================================
   HORIZONTAL SCROLLING CARDS SHOWCASE
   =================================================== */
.scroll-section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.scroll-nav-controls {
  display: flex;
  gap: 10px;
}

.scroll-nav-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: var(--card-border);
  background: var(--bg-card);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  font-size: 1rem;
}

.scroll-nav-btn:hover {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
  transform: scale(1.08);
  box-shadow: 0 4px 15px var(--primary-glow);
}

.scrolling-track-wrapper {
  position: relative;
  overflow: hidden;
  margin-bottom: 60px;
  padding: 14px 4px 22px;
  /* Premium edge fade mask so cards seamlessly glide into and out of the viewport */
  mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
}

.scrolling-track {
  display: flex;
  gap: 22px;
  overflow-x: auto;
  scroll-behavior: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  user-select: none;
  -webkit-user-select: none;
}

.scrolling-track::-webkit-scrollbar {
  display: none;
}

.scrolling-card {
  flex: 0 0 340px;
  background: linear-gradient(155deg, rgba(var(--accent-rgb), 0.12) 0%, rgba(0, 0, 0, 0.50) 100%), var(--bg-card);
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.scrolling-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary-gradient);
  background-size: 200% 200%;
  animation: cardBorderGlow 4s ease infinite;
}

@keyframes cardBorderGlow {
  0% { background-position: 0% 50%; opacity: 0.7; }
  50% { background-position: 100% 50%; opacity: 1; }
  100% { background-position: 0% 50%; opacity: 0.7; }
}

.scrolling-card:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: rgba(var(--accent-rgb), 0.65);
  box-shadow: 0 20px 45px -8px var(--primary-glow);
}

.scrolling-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--primary-light);
  color: var(--primary);
  margin-bottom: 16px;
  align-self: flex-start;
  border: 1px solid rgba(var(--accent-rgb), 0.3);
}

.scrolling-card-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-sm);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 18px;
  box-shadow: 0 4px 15px var(--primary-glow);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.scrolling-card:hover .scrolling-card-icon {
  transform: scale(1.12) rotate(-6deg);
}

.scrolling-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-main);
  letter-spacing: -0.3px;
}

.scrolling-card p {
  color: var(--text-muted);
  font-size: 0.90rem;
  line-height: 1.6;
  margin-bottom: 18px;
}

.scrolling-card-footer {
  padding-top: 14px;
  border-top: var(--card-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary);
}

/* ===================================================
   PRICING & SUBSCRIPTION DOUBLE-SHADE CARDS
   =================================================== */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 28px;
  max-width: 920px;
  width: 100%;
  margin: 0 auto 70px auto;
  align-items: stretch;
}

.pricing-card {
  background: linear-gradient(160deg, rgba(var(--accent-rgb), 0.08) 0%, rgba(0, 0, 0, 0.4) 100%), var(--bg-card);
  border: var(--card-border);
  border-radius: var(--radius-xl);
  padding: 34px 28px;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: var(--shadow-card);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.pricing-card:hover {
  transform: translateY(-6px);
  border-color: rgba(var(--accent-rgb), 0.45);
  box-shadow: 0 25px 50px -15px var(--primary-glow);
}

.pricing-card.featured {
  border: 2px solid var(--primary);
  background: linear-gradient(160deg, rgba(var(--accent-rgb), 0.16) 0%, rgba(0, 0, 0, 0.5) 100%), var(--bg-card);
  box-shadow: 0 20px 45px -10px var(--primary-glow);
}

.pricing-ribbon {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary-gradient);
  color: #FFFFFF;
  padding: 4px 16px;
  border-radius: 20px;
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  box-shadow: 0 4px 15px var(--primary-glow);
  white-space: nowrap;
}

.pricing-header {
  margin-bottom: 22px;
  text-align: center;
}

.pricing-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 8px;
}

.pricing-price {
  font-size: 2.6rem;
  font-weight: 900;
  color: var(--text-main);
  line-height: 1.1;
  margin-bottom: 6px;
}

.pricing-price strong,
#landing-pro-price {
  font-size: 2.6rem !important;
  font-weight: 900 !important;
  color: var(--text-main) !important;
  line-height: 1 !important;
}

.pricing-price span {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
}

.pricing-desc {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.pricing-features-list {
  list-style: none;
  padding: 0;
  margin: 0 0 28px 0;
  flex: 1;
}

.pricing-features-list li {
  padding: 9px 0;
  font-size: 0.88rem;
  color: var(--text-main);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-bottom: 1px solid var(--border-light);
  line-height: 1.5;
  text-align: left;
}

.pricing-features-list li > span,
.pricing-features-list li > div {
  flex: 1 1 auto;
  text-align: left;
  min-width: 0;
}

.pricing-features-list li:last-child {
  border-bottom: none;
}

.pricing-features-list li i.fa-circle-check,
.pricing-features-list li i.fa-arrows-rotate,
.pricing-features-list li i.fa-wallet,
.pricing-features-list li i.fa-qrcode,
.pricing-features-list li i.fa-triangle-exclamation,
.pricing-features-list li i.fa-shield-halved {
  font-size: 0.95rem;
  flex-shrink: 0;
  margin-top: 3px;
}

.pricing-features-list li i.fa-circle-xmark {
  color: var(--text-dim);
  font-size: 0.95rem;
  flex-shrink: 0;
}

/* ===================================================
   RESPONSIVE MODAL COMPONENT (PERFECT VIEWPORT ALIGNMENT)
   =================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.80);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}

.modal-overlay.active {
  display: flex !important;
}

.modal-dialog {
  max-width: 480px;
  width: 100%;
  max-height: 92vh;
  margin: auto;
  overflow-y: auto;
  background: var(--bg-card-solid);
  border: 1px solid rgba(var(--accent-rgb), 0.4);
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 65px rgba(0, 0, 0, 0.85);
  padding: 22px 24px;
  position: relative;
  display: flex;
  flex-direction: column;
  animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--accent-rgb), 0.3) transparent;
}

.modal-dialog::-webkit-scrollbar {
  width: 5px;
}

.modal-dialog::-webkit-scrollbar-thumb {
  background: rgba(var(--accent-rgb), 0.3);
  border-radius: 6px;
}

@keyframes modalPop {
  0% { transform: scale(0.92) translateY(12px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  border-bottom: var(--card-border);
  padding-bottom: 10px;
}

.modal-close-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  color: var(--text-muted);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  cursor: pointer;
  transition: var(--transition);
  line-height: 1;
}

.modal-close-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  color: var(--danger);
  border-color: var(--danger);
}

/* ===================================================
   RESPONSIVE UTILITY CLASSES & FLEX HELPERS
   =================================================== */
.admin-form-col {
  flex: 1 1 300px;
  min-width: 0;
}

.quota-meter-box {
  flex: 1 1 280px;
  max-width: 420px;
  min-width: 0;
}

.responsive-form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.hero-cta-group {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.pairing-input-row {
  display: flex;
  gap: 10px;
  max-width: 380px;
  margin: 0 auto 16px;
  width: 100%;
}

.pairing-input-row input {
  flex: 1 1 auto;
  min-width: 0;
}

/* ===================================================
   RESPONSIVE DESIGN ENGINE (MOBILE, TABLET, LAPTOP, TV)
   =================================================== */

/* ---------------------------------------------------
   1. TV & ULTRA-WIDE / 4K MONITORS (>= 1920px & >= 2560px)
   --------------------------------------------------- */
@media (min-width: 1920px) {
  .container {
    max-width: 1540px;
    padding: 0 32px;
  }
  .pricing-grid {
    max-width: 960px;
  }
  .feature-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
  }
}

@media (min-width: 2560px) {
  html {
    font-size: 18px; /* 10-foot viewing comfort on 4K TVs */
  }
  .container {
    max-width: 1820px;
  }
  .hero h1 {
    font-size: 4.2rem;
  }
}

/* ---------------------------------------------------
   2. DESKTOP & LAPTOPS (>= 993px) - NO TABLE SCROLL, PERFECT PROPORTIONS
   --------------------------------------------------- */
@media (min-width: 993px) {
  .container {
    max-width: 1440px;
    width: 96%;
    padding: 0 16px;
  }
  .table-responsive {
    overflow-x: hidden !important; /* Strict requirement: NO horizontal scrollbar in laptop view! */
    width: 100% !important;
    max-width: 100% !important;
  }
  table.data-table {
    width: 100% !important;
    min-width: 0 !important;
    table-layout: auto !important;
  }
  table.data-table th, 
  table.data-table td {
    padding: 10px 8px !important;
    font-size: 0.81rem !important;
  }
  table.data-table th {
    white-space: normal !important;
    line-height: 1.25 !important;
  }
  table.data-table td {
    white-space: nowrap !important;
  }
}

@media (max-width: 1200px) {
  .hero h1 {
    font-size: 2.85rem;
  }
  .feature-card {
    padding: 24px 20px;
  }
  .dashboard-grid {
    gap: 18px;
  }
}

/* ---------------------------------------------------
   3. TABLETS - LANDSCAPE & MEDIUM VIEWPORTS (769px - 992px)
   --------------------------------------------------- */
@media (max-width: 992px) {
  .hide-mobile { 
    display: none !important; 
  }
  .nav-wrapper {
    height: auto;
    min-height: 70px;
    padding: 8px 0;
  }
  .hero {
    padding: 55px 0 35px;
  }
  .hero h1 { 
    font-size: 2.4rem; 
    letter-spacing: -1px;
  }
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  .steps-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
  .pricing-grid { 
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 20px;
  }
  .dashboard-grid { 
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
    gap: 16px !important;
  }
  .dashboard-grid > * { 
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    grid-column: auto !important; 
  }
  .device-card, .api-card, .test-card, .logs-card, .stats-grid, .code-card, .card-full { 
    width: 100% !important;
    max-width: 100% !important;
    grid-column: auto !important; 
  }
  .stats-grid { 
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important; 
    gap: 14px !important;
    width: 100% !important;
  }
  .scrolling-card { 
    flex: 0 0 310px; 
  }
}

/* ---------------------------------------------------
   4. TABLETS - PORTRAIT & PHABLETS (481px - 768px)
   --------------------------------------------------- */
@media (max-width: 768px) {
  html, body {
    overflow-x: hidden;
  }
  .container {
    padding: 0 16px;
  }
  .nav-wrapper {
    height: auto;
    min-height: 64px;
    padding: 8px 0;
    gap: 10px;
  }
  .logo .brand-text {
    font-size: 1.12rem !important;
  }
  .hero {
    padding: 42px 0 28px;
  }
  .hero h1 {
    font-size: 2.1rem !important;
  }
  .hero p.hero-subtitle {
    font-size: 1rem;
    margin-bottom: 26px;
  }
  .feature-grid, .steps-grid, .pricing-grid { 
    grid-template-columns: 1fr !important;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
  }
  .admin-form-col {
    flex: 1 1 100% !important;
    min-width: 100% !important;
  }
  .quota-meter-box {
    flex: 1 1 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    margin-top: 10px;
  }
  .modal-dialog {
    width: 95%;
    max-width: 460px;
    padding: 20px 18px;
  }
  /* Prevent iOS Safari auto-zoom on input focus */
  input, select, textarea, .form-input {
    font-size: 16px !important;
  }
}

/* ---------------------------------------------------
   5. MOBILE VIEW (<= 480px) - TOP PRIORITY & 100% PERFECT
   --------------------------------------------------- */
@media (max-width: 480px) {
  html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
  }

  .container {
    padding: 0 10px !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Header & Navigation */
  header.app-header {
    top: 0;
  }
  .nav-wrapper {
    height: auto !important;
    min-height: 54px !important;
    padding: 6px 0 !important;
    gap: 6px !important;
    justify-content: space-between !important;
  }
  .logo {
    gap: 6px !important;
    min-width: 0 !important;
    flex-shrink: 0 !important;
  }
  .logo-icon {
    width: 32px !important;
    height: 32px !important;
    font-size: 1.05rem !important;
    border-radius: var(--radius-xs);
  }
  .logo .brand-text {
    font-size: 0.98rem !important;
    white-space: nowrap !important;
    overflow: visible !important;
    max-width: none !important;
  }
  .logo .brand-subtext {
    display: none !important;
  }
  .logo .badge {
    display: none !important;
  }
  .show-mobile {
    display: inline !important;
  }
  .hide-mobile {
    display: none !important;
  }
  .nav-actions {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    flex-shrink: 0 !important;
  }
  .theme-controls {
    padding: 2px 4px !important;
  }
  .theme-controls .accent-picker {
    display: none !important; /* Hide 4 color dots on mobile to keep navbar tidy */
  }
  .theme-toggle-btn {
    padding: 4px 6px !important;
    font-size: 0.78rem !important;
  }
  .status-badge {
    padding: 3px 6px !important;
    font-size: 0.68rem !important;
    gap: 4px !important;
  }
  .status-dot {
    width: 6px !important;
    height: 6px !important;
  }
  .btn-sm {
    padding: 5px 8px !important;
    font-size: 0.74rem !important;
  }

  /* Hero Section */
  .hero {
    padding: 26px 0 20px;
  }
  .hero-pill {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.74rem !important;
    padding: 6px 12px !important;
    margin-bottom: 16px !important;
    line-height: 1.4 !important;
    border-radius: 30px !important;
    max-width: 96% !important;
    text-align: center !important;
  }
  .hero-pill span {
    display: inline !important;
    text-align: center !important;
  }
  .hero h1 {
    font-size: 1.65rem !important;
    line-height: 1.25 !important;
    letter-spacing: -0.4px !important;
    margin-bottom: 12px !important;
  }
  .hero p.hero-subtitle {
    font-size: 0.88rem;
    line-height: 1.55;
    margin-bottom: 20px;
  }
  .hero-cta-group {
    flex-direction: column !important;
    width: 100% !important;
    gap: 10px !important;
  }
  .hero-cta-group .btn {
    width: 100% !important;
    justify-content: center !important;
    padding: 13px 18px !important;
    font-size: 0.95rem !important;
  }
  .metrics-row {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    margin-top: 20px !important;
    width: 100% !important;
  }
  .metric-pill {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 8px 6px !important;
    font-size: 0.72rem !important;
    background: var(--bg-card) !important;
    border: var(--card-border) !important;
    border-radius: var(--radius-sm) !important;
    text-align: center !important;
    gap: 6px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  /* Section Titles */
  .section-title {
    margin-bottom: 26px;
  }
  .section-title h2 {
    font-size: 1.55rem;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
  }
  .section-title p {
    font-size: 0.86rem;
  }

  /* Steps & Features */
  .steps-grid {
    grid-template-columns: 1fr !important;
    gap: 16px;
    margin-bottom: 45px;
  }
  .step-card {
    padding: 22px 18px;
  }
  .step-number {
    font-size: 2.2rem;
  }
  .feature-grid {
    grid-template-columns: 1fr !important;
    gap: 16px;
    margin-bottom: 50px;
  }
  .feature-card {
    padding: 20px 16px;
  }
  .feature-icon {
    width: 44px;
    height: 44px;
    font-size: 1.25rem;
    margin-bottom: 14px;
  }

  /* Scrolling Showcase */
  .scrolling-card {
    flex: 0 0 265px;
    padding: 20px 16px;
  }
  .scroll-section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  /* Terminal Preview */
  .terminal-wrapper {
    margin-bottom: 45px;
  }
  .terminal-box {
    border-radius: var(--radius-sm);
  }
  .terminal-header {
    padding: 10px 12px;
  }
  pre.code-block {
    padding: 14px 10px;
    font-size: 0.78rem;
  }

  /* Pricing Cards */
  .pricing-grid {
    grid-template-columns: 1fr !important;
    gap: 20px;
    margin-bottom: 45px;
  }
  .pricing-card {
    padding: 22px 16px;
  }
  .pricing-price {
    font-size: 2.1rem;
  }
  .pricing-price strong,
  #landing-pro-price {
    font-size: 2.1rem !important;
  }

  /* Auth Container */
  .auth-container {
    padding: 20px 14px;
    margin-bottom: 45px;
    border-radius: var(--radius-md);
  }
  .auth-tabs {
    margin-bottom: 18px;
  }
  .auth-tab {
    padding: 9px;
    font-size: 0.85rem;
  }

  /* Client Dashboard Grid (Strict Column Flex on Mobile) */
  .dashboard-grid {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
    gap: 12px !important;
    padding: 10px 0 30px !important;
  }
  .dashboard-grid > * {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    grid-column: auto !important;
  }
  .card-full, .device-card, .api-card, .test-card, .logs-card, .code-card {
    width: 100% !important;
    max-width: 100% !important;
    grid-column: auto !important;
  }
  .card {
    padding: 14px 12px !important;
    border-radius: var(--radius-md) !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    overflow-wrap: break-word !important;
  }
  .card-title {
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .card-title h3 {
    font-size: 1.02rem;
  }

  /* Stats Grid (2x2 on Mobile) */
  .stats-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    width: 100% !important;
    margin-bottom: 12px;
  }
  .stat-box {
    padding: 10px 8px !important;
    gap: 8px !important;
    border-radius: var(--radius-sm);
  }
  .stat-icon {
    width: 34px !important;
    height: 34px !important;
    font-size: 1rem !important;
    border-radius: var(--radius-xs);
  }
  .stat-info h4 {
    font-size: 1.15rem !important;
  }
  .stat-info p {
    font-size: 0.68rem !important;
  }

  /* Quota / Expiry Banner */
  .quota-meter-box {
    min-width: 100% !important;
    max-width: 100% !important;
    width: 100% !important;
    margin: 8px 0 !important;
  }
  #btn-upgrade-text {
    font-size: 0.85rem;
  }

  /* WhatsApp Connection Card */
  .pairing-box {
    padding: 12px 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  .pairing-code-display {
    font-size: 1.25rem !important;
    letter-spacing: 2px !important;
    padding: 8px 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    word-break: break-all !important;
  }
  .pairing-input-row {
    flex-direction: column !important;
    width: 100% !important;
    gap: 8px !important;
  }
  .pairing-input-row .btn {
    width: 100% !important;
    padding: 9px !important;
  }
  #view-qr .qr-image {
    width: 150px !important;
    height: 150px !important;
  }

  /* API Credentials Card */
  .credential-field {
    margin-bottom: 12px !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  .copy-input-group {
    display: flex !important;
    gap: 6px !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  .copy-input-group input {
    flex: 1 1 0 !important;
    min-width: 0 !important;
    width: 0 !important;
    font-size: 11px !important;
    padding: 7px 8px !important;
    text-overflow: ellipsis !important;
    overflow: hidden !important;
    white-space: nowrap !important;
  }
  .copy-input-group .btn {
    padding: 6px 8px !important;
    font-size: 0.72rem !important;
    flex-shrink: 0 !important;
  }

  /* Code Tabs & Pre Code Block */
  .code-tabs {
    gap: 6px !important;
    padding-bottom: 6px !important;
    margin-bottom: 10px !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  .code-tab-btn {
    padding: 5px 8px !important;
    font-size: 0.74rem !important;
    flex-shrink: 0 !important;
  }
  pre.code-block {
    padding: 12px 10px !important;
    font-size: 0.74rem !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* Live Tester */
  #test-result-json {
    max-height: 180px !important;
    font-size: 0.74rem !important;
    white-space: pre-wrap !important;
    word-break: break-all !important;
    max-width: 100% !important;
  }

  /* Table Touch Scrolling */
  .table-responsive {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    display: block !important;
    box-sizing: border-box !important;
  }
  table.data-table th, table.data-table td {
    padding: 8px 8px !important;
    font-size: 0.76rem !important;
    white-space: nowrap !important;
  }

  /* Modals */
  .modal-overlay {
    padding: 10px !important;
    align-items: flex-start !important;
    padding-top: 18px !important;
  }
  .modal-dialog {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    padding: 16px 12px !important;
    max-height: 90vh !important;
  }
  .modal-header h3 {
    font-size: 1.05rem !important;
  }
  #upi-qr-image {
    width: 110px !important;
    height: 110px !important;
  }

  /* Admin Control Center */
  .admin-nav-bar {
    display: flex !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    -webkit-overflow-scrolling: touch !important;
    gap: 6px !important;
    padding-bottom: 6px !important;
    margin-bottom: 14px !important;
    box-sizing: border-box !important;
  }
  .admin-nav-bar::-webkit-scrollbar {
    display: none !important;
  }
  .admin-nav-item {
    padding: 6px 10px !important;
    font-size: 0.74rem !important;
    flex-shrink: 0 !important;
  }
  .filter-pills {
    gap: 4px !important;
    margin-bottom: 12px !important;
  }
  .filter-pill {
    font-size: 0.70rem !important;
    padding: 4px 8px !important;
  }
  .responsive-form-grid-2 {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .admin-form-col {
    min-width: 100% !important;
    width: 100% !important;
    flex: 1 1 100% !important;
  }

  /* Footer */
  footer.app-footer {
    padding: 22px 0;
  }
}

/* ---------------------------------------------------
   6. ULTRA-NARROW PHONES (<= 360px, e.g. Fold, iPhone SE1)
   --------------------------------------------------- */
@media (max-width: 360px) {
  .container {
    padding: 0 8px;
  }
  .logo-icon {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }
  .logo .brand-text {
    font-size: 0.95rem !important;
    max-width: 120px;
  }
  .hero h1 {
    font-size: 1.50rem !important;
  }
  .stats-grid {
    grid-template-columns: 1fr !important;
  }
  .scrolling-card {
    flex: 0 0 240px;
  }
  .pairing-code-display {
    font-size: 1.20rem;
    letter-spacing: 1.5px;
    padding: 6px 8px;
  }
}
