/* =========================================================================
   AS ENGINE — FULLSCREEN AI COCKPIT STYLES
   ========================================================================= */

:root {
  --bg-primary: #07090e;
  --bg-secondary: #0d121d;
  --bg-card: rgba(16, 24, 39, 0.75);
  --bg-card-hover: rgba(22, 34, 55, 0.85);
  --bg-card-solid: #111827;
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(0, 242, 254, 0.35);
  --border-purple: rgba(139, 92, 246, 0.35);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --accent-cyan: #00f2fe;
  --accent-blue: #3b82f6;
  --accent-purple: #8b5cf6;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  
  --gradient-brand: linear-gradient(135deg, #00f2fe 0%, #4facfe 50%, #8b5cf6 100%);
  --gradient-glow: radial-gradient(circle at 50% 0%, rgba(0, 242, 254, 0.18), transparent 70%);
  --gradient-card-glow: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.01) 100%);
  --gradient-instagram: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  --gradient-telegram: linear-gradient(135deg, #2aabee 0%, #229ed9 100%);
  --gradient-whatsapp: linear-gradient(135deg, #25d366 0%, #128c7e 100%);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 9999px;
  
  --shadow-glow-cyan: 0 0 35px rgba(0, 242, 254, 0.25);
  --shadow-glow-purple: 0 0 35px rgba(139, 92, 246, 0.25);
  --shadow-card: 0 20px 40px -15px rgba(0, 0, 0, 0.7);
  
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --transition-smooth: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html, body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: 
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(0, 242, 254, 0.12), transparent 70%),
    radial-gradient(ellipse 60% 40% at 90% 40%, rgba(139, 92, 246, 0.08), transparent 60%),
    radial-gradient(ellipse 50% 40% at 10% 70%, rgba(16, 185, 129, 0.06), transparent 60%),
    var(--bg-primary);
}

/* Background Animated Grid */
.bg-ambient-grid {
  position: fixed;
  inset: 0;
  background-size: 50px 50px;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  pointer-events: none;
  z-index: 0;
}

/* Master Layout */
.cockpit-fullscreen-app {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
}

/* -------------------------------------------------------------------------
   TOP HUD NAVIGATION BAR
   ------------------------------------------------------------------------- */
.cockpit-top-bar {
  flex-shrink: 0;
  height: 64px;
  background: rgba(10, 14, 23, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  gap: 16px;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  transition: var(--transition-smooth);
  white-space: nowrap;
  flex-shrink: 0;
}

.back-link:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
}

.brand-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  white-space: nowrap;
}

.brand-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--gradient-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #07090e;
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.4);
  flex-shrink: 0;
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.hud-pill {
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(0, 242, 254, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 242, 254, 0.3);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Center Channel Switcher */
.top-bar-center {
  display: flex;
  align-items: center;
}

.channel-switcher {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 3px;
  gap: 4px;
}

.channel-pill-btn {
  padding: 7px 16px;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition-smooth);
}

.channel-pill-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
}

.channel-pill-btn.active.ig {
  background: var(--gradient-instagram);
  color: #ffffff;
  box-shadow: 0 0 16px rgba(225, 48, 108, 0.4);
}

.channel-pill-btn.active.tg {
  background: var(--gradient-telegram);
  color: #ffffff;
  box-shadow: 0 0 16px rgba(42, 171, 238, 0.4);
}

.channel-pill-btn.active.wa {
  background: var(--gradient-whatsapp);
  color: #ffffff;
  box-shadow: 0 0 16px rgba(37, 211, 102, 0.4);
}

/* Right Control Actions */
.top-bar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: var(--accent-emerald);
  font-size: 0.78rem;
  font-weight: 600;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-emerald);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px var(--accent-emerald);
  animation: pulse-glow 2s infinite ease-in-out;
}

@keyframes pulse-glow {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

.hud-tool-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.hud-tool-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
}

.hud-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  background: var(--gradient-brand);
  color: #07090e;
  font-size: 0.82rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.3);
  transition: var(--transition-smooth);
}

.hud-cta-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 25px rgba(0, 242, 254, 0.5);
}

/* -------------------------------------------------------------------------
   COCKPIT MAIN WORKSPACE (2-COLUMN GRID)
   ------------------------------------------------------------------------- */
