/* ==========================================================================
   MOTORAUTO — page d'accueil
   Concept « banc d'essai » : fond carbone, compte-tours, plaques d'identification.
   Tout passe par les variables de base.css : les 16 ambiances restent cohérentes.
   ========================================================================== */
@property --ang { syntax: '<angle>'; inherits: false; initial-value: 0deg; }

.skip-link { position: fixed; left: 1rem; top: -4rem; z-index: 6000; background: var(--accent); color: var(--on-accent); padding: 0.6rem 1rem; border-radius: 8px; font-weight: 700; text-decoration: none; transition: top 0.2s; }
.skip-link:focus { top: calc(0.75rem + var(--safe-top)); }
.scroll-progress { position: fixed; z-index: 400; top: 0; left: 0; right: 0; height: 3px; transform-origin: left; transform: scaleX(var(--p, 0)); background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 40%, #fff)); box-shadow: 0 0 12px var(--accent); }

.stage-shell { width: 100%; max-width: 1360px; margin: 0 auto; padding: 0 clamp(1rem, 3vw, 2rem); }

/* ------------------------------------------------------------------ en-tête */
.app-header { position: sticky; top: 0; z-index: 300; padding: calc(0.6rem + var(--safe-top)) clamp(0.6rem, 2vw, 1.25rem) 0.6rem; pointer-events: none; }
.header-bar {
  pointer-events: auto; min-width: 0; max-width: 1360px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.5rem 0.6rem 0.5rem 1.1rem; border-radius: 18px; background: var(--header-bg); border: 1px solid var(--stroke-line);
  backdrop-filter: blur(18px) saturate(1.5); -webkit-backdrop-filter: blur(18px) saturate(1.5);
  transition: box-shadow 0.4s, border-color 0.4s, padding 0.3s;
}
.app-header.scrolled .header-bar { box-shadow: 0 18px 40px -22px rgba(0,0,0,0.7); border-color: var(--glow); }
.brand-link { display: inline-flex; align-items: center; gap: 0.15rem; font-family: var(--font-display); font-weight: 900; font-size: 1.9rem; line-height: 1; text-decoration: none; letter-spacing: 0.01em; white-space: nowrap; }
.brand-mark { width: 30px; height: 30px; fill: var(--accent); margin-right: 0.35rem; filter: drop-shadow(0 0 10px var(--glow)); transition: transform 0.5s var(--ease-spring); }
.brand-link:hover .brand-mark { transform: skewX(-14deg) scale(1.1); }
.logo-auto { color: var(--accent); }
.nav-dot, .touch-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--glow-soft); }
.header-actions { display: flex; align-items: center; gap: 0.5rem; }
#admin-gear-container:empty { display: none; }
.unread-dot-indicator { position: absolute; top: 8px; right: 8px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--bg-elevated), 0 0 12px var(--accent); animation: pulse 2s infinite; }
.pilot-chip { display: inline-flex; align-items: center; gap: 0.5rem; height: 44px; padding: 0 1rem; border-radius: 12px; background: var(--bg-elevated); border: 1px solid var(--stroke-line); font-weight: 700; font-size: 0.88rem; max-width: 190px; transition: border-color 0.2s, box-shadow 0.2s, transform 0.25s var(--ease-out); }
.pilot-chip:hover { border-color: var(--glow); box-shadow: 0 0 0 4px var(--glow-soft); transform: translateY(-1px); }
.pilot-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-status-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: #10b981; box-shadow: 0 0 10px #10b981; }
.live-status-dot.logged-out { background: var(--color-muted); box-shadow: none; }

