/* ==========================================================================
   JP MOTORS GT - LUXURY SHOWROOM DESIGN SYSTEM
   Petén, Guatemala · Dark/Light Responsive Luxury Automotive Styling
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Syne:wght@700;800&display=swap');

:root {
  /* Color Palette - Gris Carrera Mate (#2B2D2F) & Rojo JP (#8A151B) */
  --bg: #2B2D2F;                 /* Gris Carrera Mate (Tono Dominante PMS 426 C) */
  --bg-subtle: #232527;          /* Contraste profundo */
  --panel: #333638;              /* Elevación mate */
  --panel-hover: #3A3D40;
  --surface: #3E4245;
  --ph: #252729;
  --ph2: #2E3032;

  --ink: #F7F8F9;
  --ink-secondary: rgba(247, 248, 249, 0.85);
  --ink-muted: rgba(247, 248, 249, 0.65);
  --ink-faint: rgba(247, 248, 249, 0.45);

  --line: rgba(255, 255, 255, 0.10);
  --line-hover: rgba(255, 255, 255, 0.22);
  --line-strong: rgba(255, 255, 255, 0.35);

  /* Rojo JP (Acento de Potencia PMS 202 C: #8A151B / RGB 138, 21, 27) */
  --acc: #8A151B;
  --acc-hover: #A51A21;
  --acc-active: #730E13;
  --acc-on: #FFFFFF;
  --acc-ink: #FF6E75;
  --acc-soft: rgba(138, 21, 27, 0.20);
  --acc-line: rgba(138, 21, 27, 0.50);
  --acc-glow: rgba(138, 21, 27, 0.55);

  --header-blur: rgba(43, 45, 47, 0.88);
  --modal-bg: rgba(35, 37, 39, 0.97);
  --card-shadow: 0 16px 44px rgba(0, 0, 0, 0.45);
  --chip-bg: rgba(43, 45, 47, 0.85);

  --font-display: 'Syne', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;
  --radius-pill: 9999px;
  --transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] {
  --bg: #F4F4F2;
  --bg-subtle: #E9EAE7;
  --panel: #FFFFFF;
  --panel-hover: #F0F0EE;
  --surface: #E0E2DE;
  --ph: #D8DAD5;
  --ph2: #E3E5E0;

  --ink: #2B2D2F;
  --ink-secondary: rgba(43, 45, 47, 0.85);
  --ink-muted: rgba(43, 45, 47, 0.65);
  --ink-faint: rgba(43, 45, 47, 0.45);

  --line: rgba(43, 45, 47, 0.12);
  --line-hover: rgba(43, 45, 47, 0.24);
  --line-strong: rgba(43, 45, 47, 0.38);

  --acc: #8A151B;
  --acc-hover: #6E1015;
  --acc-active: #540B0F;
  --acc-on: #FFFFFF;
  --acc-ink: #8A151B;
  --acc-soft: rgba(138, 21, 27, 0.10);
  --acc-line: rgba(138, 21, 27, 0.38);
  --acc-glow: rgba(138, 21, 27, 0.22);

  --header-blur: rgba(244, 244, 242, 0.90);
  --modal-bg: rgba(255, 255, 255, 0.97);
  --card-shadow: 0 12px 32px rgba(43, 45, 47, 0.12);
  --chip-bg: rgba(255, 255, 255, 0.88);
}

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

html, body {
  height: 100%;
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

a {
  color: var(--acc-ink);
  text-decoration: none;
  transition: var(--transition);
}
a:hover {
  color: var(--acc);
}

img {
  max-width: 100%;
  display: block;
}

button {
  font-family: inherit;
  border: none;
  outline: none;
  background: none;
  cursor: pointer;
}

/* App Scroller */
#app-viewport {
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  scroll-behavior: smooth;
}

/* Top Sticky Header */
.main-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 4vw, 44px);
  background: var(--header-blur);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  transition: var(--transition);
}

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

.brand-logo-img {
  height: 40px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.brand-logo:hover .brand-logo-img {
  transform: scale(1.03);
}

.brand-badge {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--acc);
  color: var(--acc);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.05em;
  background: var(--acc-soft);
  transition: var(--transition);
}
.brand-logo:hover .brand-badge {
  transform: scale(1.05);
  box-shadow: 0 0 14px var(--acc-glow);
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.16em;
  color: var(--ink);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.8vw, 24px);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.nav-item {
  cursor: pointer;
  color: var(--ink-muted);
  padding: 6px 4px;
  position: relative;
  transition: var(--transition);
}
.nav-item:hover, .nav-item.active {
  color: var(--ink);
}
.nav-item.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--acc);
}