.cockpit-workspace {
  flex: 1;
  display: grid;
  grid-template-columns: 410px 1fr;
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
  height: calc(100% - 64px);
  min-height: 0;
}

/* -------------------------------------------------------------------------
   LEFT PANEL: TELEMETRY & SCENARIOS
   ------------------------------------------------------------------------- */
.cockpit-sidebar {
  background: rgba(10, 14, 23, 0.65);
  backdrop-filter: blur(15px);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  min-height: 0;
  height: 100%;
  padding: 20px;
  gap: 16px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 242, 254, 0.35) rgba(255, 255, 255, 0.03);
}

.cockpit-sidebar::-webkit-scrollbar {
  width: 6px;
}
.cockpit-sidebar::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 6px;
}
.cockpit-sidebar::-webkit-scrollbar-thumb {
  background: rgba(0, 242, 254, 0.3);
  border-radius: 6px;
}
.cockpit-sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--accent-cyan);
}

.panel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.panel-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 242, 254, 0.4), transparent);
}

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

.panel-card-title {
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.01em;
}

.telemetry-dossier-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 242, 254, 0.35) rgba(255, 255, 255, 0.03);
}

.telemetry-dossier-grid::-webkit-scrollbar {
  width: 4px;
}
.telemetry-dossier-grid::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 4px;
}
.telemetry-dossier-grid::-webkit-scrollbar-thumb {
  background: rgba(0, 242, 254, 0.3);
  border-radius: 4px;
}
.telemetry-dossier-grid::-webkit-scrollbar-thumb:hover {
  background: var(--accent-cyan);
}

.dossier-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
}

.dossier-key {
  color: var(--text-dim);
  font-weight: 600;
}

.dossier-val {
  color: var(--text-main);
  font-weight: 700;
  text-align: right;
}

.dossier-val.highlight {
  color: var(--accent-cyan);
}

.dossier-val.success {
  color: var(--accent-emerald);
}

/* Preset Scenarios List */
.scenarios-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 350px;
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 242, 254, 0.35) rgba(255, 255, 255, 0.03);
}

.scenarios-list::-webkit-scrollbar {
  width: 5px;
}
.scenarios-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 4px;
}
.scenarios-list::-webkit-scrollbar-thumb {
  background: rgba(0, 242, 254, 0.3);
  border-radius: 4px;
}
.scenarios-list::-webkit-scrollbar-thumb:hover {
  background: var(--accent-cyan);
}

.scenario-card-btn {
  text-align: left;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: inherit;
  font-family: inherit;
}

.scenario-card-btn:hover {
  background: rgba(0, 242, 254, 0.08);
  border-color: rgba(0, 242, 254, 0.35);
  transform: translateX(3px);
}

.scenario-card-btn.active {
  background: rgba(0, 242, 254, 0.12);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.15);
}

.scenario-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.scenario-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.scenario-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: #ffffff;
}

.scenario-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.scenario-badge {
  font-size: 0.65rem;
  color: var(--accent-cyan);
  font-weight: 700;
  margin-top: 4px;
  text-transform: uppercase;
}

/* Mini Performance Strip */
.perf-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.perf-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}

.perf-label {
  font-size: 0.68rem;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 700;
}

.perf-val {
  font-size: 0.92rem;
  font-weight: 800;
  color: #ffffff;
  margin-top: 2px;
}

/* -------------------------------------------------------------------------
   RIGHT PANEL: CHAT COCKPIT INTERFACE
   ------------------------------------------------------------------------- */
.cockpit-chat-section {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(circle at 60% 50%, rgba(0, 242, 254, 0.03), transparent 70%);
  position: relative;
}

/* Chat Header */
.chat-interlocutor-header {
  flex-shrink: 0;
  padding: 14px 24px;
  background: rgba(13, 18, 29, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.interlocutor-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-brand);
  color: #07090e;
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.3);
}

.interlocutor-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.avatar-online-badge {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  background-color: var(--accent-emerald);
  border: 2px solid var(--bg-card-solid);
  border-radius: 50%;
}

.interlocutor-meta {
  display: flex;
  flex-direction: column;
}