/* --------------------------------------------------------------------- hero */
.hero-stage { position: relative; isolation: isolate; overflow: hidden; min-height: clamp(560px, calc(100svh - 70px), 900px); display: flex; align-items: center; padding: clamp(2rem, 6vh, 4.5rem) 0 clamp(3rem, 7vh, 5rem); margin-top: -76px; padding-top: calc(76px + clamp(2rem, 6vh, 4rem)); }
.hero-aurora { position: absolute; inset: 0; z-index: -3; overflow: hidden; }
.hero-aurora i { position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.55; will-change: transform; }
.hero-aurora i:nth-child(1) { width: 52vw; height: 52vw; max-width: 760px; max-height: 760px; right: -12%; top: -22%; background: radial-gradient(circle, var(--accent), transparent 68%); animation: drift1 22s ease-in-out infinite alternate; }
.hero-aurora i:nth-child(2) { width: 42vw; height: 42vw; max-width: 620px; max-height: 620px; left: -14%; bottom: -26%; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 45%, #3b82f6), transparent 68%); opacity: 0.38; animation: drift2 26s ease-in-out infinite alternate; }
.hero-aurora i:nth-child(3) { width: 30vw; height: 30vw; max-width: 440px; max-height: 440px; left: 38%; top: 8%; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 40%, #a855f7), transparent 68%); opacity: 0.25; animation: drift3 30s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(-8%, 12%) scale(1.15); } }
@keyframes drift2 { to { transform: translate(14%, -10%) scale(1.2); } }
@keyframes drift3 { to { transform: translate(-18%, 14%) scale(0.85); } }
.hero-grid-lines { position: absolute; inset: 0; z-index: -2; pointer-events: none; opacity: 0.55;
  background-image: linear-gradient(var(--stroke-line) 1px, transparent 1px), linear-gradient(90deg, var(--stroke-line) 1px, transparent 1px);
  background-size: 64px 64px; -webkit-mask-image: radial-gradient(ellipse 75% 85% at 70% 45%, #000 15%, transparent 72%); mask-image: radial-gradient(ellipse 75% 85% at 70% 45%, #000 15%, transparent 72%); }
.hero-streaks { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.hero-streaks i { position: absolute; left: 0; width: 38%; height: 1.5px; background: linear-gradient(90deg, transparent, var(--accent), transparent); opacity: 0; transform: translateX(-120%) skewX(-30deg); animation: streak 7s linear infinite; }
.hero-streaks i:nth-child(1) { top: 18%; animation-delay: 0s; }
.hero-streaks i:nth-child(2) { top: 36%; animation-delay: 1.6s; width: 28%; }
.hero-streaks i:nth-child(3) { top: 55%; animation-delay: 3.1s; }
.hero-streaks i:nth-child(4) { top: 72%; animation-delay: 4.4s; width: 22%; }
.hero-streaks i:nth-child(5) { top: 86%; animation-delay: 5.6s; }
@keyframes streak { 0% { opacity: 0; transform: translateX(-120%) skewX(-30deg); } 10% { opacity: 0.55; } 55% { opacity: 0.2; } 100% { opacity: 0; transform: translateX(330%) skewX(-30deg); } }

.hero-inner { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); align-items: center; gap: clamp(1.5rem, 4vw, 4rem); }
.badge-hero-pill { display: inline-flex; align-items: center; gap: 0.6rem; padding: 0.4rem 1rem 0.4rem 0.8rem; margin-bottom: 1.25rem; border-radius: 999px; border: 1px solid var(--glow); background: color-mix(in srgb, var(--bg-surface) 70%, transparent); backdrop-filter: blur(8px); font-size: 0.82rem; font-weight: 600; color: var(--color-secondary); }
.pulse-optic { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 2s infinite; }
.hero-heroic-title { font-family: var(--font-display); font-weight: 900; text-transform: uppercase; font-size: clamp(3.4rem, 7.6vw, 7.4rem); line-height: 0.88; letter-spacing: 0; margin-bottom: 1.5rem; }
.ht-line { display: block; animation: lineRise 1s var(--ease-out) both; }
.ht-line:nth-child(2) { animation-delay: 0.15s; }
.ht-outline { color: transparent; -webkit-text-stroke: 2px var(--accent); text-shadow: 0 0 50px var(--glow-soft); }
@keyframes lineRise { from { opacity: 0; transform: translateY(0.4em); clip-path: inset(0 0 100% 0); } to { opacity: 1; transform: none; clip-path: inset(0); } }
.hero-heroic-sub { max-width: 52ch; margin-bottom: 1.75rem; font-size: clamp(1rem, 1.5vw, 1.15rem); line-height: 1.6; color: var(--color-secondary); }

.command-search-container { position: relative; max-width: 600px; }
.command-search-wrapper { position: relative; display: flex; align-items: center; gap: 0.7rem; min-height: 60px; padding: 0 1rem; border-radius: 16px; background: color-mix(in srgb, var(--bg-surface) 88%, transparent); border: 1px solid var(--stroke-line); backdrop-filter: blur(12px); box-shadow: 0 20px 44px -26px rgba(0,0,0,0.8); transition: box-shadow 0.3s, border-color 0.3s; }
.command-search-wrapper::before { content: ""; position: absolute; inset: -1.5px; border-radius: inherit; padding: 1.5px; pointer-events: none; opacity: 0; transition: opacity 0.3s;
  background: conic-gradient(from var(--ang), transparent 0 55%, var(--accent) 80%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); animation: spinAng 3.5s linear infinite; }
@keyframes spinAng { to { --ang: 360deg; } }
.command-search-wrapper:focus-within { border-color: transparent; box-shadow: 0 0 0 5px var(--glow-soft), 0 24px 50px -24px var(--glow); }
.command-search-wrapper:focus-within::before { opacity: 1; }
.search-lens { flex: none; width: 22px; height: 22px; color: var(--color-muted); }
.command-search-wrapper input { flex: 1; min-width: 0; height: 58px; background: transparent; border: 0; outline: 0; font-size: 1.05rem; color: var(--color-ink); -webkit-appearance: none; appearance: none; }
.command-search-wrapper input::-webkit-search-cancel-button { -webkit-appearance: none; }
.command-search-wrapper input::placeholder { color: var(--color-muted); }
.cmd-key-indicator { flex: none; padding: 0.15rem 0.5rem; border-radius: 6px; border: 1px solid var(--stroke-line); background: var(--bg-elevated); font-family: var(--font-tech); font-size: 0.75rem; color: var(--color-muted); }
.search-suggestions-dropdown { display: none; position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 80; overflow: hidden; border-radius: 14px; background: var(--bg-surface); border: 1px solid var(--stroke-line); box-shadow: var(--shadow-pop); animation: fadeInScale 0.25s var(--ease-out); }
.search-suggestions-dropdown.open { display: block; }
.suggestion-item { display: flex; align-items: center; justify-content: space-between; gap: 1rem; width: 100%; min-height: 48px; padding: 0.7rem 1rem; background: none; border: 0; border-bottom: 1px solid var(--stroke-line); text-align: left; font-size: 0.95rem; transition: background 0.15s, padding 0.2s; }
.suggestion-item:last-child { border-bottom: 0; }
.suggestion-item:hover, .suggestion-item:focus-visible { background: var(--glow-soft); padding-left: 1.3rem; outline: none; }
.suggestion-model { font-weight: 600; }
.suggestion-years { font-family: var(--font-tech); font-size: 0.78rem; color: var(--color-muted); white-space: nowrap; }
.suggestion-empty { padding: 1rem; color: var(--color-muted); font-size: 0.9rem; }

.quick-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.quick-chip { min-height: 36px; padding: 0.3rem 0.95rem; border-radius: 999px; border: 1px solid var(--stroke-line); background: color-mix(in srgb, var(--bg-surface) 70%, transparent); font-size: 0.85rem; font-weight: 600; color: var(--color-secondary); transition: color 0.25s var(--ease-out), background-color 0.25s var(--ease-out), border-color 0.25s var(--ease-out), transform 0.25s var(--ease-out), opacity 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out); }
.quick-chip:hover { color: var(--on-accent); background: var(--accent); border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 10px 22px -12px var(--accent); }
.hero-stats { display: flex; gap: clamp(1.25rem, 3vw, 2.5rem); margin-top: 2rem; }
.hero-stats > div { display: flex; flex-direction: column-reverse; gap: 0.1rem; }
.hero-stats dt { font-size: 0.82rem; color: var(--color-muted); font-weight: 600; }
.hero-stats dd { font-family: var(--font-display); font-weight: 800; font-size: clamp(2rem, 3.4vw, 2.8rem); line-height: 1; font-variant-numeric: tabular-nums; }

/* compte-tours */
.hero-visual { display: flex; justify-content: center; perspective: 1100px; }
.hero-gauge { --rx: 0deg; --ry: 0deg; position: relative; width: 100%; max-width: 440px; aspect-ratio: 1; transform: rotateX(var(--rx)) rotateY(var(--ry)); transition: transform 0.35s var(--ease-out); transform-style: preserve-3d; animation: gaugeIn 1.2s var(--ease-out) 0.25s both; }
@keyframes gaugeIn { from { opacity: 0; transform: scale(0.85) rotate(-8deg); } to { opacity: 1; } }
.hero-gauge::before { content: ""; position: absolute; inset: -12%; border-radius: 50%; z-index: -1; background: radial-gradient(circle, var(--glow), transparent 62%); animation: breathe 5s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.12); opacity: 0.7; } }
.gauge-svg { width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 34px 50px rgba(0,0,0,0.5)); }
.gauge-ring { fill: none; stroke: var(--glow); stroke-width: 1; stroke-dasharray: 2 7; animation: ringSpin 60s linear infinite; transform-origin: 150px 150px; }
@keyframes ringSpin { to { transform: rotate(360deg); } }
.gauge-bezel { fill: var(--bg-surface); stroke: var(--stroke-line); stroke-width: 2; }
.gauge-face { fill: color-mix(in srgb, var(--bg-core) 78%, var(--bg-surface)); stroke: var(--stroke-line); }
.gauge-track, .gauge-redline, .gauge-fill { fill: none; stroke-linecap: butt; stroke-width: 12; }
.gauge-track { stroke: var(--stroke-line); }
.gauge-redline { stroke: #ef4444; opacity: 0.8; }
.gauge-fill { stroke: url(#gaugeArc); transition: stroke-dashoffset 1.2s var(--ease-out); }
#gauge-ticks line { stroke: var(--color-muted); stroke-width: 1.2; opacity: 0.75; }
#gauge-ticks line.mid { stroke-width: 1.8; opacity: 0.95; }
#gauge-ticks line.major { stroke: var(--color-ink); stroke-width: 2.8; opacity: 1; }
#gauge-ticks line.hot { stroke: #ef4444; }
#gauge-ticks text { fill: var(--color-secondary); font-family: var(--font-tech); font-size: 10px; font-weight: 700; text-anchor: middle; dominant-baseline: middle; }
#gauge-ticks text.hot { fill: #f87171; }
.gauge-needle { transform-origin: 150px 150px; transition: transform 1.5s cubic-bezier(.2,.9,.25,1.12); will-change: transform; }
.gauge-needle .needle-body { fill: var(--accent); }
.gauge-needle .needle-tail { fill: color-mix(in srgb, var(--accent) 70%, #000); }
.hero-gauge.in-red .gauge-value { color: #f87171; }
.hero-gauge.in-red .gauge-redline { opacity: 1; filter: drop-shadow(0 0 5px #ef4444); }
@media (prefers-reduced-motion: reduce) { .gauge-needle, .gauge-fill { transition-duration: 0.01s; } }
.gauge-hub { fill: var(--bg-elevated); stroke: var(--accent); stroke-width: 3; }
.gauge-readout { position: absolute; left: 50%; top: 72%; transform: translateX(-50%) translateZ(30px); width: 40%; min-width: 150px; text-align: center; pointer-events: none; }
.gauge-line { display: flex; justify-content: center; align-items: baseline; gap: 0.3rem; }
.gauge-value { font-family: var(--font-display); font-weight: 900; font-size: clamp(1.8rem, 3.6vw, 2.6rem); line-height: 1; font-variant-numeric: tabular-nums; }
.gauge-unit { font-family: var(--font-tech); font-weight: 700; font-size: 0.9rem; color: var(--accent); }
.gauge-caption { display: block; margin-top: 0.15rem; font-size: 0.72rem; line-height: 1.3; color: var(--color-muted); }
.gauge-chip { position: absolute; transform: translateZ(60px); display: flex; flex-direction: column; padding: 0.55rem 0.9rem; border-radius: 12px; background: color-mix(in srgb, var(--bg-surface) 80%, transparent); border: 1px solid var(--stroke-line); backdrop-filter: blur(10px); box-shadow: var(--shadow-pop); animation: floaty 6s ease-in-out infinite; }
.gauge-chip span { font-size: 0.7rem; color: var(--color-muted); font-weight: 600; }
.gauge-chip b { font-family: var(--font-tech); font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.gauge-chip-a { left: -4%; top: 12%; }
.gauge-chip-b { right: -2%; bottom: 14%; animation-delay: -3s; }
@keyframes floaty { 50% { translate: 0 -10px; } }
.scroll-hint { position: absolute; left: 50%; bottom: 1.25rem; width: 26px; height: 42px; margin-left: -13px; border: 2px solid var(--color-muted); border-radius: 14px; opacity: 0.6; }
.scroll-hint span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; border-radius: 2px; background: var(--accent); animation: wheel 1.8s ease-in-out infinite; }
@keyframes wheel { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* ------------------------------------------------------------ bandeau marques */
.brand-marquee { position: relative; overflow: hidden; border-block: 1px solid var(--stroke-line); background: color-mix(in srgb, var(--bg-surface) 60%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.marquee-track { display: flex; width: max-content; animation: marquee 60s linear infinite; }
.brand-marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }
.marquee-item { display: inline-flex; align-items: center; gap: 1.6rem; padding: 0.9rem 0 0.9rem 1.6rem; background: none; border: 0; font-family: var(--font-display); font-weight: 800; font-size: clamp(1.6rem, 3vw, 2.3rem); text-transform: uppercase; color: var(--color-muted); white-space: nowrap; transition: color 0.25s; }
.marquee-item::after { content: ""; width: 14px; height: 14px; background: conic-gradient(var(--accent) 25%, transparent 0 50%, var(--accent) 0 75%, transparent 0) 0 0/14px 14px; opacity: 0.8; }
.marquee-item:hover { color: var(--accent); }

/* ---------------------------------------------------------------- catalogue */
#main-catalog-view { padding-top: clamp(2.5rem, 6vw, 4.5rem); padding-bottom: 3rem; scroll-margin-top: 80px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.section-title { font-family: var(--font-display); font-weight: 900; text-transform: uppercase; font-size: clamp(2.4rem, 5vw, 3.8rem); line-height: 0.95; }
.section-title::after { content: ""; display: block; width: 64px; height: 5px; margin-top: 0.6rem; background: var(--accent); transform: skewX(-24deg); box-shadow: 0 0 18px var(--glow); }
.count-stream { margin-top: 0.7rem; font-family: var(--font-tech); font-size: 0.82rem; color: var(--color-muted); }

.toolbar-cluster { position: sticky; top: 76px; z-index: 60; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1rem; padding: 0.7rem 0.8rem; margin: 0 calc(-1 * 0.8rem) 1.5rem; border-radius: 16px; background: var(--header-bg); border: 1px solid var(--stroke-line); backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4); }
.categories-scroll { display: flex; gap: 0.4rem; overflow-x: auto; max-width: 100%; scrollbar-width: none; padding: 2px; }
.categories-scroll::-webkit-scrollbar { display: none; }
.filter-pill { min-height: 40px; padding: 0.4rem 1rem; border-radius: 10px; background: var(--bg-elevated); border: 1px solid var(--stroke-line); color: var(--color-secondary); font-weight: 700; font-size: 0.86rem; white-space: nowrap; transition: color 0.25s var(--ease-out), background-color 0.25s var(--ease-out), border-color 0.25s var(--ease-out), transform 0.25s var(--ease-out), opacity 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out); }
.filter-pill:hover { color: var(--color-ink); border-color: var(--glow); }
.filter-pill.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); box-shadow: 0 10px 22px -12px var(--accent); }
.selectors-cluster { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.sort-cluster { display: flex; align-items: center; gap: 0.5rem; }
.sort-title { font-size: 0.8rem; font-weight: 700; color: var(--color-muted); }
.toolbar-cluster .custom-select { min-height: 40px; padding-block: 0.4rem; font-size: 0.9rem; }

.vehicles-dynamic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: clamp(0.9rem, 1.6vw, 1.5rem); }
.compact-subgrid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.empty-grid { grid-column: 1 / -1; padding: 4rem 1rem; text-align: center; color: var(--color-muted); font-size: 1.05rem; }

/* cartes : plaques d'identification */
.car-box { --rx: 0deg; --ry: 0deg; position: relative; display: flex; flex-direction: column; overflow: hidden; cursor: pointer; border-radius: 18px; background: var(--bg-surface); border: 1px solid var(--stroke-line);
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)); transition: transform 0.4s var(--ease-out), border-color 0.3s, box-shadow 0.5s var(--ease-out), opacity 0.7s var(--ease-out), translate 0.7s var(--ease-out); }
.js-reveal #vehicles-grid .car-box:not(.in) { opacity: 0; translate: 0 34px; }
.car-box::before { content: ""; position: absolute; inset: 0; z-index: 4; pointer-events: none; opacity: 0; transition: opacity 0.3s; background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), var(--glow-soft), transparent 60%); }
.car-box::after { content: ""; position: absolute; z-index: 5; left: 0; top: 0; width: 100%; height: 3px; background: linear-gradient(90deg, var(--accent), transparent); transform: scaleX(0); transform-origin: left; transition: transform 0.6s var(--ease-out); }
.car-box:hover, .car-box:focus-visible { border-color: var(--glow); box-shadow: 0 34px 60px -32px rgba(0,0,0,0.8), 0 0 0 1px var(--glow-soft); }
.car-box:hover::before { opacity: 1; }
.car-box:hover::after, .car-box:focus-visible::after { transform: scaleX(1); }
.car-thumb-wrap { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg-elevated); }
.car-thumb-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease-out), filter 0.5s; filter: saturate(0.95) contrast(1.03); }
.car-box:hover .car-thumb-wrap img { transform: scale(1.08); filter: saturate(1.15) contrast(1.06); }
.car-thumb-wrap::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(to top, color-mix(in srgb, var(--bg-surface) 82%, transparent) 0%, transparent 32%); }
.badge-tag-phase { position: absolute; z-index: 3; left: 0.75rem; top: 0.75rem; padding: 0.25rem 0.6rem; border-radius: 6px; background: color-mix(in srgb, var(--bg-core) 70%, transparent); backdrop-filter: blur(10px); border: 1px solid var(--stroke-line); font-family: var(--font-tech); font-size: 0.7rem; font-weight: 700; color: var(--color-ink); }
.btn-bookmark-action { position: absolute; z-index: 6; right: 0.6rem; top: 0.6rem; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--stroke-line); background: color-mix(in srgb, var(--bg-core) 70%, transparent); backdrop-filter: blur(10px); color: var(--color-secondary); padding: 0; transition: transform 0.3s var(--ease-spring), color 0.2s, box-shadow 0.3s; }
.btn-bookmark-action svg, .btn-compare-action svg { width: 20px; height: 20px; display: block; }
.btn-bookmark-action svg { fill: none; stroke: currentColor; }
.btn-bookmark-action:hover { color: #facc15; }
.btn-bookmark-action.bookmarked svg { fill: #facc15; stroke: #facc15; }
.btn-bookmark-action:hover { transform: scale(1.12) rotate(-8deg); }
.btn-bookmark-action.bookmarked { border-color: #facc15; box-shadow: 0 0 0 3px rgba(250,204,21,0.18), 0 0 20px rgba(250,204,21,0.45); }
.car-card-body { position: relative; z-index: 3; display: flex; flex-direction: column; gap: 0.2rem; padding: 0.2rem 1.1rem 1.1rem; flex: 1; }
.car-make-row { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; }
.car-brand-name { font-size: 0.8rem; font-weight: 800; color: var(--accent); }
.car-years-label { font-family: var(--font-tech); font-size: 0.74rem; color: var(--color-muted); white-space: nowrap; }
.car-model-name { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.7rem, 2.2vw, 2rem); line-height: 1; letter-spacing: 0.005em; text-transform: uppercase; overflow-wrap: anywhere; }
.specs-trio { display: grid; grid-template-columns: repeat(3, 1fr); margin: 0.8rem 0 0.6rem; padding: 0.65rem 0; border-block: 1px dashed var(--stroke-line); }
.spec-entry { display: flex; flex-direction: column; gap: 0.1rem; padding-left: 0.7rem; min-width: 0; }
.spec-entry:first-child { padding-left: 0; }
.spec-entry + .spec-entry { border-left: 1px solid var(--stroke-line); }
.spec-lbl { font-size: 0.7rem; color: var(--color-muted); font-weight: 600; }
.spec-val { font-family: var(--font-tech); font-weight: 700; font-size: 0.92rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.badge-record-preview { margin-top: auto; font-size: 0.8rem; color: var(--color-secondary); }
.car-admin-actions { display: flex; gap: 0.5rem; margin-top: 0.8rem; }

.pagination-bar { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.4rem; margin-top: 2.5rem; }
.page-btn { min-width: 44px; min-height: 44px; padding: 0 0.9rem; border-radius: 10px; background: var(--bg-surface); border: 1px solid var(--stroke-line); font-weight: 700; transition: color 0.25s var(--ease-out), background-color 0.25s var(--ease-out), border-color 0.25s var(--ease-out), transform 0.25s var(--ease-out), opacity 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out); }
.page-btn:hover:not(:disabled) { border-color: var(--glow); transform: translateY(-2px); }
.page-btn.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); box-shadow: 0 10px 22px -12px var(--accent); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.page-ellipsis { display: grid; place-items: center; min-width: 24px; color: var(--color-muted); }

/* ----------------------------------------------------------- appel + pied de page */
.cta-band { position: relative; overflow: hidden; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem; padding: clamp(1.5rem, 4vw, 3rem); margin-block: 2rem 4rem; border-radius: 24px; border: 1px solid var(--glow);
  background: radial-gradient(600px 240px at 90% 0%, var(--glow-soft), transparent 70%), var(--bg-surface); }
.cta-band::before { content: ""; position: absolute; right: -40px; top: 0; bottom: 0; width: 220px; opacity: 0.12; background: repeating-linear-gradient(-45deg, var(--accent) 0 14px, transparent 14px 28px); transform: skewX(-12deg); }
.cta-copy h2 { font-family: var(--font-display); font-weight: 900; text-transform: uppercase; font-size: clamp(1.9rem, 4vw, 3rem); line-height: 0.98; max-width: 20ch; margin-bottom: 0.6rem; }
.cta-copy p { color: var(--color-secondary); max-width: 52ch; }
.cta-actions { position: relative; display: flex; flex-wrap: wrap; gap: 0.75rem; }
.site-footer { border-top: 1px solid var(--stroke-line); padding: 2.5rem 0 calc(2.5rem + var(--safe-bottom)); background: color-mix(in srgb, var(--bg-surface) 50%, transparent); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 1.5rem; }
.footer-brand { font-family: var(--font-display); font-weight: 900; font-size: 1.7rem; }
.footer-brand .logo-auto { color: var(--accent); }
.footer-brand p { margin-top: 0.4rem; font-family: var(--font-sans); font-weight: 500; font-size: 0.9rem; color: var(--color-muted); max-width: 36ch; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.footer-links a, .footer-links button { min-height: 40px; display: inline-flex; align-items: center; background: none; border: 0; color: var(--color-secondary); font-weight: 600; font-size: 0.92rem; text-decoration: none; transition: color 0.2s; }
.footer-links a:hover, .footer-links button:hover { color: var(--accent); }

/* ----------------------------------------------------------------- modales */
.modal-layer { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 1rem; opacity: 0; pointer-events: none; transition: opacity 0.3s;
  background: radial-gradient(circle at 50% 25%, color-mix(in srgb, var(--accent) 9%, rgba(0,0,0,0.78)), rgba(0,0,0,0.9)); backdrop-filter: blur(10px) saturate(1.2); -webkit-backdrop-filter: blur(10px) saturate(1.2); }
.modal-layer.active { opacity: 1; pointer-events: auto; }
.modal-dialog { position: relative; width: 100%; max-width: 560px; max-height: 90vh; max-height: 90dvh; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; border-radius: 22px; background: var(--bg-surface); border: 1px solid var(--stroke-line); box-shadow: var(--shadow-pop); transform: translateY(18px) scale(0.97); transition: transform 0.45s var(--ease-out); }
.modal-layer.active .modal-dialog { transform: none; }
.modal-dialog::before { content: ""; position: sticky; top: 0; display: block; height: 3px; z-index: 8; margin-bottom: -3px; background: linear-gradient(90deg, var(--accent), transparent 75%); }
.wide-box { max-width: 820px; }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.4rem 1.5rem 0.9rem; }
.dialog-title { font-family: var(--font-display); font-weight: 900; font-size: clamp(1.8rem, 4vw, 2.3rem); line-height: 1; text-transform: uppercase; }
.dialog-sub { margin-top: 0.35rem; font-size: 0.9rem; color: var(--color-secondary); }
.dialog-close-btn { flex: none; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; background: var(--bg-elevated); border: 1px solid var(--stroke-line); font-size: 1.5rem; line-height: 1; color: var(--color-secondary); transition: transform 0.35s var(--ease-out), color 0.2s, border-color 0.2s; }
.dialog-close-btn:hover { transform: rotate(90deg); color: var(--accent); border-color: var(--glow); }
.dialog-body { padding: 0.5rem 1.5rem 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
.dialog-footer { padding: 1rem 1.5rem calc(1.25rem + var(--safe-bottom)); border-top: 1px solid var(--stroke-line); display: flex; justify-content: flex-end; }
.dialog-tabs { display: flex; gap: 0.25rem; margin: 0 1.5rem; padding: 4px; border-radius: 12px; background: var(--bg-elevated); }
.dialog-tab-btn { flex: 1; min-height: 42px; border: 0; border-radius: 9px; background: transparent; font-weight: 700; color: var(--color-secondary); transition: color 0.25s var(--ease-out), background-color 0.25s var(--ease-out), border-color 0.25s var(--ease-out), transform 0.25s var(--ease-out), opacity 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out); }
.dialog-tab-btn.active { background: var(--accent); color: var(--on-accent); box-shadow: 0 8px 18px -10px var(--accent); }
.auth-box .dialog-body { padding-top: 1.25rem; }
.auth-form { display: none; flex-direction: column; gap: 0.9rem; }
.auth-form.active { display: flex; }
.google-auth-btn { display: flex; align-items: center; justify-content: center; gap: 0.75rem; min-height: 48px; border-radius: 12px; background: var(--bg-elevated); border: 1px solid var(--stroke-line); font-weight: 700; transition: border-color 0.2s, transform 0.25s var(--ease-out); }
.google-auth-btn:hover { border-color: var(--glow); transform: translateY(-1px); }
.divider-or { display: flex; align-items: center; gap: 0.75rem; color: var(--color-muted); font-size: 0.8rem; }
.divider-or::before, .divider-or::after { content: ""; flex: 1; height: 1px; background: var(--stroke-line); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.mt { margin-top: 0.9rem; }
.custom-select.full { width: 100%; }
.panel-section-title { margin: 0.5rem 0 0.4rem; font-weight: 800; font-size: 0.95rem; }
.panel-section-title.nomargin { margin: 0; }
.scroll-box { max-height: 240px; overflow-y: auto; }
.profile-head { display: flex; align-items: center; gap: 1rem; min-width: 0; }
.profile-avatar { flex: none; width: 76px; height: 76px; border-radius: 50%; object-fit: cover; border: 3px solid var(--accent); box-shadow: 0 0 24px var(--glow); }
.profile-bio { color: var(--color-secondary); line-height: 1.55; }
.private-warning { padding: 2rem 1rem; text-align: center; color: var(--color-muted); background: var(--bg-elevated); border-radius: 14px; }
.admin-engines-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; margin: 1.5rem 0 1rem; }
.admin-engine-block { position: relative; padding: 1rem; margin-bottom: 0.75rem; border-radius: 14px; background: var(--bg-elevated); border: 1px solid var(--stroke-line); }
.admin-engine-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 0.6rem; margin-bottom: 0.6rem; }
.admin-engine-remove { position: absolute; top: 0.5rem; right: 0.5rem; width: 36px; height: 36px; border-radius: 10px; border: 0; background: transparent; font-size: 1.4rem; color: #ef4444; }
.admin-engine-remove:hover { background: #ef4444; color: #fff; }

.stats-ribbon { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 0.6rem; }
.ribbon-card { display: flex; flex-direction: column; gap: 0.15rem; padding: 0.9rem; border-radius: 14px; background: var(--bg-elevated); border: 1px solid var(--stroke-line); }
.ribbon-value { font-family: var(--font-display); font-weight: 900; font-size: 2.2rem; line-height: 1; color: var(--accent); }
.ribbon-key { font-size: 0.78rem; color: var(--color-muted); font-weight: 600; }
.settings-box { padding: 0.9rem 1rem; border-radius: 14px; background: var(--bg-elevated); border: 1px solid var(--stroke-line); }
.settings-box summary { cursor: pointer; font-weight: 800; min-height: 32px; display: flex; align-items: center; }
.settings-box[open] summary { margin-bottom: 0.8rem; }
.check-row { display: flex; align-items: flex-start; gap: 0.7rem; margin-top: 0.9rem; font-size: 0.9rem; color: var(--color-secondary); cursor: pointer; }
.check-row input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.subtabs-bar { display: flex; gap: 0.4rem; border-bottom: 1px solid var(--stroke-line); }
.subtab-btn { min-height: 44px; padding: 0 1rem; background: none; border: 0; border-bottom: 3px solid transparent; font-weight: 700; color: var(--color-muted); transition: color 0.2s, border-color 0.3s; }
.subtab-btn.active { color: var(--color-ink); border-bottom-color: var(--accent); }
.garage-panel { display: none; }
.garage-panel.active { display: block; animation: fadeInScale 0.35s var(--ease-out); }

.telemetry-stack { display: flex; flex-direction: column; gap: 0.5rem; }
.telemetry-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.8rem 1rem; border-radius: 14px; background: var(--bg-elevated); border: 1px solid var(--stroke-line); transition: transform 0.3s var(--ease-out), border-color 0.2s; }
.telemetry-row:hover { transform: translateX(4px); border-color: var(--glow); }
.telemetry-row.clickable { cursor: pointer; }
.lap-left, .lap-right, .pilot-row-left, .pilot-row-right { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.lap-info, .pilot-row-text { min-width: 0; }
.lap-title { font-weight: 700; overflow-wrap: anywhere; }
.lap-on { font-weight: 500; color: var(--color-secondary); }
.lap-meta { font-size: 0.8rem; color: var(--color-muted); overflow-wrap: anywhere; }
.lap-time { font-family: var(--font-tech); font-weight: 700; color: var(--accent); white-space: nowrap; }
.lap-time.big { font-size: 1.15rem; }
.leaderboard-rank { min-width: 2.6rem; font-family: var(--font-display); font-weight: 900; font-size: 1.9rem; line-height: 1; color: var(--color-muted); }
#global-leaderboard-list .telemetry-row:nth-child(1) .leaderboard-rank { color: #facc15; text-shadow: 0 0 20px rgba(250,204,21,0.55); }
#global-leaderboard-list .telemetry-row:nth-child(2) .leaderboard-rank { color: #cbd5e1; }
#global-leaderboard-list .telemetry-row:nth-child(3) .leaderboard-rank { color: #d97706; }
.pilot-link { font-weight: 800; cursor: pointer; }
.pilot-link:hover { color: var(--accent); }
.pilot-row-avatar { flex: none; width: 42px; height: 42px; border-radius: 50%; object-fit: cover; border: 2px solid var(--stroke-line); }
.pilot-row-name { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.see-profile { font-size: 0.8rem; font-weight: 700; color: var(--accent); white-space: nowrap; }
.telemetry-trash-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; border: 0; background: transparent; transition: background 0.2s; }
.telemetry-trash-btn:hover { background: color-mix(in srgb, #ef4444 20%, transparent); }

/* thèmes */
.theme-family-title { margin: 0.5rem 0 0.75rem; font-weight: 800; }
.theme-family-title:not(:first-child) { margin-top: 1.75rem; }
.theme-palette-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 0.6rem; }
.theme-tile { display: flex; align-items: center; gap: 0.8rem; min-height: 60px; padding: 0.7rem 0.9rem; text-align: left; border-radius: 14px; background: var(--bg-elevated); border: 1px solid var(--stroke-line); transition: color 0.3s var(--ease-out), background-color 0.3s var(--ease-out), border-color 0.3s var(--ease-out), transform 0.3s var(--ease-out), opacity 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out); }
.theme-tile:hover { transform: translateY(-3px); border-color: var(--glow); }
.theme-tile.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--glow-soft); }
.swatch-circle { flex: none; width: 30px; height: 30px; border-radius: 50%; }
.tile-meta { display: flex; flex-direction: column; min-width: 0; }
.tile-title { font-weight: 800; font-size: 0.92rem; }
.tile-sub { font-size: 0.75rem; color: var(--color-muted); }