.nav-cta {
  cursor: pointer;
  padding: 9px 18px;
  border: 1px solid var(--line-hover);
  color: var(--ink);
  font-weight: 700;
  font-size: 13px;
  transition: var(--transition);
}
.nav-cta:hover {
  border-color: var(--acc);
  color: var(--acc-ink);
  background: var(--acc-soft);
}

/* Floating Controls (Theme & Lang) */
.floating-switches {
  position: fixed;
  z-index: 80;
  right: 16px;
  top: 68px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pill-switch {
  cursor: pointer;
  min-width: 60px;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  border: 1px solid var(--line-hover);
  background: var(--modal-bg);
  color: var(--ink);
  backdrop-filter: blur(12px);
  transition: var(--transition);
  box-shadow: 0 4px 14px rgba(0,0,0,0.2);
}
.pill-switch:hover {
  border-color: var(--acc);
  color: var(--acc-ink);
}

/* Mobile Nav Toggle */
.mobile-nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  cursor: pointer;
}
.mobile-nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--ink);
  transition: var(--transition);
}
.mobile-nav-toggle span:last-child {
  width: 15px;
  background: var(--acc);
}

@media (max-width: 860px) {
  .nav-links {
    display: none;
  }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--modal-bg);
    backdrop-filter: blur(20px);
    padding: 20px;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--card-shadow);
  }
  .mobile-nav-toggle {
    display: flex;
  }
}

/* Screens Wrapper */
.screen-section {
  display: none;
  animation: fadeIn 0.3s ease;
}
.screen-section.active {
  display: block;
}

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

/* --------------------------------------------------------------------------
   HERO SECTION
   -------------------------------------------------------------------------- */
.hero-wrapper {
  position: relative;
  min-height: clamp(480px, 74vw, 680px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

.hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--bg) 5%, var(--header-blur) 48%, transparent 100%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  padding: clamp(28px, 5vw, 64px);
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 2.5vw, 28px);
  max-width: 900px;
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--acc-ink);
}
.hero-eyebrow::before {
  content: '';
  width: 26px;
  height: 1.5px;
  background: var(--acc);
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(34px, 8.2vw, 80px);
  line-height: 0.96;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.hero-sub {
  max-width: 52ch;
  font-size: clamp(14px, 1.5vw, 18px);
  line-height: 1.55;
  color: var(--ink-muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.btn-primary {
  cursor: pointer;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 28px;
  background: var(--acc);
  color: var(--acc-on);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.02em;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.btn-primary:hover {
  background: var(--acc-hover);
  box-shadow: 0 0 20px var(--acc-glow);
  transform: translateY(-1px);
}

.btn-secondary {
  cursor: pointer;
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 26px;
  border: 1px solid var(--line-hover);
  color: var(--ink);
  font-weight: 600;
  font-size: 15px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.btn-secondary:hover {
  border-color: var(--ink);
  background: var(--surface);
}

/* Stats Row */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  border-bottom: 1px solid var(--line);
}

.stat-box {
  padding: clamp(18px, 2.4vw, 28px) clamp(16px, 4vw, 44px);
  border-right: 1px solid var(--line);
}
.stat-box:last-child {
  border-right: none;
}
.stat-val {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(26px, 3.2vw, 36px);
  color: var(--ink);
}
.stat-lbl {
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--ink-faint);
  margin-top: 6px;
  text-transform: uppercase;
}

/* Banner Expansion Announcement */
.announcement-banner {
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: clamp(20px, 3vw, 32px) clamp(16px, 4vw, 44px);
  background: var(--acc-soft);
  border-bottom: 1px solid var(--line);
  transition: var(--transition);
}
.announcement-banner:hover {
  background: rgba(58, 208, 122, 0.18);
}
.announcement-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--acc-ink);
}
.announcement-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(19px, 2.6vw, 28px);
  letter-spacing: -0.02em;
}

/* Section Container */
.section-container {
  padding: clamp(32px, 5vw, 64px) clamp(16px, 4vw, 44px);
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 3vw, 32px);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}
.section-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(24px, 3.6vw, 40px);
  letter-spacing: -0.02em;
}
.section-link {
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: var(--acc-ink);
}

/* Vehicle Cards Grid */
.vehicles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.vehicle-card {
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--panel);
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: var(--transition);
}
.vehicle-card:hover {
  border-color: var(--acc);
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.3);
}

.vehicle-card-img-wrap {
  aspect-ratio: 4 / 3;
  position: relative;
  background-color: var(--ph);
  overflow: hidden;
}
.vehicle-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.vehicle-card:hover .vehicle-card-img {
  transform: scale(1.04);
}