.interlocutor-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.interlocutor-name {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
}

.verified-icon {
  color: var(--accent-cyan);
  width: 16px;
  height: 16px;
}

.interlocutor-subtitle {
  font-size: 0.74rem;
  color: var(--accent-emerald);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mobile-scenarios-btn {
  display: none;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: rgba(0, 242, 254, 0.12);
  border: 1px solid rgba(0, 242, 254, 0.35);
  color: var(--accent-cyan);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  align-items: center;
  gap: 4px;
}

/* Chat Scroll Viewport */
.cockpit-chat-viewport {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cockpit-chat-viewport::-webkit-scrollbar {
  width: 5px;
}
.cockpit-chat-viewport::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

/* Message styling */
.chat-date-divider {
  align-self: center;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  font-size: 0.7rem;
  color: var(--text-dim);
  font-weight: 600;
  margin: 4px 0;
}

.cockpit-msg {
  max-width: 78%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: msgAppear 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.cockpit-msg.client {
  align-self: flex-end;
}

.cockpit-msg.concierge {
  align-self: flex-start;
}

.cockpit-msg-bubble {
  padding: 13px 18px;
  border-radius: 20px;
  font-size: 0.92rem;
  line-height: 1.55;
  position: relative;
  word-break: break-word;
}

.cockpit-msg.client .cockpit-msg-bubble {
  background: #2563eb;
  color: #ffffff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 15px rgba(37, 99, 235, 0.25);
}

/* Channel-specific client bubbles */
.channel-ig .cockpit-msg.client .cockpit-msg-bubble {
  background: linear-gradient(135deg, #7928ca 0%, #3b82f6 100%);
  box-shadow: 0 4px 15px rgba(121, 40, 202, 0.3);
}

.channel-tg .cockpit-msg.client .cockpit-msg-bubble {
  background: #2aabee;
  box-shadow: 0 4px 15px rgba(42, 171, 238, 0.25);
}

.channel-wa .cockpit-msg.client .cockpit-msg-bubble {
  background: #005c4b;
  box-shadow: 0 4px 15px rgba(0, 92, 75, 0.25);
}

.cockpit-msg.concierge .cockpit-msg-bubble {
  background: rgba(22, 30, 46, 0.9);
  color: #f1f5f9;
  border: 1px solid var(--border-subtle);
  border-bottom-left-radius: 4px;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.cockpit-msg-meta {
  font-size: 0.7rem;
  color: var(--text-dim);
  padding: 0 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cockpit-msg.client .cockpit-msg-meta {
  justify-content: flex-end;
}

/* Interactive Damage Photo Card inside Chat */
.damage-photo-card {
  margin-top: 10px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(0, 242, 254, 0.35);
  background: rgba(13, 18, 29, 0.95);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.damage-photo-img-wrap {
  width: 100%;
  height: 200px;
  overflow: hidden;
  position: relative;
}

.damage-photo-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-hud-overlay {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}

.photo-hud-badge {
  padding: 4px 10px;
  background: rgba(7, 9, 14, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--accent-cyan);
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  gap: 5px;
}

.damage-photo-details {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.damage-inspection-points {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.78rem;
  color: #cbd5e1;
}

.inspection-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.inspection-item svg {
  color: var(--accent-emerald);
  flex-shrink: 0;
}

.damage-estimate-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: rgba(0, 242, 254, 0.08);
  border: 1px solid rgba(0, 242, 254, 0.2);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  color: #ffffff;
}

/* Slots Selection in Chat */
.slots-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.cockpit-slot-btn {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(0, 242, 254, 0.12);
  border: 1px solid rgba(0, 242, 254, 0.35);
  color: var(--accent-cyan);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.cockpit-slot-btn:hover {
  background: var(--accent-cyan);
  color: #07090e;
  transform: translateY(-1px);
}

/* Typing Indicator */
.typing-bubble {
  background: rgba(22, 30, 46, 0.7);
  padding: 10px 16px;
  border-radius: 18px;
  border-bottom-left-radius: 4px;
  width: fit-content;
  display: flex;
  align-items: center;
  gap: 4px;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background-color: var(--accent-cyan);
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1.1); opacity: 1; }
}

/* Quick Scenarios Bar Above Input */
.cockpit-chips-bar {
  flex-shrink: 0;
  padding: 10px 24px;
  background: rgba(13, 18, 29, 0.75);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
}

.cockpit-chips-bar::-webkit-scrollbar {
  display: none;
}

.chips-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-weight: 700;
  text-transform: uppercase;
  flex-shrink: 0;
}

.cockpit-chip {
  white-space: nowrap;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.cockpit-chip:hover {
  background: rgba(0, 242, 254, 0.12);
  color: #ffffff;
  border-color: rgba(0, 242, 254, 0.35);
}

/* Chat Input Bar Dock */
.cockpit-input-dock {
  flex-shrink: 0;
  padding: 16px 24px;
  background: rgba(10, 14, 23, 0.95);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 10px;
}

.cockpit-dock-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
  flex-shrink: 0;
}

.cockpit-dock-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(0, 242, 254, 0.3);
}

.cockpit-dock-btn.active {
  background: rgba(0, 242, 254, 0.15);
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

.cockpit-chat-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  color: #ffffff;
  font-size: 0.92rem;
  font-family: inherit;
  outline: none;
  transition: var(--transition-smooth);
}

.cockpit-chat-input:focus {
  border-color: var(--accent-cyan);
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.2);
}

.cockpit-submit-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--gradient-brand);
  border: none;
  color: #07090e;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
  flex-shrink: 0;
}

.cockpit-submit-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.4);
}