/* ------------------------------------------------------------ fiche véhicule */
.vehicle-sheet { max-width: 1000px; padding: 0; }
.sheet-close-floating { position: sticky; top: 0.75rem; float: right; z-index: 20; margin: 0.75rem 0.75rem -3.5rem 0; background: color-mix(in srgb, var(--bg-core) 70%, transparent); backdrop-filter: blur(10px); }
.sheet-hero-banner { position: relative; height: clamp(240px, 42vh, 460px); overflow: hidden; background: var(--bg-elevated); }
.sheet-hero-banner img { width: 100%; height: 100%; object-fit: cover; animation: kenburns 14s ease-out both; }
@keyframes kenburns { from { transform: scale(1.12); } to { transform: scale(1); } }
.sheet-hero-banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, var(--bg-surface) 4%, color-mix(in srgb, var(--bg-surface) 30%, transparent) 55%, transparent); }
.sheet-heading-box { position: relative; z-index: 3; margin: -6.5rem 0 0; padding: 0 clamp(1.2rem, 4vw, 2.2rem); }
.sheet-brandline { display: inline-flex; align-items: center; gap: 0.6rem; font-weight: 800; font-size: 0.85rem; color: var(--accent); }
.sheet-brandline span { padding: 0.15rem 0.5rem; border-radius: 5px; background: var(--glow-soft); font-family: var(--font-tech); font-size: 0.75rem; color: var(--color-ink); }
.sheet-big-title { font-family: var(--font-display); font-weight: 900; text-transform: uppercase; font-size: clamp(2.8rem, 8vw, 5.4rem); line-height: 0.9; margin: 0.35rem 0 0.7rem; overflow-wrap: anywhere; }
.sheet-blurb { max-width: 62ch; color: var(--color-secondary); line-height: 1.6; }
.sheet-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1rem; }
.sheet-core-body { padding: 1.25rem clamp(1.2rem, 4vw, 2.2rem) 2rem; }
.sheet-kpis { display: grid; grid-template-columns: repeat(3, 1fr); margin-bottom: 1.5rem; border-radius: 16px; background: var(--bg-elevated); border: 1px solid var(--stroke-line); overflow: hidden; }
.sheet-kpis > div { display: flex; flex-direction: column; gap: 0.1rem; padding: 1rem 1.1rem; }
.sheet-kpis > div + div { border-left: 1px solid var(--stroke-line); }
.sheet-kpis b { font-family: var(--font-display); font-weight: 900; font-size: clamp(1.9rem, 5vw, 3rem); line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.sheet-kpis small { font-size: 0.78rem; font-weight: 600; color: var(--color-muted); }
.sheet-section-head { display: flex; align-items: center; gap: 0.7rem; margin: 2rem 0 1rem; font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; text-transform: uppercase; }
.sheet-section-head::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--stroke-line), transparent); }
.phases-strip { display: flex; gap: 0.5rem; overflow-x: auto; padding: 2px 2px 0.5rem; scrollbar-width: none; }
.phases-strip::-webkit-scrollbar { display: none; }
.phase-pill-btn { min-height: 42px; padding: 0 1.1rem; border-radius: 10px; background: var(--bg-elevated); border: 1px solid var(--stroke-line); font-weight: 700; font-size: 0.9rem; white-space: nowrap; color: var(--color-secondary); transition: color 0.25s var(--ease-out), background-color 0.25s var(--ease-out), border-color 0.25s var(--ease-out), transform 0.25s var(--ease-out), opacity 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out); }
.phase-pill-btn.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); box-shadow: 0 10px 22px -12px var(--accent); }
.phase-details { margin: 1rem 0 0.4rem; color: var(--color-secondary); line-height: 1.6; }
.phase-editions { margin-bottom: 0.4rem; font-size: 0.88rem; color: var(--color-muted); }
.engines-matrix { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 0.8rem; margin-top: 1rem; }
.engine-blueprint-card { padding: 1rem 1.1rem; border-radius: 16px; background: var(--bg-elevated); border: 1px solid var(--stroke-line); border-left: 4px solid var(--accent); transition: transform 0.3s var(--ease-out), box-shadow 0.3s; }
.engine-blueprint-card:hover { transform: translateY(-4px); box-shadow: 0 22px 40px -26px rgba(0,0,0,0.7); }
.eng-name { margin-bottom: 0.7rem; font-family: var(--font-display); font-weight: 800; font-size: 1.35rem; text-transform: uppercase; color: var(--accent); }
.eng-bar { display: grid; grid-template-columns: 1fr auto; gap: 0.15rem 0.5rem; margin-bottom: 0.55rem; font-size: 0.8rem; }
.eng-bar span { color: var(--color-muted); font-weight: 600; }
.eng-bar strong { font-family: var(--font-tech); font-variant-numeric: tabular-nums; }
.eng-bar i { grid-column: 1 / -1; display: block; height: 6px; border-radius: 6px; background: var(--stroke-line); overflow: hidden; }
.eng-bar i::after { content: ""; display: block; height: 100%; width: var(--w, 0%); border-radius: inherit; background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 50%, transparent), var(--accent)); box-shadow: 0 0 12px var(--glow); animation: barGrow 1.1s var(--ease-out) both; }
@keyframes barGrow { from { width: 0; } }
.eng-trans { margin-top: 0.3rem; font-size: 0.8rem; color: var(--color-secondary); }
.eng-trans b { font-weight: 700; color: var(--color-ink); }
.records-box { display: flex; flex-direction: column; gap: 0.5rem; }
.record-line { padding: 0.8rem 1rem; border-radius: 12px; background: var(--bg-elevated); border: 1px solid var(--stroke-line); border-left: 4px solid #facc15; line-height: 1.5; }
.telemetry-input-matrix { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0.75rem; margin-bottom: 0.75rem; }


/* ------------------------------------------------------------- barre mobile */
.mobile-touch-bar { display: none; }

/* ================================================================ RESPONSIVE */
@media (min-width: 1000px) {
  .desktop-navigation { display: flex; }
  .header-bar { display: grid; grid-template-columns: 1fr auto 1fr; }
  .header-actions { justify-self: end; }
  .brand-link { justify-self: start; }
}
@media (hover: none) { .cmd-key-indicator { display: none; } }

@media (max-width: 999px) {
  body { padding-bottom: calc(76px + var(--safe-bottom)); }
  .mobile-touch-bar { position: fixed; z-index: 500; left: 0.6rem; right: 0.6rem; bottom: calc(0.6rem + var(--safe-bottom)); display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; padding: 0.35rem; border-radius: 22px; background: var(--header-bg); border: 1px solid var(--stroke-line); backdrop-filter: blur(20px) saturate(1.5); -webkit-backdrop-filter: blur(20px) saturate(1.5); box-shadow: 0 20px 44px -18px rgba(0,0,0,0.8); }
  .touch-bar-item { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.15rem; min-height: 56px; padding: 0.3rem 0; border: 0; border-radius: 16px; background: none; color: var(--color-muted); font-size: 0.68rem; font-weight: 700; text-decoration: none; transition: color 0.2s, background 0.2s; }
  .touch-bar-item svg { width: 22px; height: 22px; transition: transform 0.35s var(--ease-spring); }
  .touch-bar-item.active { color: var(--accent); background: var(--glow-soft); }
  .touch-bar-item.active svg { transform: translateY(-2px) scale(1.1); }
  .touch-bar-highlight { color: var(--on-accent); background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 65%, #000)); margin-top: -1.1rem; min-height: 64px; box-shadow: 0 14px 28px -10px var(--accent); }
  .touch-bar-highlight.active { color: var(--on-accent); background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 65%, #000)); }
  .touch-dot { position: absolute; top: 8px; right: calc(50% - 20px); }
  .header-bar { padding-left: 0.8rem; }
  .pilot-label { max-width: 90px; }
  #open-chat-btn { display: inline-grid; place-items: center; }
  .header-actions { gap: 0.3rem; }
  .header-actions .icon-btn { width: 40px; height: 40px; }
  .toolbar-cluster { top: 70px; }
  .footer-inner { padding-bottom: 1rem; }
}

@media (max-width: 899px) {
  .hero-stage { min-height: 0; margin-top: -70px; padding: calc(70px + 1.5rem) 0 3.5rem; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { order: -1; }
  .hero-gauge { max-width: min(300px, 78vw); }
  .gauge-chip { padding: 0.4rem 0.7rem; }
  .gauge-chip-a { left: -6%; }
  .scroll-hint { display: none; }
  .hero-stats { gap: 1.5rem; }
}

@media (max-width: 640px) {
  .modal-layer { align-items: flex-end; padding: 0; }
  .modal-dialog { max-width: none; border-radius: 24px 24px 0 0; max-height: 94vh; max-height: 94dvh; transform: translateY(100%); transition: transform 0.5s var(--ease-out); padding-bottom: var(--safe-bottom); }
  .modal-layer.active .modal-dialog { transform: none; }
  .modal-dialog > .dialog-header { padding-top: 1.6rem; }
  .modal-dialog::after { content: ""; position: absolute; top: 8px; left: 50%; width: 44px; height: 5px; margin-left: -22px; border-radius: 5px; background: var(--stroke-line); z-index: 9; }
  .dialog-header, .dialog-body { padding-inline: 1.1rem; }
  .dialog-tabs { margin-inline: 1.1rem; }
  .form-grid { grid-template-columns: 1fr; }
  .stats-ribbon { gap: 0.4rem; }
  .ribbon-card { padding: 0.7rem; }
  .ribbon-value { font-size: 1.7rem; }
  .toolbar-cluster { margin-inline: 0; position: static; }
  .selectors-cluster { width: 100%; }
  .sort-cluster { flex: 1 1 140px; }
  .sort-cluster .custom-select { width: 100%; }
  .sheet-kpis > div { padding: 0.8rem 0.7rem; }
  .cta-band { padding: 1.4rem; }
  .cta-actions { width: 100%; }
  .cta-actions .cta-btn { flex: 1; }
  .telemetry-row { padding: 0.7rem 0.8rem; }
  .telemetry-row .lap-title { font-size: 0.92rem; }
  .brand-link { font-size: 1.6rem; }
  .brand-mark { width: 24px; height: 24px; }
}
@media (max-width: 380px) {
  .specs-trio .spec-val { font-size: 0.82rem; }
  .pilot-chip { padding: 0 0.7rem; }
  .pilot-label { max-width: 60px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .hero-stage { min-height: 0; }
  .modal-dialog { max-height: 96dvh; }
}

/* ---- garde-fous mobile : l'en-tête ne doit jamais dépasser la largeur d'écran ---- */
.brand-link { flex: none; }
.header-actions { min-width: 0; flex: 0 1 auto; }
.pilot-chip { min-width: 0; flex: 0 1 auto; }
@media (max-width: 480px) {
  .app-header { padding-inline: 0.5rem; }
  .header-bar { padding: 0.4rem 0.4rem 0.4rem 0.7rem; gap: 0.5rem; }
  .brand-mark { display: none; }
  .brand-link { font-size: 1.5rem; }
  .header-actions { gap: 0.35rem; }
  .icon-btn { width: 42px; height: 42px; }
  .pilot-chip { height: 42px; padding: 0 0.7rem; max-width: 128px; }
  .pilot-label { max-width: 78px; font-size: 0.82rem; }
  .gauge-readout { top: 71%; width: 44%; min-width: 0; }
  .gauge-value { font-size: 1.6rem; }
  .gauge-caption { font-size: 0.64rem; }
  .gauge-chip b { font-size: 0.92rem; }
}

@media (max-width: 480px) {
  .sort-cluster { flex: 1 1 100%; }
  .sort-cluster .sort-title { min-width: 3.2rem; }
  .sort-cluster .custom-select { flex: 1; min-width: 0; }
}

/* ---------- avatar (téléversement) ---------- */
.avatar-upload { display: flex; align-items: center; gap: 1rem; margin-top: 0.9rem; padding: 0.8rem; border-radius: 14px; background: var(--bg-elevated); border: 1px dashed var(--stroke-line); }
.avatar-preview { flex: none; width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 2px solid var(--glow); background: var(--bg-surface); }
.avatar-upload-body { display: flex; flex-direction: column; align-items: flex-start; gap: 0.4rem; min-width: 0; }
.avatar-upload-body small { font-size: 0.76rem; color: var(--color-muted); line-height: 1.4; }

/* ---------- administration ---------- */
.admin-quick { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.admin-quick > * { flex: 1 1 200px; justify-content: center; text-align: center; text-decoration: none; }
.admin-h3 { margin-top: 0.4rem; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--color-muted); }
.admin-list { display: flex; flex-direction: column; gap: 0.5rem; max-height: 40vh; overflow-y: auto; overscroll-behavior: contain; }
.admin-row-actions { display: flex; gap: 0.4rem; flex: none; flex-wrap: wrap; justify-content: flex-end; }
.admin-note { font-size: 0.8rem; color: var(--color-muted); line-height: 1.5; }
.admin-gear { color: var(--on-accent); border-color: transparent; background: linear-gradient(145deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #000)); box-shadow: 0 6px 18px -6px var(--glow); }
.admin-gear:hover { box-shadow: 0 0 0 4px var(--glow-soft), 0 8px 22px -6px var(--glow); }
.admin-gear svg { width: 22px; height: 22px; }
@media (max-width: 640px) {
  .avatar-upload { flex-direction: column; align-items: flex-start; }
  .admin-quick > * { flex-basis: 100%; }
  .admin-row-actions { width: 100%; justify-content: stretch; }
  .admin-row-actions > * { flex: 1; }
  .admin-list .telemetry-row { flex-direction: column; align-items: stretch; }
}

/* ---------- navigation (bureau) : pilule segmentée + pastille coulissante ---------- */
.desktop-navigation { display: none; position: relative; align-items: center; gap: 0.1rem; padding: 4px; border-radius: 14px; background: color-mix(in srgb, var(--bg-elevated) 80%, transparent); border: 1px solid var(--stroke-line); }
@media (min-width: 1000px) { .desktop-navigation { display: flex; } }
.nav-glider { position: absolute; top: 4px; bottom: 4px; left: 0; width: 0; border-radius: 10px; background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 22%, transparent), color-mix(in srgb, var(--accent) 10%, transparent)); border: 1px solid var(--glow); box-shadow: 0 6px 18px -8px var(--accent), inset 0 1px 0 color-mix(in srgb, #fff 12%, transparent); transition: transform 0.45s var(--ease-out), width 0.45s var(--ease-out), opacity 0.2s; pointer-events: none; }
.nav-link { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 0.5rem; height: 38px; padding: 0 1rem; background: none; border: 0; border-radius: 10px; color: var(--color-secondary); font-weight: 700; font-size: 0.88rem; letter-spacing: 0.01em; white-space: nowrap; text-decoration: none; transition: color 0.25s; }
.nav-link svg { width: 17px; height: 17px; flex: none; opacity: 0.85; transition: transform 0.35s var(--ease-spring), color 0.25s; }
.nav-link:hover, .nav-link.active, .nav-link:focus-visible { color: var(--color-ink); }
.nav-link:hover svg, .nav-link.active svg { color: var(--accent); transform: translateY(-1px) scale(1.08); opacity: 1; }
.nav-link { padding: 0 0.8rem; }
@media (min-width: 1000px) {
  .header-bar { grid-template-columns: auto 1fr auto; gap: 0.75rem; }
  .desktop-navigation { justify-self: center; }
  .nav-link svg { display: none; }
}
@media (min-width: 1000px) and (max-width: 1279px) {
  /* icônes seules : on garde le libellé pour les lecteurs d'écran */
  .nav-link { padding: 0; width: 42px; justify-content: center; }
  .nav-link svg { display: block; width: 19px; height: 19px; }
  .nav-link span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .pilot-chip { max-width: 140px; }
}

/* ---------- contact ---------- */
.contact-section { margin-block: clamp(2rem, 6vw, 4.5rem); scroll-margin-top: 90px; }
.contact-card { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(1.25rem, 4vw, 3rem); padding: clamp(1.25rem, 4vw, 2.75rem); border-radius: 26px; background: linear-gradient(145deg, var(--bg-surface), color-mix(in srgb, var(--bg-surface) 70%, var(--accent) 6%)); border: 1px solid var(--stroke-line); box-shadow: var(--shadow-pop); }
.contact-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--accent), transparent 70%); }
.contact-kicker { display: inline-block; padding: 0.25rem 0.7rem; border-radius: 999px; font-family: var(--font-tech); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); background: var(--glow-soft); border: 1px solid var(--glow); }
.contact-intro h2 { margin: 0.9rem 0 0.7rem; font-family: var(--font-display); font-weight: 900; font-size: clamp(1.9rem, 3.6vw, 2.8rem); line-height: 1; text-transform: uppercase; text-wrap: balance; }
.contact-intro p { color: var(--color-secondary); line-height: 1.6; max-width: 46ch; }
.contact-points { margin-top: 1.25rem; display: flex; flex-direction: column; gap: 0.6rem; list-style: none; padding: 0; }
.contact-points li { position: relative; padding-left: 1.4rem; font-size: 0.9rem; color: var(--color-secondary); line-height: 1.5; }
.contact-points li::before { content: ""; position: absolute; left: 0; top: 0.5em; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); transform: rotate(45deg); }
.contact-points b { color: var(--color-ink); }
.contact-form { display: flex; flex-direction: column; gap: 0.85rem; min-width: 0; }
.contact-form .custom-select { width: 100%; }
.char-count { align-self: flex-end; font-family: var(--font-tech); font-size: 0.7rem; color: var(--color-muted); }
.honeypot { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.contact-actions .fill-btn { flex: 2 1 200px; }
.contact-actions .btn-ghost { flex: 1 1 180px; }
.contact-status { min-height: 1.3rem; font-size: 0.88rem; color: var(--color-secondary); }
.contact-status.ok { color: #10b981; }
.contact-status.err { color: #ef4444; }

/* ---------- pied de page ---------- */
.footer-legal { padding-right: 3.5rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.4rem 1.5rem; margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--stroke-line); font-family: var(--font-tech); font-size: 0.74rem; letter-spacing: 0.06em; color: var(--color-muted); }

/* ---------- retour en haut ---------- */
.to-top { position: fixed; z-index: 450; right: clamp(1rem, 2vw, 1.75rem); bottom: calc(clamp(1rem, 2vw, 1.75rem) + var(--safe-bottom)); width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; background: var(--header-bg); border: 1px solid var(--glow); color: var(--accent); backdrop-filter: blur(14px); box-shadow: 0 14px 30px -14px var(--accent); transition: transform 0.3s var(--ease-spring); animation: fadeInScale 0.35s var(--ease-out) both; }
.to-top:hover { transform: translateY(-3px); }
.to-top svg { width: 22px; height: 22px; }
@media (max-width: 999px) { .to-top { bottom: calc(5.6rem + var(--safe-bottom)); width: 44px; height: 44px; } }
@media (max-width: 860px) {
  .contact-card { grid-template-columns: 1fr; }
}
@media (max-width: 999px) { .site-footer { padding-bottom: calc(6.5rem + var(--safe-bottom)); } }

.admin-msg { padding: 0.9rem 1rem; border-radius: 14px; background: var(--bg-elevated); border: 1px solid var(--stroke-line); display: flex; flex-direction: column; gap: 0.5rem; }
.admin-msg-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.7rem; }
.admin-msg-head .lap-meta { flex-basis: 100%; }
.msg-type { padding: 0.15rem 0.55rem; border-radius: 999px; font-size: 0.7rem; font-weight: 800; color: var(--accent); background: var(--glow-soft); border: 1px solid var(--glow); }
.admin-msg-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.9rem; line-height: 1.5; color: var(--color-secondary); }
.admin-msg .admin-row-actions { justify-content: flex-start; }
.admin-msg .compact-btn { text-decoration: none; display: inline-flex; align-items: center; }

/* ---------- diagnostic e-mail (admin) ---------- */
.mail-ok { font-size: 0.72rem; font-weight: 700; color: #10b981; }
.mail-ko { font-size: 0.72rem; font-weight: 700; color: #f59e0b; overflow-wrap: anywhere; }

/* ---------- comparateur ---------- */
.btn-compare-action { z-index: 6; position: absolute; top: 0.6rem; right: 3.5rem; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--stroke-line); background: color-mix(in srgb, var(--bg-surface) 80%, transparent); backdrop-filter: blur(8px); color: var(--color-secondary); padding: 0; transition: transform 0.25s var(--ease-spring), color 0.2s, border-color 0.2s; z-index: 2; }
.btn-compare-action:hover { transform: scale(1.1); color: var(--accent); border-color: var(--glow); }
.btn-compare-action.on { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
.compare-tray { position: fixed; z-index: 480; left: 0; right: 0; margin-inline: auto; width: max-content; bottom: calc(1rem + var(--safe-bottom)); display: flex; align-items: center; gap: 0.6rem; max-width: calc(100vw - 1.5rem); padding: 0.5rem 0.55rem 0.5rem 0.9rem; border-radius: 18px; background: var(--header-bg); border: 1px solid var(--glow); backdrop-filter: blur(18px); box-shadow: 0 20px 50px -18px rgba(0,0,0,0.8), 0 0 0 4px var(--glow-soft); animation: fadeInScale 0.35s var(--ease-out) both; }
.compare-chips { display: flex; gap: 0.4rem; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.compare-chip { display: inline-flex; align-items: center; gap: 0.3rem; white-space: nowrap; padding: 0.3rem 0.35rem 0.3rem 0.7rem; border-radius: 999px; font-size: 0.8rem; font-weight: 700; background: var(--bg-elevated); border: 1px solid var(--stroke-line); }
.compare-chip button { width: 22px; height: 22px; border: 0; border-radius: 50%; background: var(--glow-soft); color: var(--accent); font-size: 1rem; line-height: 1; }
.compare-tray .compact-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.compare-clear { width: 38px; height: 38px; flex: none; }
@media (max-width: 999px) { .compare-tray { bottom: calc(5.9rem + var(--safe-bottom)); } .to-top { display: none; } }
.compare-scroll { overflow-x: auto; }
.cmp-grid { display: grid; grid-template-columns: minmax(110px, 0.7fr) repeat(var(--cols), minmax(150px, 1fr)); gap: 0.5rem; min-width: min(100%, 560px); align-items: stretch; }
.cmp-col-head { display: flex; flex-direction: column; gap: 0.25rem; padding: 0.6rem; border-radius: 14px; background: var(--bg-elevated); border: 1px solid var(--stroke-line); }
.cmp-col-head img { width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: 10px; background: var(--bg-surface); }
.cmp-brand { font-family: var(--font-tech); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); }
.cmp-name { font-family: var(--font-display); font-weight: 900; font-size: 1.3rem; line-height: 1; text-transform: uppercase; }
.cmp-years { font-size: 0.78rem; color: var(--color-muted); margin-bottom: 0.3rem; }
.cmp-label { display: flex; align-items: center; font-size: 0.78rem; font-weight: 700; color: var(--color-secondary); }
.cmp-cell { position: relative; padding: 0.7rem 0.8rem 0.9rem; border-radius: 12px; background: var(--bg-elevated); border: 1px solid var(--stroke-line); overflow: hidden; }
.cmp-cell b { font-family: var(--font-tech); font-size: 1.15rem; }
.cmp-cell b small { font-size: 0.7rem; color: var(--color-muted); font-weight: 500; }
.cmp-cell i { position: absolute; left: 0; bottom: 0; height: 4px; width: var(--w); background: var(--color-muted); opacity: 0.4; border-radius: 0 4px 0 0; }
.cmp-cell.win { border-color: var(--glow); background: var(--glow-soft); }
.cmp-cell.win b { color: var(--accent); }
.cmp-cell.win i { background: var(--accent); opacity: 1; }
@media (max-width: 640px) { .cmp-grid { grid-template-columns: 76px repeat(var(--cols), minmax(120px, 1fr)); gap: 0.35rem; } .cmp-label { font-size: 0.68rem; } .cmp-name { font-size: 1.05rem; }  }

/* ---------- filtres du classement ---------- */
.lb-filters { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 0.6rem; }
.lb-field { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.lb-field > span { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-muted); }
.lb-field .custom-select { width: 100%; min-width: 0; }
.lap-chip { display: inline-block; margin-left: 0.25rem; padding: 0.05rem 0.45rem; border-radius: 999px; font-size: 0.66rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--color-secondary); background: var(--bg-surface); border: 1px solid var(--stroke-line); }
.lap-chip.turbo { color: var(--accent); border-color: var(--glow); background: var(--glow-soft); }
.leaderboard-rank.podium { font-size: 1.35rem; }
@media (max-width: 640px) { .lb-filters { grid-template-columns: 1fr 1fr; } .lb-filters .lb-field:first-child { grid-column: 1 / -1; } }

/* ---------- profil enrichi ---------- */
.settings-sep { margin-top: 1.1rem; padding-top: 0.9rem; border-top: 1px dashed var(--stroke-line); font-weight: 800; font-size: 0.9rem; }
.car-preview { flex: none; width: 96px; height: 64px; border-radius: 12px; object-fit: cover; border: 2px solid var(--glow); background: var(--bg-surface); }
.badge-row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.6rem; }
.badge-row:empty { display: none; }
.badge-pill { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.3rem 0.7rem 0.3rem 0.45rem; border-radius: 999px; font-size: 0.76rem; font-weight: 800; background: var(--bg-elevated); border: 1px solid var(--stroke-line); cursor: help; animation: fadeInScale 0.4s var(--ease-out) both; }
.badge-pill i { font-style: normal; font-size: 1rem; line-height: 1; }
.badge-pill.silver { border-color: color-mix(in srgb, #94a3b8 70%, transparent); }
.badge-pill.gold { color: #fbbf24; border-color: color-mix(in srgb, #fbbf24 60%, transparent); background: color-mix(in srgb, #fbbf24 10%, var(--bg-elevated)); }
.car-showcase { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); overflow: hidden; border-radius: 18px; background: var(--bg-elevated); border: 1px solid var(--stroke-line); }
.car-showcase:has(> img:only-child), .car-showcase > .car-showcase-body:only-child { grid-template-columns: 1fr; }
.car-showcase img { width: 100%; height: 100%; min-height: 160px; max-height: 260px; object-fit: cover; }
.car-showcase-body { padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: 0.4rem; justify-content: center; }
.car-showcase-kicker { font-family: var(--font-tech); font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.car-showcase h3 { font-family: var(--font-display); font-weight: 900; font-size: 1.5rem; line-height: 1.05; text-transform: uppercase; }
.mods-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0.3rem; }
.mods-list li { position: relative; padding-left: 1.1rem; font-size: 0.88rem; color: var(--color-secondary); }
.mods-list li::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 6px; height: 6px; border-radius: 1px; background: var(--accent); transform: rotate(45deg); }
@media (max-width: 640px) { .car-showcase { grid-template-columns: 1fr; } .car-preview { width: 80px; height: 56px; } }

/* ---------- propositions de la communauté ---------- */
.seg-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 0.3rem; padding: 0.3rem; border-radius: 14px; background: var(--bg-elevated); border: 1px solid var(--stroke-line); }
.seg-btn { min-height: 42px; border: 0; border-radius: 10px; background: none; color: var(--color-secondary); font-weight: 700; font-size: 0.88rem; transition: background 0.2s, color 0.2s; }
.seg-btn.active { background: var(--accent); color: var(--on-accent); box-shadow: 0 8px 18px -10px var(--accent); }
.sg-block { display: flex; flex-direction: column; gap: 0.8rem; }
.community-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.6rem; }
.community-gallery .empty-note { grid-column: 1 / -1; }
.cg-item { margin: 0; overflow: hidden; border-radius: 12px; background: var(--bg-elevated); border: 1px solid var(--stroke-line); }
.cg-item img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.cg-item figcaption { padding: 0.45rem 0.6rem; font-size: 0.75rem; color: var(--color-secondary); line-height: 1.35; }
.cg-item figcaption span { color: var(--color-muted); }
.sg-thumb { max-width: 220px; max-height: 150px; object-fit: cover; border-radius: 10px; border: 1px solid var(--stroke-line); }

/* ---------- filtres avancés ---------- */
.adv-toggle { display: inline-flex; align-items: center; gap: 0.5rem; white-space: nowrap; }
.adv-toggle svg { width: 18px; height: 18px; }
.adv-toggle.on { border-color: var(--accent); color: var(--accent); }
.adv-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 0.72rem; font-weight: 800; }
.adv-panel { margin: 0.9rem 0 1.4rem; padding: 1.1rem; border: 1px solid var(--stroke-line); border-radius: 16px; background: var(--bg-surface); }
.adv-panel[hidden] { display: none; }
.adv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0.9rem; }
.adv-field { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.78rem; color: var(--color-secondary); font-weight: 600; }
.adv-field input { width: 100%; padding: 0.7rem 0.8rem; border-radius: 10px; border: 1px solid var(--stroke-line); background: var(--bg-core); color: var(--color-ink); font: inherit; }
.adv-field input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.adv-actions { display: flex; justify-content: flex-end; margin-top: 0.9rem; }

