/* ==========================================================================
   MOTORAUTO — FEUILLE DE STYLE PRINCIPALE & 16 THÈMES CHROMATIQUES
   ========================================================================== */

:root {
  --bg-core: #09090b;
  --bg-surface: #121216;
  --bg-elevated: #1a1a20;
  --stroke-line: rgba(255, 255, 255, 0.08);
  --color-ink: #f4f4f5;
  --color-secondary: #a1a1aa;
  --color-muted: #71717a;
  --accent: #ef4444;
  --header-bg: rgba(18, 18, 22, 0.85);
  --font-sans: 'Inter', sans-serif;
  --font-display: 'Cabinet Grotesk', sans-serif;
  --font-tech: 'JetBrains Mono', monospace;
  --corner-xs: 8px;
  --corner-sm: 12px;
  --corner-md: 16px;
}

/* THÈMES SOMBRE */
[data-theme="midnight-blue"] { --bg-core: #060913; --bg-surface: #0f172a; --bg-elevated: #1e293b; --accent: #3b82f6; --header-bg: rgba(15, 23, 42, 0.85); }
[data-theme="asphalt-smoke"] { --bg-core: #111111; --bg-surface: #1c1c1c; --bg-elevated: #262626; --accent: #f59e0b; --header-bg: rgba(28, 28, 28, 0.85); }
[data-theme="monza-night"] { --bg-core: #0a0507; --bg-surface: #140a0e; --bg-elevated: #201016; --accent: #e11d48; --header-bg: rgba(20, 10, 14, 0.85); }
[data-theme="tokyo-neon"] { --bg-core: #050508; --bg-surface: #0e0d16; --bg-elevated: #181624; --accent: #a855f7; --header-bg: rgba(14, 13, 22, 0.85); }
[data-theme="cyber-matrix"] { --bg-core: #02120d; --bg-surface: #04241b; --bg-elevated: #083b2d; --accent: #10b981; --header-bg: rgba(4, 36, 27, 0.85); }
[data-theme="abyss-titanium"] { --bg-core: #070d1a; --bg-surface: #0f172a; --bg-elevated: #1e293b; --accent: #06b6d4; --header-bg: rgba(15, 23, 42, 0.85); }
[data-theme="velvet-gothic"] { --bg-core: #0f0309; --bg-surface: #1d0712; --bg-elevated: #2d0b1c; --accent: #ec4899; --header-bg: rgba(29, 7, 18, 0.85); }

/* THÈMES CLAIRS */
[data-theme="carrara-white"] { --bg-core: #f8fafc; --bg-surface: #ffffff; --bg-elevated: #f1f5f9; --stroke-line: rgba(0, 0, 0, 0.08); --color-ink: #0f172a; --color-secondary: #475569; --color-muted: #64748b; --accent: #dc2626; --header-bg: rgba(255, 255, 255, 0.9); }
[data-theme="silver-arrow"] { --bg-core: #f1f5f9; --bg-surface: #e2e8f0; --bg-elevated: #cbd5e1; --stroke-line: rgba(0, 0, 0, 0.1); --color-ink: #1e293b; --color-secondary: #334155; --color-muted: #64748b; --accent: #0284c7; --header-bg: rgba(226, 232, 240, 0.9); }
[data-theme="ivory-dune"] { --bg-core: #fbf9f5; --bg-surface: #f4ece1; --bg-elevated: #ede3d2; --stroke-line: rgba(60, 40, 20, 0.1); --color-ink: #2c241d; --color-secondary: #5c4d42; --color-muted: #8c7a6b; --accent: #b45309; --header-bg: rgba(244, 236, 225, 0.9); }
[data-theme="nordic-frost"] { --bg-core: #f0fdf4; --bg-surface: #dcfce7; --bg-elevated: #bbf7d0; --stroke-line: rgba(20, 80, 40, 0.1); --color-ink: #052e16; --color-secondary: #166534; --color-muted: #15803d; --accent: #16a34a; --header-bg: rgba(220, 252, 231, 0.9); }
[data-theme="solar-flare"] { --bg-core: #fffbf0; --bg-surface: #fef3c7; --bg-elevated: #fde68a; --stroke-line: rgba(120, 80, 0, 0.1); --color-ink: #451a03; --color-secondary: #78350f; --color-muted: #92400e; --accent: #d97706; --header-bg: rgba(254, 243, 199, 0.9); }
[data-theme="alpine-horizon"] { --bg-core: #f8fafc; --bg-surface: #eff6ff; --bg-elevated: #dbeafe; --stroke-line: rgba(30, 60, 120, 0.1); --color-ink: #1e3a8a; --color-secondary: #1e40af; --color-muted: #3b82f6; --accent: #2563eb; --header-bg: rgba(239, 246, 255, 0.9); }
[data-theme="rose-gold-gt"] { --bg-core: #fff1f2; --bg-surface: #ffe4e6; --bg-elevated: #fecdd3; --stroke-line: rgba(150, 30, 50, 0.1); --color-ink: #4c0519; --color-secondary: #881337; --color-muted: #9f1239; --accent: #e11d48; --header-bg: rgba(255, 228, 230, 0.9); }
[data-theme="mint-speedway"] { --bg-core: #f0fdf4; --bg-surface: #ecfdf5; --bg-elevated: #d1fae5; --stroke-line: rgba(10, 80, 60, 0.1); --color-ink: #022c22; --color-secondary: #065f46; --color-muted: #047857; --accent: #0d9488; --header-bg: rgba(236, 253, 245, 0.9); }

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

body {
  background-color: var(--bg-core);
  color: var(--color-ink);
  font-family: var(--font-sans);
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

body.modal-open {
  overflow: hidden !important;
  touch-action: none;
}

/* --- ANIMATIONS FLUIDES --- */
@keyframes fadeInScale {
  from { opacity: 0; transform: translateY(8px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes fadeInOverlay {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-layer {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  padding: 1rem;
}

.modal-layer.active {
  opacity: 1;
  pointer-events: auto;
  animation: fadeInOverlay 0.25s ease forwards;
}

.modal-dialog {
  background: var(--bg-surface);
  border: 1px solid var(--stroke-line);
  border-radius: var(--corner-md);
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  transform: translateY(10px) scale(0.98);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.modal-layer.active .modal-dialog {
  transform: translateY(0) scale(1);
  animation: fadeInScale 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* --- HEADER & NAVIGATION --- */
.app-header {
  position: sticky;
  top: 0;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--stroke-line);
  z-index: 100;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.nav-shell {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.8rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.brand-link {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.2rem;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.logo-motor { color: var(--color-ink); }
.logo-auto { color: var(--accent); }

.desktop-navigation {
  display: flex;
  gap: 0.25rem;
}

.nav-link {
  background: transparent;
  border: none;
  color: var(--color-secondary);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--corner-xs);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.nav-link:hover, .nav-link.active {
  background: var(--bg-elevated);
  color: var(--color-ink);
}

.nav-ico { width: 16px; height: 16px; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.action-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--stroke-line);
  color: var(--color-ink);
  padding: 0.4rem 0.7rem;
  border-radius: var(--corner-xs);
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.action-btn:hover { border-color: var(--accent); }
.action-ico { width: 15px; height: 15px; }

.pilot-chip {
  background: var(--bg-elevated);
  border: 1px solid var(--stroke-line);
  padding: 0.35rem 0.75rem;
  border-radius: 50px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pilot-chip:hover { border-color: var(--accent); }

.live-status-dot {
  width: 7px;
  height: 7px;
  background-color: #10b981;
  border-radius: 50%;
}

.live-status-dot.logged-out {
  background-color: var(--color-muted);
}

.pilot-label {
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--color-ink);
}

@media (max-width: 1024px) {
  .btn-caption { display: none; }
}

/* --- SECTION HÉRO --- */
.hero-stage {
  position: relative;
  padding: 3rem 1rem 2rem;
  text-align: center;
  border-bottom: 1px solid var(--stroke-line);
  background: radial-gradient(circle at 50% 0%, rgba(239, 68, 68, 0.08), transparent 60%);
}

.stage-shell {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem;
}

.badge-hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-elevated);
  border: 1px solid var(--stroke-line);
  padding: 0.3rem 0.75rem;
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
  color: var(--color-secondary);
}

.pulse-optic {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.hero-heroic-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.5vw, 3rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
  line-height: 1.1;
}

.hero-heroic-sub {
  color: var(--color-secondary);
  font-size: 0.95rem;
  max-width: 650px;
  margin: 0 auto 1.5rem;
  line-height: 1.4;
}

.command-search-container {
  max-width: 600px;
  margin: 0 auto;
}

.command-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--stroke-line);
  border-radius: var(--corner-sm);
  padding: 0.6rem 0.85rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.command-search-wrapper:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.search-lens {
  width: 18px;
  height: 18px;
  color: var(--color-muted);
  margin-right: 0.6rem;
}

.command-search-wrapper input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--color-ink);
  font-size: 0.9rem;
  font-family: var(--font-sans);
  outline: none;
}

.cmd-key-indicator {
  background: var(--bg-elevated);
  border: 1px solid var(--stroke-line);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-family: var(--font-tech);
  font-size: 0.7rem;
  color: var(--color-muted);
}

/* --- CATALOGUE & FILTRES --- */
#main-catalog-view {
  padding: 2rem 1rem 4rem;
}

.toolbar-cluster {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.categories-scroll {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding-bottom: 0.4rem;
  max-width: 100%;
  scrollbar-width: none;
}
.categories-scroll::-webkit-scrollbar { display: none; }

.filter-pill {
  background: var(--bg-surface);
  border: 1px solid var(--stroke-line);
  color: var(--color-secondary);
  padding: 0.4rem 0.85rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.filter-pill:hover, .filter-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.selectors-cluster {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  width: 100%;
}
@media (min-width: 768px) {
  .selectors-cluster { width: auto; }
}

.sort-cluster {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sort-title {
  font-size: 0.8rem;
  color: var(--color-muted);
  font-weight: 600;
}

.custom-select {
  background: var(--bg-surface);
  border: 1px solid var(--stroke-line);
  color: var(--color-ink);
  padding: 0.4rem 0.75rem;
  border-radius: var(--corner-xs);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  outline: none;
  cursor: pointer;
}

.catalog-telemetry-header {
  margin-bottom: 1.25rem;
}

.count-stream {
  font-size: 0.8rem;
  color: var(--color-muted);
  font-weight: 600;
}

/* --- GRILLE DE VÉHICULES --- */
.vehicles-dynamic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.car-box {
  background: var(--bg-surface);
  border: 1px solid var(--stroke-line);
  border-radius: var(--corner-sm);
  overflow: hidden;
  cursor: pointer;
  animation: fadeInScale 0.4s ease backwards;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.2s ease !important;
}

.car-box:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

.car-thumb-wrap {
  position: relative;
  height: 180px;
  background: var(--bg-elevated);
  overflow: hidden;
}

.car-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.car-box:hover .car-thumb-wrap img {
  transform: scale(1.04);
}

.badge-tag-phase {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  color: #fff;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
}

.btn-bookmark-action {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.btn-bookmark-action:hover { transform: scale(1.1); }
.btn-bookmark-action.bookmarked { background: var(--accent); }

.car-card-body {
  padding: 1rem;
}

.car-make-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}

.car-brand-name {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-muted);
  font-weight: 700;
}

.car-years-label {
  font-size: 0.7rem;
  color: var(--color-muted);
  font-family: var(--font-tech);
}

.car-model-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.specs-trio {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
  background: var(--bg-elevated);
  padding: 0.6rem;
  border-radius: var(--corner-xs);
  margin-bottom: 0.6rem;
}

.spec-entry {
  display: flex;
  flex-direction: column;
  text-align: center;
}

.spec-lbl {
  font-size: 0.65rem;
  color: var(--color-muted);
  text-transform: uppercase;
}

.spec-val {
  font-size: 0.85rem;
  font-weight: 700;
  font-family: var(--font-tech);
  color: var(--color-ink);
}

.badge-record-preview {
  font-size: 0.7rem;
  color: var(--color-secondary);
  background: var(--bg-elevated);
  padding: 0.35rem 0.5rem;
  border-radius: 4px;
}

/* --- PAGINATION --- */
.pagination-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 3rem;
  flex-wrap: wrap;
}

.page-btn {
  background: var(--bg-surface);
  border: 1px solid var(--stroke-line);
  color: var(--color-ink);
  padding: 0.5rem 0.85rem;
  border-radius: var(--corner-xs);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.page-btn:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--bg-elevated);
}

.page-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-ellipsis {
  color: var(--color-muted);
  font-weight: 700;
  padding: 0 0.25rem;
}

/* --- BOUTONS & FORMULAIRES --- */
.cta-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.65rem 1rem;
  border-radius: var(--corner-xs);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.1s ease;
}

.cta-btn:hover { opacity: 0.9; }
.cta-btn:active { transform: scale(0.98); }
.w-100 { width: 100%; }

.secondary-destructive-btn {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
  padding: 0.5rem 0.85rem;
  border-radius: var(--corner-xs);
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  width: 100%;
  transition: background 0.2s ease;
}

.secondary-destructive-btn:hover { background: rgba(239, 68, 68, 0.2); }

.input-stack {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 0.85rem;
}

.input-stack label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-secondary);
}

.input-stack input, .input-stack textarea, .input-stack select {
  background: var(--bg-surface);
  border: 1px solid var(--stroke-line);
  color: var(--color-ink);
  padding: 0.65rem;
  border-radius: var(--corner-xs);
  font-size: 0.85rem;
  outline: none;
  width: 100%;
  transition: border-color 0.2s ease;
}

.input-stack input:focus, .input-stack textarea:focus { border-color: var(--accent); }

/* --- NAVIGATION MOBILE (TOUCH BAR) --- */
.mobile-touch-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--stroke-line);
  padding: 0.4rem 0.5rem;
  z-index: 100;
  justify-content: space-around;
  align-items: center;
}

.touch-bar-item {
  background: transparent;
  border: none;
  color: var(--color-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.65rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s ease;
}

.touch-bar-item svg { width: 18px; height: 18px; }
.touch-bar-item.active, .touch-bar-item:hover { color: var(--accent); }

@media (max-width: 768px) {
  .desktop-navigation { display: none; }
  .mobile-touch-bar { display: flex; }
  body { padding-bottom: 55px; }
}

/* --- MODALE D'AUTHENTIFICATION --- */
.auth-box {
  max-width: 400px;
  width: 90%;
  padding: 0;
  overflow: hidden;
}

.dialog-tabs {
  display: flex;
  border-bottom: 1px solid var(--stroke-line);
  background: var(--bg-surface);
}

.dialog-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  padding: 0.75rem;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--color-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

.dialog-tab-btn.active {
  color: var(--color-ink);
  border-bottom-color: var(--accent);
  background: var(--bg-elevated);
}

.auth-form { display: none; }
.auth-form.active { display: block; }
.form-feedback.error-txt { color: #ef4444; font-size: 0.75rem; margin-top: 0.2rem; margin-bottom: 0.4rem; }

/* --- SÉLECTION DES THÈMES --- */
.theme-family-title {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--color-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.theme-palette-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.6rem;
}

.theme-tile {
  background: var(--bg-surface);
  border: 1px solid var(--stroke-line);
  padding: 0.75rem;
  border-radius: var(--corner-xs);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease;
}

.theme-tile:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  background: var(--bg-elevated);
}

.theme-tile.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent);
  background: var(--bg-elevated);
}

.swatch-circle { width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0; }
.tile-meta { display: flex; flex-direction: column; }
.tile-title { font-weight: 700; font-size: 0.8rem; color: var(--color-ink); }
.tile-sub { font-size: 0.65rem; color: var(--color-muted); }

/* --- MODALES INTERNES & DIVERS --- */
.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1.25rem 1.25rem 0.75rem;
  border-bottom: 1px solid var(--stroke-line);
}

.dialog-title { font-family: var(--font-display); font-size: 1.15rem; font-weight: 800; }
.dialog-sub { font-size: 0.8rem; color: var(--color-muted); margin-top: 0.15rem; }

.dialog-close-btn {
  background: transparent;
  border: none;
  color: var(--color-muted);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0.2rem;
  line-height: 1;
}
.dialog-close-btn:hover { color: var(--color-ink); }

.stats-ribbon {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--stroke-line);
}

.ribbon-card { text-align: center; }
.ribbon-value { display: block; font-family: var(--font-tech); font-size: 1.15rem; font-weight: 700; color: var(--accent); }
.ribbon-key { font-size: 0.7rem; color: var(--color-muted); }

.subtabs-bar { display: flex; border-bottom: 1px solid var(--stroke-line); background: var(--bg-surface); }
.subtab-btn {
  flex: 1;
  background: transparent;
  border: none;
  padding: 0.75rem;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--color-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}
.subtab-btn.active { color: var(--color-ink); border-bottom-color: var(--accent); background: var(--bg-elevated); }

.garage-panel { display: none; padding: 1.25rem; }
.garage-panel.active { display: block; }
.panel-section-title { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; color: var(--color-muted); margin-bottom: 0.75rem; }

.telemetry-stack { display: flex; flex-direction: column; gap: 0.6rem; }
.telemetry-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-elevated);
  padding: 0.75rem 0.85rem;
  border-radius: var(--corner-xs);
  border: 1px solid var(--stroke-line);
}
.telemetry-trash-btn { background: transparent; border: none; cursor: pointer; font-size: 0.9rem; opacity: 0.7; }
.telemetry-trash-btn:hover { opacity: 1; }

/* --- ATELIER IA (WIDGET FLOTTANT) --- */
.ai-widget-wrapper { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 900; }
.ai-orb-btn {
  background: var(--bg-surface);
  border: 1px solid var(--accent);
  color: var(--color-ink);
  padding: 0.6rem 1rem;
  border-radius: 50px;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: 0 8px 25px rgba(239, 68, 68, 0.25);
  cursor: pointer;
  transition: transform 0.2s ease;
}
.ai-orb-btn:hover { transform: scale(1.05); }
.ai-orb-core { width: 7px; height: 7px; background: var(--accent); border-radius: 50%; animation: pulse 2s infinite; }
.ai-orb-ico { width: 16px; height: 16px; color: var(--accent); }

.ai-cockpit-drawer {
  position: fixed;
  bottom: 5rem;
  right: 1.5rem;
  width: 360px;
  max-width: calc(100vw - 2rem);
  height: 450px;
  background: var(--bg-surface);
  border: 1px solid var(--stroke-line);
  border-radius: var(--corner-md);
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
  display: flex;
  flex-direction: column;
  transform: translateY(20px) scale(0.95);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 950;
}
.ai-cockpit-drawer.open { transform: translateY(0) scale(1); opacity: 1; pointer-events: auto; }

.ai-top-bar { display: flex; justify-content: space-between; align-items: center; padding: 0.85rem; border-bottom: 1px solid var(--stroke-line); background: var(--bg-elevated); }
.ai-status-pack { display: flex; align-items: center; gap: 0.6rem; }
.ai-pulse-dot { width: 7px; height: 7px; background: #10b981; border-radius: 50%; }
.ai-name-label { font-weight: 700; font-size: 0.8rem; }
.ai-model-tag { font-size: 0.65rem; color: var(--color-muted); }

.ai-top-actions { display: flex; gap: 0.4rem; }
.ai-action-icon { background: transparent; border: none; color: var(--color-secondary); cursor: pointer; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; }
.ai-action-icon svg { width: 15px; height: 15px; }

.ai-key-tray { display: none; padding: 0.85rem; background: var(--bg-elevated); border-bottom: 1px solid var(--stroke-line); }
.ai-key-tray.active { display: block; }
.ai-key-head { font-weight: 700; font-size: 0.75rem; margin-bottom: 0.2rem; }
.ai-key-note { font-size: 0.7rem; color: var(--color-muted); margin-bottom: 0.6rem; }
.ai-key-input-box { display: flex; gap: 0.4rem; }
.ai-key-input-box input { flex: 1; background: var(--bg-surface); border: 1px solid var(--stroke-line); color: var(--color-ink); padding: 0.35rem 0.5rem; border-radius: var(--corner-xs); font-size: 0.75rem; outline: none; }
.compact-btn { padding: 0.35rem 0.6rem; font-size: 0.75rem; }
.ai-key-feedback { font-size: 0.7rem; margin-top: 0.4rem; }

.ai-messages-chamber { flex: 1; padding: 0.85rem; overflow-y: auto; display: flex; flex-direction: column; gap: 0.6rem; }
.ai-msg { max-width: 85%; padding: 0.6rem 0.85rem; border-radius: var(--corner-sm); font-size: 0.8rem; line-height: 1.4; }
.bot-bubble { background: var(--bg-elevated); color: var(--color-ink); align-self: flex-start; border-bottom-left-radius: 2px; }
.user-bubble { background: var(--accent); color: #fff; align-self: flex-end; border-bottom-right-radius: 2px; }

.ai-prompt-bar { display: flex; padding: 0.6rem; border-top: 1px solid var(--stroke-line); background: var(--bg-elevated); gap: 0.4rem; }
.ai-prompt-bar input { flex: 1; background: var(--bg-surface); border: 1px solid var(--stroke-line); color: var(--color-ink); padding: 0.5rem 0.75rem; border-radius: var(--corner-xs); font-size: 0.8rem; outline: none; }
.ai-launch-btn { background: var(--accent); border: none; color: #fff; width: 32px; height: 32px; border-radius: var(--corner-xs); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.ai-launch-btn svg { width: 15px; height: 15px; }

/* --- FICHE VÉHICULE MODALE (AVEC DÉFILEMENT VERTICAL TOTAL) --- */
.vehicle-sheet {
  max-width: 800px !important;
  max-height: 85vh !important;
  overflow-y: auto !important;
  padding: 0 !important;
}

.sheet-close-floating {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  background: rgba(0,0,0,0.6);
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.sheet-hero-banner {
  height: 260px;
  position: relative;
  flex-shrink: 0;
}
@media(min-width: 768px) { .sheet-hero-banner { height: 320px; } }
.sheet-hero-banner img { width: 100%; height: 100%; object-fit: cover; }

.sheet-core-body {
  padding: 1.5rem;
  overflow-y: visible !important;
  padding-bottom: 3rem !important;
}
@media(min-width: 768px) { .sheet-core-body { padding: 2rem; } }

.sheet-big-title { font-family: var(--font-display); font-size: 1.75rem; font-weight: 900; margin: 0.2rem 0 0.5rem; }
.sheet-blurb { color: var(--color-secondary); font-size: 0.9rem; line-height: 1.45; margin-bottom: 1.5rem; }
.sheet-section-head { font-family: var(--font-display); font-size: 1.05rem; font-weight: 800; margin-bottom: 0.85rem; display: flex; align-items: center; gap: 0.4rem; }

.phases-strip { display: flex; gap: 0.4rem; margin-bottom: 1.25rem; overflow-x: auto; padding-bottom: 0.3rem; scrollbar-width: none; }
.phases-strip::-webkit-scrollbar { display: none; }
.phase-pill-btn { background: var(--bg-elevated); border: 1px solid var(--stroke-line); color: var(--color-secondary); padding: 0.4rem 0.85rem; border-radius: var(--corner-xs); font-weight: 700; font-size: 0.8rem; cursor: pointer; white-space: nowrap; transition: all 0.2s ease; }
.phase-pill-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.engines-matrix { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.85rem; margin-bottom: 1.5rem; }
.engine-blueprint-card { background: var(--bg-elevated); border: 1px solid var(--stroke-line); padding: 1rem; border-radius: var(--corner-xs); }
.eng-name { font-weight: 700; font-size: 0.9rem; margin-bottom: 0.6rem; color: var(--accent); }
.engine-specs-lines div { display: flex; justify-content: space-between; font-size: 0.8rem; padding: 0.2rem 0; border-bottom: 1px solid var(--stroke-line); }
.engine-specs-lines div span { color: var(--color-muted); }
.engine-specs-lines div strong { font-family: var(--font-tech); }

.telemetry-input-matrix { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.75rem; }

/* --- MASQUER LE BOUTON FLOTTANT IA EN MODE MOBILE --- */
@media (max-width: 768px) {
  .ai-widget-wrapper {
    display: none !important;
  }
}