/* ═══════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════ */
* { margin:0; padding:0; box-sizing:border-box; }
body {
  background: #0a0a0a;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  color: #fff;
}

/* ═══════════════════════════════════════
   WRAPPER & PHONE
═══════════════════════════════════════ */
.app-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 24px;
}

.phone {
  width: 390px;
  height: 844px;
  background: #000;
  border-radius: 55px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 40px 120px rgba(0,0,0,0.8), inset 0 0 0 1px rgba(255,255,255,0.08);
}

/* ═══════════════════════════════════════
   STATUS BAR
═══════════════════════════════════════ */
.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px 6px;
  flex-shrink: 0;
}
.status-time { font-size: 15px; font-weight: 700; }
.status-icons { display: flex; align-items: center; gap: 6px; font-size: 11px; }
.batt-icon {
  width: 22px; height: 11px;
  border: 1.5px solid rgba(255,255,255,0.6);
  border-radius: 3px; position: relative; padding: 1.5px;
}
.batt-icon::after {
  content: '';
  position: absolute; right: -4px; top: 50%;
  transform: translateY(-50%);
  width: 2px; height: 5px;
  background: rgba(255,255,255,0.6); border-radius: 1px;
}
.batt-fill { height: 100%; width: 80%; background: #30d158; border-radius: 1px; }

/* ═══════════════════════════════════════
   TECH TOGGLE
═══════════════════════════════════════ */
/* Side buttons group (Tech + AI) */
.side-btns {
  position: fixed;
  left: 50%;
  transform: translateX(calc(-50% + 215px));
  top: 50%;
  margin-top: -130px;
  display: flex; flex-direction: column;
  align-items: center; gap: 8px;
  z-index: 100;
}
.side-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  cursor: pointer; user-select: none;
}
.side-btn-icon {
  width: 44px; height: 44px; border-radius: 14px;
  background: #1a1a1a;
  border: 1px solid rgba(255,255,255,0.12);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; transition: all .2s;
}
.side-btn-icon.active     { background: #f5a623; border-color: #f5a623; }
.side-btn.ai .side-btn-icon.active {
  background: rgba(191,90,242,0.25);
  border-color: #bf5af2;
  box-shadow: 0 0 12px rgba(191,90,242,0.4);
}
.side-btn-label {
  font-size: 8px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: rgba(255,255,255,0.3);
}

@media (max-width: 500px) {
  .side-btns {
    position: fixed;
    left: auto; right: 16px;
    top: auto; bottom: 24px;
    margin-top: 0;
    transform: none;
    flex-direction: column;
    background: rgba(20,20,20,0.96);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 10px 10px;
    gap: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.7);
  }
  .side-btn-icon { width: 36px; height: 36px; font-size: 18px; border-radius: 12px; }
  .side-btn-label { font-size: 7px; }
}

/* ═══════════════════════════════════════
   APP HEADER
═══════════════════════════════════════ */
.app-header {
  display: flex; align-items: center;
  padding: 10px 20px 14px; gap: 12px;
  background: #000; flex-shrink: 0;
  transition: background .4s;
  position: relative;
}
.app-header.tech { background: #1a1200; }

/* LOGO BUTTON & MENU */
.logo-btn-wrap { position: relative; }
.renault-logo-btn {
  background: none; border: none; cursor: pointer;
  padding: 0; display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  transition: background .15s;
}
.renault-logo-btn:active { background: rgba(255,255,255,0.08); }
.renault-logo { width: 32px; height: 32px; object-fit: contain; }

.logo-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: #1c1c1e;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  padding: 6px;
  min-width: 200px;
  z-index: 200;
  opacity: 0;
  transform: scale(0.92) translateY(-6px);
  transform-origin: top left;
  pointer-events: none;
  transition: opacity .18s, transform .18s;
  box-shadow: 0 12px 40px rgba(0,0,0,0.6);
}
.logo-menu.open {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: all;
}
.logo-menu-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-radius: 10px;
  cursor: pointer; font-size: 13px; font-weight: 600;
  transition: background .15s;
}
.logo-menu-item:hover { background: rgba(255,255,255,0.07); }
.logo-menu-item.muted { color: rgba(255,255,255,0.45); }
.logo-menu-icon { font-size: 16px; width: 20px; text-align: center; }
.logo-menu-divider { height: 1px; background: rgba(255,255,255,0.08); margin: 4px 8px; }

.header-center { flex: 1; }
.car-name-h { font-size: 16px; font-weight: 700; }
.car-sub-h  { font-size: 11px; color: rgba(255,255,255,0.4); margin-top: 1px; }

.mode-badge {
  font-size: 9px; font-weight: 800;
  background: #f5a623; color: #000;
  padding: 3px 8px; border-radius: 6px;
  opacity: 0; transition: opacity .3s; letter-spacing: 1px;
}
.mode-badge.visible { opacity: 1; }

/* ═══════════════════════════════════════
   USER VIEW
═══════════════════════════════════════ */
.user-view { display: flex; flex-direction: column; flex: 1; overflow: hidden; }
.user-view.hidden { display: none; }

.scroll-area { flex: 1; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; }
.scroll-area::-webkit-scrollbar { display: none; }

/* Alt views (trips / services) */
.alt-view { flex: 1; overflow: hidden; flex-direction: column; }

/* ── SLIDER ── */
.slider-wrapper { overflow: hidden; }
.slider-track { display: flex; transition: transform .45s cubic-bezier(.4,0,.2,1); }
.slide { min-width: 390px; padding: 0 0 16px; display: flex; flex-direction: column; gap: 16px; }

