/* ==========================================================================
   BugHex SalesHub — Design System & 120 FPS Cinematic Stylesheet
   ========================================================================== */

:root {
  /* Color Palette */
  --bg-canvas: #fbfaf7;
  --bg-card: rgba(255, 255, 255, 0.92);
  --bg-card-subtle: #f5f3ee;
  --bg-input: #ffffff;
  
  --text-main: #14151a;
  --text-secondary: #5e606a;
  --text-muted: #8b8e9b;
  --text-mono: #2d3139;
  
  --orange-primary: #19E6E3;
  --accent-primary: #19E6E3;
  --orange-gradient: linear-gradient(135deg, #19E6E3 0%, #0bb5b2 100%);
  --orange-glow: rgba(25, 230, 227, 0.35);
  --orange-tint: rgba(25, 230, 227, 0.10);
  
  --border-subtle: rgba(20, 21, 26, 0.08);
  --border-light: rgba(20, 21, 26, 0.12);
  --border-active: rgba(25, 230, 227, 0.45);
  
  --coral-accent: #0bb5b2;
  --amber-accent: #19E6E3;
  --green-accent: #19E6E3;
  --green-pill-bg: #e6fcfb;
  --green-pill-text: #088b88;
  
  /* Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 9999px;

  /* Elevation & Shadows */
  --shadow-subtle: 0 2px 8px rgba(0, 0, 0, 0.03);
  --shadow-card: 0 8px 30px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 8px 24px var(--orange-glow);
  --shadow-dock: 0 16px 40px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.06);

  /* Transitions (120fps spring feel) */
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: 160ms var(--ease-spring);
  --transition-normal: 260ms var(--ease-spring);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-canvas);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* ==========================================================================
   Minimal Clean Animated Pattern Background (Hardware-Accelerated 120 FPS)
   Clean Micro-Grid Flow • Soft Ambient Mesh Glows • Interactive Spotlight
   ========================================================================== */
.clean-pattern-bg {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  background-color: var(--bg-canvas);
  transition: background-color 0.4s ease;
}

/* 1. Ambient Living Mesh Glows (Ultra-soft, breathing light) */
.pattern-glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  will-change: transform, opacity;
}

.pattern-glow-orb.orb-top {
  width: 650px;
  height: 650px;
  top: -150px;
  right: -100px;
  background: radial-gradient(circle, rgba(25, 230, 227, 0.20) 0%, rgba(25, 230, 227, 0.08) 50%, transparent 70%);
  animation: orbDriftTop 20s ease-in-out infinite alternate;
}

.pattern-glow-orb.orb-bottom {
  width: 700px;
  height: 700px;
  bottom: -180px;
  left: -120px;
  background: radial-gradient(circle, rgba(25, 230, 227, 0.18) 0%, rgba(25, 230, 227, 0.06) 50%, transparent 70%);
  animation: orbDriftBottom 24s ease-in-out infinite alternate;
}

@keyframes orbDriftTop {
  0% { transform: translate(0, 0) scale(1); opacity: 0.7; }
  50% { transform: translate(-80px, 60px) scale(1.08); opacity: 0.9; }
  100% { transform: translate(-40px, 120px) scale(0.95); opacity: 0.7; }
}

@keyframes orbDriftBottom {
  0% { transform: translate(0, 0) scale(1); opacity: 0.6; }
  50% { transform: translate(90px, -70px) scale(1.1); opacity: 0.85; }
  100% { transform: translate(50px, -130px) scale(0.92); opacity: 0.6; }
}

/* 2. Moving Clean Tech Grid Pattern */
.pattern-grid-flow {
  position: absolute;
  inset: -64px;
  width: calc(100vw + 128px);
  height: calc(100vh + 128px);
  background-size: 32px 32px, 32px 32px, 32px 32px;
  background-image: 
    radial-gradient(circle at center, rgba(25, 230, 227, 0.35) 1.2px, transparent 1.2px),
    linear-gradient(to right, rgba(20, 21, 26, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(20, 21, 26, 0.035) 1px, transparent 1px);
  background-position: 0 0, 0 0, 0 0;
  animation: patternDrift 28s linear infinite;
  mask-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.5) 65%, transparent 95%);
  -webkit-mask-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.5) 65%, transparent 95%);
  pointer-events: none;
}

@keyframes patternDrift {
  0% {
    background-position: 0px 0px, 0px 0px, 0px 0px;
  }
  100% {
    background-position: 32px 32px, 32px 32px, 32px 32px;
  }
}

/* 3. Interactive Cursor Spotlight (Linear / Vercel style) */
.pattern-cursor-spotlight {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(280px circle at var(--mouse-x, -999px) var(--mouse-y, -999px), rgba(25, 230, 227, 0.12) 0%, transparent 80%);
  transition: opacity 0.3s ease;
}

/* Dark Screen Mode (body.how-mode - How It Works Command Center) */
body.how-mode {
  background-color: #07080a !important;
}

body.how-mode .clean-pattern-bg {
  background-color: #07080a !important;
}

body.how-mode .pattern-glow-orb.orb-top {
  background: radial-gradient(circle, rgba(25, 230, 227, 0.28) 0%, rgba(11, 181, 178, 0.14) 50%, transparent 70%);
  opacity: 0.9;
}

body.how-mode .pattern-glow-orb.orb-bottom {
  background: radial-gradient(circle, rgba(25, 230, 227, 0.24) 0%, rgba(11, 181, 178, 0.12) 50%, transparent 70%);
  opacity: 0.8;
}

body.how-mode .pattern-grid-flow {
  background-image: 
    radial-gradient(circle at center, rgba(25, 230, 227, 0.42) 1.2px, transparent 1.2px),
    linear-gradient(to right, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  mask-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.65) 65%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.65) 65%, transparent 100%);
}

body.how-mode .pattern-cursor-spotlight {
  background: radial-gradient(300px circle at var(--mouse-x, -999px) var(--mouse-y, -999px), rgba(25, 230, 227, 0.20) 0%, transparent 80%);
}

/* ==========================================================================
   Jeux Developers Official Branding Capsule
   ========================================================================== */
.jeux-dev-capsule {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #090b0f;
  background: linear-gradient(135deg, #12151c 0%, #08090c 100%);
  border: 1px solid rgba(25, 230, 227, 0.4);
  border-radius: 9999px;
  padding: 5px 12px 5px 6px;
  text-decoration: none;
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), 0 0 12px rgba(25, 230, 227, 0.2);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  user-select: none;
  white-space: nowrap;
}