.vehicle-card-branch-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 5px 10px;
  background: var(--chip-bg);
  border: 1px solid var(--line);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  backdrop-filter: blur(8px);
}

.vehicle-card-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-grow: 1;
}
.vehicle-card-segment {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--acc-ink);
  text-transform: uppercase;
}
.vehicle-card-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  line-height: 1.25;
}
.vehicle-card-meta {
  font-size: 12px;
  color: var(--ink-muted);
}
.vehicle-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  margin-top: auto;
}
.vehicle-card-price {
  font-weight: 800;
  font-size: 17px;
  color: var(--ink);
}
.vehicle-card-action {
  font-size: 12px;
  font-weight: 700;
  color: var(--acc-ink);
}

/* Filter Chips */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}
.filter-chip {
  cursor: pointer;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 20px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--line-hover);
  color: var(--ink-muted);
  background: transparent;
  transition: var(--transition);
}
.filter-chip:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}
.filter-chip.active {
  background: var(--acc);
  color: var(--acc-on);
  border-color: var(--acc);
  font-weight: 700;
}

/* Geo Branch Card */
.geo-section {
  padding: clamp(28px, 4vw, 52px) clamp(16px, 4vw, 44px);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: clamp(20px, 3vw, 40px);
  align-items: center;
}
.geo-info-card {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-radius: var(--radius-sm);
}
.geo-pulse-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 11px;
  color: var(--ink-faint);
}
.geo-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--acc);
  box-shadow: 0 0 8px var(--acc-glow);
}

/* --------------------------------------------------------------------------
   3D CONFIGURATOR STYLES
   -------------------------------------------------------------------------- */
.configurator-wrapper {
  display: flex;
  flex-direction: column;
}

.configurator-header {
  padding: clamp(20px, 3vw, 40px) clamp(16px, 4vw, 44px) 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.configurator-grid {
  padding: clamp(20px, 3vw, 40px) clamp(16px, 4vw, 44px);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: clamp(24px, 4vw, 48px);
}

.config-stage-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.config-canvas-container {
  aspect-ratio: 4 / 3;
  position: relative;
  border: 1px solid var(--line);
  background: radial-gradient(circle at center, var(--surface) 0%, var(--bg) 100%);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: inset 0 0 40px rgba(0,0,0,0.5);
}

#config-3d-canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}
#config-3d-canvas:active {
  cursor: grabbing;
}

.config-badge-overlay {
  position: absolute;
  top: 14px;
  left: 14px;
  background: var(--modal-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--acc-ink);
  pointer-events: none;
}

.config-instructions {
  display: flex;
  justify-content: space-between;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 11px;
  color: var(--ink-faint);
}

.config-options-col {
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.color-swatch-btn {
  cursor: pointer;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid transparent;
  box-shadow: 0 0 0 1px var(--line-strong) inset;
  transition: var(--transition);
  position: relative;
}
.color-swatch-btn:hover {
  transform: scale(1.1);
}
.color-swatch-btn.active {
  border-color: var(--acc);
  box-shadow: 0 0 12px var(--acc-glow);
}

.rim-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.rim-card {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  min-height: 58px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.rim-card:hover {
  border-color: var(--line-strong);
}
.rim-card.active {
  background: var(--acc-soft);
  border-color: var(--acc);
}

.config-total-card {
  margin-top: 10px;
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.config-total-val {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(28px, 3.4vw, 38px);
  color: var(--ink);
}

/* --------------------------------------------------------------------------
   DETAIL & OTHER SECTIONS
   -------------------------------------------------------------------------- */
.detail-gallery-main {
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  background: var(--ph);
  overflow: hidden;
}
.detail-gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.spec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.spec-item {
  background: var(--panel);
  padding: 14px;
}
.spec-k {
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
  text-transform: uppercase;
}
.spec-v {
  font-weight: 700;
  font-size: 15px;
  margin-top: 6px;
}

/* Footer */
.main-footer {
  border-top: 1px solid var(--line);
  padding: 36px clamp(16px, 4vw, 44px);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  color: var(--ink-muted);
  font-size: 12px;
}

/* --------------------------------------------------------------------------
   AI SALES ASSISTANT WIDGET (Estilo The Innovatio para JP Motors)
   -------------------------------------------------------------------------- */
.ai-agent-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: linear-gradient(135deg, #1A1D1A 0%, #0B0C0B 100%);
  border: 1.5px solid var(--acc);
  color: var(--ink);
  border-radius: var(--radius-pill);
  cursor: pointer;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6), 0 0 20px var(--acc-glow);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.ai-agent-fab:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.8), 0 0 28px var(--acc-glow);
  border-color: var(--acc-ink);
}

.ai-fab-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--acc);
  color: var(--acc-on);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 12px;
  position: relative;
}
.ai-fab-pulse {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--acc);
  animation: fabPulse 2s infinite;
}
@keyframes fabPulse {
  0% { transform: scale(0.9); opacity: 1; }
  100% { transform: scale(1.6); opacity: 0; }
}

