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

/* Protège l'attribut HTML `hidden` contre les overrides CSS display */
[hidden] { display: none !important; }

:root {
  --bg: #f5f7fb;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-strong: #ffffff;
  --panel-alt: #f9fbff;
  --text: #18202a;
  --muted: #667085;
  --line: #e6ebf2;
  --primary: #1f6fff;
  --primary-strong: #4d8cff;
  --primary-soft: #e8f0ff;
  --primary-border: rgba(31, 111, 255, 0.45);
  --primary-ring: rgba(31, 111, 255, 0.1);
  --primary-shadow: rgba(31, 111, 255, 0.26);
  --page-glow: rgba(31, 111, 255, 0.1);
  --hero-glow: rgba(31, 111, 255, 0.14);
  --success: #0f9f6e;
  --success-soft: #e8f8f1;
  --warning: #c77d00;
  --warning-soft: #fff5e6;
  --danger: #d92d20;
  --danger-soft: #fff0ef;
  --shadow: 0 18px 50px rgba(16, 24, 40, 0.08);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --max: 1180px;
}

/* ── Densité adaptive : variables pour mobile/PWA ── */
@media (max-width: 680px) {
  :root {
    --spacing-lg: 12px;
    --spacing-md: 10px;
    --spacing-sm: 6px;
    --input-pad-v: 12px;
    --input-pad-h: 12px;
  }
}

@media (min-width: 681px) {
  :root {
    --spacing-lg: 24px;
    --spacing-md: 14px;
    --spacing-sm: 8px;
    --input-pad-v: 15px;
    --input-pad-h: 15px;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: 'Manrope', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, var(--page-glow), transparent 28%),
    radial-gradient(circle at 85% 10%, rgba(15, 159, 110, 0.08), transparent 24%),
    var(--bg);
}

.wrap {
  width: min(calc(100% - 32px), var(--max));
  margin: 0 auto;
}

.hero {
  padding: 28px 0 12px;
}

body.is-offline .pwa-bar {
  border-color: rgba(217, 45, 32, 0.18);
  background: rgba(255, 240, 239, 0.92);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-badge {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #ffffff;
  box-shadow: 0 10px 24px var(--primary-shadow);
  font-size: 18px;
  font-weight: 800;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-copy strong {
  letter-spacing: -0.02em;
}

.brand-copy span {
  color: var(--muted);
  font-size: 13px;
}

.brand-offer {
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}

.brand-universe {
  display: none;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: lowercase;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.8);
  color: var(--muted);
  font-size: 14px;
  backdrop-filter: blur(10px);
}

.app-mode-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

.topbar-link {
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
  font-weight: 700;
}

.topbar-link:hover {
  color: var(--primary);
}

.pwa-bar {
  margin-bottom: 20px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.pwa-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.pwa-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}

.pwa-chip[data-state='offline'] {
  background: var(--danger-soft);
  color: var(--danger);
}

.pwa-copy {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.pwa-copy[data-tone='success'] {
  color: var(--success);
}

.pwa-copy[data-tone='warning'] {
  color: var(--warning);
}

.pwa-copy[data-tone='danger'] {
  color: var(--danger);
}

.pwa-install {
  padding: 11px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 14px 28px var(--primary-shadow);
}

.pwa-install:hover {
  transform: translateY(-1px);
}

/* ── Header compact V5.9 ──────────────────────────────────── */
.topbar-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.topbar-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  justify-content: flex-end;
}

.topbar-actions-left,
.topbar-actions-public,
.topbar-actions-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.topbar-actions-right {
  justify-content: flex-end;
}

.topbar-actions-public {
  justify-content: flex-start;
  pointer-events: auto;
}

.topo-status-chip {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.55);
  border: 1px solid rgba(255,255,255,0.7);
  white-space: nowrap;
}

@media (max-width: 560px) {
  .topbar-right { width: 100%; }
}

.topo-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(255,255,255,0.8);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, transform 0.12s;
}

.topo-icon-btn:hover:not(:disabled) {
  background: rgba(255,255,255,0.95);
  transform: translateY(-1px);
}

.topo-icon-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ── Bouton fermeture panel/modal (cercle uniforme) ──────── */
.panel-close-btn,
button.panel-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50% !important;
  border: 1px solid #d0d8e4 !important;
  background: #f0f4f8 !important;
  color: #4d6278;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.panel-close-btn:hover { background: #e2e8ef !important; color: #1a1a1a; }

/* ── Sélecteur de langue (V6 i18n) ──────────────────────── */
.lang-switcher {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .5px;
  width: auto;
  padding: 0 .55rem;
  text-decoration: none;
  color: var(--text);
}
.lang-switcher:hover {
  background: rgba(255,255,255,0.95);
}