/* ── CAR HERO ── */
.car-hero {
  position: relative; height: 200px; overflow: hidden;
  background: radial-gradient(ellipse at 60% 50%, color-mix(in srgb, var(--car-color) 30%, transparent), transparent 70%), #0d0d0d;
}
.car-hero-bg {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 60% 50%, color-mix(in srgb, var(--car-color) 20%, transparent), transparent 70%);
}
.car-hero img {
  position: absolute; bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 85%; object-fit: contain;
  filter: drop-shadow(0 10px 30px rgba(0,0,0,0.5));
  transition: transform .3s;
}
.hero-gradient {
  position: absolute; bottom: 0; left: 0; right: 0; height: 60px;
  background: linear-gradient(transparent, #000);
}

/* ── DOTS ── */
.car-dots { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); display: flex; gap: 5px; }
.dot { width: 5px; height: 5px; border-radius: 50%; background: rgba(255,255,255,0.25); cursor: pointer; transition: all .3s; }
.dot.active { background: #fff; width: 14px; border-radius: 3px; }

/* ── WARN BANNER ── */
.warn-banner {
  margin: 0 16px;
  background: rgba(255,69,58,0.12); border: 1px solid rgba(255,69,58,0.3);
  border-radius: 14px; padding: 12px 14px;
  display: flex; align-items: center; gap: 10px; cursor: pointer;
}
.warn-banner-icon { font-size: 20px; }
.warn-banner-text { flex: 1; }
.warn-banner-title { font-size: 13px; font-weight: 700; color: #ff453a; }
.warn-banner-sub   { font-size: 11px; color: rgba(255,255,255,0.5); margin-top: 2px; }
.warn-banner-arrow { color: rgba(255,255,255,0.3); font-size: 14px; }

/* ── DVS CARD ── */
.dvs-card { margin: 0 16px; background: #111; border-radius: 20px; padding: 16px; border: 1px solid rgba(255,255,255,0.06); }
.dvs-inner { display: flex; align-items: center; gap: 16px; }
.dvs-label-title { font-size: 11px; color: rgba(255,255,255,0.4); margin-bottom: 4px; }
.dvs-status-text { font-size: 22px; font-weight: 800; }
.dvs-status-sub  { font-size: 11px; color: rgba(255,255,255,0.4); margin-top: 3px; }

/* ── HEALTH CARDS ── */
.health-card {
  margin: 0 16px; background: #111; border-radius: 16px;
  padding: 14px 16px; border: 1px solid rgba(255,255,255,0.06);
}
.health-card.brake-warn { cursor: pointer; border-color: rgba(255,69,58,0.4); }
.health-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.health-title { font-size: 13px; font-weight: 700; }
.health-pct   { font-size: 13px; font-weight: 800; }
.health-sub   { font-size: 10px; color: rgba(255,255,255,0.35); margin-top: 4px; }
.warn-badge {
  background: rgba(255,69,58,0.15); color: #ff453a;
  border: 1px solid rgba(255,69,58,0.4);
  font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 20px;
  animation: pulse 1.5s infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ── PROGRESS BAR ── */
.prog-bar { height: 5px; background: rgba(255,255,255,0.08); border-radius: 3px; overflow: hidden; }
.prog-fill { height: 100%; border-radius: 3px; transition: width .6s; }

/* ── ENGINE SUB ITEMS ── */
.eng-subs { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.eng-sub  { display: flex; align-items: center; gap: 8px; }
.eng-sub-label { font-size: 11px; color: rgba(255,255,255,0.4); width: 90px; flex-shrink: 0; }
.eng-sub-bar   { flex: 1; height: 3px; background: rgba(255,255,255,0.08); border-radius: 2px; overflow: hidden; }
.eng-sub-fill  { height: 100%; border-radius: 2px; }
.eng-sub-val   { font-size: 10px; color: rgba(255,255,255,0.5); width: 28px; text-align: right; }

/* ── TIRES ── */
.tire-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tire-item { background: rgba(255,255,255,0.04); border-radius: 12px; padding: 10px; display: flex; align-items: center; gap: 8px; }
.tire-icon { font-size: 20px; }
.tire-pos  { font-size: 10px; color: rgba(255,255,255,0.4); }
.tire-val  { font-size: 14px; font-weight: 800; }
.tire-ok   { font-size: 9px; margin-top: 1px; }

/* ── CO2 / BONUS ── */
.stats-row { display: flex; gap: 10px; margin: 0 16px; }
.stat-card { flex: 1; background: #111; border-radius: 16px; padding: 14px; border: 1px solid rgba(255,255,255,0.06); }
.stat-label { font-size: 10px; color: rgba(255,255,255,0.4); margin-bottom: 4px; }
.stat-value { font-size: 20px; font-weight: 800; }
.stat-sub   { font-size: 10px; color: rgba(255,255,255,0.35); margin-top: 2px; }

/* ── TAB BAR ── */
.tab-bar {
  display: flex; border-top: 1px solid rgba(255,255,255,0.07);
  padding: 8px 0 20px; background: rgba(0,0,0,0.95); flex-shrink: 0;
}
.tab-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  cursor: pointer; opacity: .35; transition: opacity .2s;
}
.tab-item.active { opacity: 1; }
.tab-icon  { font-size: 20px; }
.tab-label { font-size: 9px; font-weight: 600; }

/* ═══════════════════════════════════════
   TECH VIEW
═══════════════════════════════════════ */
.tech-view { display: none; flex-direction: column; flex: 1; overflow: hidden; }
.tech-view.active { display: flex; }
.tech-tabs { display: flex; gap: 4px; padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,0.06); flex-shrink: 0; }
.tech-tab { flex: 1; text-align: center; font-size: 10px; font-weight: 700; padding: 7px 4px; border-radius: 8px; cursor: pointer; color: rgba(255,255,255,0.35); transition: all .2s; letter-spacing: .3px; }
.tech-tab.active { background: #f5a623; color: #000; }
.tech-panel { display: none; flex: 1; overflow: hidden; flex-direction: column; }
.tech-panel.active { display: flex; }
.tech-scroll { flex: 1; overflow-y: auto; scrollbar-width: none; padding: 14px; }
.tech-scroll::-webkit-scrollbar { display: none; }

.tc-block { background: #111; border-radius: 16px; padding: 14px; margin-bottom: 10px; border: 1px solid rgba(255,255,255,0.06); }
.tc-title { font-size: 11px; font-weight: 800; color: rgba(255,255,255,0.5); letter-spacing: .8px; text-transform: uppercase; margin-bottom: 12px; }
.session-info-row { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11px; color: rgba(255,255,255,0.6); }
.obd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.obd-cell { background: rgba(255,255,255,0.04); border-radius: 10px; padding: 10px; }
.obd-cell-label { font-size: 9px; color: rgba(255,255,255,0.35); text-transform: uppercase; letter-spacing: .5px; }
.obd-cell-value { font-size: 18px; font-weight: 800; margin: 3px 0; }
.obd-cell-unit  { font-size: 9px; color: rgba(255,255,255,0.35); }
.obd-code { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px; margin-bottom: 6px; }
.active-code  { background: rgba(255,69,58,0.1); border: 1px solid rgba(255,69,58,0.25); }
.archived     { background: rgba(255,255,255,0.04); }
.obd-badge { font-size: 11px; font-weight: 800; padding: 4px 8px; border-radius: 7px; flex-shrink: 0; }
.obd-badge.act  { background: #ff453a; color: #fff; }
.obd-badge.arch { background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.5); }
.obd-name   { font-size: 12px; font-weight: 600; }
.obd-detail { font-size: 10px; color: rgba(255,255,255,0.4); margin-top: 2px; }

.mech-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
.mech-item:last-child { border-bottom: none; }
.mech-icon  { font-size: 18px; width: 28px; text-align: center; }
.mech-info  { flex: 1; }
.mech-name  { font-size: 12px; font-weight: 600; }
.mech-sub   { font-size: 10px; color: rgba(255,255,255,0.35); margin-top: 2px; }
.mech-pct   { font-size: 13px; font-weight: 800; }
.status-ok     { color: #30d158; }
.status-warn   { color: #ffd60a; }
.status-danger { color: #ff453a; }

.serv-list { display: flex; flex-direction: column; gap: 6px; }
.serv-row  { display: flex; align-items: center; gap: 8px; background: #1a1a1a; border-radius: 10px; padding: 10px; cursor: pointer; transition: background .15s; }
.serv-row:hover { background: #222; }
.serv-ico  { font-size: 18px; }
.serv-info { flex: 1; }
.serv-name { font-size: 12px; font-weight: 600; }
.serv-date { font-size: 10px; color: rgba(255,255,255,0.35); margin-top: 1px; }
.serv-badge { font-size: 9px; font-weight: 700; padding: 3px 7px; border-radius: 5px; }
.serv-badge.ok     { background: rgba(47,158,68,0.2);  color: #2f9e44; }
.serv-badge.warn   { background: rgba(245,166,35,0.2); color: #f5a623; }
.serv-badge.danger { background: rgba(224,49,49,0.2);  color: #e03131; }

.hist-list { display: flex; flex-direction: column; }
.hist-item { display: flex; gap: 10px; }
.hist-dot-col { display: flex; flex-direction: column; align-items: center; padding-top: 3px; }
.hist-dot  { width: 10px; height: 10px; border-radius: 50%; background: #f5a623; flex-shrink: 0; }
.hist-line { width: 2px; flex: 1; background: rgba(255,255,255,0.1); margin: 4px 0; }
.hist-body { padding-bottom: 16px; flex: 1; }
.hist-title{ font-size: 13px; font-weight: 700; }
.hist-date { font-size: 10px; color: rgba(255,255,255,0.4); margin: 3px 0 5px; }
.hist-km   { color: #f5a623; }
.hist-items{ display: flex; flex-wrap: wrap; gap: 4px; }
.hist-tag  { font-size: 9px; background: rgba(255,255,255,0.08); border-radius: 5px; padding: 3px 7px; color: rgba(255,255,255,0.6); }

.alert-row { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; margin-bottom: 6px; }
.alert-row.ok     { background: rgba(47,158,68,0.1);  border: 1px solid rgba(47,158,68,0.25); }
.alert-row.danger { background: rgba(224,49,49,0.12); border: 1px solid rgba(224,49,49,0.3); }
.alert-row.warn   { background: rgba(245,166,35,0.1); border: 1px solid rgba(245,166,35,0.25); }
.alert-icon  { font-size: 22px; }
.alert-title { font-size: 12px; font-weight: 700; }
.alert-desc  { font-size: 10px; color: rgba(255,255,255,0.4); margin-top: 2px; }

.export-btns { display: flex; flex-direction: column; gap: 8px; }
.exp-btn {
  background: #1a1a1a; border: 1px solid rgba(255,255,255,0.1);
  color: #fff; border-radius: 12px; padding: 12px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  text-align: left; transition: background .2s;
}
.exp-btn:hover { background: #2a2a2a; }

/* ═══════════════════════════════════════
   WARN POPUP
═══════════════════════════════════════ */
.warn-popup-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.7);
  display: none; z-index: 100;
  align-items: center; justify-content: center;
}
.warn-popup-overlay.open { display: flex; }
.warn-popup { background: #1c1c1e; border-radius: 20px; padding: 28px 24px; margin: 24px; text-align: center; border: 1px solid rgba(255,255,255,0.1); }
.warn-icon-big { font-size: 44px; display: block; margin-bottom: 12px; }
.warn-title { font-size: 18px; font-weight: 800; margin-bottom: 10px; }
.warn-msg   { font-size: 13px; color: rgba(255,255,255,0.6); line-height: 1.5; margin-bottom: 20px; }
.warn-close { background: #f5a623; color: #000; border: none; border-radius: 12px; padding: 12px 32px; font-size: 14px; font-weight: 700; cursor: pointer; width: 100%; }

/* ═══════════════════════════════════════
   EDIT SHEET
═══════════════════════════════════════ */
.edit-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.5); display: none; z-index: 90; }
.edit-overlay.open { display: block; }
.edit-sheet {
  position: absolute; bottom: -100%; left: 0; right: 0;
  background: #1a1a1a; border-radius: 24px 24px 0 0;
  padding: 16px 20px 32px; z-index: 95;
  transition: bottom .35s cubic-bezier(.4,0,.2,1);
  max-height: 85%;
  overflow-y: auto;
}
.edit-sheet.open { bottom: 0; }
.tall-sheet { max-height: 90%; }
.edit-handle { width: 36px; height: 4px; background: rgba(255,255,255,0.2); border-radius: 2px; margin: 0 auto 16px; flex-shrink: 0; }
.edit-title { font-size: 17px; font-weight: 800; margin-bottom: 16px; }
.field-group { margin-bottom: 12px; }
.field-group label { font-size: 11px; color: rgba(255,255,255,0.4); display: block; margin-bottom: 4px; }
.field-group input {
  width: 100%; background: #111;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px; padding: 10px 12px;
  color: #fff; font-size: 14px; outline: none;
}
.edit-actions { display: flex; gap: 10px; margin-top: 16px; }
.btn-cancel { background: #2a2a2a; color: #fff; border: none; border-radius: 12px; padding: 13px 20px; font-size: 14px; font-weight: 600; cursor: pointer; }
.btn-apply  { flex: 1; background: #f5a623; color: #000; border: none; border-radius: 12px; padding: 13px; font-size: 14px; font-weight: 700; cursor: pointer; }

/* ═══════════════════════════════════════
   TRIPS / HABITUDES DE CONDUITE
═══════════════════════════════════════ */
.trips-scroll {
  flex: 1; overflow-y: auto; scrollbar-width: none;
  padding: 14px 14px 0;
  display: flex; flex-direction: column; gap: 12px;
}
.trips-scroll::-webkit-scrollbar { display: none; }

.trips-header-block { margin-bottom: 2px; }
.trips-title { font-size: 18px; font-weight: 800; }
.trips-sub   { font-size: 11px; color: rgba(255,255,255,0.4); margin-top: 3px; }

/* Weekly stats */
.weekly-stats-row { display: flex; gap: 0; margin-bottom: 14px; }
.weekly-stat { flex: 1; text-align: center; }
.ws-val { font-size: 16px; font-weight: 800; }
.ws-lbl { font-size: 9px; color: rgba(255,255,255,0.35); margin-top: 2px; }

/* Bar chart */
.bar-chart { display: flex; align-items: flex-end; gap: 6px; height: 110px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.bar-wrap { flex: 1; display: flex; align-items: flex-end; width: 100%; justify-content: center; }
.bar-fill { width: 100%; min-height: 4px; border-radius: 4px 4px 0 0; transition: height .4s ease; }
.bar-label { font-size: 9px; color: rgba(255,255,255,0.4); }
.bar-km    { font-size: 8px; color: rgba(255,255,255,0.3); white-space: nowrap; }

/* IA Promo */
.ia-profile-promo {
  background: linear-gradient(135deg, rgba(10,132,255,0.15), rgba(10,132,255,0.05));
  border: 1px solid rgba(10,132,255,0.3);
  border-radius: 16px; padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  cursor: pointer; transition: background .2s;
}
.ia-profile-promo:hover { background: rgba(10,132,255,0.2); }
.ia-promo-icon { font-size: 28px; }
.ia-promo-text { flex: 1; }
.ia-promo-title { font-size: 14px; font-weight: 700; color: #0a84ff; }
.ia-promo-sub   { font-size: 11px; color: rgba(255,255,255,0.5); margin-top: 3px; line-height: 1.4; }
.ia-promo-arrow { color: rgba(255,255,255,0.3); font-size: 18px; }

/* Recent trips */
.trip-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
.trip-row:last-child { border-bottom: none; }
.trip-mode { font-size: 18px; width: 28px; text-align: center; }
.trip-info { flex: 1; }
.trip-route { font-size: 12px; font-weight: 600; }
.trip-meta  { font-size: 10px; color: rgba(255,255,255,0.4); margin-top: 2px; }
.trip-score { font-size: 15px; font-weight: 800; }

/* Profile card (after form) */
.profile-card {
  background: #111; border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px; padding: 16px;
  position: relative; overflow: hidden;
}
.profile-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--profile-color);
}
.profile-card-top { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.profile-icon-big { font-size: 32px; }
.profile-card-info { flex: 1; }
.profile-badge-lbl { display: inline-block; font-size: 9px; font-weight: 700; padding: 3px 8px; border-radius: 6px; margin-bottom: 4px; }
.profile-name { font-size: 16px; font-weight: 800; }
.profile-edit-btn { background: rgba(255,255,255,0.08); border: none; color: #fff; border-radius: 10px; padding: 8px 12px; cursor: pointer; font-size: 14px; }
.profile-desc { font-size: 12px; color: rgba(255,255,255,0.55); line-height: 1.5; margin-bottom: 14px; }
.profile-traits { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.profile-trait { display: flex; align-items: center; gap: 8px; }
.profile-trait-label { font-size: 10px; color: rgba(255,255,255,0.4); width: 110px; flex-shrink: 0; }
.profile-trait-bar { flex: 1; height: 3px; background: rgba(255,255,255,0.08); border-radius: 2px; overflow: hidden; }
.profile-trait-fill { height: 100%; border-radius: 2px; transition: width .6s; }
.profile-trait-val  { font-size: 10px; font-weight: 700; width: 28px; text-align: right; }
.profile-tip { font-size: 11px; color: rgba(255,255,255,0.5); background: rgba(255,255,255,0.04); border-radius: 10px; padding: 10px 12px; line-height: 1.5; }

/* ═══════════════════════════════════════
   DRIVING FORM
═══════════════════════════════════════ */
.df-progress-wrap { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.df-progress-bar { flex: 1; height: 3px; background: rgba(255,255,255,0.1); border-radius: 2px; overflow: hidden; }
.df-progress-fill { height: 100%; background: #f5a623; border-radius: 2px; transition: width .3s; }
.df-step-label { font-size: 10px; color: rgba(255,255,255,0.35); white-space: nowrap; }

.df-question { font-size: 15px; font-weight: 700; line-height: 1.4; margin-bottom: 16px; }

.df-options { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.df-option {
  display: flex; align-items: center; gap: 12px;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px; padding: 13px 14px;
  cursor: pointer; transition: all .15s;
  font-size: 13px;
}
.df-option:hover { background: rgba(255,255,255,0.08); }
.df-option.selected { background: rgba(245,166,35,0.12); border-color: rgba(245,166,35,0.4); }
.df-opt-radio { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.2); flex-shrink: 0; transition: all .15s; }
.df-opt-radio.checked { background: #f5a623; border-color: #f5a623; box-shadow: 0 0 0 3px rgba(245,166,35,0.2); }

.df-nav { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.df-btn-back { background: rgba(255,255,255,0.08); border: none; color: rgba(255,255,255,0.6); border-radius: 12px; padding: 12px 18px; font-size: 13px; font-weight: 600; cursor: pointer; }
.df-btn-next {
  flex: 1; background: #f5a623; color: #000;
  border: none; border-radius: 12px; padding: 13px;
  font-size: 14px; font-weight: 700; cursor: pointer;
  transition: opacity .2s;
}
.df-btn-next.disabled { opacity: 0.35; pointer-events: none; }

/* Result screen */
.df-result { text-align: center; padding: 10px 0 20px; }
.df-result-icon { font-size: 56px; display: block; margin-bottom: 12px; }
.df-result-title { font-size: 12px; color: rgba(255,255,255,0.4); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.df-result-name { font-size: 24px; font-weight: 800; margin-bottom: 10px; }
.df-result-desc { font-size: 13px; color: rgba(255,255,255,0.55); line-height: 1.5; margin-bottom: 14px; }
.df-result-badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 5px 14px; border-radius: 20px; margin-bottom: 20px; }
.df-btn-confirm { width: 100%; background: #f5a623; color: #000; border: none; border-radius: 14px; padding: 14px; font-size: 14px; font-weight: 700; cursor: pointer; }

/* ═══════════════════════════════════════
   ADD CAR FORM
═══════════════════════════════════════ */
.ac-step-title { font-size: 15px; font-weight: 700; margin-bottom: 16px; }
.ac-step-body  { display: flex; flex-direction: column; gap: 14px; margin-bottom: 20px; }

.ac-field label { font-size: 11px; color: rgba(255,255,255,0.4); display: block; margin-bottom: 6px; }
.ac-field input {
  width: 100%; background: #111; border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px; padding: 11px 14px; color: #fff; font-size: 14px; outline: none;
}
.ac-field input:focus { border-color: rgba(245,166,35,0.5); }

.ac-colors { display: flex; gap: 8px; flex-wrap: wrap; }
.ac-color-swatch {
  width: 28px; height: 28px; border-radius: 50%; cursor: pointer;
  border: 2px solid transparent; transition: all .15s;
}
.ac-color-swatch.selected { border-color: #fff; transform: scale(1.2); }

.ac-slider-group label { font-size: 11px; color: rgba(255,255,255,0.4); display: flex; justify-content: space-between; margin-bottom: 8px; }
.ac-slider-group label span { color: #f5a623; font-weight: 700; }
.ac-range {
  width: 100%; -webkit-appearance: none; height: 4px;
  background: rgba(255,255,255,0.12); border-radius: 2px; outline: none;
}
.ac-range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px;
  border-radius: 50%; background: #f5a623; cursor: pointer;
}

.ac-checks { display: flex; flex-direction: column; gap: 8px; }
.ac-check-row {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px; padding: 11px 14px; cursor: pointer; transition: all .15s;
  font-size: 13px;
}
.ac-check-row.checked { background: rgba(255,69,58,0.08); border-color: rgba(255,69,58,0.3); }
.ac-check-box { font-size: 16px; }
.ac-check-tick { margin-left: auto; font-size: 14px; color: #ff453a; font-weight: 800; width: 16px; text-align: center; }

.ac-driving-intro { font-size: 13px; color: rgba(255,255,255,0.5); margin-bottom: 14px; line-height: 1.4; }
.ac-profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ac-profile-card {
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px; padding: 14px 10px; text-align: center;
  cursor: pointer; transition: all .15s;
}
.ac-profile-card:hover { background: rgba(255,255,255,0.07); }
.ac-profile-card.selected { background: rgba(var(--pc-r,245),var(--pc-g,166),var(--pc-b,35),0.12); border-color: var(--pc); }
.ac-profile-card.selected { border-color: var(--pc); box-shadow: 0 0 0 2px var(--pc)40; }
.ac-profile-icon { font-size: 26px; margin-bottom: 6px; }
.ac-profile-name { font-size: 11px; font-weight: 700; line-height: 1.3; }

/* ═══════════════════════════════════════
   SERVICES TAB
═══════════════════════════════════════ */
.services-scroll {
  flex: 1; overflow-y: auto; scrollbar-width: none;
  padding: 14px; display: flex; flex-direction: column; gap: 12px;
}
.services-scroll::-webkit-scrollbar { display: none; }
.services-header { margin-bottom: 2px; }
.services-title { font-size: 18px; font-weight: 800; }
.services-sub   { font-size: 11px; color: rgba(255,255,255,0.4); margin-top: 3px; }

/* Garage card */
.garage-card {
  background: #111; border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px; padding: 16px;
  display: flex; gap: 14px; align-items: flex-start;
}
.garage-logo-wrap { flex-shrink: 0; }
.garage-logo { width: 44px; height: 44px; background: rgba(245,166,35,0.15); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.garage-info { flex: 1; }
.garage-name { font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.garage-addr { font-size: 10px; color: rgba(255,255,255,0.4); margin-bottom: 3px; }
.garage-hours { font-size: 10px; color: rgba(255,255,255,0.4); margin-bottom: 6px; }
.garage-status { font-size: 10px; font-weight: 700; }
.garage-status.open { color: #30d158; }

/* Contact buttons */
.contact-actions { display: flex; flex-direction: column; gap: 8px; }
.contact-btn {
  background: #111; border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px; padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  cursor: pointer; text-decoration: none; color: #fff;
  transition: background .15s;
}
.contact-btn:hover { background: #1a1a1a; }
.contact-btn.primary { background: rgba(245,166,35,0.1); border-color: rgba(245,166,35,0.3); }
.contact-btn-icon { font-size: 22px; }
.contact-btn-text { flex: 1; }
.contact-btn-label { font-size: 13px; font-weight: 700; }
.contact-btn-sub   { font-size: 10px; color: rgba(255,255,255,0.4); margin-top: 2px; }
.contact-btn-arrow { color: rgba(255,255,255,0.3); font-size: 16px; }

/* Appointment card */
.appt-card {
  display: flex; align-items: center; gap: 14px;
  background: rgba(255,255,255,0.03); border-radius: 12px;
  padding: 12px; margin-bottom: 12px;
}
.appt-date { text-align: center; background: #f5a623; color: #000; border-radius: 10px; padding: 6px 10px; flex-shrink: 0; }
.appt-day  { font-size: 20px; font-weight: 800; line-height: 1; }
.appt-month{ font-size: 8px; font-weight: 700; text-transform: uppercase; }
.appt-info { flex: 1; }
.appt-title { font-size: 12px; font-weight: 700; }
.appt-time  { font-size: 10px; color: rgba(255,255,255,0.4); margin-top: 3px; }
.appt-tech  { font-size: 10px; color: rgba(255,255,255,0.4); margin-top: 2px; }
.appt-status { font-size: 9px; font-weight: 700; padding: 4px 8px; border-radius: 6px; flex-shrink: 0; }
.appt-status.confirmed { background: rgba(48,209,88,0.15); color: #30d158; }
.appt-modify-btn {
  width: 100%; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.7); border-radius: 10px; padding: 10px;
  font-size: 12px; font-weight: 600; cursor: pointer;
}

/* Chat box */
.chat-box {
  background: #111; border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px; padding: 14px;
}
.chat-box-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 20px; }
.chat-box-title { font-size: 13px; font-weight: 700; }
.chat-box-sub   { font-size: 10px; color: rgba(255,255,255,0.4); margin-top: 2px; }
.chat-input {
  width: 100%; background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px; padding: 10px 12px;
  color: #fff; font-size: 13px;
  outline: none; resize: none;
  font-family: inherit; line-height: 1.5;
  margin-bottom: 10px;
}
.chat-input:focus { border-color: rgba(245,166,35,0.4); }
.chat-send-btn {
  width: 100%; background: #f5a623; color: #000;
  border: none; border-radius: 12px; padding: 12px;
  font-size: 13px; font-weight: 700; cursor: pointer;
}

/* ═══════════════════════════════════════
   PROFILE BANNER (top of Conduite tab)
═══════════════════════════════════════ */
.profile-banner {
  background: linear-gradient(135deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.1);
  border-left: 3px solid var(--pb-color, #f5a623);
  border-radius: 16px;
  padding: 12px 14px;
  display: flex; align-items: center; gap: 12px;
  cursor: pointer; margin-bottom: 4px;
  transition: background .15s;
}
.profile-banner:hover { background: rgba(255,255,255,0.07); }
.pb-icon { font-size: 26px; }
.pb-info { flex: 1; }
.pb-label { font-size: 9px; color: rgba(255,255,255,0.35); text-transform: uppercase; letter-spacing: .8px; }
.pb-name  { font-size: 14px; font-weight: 700; margin-top: 2px; }
.pb-score { font-size: 20px; font-weight: 800; }
.pb-score span { font-size: 11px; color: rgba(255,255,255,0.4); }
.pb-edit { font-size: 14px; color: rgba(255,255,255,0.25); padding: 6px; }

/* ═══════════════════════════════════════
   ADVANCED STATS
═══════════════════════════════════════ */
.adv-stat-row { display: flex; gap: 8px; margin-bottom: 14px; }
.adv-stat-card {
  flex: 1; background: rgba(255,255,255,0.04);
  border-radius: 12px; padding: 10px 8px; text-align: center;
}
.adv-stat-icon { font-size: 16px; margin-bottom: 4px; }
.adv-stat-val  { font-size: 16px; font-weight: 800; }
.adv-stat-val span { font-size: 9px; color: rgba(255,255,255,0.4); font-weight: 400; }
.adv-stat-lbl  { font-size: 9px; color: rgba(255,255,255,0.35); margin-top: 2px; }

/* Consumption mini-chart */
.conso-chart-wrap { margin-bottom: 14px; }
.conso-chart-label { font-size: 9px; color: rgba(255,255,255,0.35); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; }
.conso-bars { display: flex; align-items: flex-end; gap: 4px; height: 65px; }
.conso-col  { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; height: 100%; justify-content: flex-end; }
.conso-bar-wrap { flex: 1; display: flex; align-items: flex-end; width: 100%; justify-content: center; }
.conso-bar-fill { width: 100%; min-height: 0; border-radius: 3px 3px 0 0; transition: height .4s; }
.conso-lbl  { font-size: 8px; color: rgba(255,255,255,0.3); }
.conso-ev-note { font-size: 11px; color: rgba(255,255,255,0.35); background: rgba(10,132,255,0.08); border-radius: 10px; padding: 10px 12px; margin-bottom: 14px; }

/* Score line chart */
.score-chart-wrap { margin-bottom: 4px; }
.score-chart-labels { display: flex; justify-content: space-between; margin-top: 4px; }
.score-chart-labels span { font-size: 8px; color: rgba(255,255,255,0.3); flex: 1; text-align: center; }

/* ═══════════════════════════════════════
   BEHAVIOR COMPARISON
═══════════════════════════════════════ */
.behavior-row { margin-bottom: 14px; }
.behavior-row:last-child { margin-bottom: 0; }
.beh-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.beh-icon  { font-size: 14px; }
.beh-label { flex: 1; font-size: 12px; font-weight: 600; }
.beh-val   { font-size: 13px; font-weight: 800; }
.beh-bars  { display: flex; flex-direction: column; gap: 3px; }
.beh-bar-wrap { height: 5px; background: rgba(255,255,255,0.06); border-radius: 3px; overflow: hidden; }
.beh-bar-wrap.peer { height: 3px; }
.beh-bar-fill { height: 100%; border-radius: 3px; transition: width .6s; }
.beh-compare { font-size: 10px; margin-top: 4px; font-weight: 600; }
.beh-compare.above { color: #30d158; }
.beh-compare.below { color: #ff453a; }
.peer-legend { display: flex; align-items: center; gap: 6px; margin-top: 12px; font-size: 10px; color: rgba(255,255,255,0.35); }
.peer-you  { width: 16px; height: 4px; background: #30d158; border-radius: 2px; }
.peer-avg  { width: 16px; height: 3px; background: rgba(255,255,255,0.2); border-radius: 2px; }

/* ═══════════════════════════════════════
   CONSEILS IA
═══════════════════════════════════════ */
.conseil-row {
  display: flex; gap: 12px; padding: 12px;
  border-radius: 12px; margin-bottom: 8px;
  border: 1px solid transparent;
}
.conseil-row:last-child { margin-bottom: 0; }
.conseil-row.ok      { background: rgba(48,209,88,0.08);  border-color: rgba(48,209,88,0.2); }
.conseil-row.info    { background: rgba(10,132,255,0.08); border-color: rgba(10,132,255,0.2); }
.conseil-row.warn    { background: rgba(255,214,10,0.08); border-color: rgba(255,214,10,0.2); }
.conseil-row.danger  { background: rgba(255,69,58,0.08);  border-color: rgba(255,69,58,0.25); }
.conseil-icon  { font-size: 20px; flex-shrink: 0; padding-top: 1px; }
.conseil-titre { font-size: 12px; font-weight: 700; margin-bottom: 4px; }
.conseil-msg   { font-size: 11px; color: rgba(255,255,255,0.55); line-height: 1.5; }

/* ═══════════════════════════════════════
   RE-FACTORY FLINS
═══════════════════════════════════════ */
.refactory-block {
  border-color: rgba(245,166,35,0.25) !important;
  background: linear-gradient(135deg, #111 0%, #140f00 100%) !important;
}
.refactory-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.refactory-logo { display: flex; align-items: baseline; gap: 0; font-size: 18px; font-weight: 900; letter-spacing: -0.5px; }
.refactory-r { color: #f5a623; }
.refactory-f { color: #fff; }
.refactory-location { font-size: 10px; color: rgba(255,255,255,0.35); }
.refactory-subtitle { font-size: 10px; color: rgba(255,255,255,0.35); margin-bottom: 14px; }

.dvs-req-banner {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px; padding: 10px 14px;
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
}
.dvs-req-label  { font-size: 10px; color: rgba(255,255,255,0.4); flex: 1; }
.dvs-req-score  { font-size: 18px; font-weight: 800; }
.dvs-req-status { font-size: 9px; font-weight: 700; }

.refactory-parts-title { font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.4); text-transform: uppercase; letter-spacing: .8px; margin-bottom: 8px; }

.rf-part-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px; border-radius: 10px; margin-bottom: 6px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  transition: background .15s;
}
.rf-part-row.ineligible { opacity: 0.55; }
.rf-part-main { flex: 1; }
.rf-part-ref  { font-size: 8px; color: rgba(255,255,255,0.3); font-family: monospace; margin-bottom: 3px; letter-spacing: .5px; }
.rf-part-name { font-size: 12px; font-weight: 600; margin-bottom: 3px; }
.rf-part-dvs  { font-size: 10px; color: rgba(255,255,255,0.35); }
.rf-part-right { text-align: right; flex-shrink: 0; }
.rf-stock { font-size: 11px; font-weight: 700; margin-bottom: 3px; }
.rf-stock.ok  { color: #30d158; }
.rf-stock.low { color: #ffd60a; }
.rf-stock.out { color: #ff453a; }
.rf-eta { font-size: 9px; color: rgba(255,255,255,0.35); }
.rf-ineligible-badge { font-size: 8px; font-weight: 700; color: #ff453a; background: rgba(255,69,58,0.1); border-radius: 5px; padding: 2px 6px; margin-top: 4px; }
.rf-empty { font-size: 12px; color: rgba(255,255,255,0.3); text-align: center; padding: 14px 0; }

.refactory-live {
  display: flex; align-items: center; gap: 6px;
  font-size: 10px; color: rgba(255,255,255,0.35);
  margin: 10px 0 12px; 
}
.live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #30d158;
  box-shadow: 0 0 6px #30d158;
  animation: livepulse 2s infinite;
}
@keyframes livepulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
.live-time { margin-left: auto; font-size: 9px; }

.refactory-link-btn {
  width: 100%; background: rgba(245,166,35,0.1);
  border: 1px solid rgba(245,166,35,0.3);
  color: #f5a623; border-radius: 12px; padding: 12px;
  font-size: 13px; font-weight: 700; cursor: pointer;
  text-align: center; transition: background .2s;
}
.refactory-link-btn:hover { background: rgba(245,166,35,0.2); }

/* ═══════════════════════════════════════
   REPAIR PRICE ESTIMATE
═══════════════════════════════════════ */
.repair-estimate {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
}
.repair-estimate.urgent {
  background: rgba(255,69,58,0.07);
  border-color: rgba(255,69,58,0.2);
}
.repair-estimate.info {
  background: rgba(255,214,10,0.06);
  border-color: rgba(255,214,10,0.15);
}
.repair-icon {
  font-size: 16px;
  flex-shrink: 0;
}
.repair-body {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex: 1;
  gap: 8px;
}
.repair-label {
  font-size: 10px;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  letter-spacing: .5px;
  white-space: nowrap;
}
.repair-price {
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
}
.repair-estimate.urgent .repair-price { color: #ff6b60; }
.repair-estimate.info   .repair-price { color: #ffd60a; }

/* ═══════════════════════════════════════
   COMMUNITY TAB
═══════════════════════════════════════ */
.comm-scroll {
  flex: 1; overflow-y: auto; padding: 14px 16px 0;
  display: flex; flex-direction: column; gap: 0;
}
.comm-header { margin-bottom: 16px; }
.comm-title  { font-size: 20px; font-weight: 800; margin-bottom: 2px; }
.comm-sub    { font-size: 11px; color: rgba(255,255,255,0.35); margin-bottom: 12px; }

.comm-global-stats {
  display: flex; gap: 8px; margin-bottom: 12px;
}
.cgs-item {
  flex: 1; background: rgba(255,255,255,0.05);
  border-radius: 12px; padding: 10px 8px; text-align: center;
}
.cgs-val { font-size: 18px; font-weight: 800; }
.cgs-lbl { font-size: 9px; color: rgba(255,255,255,0.35); margin-top: 2px; text-transform: uppercase; letter-spacing: .5px; }

.comm-your-profile {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; color: rgba(255,255,255,0.4);
  margin-bottom: 4px;
}
.comm-profile-badge {
  font-size: 11px; font-weight: 700;
  padding: 3px 10px; border-radius: 20px;
}

/* Cards */
.comm-cards { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }

.comm-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px; overflow: hidden;
  cursor: pointer; transition: background .15s;
  border-left: 3px solid var(--cc, #fff);
}
.comm-card.my-profile {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.15);
}
.comm-card.open { background: rgba(255,255,255,0.06); }

.comm-card-top {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px 8px;
}
.comm-card-icon  { font-size: 24px; flex-shrink: 0; }
.comm-card-info  { flex: 1; }
.comm-card-name  { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.comm-card-tagline { font-size: 10px; color: rgba(255,255,255,0.35); margin-top: 2px; }
.comm-card-right { text-align: right; flex-shrink: 0; }
.comm-card-score   { font-size: 18px; font-weight: 800; }
.comm-card-members { font-size: 9px; color: rgba(255,255,255,0.3); margin-top: 2px; }
.comm-card-chevron { font-size: 9px; color: rgba(255,255,255,0.25); margin-left: 4px; flex-shrink: 0; transition: transform .2s; }

.comm-you-badge {
  font-size: 9px; font-weight: 800; text-transform: uppercase;
  background: var(--cc); color: #000;
  padding: 2px 6px; border-radius: 6px; letter-spacing: .5px;
}

/* Share bar */
.comm-share-bar {
  height: 3px; background: rgba(255,255,255,0.06);
  margin: 0 14px 12px; border-radius: 2px; position: relative;
}
.comm-share-fill {
  height: 100%; border-radius: 2px; transition: width .6s;
}
.comm-share-pct {
  position: absolute; right: 0; top: 6px;
  font-size: 8px; color: rgba(255,255,255,0.25);
}

/* Detail panel */
.comm-detail { padding: 0 14px 14px; border-top: 1px solid rgba(255,255,255,0.06); margin-top: 4px; }
.comm-desc   { font-size: 11px; color: rgba(255,255,255,0.5); line-height: 1.5; padding: 10px 0 12px; }

.comm-stats-title, .comm-tips-title, .comm-badges-title, .comm-leaders-title {
  font-size: 9px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .8px; color: rgba(255,255,255,0.3);
  margin: 10px 0 8px;
}
.comm-stat-row {
  display: flex; align-items: center; gap: 8px; margin-bottom: 7px;
}
.comm-stat-label { font-size: 10px; flex: 1; color: rgba(255,255,255,0.6); }
.comm-stat-bar   { width: 70px; height: 4px; background: rgba(255,255,255,0.08); border-radius: 2px; overflow: hidden; flex-shrink: 0; }
.comm-stat-fill  { height: 100%; border-radius: 2px; transition: width .5s; }
.comm-stat-val   { font-size: 11px; font-weight: 700; width: 28px; text-align: right; flex-shrink: 0; }

.comm-tip-row {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 11px; color: rgba(255,255,255,0.5); line-height: 1.45;
  margin-bottom: 6px;
}
.comm-tip-dot {
  width: 5px; height: 5px; border-radius: 50%;
  flex-shrink: 0; margin-top: 4px;
}

.comm-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.comm-badge  {
  font-size: 10px; font-weight: 600;
  padding: 4px 10px; border-radius: 20px;
  border: 1px solid; background: transparent;
}

.comm-leader-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.05);
}
.comm-leader-row:last-child { border-bottom: none; }
.comm-leader-rank   { font-size: 14px; font-weight: 900; width: 24px; text-align: center; flex-shrink: 0; }
.comm-leader-info   { flex: 1; }
.comm-leader-name   { font-size: 12px; font-weight: 600; }
.comm-leader-city   { font-size: 10px; color: rgba(255,255,255,0.35); margin-top: 1px; }
.comm-leader-score  { font-size: 18px; font-weight: 800; flex-shrink: 0; }

/* AI note */
.comm-ai-note {
  display: flex; gap: 10px; align-items: flex-start;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px; padding: 12px; margin-bottom: 14px;
}
.comm-ai-icon { font-size: 18px; flex-shrink: 0; }
.comm-ai-text { font-size: 10px; color: rgba(255,255,255,0.3); line-height: 1.5; }

/* ═══════════════════════════════════════
   AI TOGGLE BUTTON
═══════════════════════════════════════ */
/* ai-toggle merged into .side-btns */

/* ═══════════════════════════════════════
   AI ANALYSIS VIEW
═══════════════════════════════════════ */
.ai-view {
  position: absolute; inset: 0;
  background: #0a0a0f;
  display: none; flex-direction: column;
  z-index: 20;
  border-radius: 44px;
  overflow: hidden;
}
.ai-view.active { display: flex; }

.ai-scroll {
  flex: 1; overflow-y: auto; padding: 20px 16px 0;
  scrollbar-width: none;
}
.ai-scroll::-webkit-scrollbar { display: none; }

/* Header */
.ai-header { margin-bottom: 16px; }
.ai-title { font-size: 22px; font-weight: 900; margin-bottom: 2px; }
.ai-sub   { font-size: 11px; color: rgba(255,255,255,0.35); margin-bottom: 10px; }
.ai-badge-row { display: flex; align-items: center; gap: 10px; }
.ai-verdict-badge {
  font-size: 12px; font-weight: 700;
  padding: 5px 12px; border-radius: 20px;
}
.ai-scan-time { font-size: 9px; color: rgba(255,255,255,0.25); }

/* Sections */
.ai-section {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 16px; padding: 14px;
  margin-bottom: 10px;
}
.ai-section-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .8px; color: rgba(255,255,255,0.4);
  margin-bottom: 12px;
}

/* Driving profile row */
.ai-profile-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; background: rgba(255,255,255,0.04);
  border-radius: 12px;
}
.ai-profile-icon  { font-size: 26px; flex-shrink: 0; }
.ai-profile-body  { flex: 1; }
.ai-profile-name  { font-size: 14px; font-weight: 700; margin-bottom: 3px; }
.ai-profile-desc  { font-size: 10px; color: rgba(255,255,255,0.4); line-height: 1.4; }
.ai-profile-score { font-size: 22px; font-weight: 900; flex-shrink: 0; }
.ai-profile-score span { font-size: 10px; color: rgba(255,255,255,0.3); }
.ai-no-profile {
  font-size: 12px; color: rgba(255,255,255,0.35);
  padding: 12px; background: rgba(255,255,255,0.03);
  border-radius: 12px; cursor: pointer; text-align: center;
  border: 1px dashed rgba(255,255,255,0.1);
}

/* Behaviour grid */
.ai-beh-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.ai-beh-card {
  background: rgba(255,255,255,0.04); border-radius: 12px;
  padding: 10px 8px; text-align: center;
}
.ai-beh-icon  { font-size: 16px; margin-bottom: 4px; }
.ai-beh-val   { font-size: 15px; font-weight: 800; }
.ai-beh-label { font-size: 9px; color: rgba(255,255,255,0.35); margin-top: 3px; line-height: 1.2; }

/* OBD grid */
.ai-obd-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.ai-obd-card {
  background: rgba(255,255,255,0.04); border-radius: 12px;
  padding: 10px 8px; text-align: center; position: relative;
}
.ai-obd-icon  { font-size: 14px; margin-bottom: 4px; }
.ai-obd-val   { font-size: 13px; font-weight: 800; }
.ai-obd-val span { font-size: 8px; color: rgba(255,255,255,0.3); font-weight: 400; }
.ai-obd-label { font-size: 9px; color: rgba(255,255,255,0.35); margin-top: 3px; }
.ai-obd-dot   {
  position: absolute; top: 7px; right: 7px;
  width: 5px; height: 5px; border-radius: 50%;
}

/* Findings */
.ai-finding {
  border-radius: 12px; padding: 11px 12px;
  margin-bottom: 8px; border: 1px solid transparent;
}
.ai-finding:last-child { margin-bottom: 0; }
.ai-finding.ok     { background: rgba(48,209,88,0.06);  border-color: rgba(48,209,88,0.2); }
.ai-finding.warn   { background: rgba(255,214,10,0.06); border-color: rgba(255,214,10,0.2); }
.ai-finding.danger { background: rgba(255,69,58,0.07);  border-color: rgba(255,69,58,0.25); }
.ai-finding-head {
  display: flex; align-items: center; gap: 8px; margin-bottom: 5px;
}
.ai-finding-icon  { font-size: 14px; flex-shrink: 0; }
.ai-finding-title { font-size: 12px; font-weight: 700; flex: 1; }
.ai-finding-dot   { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.sev-ok    .ai-finding-dot, .ai-finding-dot.sev-ok     { background: #30d158; }
.sev-warn  .ai-finding-dot, .ai-finding-dot.sev-warn   { background: #ffd60a; }
.sev-danger .ai-finding-dot, .ai-finding-dot.sev-danger { background: #ff453a; }
.ai-finding-detail { font-size: 11px; color: rgba(255,255,255,0.45); line-height: 1.5; }

/* Predictive */
.ai-pred-list { display: flex; flex-direction: column; gap: 0; }
.ai-pred-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.ai-pred-row:last-child { border-bottom: none; }
.ai-pred-icon  { font-size: 16px; flex-shrink: 0; }
.ai-pred-label { flex: 1; font-size: 12px; color: rgba(255,255,255,0.6); }
.ai-pred-val   { font-size: 12px; font-weight: 700; color: rgba(255,255,255,0.8); }
.ai-pred-val.urgent { color: #ff453a; }

/* Disclaimer */
.ai-disclaimer {
  font-size: 9px; color: rgba(255,255,255,0.2);
  line-height: 1.5; padding: 12px;
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 10px; margin-bottom: 10px;
  text-align: center;
}

/* Re-Factory origin label */
.rf-part-origin {
  font-size: 9px; color: rgba(255,255,255,0.3);
  margin-top: 2px;
}

/* AI category row in header */
.ai-category-row {
  display: flex; align-items: center; gap: 8px;
  margin-top: 10px;
}
.ai-cat-label {
  font-size: 10px; color: rgba(255,255,255,0.3);
  text-transform: uppercase; letter-spacing: .6px;
  white-space: nowrap;
}
.ai-cat-badge {
  font-size: 12px; font-weight: 700;
  padding: 4px 12px; border-radius: 20px;
  border: 1px solid;
}
.ai-cat-badge.unset {
  font-size: 10px; font-weight: 500;
  color: rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.1);
}

/* No fault code state */
.obd-code.no-code {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: rgba(255,255,255,0.3);
  padding: 10px 4px;
}