/* -------------------------------------------------------------------------
   MODAL DIALOG (LEAD CAPTURE)
   ------------------------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 12, 0.85);
  backdrop-filter: blur(14px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal-backdrop.open {
  display: flex;
  opacity: 1;
}

.modal-window {
  background: var(--bg-card-solid);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-xl);
  max-width: 500px;
  width: 100%;
  padding: 34px;
  position: relative;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.9), var(--shadow-glow-cyan);
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.open .modal-window {
  transform: translateY(0);
}

.modal-close-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.lead-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #cbd5e1;
}

.form-input {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 11px 15px;
  color: #ffffff;
  font-size: 0.92rem;
  font-family: inherit;
  outline: none;
  transition: var(--transition-smooth);
}

.form-input:focus {
  border-color: var(--accent-cyan);
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.2);
}

.form-status {
  padding: 12px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  display: none;
  margin-bottom: 12px;
}

.form-status.success {
  display: block;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
}

.form-status.error {
  display: block;
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.35);
  color: #fb7185;
}

/* -------------------------------------------------------------------------
   RESPONSIVE DESIGN (TABLET & MOBILE)
   ------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .cockpit-workspace {
    grid-template-columns: 320px 1fr;
  }
  
  .perf-strip {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .cockpit-workspace {
    grid-template-columns: 1fr;
  }
  
  .cockpit-sidebar {
    position: fixed;
    top: 64px;
    bottom: 0;
    left: 0;
    width: 320px;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 20px 0 50px rgba(0, 0, 0, 0.8);
    background: rgba(10, 14, 23, 0.96);
  }
  
  .cockpit-sidebar.open {
    transform: translateX(0);
  }

  .mobile-scenarios-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .top-bar-center {
    display: none;
  }

  .status-badge span.status-text {
    display: none;
  }

  .brand-title span.brand-full {
    display: none;
  }
}

@media (max-width: 600px) {
  #fullscreenBtn {
    display: none !important;
  }
}

@media (max-width: 500px) {
  .cockpit-top-bar {
    height: 54px;
    padding: 0 10px;
    gap: 8px;
    padding-top: env(safe-area-inset-top, 0px);
  }

  .top-bar-left {
    gap: 8px;
    flex-shrink: 0;
  }

  .back-link {
    padding: 5px 9px;
    font-size: 0.76rem;
    gap: 4px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .brand-indicator {
    gap: 6px;
    flex-shrink: 0;
    white-space: nowrap;
  }

  .brand-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    flex-shrink: 0;
  }

  .brand-icon svg {
    width: 15px;
    height: 15px;
  }

  .brand-title {
    gap: 6px;
    white-space: nowrap;
  }

  .hud-pill {
    font-size: 0.62rem;
    padding: 2px 6px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .top-bar-right {
    gap: 6px;
    flex-shrink: 0;
  }

  .status-badge {
    padding: 4px 6px;
    flex-shrink: 0;
  }

  .hud-tool-btn {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
  }

  .hud-tool-btn svg {
    width: 15px;
    height: 15px;
  }

  .hud-cta-btn {
    display: none !important;
  }

  .chat-interlocutor-header {
    padding: 8px 12px;
  }

  .interlocutor-info {
    gap: 8px;
    min-width: 0;
    flex: 1;
  }

  .interlocutor-avatar {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
  }

  .interlocutor-meta {
    min-width: 0;
  }

  .interlocutor-name {
    font-size: 0.86rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .interlocutor-subtitle {
    font-size: 0.68rem;
    white-space: nowrap;
  }

  .mobile-scenarios-btn {
    padding: 5px 10px;
    font-size: 0.74rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .cockpit-chat-viewport {
    padding: 14px 10px;
    gap: 12px;
  }

  .cockpit-msg {
    max-width: 90%;
  }

  .cockpit-msg-bubble {
    padding: 10px 14px;
    font-size: 0.88rem;
    line-height: 1.5;
  }

  .cockpit-chips-bar {
    padding: 7px 10px;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .cockpit-chips-bar::-webkit-scrollbar {
    display: none;
  }

  .chips-label {
    font-size: 0.65rem;
    flex-shrink: 0;
  }

  .cockpit-chip {
    padding: 5px 10px;
    font-size: 0.72rem;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .cockpit-input-dock {
    padding: 8px 10px;
    padding-bottom: max(8px, env(safe-area-inset-bottom, 8px));
    gap: 8px;
  }

  .cockpit-dock-btn {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
  }

  .cockpit-chat-input {
    padding: 9px 12px;
    font-size: 16px; /* Prevents iOS Safari auto-zoom on iPhone */
  }

  .cockpit-submit-btn {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
  }
}