/* ---------- graphiques du comparateur ---------- */
.cmp-charts { margin-top: 1.6rem; }
.cc-legend { display: flex; flex-wrap: wrap; gap: 0.5rem 1.1rem; margin-bottom: 0.9rem; font-size: 0.82rem; color: var(--color-secondary); font-weight: 600; }
.cc-key { display: inline-flex; align-items: center; gap: 0.45rem; }
.cc-key i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.cc-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 1rem; }
.cc-card { margin: 0; padding: 1rem; border: 1px solid var(--stroke-line); border-radius: 16px; background: var(--bg-surface); }
.cc-card figcaption { font-weight: 700; font-size: 0.9rem; margin-bottom: 0.6rem; color: var(--color-ink); }
.cc-card figcaption small { color: var(--color-muted); font-weight: 500; }
.cc-svg { width: 100%; height: auto; display: block; }
.cc-grid { fill: none; stroke: var(--stroke-line); stroke-width: 1; }
.cc-label, .cc-tick, .cc-axis { fill: var(--color-secondary); font-size: 11px; font-family: var(--font-sans); font-weight: 600; }
.cc-tick { font-size: 10px; font-family: var(--font-tech); }
@media (max-width: 760px) { .cc-row { grid-template-columns: 1fr; } }

/* ---------- import CSV / Wikipédia ---------- */
.import-pane { margin-top: 1rem; display: flex; flex-direction: column; gap: 0.8rem; }
.import-pane[hidden] { display: none; }
.file-pick { cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.import-pane code { font-family: var(--font-tech); font-size: 0.78rem; background: var(--bg-elevated); padding: 0.1rem 0.4rem; border-radius: 6px; }
.import-box { padding: 0.8rem 1rem; border-radius: 12px; font-size: 0.85rem; border: 1px solid var(--stroke-line); background: var(--bg-elevated); }
.import-box ul { margin: 0.4rem 0 0 1.1rem; padding: 0; display: grid; gap: 0.2rem; color: var(--color-secondary); }
.import-box.err { border-color: color-mix(in srgb, #ef4444 55%, transparent); }
.import-box.warn { border-color: color-mix(in srgb, #f59e0b 55%, transparent); }
.import-box.ok { border-color: color-mix(in srgb, #10b981 55%, transparent); }
.import-table-wrap { max-height: 38vh; overflow: auto; border: 1px solid var(--stroke-line); border-radius: 12px; }
.import-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.import-table th, .import-table td { text-align: left; padding: 0.55rem 0.8rem; border-bottom: 1px solid var(--stroke-line); }
.import-table th { position: sticky; top: 0; background: var(--bg-elevated); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-muted); }
.import-table tr.skip td { opacity: 0.5; }
.wiki-row { display: flex; gap: 0.6rem; }
.wiki-row input { flex: 1; min-width: 0; padding: 0.8rem 1rem; border-radius: 12px; border: 1px solid var(--stroke-line); background: var(--bg-core); color: var(--color-ink); font: inherit; }
@media (max-width: 560px) { .wiki-row { flex-direction: column; } }

/* ---------- abonnements ---------- */
.social-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.2rem; margin-bottom: 0.9rem; }
.social-count { background: none; border: 0; padding: 0.2rem 0; color: var(--color-secondary); font: inherit; font-size: 0.9rem; cursor: pointer; }
.social-count b { color: var(--color-ink); font-weight: 800; font-size: 1.05rem; margin-right: 0.15rem; }
.social-count:hover { color: var(--accent); }
.follow-btn.on { background: var(--bg-elevated); color: var(--color-ink); border: 1px solid var(--stroke-line); box-shadow: none; }
.follow-btn[hidden] { display: none; }

@media (max-width: 560px) { .adv-grid { grid-template-columns: 1fr 1fr; gap: 0.7rem; } .adv-panel { padding: 0.9rem; } }
#wiki-paste-wrap { display: flex; flex-direction: column; gap: 0.6rem; }
#wiki-paste-wrap[hidden] { display: none; }
#wiki-paste { width: 100%; padding: 0.8rem 1rem; border-radius: 12px; border: 1px solid var(--stroke-line); background: var(--bg-core); color: var(--color-ink); font: inherit; resize: vertical; }

/* ---- carrousel photos (cartes + fiche) ---- */
.car-slides { position: absolute; inset: 0; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.car-slides::-webkit-scrollbar { display: none; }
.car-slides img { flex: 0 0 100%; width: 100%; height: 100%; object-fit: cover; scroll-snap-align: center; scroll-snap-stop: always; -webkit-user-drag: none; user-select: none; }
.car-slides.single { overflow: hidden; }
.sheet-hero-banner .car-slides img { animation: none; }
.car-thumb-wrap::after, .sheet-hero-banner::after { z-index: 1; }
.slide-arrow { position: absolute; z-index: 4; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; padding: 0; border-radius: 50%; border: 1px solid var(--stroke-line); background: color-mix(in srgb, var(--bg-core) 72%, transparent); backdrop-filter: blur(8px); color: var(--color-ink); cursor: pointer; opacity: 0; transition: opacity .2s; }
.slide-arrow svg { width: 16px; height: 16px; }
.slide-arrow.prev { left: 0.5rem; } .slide-arrow.next { right: 0.5rem; }
.car-box:hover .slide-arrow, .sheet-hero-banner:hover .slide-arrow, .slide-arrow:focus-visible { opacity: 1; }
@media (hover: none) { .slide-arrow { display: none; } }
.slide-dots { position: absolute; z-index: 4; left: 0; right: 0; bottom: 0.55rem; display: flex; justify-content: center; gap: 5px; pointer-events: none; }
.slide-dots i { width: 6px; height: 6px; border-radius: 50%; background: color-mix(in srgb, #fff 55%, transparent); box-shadow: 0 0 0 1px rgb(0 0 0 / .25); transition: transform .2s, background .2s; }
.slide-dots i.on { background: #fff; transform: scale(1.35); }
.sheet-hero-banner .slide-dots { bottom: 7.2rem; }
.car-box:hover .car-thumb-wrap .car-slides img { transform: none; }
/* ---- galerie du formulaire véhicule ---- */
.adm-gallery { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 0.6rem; }
.adm-thumb { position: relative; width: 96px; height: 64px; border-radius: 8px; overflow: hidden; border: 2px solid var(--stroke-line); background: var(--bg-elevated); }
.adm-thumb.main { border-color: var(--accent); }
.adm-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.adm-thumb-tag, .adm-thumb-first { position: absolute; left: 0; right: 0; bottom: 0; padding: 2px 0; font-size: 0.62rem; font-weight: 800; text-align: center; background: var(--accent); color: var(--on-accent); border: 0; cursor: default; }
.adm-thumb-first { background: color-mix(in srgb, var(--bg-core) 80%, transparent); color: var(--color-ink); cursor: pointer; }
.adm-thumb-del { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; padding: 0; line-height: 1; border-radius: 50%; border: 0; background: rgb(0 0 0 / .65); color: #fff; font-size: 0.95rem; cursor: pointer; }
.adm-gallery-empty { margin: 0; color: var(--color-muted); font-size: 0.85rem; }
.adm-photo-add { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.adm-photo-add input[type="url"] { flex: 1 1 220px; min-width: 0; }
.adm-file-btn { cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.hint-line { font-size: 0.8rem; color: var(--color-muted); min-height: 1em; }
/* ---- tag admin, bouton de grade ---- */
.admin-tag { display: inline-flex; align-items: center; vertical-align: middle; margin-left: 0.4rem; padding: 0.08rem 0.45rem; border-radius: 5px; background: var(--accent); color: var(--on-accent); font-family: var(--font-tech); font-size: 0.62rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; line-height: 1.4; }
.grade-btn { white-space: nowrap; border: 1px solid var(--stroke-line); background: transparent; color: var(--color-ink); border-radius: 8px; padding: 0.35rem 0.7rem; font-size: 0.75rem; font-weight: 700; cursor: pointer; }
.grade-btn.on { border-color: var(--accent); color: var(--accent); }
.mb-sm { margin-bottom: 0.9rem; }
/* ---- voitures de la communauté ---- */
.community-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem; margin-bottom: 1rem; }
.community-tools input { flex: 1 1 240px; min-width: 0; }
.comm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 1rem; }
.comm-car { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--stroke-line); border-radius: 14px; background: var(--bg-surface); overflow: hidden; }
.comm-thumb { flex: none; }
.comm-body { display: flex; flex-direction: column; gap: 0.5rem; padding: 0.9rem 1rem 1rem; min-width: 0; }
.comm-body h3 { margin: 0; font-size: 1.05rem; overflow-wrap: anywhere; }
.comm-meta { font-family: var(--font-tech); font-size: 0.78rem; color: var(--accent); font-weight: 700; }
.comm-desc { margin: 0; font-size: 0.88rem; color: var(--color-secondary); overflow-wrap: anywhere; }
.comm-owner { display: inline-flex; align-items: center; gap: 0.5rem; align-self: flex-start; padding: 0.2rem 0.6rem 0.2rem 0.2rem; border: 1px solid var(--stroke-line); border-radius: 999px; background: transparent; color: var(--color-ink); font-size: 0.8rem; font-weight: 700; cursor: pointer; }
.comm-owner .pilot-row-avatar { width: 24px; height: 24px; }
.comm-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
#pub-profile-cars { margin-top: 1rem; }
#my-cars-list { margin-top: 0.8rem; }
/* registre des pilotes : la ligne se replie proprement sur petit écran */
#pilots-registry-list .telemetry-row { flex-wrap: wrap; }
#pilots-registry-list .pilot-row-left { flex: 1 1 150px; }
#pilots-registry-list .pilot-row-text { min-width: 0; }
#pilots-registry-list .pilot-row-name { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; line-height: 1.5; }
#pilots-registry-list .pilot-row-right { flex: 0 1 auto; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 480px) { #pilots-registry-list .see-profile { display: none; } }

/* ---- menu « Communauté » (style réseau social) ---- */
@media (min-width: 1000px) { #hub-modal { display: none !important; } }

.sheet-approx { margin: -0.75rem 0 1.25rem; font-size: 0.8rem; color: var(--text-muted, #8a8f98); }