.jeux-dev-capsule:hover {
  transform: translateY(-2px) scale(1.03);
  border-color: #19E6E3;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), 0 0 22px rgba(25, 230, 227, 0.45);
  background: linear-gradient(135deg, #181c25 0%, #0c0e14 100%);
}

.jeux-dev-capsule.mini {
  padding: 3px 10px 3px 5px;
  gap: 6px;
  border-color: rgba(25, 230, 227, 0.35);
}

.jeux-dev-icon {
  width: 18px;
  height: 18px;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.jeux-dev-capsule.mini .jeux-dev-icon {
  width: 16px;
  height: 16px;
}

.jeux-dev-capsule:hover .jeux-dev-icon {
  transform: scale(1.15);
  border: none;
  box-shadow: none;
}

.jeux-dev-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.jeux-dev-text {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1;
}

.jeux-dev-prefix {
  font-size: 0.68rem;
  color: #94a3b8;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.jeux-dev-capsule.mini .jeux-dev-prefix {
  font-size: 0.62rem;
}

.jeux-dev-name {
  font-size: 0.72rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.02em;
  transition: color 0.2s ease;
}

.jeux-dev-capsule.mini .jeux-dev-name {
  font-size: 0.66rem;
}

.jeux-dev-capsule:hover .jeux-dev-name {
  color: #19E6E3;
}

.jeux-dev-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #19E6E3;
  transition: transform 0.25s ease, color 0.25s ease;
  line-height: 1;
}

.jeux-dev-capsule:hover .jeux-dev-arrow {
  transform: translate(2px, -2px);
  color: #19E6E3;
}

.footer-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Portal Header How It Works Button */
.btn-portal-how {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 9999px;
  padding: 6px 14px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  color: #1e293b;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
}

.btn-portal-how:hover {
  background: #ffffff;
  color: #0b9e9b;
  border-color: rgba(25, 230, 227, 0.45);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(25, 230, 227, 0.25);
}

.portal-how-icon {
  font-size: 0.85rem;
  color: #0b9e9b;
  transition: transform 0.25s ease;
}

.btn-portal-how:hover .portal-how-icon {
  transform: scale(1.25);
}

/* Featured Portal Capsule Variant */
.jeux-dev-capsule.portal-featured {
  padding: 6px 14px 6px 7px;
  gap: 9px;
  border-width: 1.5px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35), 0 0 16px rgba(25, 230, 227, 0.25);
}

.jeux-dev-capsule.portal-featured:hover {
  transform: translateY(-2px) scale(1.04);
  border-color: #19E6E3;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5), 0 0 26px rgba(25, 230, 227, 0.6);
}

/* Typography Helpers */
.mono-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

/* Screen Transitions & Strict View Isolation */
/* No transform/filter here: it would create a containing block and trap
   position:fixed descendants (drawer, backdrops) inside the page. */
.view-screen {
  position: relative;
  z-index: 1;
  display: none;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.view-screen.active {
  display: flex;
  flex-direction: column;
  opacity: 1;
}

#loginView.active {
  min-height: 100vh;
  min-height: 100dvh;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: rgba(20, 22, 28, 0.94);
  color: #fff;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: toastIn 0.3s var(--ease-spring) forwards;
  will-change: transform, opacity;
}

.toast.success .toast-icon { color: #2ec4b6; }
.toast.info .toast-icon { color: #ff9800; }
.toast.error .toast-icon { color: #f25f5c; }

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

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-12px) scale(0.94); }
}


/* ==========================================================================
   VIEW 1: AUTONOMOUS LOGIN PORTAL (Image 2)
   ========================================================================== */

.login-screen {
  min-height: 100vh;
  justify-content: space-between;
}

/* Portal Header - Light Editorial Glassmorphism (Image 2 Theme) */
.portal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 48px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.03);
  position: relative;
  z-index: 50;
}

.portal-header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-icon {
  width: 34px;
  height: 34px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  box-shadow: none;
  position: relative;
}

.brand-icon.logo-squircle {
  width: 36px;
  height: 36px;
  border-radius: 0;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.brand-icon.logo-squircle:hover {
  transform: scale(1.08);
  box-shadow: none;
}

.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 0;
  filter: drop-shadow(0 2px 8px rgba(25, 230, 227, 0.3));
}

.portal-header .brand-name {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f172a;
}

.portal-header .system-status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: var(--radius-pill);
  color: #475569;
  font-size: 0.74rem;
  font-weight: 600;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
  animation: pulseGreen 2s infinite;
}

@keyframes pulseGreen {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.portal-header-right {
  display: flex;
  align-items: center;
  gap: 24px;
}

.portal-header-right .header-link {
  font-size: 0.86rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.portal-header-right .header-link:hover,
.portal-header-right .header-link.active {
  color: #0f172a;
}

.header-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  border: 1.5px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

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

/* Portal Main Container */
.portal-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.dual-card-container {
  display: grid;
  grid-template-columns: 460px 480px;
  gap: 32px;
  max-width: 1020px;
  width: 100%;
}

.glass-panel {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border: 1px solid rgba(20, 21, 26, 0.07);
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 54px -12px rgba(20, 21, 26, 0.07), 0 4px 16px rgba(0, 0, 0, 0.02), inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

/* Left Card: Gateway */
.gateway-card {
  padding: 44px 40px;
  display: flex;
  flex-direction: column;
}

.badge-capsule {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 20px;
  align-self: flex-start;
}

.badge-capsule.warm {
  background: #e6fcfb;
  color: #088b88;
  border: 1px solid rgba(25, 230, 227, 0.3);
}

.badge-capsule.lightning {
  background: #e6fcfb;
  color: #088b88;
  border: 1px solid rgba(25, 230, 227, 0.3);
}

.badge-capsule.fresh {
  background: var(--green-pill-bg);
  color: var(--green-pill-text);
}

.fresh-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green-pill-text);
}

.gateway-title {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}

.gateway-subtitle {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
  line-height: 1.45;
}

.gateway-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.input-group label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.label-with-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.text-btn {
  background: none;
  border: none;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition-fast);
}

.text-btn:hover { color: var(--orange-primary); }

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

.input-wrapper .field-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.input-wrapper input {
  width: 100%;
  padding: 13px 14px 13px 44px;
  background: #fbfaf8;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: 16px;
  font-family: inherit;
  color: var(--text-main);
  outline: none;
  transition: all var(--transition-fast);
}

.input-wrapper input:focus {
  background: #fff;
  border-color: var(--orange-primary);
  box-shadow: 0 0 0 3px var(--orange-tint);
}

.input-wrapper.has-error input {
  border-color: #e63946 !important;
  background-color: #fff9f9 !important;
  box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.15) !important;
}

.field-error {
  display: none;
  font-size: 0.73rem;
  font-weight: 600;
  color: #e63946;
  margin-top: 4px;
  margin-left: 2px;
  line-height: 1.3;
}

.field-error.active {
  display: block;
  animation: errorFadeIn 0.2s var(--ease-spring);
}

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

.gateway-card.shake {
  animation: shakeCard 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes shakeCard {
  10%, 90% { transform: translate3d(-2px, 0, 0); }
  20%, 80% { transform: translate3d(4px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-6px, 0, 0); }
  40%, 60% { transform: translate3d(6px, 0, 0); }
}

.eye-toggle-btn {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.checkbox-row {
  display: flex;
  align-items: center;
  margin-top: 4px;
}

.custom-checkbox-container {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text-secondary);
  user-select: none;
}

.custom-checkbox-container input {
  display: none;
}

.custom-checkmark {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--border-light);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.custom-checkbox-container input:checked ~ .custom-checkmark {
  background: var(--orange-primary);
  border-color: var(--orange-primary);
}

.custom-checkbox-container input:checked ~ .custom-checkmark::after {
  content: '';
  width: 5px;
  height: 9px;
  border: solid #092020;
  border-width: 0 2.2px 2.2px 0;
  transform: rotate(45deg) translate(-1px, -1px);
}

/* Primary Glow Button */
.btn-primary-glow {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 24px;
  background: var(--orange-gradient);
  border: none;
  border-radius: var(--radius-md);
  color: #061e1d;
  font-size: 0.96rem;
  font-weight: 750;
  font-family: inherit;
  cursor: pointer;
  box-shadow: var(--shadow-glow);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  will-change: transform;
}

.btn-primary-glow:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(25, 230, 227, 0.42);
}

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

