/* GM Suivi — feuille de styles */
:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --ink: #172033;
  --muted: #667085;
  --line: #e4e8f0;
  --side: #14213d;
  --side2: #1d2f55;
  --side-ink: #c9d3e6;
  --accent: #2563eb;
  --accent-2: #4f46e5;
  --soft: #eef3ff;
  --ok: #12805c;
  --ok-soft: #e6f6ef;
  --ko: #b42318;
  --ko-soft: #fdecea;
  --warn: #b45309;
  --warn-soft: #fff5e6;
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.5 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: var(--ink); background: var(--bg); display: flex; min-height: 100vh; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; margin: 0 0 16px; }
h3 { font-size: 15px; margin: 18px 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.nowrap form { display: inline; }
.is-hidden, .is-collapsed, .is-filtered { display: none !important; }

/* Barre latérale */
.sidebar { width: 220px; flex-shrink: 0; background: linear-gradient(180deg, var(--side), var(--side2)); color: var(--side-ink); display: flex; flex-direction: column; padding: 20px 14px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; color: #fff; font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand small { display: block; font-weight: 500; color: var(--side-ink); font-size: 11px; }
.logo { width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, #3b82f6, #6366f1); display: grid; place-items: center; color: #fff; font-weight: 800; letter-spacing: -.02em; box-shadow: 0 4px 12px rgba(59,130,246,.4); flex-shrink: 0; }
.sidebar nav a { display: flex; align-items: center; gap: 10px; color: var(--side-ink); padding: 9px 12px; border-radius: 10px; margin-bottom: 4px; font-weight: 500; }
.sidebar nav a svg { width: 18px; height: 18px; opacity: .85; }
.sidebar nav a.active, .sidebar nav a:hover { background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }
.me { margin-top: auto; padding: 10px; border-radius: 10px; background: rgba(255,255,255,.06); font-size: 12px; }
.me-id { display: flex; align-items: center; gap: 10px; }
.me-id b { display: block; color: #fff; font-size: 13px; }
.me-links { display: flex; gap: 12px; margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.08); }
.me-links a, .me-links .link-button { color: var(--side-ink); font-size: 12px; }
.me-links form { display: inline; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; background: #6366f1; flex-shrink: 0; }

.main { flex: 1; padding: 24px 28px 80px; min-width: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.page-head h1 { margin: 0; }
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 6px; }

/* Boutons */
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 9px 16px; border-radius: 10px; cursor: pointer; font: inherit; font-weight: 600; }
.btn:hover { text-decoration: none; border-color: #c7cfdd; }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; color: #fff; box-shadow: 0 4px 12px rgba(37,99,235,.28); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; box-shadow: 0 4px 12px rgba(18,128,92,.25); }
.btn.danger { background: var(--ko); border-color: var(--ko); color: #fff; }
.btn.small { padding: 5px 11px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; justify-content: center; }
.link-button { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font: inherit; }
.link-button.danger { color: var(--ko); }
.link-muted { background: none; border: 0; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; margin-right: auto; padding: 0; }
.link-muted:hover { color: var(--ink); }
button:disabled { opacity: .5; cursor: default; }

/* Messages */
.flash { padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; }
.flash.notice { background: var(--ok-soft); color: var(--ok); }
.flash.alert { background: var(--ko-soft); color: var(--ko); }
.flash ul { margin: 6px 0 0; padding-left: 18px; }
.toasts { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; width: min(560px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; margin: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; box-shadow: 0 10px 30px rgba(16,24,40,.16); transition: opacity .3s, transform .3s; font-weight: 500; }
.toast.notice { border: 1px solid #b8e6d2; }
.toast.alert { border: 1px solid #f5c2bc; }
.toast-hide { opacity: 0; transform: translateY(-8px); }
.toast-close { background: none; border: 0; cursor: pointer; color: inherit; opacity: .6; font-size: 13px; padding: 0; }
.toast-close:hover { opacity: 1; }

/* Tableaux */
.table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.table th, .table td { padding: 11px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table th { background: #f8fafd; font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.table tbody tr:hover td { background: #fafbff; }
.table td a:first-child { font-weight: 600; }
.table tr.inactive td { color: var(--muted); }
.search { margin: 4px 0 16px; }
.search input { max-width: 340px; }

.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 20px; background: #eef1f6; color: var(--muted); }
.badge.done, .badge.validated { background: var(--ok-soft); color: var(--ok); }
.badge.refused { background: var(--ko-soft); color: var(--ko); }
.badge.pending, .badge.editing { background: var(--warn-soft); color: var(--warn); }

/* Cartes et formulaires */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.card.pad { padding: 16px 18px; }
.card.narrow { max-width: 560px; }
.card-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 12px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
label { display: block; margin-bottom: 12px; }
label.inline { display: inline-flex; align-items: center; gap: 6px; margin: 0 14px 6px 0; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=date], select, textarea {
  display: block; width: 100%; margin-top: 4px; padding: 9px 12px; border: 1px solid #d3d9e5; border-radius: 10px; font: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--soft); }
textarea { resize: vertical; }
input:disabled, select:disabled, textarea:disabled { background: #f7f8fa; color: #4b5563; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.actions { display: flex; gap: 10px; justify-content: flex-end; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.hint { font-size: 12px; color: var(--muted); margin: 0; padding: 0 22px 14px; text-align: right; }
.read-only-note { margin-right: auto; }

/* En-tête du dossier */
.dossier-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.dossier-head h1 { margin: 0; }
.chips { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.chip { font-size: 12px; font-weight: 500; padding: 3px 10px; border-radius: 20px; background: #fff; border: 1px solid var(--line); color: var(--muted); }
.chip-link { color: var(--accent); }
.chip-warn { background: var(--warn-soft); color: var(--warn); border-color: #f3d6a8; }
.progress { min-width: 260px; }
.progress-top { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.progress-top b { color: var(--ink); }
.bar { height: 8px; border-radius: 8px; background: #e3e8f2; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 8px; background: linear-gradient(90deg, #22c55e, #16a34a); }

/* Page étape */
.step-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr) 250px; gap: 18px; align-items: start; }
.col-left .card, .col-right .card { margin-bottom: 14px; }

/* Frise des étapes */
.timeline { list-style: none; margin: 0; padding: 0; max-height: 70vh; overflow: auto; }
.timeline li { position: relative; padding: 6px 0 6px 34px; font-size: 13px; }
.timeline li::before { content: ""; position: absolute; left: 11px; top: 0; bottom: 0; width: 2px; background: #e3e8f2; }
.timeline li:first-child::before { top: 14px; }
.timeline li:last-child::before { bottom: calc(100% - 14px); }
.timeline .num { position: absolute; left: 0; top: 5px; width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 2px solid #cfd6e3; font-size: 11px; font-weight: 700; color: var(--muted); display: grid; place-items: center; z-index: 1; }
.timeline a { color: var(--muted); display: block; line-height: 1.35; padding-top: 2px; }
.timeline a:hover { color: var(--ink); text-decoration: none; }
.timeline .done .num { background: var(--ok); border-color: var(--ok); color: #fff; }
.timeline .done a { color: var(--ink); }
.timeline .editing .num { background: var(--warn); border-color: var(--warn); color: #fff; }
.timeline .current .num { border-color: var(--accent); color: var(--accent); }
.timeline .current a { color: var(--accent); }
.timeline .selected a { font-weight: 700; color: var(--ink); }
.timeline .selected .num { box-shadow: 0 0 0 4px var(--soft); }

/* Carte de l'étape */
.step-card { padding: 0; overflow: hidden; }
.step-card.done { border-color: #b8e6d2; }
.step-card.editing { border-color: #f3d6a8; }
.step-head { padding: 20px 22px 18px; background: linear-gradient(135deg, #eef3ff 0%, #f5f0ff 100%); border-bottom: 1px solid var(--line); position: relative; overflow: hidden; }
.step-card.done .step-head { background: linear-gradient(135deg, #e9f8f1 0%, #eef6ff 100%); }
.step-card.editing .step-head { background: linear-gradient(135deg, #fff6e8 0%, #fff0f0 100%); }
.step-head::after { content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: radial-gradient(circle, rgba(99,102,241,.14), transparent 70%); pointer-events: none; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-2); }
.step-card.done .eyebrow { color: var(--ok); }
.step-card.editing .eyebrow { color: var(--warn); }
.step-head h2 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; margin: 4px 0 10px; }
.meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 20px; background: #fff; border: 1px solid var(--line); color: var(--ink); }
.pill .d { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.todo { color: var(--accent); border-color: #c7d7fe; }
.pill.done { background: var(--ok-soft); color: var(--ok); border-color: #b8e6d2; }
.pill.editing { background: var(--warn-soft); color: var(--warn); border-color: #f3d6a8; }
.step-body { padding: 16px 22px 20px; }
.step-actions { margin: 0; padding: 14px 22px; border-top: 1px solid var(--line); background: #fbfcfe; }
.step-actions:empty { display: none; }
.step-actions.sticky { position: sticky; bottom: 0; z-index: 5; }
.banner { border-radius: 10px; padding: 10px 14px; font-size: 13px; font-weight: 500; margin-bottom: 14px; }
.banner.done { background: var(--ok-soft); color: var(--ok); }
.banner.editing { background: var(--warn-soft); color: var(--warn); }
.banner-sub { display: block; opacity: .85; font-size: 12px; font-weight: 400; margin-top: 2px; }

/* Colonne de droite */
.person { display: flex; align-items: center; gap: 10px; }
.person + .person { margin-top: 10px; }
.person b { display: block; }
.person span:not(.avatar) { font-size: 12px; color: var(--muted); }
.kv { margin: 0; }
.kv > div { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.kv > div:last-child { border-bottom: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-weight: 600; }

/* Champs du formulaire */
.field { margin-bottom: 16px; }
.field > .label { display: block; font-weight: 600; margin-bottom: 6px; }
.field-help { margin: -2px 0 8px; font-size: 13px; color: var(--muted); max-width: 680px; }
.form-title { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 700; margin: 24px 0 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.form-title::before { content: "◆"; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--soft); color: var(--accent); font-size: 12px; flex-shrink: 0; }
fieldset > .form-title:first-child, .answers > .form-title:first-child { margin-top: 4px; }
/* Champs conditionnels : pas de barre ni de retrait, ils s'enchaînent comme les autres champs */
.branch { margin: 16px 0 0; padding: 0; border: 0; background: none; border-radius: 10px; }
.branch.just-shown { animation: just-shown 2s ease-out; }
@keyframes just-shown { 0%, 40% { background: #eef4ff; box-shadow: 0 0 0 8px #eef4ff; } 100% { background: transparent; box-shadow: 0 0 0 8px transparent; } }
.checks { margin-top: 4px; }
.suffix-input { display: flex; align-items: center; gap: 6px; max-width: 220px; }
.suffix-input input { margin-top: 0; }
.f-number input, .f-date input { max-width: 220px; }
.f-text input, .f-person select { max-width: 520px; }
.f-calculated { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: linear-gradient(135deg, #f4f7ff, #f7f4ff); border: 1px solid #e3e8fb; border-radius: 10px; padding: 9px 12px; }
.f-calculated .label { font-weight: 500; }
.f-calculated output { font-weight: 800; white-space: nowrap; color: #1e3a8a; }
.file-input span { margin-right: 10px; }
.file-input input[type=file] { margin-top: 6px; }

/* Choix courts : boutons */
.seg { display: inline-flex; flex-wrap: wrap; background: #f1f4f9; border-radius: 10px; padding: 3px; gap: 3px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { margin: 0; padding: 7px 18px; border-radius: 8px; cursor: pointer; font-weight: 500; color: var(--muted); user-select: none; }
.seg label:hover { color: var(--ink); }
.seg input:checked + label { background: #fff; color: var(--accent); font-weight: 600; box-shadow: 0 1px 3px rgba(16,24,40,.14); }
.seg input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 0; }
.seg input:disabled + label { cursor: default; }
.clear-choice { background: none; border: 0; color: var(--muted); font-size: 12px; cursor: pointer; margin-left: 8px; padding: 0; }
.clear-choice:hover { color: var(--ko); }
fieldset:disabled .clear-choice { display: none; }

/* Listes longues : champ avec recherche */
.combo { position: relative; max-width: 420px; }
.combo-list { list-style: none; margin: 4px 0 0; padding: 4px; position: absolute; left: 0; right: 0; z-index: 20; background: #fff; border: 1px solid var(--line); border-radius: 10px; max-height: 240px; overflow: auto; box-shadow: 0 10px 30px rgba(16,24,40,.12); }
.combo-list li { padding: 7px 10px; border-radius: 8px; cursor: pointer; }
.combo-list li.active, .combo-list li:hover { background: var(--soft); }
.combo-list li.empty { color: var(--muted); cursor: default; background: none; }
.combo-list.is-closed { display: none; }

/* Choix principal : tuiles par famille */
.tiles-search { margin-bottom: 4px; }
.tiles-field .fam { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 14px 0 6px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.tile { position: relative; }
.tile input { position: absolute; opacity: 0; pointer-events: none; }
.tile label { display: block; height: 100%; margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: #fff; font-size: 13px; transition: border-color .15s, box-shadow .15s; }
.tile label:hover { border-color: #b9c6e0; box-shadow: 0 2px 6px rgba(16,24,40,.06); }
.tile input:checked + label { border-color: var(--accent); background: var(--soft); color: #1e40af; font-weight: 600; box-shadow: 0 0 0 1px var(--accent) inset; }
.tile input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 1px; }
.tiles-chosen { display: flex; align-items: center; gap: 12px; margin-top: 4px; padding: 9px 14px; background: var(--soft); border-radius: 10px; color: #1e40af; width: fit-content; }
fieldset:disabled .tiles-chosen .link-button { display: none; }

/* Blocs répétables et lignes de prix */
.f-repeat > .rows { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.repeat-row { position: relative; border: 1px solid var(--line); border-radius: 12px; padding: 16px 36px 4px 16px; background: #fcfdff; box-shadow: 0 1px 2px rgba(16,24,40,.03); }
.repeat-row .repeat-row { background: #fff; }
.remove-row { position: absolute; top: 10px; right: 10px; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 14px; width: 24px; height: 24px; border-radius: 6px; }
.remove-row:hover { color: var(--ko); background: var(--ko-soft); }
.f-lines .line { border: 1px solid #d9e3fb; border-radius: 12px; padding: 14px 16px 4px; margin-bottom: 12px; background: #fbfcff; }
.line-label { font-weight: 700; margin-bottom: 10px; color: #1e40af; }
.recap { margin: 0 0 12px; font-size: 13px; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 16px; background: #f5f7fb; border-radius: 10px; padding: 10px 12px; }
.recap dt { color: var(--muted); font-size: 12px; }
.recap dd { margin: 0; font-weight: 500; }
.recap-produits .recap { margin-bottom: 10px; }

/* Récapitulatif en lecture */
.answers { margin: 0; }
.answer { padding: 8px 0; border-bottom: 1px solid #f0f2f6; }
.answer dt { color: var(--muted); font-size: 12px; }
.answer dd { margin: 0; font-weight: 500; }
.answer-calc dd { font-weight: 800; color: #1e3a8a; }
.answer-branch { margin: 0; padding: 0; border: 0; }
.answer-group { border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px; margin: 12px 0; background: #fcfdff; }
.answer-group-title { font-weight: 700; margin: 2px 0 4px; }
.answer-row { position: relative; border-top: 1px dashed var(--line); padding-top: 4px; }
.answer-row:first-of-type { border-top: 0; }
.answer-row-num { position: absolute; right: 0; top: 8px; font-size: 11px; color: var(--muted); background: #eef1f6; border-radius: 8px; padding: 1px 7px; }

/* Maquettes */
.mockup { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.mockup .review { display: flex; gap: 8px; margin-top: 8px; align-items: center; }
.mockup .review input { margin: 0; }
.mockup-upload { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 8px; }
.mockup-upload input[type=text] { margin-bottom: 8px; }

/* Connexion */
body.auth { align-items: center; justify-content: center; background: radial-gradient(circle at 20% 10%, #e0e9ff, transparent 40%), radial-gradient(circle at 90% 90%, #ece4ff, transparent 40%), var(--bg); }
.auth-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 30px; width: 380px; box-shadow: 0 20px 50px rgba(16,24,40,.08); }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.auth-brand h1 { margin: 0; }

@media (max-width: 1100px) {
  .step-layout { grid-template-columns: 1fr; }
  .col-right { order: -1; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  .timeline { max-height: none; }
}
@media (max-width: 700px) {
  body { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; align-items: center; gap: 12px; padding: 12px 16px; }
  .brand { margin: 0; }
  .sidebar nav { display: flex; gap: 4px; }
  .me { margin: 0 0 0 auto; }
  .me-id div { display: none; }
  .main { padding: 16px; }
  .table { display: block; overflow-x: auto; }
  .col-right { grid-template-columns: 1fr; }
  .progress { min-width: 0; width: 100%; }
}

/* Champs obligatoires */
.req { color: #e11d48; font-weight: 700; }
.req-legend { font-size: 12px; color: var(--muted); margin: 0 0 6px; text-align: right; }
.field.missing > .label { color: var(--ko); }
.field.missing > input, .field.missing > select, .field.missing > textarea,
.field.missing > .combo input, .field.missing > .suffix-input input { border-color: #f04438; box-shadow: 0 0 0 3px #fee4e2; }
.field.missing > .seg { box-shadow: 0 0 0 2px #f04438; }
.field.missing > .tiles-field .tiles-search { border-color: #f04438; }
.field.missing.f-repeat > .rows + template + .btn, .field.missing.f-repeat > .btn { border-color: #f04438; color: var(--ko); }
.missing-msg { color: var(--ko); font-size: 12px; font-weight: 600; margin-top: 4px; }
.missing-msg::before { content: "⚠ "; }

/* Aperçu des images */
.file-current { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.thumb { display: inline-block; line-height: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; box-shadow: 0 1px 3px rgba(16,24,40,.08); }
.thumb img { max-width: 220px; max-height: 160px; object-fit: contain; display: block; }
.thumb:hover { border-color: var(--accent); }
.file-new { display: flex; align-items: center; gap: 12px; margin: 8px 0 4px; padding: 8px; border: 1px dashed #c7d7fe; border-radius: 10px; background: #f9fbff; font-size: 12px; color: var(--muted); }
.file-new img { max-width: 160px; max-height: 120px; object-fit: contain; border-radius: 8px; }
.answer dd .thumb { margin: 4px 0; }
.file-new[hidden] { display: none; }
.file-current[hidden], .file-removed[hidden], .file-input input[type=file][hidden] { display: none; }
.file-remove { border: 1px solid var(--line); background: #fff; color: var(--ko); border-radius: 8px; padding: 4px 10px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.file-remove:hover { background: var(--ko-soft); border-color: #f5c2bc; }
.file-removed { font-size: 12px; color: var(--muted); padding: 6px 0; }
fieldset:disabled .file-remove { display: none; }
.recap-box { border: 1px solid var(--line); border-radius: 12px; padding: 8px 16px 12px; background: #fcfdff; }
.recap-box .answers { margin-bottom: 6px; }

/* Message de fin d'étape */
.completion { display: flex; gap: 14px; align-items: flex-start; background: linear-gradient(135deg, #e9f8f1, #eef6ff); border: 1px solid #b8e6d2; border-radius: 12px; padding: 14px 16px; margin: 4px 0 16px; }
.completion-icon { font-size: 26px; line-height: 1; }
.completion strong { color: var(--ok); }
.completion p { margin: 4px 0 0; }

/* Circuit maquette au cœur de l'étape */
.mockup-core { margin-top: 8px; }
.mockup-core .mockup { padding: 14px 16px; }
.mockup-latest { border-color: #c7d7fe; background: #f9fbff; box-shadow: 0 2px 8px rgba(37,99,235,.08); }
.mockup-latest .thumb img { max-width: 420px; max-height: 300px; }
.mockup-core .mockup-upload { border: 2px dashed #c7d7fe; border-radius: 12px; padding: 16px; background: #fbfcff; margin-top: 12px; }
.brief { margin-top: 18px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px; background: #fcfdff; }
.brief summary { cursor: pointer; font-weight: 700; }
.brief .recap-etape > .label { display: none; }
.brief .recap-box { border: 0; padding: 0; background: none; }
.review { flex-wrap: wrap; }
.review input.is-invalid { border-color: #f04438; box-shadow: 0 0 0 3px #fee4e2; }
.review-msg { width: 100%; }
.review-msg[hidden] { display: none; }

/* Enregistrement automatique */
.autosave-status { margin-right: auto; font-size: 13px; color: var(--muted); }
.autosave-status[data-kind="ok"] { color: #067647; }
.autosave-status[data-kind="err"] { color: #b42318; }

/* Lignes de prix regroupées par produit : bandeau produit + pastilles option / quantité / livraisons */
.f-lines .line.in-group, .answer-group.in-group { margin: 0; border-radius: 0; border-top: 1px dashed #d9e3fb; }
.f-lines .line.in-group { border-color: #d9e3fb; border-top-style: dashed; }
.in-group.group-first { border-top: 1px solid #d9e3fb; border-radius: 14px 14px 0 0; overflow: hidden; padding-top: 0; }
.in-group.group-last { border-bottom-left-radius: 14px; border-bottom-right-radius: 14px; margin-bottom: 16px; }
.in-group.group-first.group-last { border-radius: 14px; }
.product-head { display: flex; gap: 12px; align-items: center; margin: 0 -16px 14px; padding: 12px 16px; background: linear-gradient(135deg, #eef4ff, #f5f3ff); border-bottom: 1px solid #d9e3fb; }
.pnum { width: 32px; height: 32px; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 800; display: grid; place-items: center; flex: none; }
.pname { font-size: 16px; font-weight: 800; line-height: 1.2; }
.pmeta { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.pbadge { margin-left: auto; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.chips-line { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.lchip { font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 8px; background: #eef2ff; border: 1px solid #dbe4ff; color: #1d3fae; }
.lchip b { font-weight: 800; }
.lchip-option { background: #fff7ed; border-color: #fed7aa; color: #9a3412; }
.f-select select.dropdown { max-width: 420px; }
.branch > .field:last-child { margin-bottom: 0; }

/* Menus déroulants : flèche maison, décalée du bord droit */
select:not([multiple]) {
  -webkit-appearance: none; appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23667085' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; background-size: 12px 8px;
}