.ai-fab-text {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* Chat Modal Window */
.ai-chat-window {
  position: fixed;
  bottom: 86px;
  right: 24px;
  z-index: 1001;
  width: min(420px, calc(100vw - 32px));
  height: min(620px, calc(100vh - 120px));
  background: var(--modal-bg);
  border: 1px solid var(--line-hover);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(0,0,0,0.7), 0 0 30px rgba(58,208,122,0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  backdrop-filter: blur(20px);
  opacity: 0;
  transform: translateY(20px) scale(0.96);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.ai-chat-window.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.ai-chat-header {
  padding: 16px 20px;
  background: rgba(20, 24, 20, 0.85);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ai-header-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ai-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--acc);
  color: var(--acc-on);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
}
.ai-title-wrap {
  display: flex;
  flex-direction: column;
}
.ai-title-name {
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.02em;
}
.ai-title-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--acc-ink);
}
.ai-title-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--acc);
  box-shadow: 0 0 6px var(--acc);
}

.ai-close-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ink-muted);
  cursor: pointer;
  transition: var(--transition);
}
.ai-close-btn:hover {
  background: rgba(255,255,255,0.1);
  color: var(--ink);
}

/* Chat Messages Stream */
.ai-chat-body {
  flex-grow: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}

.chat-bubble {
  max-width: 86%;
  padding: 12px 16px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.5;
  word-wrap: break-word;
  animation: bubbleIn 0.25s ease;
}
@keyframes bubbleIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-bubble-ai {
  align-self: flex-start;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
}

.chat-bubble-user {
  align-self: flex-end;
  background: var(--acc);
  color: var(--acc-on);
  font-weight: 600;
  border-bottom-right-radius: 4px;
}

/* Interactive Quote Card in Chat */
.chat-quote-card {
  background: var(--panel);
  border: 1px solid var(--acc-line);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 12px;
  margin-top: 4px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.3);
}
.chat-quote-title {
  font-weight: 800;
  font-size: 14px;
  color: var(--acc-ink);
}
.chat-quote-row {
  display: flex;
  justify-content: space-between;
  color: var(--ink-secondary);
}
.chat-quote-row strong {
  color: var(--ink);
}
.chat-quote-btn {
  margin-top: 4px;
  padding: 10px;
  background: var(--acc);
  color: var(--acc-on);
  font-weight: 700;
  font-size: 12px;
  text-align: center;
  border-radius: var(--radius-sm);
  display: block;
  text-decoration: none;
  transition: var(--transition);
}
.chat-quote-btn:hover {
  background: var(--acc-hover);
  color: var(--acc-on);
}

/* Typing Indicator */
.typing-indicator {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 10px 16px;
  border-radius: 14px;
  display: none;
  align-items: center;
  gap: 4px;
}
.typing-indicator span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--acc);
  animation: typingBounce 1.4s infinite ease-in-out;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-5px); opacity: 1; }
}

/* Suggested Replies Chips */
.ai-suggested-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 16px 10px;
}
.ai-suggestion-chip {
  cursor: pointer;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  background: var(--panel);
  border: 1px solid var(--line-hover);
  color: var(--ink-secondary);
  border-radius: var(--radius-pill);
  transition: var(--transition);
}
.ai-suggestion-chip:hover {
  border-color: var(--acc);
  color: var(--acc-ink);
  background: var(--acc-soft);
}

/* Chat Input Bar */
.ai-chat-input-bar {
  padding: 12px 16px;
  background: rgba(20, 24, 20, 0.9);
  border-top: 1px solid var(--line);
  display: flex;
  gap: 8px;
  align-items: center;
}
.ai-chat-input {
  flex-grow: 1;
  padding: 10px 14px;
  background: var(--panel);
  border: 1px solid var(--line-hover);
  border-radius: var(--radius-pill);
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: var(--transition);
}
.ai-chat-input:focus {
  border-color: var(--acc);
  box-shadow: 0 0 10px var(--acc-soft);
}
.ai-chat-send {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--acc);
  color: var(--acc-on);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--transition);
}
.ai-chat-send:hover {
  background: var(--acc-hover);
  transform: scale(1.05);
}