.btn-shimmer {
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  transform: skewX(-20deg);
  animation: btnShimmer 3.5s infinite;
  pointer-events: none;
}

@keyframes btnShimmer {
  0% { left: -100%; }
  30%, 100% { left: 200%; }
}

.gateway-footer {
  margin-top: 36px;
  font-size: 0.84rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
}

.magic-link {
  color: var(--text-main);
  text-decoration: none;
  font-weight: 600;
  transition: color var(--transition-fast);
}

.magic-link:hover { color: var(--orange-primary); }

/* Right Card: Dispatch */
.dispatch-card {
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

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

.dispatch-stats {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.dispatch-stat-box {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.dispatch-stat-box:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 0, 0, 0.12);
}

.stat-top {
  display: flex;
  gap: 14px;
}

.stat-icon-wrapper {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon-wrapper.coral { background: #e6fcfb; color: #088b88; }
.stat-icon-wrapper.amber { background: #e0f7f6; color: #009e9b; }
.stat-icon-wrapper.rose { background: #ebfaf9; color: #057a77; }

.stat-title-group {
  flex: 1;
}

.stat-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.stat-title {
  font-size: 0.94rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.pill-tag {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.03em;
}

.pill-tag.peach { background: #e6fcfb; color: #088b88; }
.pill-tag.gray { background: #ececec; color: var(--text-secondary); }

.stat-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.pill-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
  padding-left: 52px;
}

.chip {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 9px;
  background: #f0eee8;
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
}

.chip.muted { color: var(--text-muted); background: #f6f5f0; }

.dispatch-crm-footer {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.crm-sync-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.green-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2ec4b6;
}

.sync-text {
  display: flex;
  flex-direction: column;
}

.sync-text strong {
  font-size: 0.8rem;
  font-weight: 700;
}

.sync-text .subtext {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.crm-badges-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sync-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-right: 4px;
}

.crm-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  background: #f2f0eb;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
}

.crm-dot { width: 5px; height: 5px; border-radius: 50%; }
.crm-dot.sf { background: #2ec4b6; }
.crm-dot.hs { background: #ff9800; }
.crm-dot.cy { background: #2ec4b6; }

/* Portal Footer */
.portal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 48px;
  border-top: 1px solid var(--border-subtle);
}

.footer-left { display: flex; align-items: center; gap: 8px; }
.footer-right { display: flex; align-items: center; gap: 24px; }
/* ==========================================================================
   Creative Company Logo & Brand Emblem Enhancements
   ========================================================================== */

.login-brand-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  position: relative;
}

.hero-logo-container {
  position: relative;
  width: 76px;
  height: 76px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-logo-halo {
  display: none !important;
}

.hero-logo-squircle {
  position: relative;
  width: 76px;
  height: 76px;
  border-radius: 0;
  overflow: visible;
  background: transparent;
  border: none;
  box-shadow: none;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-logo-squircle:hover {
  transform: scale(1.08);
}

.hero-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 4px 14px rgba(25, 230, 227, 0.22));
}

/* Cockpit Live Status Pill */
.jeux-live-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  background: rgba(25, 230, 227, 0.10);
  border: 1px solid rgba(25, 230, 227, 0.35);
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 700;
  color: #088b88;
  letter-spacing: 0.04em;
}

.mini-logo-dot {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(25, 230, 227, 0.3);
}

.mini-logo-dot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 9, 12, 0.75);
  backdrop-filter: blur(12px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: 100%;
  max-width: 820px;
  max-height: 90vh;
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.95) translateY(12px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.active .modal-card {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 28px;
  border-bottom: 1px solid var(--border-subtle);
  background: #faf8f5;
}

.modal-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.modal-icon-badge {
  width: 40px;
  height: 40px;
  border-radius: 0;
  overflow: visible;
  background: transparent;
  border: none;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 3px 10px rgba(25, 230, 227, 0.35));
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  margin-bottom: 3px;
}

.modal-subtitle {
  font-size: 0.84rem;
  color: var(--text-secondary);
}

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

.modal-close-btn:hover {
  background: #f0ede6;
  color: var(--text-main);
}

.modal-body {
  padding: 24px 28px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.section-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
/* ==========================================================================
   Pure CSS Interactive Tooltips
   ========================================================================== */
[data-tooltip] {
  position: relative;
  cursor: pointer;
}

[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 6px 12px;
  background: #090a0e;
  color: #ffffff;
  font-family: var(--font-family);
  font-size: 0.72rem;
  font-weight: 500;
  white-space: nowrap;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 1000;
}

[data-tooltip]::after {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px 5px 0 5px;
  border-style: solid;
  border-color: #090a0e transparent transparent transparent;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
  z-index: 1000;
}

[data-tooltip]:hover::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

[data-tooltip]:hover::after {
  opacity: 1;
}

/* ==========================================================================
   APP SHELL — Header, Nav, Mobile Drawer, Page Frame
   Shared by Home / Leads / Regeneration / How It Works
   ========================================================================== */

:root {
  --shell-max: 1240px;
  --gutter: 16px;
  --tap: 44px;
  --status-new-bg: #eef2ff;
  --status-new-fg: #4053c7;
  --status-sent-bg: #e6f9f5;
  --status-sent-fg: #0d8276;
  --status-due-bg: #e6fcfb;
  --status-due-fg: #088b88;
  --status-done-bg: #f0f0f2;
  --status-done-fg: #5e606a;
  --danger-bg: #ffecec;
  --danger-fg: #c23a36;
}

html, body {
  overflow-x: hidden;
  max-width: 100%;
}

/* The [hidden] attribute must win over our display rules. */
[hidden] { display: none !important; }

body.app-mode {
  background-color: var(--bg-canvas);
}

.view-screen {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

/* ---------- App header ---------- */
.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(251, 250, 247, 0.88);
  backdrop-filter: saturate(160%) blur(16px);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  padding-top: env(safe-area-inset-top);
}

.app-header-inner {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 10px var(--gutter);
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: 0;
  padding: 4px;
  margin-left: -4px;
  cursor: pointer;
  color: inherit;
  font: inherit;
  text-align: left;
  border-radius: var(--radius-md);
  flex: 0 0 auto;
}

.app-brand:focus-visible { outline: 2px solid var(--orange-primary); outline-offset: 2px; }

.app-brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 0;
  overflow: visible;
  background: transparent;
  border: none;
  box-shadow: none;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-brand-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(25, 230, 227, 0.35));
}

.app-brand-text { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.app-brand-name {
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--text-main);
  white-space: nowrap;
}
.app-brand-sub {
  font-size: 0.66rem;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

/* ---------- Desktop nav ---------- */
.app-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0 auto;
  background: rgba(20, 21, 26, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 4px;
}

.app-nav-link {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  padding: 8px 16px;
  min-height: 36px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--transition-fast), background var(--transition-fast);
}

.app-nav-link:hover { color: var(--text-main); background: rgba(255, 255, 255, 0.7); }

.app-nav-link[aria-current="page"] {
  background: #ffffff;
  color: var(--text-main);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border-subtle);
  padding: 7px 15px;
}

.app-nav-link[aria-current="page"]::after {
  content: '';
  display: block;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: var(--orange-primary);
  margin: 3px auto -4px auto;
}

/* ---------- Header right ---------- */
.app-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex: 0 0 auto;
}

.user-menu-wrapper { position: relative; }

.user-avatar-trigger {
  width: var(--tap);
  height: var(--tap);
  padding: 4px;
  border-radius: 50%;
  border: 1px solid var(--border-light);
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: box-shadow var(--transition-fast);
}
.user-avatar-trigger:hover { box-shadow: 0 2px 10px rgba(0,0,0,0.12); }
.user-avatar-trigger img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 232px;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 8px;
  display: none;
  z-index: 80;
}
.user-dropdown-menu.active { display: block; }

.dropdown-header { padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; }
.dropdown-header strong { font-size: 0.9rem; }
.dropdown-header .subtext { font-size: 0.76rem; color: var(--text-muted); word-break: break-all; }
.dropdown-divider { height: 1px; background: var(--border-subtle); margin: 6px 0; }
.dropdown-item {
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 10px;
  min-height: var(--tap);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.dropdown-item:hover { background: var(--bg-card-subtle); color: var(--text-main); }
.dropdown-item.danger { color: var(--danger-fg); }
.dropdown-item.danger:hover { background: var(--danger-bg); }

/* ---------- Mobile menu button + drawer ---------- */
.app-menu-btn {
  display: none;
  width: var(--tap);
  height: var(--tap);
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: #fff;
  color: var(--text-main);
  cursor: pointer;
  flex: 0 0 auto;
}

.app-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 9, 12, 0.5);
  backdrop-filter: blur(3px);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--ease-spring);
}
.app-drawer-backdrop.active { opacity: 1; pointer-events: auto; }