/* ── GPS button (V6.3) ──────────────────────────────────── */
.gps-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--panel-strong);
  border: 1px solid var(--primary, #1f6fff);
  border-radius: 14px;
  padding: 15px 13px;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--primary, #1f6fff);
  transition: background .15s, border-color .15s, box-shadow 180ms ease, opacity .15s;
  flex-shrink: 0;
  width: 2.8rem;
}
.gps-btn:hover { background: var(--primary-soft, #e8f0ff); }
.gps-btn:active { background: #d0e4ff; }
.gps-btn:focus { border-color: var(--primary-border); box-shadow: 0 0 0 4px var(--primary-ring); }
.gps-btn.loading { opacity: .5; pointer-events: none; animation: spin .8s linear infinite; }
.gps-btn.success { color: #16a34a; border-color: #16a34a; background: #f0fdf4; }
.gps-btn.error   { color: #dc2626; border-color: #dc2626; background: #fef2f2; }
.gps-msg {
  display: block;
  font-size: .78rem;
  color: #dc2626;
  margin-top: .25rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Dossiers chantier — panel slide (V6.2) ─────────────── */
.dossiers-panel {
  position: fixed;
  inset: 0;
  z-index: 8000;
  display: none;
  flex-direction: column;
  background: var(--bg, #fff);
  transform: translateX(100%);
  visibility: hidden;
  pointer-events: none;
  transition: transform .28s cubic-bezier(.4,0,.2,1);
}
.dossiers-panel.open { display: flex; transform: translateX(0); visibility: visible; pointer-events: auto; }
.dossiers-panel__header {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1rem 1rem .75rem;
  border-bottom: 1px solid var(--border, #e5e7eb);
  background: var(--surface, #f9fafb);
}
.dossiers-panel__header h2 { flex: 1; font-size: 1.05rem; margin: 0; }
.dossiers-panel__body { flex: 1; overflow-y: auto; padding: .75rem 1rem; }
/* .dossier-card redéfini en bas du fichier — spec §2 cards légères */
.dossier-status {
  font-size: .7rem;
  font-weight: 700;
  padding: .15rem .45rem;
  border-radius: .4rem;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.dossier-status.draft      { background: #f3f4f6; color: #374151; }
.dossier-status.prospect   { background: #eff6ff; color: #3b82f6; }
.dossier-status.quoted     { background: #fef3c7; color: #d97706; }
.dossier-status.active     { background: #dcfce7; color: #16a34a; }
.dossier-status.done       { background: #f0fdf4; color: #166534; }
.dossier-status.sav        { background: #fee2e2; color: #dc2626; }
/* .dossier-checklist retiré — dans l'écran chantier §7 */
.save-project-btn {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .9rem;
  padding: .65rem 1rem;
  border-radius: .75rem;
  border: none;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #fff;
  cursor: pointer;
  font-weight: 700;
  margin-top: 1rem;
  width: 100%;
  justify-content: center;
  box-shadow: 0 8px 20px var(--primary-shadow);
  transition: transform .15s, opacity .15s;
}
.save-project-btn:hover { transform: translateY(-1px); opacity: .92; }
.save-project-btn[disabled] { opacity: .5; pointer-events: none; }

/* ── Badge dossiers dans la nav ─────────────────────────── */
.nav-dossiers-badge {
  font-size: .6rem;
  font-weight: 700;
  background: var(--primary, #1f6fff);
  color: #fff;
  border-radius: 99px;
  padding: 0 .3rem;
  line-height: 1.4;
  position: absolute;
  top: .15rem;
  right: .05rem;
}

/* ── V7.1 — Section devis dans le panel dossiers ──────────── */
.devis-section {
  margin-top: .6rem;
  border-top: 1px solid var(--border, #e5e7eb);
  padding-top: .5rem;
}

.devis-section__toggle {
  cursor: pointer;
  font-size: .8rem;
  font-weight: 600;
  color: var(--primary, #1f6fff);
  list-style: none;
  padding: .25rem 0;
  user-select: none;
}

.devis-section__toggle::-webkit-details-marker { display: none; }

.devis-form {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  margin-top: .5rem;
}

.devis-field {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: .5rem;
  padding: .4rem .55rem;
  font-size: .8rem;
  background: var(--bg, #fff);
  color: var(--text, #111);
}

.devis-field:focus {
  outline: none;
  border-color: var(--primary, #1f6fff);
}

textarea.devis-field { resize: vertical; min-height: 3.5rem; }

.contact-picker-btn {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: var(--primary-soft, #e8f0ff);
  color: var(--primary, #1f6fff);
  border: 1.5px solid var(--primary-border, rgba(31,111,255,.4));
  border-radius: .5rem;
  padding: .38rem .7rem;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.devis-controls {
  display: flex;
  gap: .4rem;
  align-items: center;
}

.devis-controls .devis-tva {
  flex: 1;
  font-size: .78rem;
  padding: .3rem .4rem;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: .5rem;
  background: var(--bg, #fff);
}

.devis-generate-btn {
  background: var(--primary, #1f6fff);
  color: #fff;
  border: none;
  border-radius: .5rem;
  padding: .35rem .8rem;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
}

.devis-generate-btn:disabled { opacity: .5; cursor: default; }

.devis-loading { font-size: .8rem; color: var(--text-muted, #888); padding: .4rem 0; }
.devis-error   { font-size: .8rem; color: #dc2626; padding: .4rem 0; }

.devis-output { margin-top: .4rem; }

.devis-designation {
  font-size: .85rem;
  margin-bottom: .5rem;
  color: var(--text, #111);
}

.devis-lines {
  width: 100%;
  border-collapse: collapse;
  font-size: .78rem;
  margin-bottom: .4rem;
}

.devis-lines th {
  text-align: left;
  padding: .2rem .3rem;
  border-bottom: 2px solid var(--border, #e5e7eb);
  font-weight: 600;
  color: var(--text-muted, #888);
}

.devis-lines td {
  padding: .2rem .3rem;
  border-bottom: 1px solid var(--border, #e5e7eb);
  vertical-align: top;
}

.devis-lines tfoot td { font-size: .8rem; padding-top: .3rem; }

.devis-notes {
  font-size: .78rem;
  color: var(--text-muted, #888);
  font-style: italic;
  margin: .3rem 0;
}

.devis-export-actions {
  display: flex;
  gap: .4rem;
  margin-top: .5rem;
  flex-wrap: wrap;
}

/* ── Popup QR header (V5.8) ───────────────────────────────── */
.qr-popup {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-popup[hidden] {
  display: none;
}

.qr-popup-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10,12,28,0.55);
  backdrop-filter: blur(4px);
}

.qr-popup-card {
  position: relative;
  background: var(--panel);
  border: 1px solid rgba(255,255,255,0.8);
  border-radius: var(--radius-xl);
  box-shadow: 0 32px 80px rgba(0,0,0,0.28);
  padding: 28px 24px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 280px;
  width: 90%;
  text-align: center;
}

.qr-share-card {
  max-width: 360px;
  width: min(92vw, 360px);
  text-align: left;
  align-items: stretch;
  gap: 12px;
  background:
    radial-gradient(circle at 92% 8%, rgba(194, 136, 79, 0.18), transparent 46%),
    linear-gradient(145deg, #fff8ef 0%, #f9f0e4 100%);
  border: 1px solid rgba(166, 124, 82, 0.36);
  box-shadow: 0 28px 62px rgba(26, 22, 15, 0.27);
}

.qr-popup-icon-close {
  align-self: flex-end;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(119, 79, 42, 0.25);
  background: rgba(255, 255, 255, 0.75);
  color: #6a5137;
}

.qr-popup-icon-close:hover {
  background: rgba(255, 255, 255, 0.95);
}

.qr-popup-kicker {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 800;
  color: #8f683f;
}

.qr-popup-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  color: #35230f;
}

.qr-share-subtitle {
  margin: 0;
  font-size: 0.8rem;
  color: #6c5a47;
  line-height: 1.45;
}

.qr-share-body {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 16px;
  align-items: center;
}

.qr-share-code {
  width: 140px;
  height: 140px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  border: 1.5px solid rgba(119, 79, 42, 0.3);
  background: rgba(255, 255, 255, 0.8);
  padding: 10px;
  overflow: visible;
}

.qr-share-benefits {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.qr-share-benefits li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.76rem;
  line-height: 1.45;
  color: #4f3e2c;
}

.qr-benefit-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(119, 79, 42, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  margin-top: 1px;
}

#header-qrcode canvas,
#header-qrcode img {
  border-radius: 8px;
  display: block;
}

.qr-popup-hint {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
}

.qr-popup-ref-link {
  display: inline-block;
  font-size: 0.72rem;
  color: #3f5f9f;
  word-break: break-all;
  text-decoration: none;
  opacity: 0.9;
}

.qr-popup-ref-link:hover {
  text-decoration: underline;
}

.qr-popup-close {
  margin-top: 4px;
  padding: 9px 20px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.qr-popup-primary-btn {
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #ffffff;
  font-size: 0.86rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
}

.qr-popup-primary-btn:hover {
  transform: translateY(-1px);
}

.qr-popup-secondary-link {
  align-self: center;
  font-size: 0.78rem;
  color: #4f3e2c;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.qr-popup-fallback-link {
  font-size: 0.82rem;
  line-height: 1.35;
  color: #234783;
  word-break: break-all;
}

@media (max-width: 520px) {
  .qr-share-body {
    grid-template-columns: 1fr;
  }

  .qr-share-code {
    width: 200px;
    height: 200px;
    margin: 0 auto;
  }
}

/* ── Select modèle matériaux (4.4) ────────────────────────── */
#material_model {
  width: 100%;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.82);
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
  appearance: auto;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 22px;
  align-items: stretch;
}

.card {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.intro {
  padding: 34px;
  position: relative;
  overflow: hidden;
  animation: lift-in 560ms ease both;
}

.intro::after {
  content: '';
  position: absolute;
  right: -40px;
  top: -20px;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, var(--hero-glow), transparent 68%);
  pointer-events: none;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 16px;
}

h1 {
  margin: 0;
  font-size: clamp(32px, 5vw, 54px);
  line-height: 0.96;
  letter-spacing: -0.045em;
  max-width: 12ch;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--primary-border);
  background: var(--bg);
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 600;
  margin-top: 14px;
  opacity: 0.75;
}

.lead {
  margin: 18px 0 0;
  font-size: 18px;
  line-height: 1.5;
  color: var(--muted);
  max-width: 56ch;
}

.benefits {
  margin-top: 26px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.benefit {
  padding: 16px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
}

.benefit strong {
  display: block;
  font-size: 15px;
  margin-bottom: 6px;
}

.benefit span {
  display: block;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
}

.simulator {
  padding: 22px;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  animation: lift-in 660ms ease both;
}

.simulator-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.simulator-head h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.03em;
}

.simulator-head p {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.5;
}

.mini-step {
  font-size: 12px;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 8px 10px;
  border-radius: 999px;
  white-space: nowrap;
  font-weight: 800;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

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

.field.full {
  grid-column: 1 / -1;
}

label {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.hint {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.why-box {
  margin-top: 8px;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  border-radius: 14px;
  padding: 15px 15px;
  font: inherit;
  color: var(--text);
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

input:focus,
select:focus {
  border-color: var(--primary-border);
  box-shadow: 0 0 0 4px var(--primary-ring);
  transform: translateY(-1px);
}

.locked-trade {
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
}

.locked-trade strong {
  display: block;
  font-size: 16px;
  margin-bottom: 6px;
}

.locked-trade span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.input-inline {
  position: relative;
}

.input-inline span {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 13px;
  pointer-events: none;
}

/* Variante avec bouton GPS aligné en ligne */
.input-inline--gps {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: nowrap;
}
.input-inline--gps .input-inline__inner {
  position: relative;
  flex: 2 1 0;
  min-width: 0;
}
.input-inline--gps .input-inline__inner input {
  width: 100%;
}
.input-inline--gps .input-inline__inner span {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 13px;
  pointer-events: none;
}

.disclosure {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 0;
  color: var(--muted);
  font-size: 13px;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.disclosure:hover {
  color: var(--primary);
}

.actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  flex-wrap: wrap;
}

button {
  border: 0;
  cursor: pointer;
  font: inherit;
}

/* Variante BEM utilisée dans les pages HTML statiques (courses, journée, stats) */
.btn--primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .5rem 1rem;
  border-radius: 99px;
  background: var(--primary, #1f6fff);
  color: #fff;
  font-size: .875rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: opacity .15s;
  white-space: nowrap;
}
.btn--primary:hover { opacity: .88; }
.btn--primary:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary {
  padding: 15px 18px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 14px 28px var(--primary-shadow);
  min-width: 220px;
  transition: transform 180ms ease, opacity 180ms ease;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn-primary:disabled,
.chip:disabled {
  cursor: wait;
  opacity: 0.7;
}

.ghost-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  max-width: 34ch;
}

.result-caption {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.result-card {
  margin-top: 20px;
  border-radius: 20px;
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--panel-alt);
  transition: 0.2s ease;
  animation: result-pop 260ms ease both;
}

.result-healthy {
  background: var(--success-soft);
  border-color: rgba(15, 159, 110, 0.18);
}

.result-tight {
  background: var(--warning-soft);
  border-color: rgba(199, 125, 0, 0.18);
}

.result-underpriced,
.result-error {
  background: var(--danger-soft);
  border-color: rgba(217, 45, 32, 0.16);
}

.result-loss {
  background: #fef2f2;
  border-color: rgba(185, 28, 28, 0.22);
  color: #1a1a2e;
}
.result-loss .result-status,
.result-loss .result-tag {
  background: rgba(255, 255, 255, 0.92);
  color: #7f1d1d;
}
.result-loss .result-title { color: #7f1d1d; }
.result-loss .result-text  { color: rgba(127, 29, 29, 0.82); }

.result-pending {
  background: var(--panel-alt);
}

/* ── QR code partage ──────────────────────────────── */
.qr-share-shell {
  margin-top: 12px;
}

.qr-share {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: var(--panel-alt);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 16px;
}

.qr-share-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0;
}

.qrcode-canvas img,
.qrcode-canvas canvas {
  border-radius: 8px;
  display: block;
}

.qr-share-hint {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin: 0;
  text-align: center;
}

/* ── Verdict banner ───────────────────────────────── */
.verdict-banner {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 14px;
}

.verdict-label {
  font-size: 1rem;
  font-weight: 700;
  color: inherit;
}

.verdict-text {
  font-size: 0.84rem;
  opacity: 0.85;
}

/* ── Explication écart jours ──────────────────────── */
.days-gap-note {
  display: block;
  font-size: 0.78rem;
  font-style: italic;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Note prix carburant sous déplacement ─────────── */
.fuel-price-note {
  display: block;
  font-size: 0.74rem;
  font-style: normal;
  color: var(--text-muted);
  opacity: 0.80;
  margin-top: 2px;
}

/* ── Note retour session ──────────────────────────── */
.session-returning-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 6px 0 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── Solo toggle ──────────────────────────────────── */
.solo-toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.solo-toggle-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.solo-toggle-group {
  display: flex;
  gap: 6px;
}

.solo-btn {
  padding: 5px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--line);
  background: var(--panel-alt);
  color: var(--text-secondary);
  font-size: 0.82rem;
  cursor: pointer;
  transition: 0.15s ease;
}

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

/* ── Complexité ───────────────────────────────────── */
.complexity-group {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.complexity-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-basis: 100%;
  margin-bottom: 2px;
}

.complexity-btn {
  padding: 5px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--line);
  background: var(--panel-alt);
  color: var(--text-secondary);
  font-size: 0.82rem;
  cursor: pointer;
  transition: 0.15s ease;
}

.complexity-btn.active {
  background: var(--primary-soft);
  border-color: var(--primary-border);
  color: var(--primary);
  font-weight: 600;
}

/* ── Toggles VTC (plateforme / véhicule) ────────── */
.vtc-toggle-btn {
  padding: 5px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--line);
  background: var(--panel-alt);
  color: var(--text-secondary);
  font-size: 0.82rem;
  cursor: pointer;
  transition: 0.15s ease;
}

.vtc-toggle-btn.active {
  background: var(--primary-soft);
  border-color: var(--primary-border);
  color: var(--primary);
  font-weight: 600;
}

/* ── Email capture ────────────────────────────────── */
.email-capture-shell {
  margin-top: 12px;
}

.email-capture {
  background: var(--panel-alt);
  border: 1.5px solid var(--primary-border);
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.email-capture-msg {
  font-size: 0.9rem;
  color: var(--text-primary);
  font-weight: 500;
  margin: 0;
}

.email-capture-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.email-capture-row input[type="email"] {
  flex: 1;
  min-width: 180px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  background: var(--panel);
  color: var(--text-primary);
  font-size: 0.9rem;
}

.btn-email-capture {
  padding: 8px 18px;
  border-radius: 10px;
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 0.87rem;
  font-weight: 600;
  cursor: pointer;
  transition: 0.15s ease;
  white-space: nowrap;
}

.btn-email-capture:hover {
  background: var(--primary-strong);
}

.btn-email-capture:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.email-capture-status {
  font-size: 0.8rem;
  color: var(--text-muted);
  min-height: 1em;
  margin: 0;
}

.email-capture-login-cta {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--primary-border);
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.email-capture-dismiss {
  align-self: flex-start;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.result-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.result-status,
.result-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
}

.result-tag {
  color: var(--muted);
}

.result-title {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.03em;
}

.result-text {
  margin: 8px 0 0;
  color: rgba(24, 32, 42, 0.82);
  line-height: 1.5;
  font-size: 15px;
}

.result-card {
  --result-accent: #1f6fff;
  --result-target-pct: 20%;
}

.dominant-margin-card {
  margin-top: 14px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--result-accent) 26%, #ffffff);
  background: color-mix(in srgb, var(--result-accent) 11%, #ffffff);
}

.dominant-margin-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}

.dominant-margin-label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: color-mix(in srgb, var(--result-accent) 78%, #1a1a2e);
}

.dominant-margin-value {
  font-size: 40px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--result-accent);
}

.dominant-margin-range {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--result-accent);
  opacity: 0.7;
  letter-spacing: 0.01em;
}

.dominant-margin-bar {
  position: relative;
  margin-top: 14px;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  overflow: hidden;
}

.dominant-margin-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--result-accent), color-mix(in srgb, var(--result-accent) 70%, #ffffff));
}

.dominant-margin-bar--negative {
  overflow: visible;
}

.dominant-margin-zero {
  position: absolute;
  top: -22px;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 600;
  color: rgba(24, 32, 42, 0.55);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.dominant-margin-zero::after {
  content: '';
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 20px;
  background: rgba(24, 32, 42, 0.35);
}

.dominant-margin-target {
  position: absolute;
  top: -22px;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.dominant-margin-target::after {
  content: '';
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 20px;
  background: rgba(24, 32, 42, 0.25);
}

.primary-metrics {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.metric-row {
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 14px;
  padding: 12px 14px;
}

.metric-row-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.metric-label {
  font-size: 12px;
  color: var(--muted);
}

.metric-value {
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.metric-bar,
.detail-bar {
  margin-top: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  overflow: hidden;
}

.metric-bar span,
.detail-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--result-accent);
}

/* Barre de positionnement TJC réel vs objectif journalier */
.detail-bar--objective {
  position: relative;
  overflow: visible;
  background: rgba(255, 255, 255, 0.75);
}
/* Remplissage principal depuis 0 → TJC médian (peut dépasser 100% si TJC > objectif) */
.detail-bar--objective .detail-bar__fill {
  position: absolute;
  left: 0; top: 0; height: 100%;
  background: var(--result-accent);
  opacity: 0.42;
  border-radius: 999px;
}
/* Zone fourchette (bas→haut) plus saturée, superposée sur la fill */
.detail-bar--objective .detail-bar__range {
  position: absolute;
  top: 0; height: 100%;
  background: var(--result-accent);
  opacity: 0.9;
  border-radius: 999px;
}
/* Marqueur vertical = objectif (positionné proportionnellement sur l'axe) */
.detail-bar--objective .detail-bar__goal {
  position: absolute;
  left: 0; top: -4px;
  transform: translateX(-50%);
  width: 2px; height: calc(100% + 8px);
  background: #374151;
  border-radius: 2px;
  opacity: 0.45;
}

.detail-accordion {
  margin-top: 14px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.78);
}

.detail-title {
  margin: 0 0 10px;
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.detail-list {
  display: grid;
  gap: 10px;
}

.detail-row {
  border-radius: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.82);
}

.detail-row-head {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
}

.detail-label {
  font-size: 12px;
  color: var(--muted);
}

.detail-value {
  font-size: 14px;
}

.detail-toggle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(24, 32, 42, 0.16);
  background: #fff;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 180ms ease;
}

.detail-toggle[disabled] {
  opacity: 0.35;
  cursor: not-allowed;
}

.detail-row--locked .detail-toggle {
  border-style: dashed;
  color: var(--muted);
  opacity: 0.7;
}

.detail-panel-lock {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-style: italic;
}

.detail-panel-lock-cta {
  align-self: flex-start;
  margin-top: 2px;
  padding: 4px 14px;
  border-radius: 20px;
  border: 1px solid var(--c-accent, #3b82f6);
  background: transparent;
  color: var(--c-accent, #3b82f6);
  font-size: 12px;
  font-style: normal;
  cursor: pointer;
  line-height: 1.6;
}

.detail-row.is-open .detail-toggle {
  transform: rotate(180deg);
}

.detail-panel {
  max-height: 0;
  overflow: hidden;
  margin-top: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-secondary);
  transition: max-height 180ms ease, margin-top 180ms ease;
}

.detail-row.is-open .detail-panel {
  max-height: 140px;
  margin-top: 8px;
}

.detail-note {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-muted);
  font-style: normal;
}

.result-tone-green .metric-bar span,
.result-tone-green .detail-bar span,
.result-tone-green .dominant-margin-fill {
  background: #0f9f6e;
}

.result-tone-orange .metric-bar span,
.result-tone-orange .detail-bar span,
.result-tone-orange .dominant-margin-fill {
  background: #c77d00;
}

.result-tone-red .metric-bar span,
.result-tone-red .detail-bar span,
.result-tone-red .dominant-margin-fill {
  background: #d92d20;
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.stat {
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 16px;
  padding: 14px;
}

.stat .label,
.meta-stat span {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
  display: block;
}

.stat .value,
.meta-stat strong {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.035em;
}

.range-value {
  font-size: 20px;
  line-height: 1.35;
}

.meta-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.meta-stat {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.54);
  border: 1px solid rgba(255, 255, 255, 0.75);
}

/* ── P2 — Comparateur plateformes VTC ─────────────────────────────── */
.vtc-compare-wrap {
  margin-top: 16px;
}

.vtc-compare-btn {
  background: none;
  border: 1px solid var(--primary-border, rgba(26, 26, 46, 0.18));
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-strong, #1A1A2E);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  width: 100%;
  text-align: center;
}
.vtc-compare-btn:hover {
  background: rgba(26, 26, 46, 0.05);
  border-color: var(--primary-strong, #1A1A2E);
}

.vtc-compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.vtc-cmp-card {
  padding: 13px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.60);
  border: 1px solid rgba(255, 255, 255, 0.75);
  font-size: 13px;
}
.vtc-cmp-card.vtc-cmp-better {
  border-color: #2ecc71;
  background: rgba(46, 204, 113, 0.07);
}

.vtc-cmp-header {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 8px;
  font-size: 13px;
}
.vtc-cmp-comm {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted, #777);
  font-weight: 500;
}

.vtc-cmp-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px;
  padding: 3px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  font-size: 12px;
}
.vtc-cmp-row:last-of-type { border-bottom: none; }
.vtc-cmp-row span { color: var(--muted, #777); }
.vtc-cmp-row strong { font-size: 13px; }

.vtc-cmp-gain {
  margin-top: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #2ecc71;
}

.feedback-shell {
  margin-top: 16px;
}

.feedback {
  padding: 14px 16px;
  border-top: 1px dashed rgba(24, 32, 42, 0.12);
  background: var(--primary-soft, #e8f0ff);
  border-radius: .75rem;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.feedback-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #1a1a2e);
}

.feedback-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.feedback span {
  font-size: 13px;
  color: var(--muted);
}

.chip {
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  font-size: 13px;
  font-weight: 700;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.chip:hover:not(:disabled) {
  transform: translateY(-1px);
}

.chip.active {
  border-color: var(--primary-border);
  background: var(--primary-soft);
  color: var(--primary);
}

.feedback-status {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.export-actions-disabled {
  opacity: 0.6;
}

.action-chip {
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  font-size: 13px;
  font-weight: 700;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.action-chip:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: var(--primary-border);
  background: var(--primary-soft);
}

.action-chip:disabled {
  cursor: not-allowed;
}

.export-status {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.section {
  padding: 20px 0 42px;
}

.strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.strip-card {
  padding: 22px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.strip-card h3 {
  margin: 0 0 10px;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.strip-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 14px;
}

.section-head {
  margin-top: 22px;
}

.section-head h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.03em;
}

.testimonials {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.quote-card {
  padding: 20px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

.quote-card p {
  margin: 0 0 12px;
  line-height: 1.6;
  color: rgba(24, 32, 42, 0.84);
}

.quote-card strong {
  font-size: 13px;
  color: var(--muted);
}

.app-shell .wrap {
  width: min(calc(100% - 24px), 780px);
}

.app-shell .hero {
  padding: 14px 0 16px;
}

.app-shell .hero-grid {
  grid-template-columns: 1fr;
  gap: 0;
}

.app-shell .intro,
.app-shell .section {
  display: none;
}

.app-shell .simulator {
  padding: 20px;
}

.app-shell .simulator-head {
  margin-bottom: 14px;
}

.app-shell .topbar {
  margin-bottom: 8px;
}

.app-shell .topbar-right {
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.app-shell .brand-copy span {
  display: none;
}

.is-standalone .brand-universe {
  display: block;
}

.is-standalone .simulator-head {
  display: none;
}

.app-shell .topo-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}

.app-shell .topo-status-chip {
  font-size: 10px;
  padding: 3px 7px;
}

.app-shell .pill {
  display: none;
}

.app-shell .pwa-bar {
  margin-bottom: 14px;
  padding: 12px 14px;
}

.app-shell .ghost-note {
  max-width: none;
}

.app-shell .lang-switcher {
  display: none;
}

@media (max-width: 380px) {
  .app-shell .lang-switcher {
    display: none;
  }
}

.bloc-guide {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(31,111,255,0.15);
  text-align: center;
}

.bloc-guide__link {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.bloc-guide__link:hover {
  color: var(--primary);
  text-decoration: underline;
}

.footer-note {
  margin-top: 18px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  line-height: 1.5;
}

@keyframes lift-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes result-pop {
  from {
    opacity: 0;
    transform: scale(0.985) translateY(8px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@media (max-width: 1024px) {
  .hero-grid,
  .benefits,
  .strip,
  .testimonials {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .hero {
    padding-top: 18px;
  }

  .topbar {
    position: relative;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    margin-bottom: 18px;
  }

  .brand {
    width: 100%;
  }

  .brand-copy {
    padding-right: 78px;
  }

  .brand-copy span {
    max-width: none;
  }

  .topbar-right {
    width: 100%;
    align-items: stretch;
    margin-top: 0;
  }

  .topbar-meta {
    position: absolute;
    top: 2px;
    right: 0;
    justify-content: flex-end;
    width: auto;
    z-index: 2;
  }

  .topbar-actions {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 6px;
  }

  .topbar-actions-left {
    order: 1;
    margin-right: auto;
    gap: 6px;
  }

  .topbar-actions-public {
    order: 2;
    gap: 6px;
    justify-content: flex-end;
  }

  .topbar-actions-right {
    order: 3;
    min-width: 0;
    justify-content: flex-end;
    gap: 3px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .topbar-actions-right::-webkit-scrollbar {
    display: none;
  }

  .topo-icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 9px;
  }

  .lang-switcher {
    padding: 0 .4rem;
    font-size: .69rem;
  }

  .topo-status-chip {
    padding: 3px 7px;
    font-size: 10px;
  }

  .intro,
  .strip-card {
    padding: 20px;
  }

  .simulator {
    padding: 16px;
  }

  .form-grid,
  .stats,
  .meta-stats {
    grid-template-columns: 1fr;
  }

  .dominant-margin-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .dominant-margin-value {
    font-size: 34px;
  }

  .detail-row-head {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      'label toggle'
      'value toggle';
  }

  .detail-label { grid-area: label; }
  .detail-value { grid-area: value; }
  .detail-toggle { grid-area: toggle; }

  h1 {
    max-width: none;
  }

  .btn-primary {
    width: 100%;
  }

  .actions,
  .result-top,
  .pwa-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .export-actions {
    flex-direction: column;
    align-items: stretch;
  }

  /* ── Mobile/PWA : réduction compacte des espacements ── */
  .topbar { margin-bottom: var(--spacing-lg); }
  .hero { padding: 16px 0 10px; }
  .form-grid { gap: var(--spacing-md); }
  .field { gap: var(--spacing-sm); }
  input,
  select {
    padding: var(--input-pad-v) var(--input-pad-h);
  }
  .result-card { margin-top: 12px; }
  .result-top { 
    margin-bottom: 6px; 
    gap: var(--spacing-md);
  }
  .dominant-margin-card {
    margin-top: 10px;
    padding: 12px;
  }
  .dominant-margin-bar {
    margin-top: 10px;
    height: 10px;
  }
  .dominant-margin-value {
    font-size: 28px;
  }
  .primary-metrics {
    margin-top: 10px;
    gap: 8px;
  }
  .metric-row {
    padding: 9px 10px;
    border-radius: 12px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      'label label'
      'value bar'
      'note note';
    column-gap: 8px;
    row-gap: 5px;
    align-items: center;
  }
  .metric-row-head {
    display: contents;
  }
  .metric-label {
    grid-area: label;
    font-size: 11px;
    line-height: 1.2;
  }
  .metric-value {
    grid-area: value;
    font-size: 15px;
    line-height: 1.1;
    letter-spacing: -0.01em;
    white-space: nowrap;
  }
  .metric-bar {
    grid-area: bar;
    margin-top: 0;
    height: 6px;
  }
  .detail-accordion {
    margin-top: 10px;
    padding: 10px;
  }
  .detail-title {
    margin-bottom: 8px;
    font-size: 11px;
  }
  .detail-list {
    gap: 8px;
  }
  .detail-row {
    padding: 8px;
    border-radius: 10px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      'label label toggle'
      'value bar toggle'
      'note note note'
      'panel panel panel';
    column-gap: 8px;
    row-gap: 5px;
    align-items: center;
  }
  .detail-row-head {
    display: contents;
  }
  .detail-label {
    grid-area: label;
    font-size: 11px;
    line-height: 1.2;
  }
  .detail-value {
    grid-area: value;
    font-size: 13px;
    line-height: 1.1;
    white-space: nowrap;
  }
  .detail-toggle {
    grid-area: toggle;
    width: 24px;
    height: 24px;
  }
  .detail-bar {
    grid-area: bar;
    margin-top: 0;
    height: 6px;
  }
  .detail-note {
    grid-area: note;
    margin-top: 0;
    font-size: 10px;
    min-width: 0;
    overflow-wrap: break-word;
  }
  .detail-panel {
    grid-area: panel;
  }
  .detail-row.is-open .detail-panel {
    margin-top: 4px;
  }
  .result-card .result-top,
  .result-card .result-title,
  .result-card .result-text {
    display: none;
  }
  .field label { font-size: 13px; }
}
/* ── V5.6 RGPD ──────────────────────────────────────────────────────── */
.rgpd-consent-label {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: #555;
  line-height: 1.4;
  margin-top: 4px;
  cursor: pointer;
}
.rgpd-consent-label input[type="checkbox"] {
  flex: none;
  width: 15px;
  height: 15px;
  margin-top: 2px;
  accent-color: #1A1A2E;
  cursor: pointer;
}
.rgpd-consent-label span {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}
.rgpd-consent-label a {
  color: #1A1A2E;
  text-decoration: underline;
}

.footer-legal {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  margin-top: 10px;
  color: #888;
}
.footer-legal a,
.footer-legal-link {
  color: #888;
  text-decoration: underline;
  cursor: pointer;
}
.footer-legal a:hover,
.footer-legal-link:hover {
  color: #333;
}

/* ── L4 — Bandeau cookies conditionnel ─────────────────────────────── */
.mp-cookie-banner {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 1600;
  padding: 14px;
  background: linear-gradient(180deg, rgba(245, 247, 251, 0), rgba(245, 247, 251, 0.95) 40%, rgba(245, 247, 251, 1) 100%);
}

.mp-cookie-banner__card {
  width: min(100%, 780px);
  margin: 0 auto;
  background: #ffffff;
  border: 1px solid #d8e2f1;
  border-radius: 14px;
  box-shadow: 0 14px 36px rgba(16, 24, 40, 0.14);
  padding: 14px;
}

.mp-cookie-banner__title {
  margin: 0 0 6px;
  font-weight: 800;
  color: var(--text);
}

.mp-cookie-banner__text {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.mp-cookie-banner__actions {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mp-cookie-btn {
  appearance: none;
  border: 1px solid #cfd6e4;
  border-radius: 999px;
  background: #fff;
  color: #243347;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 14px;
}

.mp-cookie-btn--primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  border-color: transparent;
  color: #fff;
}

.mp-cookie-customize {
  margin-top: 10px;
  background: #f7fbff;
  border: 1px dashed #c3d8fb;
  border-radius: 10px;
  padding: 10px;
  font-size: 12px;
  color: #2b3950;
}

/* ── Stub Pro teaser ────────────────────────────────────────────────── */
.pro-teaser-shell {
  padding: 0 16px 16px;
}
.pro-teaser {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: linear-gradient(135deg, #1A1A2E 0%, #16213E 100%);
  color: #fff;
  border-radius: 12px;
  padding: 16px;
  position: relative;
}
.pro-teaser-icon {
  font-size: 24px;
  flex-shrink: 0;
  margin-top: 2px;
}
.pro-teaser-body {
  flex: 1;
}
.pro-teaser-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
  color: #FFD700;
}
.pro-teaser-text {
  font-size: 13px;
  color: rgba(255,255,255,0.8);
  margin-bottom: 10px;
  line-height: 1.4;
}
.btn-pro-upgrade {
  background: #FFD700;
  color: #1A1A2E;
  border: none;
  border-radius: 6px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.btn-pro-upgrade:hover {
  background: #FFC200;
}
.pro-teaser-dismiss {
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  font-size: 16px;
  padding: 0;
  flex-shrink: 0;
  line-height: 1;
}
.pro-teaser-dismiss:hover {
  color: #fff;
}

/* ── Modal Pro ──────────────────────────────────────────────────────── */
.pro-modal-shell {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
}
/* Quand hidden est retiré par JS, le display:flex reprend — pas besoin d'autre règle */
@media (min-width: 600px) {
  .pro-modal-shell { align-items: center; justify-content: center; }
}
.pro-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
}
.pro-modal-card {
  position: relative;
  background: #fff;
  border-radius: 16px 16px 0 0;
  padding: 28px 20px 36px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}
@media (min-width: 600px) {
  .pro-modal-card {
    border-radius: 16px;
    max-width: 560px;
    width: 100%;
    max-height: 80vh;
  }
}
.pro-modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid #d0d8e4 !important;
  background: #f0f4f8;
  color: #4d6278;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
}
.pro-modal-close:hover { background: #e2e8ef; color: #1a1a1a; }
.pro-modal-header {
  text-align: center;
  margin-bottom: 22px;
}
.pro-badge {
  display: inline-block;
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #1A1A2E;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  border-radius: 4px;
  padding: 2px 8px;
  margin-bottom: 8px;
}
.pro-modal-title {
  font-size: 22px;
  font-weight: 700;
  color: #1A1A2E;
  margin-bottom: 4px;
}
.pro-modal-price {
  font-size: 14px;
  color: #666;
}

/* ── Bloc statut abonnement (Mon compte connecté) ──────────────────── */
.subscription-status {
    margin: 0 0 1.25rem;
    padding: 1rem 1.1rem;
    background: var(--card-bg, #f5f7fb);
    border: 1.5px solid var(--border-light, #e3e8f0);
    border-radius: .875rem;
}

.sub-plan-badge {
    display: inline-flex;
    align-items: center;
    padding: .2rem .75rem;
    border-radius: 2rem;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    margin-bottom: .65rem;
}
.sub-plan-badge--free  { background: #f0f4ff; color: #3b5acc; }
.sub-plan-badge--pro   { background: #e6faf3; color: #0f9f6e; }
.sub-plan-badge--trial { background: #fff8e6; color: #c67a00; }

.sub-main-msg {
    font-size: .95rem;
    font-weight: 600;
    color: var(--text-primary, #1a1a1a);
    margin: 0 0 .35rem;
}
.sub-secondary-msg {
    font-size: .82rem;
    color: var(--muted, #666);
    margin: 0 0 .85rem;
    line-height: 1.4;
}

.sub-cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: .75rem;
}

.btn-sub-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .55rem 1.1rem;
    border-radius: .6rem;
    font-size: .85rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: opacity .15s;
}
.btn-sub-cta--primary { background: var(--primary, #1f6fff); color: #fff; }
.btn-sub-cta--primary:hover { opacity: .88; }
.btn-sub-cta--ghost {
    background: transparent;
    color: var(--primary, #1f6fff);
    border: 1.5px solid var(--primary, #1f6fff);
}
.btn-sub-cta--ghost:hover { background: var(--primary-soft, #e8f0ff); }

/* Pricing list dans bloc statut — mêmes styles que list principale */
.sub-pricing-list { margin: .75rem 0 .5rem; }
.sub-pricing-list.pro-pricing-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 559px) {
  .sub-pricing-list.pro-pricing-list {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
}
.sub-pricing-buy  { margin: .5rem 0 0; }

.profile-public-sections {
  margin-top: 12px;
  border: 1px solid #e8edf6;
  background: #f8fbff;
  border-radius: 12px;
  padding: 12px;
  text-align: left;
}
.profile-public-sections h3 {
  margin: 0 0 4px;
  font-size: 14px;
  color: #1a2a40;
}
.profile-public-sections p {
  margin: 0 0 10px;
  font-size: 12px;
  color: #607083;
}
.profile-public-actions {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.btn-profile-public {
  border: 1px solid #d6e2f4;
  background: #fff;
  border-radius: 8px;
  padding: 8px 10px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #27405f;
  text-align: center;
  cursor: pointer;
}
.btn-profile-public:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-ring);
  border-color: var(--primary-border);
}
.btn-profile-public--primary {
  border-color: var(--primary-border);
  background: var(--primary-soft);
  color: var(--primary);
}
.btn-profile-public--link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.pro-pricing-list {
  margin-top: 10px;
  display: grid;
  gap: 9px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.pro-pricing-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  border: 1px solid #e8ebf2;
  border-radius: 10px;
  padding: 8px 12px;
  background: #f9fbff;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.pro-pricing-item:hover {
  border-color: rgba(31, 111, 255, 0.38);
}
.pro-pricing-item:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-ring);
}
.pro-pricing-item.is-selected {
  border-color: var(--primary-border);
  box-shadow: 0 8px 20px rgba(31, 111, 255, 0.14);
  background: #f2f7ff;
}
.pro-pricing-item.is-highlight {
  border-color: var(--primary-border);
  background: var(--primary-soft);
}
.pro-pricing-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  flex: 1;
  min-width: 0;
}
.pro-pricing-label {
  color: #1a2a40;
  font-size: 13px;
  font-weight: 800;
}
.pro-pricing-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(31, 111, 255, 0.25);
  border-radius: 999px;
  padding: 2px 8px;
}
.pro-pricing-value {
  margin: 0;
  flex-shrink: 0;
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.pro-pricing-value .amount {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #1A1A2E;
}
.pro-pricing-value .period {
  font-size: 12px;
  color: #667085;
  font-weight: 600;
}
@media (max-width: 479px) {
  .pro-pricing-list {
    grid-template-columns: repeat(1, minmax(0, 1fr));
  }
}
.pro-pricing-buy {
  margin-top: 10px;
}
.pro-feature-list {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
}
.pro-feature-list li {
  display: grid;
  gap: 3px;
  font-size: 14px;
  padding: 7px 0;
  border-bottom: 1px solid #f0f0f0;
  color: #333;
}
.pro-feature-list li strong {
  color: #1a2a40;
}
.pro-feature-list li span {
  color: #4b5565;
}
.pro-feature-list li:last-child {
  border-bottom: none;
  color: #aaa;
}
.pro-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.btn-pro-checkout {
  background: #1A1A2E;
  color: #FFD700;
  border: none;
  border-radius: 8px;
  padding: 14px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
}
.btn-pro-checkout:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-pro-annual {
  background: #f5f5f5;
  color: #1A1A2E;
}
.pro-modal-hint {
  text-align: center;
  font-size: 12px;
  color: #aaa;
  margin: 0;
}

/* ── Topbar profile icon — connected state ────────────────────────── */
.topo-profil-btn.is-connected {
  color: var(--primary, #1f6fff);
}
.topo-profil-btn.is-connected svg {
  stroke: var(--primary, #1f6fff);
}

/* ── Bottom navigation bar — app-shell V5.10 ──────────────────────── */
.app-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 800;
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0;
  background: rgba(255, 255, 255, 0.92);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  /* Safe area iOS */
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
}

.app-nav-item {
  flex: 0 1 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 6px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.app-nav-item svg {
  stroke: currentColor;
  transition: stroke 0.15s ease, transform 0.15s ease;
}

.app-nav-item:hover,
.app-nav-item--active {
  color: var(--primary);
}

.app-nav-item--active svg {
  transform: translateY(-1px);
}

.app-nav-label {
  display: flex;
  align-items: center;
  gap: 4px;
}

.app-nav-plan-badge {
  font-size: 9px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Padding pour que le contenu ne soit pas caché sous la nav bar */
body.app-shell {
  padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px));
}

.mp-dev-session-panel {
  position: fixed;
  right: 12px;
  bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  z-index: 901;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border-radius: 12px;
  background: rgba(24, 32, 42, 0.9);
  box-shadow: 0 12px 28px rgba(16, 24, 40, 0.22);
}

.mp-dev-session-panel button {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.mp-dev-session-panel button:hover {
  background: rgba(255, 255, 255, 0.16);
}

/* ── V5.10 Panel profil ─────────────────────────────────────────────── */

/* ── V12.41 Mon compte — Topbar + Carte identité + Onglets ────────── */

/* Topbar */
.pf-topbar {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: 16px 0 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--line, #e6ebf2);
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
}
.pf-topbar-title {
    flex: 1;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary, #1a1a1a);
    text-align: center;
    margin: 0;
}
.pf-topbar-save {
    padding: .4rem .9rem;
    background: var(--primary, #1f6fff);
    color: #fff;
    border: none;
    border-radius: .55rem;
    font-size: .88rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity .15s;
    white-space: nowrap;
    flex-shrink: 0;
}
.pf-topbar-save:hover { opacity: .88; }
.pf-topbar-save:disabled { opacity: .55; cursor: default; }

/* Overrider le bouton × existant (#pro-modal-close) pour l'intégrer dans la topbar */
.pf-topbar .pro-modal-close {
    position: static;
    top: auto;
    right: auto;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    font-size: 1rem;
}

/* Carte identité */
.pf-identity-card {
    background: var(--card-bg, #f5f7fb);
    border: 1.5px solid var(--border-light, #e3e8f0);
    border-radius: .85rem;
    padding: .75rem 1rem;
    margin-bottom: 1rem;
}
.pf-identity-card__name {
    font-size: .97rem;
    font-weight: 700;
    color: var(--text-primary, #1a1a1a);
    margin: 0 0 .2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pf-identity-card__sub {
    font-size: .78rem;
    color: var(--muted, #6b7280);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Tab navigation */
.pf-tab-nav {
    display: flex;
    gap: 0;
    border-bottom: 1.5px solid var(--line, #e6ebf2);
    margin-bottom: 1.1rem;
    overflow-x: auto;
    scrollbar-width: none;
}
.pf-tab-nav::-webkit-scrollbar { display: none; }
.pf-tab {
    padding: .55rem .75rem;
    border: none;
    background: none;
    font: inherit;
    font-size: .82rem;
    font-weight: 600;
    color: var(--muted, #6b7280);
    cursor: pointer;
    border-bottom: 2.5px solid transparent;
    margin-bottom: -1.5px;
    white-space: nowrap;
    transition: color .15s, border-color .15s;
    flex-shrink: 0;
}
.pf-tab:hover { color: var(--text-primary, #1a1a1a); }
.pf-tab.active,
.pf-tab[aria-selected="true"] {
    color: var(--primary, #1f6fff);
    border-bottom-color: var(--primary, #1f6fff);
}

/* Tab panels */
.pf-tab-panel { padding: 0; }

/* Section label dans onglet */
.pf-section-label {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--muted, #6b7280);
    margin: 0 0 1rem;
}
.pf-section-desc {
    font-size: .82rem;
    color: var(--muted, #6b7280);
    margin: -.5rem 0 1rem;
    line-height: 1.4;
}

/* Subsection Identité (collapsible) */
.pf-subsection {
    border: 1.5px solid var(--border-light, #e3e8f0);
    border-radius: .75rem;
    padding: .85rem 1rem;
    margin-bottom: 1rem;
}
.pf-subsection summary.pf-subsection-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    list-style: none;
    font-size: .92rem;
    font-weight: 700;
    color: var(--text-primary, #1a1a1a);
    gap: .5rem;
}
.pf-subsection summary::-webkit-details-marker { display: none; }
.pf-subsection summary::after {
    content: 'Réduire';
    font-size: .75rem;
    font-weight: 600;
    color: var(--muted, #6b7280);
    background: var(--card-bg, #f5f7fb);
    border: 1px solid var(--border-light, #e3e8f0);
    border-radius: .4rem;
    padding: .15rem .5rem;
    flex-shrink: 0;
}
.pf-subsection:not([open]) summary::after { content: 'Développer'; }
.pf-subsection > :not(summary) { margin-top: 1rem; }

/* Résumé rapide */
.pf-resume-rapide {
    background: var(--card-bg, #f5f7fb);
    border-radius: .75rem;
    padding: .85rem 1rem;
    margin-bottom: 1rem;
}
.pf-muted {
    font-size: .82rem;
    color: var(--muted, #6b7280);
    margin: 0;
    line-height: 1.4;
}

/* Liens légaux panel appareil */
.profile-legal-links {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem .5rem;
    align-items: center;
    margin-top: 1rem;
    font-size: .75rem;
}
.profile-legal-links a { color: var(--muted, #6b7280); text-decoration: none; }
.profile-legal-links a:hover { text-decoration: underline; }

/* Override padding modal card — padding-top géré par .pf-topbar */
.pro-modal-card { padding: 0 20px 32px; }


.profile-form { padding: 4px 0 8px; }
.profile-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.profile-field label { font-size: 13px; font-weight: 600; color: #444; }
.profile-field input[type="text"],
.profile-field input[type="number"],
.profile-field select {
  border: 1.5px solid #ddd; border-radius: 8px;
  padding: 9px 12px; font-size: 15px; background: #fafafa;
  transition: border-color 0.15s;
}
.profile-field input:focus, .profile-field select:focus {
  border-color: var(--primary); outline: none; background: #fff;
}
.profile-field--row { flex-direction: row; align-items: flex-start; gap: 16px; }
.profile-field--row > div { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.profile-device-section {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line, #e6ebf2);
}
.profile-device-section .profile-section-title {
  margin: 0 0 8px;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted, #6b7280);
}
.profile-device-email {
  margin: 0 0 10px;
  font-size: .92rem;
  color: var(--text, #18202a);
  word-break: break-word;
}
.profile-device-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.btn-device-action {
  min-height: 40px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-size: .82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, opacity .18s ease, border-color .18s ease;
}
.btn-device-action:disabled {
  opacity: .6;
  cursor: default;
}
.btn-device-action--logout {
  background: rgba(224, 68, 68, 0.08);
  border-color: rgba(224, 68, 68, 0.25);
  color: #b42318;
}
.btn-device-action--logout:hover:not(:disabled),
.btn-device-action--logout:focus-visible:not(:disabled) {
  background: #b42318;
  border-color: #b42318;
  color: #fff;
}
.profile-device-hint {
  margin: 10px 0 0;
  font-size: .76rem;
  color: var(--muted, #6b7280);
}
/* Checkbox inline dans le profil */
.profile-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text, #1a1a2e);
  line-height: 1.4;
}
.profile-checkbox-label input[type="checkbox"] {
  flex-shrink: 0;
  margin-top: 2px;
  width: 18px;
  height: 18px;
  accent-color: var(--primary, #1f6fff);
  cursor: pointer;
}
.profile-toggle-group { display: flex; gap: 6px; }
.profile-toggle {
  flex: 1; padding: 7px 10px; border: 1.5px solid #ddd; border-radius: 8px;
  background: #f5f5f5; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: all 0.15s;
}
.profile-toggle.active {
  background: var(--primary); color: #fff; border-color: var(--primary);
}
.profile-form-actions { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.btn-profile-save {
  padding: 10px 22px; background: var(--primary); color: #fff;
  border: none; border-radius: 8px; font-size: 15px; font-weight: 700;
  cursor: pointer; transition: opacity 0.15s;
}
.btn-profile-save:hover { opacity: 0.88; }
.profile-save-status { font-size: 13px; color: #0f9f6e; font-weight: 600; }

/* ── Titre + bouton éditer dans la card dossier ──────────────────────── */
.dossier-card__titlerow {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .4rem;
  margin-bottom: .25rem;
}
.dossier-card__titlerow .dossier-card__title { margin-bottom: 0; }
.dossier-edit-btn {
  background: none;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: .4rem;
  padding: .15rem .4rem;
  font-size: .85rem;
  cursor: pointer;
  color: var(--muted);
  flex-shrink: 0;
  line-height: 1;
  transition: background .12s, border-color .12s;
}
.dossier-edit-btn:hover {
  background: var(--primary-soft, #e8f0ff);
  border-color: var(--primary-border, rgba(31,111,255,.45));
  color: var(--primary, #1f6fff);
}

/* ── Modale qualification dossier ────────────────────────────────────── */
.qualify-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9500;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
@media (min-width: 600px) {
  .qualify-modal-overlay { align-items: center; }
}
.qualify-modal-box {
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 24px 20px 32px;
  width: 100%;
  max-width: 480px;
  max-height: 92vh;
  overflow-y: auto;
}
@media (min-width: 600px) {
  .qualify-modal-box { border-radius: 20px; max-height: 80vh; }
}
.qualify-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.qualify-modal-header h3 { margin: 0; font-size: 1.05rem; font-weight: 700; }
.qualify-modal-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: #888;
  cursor: pointer;
  padding: 0 4px;
}
.qualify-modal-hint {
  font-size: .82rem;
  color: var(--muted);
  margin: 0 0 14px;
}
.qualify-sim-recap {
  background: var(--primary-soft, #e8f0ff);
  border: 1px solid var(--primary-border, rgba(31,111,255,.45));
  border-radius: 10px;
  padding: 10px 12px;
  font-size: .8rem;
  color: var(--primary, #1f6fff);
  margin-bottom: 14px;
  line-height: 1.5;
}
.qualify-sim-recap strong { display: block; margin-bottom: 3px; font-size: .82rem; }
.qualify-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 12px;
}
.qualify-field label {
  font-size: .82rem;
  font-weight: 600;
  color: #444;
}
.qualify-field input,
.qualify-field textarea {
  width: 100%;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: .9rem;
  font-family: inherit;
  background: #fafafa;
  box-sizing: border-box;
  transition: border-color .15s;
}
.qualify-field input:focus,
.qualify-field textarea:focus { border-color: var(--primary, #1f6fff); outline: none; background: #fff; }
.qualify-field textarea { resize: vertical; min-height: 3rem; }
.qualify-modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  justify-content: flex-end;
}
.qualify-modal-cancel {
  background: none;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 9px 18px;
  font-size: .88rem;
  color: #666;
  cursor: pointer;
}
.qualify-modal-confirm {
  padding: 10px 22px;
  font-size: .9rem;
  font-weight: 700;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary, #1f6fff), var(--primary-strong, #4d8cff));
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 16px var(--primary-shadow, rgba(31,111,255,.26));
}
.qualify-modal-confirm:disabled { opacity: .5; cursor: not-allowed; }

/* ── Éditeur pleine page (project editor overlay) ────────────────────── */
.project-editor-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: var(--bg, #f5f7fb);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  pointer-events: none;
}
.project-editor-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: .85rem 1rem;
  background: #fff;
  border-bottom: 1px solid var(--border, #e5e7eb);
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.editor-title-input {
  flex: 1;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: .25rem .1rem;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  background: transparent;
  color: var(--text, #18202a);
  transition: border-color .15s;
  min-width: 0;
}
.editor-title-input:focus { border-bottom-color: var(--primary, #1f6fff); outline: none; }
.editor-header-date {
  font-size: .72rem;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.editor-sim-btn {
  flex-shrink: 0;
  background: var(--primary-soft, #e8f0ff);
  color: var(--primary, #1f6fff);
  border: 1px solid var(--primary-border, rgba(31,111,255,.45));
  border-radius: 8px;
  padding: .3rem .65rem;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
}
.editor-close-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  font-size: 1.3rem;
  color: #888;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.project-editor-body {
  flex: 1;
  overflow-y: auto;
  padding: .9rem;
}
.editor-section {
  background: #fff;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: .75rem;
  padding: .9rem 1rem;
  margin-bottom: .9rem;
}
.editor-section h4 {
  margin: 0 0 .6rem;
  font-size: .78rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.editor-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}
.editor-field:last-child { margin-bottom: 0; }
.editor-field label { font-size: .78rem; font-weight: 600; color: #555; }
.editor-field input,
.editor-field textarea,
.editor-field select {
  width: 100%;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: .88rem;
  font-family: inherit;
  background: #fafafa;
  box-sizing: border-box;
  transition: border-color .15s;
}
.editor-field input:focus,
.editor-field textarea:focus,
.editor-field select:focus { border-color: var(--primary, #1f6fff); outline: none; background: #fff; }
.editor-field textarea { resize: vertical; min-height: 3.5rem; }
.editor-sim-recap {
  background: var(--primary-soft, #e8f0ff);
  border: 1px solid var(--primary-border, rgba(31,111,255,.45));
  border-radius: .6rem;
  padding: .7rem .9rem;
  font-size: .8rem;
  color: var(--primary, #1f6fff);
  line-height: 1.55;
}
.editor-sim-recap p { margin: .15rem 0; }
.editor-devis-lines {
  width: 100%;
  border-collapse: collapse;
  font-size: .8rem;
  margin-top: .4rem;
}
.editor-devis-lines th {
  text-align: left;
  padding: .2rem .3rem;
  border-bottom: 2px solid #e5e7eb;
  font-weight: 600;
  color: #888;
  font-size: .72rem;
  text-transform: uppercase;
}
.editor-devis-lines td { padding: .25rem .3rem; border-bottom: 1px solid #f0f0f0; }
.editor-devis-lines .line-mat { color: var(--warning, #c77d00); }
.editor-save-row {
  padding: .85rem 1rem;
  border-top: 1px solid var(--border, #e5e7eb);
  background: #fff;
  flex-shrink: 0;
  display: flex;
  gap: 10px;
  align-items: center;
}
.editor-save-btn {
  flex: 1;
  padding: 12px;
  background: linear-gradient(135deg, var(--primary, #1f6fff), var(--primary-strong, #4d8cff));
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: .92rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 6px 16px var(--primary-shadow, rgba(31,111,255,.26));
}
.editor-save-btn:disabled { opacity: .5; cursor: not-allowed; }
.editor-save-status { font-size: .8rem; color: var(--success, #0f9f6e); font-weight: 600; }

/* ── Cards légères dossiers — spec §2 ───────────────────────────────────── */
.dossier-card {
  display: flex;
  align-items: center;
  gap: .5rem;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: .75rem;
  padding: .75rem .9rem;
  margin-bottom: .55rem;
  background: var(--surface, #f9fafb);
  cursor: pointer;
  transition: background .12s, box-shadow .12s;
  -webkit-tap-highlight-color: transparent;
}
.dossier-card:hover { background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.07); }
.dossier-card:active { background: var(--primary-soft, #e8f0ff); }
.dossier-card__body { flex: 1; min-width: 0; }
.dossier-card__title { font-weight: 600; font-size: .95rem; margin-bottom: .2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dossier-card__meta { font-size: .75rem; color: var(--muted); display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; }
.dossier-card__date { color: var(--muted); }
.dossier-card__client { color: var(--text); font-weight: 500; }
.dossier-card__summary { font-size: .75rem; color: var(--muted); margin-top: .2rem; }
.dossier-card__arrow { color: var(--muted); font-size: 1.2rem; flex-shrink: 0; }
.dossier-simulation-reload-btn {
  background: var(--primary-soft, #e8f0ff);
  color: var(--primary, #1f6fff);
  border: none;
  border-radius: .5rem;
  font-size: .78rem;
  font-weight: 700;
  padding: .3rem .6rem;
  cursor: pointer;
  white-space: nowrap;
}
.dossier-card--offline {}

/* Cartes simulation — header */
.sim-card__header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.sim-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.sim-card__margin {
  font-size: .85rem;
  font-weight: 600;
  color: var(--text, #374151);
}

/* Badges libre / gelée */
.sim-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: .68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
}
.sim-badge--free {
  background: #f3f4f6;
  color: var(--muted);
  border: 1px solid var(--border);
}
.sim-badge--frozen {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

/* Badge verdict */
.sim-verdict {
  font-size: .72rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
}
.sim-verdict--healthy {
  background: #e6f8f0;
  color: #1a7a4a;
}
.sim-verdict--tight {
  background: #fef3e2;
  color: #92550a;
}
.sim-verdict--loss {
  background: #fef2f2;
  color: #b91c1c;
}

/* Source partenaire */
.sim-partner-hint {
  font-size: .72rem;
  color: var(--primary);
  font-style: italic;
}

/* CTA sim */
.sim-cta-link {
  display: inline-block;
  font-size: .78rem;
  font-weight: 600;
  color: var(--primary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.sim-cta-link--convert {
  color: var(--primary);
  font-size: .75rem;
  opacity: .85;
}

/* Colonne d'actions non-frozen (reload + créer chantier) */
.sim-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .35rem;
}

/* Colonne droite des sim cards (override dossier-card__arrow) */
.sim-card__arrow {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: .35rem;
}

/* Icône crayon SVG inline */
.sim-rename-ico {
  vertical-align: middle;
  opacity: .45;
  margin-left: 3px;
  flex-shrink: 0;
}
.sim-name-label:hover .sim-rename-ico { opacity: .75; }

/* Tag chips */
.sim-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #E07B2A;
  color: #fff;
  font-size: .68rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: .3rem;
  margin: 1px 2px 1px 0;
}
.sim-tag-remove {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  padding: 0;
  font-size: .7rem;
  line-height: 1;
  opacity: .75;
}
.sim-tag-remove:hover { opacity: 1; }

/* Bouton + ajouter tag */
.sim-tag-add-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--border, #e5e7ef);
  background: none;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
  vertical-align: middle;
  transition: border-color .12s, color .12s;
  padding: 0;
}
.sim-tag-add-btn:hover { border-color: var(--primary); color: var(--primary); }

/* Input inline tag */
.sim-tag-input {
  width: 90px;
  border: 1.5px solid var(--primary, #1f6fff);
  border-radius: .3rem;
  padding: 2px 6px;
  font-size: .72rem;
  outline: none;
  vertical-align: middle;
}

/* Input inline renommage simulation */
.sim-name-input {
  border: 1.5px solid var(--primary, #1f6fff);
  border-radius: .4rem;
  padding: 3px 8px;
  font-size: .93rem;
  font-weight: 600;
  outline: none;
  width: 100%;
  max-width: 200px;
}

/* Carte gelée — subtle différentiation */
.dossier-card--frozen {
  border-left: 3px solid #bfdbfe;
}

/* Filtre bar */
.sim-filter-bar {
  display: flex;
  gap: 6px;
  padding: .5rem 0 .75rem;
}
.sim-filter-btn {
  flex: 1;
  padding: 6px 4px;
  font-size: .75rem;
  font-weight: 600;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.sim-filter-btn.active {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft, #eff6ff);
}
.sim-filter-count {
  font-size: .68rem;
  font-weight: 700;
  margin-left: 3px;
  opacity: .7;
}

/* Badge hors ligne dans le listing */
.dossier-offline-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  background: #e6f8f0;
  color: #1a7a4a;
  border: 1px solid #9ed9bc;
  vertical-align: middle;
}
.dossier-offline-chip::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #1a7a4a;
  flex-shrink: 0;
}

/* Bannière "Mode hors ligne" au-dessus du listing */
.offline-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .8rem;
  font-weight: 600;
  color: #92550a;
  background: #fef3e2;
  border: 1px solid #f6cfa0;
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 10px;
}
.offline-notice::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
  flex-shrink: 0;
}

/* ── Écran chantier (project-editor-overlay) — transitions ──────────────── */
.project-editor-overlay {
  transform: translateX(100%);
  transition: transform .24s cubic-bezier(.4,0,.2,1);
}
.project-editor-overlay.open { transform: translateX(0); pointer-events: auto; }

/* ── Statut + date dans l'écran chantier ────────────────────────────────── */
.editor-status-row {
  display: flex;
  gap: .5rem;
  align-items: center;
  padding: .25rem .2rem;
  margin-bottom: .45rem;
}
.editor-status-select {
  flex: 1;
  font-size: .82rem;
  padding: .35rem .5rem;
  border: 1.5px solid var(--border, #e5e7eb);
  border-radius: .5rem;
  font-family: inherit;
  background: #fff;
}
.editor-started-date {
  font-size: .82rem;
  padding: .35rem .5rem;
  border: 1.5px solid var(--border, #e5e7eb);
  border-radius: .5rem;
  font-family: inherit;
  background: #fff;
  width: auto;
}

/* ── Label de section chantier ─────────────────────────────────────────── */
.editor-section-label {
  font-size: .72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: .5rem;
  display: flex;
  align-items: center;
}

/* ── Section éditeur hors ligne ─────────────────────────────────────────── */
.editor-section--offline {
  border-color: var(--border);
  transition: border-color .25s, background .25s;
}
.editor-section--offline.is-offline-ready {
  background: #f0faf5;
  border-color: #a8d5bb;
}
.ed-offline-icon {
  vertical-align: -2px;
  margin-right: 5px;
  opacity: .7;
  flex-shrink: 0;
}
.editor-offline-row {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}
.editor-offline-copy {
  flex: 1;
  min-width: 0;
}
.editor-offline-actions {
  flex-shrink: 0;
}
.editor-offline-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  letter-spacing: .3px;
  margin-bottom: .4rem;
}
.editor-offline-chip--idle {
  background: #fef3e2;
  color: #92550a;
  border: 1px solid #f6cfa0;
}
.editor-offline-chip--ready {
  background: #e6f8f0;
  color: #1a7a4a;
  border: 1px solid #9ed9bc;
}
.editor-offline-chip--locked {
  background: #f3f4f6;
  color: var(--muted);
  border: 1px solid var(--border);
}
.editor-offline-chip--pending {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}
.editor-offline-hint {
  font-size: .84rem;
  color: var(--text, #374151);
  margin: 0 0 .2rem;
  line-height: 1.4;
}
.editor-offline-caption {
  font-size: .75rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.4;
}
.editor-offline-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .82rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--text, #374151);
  cursor: pointer;
  transition: border-color .18s, background .18s, color .18s;
  white-space: nowrap;
}
.editor-offline-toggle-btn:hover {
  border-color: #9ed9bc;
  background: #f0faf5;
  color: #1a7a4a;
}
.editor-offline-toggle-btn.is-active {
  background: #e6f8f0;
  border-color: #9ed9bc;
  color: #1a7a4a;
  font-weight: 700;
}
.editor-offline-toggle-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}
.ed-offline-badge {
  font-size: .78rem;
  color: #b45309;
  padding: .35rem .75rem;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  margin: .25rem .75rem 0;
  text-align: center;
}

/* ── Client chip + formulaire inline ────────────────────────────────────── */
.editor-client-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: var(--primary-soft, #e8f0ff);
  color: var(--primary, #1f6fff);
  border-radius: 99px;
  padding: .3rem .7rem;
  font-size: .8rem;
  font-weight: 600;
}
.editor-link-btn {
  background: none;
  border: none;
  color: var(--primary, #1f6fff);
  font-size: .78rem;
  cursor: pointer;
  padding: .15rem .3rem;
  font-family: inherit;
  text-decoration: underline;
}

/* ── Boutons outline SVG — éditeur de chantier ─────────────────────────── */
.editor-btn-outline {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: var(--primary-soft, #e8f0ff);
  color: var(--primary, #1f6fff);
  border: 1.5px solid var(--primary-border, rgba(31,111,255,.4));
  border-radius: .5rem;
  padding: .38rem .7rem;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background .12s, border-color .12s;
  text-decoration: none;
}
.editor-btn-outline:hover { background: #d4e5ff; border-color: var(--primary, #1f6fff); }
.editor-btn-outline:active { background: #c0d8ff; }
.editor-btn-outline svg { flex-shrink: 0; }

.editor-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: .4rem;
  padding: .25rem;
  cursor: pointer;
  color: var(--primary, #1f6fff);
  transition: background .12s, border-color .12s;
  line-height: 1;
}
.editor-btn-icon:hover { background: var(--primary-soft, #e8f0ff); border-color: var(--primary-border, rgba(31,111,255,.4)); }
.editor-btn-icon svg { display: block; }
.editor-subform {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  margin-top: .5rem;
}
.editor-subform input {
  width: 100%;
  border: 1.5px solid var(--border, #e5e7eb);
  border-radius: .5rem;
  padding: .5rem .65rem;
  font-size: .85rem;
  font-family: inherit;
  background: #fafafa;
  box-sizing: border-box;
}
.editor-addr-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: #f0fdf4;
  color: #16a34a;
  border-radius: 99px;
  padding: .3rem .7rem;
  font-size: .8rem;
  font-weight: 500;
}

/* ── Résumé §7 ─────────────────────────────────────────────────────────── */
.editor-resume-row {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  padding: .55rem .65rem;
  background: #fff;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: .6rem;
  margin-bottom: .6rem;
}
.editor-resume-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 60px;
  flex: 1;
}
.editor-resume-stat strong { font-size: 1rem; font-weight: 700; color: var(--text); }
.editor-resume-stat span   { font-size: .68rem; color: var(--muted); margin-top: 1px; text-align: center; }
.editor-resume-gain strong { color: var(--success, #0f9f6e); }
.editor-resume-verdict {
  width: 100%;
  font-size: .78rem;
  font-weight: 600;
  color: var(--muted);
  text-align: center;
  padding-top: .25rem;
  border-top: 1px solid var(--border, #e5e7eb);
  margin-top: .25rem;
}

/* ── Historique logs tableau §7b ─────────────────────────────────────────── */
.editor-logs-details {
  margin-bottom: .6rem;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: .75rem;
  overflow: hidden;
  background: #fff;
}
.editor-logs-summary {
  padding: .55rem .9rem;
  font-size: .82rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: .4rem;
  user-select: none;
}
.editor-logs-summary::-webkit-details-marker { display: none; }
.editor-logs-details[open] .editor-logs-summary { border-bottom: 1px solid var(--border, #e5e7eb); }
.editor-logs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .8rem;
}
.editor-logs-table thead th {
  padding: .35rem .7rem;
  text-align: left;
  color: var(--muted);
  font-weight: 600;
  font-size: .73rem;
  background: var(--bg, #f9fafb);
  border-bottom: 1px solid var(--border, #e5e7eb);
}
.editor-logs-table tbody tr { border-bottom: 1px solid var(--border-light, #f3f4f6); }
.editor-logs-table tbody tr:last-child { border-bottom: none; }
.editor-log-row td {
  padding: .45rem .7rem;
  vertical-align: top;
}
.editor-log-row .log-date { color: var(--muted); white-space: nowrap; width: 4rem; }
.editor-log-row .log-qty  { font-weight: 600; white-space: nowrap; width: 4.5rem; }
.editor-log-row .log-mat  { font-weight: 600; white-space: nowrap; width: 5.5rem; }
.editor-log-row .log-desc { color: var(--muted); }
.editor-logs-empty { color: var(--muted); font-style: italic; padding: .7rem; text-align: center; }

/* ── Section ➕ Ajouter §7 ──────────────────────────────────────────────── */
.editor-add-section { margin-bottom: .6rem; }
.editor-add-chips {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
  padding: .5rem .9rem;
}
.editor-add-chip {
  padding: .4rem .85rem;
  border-radius: 99px;
  border: 1.5px solid var(--border, #e5e7eb);
  background: #fff;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
  font-family: inherit;
}
.editor-add-chip:hover,
.editor-add-chip.active {
  background: var(--primary-soft, #e8f0ff);
  border-color: var(--primary-border, rgba(31,111,255,.45));
  color: var(--primary, #1f6fff);
}
.editor-add-form {
  background: #fff;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: .75rem;
  padding: .75rem .9rem;
  margin: 0 .4rem .6rem;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.editor-add-form input,
.editor-add-form textarea {
  width: 100%;
  border: 1.5px solid var(--border, #e5e7eb);
  border-radius: .5rem;
  padding: .45rem .6rem;
  font-size: .85rem;
  font-family: inherit;
  background: #fafafa;
  box-sizing: border-box;
}
.editor-add-form button[type="submit"] { align-self: flex-start; }

/* ── Notes textarea ─────────────────────────────────────────────────────── */
.editor-notes-textarea {
  width: 100%;
  border: 1.5px solid var(--border, #e5e7eb);
  border-radius: .5rem;
  padding: .5rem .65rem;
  font-size: .85rem;
  font-family: inherit;
  background: #fafafa;
  box-sizing: border-box;
  resize: vertical;
  min-height: 3rem;
}
.editor-notes-textarea:focus { border-color: var(--primary, #1f6fff); outline: none; background: #fff; }

/* ── Devis existant preview ───────────────────────────────────────────── */
.editor-devis-preview {
  background: #fff;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: .75rem;
  padding: .75rem .9rem;
  margin-bottom: .6rem;
}

/* ── Bouton créer / modifier le devis ───────────────────────────────────── */
.editor-create-devis-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  width: 100%;
  padding: .75rem;
  border-radius: .75rem;
  border: 2px solid var(--primary, #1f6fff);
  background: var(--primary-soft, #e8f0ff);
  color: var(--primary, #1f6fff);
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background .12s;
}
.editor-create-devis-btn:hover { background: #d4e5ff; }

/* ── Formulaire devis collapsible dans l'écran chantier ─────────────────── */
.editor-devis-form-wrap {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  margin-top: .55rem;
  padding: .55rem;
  background: #fafafa;
  border-radius: .6rem;
  border: 1px solid var(--border, #e5e7eb);
}

/* ── Panel Statistiques (nav stats) ───────────────────────────────────── */
.stats-panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(420px, 100vw);
  background: #fff;
  z-index: 900;
  display: none;
  flex-direction: column;
  transform: translateX(100%);
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.27s cubic-bezier(.4,0,.2,1);
  box-shadow: -6px 0 32px rgba(0,0,0,.12);
}
.stats-panel--open { display: flex; transform: translateX(0); visibility: visible; pointer-events: auto; }

/* ── Referral panel ───────────────────────────────────────────────── */
.referral-panel {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(420px, 100vw);
  background: #fff;
  z-index: 900;
  display: none;
  flex-direction: column;
  transform: translateX(100%);
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.27s cubic-bezier(.4,0,.2,1);
  box-shadow: -6px 0 32px rgba(0,0,0,.12);
}
.referral-panel--open { display: flex; transform: translateX(0); visibility: visible; pointer-events: auto; }
.referral-panel__header {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1rem 1rem 1rem 1.2rem;
  border-bottom: 1px solid #eee;
}
.referral-panel__header h2 {
  flex: 1;
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
}
.referral-panel__body {
  flex: 1;
  overflow-y: auto;
  padding: 1.2rem 1.1rem 6rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

/* ── Referral panel content ───────────────────────────────────────── */
.referral-loading { color: var(--muted); font-size: .9rem; }

.referral-hero {
  text-align: center;
  padding: .25rem 0 0;
}
.referral-hero h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 .45rem;
  line-height: 1.35;
}
.referral-hero p {
  font-size: .84rem;
  color: var(--muted);
  margin: 0 0 .6rem;
}
.referral-status-pill {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .25rem .75rem;
  border-radius: 99px;
  font-size: .78rem;
  font-weight: 600;
}
.referral-status-pill--default { background: var(--primary-soft); color: var(--primary); }
.referral-status-pill--pro { background: #fef3c7; color: #92400e; }
.referral-status-pill--ambassador { background: #d1fae5; color: #065f46; }

.referral-progress-card {
  background: var(--primary-soft);
  border-radius: 1rem;
  padding: 1rem 1.1rem;
}
.referral-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: .55rem;
}
.referral-progress-label {
  font-size: .75rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.referral-progress-count {
  font-size: 1rem;
  font-weight: 700;
}
.referral-progress-track {
  height: 7px;
  border-radius: 99px;
  background: rgba(31,111,255,.15);
  overflow: hidden;
  margin-bottom: .5rem;
}
.referral-progress-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--primary);
  transition: width .45s ease;
}
.referral-progress-hint {
  font-size: .82rem;
  color: var(--muted);
  margin: 0;
}

.referral-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .6rem;
}
.referral-kpi-card {
  background: var(--primary-soft);
  border-radius: .9rem;
  padding: .9rem .5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
  text-align: center;
}
.referral-kpi-card strong {
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1;
  color: var(--primary);
}
.referral-kpi-card p {
  font-size: .72rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.3;
}

.referral-how-section h4 {
  font-size: .75rem;
  font-weight: 700;
  margin: 0 0 .7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.referral-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .55rem;
}
.referral-step {
  display: flex;
  align-items: flex-start;
  gap: .8rem;
  background: var(--primary-soft);
  border-radius: .9rem;
  padding: .9rem 1rem;
}
.referral-step-num {
  min-width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: .8rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.referral-step-body strong {
  display: block;
  font-size: .9rem;
  font-weight: 700;
  margin-bottom: .15rem;
}
.referral-step-body p {
  font-size: .82rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.4;
}

.referral-empty-state {
  border: 1.5px dashed #d0d9e8;
  border-radius: 1rem;
  padding: 1.4rem 1rem;
  text-align: center;
}
.referral-empty-state h4 {
  font-size: .95rem;
  font-weight: 700;
  margin: 0 0 .4rem;
}
.referral-empty-state p {
  font-size: .84rem;
  color: var(--muted);
  margin: 0;
}

.referral-share-card {
  display: flex;
  flex-direction: column;
  gap: .6rem;
}

.stats-panel__header {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1rem 1rem 1rem 1.2rem;
  border-bottom: 1px solid #eee;
}
.stats-panel__header h2 {
  flex: 1;
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
}

.stats-panel__body {
  flex: 1;
  overflow-y: auto;
  padding: 1.2rem 1.1rem 6rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.stats-loading { color: var(--muted); font-size: .9rem; }

.stats-kpis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .8rem;
}
.stats-kpi {
  background: var(--primary-soft, #edf3ff);
  border-radius: 1rem;
  padding: 1rem .9rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25rem;
}
.stats-kpi__val {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--primary, #1f6fff);
  line-height: 1;
}
.stats-kpi__lbl {
  font-size: .75rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.stats-section-title {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin-bottom: -.4rem;
}
.stats-rows { display: flex; flex-direction: column; gap: .5rem; }
.stats-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .6rem .8rem;
  background: #f9f9f9;
  border-radius: .6rem;
  font-size: .9rem;
}
.stats-row strong { color: var(--primary, #1f6fff); font-weight: 700; }

/* ── S9 — Devis Ready Sheet ─────────────────────────────────────────────── */
.drs-overlay {
  position: fixed; inset: 0; z-index: 1200;
  background: rgba(16,24,40,.45);
  backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center;
  pointer-events: none;
  opacity: 0; transition: opacity .25s;
}
.drs-overlay.drs-visible { opacity: 1; pointer-events: auto; }
.drs-sheet {
  width: 100%; max-width: 480px;
  background: var(--panel-strong, #fff);
  border-radius: 24px 24px 0 0;
  padding: 0 0 env(safe-area-inset-bottom);
  transform: translateY(100%);
  transition: transform .32s cubic-bezier(.4,0,.2,1);
  max-height: 92svh;
  overflow-y: auto;
}
.drs-overlay.drs-visible .drs-sheet { transform: translateY(0); }
.drs-handle {
  width: 40px; height: 4px;
  background: var(--line, #e6ebf2);
  border-radius: 99px;
  margin: .75rem auto .25rem;
}
.drs-header {
  display: flex; align-items: center; gap: .6rem;
  padding: .6rem 1rem 1rem;
}
.drs-check {
  width: 2rem; height: 2rem;
  background: var(--success-soft, #e8f8f1);
  color: var(--success, #0f9f6e);
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 1.1rem; font-weight: 800;
  flex-shrink: 0;
}
.drs-header h2 {
  flex: 1; margin: 0;
  font-size: 1.1rem; font-weight: 800;
  color: var(--text, #18202a);
}
.drs-close {
  width: 2rem; height: 2rem;
  background: var(--panel-alt, #f9fbff);
  border: 1px solid var(--line, #e6ebf2);
  border-radius: 50%;
  font-size: 1.1rem; line-height: 1;
  cursor: pointer; color: var(--muted, #667085);
  display: grid; place-items: center;
}
.drs-body { padding: 0 1rem 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
.drs-summary {
  background: var(--primary, #1f6fff);
  border-radius: var(--radius-lg, 18px);
  padding: 1.25rem 1.25rem;
  display: flex; flex-direction: column; gap: .2rem;
}
.drs-summary-name { font-size: .85rem; color: rgba(255,255,255,.75); }
.drs-summary-total {
  font-size: 2.4rem; font-weight: 800;
  color: #fff; letter-spacing: -.02em; line-height: 1;
}
.drs-summary-sub { font-size: .8rem; color: rgba(255,255,255,.65); }
.drs-qr-wrap { display: flex; flex-direction: column; align-items: center; gap: .5rem; }
.drs-qr {
  width: 140px; height: 140px;
  border-radius: 12px;
  border: 1px solid var(--line, #e6ebf2);
}
.drs-qr-hint { font-size: .8rem; color: var(--muted, #667085); margin: 0; }
.drs-actions {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: .6rem;
}
.drs-action-btn {
  background: var(--panel-alt, #f9fbff);
  border: 1.5px solid var(--line, #e6ebf2);
  border-radius: var(--radius-lg, 18px);
  padding: .9rem .5rem;
  font-size: .82rem; font-weight: 700;
  color: var(--text, #18202a);
  cursor: pointer;
  display: flex; flex-direction: column;
  align-items: center; gap: .35rem;
  transition: background .15s, border-color .15s;
}
.drs-action-btn:active { background: var(--primary-soft, #e8f0ff); border-color: var(--primary-border); }
.drs-action-btn svg { color: var(--primary, #1f6fff); }
.drs-input-row {
  display: flex; gap: .5rem;
  animation: drs-fadein .18s ease;
}
@keyframes drs-fadein { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:none; } }
.drs-input {
  flex: 1;
  padding: .7rem .9rem;
  border: 1.5px solid var(--primary-border, rgba(31,111,255,.45));
  border-radius: var(--radius-lg, 18px);
  font-size: .95rem;
  background: var(--panel-strong, #fff);
  color: var(--text, #18202a);
  outline: none;
}
.drs-input:focus { border-color: var(--primary, #1f6fff); box-shadow: 0 0 0 3px var(--primary-ring, rgba(31,111,255,.1)); }
.drs-send-confirm {
  background: var(--primary, #1f6fff);
  color: #fff;
  border: none;
  border-radius: var(--radius-lg, 18px);
  padding: .7rem 1rem;
  font-size: .9rem; font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity .15s;
}
.drs-send-confirm:disabled { opacity: .5; cursor: default; }
.drs-feedback {
  font-size: .85rem; font-weight: 600;
  padding: .5rem .75rem;
  border-radius: 8px;
  text-align: center;
}
.drs-feedback--ok  { background: var(--success-soft, #e8f8f1); color: var(--success, #0f9f6e); }
.drs-feedback--err { background: var(--danger-soft, #fff0ef);  color: var(--danger, #d92d20); }

/* ── Select unité durée Heures / Jours (duration-switch plugin) ──────────── */
.duration-unit-select {
  flex: 1 0 0;
  min-width: 0;
  width: 0;
  min-height: 44px;
padding: 11px 14px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.82);
    font-size: 0.9rem;
    color: var(--text);
    cursor: pointer;
    appearance: auto;
}
.duration-unit-select:hover,
.duration-unit-select:focus {
  background: var(--primary-soft, #e8f0ff);
  border-color: var(--primary, #1f6fff);
}

/* ── Tunnel activation — UI primitives ─────────────────────────────────── */

/* Toast — haut de l'écran, 5s auto-dismiss */
.mp-toast {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1800;
  background: var(--surface, #fff);
  border: 1.5px solid var(--primary-border, rgba(31,111,255,.3));
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0,0,0,.14);
  padding: .85rem 1rem;
  width: min(92vw, 420px);
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.mp-toast[hidden] { display: none; }
.mp-toast__msg {
  margin: 0;
  font-size: .875rem;
  line-height: 1.45;
  color: var(--text, #1a1a1a);
}
.mp-toast__actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  justify-content: flex-end;
}
.mp-toast__cta {
  padding: .35rem .9rem;
  border-radius: 99px;
  border: none;
  background: var(--primary, #1f6fff);
  color: #fff;
  font-size: .8rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}
.mp-toast__close {
  background: transparent;
  border: none;
  color: var(--muted, #888);
  font-size: 1rem;
  cursor: pointer;
  line-height: 1;
  padding: 2px;
}

/* Bandeau bas — discret, dismiss possible */
.mp-bottom-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1700;
  background: var(--surface, #fff);
  border-top: 1.5px solid var(--border, #e5e8ed);
  box-shadow: 0 -2px 16px rgba(0,0,0,.09);
  padding: .9rem 1rem .9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  flex-wrap: wrap;
}
.mp-bottom-banner[hidden] { display: none; }
.mp-bottom-banner__msg {
  margin: 0;
  font-size: .875rem;
  color: var(--text, #1a1a1a);
  flex: 1 1 auto;
  min-width: 0;
}
.mp-bottom-banner__actions {
  display: flex;
  gap: .5rem;
  flex-shrink: 0;
}
.mp-bottom-banner__cta {
  padding: .45rem 1rem;
  border-radius: 99px;
  border: none;
  background: var(--primary, #1f6fff);
  color: #fff;
  font-size: .82rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  min-height: 40px;
}
.mp-bottom-banner__dismiss {
  background: transparent;
  border: none;
  color: var(--muted, #888);
  font-size: .8rem;
  cursor: pointer;
  font-family: inherit;
  padding: .45rem .5rem;
}

/* Bottom sheet — overlay + carte depuis le bas */
.mp-sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 1900;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: flex-end;
}
.mp-sheet-overlay[hidden] { display: none; }
.mp-sheet {
  background: var(--surface, #fff);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-height: 85vh;
  padding: 1.5rem 1.25rem 2rem;
  display: flex;
  flex-direction: column;
  gap: .85rem;
}
.mp-sheet__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text, #1a1a1a);
}
.mp-sheet__body {
  margin: 0;
  font-size: .9rem;
  line-height: 1.55;
  color: var(--muted, #555);
}
.mp-sheet__cta {
  padding: .85rem 1rem;
  border-radius: 12px;
  border: none;
  background: var(--primary, #1f6fff);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  width: 100%;
  min-height: 48px;
}
.mp-sheet__close {
  background: transparent;
  border: none;
  color: var(--muted, #888);
  font-size: .875rem;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  width: 100%;
  padding: .25rem;
}

/* Note de réassurance confidentialité sous le résultat */
.mp-confidentiality-note {
  margin: .75rem 0 0;
  padding: .5rem .75rem;
  background: #f0f7ff;
  border-left: 3px solid var(--primary, #1f6fff);
  border-radius: 0 8px 8px 0;
  font-size: .78rem;
  color: var(--muted, #555);
}

/* CTA trial dans le Pro modal */
.btn-trial-activate {
  display: block;
  width: 100%;
  padding: .95rem 1rem;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #1f6fff 0%, #0f9f6e 100%);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  text-align: center;
  min-height: 52px;
  transition: opacity .15s;
}
.btn-trial-activate:disabled {
  opacity: .6;
  cursor: wait;
}
.pro-modal-reassurance {
  font-size: .78rem;
  color: var(--muted, #888);
  text-align: center;
  margin: 0;
}
.pro-trial-expired-msg {
  font-size: .875rem;
  color: var(--muted, #555);
  text-align: center;
  margin: 0 0 .5rem;
}
.mp-profil-reassurance {
  margin: .85rem 0 0;
  padding: .55rem .8rem;
  background: #f0f7ff;
  border-left: 3px solid var(--primary, #1f6fff);
  border-radius: 0 8px 8px 0;
  font-size: .76rem;
  color: var(--muted, #555);
  line-height: 1.5;
}

/* ── Badge compteur trial — accroché sur l'icône Mon compte ──────── */
.topo-trial-dot {
  position: absolute;
  top: 1px;
  right: 1px;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  border-radius: 99px;
  background: var(--primary, #1f6fff);
  color: #fff;
  font-size: .6rem;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  pointer-events: none;
  box-shadow: 0 0 0 2px var(--bg, #fff);
}

/* ── Support V8.4 ────────────────────────────────────────────────────────── */

/* Bottom sheet overlay */
.support-overlay {
  position: fixed;
  inset: 0;
  z-index: 8500;
  display: flex;
  flex-direction: column;
  transition: opacity .2s;
}
.support-overlay[hidden] { display: none; }
.support-backdrop {
  flex: 1;
  background: rgba(0, 0, 0, .42);
  backdrop-filter: blur(2px);
}
.support-sheet {
  background: var(--bg, #f5f7fb);
  border-radius: 24px 24px 0 0;
  max-height: 85vh;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, .18);
  transition: transform .24s cubic-bezier(.4, 0, .2, 1);
}
@media (min-width: 600px) {
  .support-overlay { align-items: center; justify-content: center; }
  .support-backdrop { position: absolute; inset: 0; flex: none; }
  .support-sheet {
    position: relative;
    border-radius: 24px;
    max-width: 480px;
    width: 100%;
    max-height: 80vh;
  }
}
.support-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 12px;
  flex-shrink: 0;
  background: var(--panel, #fff);
  border-bottom: 1px solid var(--line, #e6ebf2);
}
.support-header h2 { margin: 0; font-size: 1rem; font-weight: 800; }
.support-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid #d0d8e4 !important;
  background: #f0f4f8;
  color: #4d6278;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .15s, color .15s;
}
.support-close-btn:hover { background: #e2e8ef; color: #1a1a1a; }
.support-back-btn {
  display: none;
  background: none;
  border: none;
  font-size: .85rem;
  cursor: pointer;
  color: var(--primary, #1f6fff);
  padding: 4px 0;
  font-weight: 700;
  gap: 4px;
  align-items: center;
}
.support-back-btn.visible { display: flex; }
.support-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 20px 24px;
}
.support-body--embedded {
  display: flex;
  overflow: hidden;
  padding: 0;
}
.support-iframe-shell {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: min(68vh, 680px);
}
.support-body--embedded .support-iframe-shell {
  flex: 1;
  min-height: 0;
  height: 100%;
  box-sizing: border-box;
  padding: 16px 20px 24px;
}
.support-iframe {
  flex: 1;
  width: 100%;
  min-height: min(64vh, 620px);
  border: 0;
  border-radius: 18px;
  background: var(--panel, #fff);
}
.support-body--embedded .support-iframe {
  min-height: 0;
  height: 100%;
}
.support-body--embedded .support-iframe[data-autosize="1"] {
  height: auto;
  flex: 0 0 auto;
}
.support-iframe-fallback {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--line, #e6ebf2);
  background: var(--panel, #fff);
  color: var(--muted, #667085);
  font-size: .82rem;
}
.support-iframe-fallback p {
  margin: 0;
}
.support-iframe-fallback a {
  color: var(--primary, #1f6fff);
  font-weight: 700;
  text-decoration: none;
}
.support-iframe-fallback a:hover {
  text-decoration: underline;
}

/* ── 4 tuiles ────────────────────────────────────────────────────────────── */
.support-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.support-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 16px;
  border-radius: var(--radius-md, 14px);
  border: 1.5px solid var(--line, #e6ebf2);
  background: var(--panel, #fff);
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background .15s;
  -webkit-tap-highlight-color: transparent;
  text-align: left;
  font: inherit;
  color: var(--text, #18202a);
}
.support-tile:hover:not(.support-tile--disabled) {
  border-color: var(--primary-border, rgba(31, 111, 255, .45));
  box-shadow: 0 4px 14px var(--primary-ring, rgba(31, 111, 255, .1));
  background: var(--primary-soft, #e8f0ff);
}
.support-tile--disabled {
  opacity: .55;
  cursor: not-allowed;
  background: var(--panel-alt, #f9fbff);
}
.support-tile__icon { font-size: 1.4rem; line-height: 1; }
.support-tile__label {
  font-size: .85rem;
  font-weight: 800;
  line-height: 1.2;
}
.support-tile__desc {
  font-size: .75rem;
  color: var(--muted, #667085);
  line-height: 1.4;
}
.support-tile__lock {
  font-size: .7rem;
  color: var(--primary, #1f6fff);
  font-weight: 600;
  margin-top: 2px;
}

/* ── Vue FAQ ─────────────────────────────────────────────────────────────── */
.support-faq-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.support-faq-item {
  border: 1px solid var(--line, #e6ebf2);
  border-radius: var(--radius-sm, 10px);
  background: var(--panel, #fff);
  overflow: hidden;
}
.support-faq-q {
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  background: none;
  border: none;
  font: inherit;
  font-size: .87rem;
  font-weight: 700;
  color: var(--text, #18202a);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  -webkit-tap-highlight-color: transparent;
}
.support-faq-q::after {
  content: '▾';
  font-size: .7rem;
  color: var(--muted);
  flex-shrink: 0;
  transition: transform .15s;
}
.support-faq-item.open .support-faq-q::after { transform: rotate(180deg); }
.support-faq-a {
  display: none;
  padding: 0 14px 12px;
  font-size: .84rem;
  color: var(--muted, #667085);
  line-height: 1.55;
}
.support-faq-item.open .support-faq-a { display: block; }

/* ── Vue Chat agent IA ───────────────────────────────────────────────────── */
.support-chat {
  display: flex;
  flex-direction: column;
  gap: 0;
  height: 100%;
}
.support-chat-history {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  margin-bottom: 12px;
  min-height: 80px;
}
.support-chat-msg {
  max-width: 85%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: .87rem;
  line-height: 1.5;
}
.support-chat-msg--user {
  align-self: flex-end;
  background: var(--primary, #1f6fff);
  color: #fff;
  border-radius: 14px 14px 4px 14px;
}
.support-chat-msg--bot {
  align-self: flex-start;
  background: var(--panel, #fff);
  border: 1px solid var(--line, #e6ebf2);
  border-radius: 14px 14px 14px 4px;
  color: var(--text, #18202a);
}
.support-chat-msg--error {
  align-self: flex-start;
  background: var(--danger-soft, #fff0ef);
  color: var(--danger, #d92d20);
  border: 1px solid rgba(217, 45, 32, .16);
}
.support-chat-typing {
  align-self: flex-start;
  color: var(--muted);
  font-size: .8rem;
  font-style: italic;
}
.support-chat-input-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-shrink: 0;
}
.support-chat-input {
  flex: 1;
  border: 1.5px solid var(--line, #e6ebf2);
  border-radius: 12px;
  padding: 9px 12px;
  font: inherit;
  font-size: .9rem;
  resize: none;
  max-height: 100px;
  line-height: 1.4;
  background: var(--panel, #fff);
  color: var(--text);
  transition: border-color .15s;
}
.support-chat-input:focus { outline: none; border-color: var(--primary-border); }
.support-chat-send {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: none;
  background: var(--primary, #1f6fff);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: opacity .15s;
}
.support-chat-send:disabled { opacity: .45; cursor: default; }
.support-chat-useless {
  margin-top: 10px;
  display: flex;
  justify-content: center;
}
.support-chat-useless-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: .78rem;
  cursor: pointer;
  text-decoration: underline;
  font: inherit;
}

/* ── Formulaire ticket / feature ─────────────────────────────────────────── */
.support-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.support-form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.support-form-field label {
  font-size: .8rem;
  font-weight: 700;
  color: var(--text, #18202a);
}
.support-form-field select,
.support-form-field input,
.support-form-field textarea {
  width: 100%;
  border: 1.5px solid var(--line, #e6ebf2);
  border-radius: 10px;
  padding: 9px 12px;
  font: inherit;
  font-size: .88rem;
  background: var(--panel, #fff);
  color: var(--text);
  box-sizing: border-box;
  transition: border-color .15s;
}
.support-form-field select:focus,
.support-form-field input:focus,
.support-form-field textarea:focus { outline: none; border-color: var(--primary-border); }
.support-form-field textarea { resize: vertical; min-height: 80px; }
.support-form-counter {
  font-size: .72rem;
  color: var(--muted);
  text-align: right;
}
.support-form-submit {
  padding: 11px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, var(--primary, #1f6fff), var(--primary-strong, #4d8cff));
  color: #fff;
  font: inherit;
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 16px var(--primary-shadow);
  transition: opacity .15s;
}
.support-form-submit:disabled { opacity: .5; cursor: not-allowed; }
.support-form-status {
  font-size: .82rem;
  padding: 8px 12px;
  border-radius: 8px;
  text-align: center;
}
.support-form-status--ok  { background: var(--success-soft, #e8f8f1); color: var(--success, #0f9f6e); }
.support-form-status--err { background: var(--danger-soft, #fff0ef);  color: var(--danger, #d92d20); }

/* ── CTA upgrade dans le support ─────────────────────────────────────────── */
.support-upgrade-cta {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--primary-soft, #e8f0ff);
  border: 1.5px solid var(--primary-border);
  text-align: center;
  font-size: .84rem;
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
}
.support-upgrade-cta:hover { background: #d4e5ff; }

/* ── Icône support avec badge réponse non lue ─────────────────────────────── */
#support-btn.support-btn--unread {
  color: var(--primary, #1f6fff);
  position: relative;
}
#support-btn.support-btn--unread::after {
  content: '';
  position: absolute;
  top: 2px;
  right: 2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary, #1f6fff);
  border: 2px solid var(--bg-header, #fff);
}

/* ── Tuile avec badge non lu ─────────────────────────────────────────────── */
.support-tile--unread {
  border-color: var(--primary-border, rgba(31, 111, 255, .45));
}
.support-tile__badge {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary, #1f6fff);
  vertical-align: top;
  margin-left: 3px;
}

/* ── Vue Mes tickets ─────────────────────────────────────────────────────── */
.support-mytickets-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.support-myticket {
  border: 1px solid var(--line, #e6ebf2);
  border-radius: var(--radius-sm, 10px);
  background: var(--panel, #fff);
  padding: 14px;
  transition: border-color .15s;
}
.support-myticket--unread {
  border-color: var(--primary-border, rgba(31, 111, 255, .45));
  background: var(--primary-soft, #e8f0ff);
}
.support-myticket__head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.support-myticket__type {
  font-size: .78rem;
  font-weight: 700;
  color: var(--muted, #667085);
}
.support-myticket__status {
  font-size: .72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
}
.support-myticket__status--open     { background: #fef3c7; color: #92400e; }
.support-myticket__status--progress { background: #dbeafe; color: #1e40af; }
.support-myticket__status--closed   { background: #d1fae5; color: #065f46; }
.support-myticket__new {
  font-size: .72rem;
  font-weight: 800;
  color: var(--primary, #1f6fff);
  background: var(--primary-soft, #e8f0ff);
  padding: 2px 8px;
  border-radius: 20px;
  margin-left: auto;
}
.support-myticket__desc {
  font-size: .82rem;
  color: var(--text, #18202a);
  line-height: 1.45;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.support-myticket__date {
  font-size: .72rem;
  color: var(--muted, #667085);
  margin-bottom: 4px;
}
.support-myticket__reply {
  margin-top: 10px;
  padding: 10px;
  border-radius: 8px;
  background: var(--panel-alt, #f9fbff);
  border-left: 3px solid var(--primary, #1f6fff);
}
.support-myticket__reply-label {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  color: var(--primary, #1f6fff);
  margin-bottom: 4px;
}
.support-myticket__reply-text {
  font-size: .82rem;
  color: var(--text, #18202a);
  line-height: 1.45;
}

/* ══════════════════════════════════════════════════════════════════════════
   V9 — Clôture chantier & SAV
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Section clôture dans l'éditeur ──────────────────────────────────────── */
.cloture-section {
  margin-top: 14px;
  border-top: 1px solid var(--border, #eee);
  padding-top: 14px;
}
.cloture-open-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1.5px solid var(--success, #0f9f6e);
  color: var(--success, #0f9f6e);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: .84rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  justify-content: center;
}
.cloture-open-btn:hover { background: var(--success-soft, #e8f8f1); }
.cloture-open-btn--done {
  border-color: var(--muted, #888);
  color: var(--muted, #888);
}

/* ── Panneau clôture ─────────────────────────────────────────────────────── */
.cloture-panel {
  background: var(--surface-alt, #f7f9fc);
  border: 1px solid var(--border, #eee);
  border-radius: 12px;
  padding: 14px;
  margin-top: 10px;
}
.cloture-panel h4 {
  margin: 0 0 10px;
  font-size: .88rem;
  font-weight: 700;
  color: var(--text);
}

/* ── Comparatif estimé / réel ────────────────────────────────────────────── */
.cloture-compare {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 4px 8px;
  margin: 8px 0 4px;
  align-items: center;
}
.cloture-col-head {
  font-size: .7rem;
  font-weight: 600;
  color: var(--muted, #888);
  text-transform: uppercase;
  letter-spacing: .03em;
}
.cloture-compare-row {
  display: contents;
}
.cloture-compare-row .cloture-label {
  grid-column: 1 / -1;
  font-size: .72rem;
  color: var(--muted);
  margin-top: 6px;
}
.cloture-cell {
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
  padding: 2px 0;
}
.cloture-cell--pos { color: var(--success, #0f9f6e); }
.cloture-cell--neg { color: var(--danger, #d92d20); }
.cloture-cell--muted { color: var(--muted, #888); font-weight: 400; }
.cloture-cell--label {
  grid-column: 1 / -1;
  font-size: .7rem;
  color: var(--muted, #888);
  padding-bottom: 2px;
  border-bottom: 1px solid #f0f0f0;
  margin-bottom: 2px;
}

/* ── Cellules delta ──────────────────────────────────────────────────── */
.cloture-delta {
  font-size: .78rem;
  font-weight: 600;
  white-space: nowrap;
}
.cloture-delta--ok   { color: #15803d; }
.cloture-delta--warn { color: #b45309; }

/* ── Alerte poste sous-estimé ───────────────────────────────────────── */
.clo-alert {
  font-size: .8rem;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 6px;
  padding: 6px 10px;
  margin: 4px 0;
}

/* ── Formulaire clôture ──────────────────────────────────────────────────── */
.cloture-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cloture-form label {
  font-size: .78rem;
  font-weight: 600;
  color: var(--text-secondary, #555);
}
.cloture-form input[type="number"] {
  width: 100%;
  padding: 8px 10px;
  border: 1.5px solid var(--border, #ddd);
  border-radius: 8px;
  font-size: .9rem;
  background: #fff;
}
.cloture-submit-btn {
  background: var(--success, #0f9f6e);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 9px 18px;
  font-size: .86rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 4px;
}
.cloture-submit-btn:disabled { opacity: .55; cursor: default; }
.cloture-submit-btn:not(:disabled):hover { background: #0b8a5e; }

/* ── Résultat clôture (affiché après) ────────────────────────────────────── */
.cloture-result {
  background: var(--success-soft, #e8f8f1);
  border: 1px solid var(--success, #0f9f6e);
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 10px;
  font-size: .84rem;
  color: var(--success-dark, #05714d);
}
.cloture-result strong { display: block; font-size: .95rem; margin-bottom: 4px; }
.cloture-result--neg { background: var(--danger-soft, #fff0ef); border-color: var(--danger, #d92d20); color: var(--danger, #d92d20); }

/* ── Section SAV ─────────────────────────────────────────────────────────── */
.sav-section {
  margin-top: 14px;
  border-top: 1px solid var(--border, #eee);
  padding-top: 14px;
}
.sav-add-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1.5px solid var(--warning, #f59e0b);
  color: var(--warning, #f59e0b);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: .84rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  justify-content: center;
}
.sav-add-btn:hover { background: var(--warning-soft, #fffbeb); }

.sav-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.sav-form input, .sav-form textarea {
  width: 100%;
  padding: 7px 10px;
  border: 1.5px solid var(--border, #ddd);
  border-radius: 8px;
  font-size: .86rem;
  background: #fff;
  box-sizing: border-box;
}
.sav-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.sav-submit-btn {
  background: var(--warning, #f59e0b);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: .84rem;
  font-weight: 700;
  cursor: pointer;
}
.sav-submit-btn:disabled { opacity: .5; cursor: default; }
.sav-submit-btn:not(:disabled):hover { background: #d97706; }

/* ── Liste des SAV ───────────────────────────────────────────────────────── */
.sav-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sav-item {
  background: #fff;
  border: 1px solid var(--warning-border, #fcd34d);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: .8rem;
}
.sav-item__head {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.sav-item__meta { color: var(--muted); font-size: .72rem; }
.sav-total-bar {
  font-size: .82rem;
  font-weight: 700;
  color: var(--warning, #f59e0b);
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--border, #eee);
}

/* ── V8 Multi-métier — Recherche + chips ──────────────────────── */
.trade-search-wrap { position: relative; }
.trade-search-input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  border-radius: 14px;
  padding: 15px 15px;
  font: inherit;
  color: var(--text);
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}
.trade-search-input:focus {
  border-color: var(--primary-border);
  box-shadow: 0 0 0 4px var(--primary-ring);
}
.trade-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0,0,0,.1);
  max-height: 220px;
  overflow-y: auto;
  z-index: 200;
  list-style: none;
  margin: 0; padding: 4px 0;
}
.trade-dropdown li {
  padding: 10px 14px;
  cursor: pointer;
  touch-action: manipulation; /* supprime le délai 300ms iOS */
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  font-size: .93rem;
  color: var(--text);
}
.trade-dropdown li:hover,
.trade-dropdown li[aria-selected="true"] { background: var(--primary-soft); color: var(--primary); }
.trade-dropdown li.trade-dropdown--already { opacity: .45; pointer-events: none; font-style: italic; }
.trade-chips {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 8px; min-height: 0;
}
.trade-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--primary-soft); color: var(--primary);
  border: 1px solid var(--primary-border);
  border-radius: 20px; padding: 4px 10px 4px 12px;
  font-size: .85rem; font-weight: 600;
}
.trade-chip__remove {
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer;
  color: var(--primary); font-size: 1.1rem; line-height: 1;
  padding: 0 2px; opacity: .7;
}
.trade-chip__remove:hover { opacity: 1; }

/* ── V8 Panneau répartition multi-métier ─────────────────────── */
.trade-split-panel {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 14px 10px;
  margin-bottom: 12px;
}
.trade-split-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.trade-split-title { font-weight: 700; font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.trade-split-sliders { display: flex; flex-direction: column; gap: 6px; }
.trade-split-row { display: flex; align-items: center; gap: 8px; }
.trade-split-label {
  font-size: .72rem; font-weight: 600; color: var(--text);
  width: 82px; min-width: 82px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.trade-split-pct {
  font-variant-numeric: tabular-nums;
  font-size: .75rem; font-weight: 700;
  width: 30px; min-width: 30px;
  text-align: right; color: var(--primary);
}
.trade-split-range {
  appearance: none;
  -webkit-appearance: none;
  flex: 1; height: 4px;
  border-radius: 4px;
  background: var(--primary-soft);
  accent-color: var(--primary);
  cursor: pointer;
}
.trade-split-total-val { font-size: .78rem; font-weight: 700; color: var(--primary); }
.trade-split-total-val.over { color: #dc2626; }

/* ── Guide installation iOS (bulle Safari avec flèche) ─────────────────── */
#mp-ios-guide {
  position: fixed;
  bottom: 90px; /* au-dessus de la toolbar Safari (~83px) */
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  opacity: 0;
  transition: opacity .35s ease, transform .35s ease;
  z-index: 9100;
  width: min(320px, calc(100vw - 32px));
  background: #12243e;
  color: #fff;
  border-radius: 18px;
  padding: 14px 16px 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,.4), 0 2px 8px rgba(0,0,0,.2);
  pointer-events: none;
}
#mp-ios-guide.mp-ios-guide--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}
.mp-ios-guide__close {
  position: absolute;
  top: 8px; right: 10px;
  background: none; border: none;
  color: rgba(255,255,255,.5);
  font-size: 15px; font-family: inherit;
  cursor: pointer; padding: 4px 6px; line-height: 1;
  min-width: 28px; min-height: 28px;
}
.mp-ios-guide__close:hover { color: #fff; }
.mp-ios-guide__schema {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
}
.mp-ios-guide__step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,.65);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.mp-ios-guide__icon-wrap {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.15);
}
.mp-ios-guide__icon-wrap svg { width: 22px; height: 22px; }
.mp-ios-guide__icon-wrap.step-share {
  animation: ios-guide-tap 2.2s ease-in-out infinite;
}
.mp-ios-guide__icon-wrap.step-add {
  animation: ios-guide-tap 2.2s ease-in-out 1.1s infinite;
}
@keyframes ios-guide-tap {
  0%, 100% { background: rgba(255,255,255,.1); transform: scale(1); }
  40%       { background: rgba(31,111,255,.55); transform: scale(.9); }
  55%       { background: rgba(31,111,255,.35); transform: scale(.96); }
}
.mp-ios-guide__seq-arrow {
  font-size: 22px;
  color: rgba(255,255,255,.3);
  font-weight: 300;
  line-height: 1;
  flex-shrink: 0;
}
.mp-ios-guide__text {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  text-align: center;
  color: rgba(255,255,255,.88);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2px 4px;
}
.mp-ios-guide__share-inline {
  width: 14px; height: 14px;
  vertical-align: text-bottom;
  flex-shrink: 0;
  display: inline-block;
}
.mp-ios-guide__caret {
  position: absolute;
  bottom: -10px; left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 11px solid transparent;
  border-right: 11px solid transparent;
  border-top: 11px solid #12243e;
}

/* SEC: overlay body lock — empeche double scroll desktop */
body.overlay-open { overflow: hidden; }

/* ── Chantier BTP UX mobile v1.2 ───────────────────────────────────────── */
.project-editor-header {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: .55rem .65rem .5rem;
}
.project-editor-header-main {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}
.project-editor-header-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}
.editor-header-client {
  font-size: .76rem;
  color: var(--muted);
  max-width: 70%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.editor-header-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--primary-soft, #e8f0ff);
  color: var(--primary, #1f6fff);
  font-size: .72rem;
  font-weight: 700;
}
.project-editor-body {
  padding: .55rem .65rem calc(96px + env(safe-area-inset-bottom, 0px));
}
.editor-section {
  padding: .72rem .78rem;
  margin-bottom: .55rem;
}
.project-editor-actionbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 10px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--line, #e6ebf2);
  backdrop-filter: blur(10px);
}
.project-editor-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--primary-border, rgba(31,111,255,.45));
  border-radius: 12px;
  background: var(--primary-soft, #e8f0ff);
  color: var(--primary, #1f6fff);
  font-size: .77rem;
  font-weight: 700;
  padding: 10px 8px;
  min-height: 44px;
}
.editor-header-date-input {
  flex-shrink: 0;
  width: 132px;
  font-size: .8rem;
  padding: .32rem .45rem;
  border: 1.5px solid var(--border, #e5e7eb);
  border-radius: 9px;
  font-family: inherit;
  background: #fff;
  color: var(--text, #18202a);
}
.editor-close-btn {
  order: -1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line, #e6ebf2);
  border-radius: 9px;
  background: #fff;
  color: var(--muted, #667085);
  padding: 0;
}
.editor-title-input {
  font-size: .95rem;
  line-height: 1.25;
}

@media (max-width: 420px) {
  .editor-header-date-input {
    width: 118px;
    font-size: .76rem;
  }
  .project-editor-header {
    padding: .5rem .55rem .45rem;
  }
  .project-editor-body {
    padding: .45rem .55rem calc(94px + env(safe-area-inset-bottom, 0px));
  }
}
.project-editor-action-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.editor-rentability {
  margin-bottom: .6rem;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: .84rem;
  font-weight: 700;
  text-align: center;
  border: 1px solid transparent;
}
.editor-rentability--healthy {
  color: var(--success, #0f9f6e);
  background: var(--success-soft, #e8f8f1);
  border-color: rgba(15, 159, 110, 0.35);
}
.editor-rentability--tight {
  color: var(--warning, #c77d00);
  background: var(--warning-soft, #fff5e6);
  border-color: rgba(199, 125, 0, 0.35);
}
.editor-rentability--loss {
  color: var(--danger, #d92d20);
  background: var(--danger-soft, #fff0ef);
  border-color: rgba(217, 45, 32, 0.35);
}

.editor-dynamic-cta {
  margin-bottom: .6rem;
}
.editor-dynamic-cta:empty {
  display: none;
}
.editor-dynamic-cta-btn {
  width: 100%;
  border: none;
  border-radius: 12px;
  min-height: 44px;
  padding: 10px 14px;
  font-size: .86rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--primary, #1f6fff), var(--primary-strong, #4d8cff));
}
.editor-dynamic-cta-btn--close {
  background: linear-gradient(135deg, #0f9f6e, #22b07f);
}

/* ── Référence simulation gelée (éditeur chantier) ─────────────── */
.editor-sim-ref {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  color: #1e40af;
  margin: 4px 0 6px;
}
.editor-sim-ref__pin { flex-shrink: 0; }
.editor-sim-ref__text { flex: 1; line-height: 1.4; }
.editor-sim-ref__link {
  background: none;
  border: none;
  color: #2563eb;
  font-size: 16px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  flex-shrink: 0;
}
.editor-sim-ref__link:hover { background: #dbeafe; }

/* ── Marge projetée temps réel ──────────────────────────────────── */
.editor-projected-margin {
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 6px;
  margin: 0 0 6px;
  line-height: 1.5;
}
.editor-projected-margin--healthy { background: #f0faf5; color: #166534; }
.editor-projected-margin--tight   { background: #fffbeb; color: #92400e; }
.editor-projected-margin--loss    { background: #fef2f2; color: #991b1b; }
.ed-proj-vs    { opacity: 0.75; }
.ed-proj-delta { font-weight: 600; }
.ed-proj-delta--healthy { color: #15803d; }
.ed-proj-delta--tight   { color: #b45309; }
.ed-proj-delta--loss    { color: #dc2626; }

/* ── Highlight temporaire carte simulation (navigation retour) ──── */
@keyframes mp-sim-highlight {
  0%   { box-shadow: 0 0 0 3px #3b82f6; }
  100% { box-shadow: none; }
}
.dossier-card--highlight {
  animation: mp-sim-highlight 1.8s ease-out forwards;
}

.editor-logs-list-simple {
  list-style: none;
  margin: 0;
  padding: 0;
}
.editor-log-item {
  display: grid;
  grid-template-columns: 78px 84px 1fr;
  gap: 4px 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--line, #e6ebf2);
}
.editor-log-item__date {
  grid-column: 1;
  font-size: .72rem;
  color: var(--muted);
}
.editor-log-item__type {
  grid-column: 2;
  font-size: .72rem;
  color: var(--muted);
  text-transform: capitalize;
}
.editor-log-item__value {
  grid-column: 3;
  font-size: .78rem;
  font-weight: 700;
  color: var(--text);
  text-align: right;
}
.editor-log-item__desc {
  grid-column: 1 / -1;
  font-size: .78rem;
  color: var(--text);
}

.editor-mobile-sheet-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: rgba(0, 0, 0, 0.28);
  display: flex;
  align-items: flex-end;
}
.editor-mobile-sheet {
  width: 100%;
  background: #fff;
  border-radius: 18px 18px 0 0;
  padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -10px 30px rgba(0, 0, 0, .18);
}
.editor-mobile-sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.editor-mobile-sheet__head strong {
  font-size: .94rem;
}
.editor-mobile-sheet__close {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 4px;
}
.editor-add-form--sheet {
  margin: 0;
  border: none;
  padding: 6px 2px 2px;
}

.cloture-panel {
  position: fixed;
  inset: 0;
  z-index: 8;
  margin: 0;
  border: none;
  border-radius: 0;
  background: #fff;
  overflow-y: auto;
  padding: 16px;
  padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
}
.cloture-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.cloture-panel-close {
  border: 1px solid var(--line, #e6ebf2);
  background: #fff;
  border-radius: 10px;
  padding: 4px;
  color: var(--muted);
}

.mp-partner-skin-banner {
  position: sticky;
  top: 0;
  z-index: 240;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  background: linear-gradient(135deg, var(--color-partner, #0f766e), var(--color-partner-secondary, #ecfeff));
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(10px);
}

.mp-partner-skin-banner__inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.mp-partner-skin-banner__logo {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  object-fit: contain;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  padding: 4px;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06);
}

.mp-partner-skin-banner__copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mp-partner-skin-banner__copy strong {
  color: var(--color-partner-text, #0f172a);
  font-size: 0.93rem;
  line-height: 1.2;
}

.mp-partner-skin-banner__copy span {
  color: var(--color-partner-subtext, #475467);
  font-size: 0.8rem;
  line-height: 1.3;
}

.mp-partner-auto-toast {
  position: fixed;
  left: 50%;
  bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  transform: translate(-50%, 14px);
  z-index: 320;
  max-width: min(92vw, 420px);
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.2;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.24);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}

.dev-mode-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 12px;
  background: #ffa500;
  color: #000;
  font-weight: bold;
  text-align: center;
  z-index: 9999;
  font-size: 0.9rem;
  line-height: 1.4;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dev-mode-banner strong {
  font-weight: 900;
  display: block;
  margin-bottom: 4px;
}

.mp-partner-auto-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 680px) {
  .mp-partner-skin-banner__inner {
    padding: 9px 12px;
    gap: 10px;
  }

  .mp-partner-skin-banner__logo {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .mp-partner-skin-banner__copy strong {
    font-size: 0.88rem;
  }

  .mp-partner-skin-banner__copy span {
    font-size: 0.76rem;
  }

  .mp-partner-auto-toast {
    bottom: calc(78px + env(safe-area-inset-bottom, 0px));
    padding: 11px 14px;
    font-size: 0.82rem;
  }
}

/* ── Modal bascule simulation → chantier (v12) ── */
.mp-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 9000; padding: 1rem;
}
.mp-modal-overlay.mp-modal-hidden { display: none; }
.mp-modal-box {
  background: var(--card-bg, #fff); border-radius: .75rem;
  padding: 1.5rem; width: 100%; max-width: 400px;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
}
.mp-invite-modal-box {
  max-width: 420px;
  border: 1px solid rgba(166, 124, 82, 0.32);
  background:
    radial-gradient(circle at 90% 5%, rgba(194, 136, 79, 0.14), transparent 42%),
    linear-gradient(160deg, #fff9f0 0%, #f7efe2 100%);
  position: relative;
}

.mp-invite-close-x {
  position: absolute;
  right: 14px;
  top: 12px;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(119, 79, 42, 0.25);
  background: rgba(255, 255, 255, 0.82);
  color: #6a5137;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mp-invite-kicker {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8f683f;
}

.mp-invite-modal-box h2 {
  margin: 6px 0 0;
  font-size: 1.18rem;
}

.mp-invite-subtitle {
  margin: .5rem 0 0;
  color: #5d4b38;
  font-size: 0.88rem;
  line-height: 1.4;
}

.mp-invite-channel-wrap {
  margin: 1rem 0;
}

.mp-invite-channel-label {
  display: block;
  margin-bottom: .5rem;
  font-size: 0.84rem;
  font-weight: 700;
  color: #4f3e2c;
}

.mp-invite-channel-options {
  display: flex;
  gap: .45rem;
  flex-wrap: wrap;
}

.mp-invite-channel-option {
  display: inline-flex;
  align-items: center;
  gap: .36rem;
  padding: .38rem .62rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(119, 79, 42, 0.2);
  font-size: 0.8rem;
  color: #4f3e2c;
}

.mp-invite-contact-row {
  margin-bottom: .85rem;
}

.mp-invite-contact-label {
  font-size: .84rem;
  font-weight: 700;
  color: #4f3e2c;
}

.mp-invite-contact-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: .36rem;
  padding: .62rem;
  border: 1px solid rgba(119, 79, 42, 0.23);
  border-radius: .5rem;
  font-size: .88rem;
  background: rgba(255, 255, 255, 0.88);
}

.mp-invite-send-btn {
  width: 100%;
  padding: .76rem;
  border: none;
  border-radius: .6rem;
  background: linear-gradient(135deg, #2b77f4, #1358c8);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.mp-invite-send-btn.is-hidden {
  display: none;
}

.mp-invite-result {
  margin-top: 1rem;
  text-align: center;
}

.mp-invite-qr-card {
  border-radius: .75rem;
  border: 1px solid rgba(119, 79, 42, 0.2);
  background: rgba(255, 255, 255, 0.82);
  padding: .85rem;
}

.mp-invite-qr-container {
  display: flex;
  justify-content: center;
  margin-bottom: .8rem;
}

.mp-invite-benefits {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .42rem;
  text-align: left;
}

.mp-invite-benefits li {
  position: relative;
  padding-left: 14px;
  font-size: .78rem;
  color: #4f3e2c;
}

.mp-invite-benefits li::before {
  content: '';
  position: absolute;
  left: 0;
  top: .46em;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #1f6fff;
}

.mp-invite-url-display {
  margin: .7rem 0 0;
  font-size: .75rem;
  line-height: 1.35;
  color: #5d4b38;
  word-break: break-all;
}

.mp-invite-result-actions {
  margin-top: .6rem;
  display: flex;
  flex-direction: column;
  gap: .45rem;
  align-items: center;
}

.mp-invite-copy-btn {
  border: 1px solid #2b77f4;
  color: #2b77f4;
  background: rgba(255, 255, 255, 0.9);
  border-radius: .45rem;
  padding: .48rem .95rem;
  font-size: .86rem;
  cursor: pointer;
}

.mp-invite-learn-more {
  font-size: .79rem;
  color: #4f3e2c;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.mp-invite-inline-error {
  color: #dc2626;
  font-size: .86rem;
  margin-top: .75rem;
  min-height: 1.2em;
}

.mp-invite-actions {
  margin-top: 1.1rem;
}
.mp-modal-box h3 { margin: 0 0 1rem; font-size: 1.1rem; font-weight: 600; }
.mp-form-row { display: flex; flex-direction: column; gap: .25rem; margin-bottom: .75rem; }
.mp-form-row label { font-size: .82rem; color: var(--text-muted, #666); }
.mp-form-row input, .mp-form-row select {
  border: 1px solid var(--border-color, #ddd); border-radius: .4rem;
  padding: .5rem .75rem; font-size: .95rem; background: var(--input-bg, #fff);
  color: var(--text-main, #222);
}
.mp-modal-actions { display: flex; gap: .75rem; justify-content: flex-end; margin-top: 1rem; }
.dossier-convert-btn {
  font-size: .78rem; color: var(--primary, #2563eb); background: none;
  border: 1px solid var(--primary, #2563eb); border-radius: .35rem;
  padding: .25rem .6rem; cursor: pointer; margin-top: .35rem; white-space: nowrap;
}
.dossier-convert-btn:hover { background: var(--primary-soft, #eff6ff); }

/* ── T5 : Tab switcher Pro ─────────────────────────────────────────────── */
.dossiers-tab-switcher {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg-subtle, #f3f4f6);
  border-radius: 12px;
  margin: 0 1rem .75rem;
}
.dossiers-tab {
  flex: 1;
  padding: 7px 4px;
  font-size: .78rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.dossiers-tab[aria-selected="true"] {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
}
.dossiers-tab:hover:not([aria-selected="true"]) {
  color: var(--text, #374151);
}
/* Masqué par défaut (JS active si Pro) */
.dossiers-tab-switcher[hidden] { display: none; }

/* ── Onglets nav centrés dans le header (pages /s/*) ───────────────────── */
.page-header-tabs { display: flex; align-items: center; justify-content: center; gap: 0; flex: 1; }
.page-header-tab { font-size: 1rem; font-weight: 700; color: var(--muted); background: none; border: none; border-bottom: 2px solid transparent; padding: .25rem .9rem; cursor: pointer; text-decoration: none; line-height: 1.2; transition: color .15s, border-color .15s; white-space: nowrap; display: inline-block; }
.page-header-tab--active { color: var(--primary); border-bottom-color: var(--primary); }

/* ── Nav icônes (bottom-nav remontée dans le header, pages /s/*) ──────── */
.pg-nav { display: flex; align-items: stretch; flex: 1; overflow: hidden; }
.pg-nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .12rem; padding: .35rem .1rem .25rem; font-size: .52rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--muted, #6b7280); text-decoration: none; background: none; border: none; border-bottom: 2.5px solid transparent; cursor: pointer; transition: color .15s, border-color .15s; line-height: 1; white-space: nowrap; }
.pg-nav-item--active, .pg-nav-item[aria-current="page"] { color: var(--primary, #1f6fff); border-bottom-color: var(--primary, #1f6fff); }
/* Barre de nav secondaire sur les pages dossier (chantier / rendezvous) */
.ch-pg-subnav { display: flex; background: var(--card, #fff); border-bottom: 1px solid var(--border, #e5e7eb); position: sticky; top: 3rem; z-index: 49; }
.ch-pg-subnav .pg-nav { flex: 1; }

/* ── T2 : Masquer la bottom nav quand le panel Pro est ouvert ──────────── */
body.dossiers-panel-open .app-nav {
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity .2s, transform .2s;
}

/* ── T4 : État vide Stats ──────────────────────────────────────────────── */
.stats-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 2.5rem 1.5rem;
  text-align: center;
}
.stats-empty-title {
  font-size: .95rem;
  color: var(--text, #374151);
  line-height: 1.5;
}
.stats-empty-cta {
  padding: 10px 20px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
}


/* ── Section photos (éditeur chantier) ─────────────────────────────── */
.editor-section--photos { margin: 4px 0; }

.ed-photo-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-soft, #eff6ff);
  border: 1px dashed var(--primary, #2563eb);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 14px;
  color: var(--primary, #2563eb);
  cursor: pointer;
  margin-top: 6px;
  position: relative;
  user-select: none;
}
.ed-photo-add-btn:hover { background: #dbeafe; }

.ed-photos-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 4px; }
.ed-photos-empty, .ed-photos-loading { font-size: .82rem; color: var(--muted, #888); }

.ed-photo-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .82rem;
  background: #f8fafc;
  border-radius: 6px;
  padding: 5px 8px;
}
.ed-photo-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }
.ed-photo-date { color: var(--muted, #888); flex-shrink: 0; }
.ed-photo-gps  { flex-shrink: 0; }
.ed-photo-del  {
  background: none; border: none; color: var(--muted, #888);
  cursor: pointer; font-size: 14px; padding: 2px 4px; border-radius: 4px; flex-shrink: 0;
}
.ed-photo-del:hover { color: #dc2626; background: #fef2f2; }

/* ── Dialog consentement GPS ────────────────────────────────────────── */
.mp-modal--gps-consent {
  max-width: 320px;
  padding: 20px;
  border-radius: 12px;
  background: #fff;
}
.mp-modal--gps-consent h4 { margin: 0 0 10px; font-size: 15px; }
.mp-modal__body { font-size: 13px; color: #555; line-height: 1.5; margin: 0 0 16px; }
.mp-modal__actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.mp-modal-btn { border: none; border-radius: 6px; padding: 8px 14px; font-size: 13px; cursor: pointer; }
.mp-modal-btn--primary   { background: var(--primary, #2563eb); color: #fff; font-weight: 600; }
.mp-modal-btn--secondary { background: #f3f4f6; color: #374151; }

/* ── Calendrier Tab ─────────────────────────────────────── */
.cal-subscribe-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.btn-cal-subscribe {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  border-radius: 10px;
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 1.5px solid var(--border, #e5e7eb);
  background: #fff;
  color: var(--text-primary, #1a1a1a);
  transition: background .15s, border-color .15s;
  min-height: 44px;
  width: 100%;
  text-align: left;
}

.btn-cal-subscribe:hover {
  background: var(--bg, #f5f7fb);
  border-color: var(--accent, #2563eb);
}

.btn-cal-subscribe--google {
  border-color: #4285f4;
  color: #4285f4;
}

.btn-cal-subscribe--apple {
  border-color: #555;
  color: #333;
}

.btn-cal-subscribe--copy {
  border-color: var(--border, #e5e7eb);
  color: var(--text-secondary, #555);
}

/* ── Notes vocales — modal bottom-sheet ────────────────────────── */
#voice-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.52);
  z-index: 1200;
  display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: env(safe-area-inset-bottom, 0);
  backdrop-filter: blur(2px);
}
#voice-modal-overlay[hidden] { display: none; }
.voice-modal-card {
  background: #fff;
  border-radius: 20px 20px 0 0;
  width: 100%; max-width: 560px;
  padding: 12px 16px 28px;
  max-height: 88vh; overflow-y: auto;
  animation: voiceModalSlideUp .22s cubic-bezier(.4,0,.2,1);
}
@keyframes voiceModalSlideUp {
  from { transform: translateY(60px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.voice-modal-handle {
  width: 36px; height: 4px;
  background: var(--border, #e5e7eb);
  border-radius: 2px;
  margin: 0 auto 14px;
}
.voice-modal-title { font-size: 1rem; font-weight: 700; color: var(--text, #111); margin: 0 0 6px; }
.voice-modal-hint  { font-size: .82rem; color: var(--muted, #6b7280); margin: 0 0 10px; }

/* ── Notes vocales — validation & résultat ─────────────────────── */
.voice-validation {
  padding: 12px;
  background: var(--card-bg, #f5f7fb);
  border-radius: 10px;
  margin-top: 8px;
}
.voice-validation--ok    { color: var(--success, #16a34a); font-size: .88rem; padding: 10px 12px; }
.voice-validation--error { color: var(--danger, #dc2626);  font-size: .88rem; padding: 10px 12px; }
.voice-validation__label { font-size: .78rem; font-weight: 700; color: var(--muted); margin: 0 0 6px; }
.voice-validation__edit  { width: 100%; min-height: 80px; padding: 8px 10px; border: 1.5px solid var(--border, #e5e7eb); border-radius: 8px; font-size: .9rem; resize: vertical; box-sizing: border-box; background: #fff; }
.voice-validation__actions { display: flex; gap: 8px; margin-top: 8px; }
.voice-btn { padding: 8px 16px; border-radius: 8px; font-size: .85rem; font-weight: 600; cursor: pointer; border: none; min-height: 38px; }
.voice-btn--validate { background: var(--primary, #2563eb); color: #fff; }
.voice-btn--validate:disabled { opacity: .6; cursor: not-allowed; }
.voice-btn--delete   { background: transparent; color: var(--danger, #dc2626); border: 1.5px solid var(--danger, #dc2626); }

.voice-note-result { padding: 12px; background: var(--card-bg, #f5f7fb); border-radius: 10px; margin-top: 8px; }
.voice-note-result__title   { font-weight: 700; font-size: .9rem; color: var(--success, #16a34a); margin: 0 0 8px; }
.voice-note-result__section { font-size: .78rem; font-weight: 700; color: var(--muted); margin: 8px 0 4px; }
.voice-note-result__list    { margin: 0 0 4px; padding-left: 1.2rem; font-size: .88rem; line-height: 1.5; }
.voice-note-result__devis   { margin-top: 8px; font-size: .85rem; }
.voice-note-result__devis summary { cursor: pointer; color: var(--primary, #2563eb); font-size: .82rem; }

/* ── Badge dépassement notes vocales ──────────────────────────────────────────── */
.voice-depassement-badge {
  display: inline-block;
  background: #fff7ed;
  border: 1.5px solid #f97316;
  color: #c2410c;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: .82rem;
  font-weight: 600;
  margin-top: 8px;
}

.voice-depassement-banner {
  background: #fff7ed;
  border-left: 4px solid #f97316;
  color: #c2410c;
  padding: 10px 14px;
  font-size: .88rem;
  border-radius: 0 8px 8px 0;
  margin-bottom: 12px;
}

.voice-notes-history { margin-top: 10px; }
.voice-history__title { font-size: .78rem; font-weight: 700; color: var(--muted); margin: 0 0 6px; }
.voice-history__item  { padding: 8px 10px; border-left: 3px solid var(--border, #e5e7eb); margin-bottom: 6px; }
.voice-history__meta  { display: block; font-size: .75rem; color: var(--muted); }
.voice-history__preview { display: block; font-size: .82rem; color: var(--text-secondary, #555); font-style: italic; margin-top: 2px; }

/* ── Voice synthesis Bloc 4 ── */
.voice-synthesis-wrap { margin-top: 1rem; }
.voice-synthesis { background: var(--card-bg, #fff); border: 1px solid var(--border, #e5e7eb); border-radius: .5rem; padding: 1rem; display: flex; flex-direction: column; gap: .75rem; }
.voice-synthesis__title { font-size: .9rem; font-weight: 700; color: var(--text, #111); margin: 0; }
.voice-synthesis__block { display: flex; flex-direction: column; gap: .25rem; }
.voice-synthesis__label { font-size: .75rem; font-weight: 600; color: var(--muted, #6b7280); margin: 0; text-transform: uppercase; letter-spacing: .04em; }
.voice-synthesis__list { margin: 0; padding-left: 1.2rem; font-size: .82rem; color: var(--text); }
.voice-synthesis__facturation { font-size: .84rem; color: var(--text); line-height: 1.5; background: var(--bg-soft, #f9fafb); border-radius: .25rem; padding: .5rem .75rem; white-space: pre-wrap; }
.voice-synthesis__copy-btn { align-self: flex-start; margin-top: .25rem; font-size: .78rem; padding: .3rem .7rem; background: var(--primary, #2563eb); color: #fff; border: none; border-radius: .25rem; cursor: pointer; }
.voice-synthesis__copy-btn:hover { opacity: .88; }
.voice-synthesis__delta { font-size: .82rem; color: var(--text); margin: 0; }
.voice-synthesis__delta-note { font-size: .78rem; color: var(--muted); margin: 0; font-style: italic; }
.voice-synthesis__loading { font-size: .82rem; color: var(--muted); font-style: italic; }
.voice-synthesis__empty { font-size: .82rem; color: var(--muted); font-style: italic; }

/* ── Voice journal ── */
.voice-journal { margin-top: .5rem; }
.voice-journal__retry-btn { margin-top: .35rem; background: none; border: 1.5px solid var(--err, #c00); color: var(--err, #c00); font-size: .75rem; font-weight: 600; padding: .2rem .6rem; border-radius: 5px; cursor: pointer; transition: background .15s, color .15s; }
.voice-journal__retry-btn:hover:not(:disabled) { background: var(--err, #c00); color: #fff; }
.voice-journal__retry-btn:disabled { opacity: .55; cursor: not-allowed; }
.voice-journal__entry { padding: .55rem .75rem; border-radius: .5rem; margin-bottom: .3rem; border-left: 3px solid var(--border, #e5e7eb); background: var(--bg, #f9fafb); }
.voice-journal__entry--releve  { border-left-color: #3b82f6; }
.voice-journal__entry--suivi   { border-left-color: #22c55e; }
.voice-journal__entry--cloture { border-left-color: #f59e0b; }
.voice-journal__header { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; margin-bottom: .25rem; }
.voice-journal__type { font-size: .7rem; font-weight: 700; padding: .15rem .45rem; border-radius: .25rem; background: var(--border, #e5e7eb); color: var(--muted, #6b7280); text-transform: uppercase; letter-spacing: .03em; }
.voice-journal__type--releve  { background: #dbeafe; color: #1d4ed8; }
.voice-journal__type--suivi   { background: #dcfce7; color: #15803d; }
.voice-journal__type--cloture { background: #fef3c7; color: #b45309; }
.voice-journal__status { font-size: .7rem; padding: .15rem .4rem; border-radius: .25rem; }
.voice-journal__status--ok   { color: #15803d; }
.voice-journal__status--wait { color: var(--muted, #6b7280); }
.voice-journal__status--err  { color: var(--err, #c00); }
.voice-journal__date { font-size: .7rem; color: var(--muted, #6b7280); margin-left: auto; }
.voice-journal__author { display: inline-block; font-size: .75rem; font-weight: 600; color: var(--primary, #2563eb); background: color-mix(in srgb, var(--primary, #2563eb) 10%, transparent); border-radius: 4px; padding: 1px 6px; margin-bottom: 4px; }
.voice-journal__text { margin: 0; font-size: .82rem; color: var(--text, #111); line-height: 1.45; font-style: italic; }

/* ── Stats taxi ──────────────────────────────────────────────────────── */
.taxi-stats-periods {
  display: flex; gap: .375rem; flex-wrap: wrap; margin-bottom: 1rem;
}
.taxi-period-btn {
  padding: .3rem .7rem; border-radius: 999px; border: 1px solid var(--border);
  background: transparent; font-size: .8rem; cursor: pointer; color: var(--text);
}
.taxi-period-btn--active {
  background: var(--primary); color: #fff; border-color: var(--primary);
}
.stats-row--multi {
  display: grid; grid-template-columns: 1fr auto auto; gap: .5rem;
}
.trend-bars {
  display: flex; align-items: flex-end; gap: .25rem; height: 80px;
  margin-top: .5rem; padding-bottom: 1.2rem;
}
.trend-bar-wrap {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  height: 100%; justify-content: flex-end;
}
.trend-bar {
  width: 100%; min-height: 2px; background: var(--primary);
  border-radius: 2px 2px 0 0; transition: height .2s;
}
.trend-bar__label {
  font-size: .65rem; color: var(--muted); margin-top: .2rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* ── Journée — bouton Aujourd'hui ────────────────────────────────────── */
.journee-today-btn {
  display: block; margin: .5rem auto 0; padding: .3rem .9rem;
  border-radius: 999px; border: 1px solid var(--border);
  background: transparent; font-size: .8rem; cursor: pointer; color: var(--muted);
}

/* ── Signal TJCC — barre de comparaison visuelle (C4 v1.1) ─────────── */
.tjcc-bar { position: relative; height: 8px; background: var(--c-border, #e0e0e0); border-radius: 4px; margin: 8px 0; overflow: hidden; }
.tjcc-bar__ref { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: var(--c-border, #e0e0e0); border-radius: 4px; }
.tjcc-bar__pos { position: absolute; top: 0; left: 0; height: 100%; background: var(--c-warning, #f59e0b); border-radius: 4px; }

 *//* ── Toggle materiaux_artisan (C3 v1.1) ────────────────────
.form__field--toggle { margin-bottom: .75rem; }
.toggle-label { display: flex; align-items: flex-start; gap: .5rem; cursor: pointer; }
.toggle-label input[type="checkbox"] { margin-top: .15rem; flex-shrink: 0; }
.toggle-label__text { font-weight: 500; }
.toggle-label__hint { display: block; font-size: .78rem; color: var(--muted, #6b7280); line-height: 1.35; }
.toggle-feedback { margin: .25rem 0 0 1.5rem; font-size: .8rem; color: var(--muted, #6b7280); font-style: italic; }

/* ── C2 — Alerte estimation charges fixes ─────────────────────────────────── */
.cf-estimation-alert {
    font-size: .78rem;
    color: var(--c-orange, #e67e22);
    margin: .2rem 0 0 0;
    line-height: 1.3;
}
.cf-estimation-alert a { color: inherit; text-decoration: underline; }

/* ── C3 — Bannière anonyme + gate tooltip ─────────────────────────────────── */
.mp-anon-banner {
    display: flex; align-items: flex-start; gap: .75rem;
    background: #f8f5ec; border: 1px solid #ddd;
    border-radius: 8px; padding: .875rem 1rem;
    margin: .875rem 0;
}
.mp-anon-banner--red { background: #fff3ef; border-color: #f0b8a8; }
.mp-anon-banner p { margin: 0; font-size: .85rem; line-height: 1.4; flex: 1; }
.mp-anon-banner__cta {
    white-space: nowrap; font-size: .82rem; font-weight: 600;
    background: var(--c-primary, #1a6cff); color: #fff;
    border-radius: 6px; padding: .35rem .75rem;
    text-decoration: none; align-self: center;
}
.anon-tooltip-hint {
    font-size: .78rem; color: var(--c-primary, #1a6cff);
    margin: .2rem 0 0 .5rem;
}
.anon-tooltip-hint a { color: inherit; font-weight: 600; }

/* ── Travel mode switch ─────────────────────────────────────────────────── */
.travel-mode-switch.link-discrete {
  background: none;
  border: none;
  padding: 0;
  margin-top: .4rem;
  font-size: .8rem;
  color: var(--c-muted, #888);
  cursor: pointer;
  text-decoration: underline;
  display: block;
}
.travel-conversion-note {
  font-size: .82rem;
  color: var(--c-muted, #888);
  margin: .5rem 0 0;
  line-height: 1.5;
}
.travel-conversion-note__sub {
  display: block;
  font-style: italic;
}