/* =========================================================================
   ELCARS KYIV SPECIFIC VIP STYLES & HUD BANNER
   ========================================================================= */

.elcars-vip-banner {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 20px;
  background: linear-gradient(90deg, rgba(0, 242, 254, 0.12) 0%, rgba(16, 185, 129, 0.08) 45%, rgba(139, 92, 246, 0.12) 100%);
  border-bottom: 1px solid rgba(0, 242, 254, 0.22);
  backdrop-filter: blur(14px);
  position: relative;
  z-index: 5;
}

.elcars-vip-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px;
  background: rgba(0, 242, 254, 0.16);
  border: 1px solid rgba(0, 242, 254, 0.4);
  border-radius: var(--radius-pill);
  color: var(--accent-cyan);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.elcars-vip-badge .pulse-green {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
  animation: pulseGreenGlow 1.8s infinite;
}

@keyframes pulseGreenGlow {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1.15); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.elcars-vip-info {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #cbd5e1;
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.elcars-vip-info strong {
  color: #ffffff;
  font-weight: 700;
}

.elcars-vip-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.elcars-stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-pill);
  font-size: 0.74rem;
  color: #94a3b8;
  white-space: nowrap;
}

.elcars-stat-chip strong {
  color: var(--accent-cyan);
}

.brand-icon.elcars-theme {
  background: linear-gradient(135deg, #00f2fe 0%, #10b981 100%);
  color: #050b14;
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.5);
}

.hud-pill.elcars-pill {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.4);
}

.interlocutor-avatar.elcars-avatar {
  border: 2px solid rgba(0, 242, 254, 0.45);
  box-shadow: 0 0 15px rgba(0, 242, 254, 0.3);
}

.interlocutor-avatar.elcars-avatar img {
  border-radius: var(--radius-pill);
  object-fit: cover;
}

@media (max-width: 960px) {
  .elcars-vip-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 14px;
  }
  .elcars-vip-stats {
    flex-wrap: wrap;
    gap: 6px;
  }
}

@media (max-width: 640px) {
  .elcars-vip-info {
    font-size: 0.76rem;
    white-space: normal;
  }
  .elcars-stat-chip {
    font-size: 0.7rem;
    padding: 2px 8px;
  }
}