.app-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(84vw, 320px);
  background: #fff;
  border-left: 1px solid var(--border-light);
  box-shadow: -18px 0 50px rgba(0, 0, 0, 0.18);
  z-index: 95;
  transform: translateX(102%);
  transition: transform 0.26s var(--ease-spring);
  display: flex;
  flex-direction: column;
  padding: calc(env(safe-area-inset-top) + 14px) 14px calc(env(safe-area-inset-bottom) + 14px) 14px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.app-drawer.active { transform: translateX(0); }

.app-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 12px;
}
.app-drawer-title { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.1em; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; }

.app-drawer-close {
  width: var(--tap);
  height: var(--tap);
  border-radius: 50%;
  border: 1px solid var(--border-light);
  background: #fff;
  color: var(--text-secondary);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.app-drawer-nav { display: flex; flex-direction: column; gap: 4px; }

.app-drawer-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  font: inherit;
  font-size: 0.98rem;
  font-weight: 650;
  color: var(--text-secondary);
  text-align: left;
  cursor: pointer;
}
.app-drawer-link:hover { background: var(--bg-card-subtle); color: var(--text-main); }
.app-drawer-link[aria-current="page"] {
  background: var(--orange-tint);
  color: var(--text-main);
  box-shadow: inset 3px 0 0 var(--orange-primary);
}

.app-drawer-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border-subtle); display: flex; flex-direction: column; gap: 8px; }
.app-drawer-user { display: flex; flex-direction: column; gap: 2px; padding: 4px 6px; }
.app-drawer-user strong { font-size: 0.9rem; }
.app-drawer-user span { font-size: 0.76rem; color: var(--text-muted); word-break: break-all; }

/* ---------- Page frame ---------- */
.app-main {
  flex: 1 1 auto;
  width: 100%;
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: 22px var(--gutter) calc(48px + env(safe-area-inset-bottom)) var(--gutter);
}

.app-page { display: none; }
.app-page.active { display: block; animation: pageIn 0.22s var(--ease-spring); }

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

.page-head { margin-bottom: 20px; }
.page-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--orange-primary);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.page-title {
  font-size: clamp(1.5rem, 5vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-main);
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.page-sub {
  margin-top: 8px;
  font-size: 0.94rem;
  color: var(--text-secondary);
  max-width: 62ch;
  line-height: 1.55;
}

.surface {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.surface-pad { padding: 18px; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 28px 0 12px 0;
}
.section-title { font-size: 1.1rem; font-weight: 750; letter-spacing: -0.01em; }
.section-note { font-size: 0.8rem; color: var(--text-muted); }

/* ---------- Buttons ---------- */
.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 11px 18px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-light);
  background: #fff;
  color: var(--text-main);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
  text-decoration: none;
  line-height: 1.2;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: var(--shadow-subtle); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-accent {
  background: var(--orange-gradient);
  color: #0b1a19;
  font-weight: 750;
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(25, 230, 227, 0.35);
}
.btn-accent:hover:not(:disabled) { box-shadow: 0 8px 22px rgba(25, 230, 227, 0.42); color: #0b1a19; }

.btn-quiet { background: transparent; border-color: var(--border-subtle); color: var(--text-secondary); }
.btn-quiet:hover:not(:disabled) { background: var(--bg-card-subtle); color: var(--text-main); }

.btn-sm { min-height: 38px; padding: 8px 14px; font-size: 0.8rem; }
.btn-block { width: 100%; }

@media (max-width: 767px) {
  .btn-sm { min-height: var(--tap); }
}

.btn-spinner {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-top-color: transparent;
  animation: spin 0.7s linear infinite;
  flex: 0 0 auto;
}

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

/* ---------- Tiles (Home) ---------- */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}

.tile-grid > * { min-width: 0; }

.tile {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-subtle);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.tile-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
}
.tile-value {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-main);
  line-height: 1.1;
  overflow-wrap: anywhere;
}
.tile-value.small { font-size: 1.02rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; }
.tile-value.accent { color: var(--orange-primary); }
.tile-note { font-size: 0.76rem; color: var(--text-secondary); line-height: 1.4; }

.home-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.run-card {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 22px;
  align-items: center;
  padding: 16px 18px;
}
.run-card-item { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

/* ---------- Filters ---------- */
.filters { display: flex; flex-direction: column; gap: 14px; padding: 14px; }

.search-field-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-pill);
  padding: 0 16px;
  min-height: var(--tap);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.search-field-box:focus-within { border-color: var(--border-active); box-shadow: 0 0 0 3px var(--orange-tint); }
.search-field-box .search-icon { color: var(--text-muted); flex: 0 0 auto; }
.search-field-box input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 16px;
  color: var(--text-main);
  padding: 10px 0;
}
.search-field-box input::placeholder { color: var(--text-muted); }

