:root { --ink:#1d2433; --muted:#6b7385; --line:#e3e7ef; --bg:#f4f6fa;
  --brand:#1f4fd6; --ok:#137a43; --warn:#9a5b00; }
* { box-sizing: border-box; }
body { margin:0; background:var(--bg); color:var(--ink);
  font:16px/1.5 -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
main { max-width:640px; margin:0 auto; padding:20px 16px 8px; }
.card { background:#fff; border-radius:16px; padding:22px; margin-bottom:16px;
  box-shadow:0 1px 2px rgba(20,30,60,.06); }
.center { text-align:center; }
h1 { font-size:22px; margin:0 0 4px; }
h2 { font-size:17px; margin:0 0 12px; }
.muted { color:var(--muted); font-size:14px; }
.amount { font-size:28px; font-weight:700; margin:8px 0 2px; }
.row { display:flex; justify-content:space-between; gap:12px; padding:6px 0;
  border-bottom:1px solid var(--line); font-size:15px; }
.row:last-child { border-bottom:0; }
.btn { display:block; width:100%; border:0; border-radius:12px; padding:15px;
  font-size:16px; font-weight:600; cursor:pointer; margin-top:16px;
  background:var(--brand); color:#fff; text-align:center; text-decoration:none; }
.btn.secondary { background:#eef2fb; color:var(--brand); }
.badge { display:inline-block; font-size:12px; font-weight:600; padding:2px 8px;
  border-radius:20px; background:#eef2fb; color:var(--brand); }
.badge.old { background:#f1f2f5; color:var(--muted); }
.badge.ok { background:#e6f5ec; color:var(--ok); }
.version { display:flex; justify-content:space-between; align-items:center;
  gap:10px; padding:12px 0; border-bottom:1px solid var(--line); }
.version:last-child { border-bottom:0; }
.link { background:none; border:0; color:var(--brand); font-weight:600;
  cursor:pointer; font-size:15px; padding:6px 0; }
.note { background:#fff8e8; color:var(--warn); border-radius:12px;
  padding:12px 14px; font-size:14px; margin-top:12px; }
/* Recette A0 (7/11) : zone de message vide = rien d'affiché. */
.note:empty { display:none; }
pre.bank { white-space:pre-wrap; font:14px/1.5 ui-monospace, Menlo, monospace;
  background:#f6f7fa; padding:12px; border-radius:10px; }
.foot { max-width:640px; margin:0 auto; padding:8px 16px 32px;
  color:var(--muted); font-size:12px; text-align:center; }
.spinner { width:28px; height:28px; border:3px solid var(--line);
  border-top-color:var(--brand); border-radius:50%; margin:8px auto 12px;
  animation:spin 1s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }
/* Signature */
.fields { display:grid; gap:6px; margin:14px 0 6px; }
label { font-size:14px; font-weight:600; }
input[type=text] { width:100%; font-size:16px; padding:12px 14px; border-radius:10px;
  border:1px solid var(--line); background:#fff; color:var(--ink); margin-bottom:8px; }
input[type=text]:focus { outline:2px solid var(--brand); border-color:transparent; }
.consent { display:flex; gap:12px; align-items:flex-start; font-weight:400; font-size:15px;
  background:#f6f7fa; border-radius:12px; padding:14px; margin-top:8px; cursor:pointer; }
.consent input { width:22px; height:22px; flex:0 0 22px; margin:2px 0 0; accent-color:var(--brand); }
.quote { background:#f6f7fa; border-left:3px solid var(--brand); border-radius:8px;
  padding:10px 12px; font-size:14px; }
input.code { font-size:28px; letter-spacing:10px; text-align:center; font-weight:700;
  font-variant-numeric:tabular-nums; margin-top:6px; }
.error { color:#b42318; font-size:14px; min-height:0; margin:10px 0 0; }
.error:empty { display:none; }
.okbox { background:#e6f5ec; color:var(--ok); border-radius:12px; padding:12px 14px;
  font-size:15px; font-weight:600; margin-top:14px; }
.btn[disabled], .link[disabled] { opacity:.55; cursor:default; }
.btn.busy { opacity:.7; }
.link { display:block; margin:10px auto 0; }
/* --- Lot 3 Messages --- */
.msgs { display:flex; flex-direction:column; gap:10px; margin:8px 0 12px; }
.msg { max-width:88%; background:#f1f3f8; border-radius:14px 14px 14px 4px;
  padding:10px 12px; align-self:flex-start; }
.msg.mine { background:#e8eefc; border-radius:14px 14px 4px 14px; align-self:flex-end; }
.msg.sys { align-self:center; background:none; text-align:center; color:var(--muted);
  font-size:13px; padding:4px; }
.msg .who { font-size:12px; font-weight:700; color:var(--muted); margin-bottom:2px; }
.msg .text { margin:0; white-space:pre-wrap; overflow-wrap:anywhere; }
.msg .removed { margin:0; font-style:italic; color:var(--muted); }
.msg .meta { font-size:12px; color:var(--muted); margin-top:4px; }
.msg .thumb img { display:block; max-width:100%; max-height:220px; border-radius:10px;
  margin-top:6px; }
.msg .file { display:inline-block; margin-top:6px; color:var(--brand); font-weight:600;
  overflow-wrap:anywhere; }
.link.small { font-size:13px; margin:4px 0 0; padding:2px 0; }
.link.inline { display:inline; margin:0; }
textarea { width:100%; font-family:inherit; font-size:16px; line-height:1.4; padding:12px 14px; border-radius:10px;
  border:1px solid var(--line); resize:vertical; min-height:84px; margin-top:6px; }
textarea:focus { outline:2px solid var(--brand); border-color:transparent; }
.compose-row { display:flex; justify-content:space-between; align-items:center; gap:8px;
  margin-top:6px; }
.chips { display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
.chip { background:#eef2fb; color:var(--brand); border-radius:20px; padding:4px 6px 4px 12px;
  font-size:13px; display:inline-flex; align-items:center; gap:4px; }
.chip-x { border:0; background:none; color:var(--brand); font-size:18px; cursor:pointer;
  line-height:1; padding:0 4px; }
.hidden { display:none; }
.print-only { display:none; }
@media print {
  body.printing main, body.printing .foot { display:none; }
  body.printing .print-only { display:block; padding:16px; }
  .print-msg { border-bottom:1px solid #ccc; padding:8px 0; break-inside:avoid; }
  .print-msg .text { white-space:pre-wrap; margin:4px 0 0; }
}
/* --- fin Lot 3 Messages --- */
/* --- Lot 4 Échéancier --- */
.badge.warn { background:#fff4e0; color:#9a5b00; }
/* --- fin Lot 4 --- */

/* Lot 5 : certification TVA à taux réduit */
.tax { margin:16px 0; padding-top:12px; border-top:1px solid #e6e8ee; }
.tax h3 { font-size:16px; margin:0 0 6px; }
.small { font-size:13px; }
/* Lot 7 : un bouton masqué reste masqué malgré .btn { display:block }. */
[hidden] { display:none !important; }
/* Lot 6 : PV de réception à signer à distance. */
#pv-reception label { display:block; margin:12px 0 6px; font-weight:600; }
#pv-reception input[type=text], #pv-reception textarea { width:100%; box-sizing:border-box;
  border:1px solid #d5dbe6; border-radius:12px; padding:12px; font:inherit; margin-bottom:10px; }
#pv-reception .pv-text { background:#f5f7fb; border-radius:12px; padding:14px; line-height:1.5; }
#pv-reception .pv-check { display:flex; gap:10px; align-items:flex-start; font-weight:400; margin:10px 0 14px; }
#pv-reception .pv-check input { margin-top:3px; }
/* Lot 9 : rendez-vous. */
#rendez-vous .rdv { border-top:1px solid #edf0f6; padding:12px 0; }
#rendez-vous .rdv:first-of-type { border-top:0; }
#rendez-vous .rdv .btn { margin-top:10px; }
#rendez-vous textarea { width:100%; box-sizing:border-box; border:1px solid #d5dbe6;
  border-radius:12px; padding:12px; font:inherit; margin-top:10px; }
/* Lot 10 : variantes. */
#propositions .variant { border-top:1px solid #edf0f6; padding:12px 0; }
#propositions .variant.current { background:#f5f7fb; border-radius:12px; padding:12px; border-top:0; }
#propositions .variant .btn { margin-top:8px; }