.filter-row { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.filter-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.chip-strip {
  display: flex;
  max-width: 100%;
  min-width: 0;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  padding: 2px 2px 8px 2px;
  margin: -2px -2px -4px -2px;
  scroll-snap-type: x proximity;
}
.chip-strip::-webkit-scrollbar { height: 4px; }
.chip-strip::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 4px; }

.f-chip {
  flex: 0 0 auto;
  scroll-snap-align: start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: #fff;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}
.f-chip:hover { border-color: #ffd8be; background: #fff9f4; color: var(--text-main); }
.f-chip[aria-pressed="true"] {
  background: var(--text-main);
  border-color: var(--text-main);
  color: #fff;
}
.f-chip[aria-pressed="true"] .f-chip-count { background: rgba(255,255,255,0.22); color: #fff; }
.f-chip-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  background: rgba(20, 21, 26, 0.06);
  color: var(--text-muted);
}

.custom-range { display: none; gap: 8px; flex-wrap: wrap; align-items: center; }
.custom-range.active { display: flex; }
.custom-range label { font-size: 0.76rem; color: var(--text-muted); font-weight: 600; }

.input-line {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  padding: 9px 12px;
  min-height: var(--tap);
  font: inherit;
  font-size: 16px;
  color: var(--text-main);
  outline: 0;
  min-width: 0;
  max-width: 100%;
}
.input-line:focus { border-color: var(--border-active); box-shadow: 0 0 0 3px var(--orange-tint); }

.results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin: 16px 0 10px 0;
}
.results-count { font-size: 0.84rem; color: var(--text-secondary); font-weight: 600; }

/* ---------- Lead cards ---------- */
.lead-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.lead-grid > * { min-width: 0; }

@media (min-width: 900px) {
  .lead-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.lead-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-subtle);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.lead-card:hover { border-color: var(--border-light); box-shadow: var(--shadow-card); }

.lead-card-top { display: flex; gap: 12px; align-items: flex-start; min-width: 0; }

.lead-identity { flex: 1 1 auto; min-width: 0; }
.lead-name {
  font-size: 1rem;
  font-weight: 750;
  color: var(--text-main);
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}
.lead-domain {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.74rem;
  color: var(--text-muted);
  overflow-wrap: anywhere;
  margin-top: 2px;
}

.lead-score {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--orange-tint);
  border: 1px solid rgba(25, 230, 227, 0.25);
}
.lead-score-val { font-size: 1.1rem; font-weight: 800; color: #088b88; line-height: 1; }
.lead-score-lbl { font-size: 0.56rem; font-weight: 700; letter-spacing: 0.08em; color: #088b88; opacity: 0.8; }

.badge-row { display: flex; flex-wrap: wrap; gap: 6px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  background: var(--bg-card-subtle);
  color: var(--text-secondary);
  max-width: 100%;
  overflow-wrap: anywhere;
}
.badge.auto { background: #e9f1ff; color: #2f5bbd; }
.badge.manual { background: #f3e9ff; color: #6b3fbd; }
.badge.niche { background: #e6fcfb; color: #088b88; }
.badge.st-new { background: var(--status-new-bg); color: var(--status-new-fg); }
.badge.st-sent { background: var(--status-sent-bg); color: var(--status-sent-fg); }
.badge.st-due { background: var(--status-due-bg); color: var(--status-due-fg); }
.badge.st-done { background: var(--status-done-bg); color: var(--status-done-fg); }

.lead-meta { display: flex; flex-direction: column; gap: 6px; }
.meta-line { display: flex; gap: 8px; font-size: 0.82rem; min-width: 0; }
.meta-k {
  flex: 0 0 74px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-transform: uppercase;
  padding-top: 3px;
}
.meta-v { flex: 1 1 auto; min-width: 0; color: var(--text-secondary); overflow-wrap: anywhere; line-height: 1.45; }
.meta-v strong { color: var(--text-main); font-weight: 650; }

.followup-line {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 650;
  background: var(--bg-card-subtle);
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}
.followup-line.due { background: var(--status-due-bg); color: var(--status-due-fg); }
.followup-line.done { background: var(--status-sent-bg); color: var(--status-sent-fg); }

.lead-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.lead-actions .btn { flex: 1 1 auto; min-width: 128px; }

/* ---------- Pagination ---------- */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}
.pager-info { font-size: 0.82rem; color: var(--text-secondary); font-weight: 600; }

/* ---------- States (loading / empty / error) ---------- */
.state-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  padding: 40px 20px;
  background: var(--bg-card);
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-lg);
}
.state-title { font-size: 1rem; font-weight: 750; color: var(--text-main); }
.state-desc { font-size: 0.88rem; color: var(--text-secondary); max-width: 46ch; line-height: 1.55; overflow-wrap: anywhere; }
.state-box.error { border-color: rgba(194, 58, 54, 0.3); background: #fff8f8; }
.state-box.error .state-title { color: var(--danger-fg); }

.skel {
  border-radius: var(--radius-lg);
  background: linear-gradient(100deg, #f1efe9 25%, #f8f7f3 45%, #f1efe9 65%);
  background-size: 300% 100%;
  animation: shimmer 1.4s linear infinite;
}
.skel-card { height: 176px; }
.skel-tile { height: 98px; }
.skel-row { height: 78px; }

@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.inline-error {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--danger-bg);
  border: 1px solid rgba(194, 58, 54, 0.25);
  color: var(--danger-fg);
  font-size: 0.84rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.inline-error:empty { display: none; }

/* ---------- Regeneration ---------- */
.regen-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.regen-grid > * { min-width: 0; }

@media (min-width: 980px) {
  .regen-grid { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: start; }
}

.explainer {
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  background: var(--orange-tint);
  border: 1px solid rgba(25, 230, 227, 0.25);
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}
.explainer strong { color: var(--text-main); }

.field-block { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.field-block > label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.quota-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card-subtle);
}
.quota-label { font-size: 0.78rem; color: var(--text-secondary); font-weight: 650; }
.quota-value { font-size: 1.05rem; font-weight: 800; color: var(--text-main); font-family: 'JetBrains Mono', monospace; }
.quota-value.out { color: var(--danger-fg); }

.progress-track {
  height: 10px;
  border-radius: var(--radius-pill);
  background: rgba(20, 21, 26, 0.08);
  overflow: hidden;
  margin-top: 6px;
}
.progress-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--orange-gradient);
  width: 0%;
  transition: width 0.4s var(--ease-spring);
}

.run-status {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}
.run-status-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.07em;
}
.status-pill.QUEUED { background: var(--status-new-bg); color: var(--status-new-fg); }
.status-pill.PROCESSING { background: var(--status-due-bg); color: var(--status-due-fg); }
.status-pill.COMPLETED { background: var(--status-sent-bg); color: var(--status-sent-fg); }
.status-pill.PARTIAL { background: #fff6e0; color: #96690a; }
.status-pill.FAILED { background: var(--danger-bg); color: var(--danger-fg); }

.counter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
  gap: 8px;
  min-width: 0;
}

.counter-grid > * { min-width: 0; }
.counter {
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-subtle);
  text-align: center;
  min-width: 0;
}
.counter-v { font-size: 1.05rem; font-weight: 800; color: var(--text-main); font-family: 'JetBrains Mono', monospace; }
.counter-k { font-size: 0.6rem; font-weight: 700; letter-spacing: 0.06em; color: var(--text-muted); text-transform: uppercase; }

.batch-list { display: flex; flex-direction: column; gap: 10px; }

.batch-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-subtle);
  min-width: 0;
}
.batch-row-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.batch-niche { font-size: 0.95rem; font-weight: 700; overflow-wrap: anywhere; }
.batch-when { font-size: 0.74rem; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; }
.batch-summary { font-size: 0.84rem; color: var(--text-secondary); line-height: 1.5; overflow-wrap: anywhere; }

/* ---------- How it works ---------- */
.hiw-steps { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.hiw-steps > * { min-width: 0; }

@media (min-width: 700px) { .hiw-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1040px) { .hiw-steps { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.hiw-step {
  padding: 16px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-subtle);
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.hiw-num {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--orange-tint);
  color: var(--orange-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.86rem;
  font-family: 'JetBrains Mono', monospace;
}
.hiw-step h3 { font-size: 0.98rem; font-weight: 750; }
.hiw-step p { font-size: 0.86rem; color: var(--text-secondary); line-height: 1.55; }

.hiw-two { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.hiw-two > * { min-width: 0; }
@media (min-width: 760px) { .hiw-two { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.prose { font-size: 0.94rem; color: var(--text-secondary); line-height: 1.68; }
.prose h3 { font-size: 1rem; font-weight: 750; color: var(--text-main); margin-bottom: 6px; }
.prose p + p { margin-top: 10px; }
.prose ul { margin: 10px 0 0 18px; display: flex; flex-direction: column; gap: 6px; }

.cta-band {
  margin-top: 26px;
  padding: 22px;
  border-radius: var(--radius-lg);
  background: var(--orange-tint);
  border: 1px solid rgba(25, 230, 227, 0.25);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.cta-band h3 { font-size: 1.1rem; font-weight: 780; letter-spacing: -0.015em; }
.cta-band p { font-size: 0.88rem; color: var(--text-secondary); margin-top: 4px; }

/* ---------- Modal (sheet on mobile) ---------- */
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  padding: 16px 20px calc(16px + env(safe-area-inset-bottom)) 20px;
  border-top: 1px solid var(--border-subtle);
  background: #faf8f5;
}

.modal-card.compact { max-width: 480px; }
.modal-body { gap: 16px; }
.modal-body .field-block { margin-bottom: 0; }

.day-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.day-opt {
  flex: 1 1 62px;
  min-height: var(--tap);
  padding: 10px 8px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-subtle);
  background: #faf8f5;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
}
.day-opt[aria-pressed="true"] { border-color: var(--orange-primary); background: #e6fcfb; color: #088b88; }

/* ---------- Footer ---------- */
.app-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 18px var(--gutter) calc(20px + env(safe-area-inset-bottom)) var(--gutter);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 18px;
  font-size: 0.74rem;
  color: var(--text-muted);
  text-align: center;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 1080px) {
  .app-brand-sub { display: none; }
}

@media (max-width: 900px) {
  .app-nav { display: none; }
  .app-menu-btn { display: flex; }
  .user-menu-wrapper { display: none; }
  .app-header-inner { gap: 8px; }
}

@media (max-width: 767px) {
  :root { --gutter: 16px; }
  .app-main { padding-top: 16px; }
  .surface-pad { padding: 14px; }
  .tile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile { padding: 13px; }
  .tile-value { font-size: 1.4rem; }
  .tile-value.small { font-size: 0.92rem; }
  .home-cta-row .btn { width: 100%; }
  .lead-actions .btn { min-width: 0; flex: 1 1 100%; }
  .cta-band { flex-direction: column; align-items: flex-start; }
  .cta-band .btn { width: 100%; }
  .run-card { gap: 12px; }
  .modal-backdrop { padding: 0; align-items: flex-end; }
  .modal-card {
    max-width: 100%;
    max-height: 92vh;
    max-height: 92dvh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    transform: translateY(24px);
  }
  .modal-backdrop.active .modal-card { transform: translateY(0); }
  .modal-header { padding: 16px; }
  .modal-body { padding: 16px; }
  .modal-footer { padding: 14px 16px calc(14px + env(safe-area-inset-bottom)) 16px; }
  .modal-footer .btn { flex: 1 1 100%; }
  .modal-title { font-size: 1.05rem; }
  .section-head { margin-top: 22px; }
}

@media (max-width: 400px) {
  :root { --gutter: 12px; }
  .app-brand-name { font-size: 0.84rem; }
  .app-brand-icon { width: 30px; height: 30px; }
  .tile { padding: 11px; }
  .tile-value { font-size: 1.25rem; }
  .lead-score { width: 46px; height: 46px; }
  .meta-k { flex-basis: 66px; }
  .page-title { font-size: 1.35rem; }
}

/* Login portal responsive (kept design, tightened for phones) */
@media (max-width: 1024px) {
  .dual-card-container { grid-template-columns: 1fr; max-width: 520px; }
  .portal-main { padding: 24px 16px; }
}

@media (max-width: 860px) {
  .portal-header { padding: 12px 16px; flex-wrap: wrap; gap: 10px; }
  .portal-header .system-status-pill { display: none; }
  .portal-header-right .btn-portal-how { display: none; }
  .portal-footer { flex-direction: column; gap: 10px; text-align: center; padding: 16px; }
  .footer-left, .footer-right { justify-content: center; flex-wrap: wrap; gap: 10px; }
}

@media (max-width: 560px) {
  .portal-header .jeux-dev-capsule .jeux-dev-text { display: none; }
  .gateway-card, .dispatch-card { padding: 22px 18px; }
  .gateway-title { font-size: 1.7rem; }
  .footer-right { display: none; }
  .portal-footer { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
  .input-wrapper input { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* Focus visibility across the app */
.btn:focus-visible,
.f-chip:focus-visible,
.app-nav-link:focus-visible,
.app-drawer-link:focus-visible,
.dropdown-item:focus-visible,
.day-opt:focus-visible,
.input-line:focus-visible,
.modal-close-btn:focus-visible {
  outline: 2px solid var(--orange-primary);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Tooltips are a pointer affordance only. */
@media (hover: none) {
  [data-tooltip]::before, [data-tooltip]::after { content: none; }
}

/* Textarea inside the action modal */
textarea.input-line { resize: vertical; min-height: 84px; line-height: 1.5; font-family: inherit; }

/* ==========================================================================
   Touch target sizing — everything tappable reaches 44px on phones/tablets
   ========================================================================== */
.app-brand { min-height: var(--tap); }

@media (max-width: 900px), (hover: none) {
  .f-chip { min-height: var(--tap); padding: 10px 16px; }
  .modal-close-btn { width: var(--tap); height: var(--tap); }
  .app-drawer-close { width: var(--tap); height: var(--tap); }
  .eye-toggle-btn { min-width: var(--tap); min-height: var(--tap); }
  .btn-sm { min-height: var(--tap); }
}

/* Grid and flex children must be allowed to shrink below their content width,
   otherwise a horizontally scrolling strip blows the whole column out. */
.regen-grid > .surface,
.run-status,
.filters,
.field-block,
.batch-row,
.batch-row > *,
.lead-card,
.lead-card > * { min-width: 0; }

/* ── ICP match badges ──────────────────────────────────────────────────────
   How well a company matches the kind of client this agency can actually win.
   A famous enterprise scores well on generic quality but runs its own
   engineering team, so match quality is shown separately from lead score. */
.badge.fit-ideal {
  background: color-mix(in srgb, var(--success, #12805c) 12%, transparent);
  color: var(--success, #12805c);
  border: 1px solid color-mix(in srgb, var(--success, #12805c) 28%, transparent);
}
.badge.fit-good {
  background: color-mix(in srgb, var(--accent, #ff5b24) 10%, transparent);
  color: var(--accent, #ff5b24);
  border: 1px solid color-mix(in srgb, var(--accent, #ff5b24) 26%, transparent);
}
.badge.fit-weak {
  background: color-mix(in srgb, var(--text-muted, #6b7280) 10%, transparent);
  color: var(--text-muted, #6b7280);
  border: 1px solid color-mix(in srgb, var(--text-muted, #6b7280) 22%, transparent);
}

/* ── Market picker ─────────────────────────────────────────────────────────
   Markets are tapped, not typed. Each card already carries the queries the
   engine runs and the allowance left, so the choice needs no second screen. */
.market-groups { display: flex; flex-direction: column; gap: 18px; margin-top: 10px; }
.market-group-head { margin-bottom: 8px; }
.market-group-title {
  font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-muted, #6b7280);
}
.market-group-sub { font-size: 12.5px; color: var(--text-muted, #6b7280); margin-top: 3px; line-height: 1.45; }
.market-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 10px; }
.market-card {
  display: flex; flex-direction: column; gap: 4px; text-align: left;
  padding: 12px 13px; min-height: 44px;
  border: 1px solid var(--border, #e5e7eb); border-radius: 14px;
  background: var(--surface, #fff); color: inherit;
  cursor: pointer; font: inherit; transition: border-color .15s ease, background .15s ease;
}
.market-card:hover { border-color: var(--accent, #ff5b24); }
.market-card:focus-visible { outline: 2px solid var(--accent, #ff5b24); outline-offset: 2px; }
.market-card[aria-pressed="true"] {
  border-color: var(--accent, #ff5b24);
  background: color-mix(in srgb, var(--accent, #ff5b24) 8%, transparent);
}
.market-card-name { font-weight: 650; font-size: 14px; line-height: 1.3; }
.market-card-meta { font-size: 11.5px; color: var(--text-muted, #6b7280); }
.market-card.is-exhausted { opacity: .5; cursor: not-allowed; }
.market-card.is-exhausted:hover { border-color: var(--border, #e5e7eb); }
.custom-market { margin-top: 14px; }
.custom-market > summary {
  cursor: pointer; font-size: 13px; color: var(--text-muted, #6b7280);
  padding: 8px 0; min-height: 44px; display: flex; align-items: center;
}
.custom-market > summary:focus-visible { outline: 2px solid var(--accent, #ff5b24); outline-offset: 2px; }
.field-hint { font-size: 12.5px; color: var(--text-muted, #6b7280); margin: 2px 0 0; line-height: 1.5; }
@media (max-width: 480px) {
  .market-grid { grid-template-columns: 1fr 1fr; }
  .market-card { padding: 11px; }
}

/* ==========================================================================
   DARK COMMAND BAR
   A single dark rail carrying the brand, the routes and the account control.
   Every hook the controller binds to is preserved; only the presentation
   changes, so routing, the drawer and the account menu keep working.
   ========================================================================== */
.app-header {
  background: transparent;
  border-bottom: 0;
  box-shadow: none;
  padding: 14px 0 6px;
  backdrop-filter: none;
}
.app-header-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 10px 16px;
  gap: 16px;
}
@media (min-width: 900px) {
  .app-header-inner {
    background: #16171c;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: var(--radius-pill);
    padding: 9px 12px 9px 18px;
    box-shadow: 0 10px 34px rgba(12, 13, 18, 0.22);
  }
}
@media (min-width: 900px) {
  .app-brand-name { color: #fff; letter-spacing: .02em; }
  .app-brand-sub {
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
  }
  .app-brand-sub::before { content: "— "; }

  /* Nav sits in an inset capsule, as a grouped control rather than loose links. */
  .app-nav {
    background: rgba(255, 255, 255, 0.055);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: var(--radius-pill);
    padding: 4px;
    gap: 2px;
  }
  .app-nav-link {
    color: rgba(255, 255, 255, 0.62);
    border-radius: var(--radius-pill);
    padding: 8px 16px;
    font-weight: 600;
  }
  .app-nav-link:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
  .app-nav-link[aria-current="page"] {
    color: #fff;
    background: rgba(255, 255, 255, 0.13);
  }
  /* The light theme marks the active route with an underline bar; inside the
     dark capsule the filled pill already carries that meaning. */
  .app-nav-link[aria-current="page"]::after { display: none; }

  .app-menu-btn { display: none; }
}

.product-badge {
  display: none;
  align-items: center;
  gap: 7px;
  padding: 6px 12px 6px 7px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}
.product-badge:hover { background: rgba(255, 255, 255, 0.11); color: #fff; }
.product-badge strong { color: #fff; font-weight: 650; }
.product-badge-icon {
  width: 18px;
  height: 18px;
  overflow: visible;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.product-badge-icon img { width: 100%; height: 100%; object-fit: contain; display: block; }
@media (min-width: 1120px) { .product-badge { display: inline-flex; } }

@media (min-width: 900px) {
  .user-avatar-trigger {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
  }
}

/* ==========================================================================
   LEADS COCKPIT
   Lead list beside the prepared message, so an operator reads a company and
   acts on it without losing their place in the list.
   ========================================================================== */
.cockpit { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 1080px) {
  .cockpit { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; }
  .cockpit-panel { position: sticky; top: 92px; max-height: calc(100vh - 112px); overflow: auto; }
}
.cockpit-list { min-width: 0; }

.cockpit-panel {
  min-width: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
}

.panel-empty { padding: 44px 24px; text-align: center; }
.panel-empty-icon { font-size: 26px; opacity: .35; }
.panel-empty-title { font-weight: 650; margin: 10px 0 4px; }
.panel-empty-sub { font-size: 13px; color: var(--text-muted); line-height: 1.55; margin: 0; }

.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid var(--border-subtle);
}
.panel-title { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 7px; }
.panel-tag {
  font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent-primary, #19E6E3); background: rgba(25, 230, 227, .12);
  border: 1px solid rgba(25, 230, 227, .28); border-radius: var(--radius-pill); padding: 4px 9px;
}
.panel-section { padding: 14px 16px; border-bottom: 1px solid var(--border-subtle); }
.panel-section:last-child { border-bottom: 0; }
.panel-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 8px;
}

.dossier { display: flex; gap: 11px; align-items: flex-start; }
.dossier-avatar {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  display: grid; place-items: center; font-weight: 700; font-size: 14px;
  background: rgba(25, 230, 227, .12); color: var(--accent-primary, #19E6E3);
}
.dossier-main { min-width: 0; }
.dossier-name { font-weight: 650; }
.dossier-role { font-size: 12.5px; color: var(--text-muted); }
.dossier-email {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px;
  color: var(--accent-primary, #19E6E3); word-break: break-all; margin-top: 3px;
}

.draft-subject {
  background: var(--bg-card-subtle); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); padding: 10px 12px; font-weight: 600; font-size: 13.5px;
}
.draft-body {
  background: var(--bg-card-subtle); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); padding: 12px;
  font-size: 13px; line-height: 1.62; white-space: pre-wrap; max-height: 260px; overflow: auto;
}
.draft-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.draft-pill {
  font-size: 10.5px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase;
  border-radius: var(--radius-pill); padding: 4px 9px;
  background: var(--bg-card-subtle); border: 1px solid var(--border-subtle); color: var(--text-secondary);
}
.draft-missing { font-size: 13px; color: var(--text-muted); line-height: 1.55; }
.panel-actions { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; }
.panel-actions .btn { width: 100%; }

/* Selected row in the list mirrors what the panel is showing. */
.lead-card.is-selected {
  border-color: var(--accent-primary, #19E6E3);
  box-shadow: 0 0 0 1px var(--accent-primary, #19E6E3) inset, var(--shadow-card);
}

/* Beside the panel the list is one column: a two-up grid squeezes each card to
   roughly a third of the window and the company name wraps to three lines. */
@media (min-width: 1080px) {
  .cockpit-list .lead-grid { grid-template-columns: minmax(0, 1fr); }
  /* The panel carries the primary action, so the row keeps a compact version. */
  .cockpit-list .lead-actions .btn { padding: 7px 12px; font-size: 12.5px; }
  .cockpit-list .lead-actions { gap: 6px; }
}

/* ==========================================================================
   HOW IT WORKS — dark explainer
   The one page that earns a dark treatment: it is read once, not worked in.
   Every figure on it comes from the backend; nothing here is decorative data.
   ========================================================================== */
.hiw-dark {
  background: #121317;
  color: #e8e9ee;
  border-radius: var(--radius-xl);
  padding: 26px 20px 30px;
  margin-top: 4px;
  background-image:
    radial-gradient(900px 340px at 78% -8%, rgba(25, 230, 227, .18), transparent 62%),
    radial-gradient(620px 320px at 8% 4%, rgba(25, 230, 227, .09), transparent 60%);
}
@media (min-width: 900px) { .hiw-dark { padding: 38px 34px 40px; } }

.hiw-hero { display: grid; gap: 22px; align-items: center; }
@media (min-width: 980px) { .hiw-hero { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 34px; } }
.hiw-kicker {
  font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--accent-primary, #19E6E3);
}
.hiw-title {
  font-size: clamp(30px, 5.2vw, 50px); line-height: 1.06; letter-spacing: -.02em;
  margin: 12px 0 0; color: #fff; font-weight: 750;
}
.hiw-lede {
  margin: 14px 0 0; max-width: 56ch; font-size: 15px; line-height: 1.68;
  color: rgba(232, 233, 238, .7);
}
.hiw-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.btn-ghost-dark {
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .16);
  color: #fff;
}
.btn-ghost-dark:hover { background: rgba(255, 255, 255, .12); }

.hiw-hero-side { position: relative; border-radius: var(--radius-lg); overflow: hidden; min-height: 190px; }
.hiw-hero-side img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: .62; }
.hiw-hero-tag {
  position: absolute; left: 12px; bottom: 12px;
  background: rgba(10, 11, 14, .82); border: 1px solid rgba(255, 255, 255, .14);
  border-radius: var(--radius-pill); padding: 7px 13px; font-size: 12px; color: #fff;
}

.hiw-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 26px; }
@media (min-width: 820px) { .hiw-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.hiw-stat {
  background: rgba(255, 255, 255, .045); border: 1px solid rgba(255, 255, 255, .08);
  border-radius: var(--radius-lg); padding: 15px 16px;
}
.hiw-stat-v { font-size: 25px; font-weight: 750; color: #fff; line-height: 1.1; }
.hiw-stat-l {
  font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: rgba(232, 233, 238, .48); margin-bottom: 6px;
}
.hiw-stat-s { font-size: 12px; color: rgba(232, 233, 238, .55); margin-top: 3px; }

.hiw-block-head { margin: 34px 0 14px; }
.hiw-block-head.tight { margin: 0 0 10px; }
.hiw-block-head h2 { font-size: 20px; color: #fff; margin: 0; font-weight: 700; }
.hiw-block-head span { display: block; font-size: 13px; color: rgba(232, 233, 238, .55); margin-top: 4px; }

.hiw-nodes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 232px), 1fr)); gap: 12px; }
.hiw-node {
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .08);
  border-radius: var(--radius-lg); padding: 16px;
}
.hiw-node-n {
  font-size: 10.5px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: var(--accent-primary, #19E6E3);
}
.hiw-node h3 { font-size: 15.5px; color: #fff; margin: 8px 0 6px; font-weight: 680; }
.hiw-node p { font-size: 13px; line-height: 1.6; color: rgba(232, 233, 238, .66); margin: 0; }

.hiw-split { display: grid; gap: 12px; margin-top: 30px; }
@media (min-width: 980px) { .hiw-split { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.hiw-card {
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .08);
  border-radius: var(--radius-lg); padding: 20px;
}
.hiw-note { font-size: 13px; color: rgba(232, 233, 238, .6); line-height: 1.6; margin: 0 0 12px; }
.hiw-reasons { list-style: none; margin: 0; padding: 0; display: grid; gap: 11px; }
.hiw-reasons li {
  font-size: 13px; line-height: 1.6; color: rgba(232, 233, 238, .66);
  padding-left: 15px; position: relative;
}
.hiw-reasons li::before {
  content: ""; position: absolute; left: 0; top: 8px; width: 5px; height: 5px;
  border-radius: 50%; background: var(--accent-primary, #19E6E3);
}
.hiw-reasons strong { color: #fff; font-weight: 640; }

.hiw-way { padding: 13px 0; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.hiw-way:last-of-type { border-bottom: 0; }
.hiw-way p { font-size: 13px; line-height: 1.6; color: rgba(232, 233, 238, .66); margin: 7px 0 0; }
.hiw-way-tag {
  font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  border-radius: var(--radius-pill); padding: 4px 10px;
}
.hiw-way-tag.auto { background: rgba(93, 160, 255, .14); color: #8fc0ff; border: 1px solid rgba(93, 160, 255, .26); }
.hiw-way-tag.manual { background: rgba(25, 230, 227, .14); color: #19E6E3; border: 1px solid rgba(25, 230, 227, .35); }

.hiw-schedule {
  margin-top: 14px; padding-top: 13px; border-top: 1px solid rgba(255, 255, 255, .07);
  font-size: 12.5px; color: rgba(232, 233, 238, .6); line-height: 1.6;
}
.hiw-schedule strong { color: #fff; }

.hiw-foot {
  margin-top: 30px; padding-top: 22px; border-top: 1px solid rgba(255, 255, 255, .08);
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
}
.hiw-foot p { margin: 0; color: rgba(232, 233, 238, .7); font-size: 15px; }
