:root {
  --bg: #f6f3ee;
  --surface: #ffffff;
  --ink: #23201c;
  --muted: #6f675d;
  --line: #e4ddd2;
  --accent: #c2410c;
  --accent-ink: #ffffff;
  --accent-soft: #fde7da;
  --ok: #15803d;
  --err: #b91c1c;
  --radius: 12px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; }
body { margin: 0; line-height: 1.45; }
a { color: var(--accent); }
h1 { font-size: 1.6rem; margin: .2rem 0 1rem; }
h2 { font-size: 1.15rem; margin: 2rem 0 .8rem; }
h3 { font-size: 1.05rem; margin: 0; }

/* --- Barre du haut --- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .7rem 1.2rem; background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.brand { font-weight: 700; text-decoration: none; color: var(--ink); }
#nav { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
#nav a { text-decoration: none; color: var(--muted); padding: .25rem .5rem; border-radius: 6px; }
#nav a.active { color: var(--ink); background: var(--accent-soft); }
.who { color: var(--muted); font-size: .9rem; }

main { max-width: 1040px; margin: 0 auto; padding: 1.5rem 1.2rem 4rem; }

/* --- Cartes & grilles --- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem 1.2rem; margin-bottom: 1rem; display: block;
}
.card.link { color: inherit; text-decoration: none; transition: border-color .15s, transform .15s; }
.card.link:hover { border-color: var(--accent); transform: translateY(-1px); }
.card.narrow { max-width: 420px; margin: 3rem auto; }
.card > h2:first-child { margin-top: 0; }
.card-head { display: flex; justify-content: space-between; align-items: start; gap: 1rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.grid .card { margin: 0; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }

.muted { color: var(--muted); }
.small { font-size: .85rem; }
.meta { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin: .8rem 0 0; }
.pill {
  display: inline-block; font-size: .8rem; padding: .15rem .6rem; border-radius: 99px;
  background: var(--accent-soft); color: var(--accent); font-weight: 600;
}
.code {
  font-family: ui-monospace, monospace; font-size: .8rem; padding: .1rem .45rem;
  border: 1px solid var(--line); border-radius: 6px; color: var(--muted); vertical-align: middle;
}
.seller-badge {
  background: var(--ink); color: #fff; font-weight: 700; padding: .35rem .7rem;
  border-radius: 8px; white-space: nowrap;
}
.facts { display: grid; grid-template-columns: auto 1fr; gap: .2rem .8rem; margin: .8rem 0; font-size: .92rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }

/* --- Frise des étapes --- */
.timeline { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: .3rem; }
.timeline li { border-top: 4px solid var(--line); padding-top: .4rem; font-size: .8rem; }
.timeline li.done { border-color: #d6c7b5; color: var(--muted); }
.timeline li.current { border-color: var(--accent); }
.timeline li.current .tl-label { color: var(--accent); font-weight: 700; }
.tl-label, .tl-date { display: block; }
.tl-date { color: var(--muted); }
@media (max-width: 640px) {
  .timeline { grid-template-columns: 1fr; }
  .timeline li { border-top: 0; border-left: 4px solid var(--line); padding: .1rem 0 .1rem .6rem; }
}

/* --- Indicateurs --- */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .7rem; margin: 1.5rem 0; }
.kpis div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem .9rem; color: var(--muted); font-size: .85rem; }
.kpis span { display: block; font-size: 1.3rem; font-weight: 700; color: var(--ink); }

/* --- Tableau --- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { padding: .55rem .8rem; border-bottom: 1px solid var(--line); text-align: left; }
th { font-weight: 600; color: var(--muted); background: #faf8f4; }
tbody tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* --- Formulaires --- */
.stack { display: flex; flex-direction: column; gap: .8rem; }
.row { display: flex; gap: .8rem; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.grow { flex: 1 1 220px; }
label { display: flex; flex-direction: column; gap: .25rem; font-size: .88rem; font-weight: 600; }
label small { font-weight: 400; color: var(--muted); }
input {
  font: inherit; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
input.upper { text-transform: uppercase; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem; margin: 0; }
fieldset.dates label { flex: 1 1 150px; }
legend { font-weight: 600; font-size: .9rem; padding: 0 .3rem; }

.btn {
  font: inherit; font-weight: 600; cursor: pointer; border: 1px solid var(--accent);
  background: var(--accent); color: var(--accent-ink); padding: .55rem 1rem; border-radius: 8px;
}
.btn:hover { filter: brightness(1.05); }
.btn:disabled { opacity: .55; cursor: wait; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.small { padding: .3rem .7rem; font-size: .85rem; }

.tabs { display: flex; gap: .3rem; margin-bottom: 1rem; border-bottom: 1px solid var(--line); }
.tab { font: inherit; background: none; border: 0; padding: .5rem .8rem; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; }
.tab.active { color: var(--ink); border-color: var(--accent); font-weight: 600; }

.form-msg { margin: 0; min-height: 1.2em; font-size: .9rem; }
.form-msg.err { color: var(--err); }
.form-msg.ok { color: var(--ok); }

/* --- Toast --- */
#toast {
  position: fixed; left: 50%; bottom: 1.5rem; transform: translate(-50%, 150%);
  background: var(--ink); color: #fff; padding: .7rem 1.1rem; border-radius: 10px;
  transition: transform .25s, opacity .25s; max-width: 90vw; z-index: 10;
  opacity: 0; pointer-events: none;
}
#toast.show { transform: translate(-50%, 0); opacity: 1; }
#toast.err { background: var(--err); }

/* =====================================================================
   Étape 2 — Mes jeux
   ===================================================================== */
.card .row.end { align-items: center; margin-top: .9rem; }
.row.align-end { align-items: flex-end; }
.notice {
  background: #fff8e6; border: 1px solid #f3dfa8; border-radius: var(--radius);
  padding: .65rem .9rem; margin: 1.2rem 0 0; font-size: .92rem;
}
input.price { width: 9rem; font-size: 1.1rem; font-weight: 600; }
.input-with-btn { display: flex; gap: .4rem; }
.input-with-btn input { flex: 1; min-width: 0; }
.simulation {
  margin: 0; padding: .7rem .9rem; border-radius: 8px; background: #f2f7f2;
  border: 1px solid #d5e6d5; font-weight: 400;
}
.simulation .net { color: var(--ok); font-size: 1.1rem; }
.btn.danger { color: var(--err); }
.btn.danger:hover { border-color: var(--err); }

.item-list { display: flex; flex-direction: column; gap: .5rem; }
.item {
  display: grid; grid-template-columns: 1fr auto auto auto; align-items: center; gap: 1rem;
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--line);
  border-radius: 10px; padding: .7rem .9rem;
}
.item-title { font-weight: 600; }
.item-sub { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-top: .25rem; font-size: .88rem; }
.item-money { text-align: right; font-variant-numeric: tabular-nums; }
.item-price { font-weight: 700; }
.item-actions { display: flex; gap: .3rem; }
.item.status-deposited { border-left-color: #2563eb; }
.item.status-sold { border-left-color: var(--ok); }
.item.status-returned { border-left-color: #9ca3af; opacity: .75; }
.item.status-deposited .pill.status { background: #dbeafe; color: #1d4ed8; }
.item.status-sold .pill.status { background: #dcfce7; color: var(--ok); }
.item.status-returned .pill.status { background: #f3f4f6; color: #4b5563; }
.item.status-registered .pill.status { background: #f3efe8; color: var(--muted); }
@media (max-width: 640px) {
  .item { grid-template-columns: 1fr auto; }
  .item .pill.status { justify-self: start; }
  .item-actions { justify-self: end; }
}

/* --- Scanner caméra --- */
.scanner-overlay {
  position: fixed; inset: 0; background: rgba(20, 16, 12, .7); z-index: 20;
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.scanner-box { background: var(--surface); border-radius: var(--radius); padding: 1rem; width: min(520px, 100%); }
.scanner-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .7rem; }
.scanner-view {
  position: relative; background: #000; border-radius: 8px; overflow: hidden; aspect-ratio: 4 / 3;
}
.scanner-view video, .scanner-view canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scanner-view canvas.drawingBuffer { display: none; }
.scanner-aim {
  position: absolute; left: 12%; right: 12%; top: 35%; bottom: 35%; z-index: 2;
  border: 2px solid rgba(255, 255, 255, .85); border-radius: 8px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .25);
}
.scanner-hint { margin: .6rem 0; }
.scanner-manual input { flex: 1; }
.row > label { min-width: 0; max-width: 100%; }
.row > label > input, .input-with-btn { width: 100%; }
.input-with-btn .btn { white-space: nowrap; flex: none; }
.form-msg:empty { display: none; }

/* =====================================================================
   Images de campagne + calendrier par périodes
   ===================================================================== */
.cover { background: var(--accent-soft); overflow: hidden; }
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover.placeholder { display: flex; align-items: center; justify-content: center; font-size: 2rem; opacity: .8;
  background: repeating-linear-gradient(45deg, #fbe3d4, #fbe3d4 12px, #fdeee4 12px, #fdeee4 24px); }
.card.has-cover { padding-top: 0; overflow: hidden; }
.card.has-cover > .cover { margin: 0 -1.2rem .9rem; aspect-ratio: 16 / 7; }
.card.with-side-cover { display: grid; grid-template-columns: 180px 1fr; gap: 1.2rem; padding: 0; overflow: hidden; }
.card.with-side-cover .card-body { padding: 1.1rem 1.2rem 1.1rem 0; min-width: 0; }
.cover.side { height: 100%; min-height: 160px; }
.cover.banner { aspect-ratio: 16 / 5; border-radius: var(--radius); margin-bottom: 1rem; }
@media (max-width: 640px) {
  .card.with-side-cover { grid-template-columns: 1fr; gap: 0; }
  .card.with-side-cover .card-body { padding: 1rem 1.1rem; }
  .cover.side { min-height: 0; aspect-ratio: 16 / 6; }
  .cover.banner { aspect-ratio: 16 / 7; }
}

.image-field { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap;
  border: 1px dashed var(--line); border-radius: var(--radius); padding: .8rem; }
.image-preview { width: 160px; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: var(--accent-soft);
  display: flex; align-items: center; justify-content: center; font-size: 1.6rem; flex: none; }
.image-preview img { width: 100%; height: 100%; object-fit: cover; }
.image-field .stack { gap: .35rem; flex: 1; min-width: 200px; }
.file-btn { display: inline-flex; flex-direction: row; font-weight: 600; cursor: pointer; }

fieldset.periods { display: flex; flex-direction: column; gap: .6rem; }
.period { display: grid; grid-template-columns: 170px 1fr 1fr; gap: .8rem; align-items: end; }
.period-label { font-weight: 600; padding-bottom: .6rem; }
.period-hint { align-self: center; }
@media (max-width: 640px) {
  .period { grid-template-columns: 1fr 1fr; }
  .period-label { grid-column: 1 / -1; padding: .3rem 0 0; }
}
.timeline { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 640px) { .timeline { grid-template-columns: 1fr; } }
a.btn { text-decoration: none; display: inline-block; }

/* --- Mini frise du formulaire de campagne --- */
.mini-tl { border-top: 1px solid var(--line); padding-top: .8rem; margin-top: .2rem; }
.mini-tl-empty { margin: 0; }
.mini-tl-grid { display: grid; grid-template-columns: 150px 1fr; gap: .35rem .8rem; align-items: center; }
.mini-tl-label { font-size: .82rem; color: var(--muted); }
.mini-tl-track { position: relative; height: 22px; border-radius: 6px;
  background: repeating-linear-gradient(90deg, #f3efe8 0 calc(100% / var(--span) - 1px), #e9e3d8 calc(100% / var(--span) - 1px) calc(100% / var(--span))); }
.mini-tl-bar { position: absolute; top: 2px; bottom: 2px; border-radius: 5px; min-width: 6px;
  font-size: .7rem; font-weight: 700; color: #fff; display: flex; align-items: center; justify-content: center;
  overflow: hidden; white-space: nowrap; transition: left .2s, width .2s; }
.mini-tl-dot { position: absolute; top: 5px; width: 12px; height: 12px; border-radius: 50%; transition: left .2s; }
.p-listing { background: #d97706; }
.p-deposit { background: #2563eb; }
.p-sale { background: var(--ok); }
.p-close { background: var(--ink); }
.mini-tl-today, .mini-tl-today-key { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--err); }
.mini-tl-today-key { position: relative; display: inline-block; height: .9em; vertical-align: middle; margin-right: .3rem; top: 0; }
.mini-tl-axis { position: relative; height: 1.2rem; font-size: .7rem; color: var(--muted); }
.mini-tl-axis span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.mini-tl-legend { margin: .3rem 0 0; }
.mini-tl-check { margin: .5rem 0 0; font-size: .88rem; font-weight: 600; }
.mini-tl-check.ok { color: var(--ok); }
.mini-tl-check.err { color: var(--err); }
@media (max-width: 640px) {
  .mini-tl-grid { grid-template-columns: 1fr; gap: .15rem; }
  .mini-tl-label { margin-top: .3rem; }
  .mini-tl-grid > span:empty { display: none; }
}
@media (max-width: 640px) {
  .topbar { flex-wrap: wrap; gap: .4rem; padding: .6rem .9rem; }
  .brand { white-space: nowrap; }
  #nav { gap: .4rem; font-size: .88rem; }
  #nav .who { display: none; }
  fieldset.periods { padding: .7rem .6rem; }
  .period input[type=date] { min-width: 0; }
}

/* --- Étiquettes --- */
select { font: inherit; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
input.short { width: 7rem; }
label.check { flex-direction: row; align-items: center; gap: .5rem; font-weight: 400; }
label.check input { width: auto; }
.labels-bar { display: flex; gap: .8rem; align-items: flex-end; flex-wrap: wrap; }
.labels-bar label { min-width: 220px; }
.labels-bar select { width: 100%; }
td .btn.small { white-space: nowrap; }

/* =====================================================================
   Écran de scan
   ===================================================================== */
.counters { display: flex; gap: .4rem; flex-wrap: wrap; }
.counters span { background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: .25rem .7rem; font-size: .85rem; color: var(--muted); }
.counters b { color: var(--ink); }
.mode-tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin: .5rem 0 1rem; }
.mode-tab { font: inherit; font-weight: 600; padding: .65rem 1.1rem; border-radius: 10px; cursor: pointer;
  border: 2px solid var(--line); background: var(--surface); color: var(--ink); }
.mode-tab.secondary { font-weight: 400; color: var(--muted); }
.mode-tab.active { border-color: var(--accent); background: var(--accent); color: #fff; }
.mode-tab.secondary.active { background: var(--ink); border-color: var(--ink); }

.scan-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 1.4rem; align-items: start; }
.scan-layout:not([data-mode=sell]) { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
@media (max-width: 800px) { .scan-layout, .scan-layout:not([data-mode=sell]) { grid-template-columns: 1fr; } }
.scan-main { display: flex; flex-direction: column; gap: .8rem; }
.scan-main > p { margin: 0; }
.scan-input-row { display: flex; gap: .5rem; }
.scan-input-row input { flex: 1; min-width: 0; font-size: 1.25rem; font-family: ui-monospace, monospace; padding: .8rem 1rem; letter-spacing: .03em; }

.qr-view { position: relative; aspect-ratio: 4 / 3; background: #000; border-radius: var(--radius); overflow: hidden; max-height: 55vh; }
.qr-view video { width: 100%; height: 100%; object-fit: cover; display: block; }
.qr-aim { position: absolute; inset: 18% 25%; border: 3px solid rgba(255, 255, 255, .85); border-radius: 14px;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, .3); transition: border-color .15s; }
.qr-aim.hit { border-color: #4ade80; }

.feedback { border-radius: var(--radius); padding: 1.1rem 1.2rem; border: 2px solid var(--line); background: var(--surface); min-height: 6.5rem; }
.feedback.idle { color: var(--muted); display: flex; align-items: center; }
.feedback.ok { border-color: #86efac; background: #f0fdf4; }
.feedback.warn { border-color: #fcd34d; background: #fffbeb; }
.feedback.err { border-color: #fca5a5; background: #fef2f2; }
.feedback.pulse { animation: fb-pulse .35s ease-out; }
@keyframes fb-pulse { from { transform: scale(.98); } to { transform: scale(1); } }
.fb-title { font-size: 1.25rem; font-weight: 800; margin-bottom: .25rem; }
.feedback.ok .fb-title { color: var(--ok); }
.feedback.warn .fb-title { color: #b45309; }
.feedback.err .fb-title { color: var(--err); }
.fb-amount { font-size: 1.8rem; font-weight: 800; margin: .2rem 0; font-variant-numeric: tabular-nums; }
.progress-line { margin-top: .5rem; padding-top: .5rem; border-top: 1px dashed var(--line); }
.progress-line.complete { color: var(--ok); font-weight: 600; }

.basket { margin: 0 0 1rem; }
.basket-head { display: flex; justify-content: space-between; align-items: baseline; }
.basket-head h2 { margin: 0 0 .6rem; }
.basket-list { list-style: none; margin: 0; padding: 0; max-height: 45vh; overflow-y: auto; }
.basket-list li { display: grid; grid-template-columns: 1fr auto auto; gap: .6rem; align-items: center; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.basket-price { font-weight: 700; font-variant-numeric: tabular-nums; }
.basket-total { display: flex; justify-content: space-between; align-items: baseline; padding: .8rem 0; font-size: 1.05rem; }
.basket-total strong { font-size: 1.9rem; }
.btn.big { padding: .8rem 1.3rem; font-size: 1.05rem; }

.journal { list-style: none; margin: 0; padding: 0; font-size: .85rem; max-height: 40vh; overflow-y: auto; }
.journal li { padding: .35rem .5rem; border-left: 3px solid var(--line); margin-bottom: .25rem; background: var(--surface); border-radius: 0 6px 6px 0; }
.journal li.ok { border-color: var(--ok); }
.journal li.warn { border-color: #f59e0b; }
.journal li.err { border-color: var(--err); }
.j-time { color: var(--muted); font-variant-numeric: tabular-nums; margin-right: .4rem; }
.scan-input-row input::placeholder { font-family: system-ui, sans-serif; font-size: 1rem; letter-spacing: 0; }
.mode-tab:disabled { opacity: .4; cursor: not-allowed; }
button.btn:disabled[title] { cursor: help; }

/* --- Confirmation de réception (dépôt) --- */
.confirm-overlay {
  position: fixed; inset: 0; z-index: 30; background: rgba(20, 16, 12, .65);
  display: flex; align-items: center; justify-content: center; padding: 1rem;
  animation: confirm-fade .15s ease-out;
}
@keyframes confirm-fade { from { opacity: 0; } to { opacity: 1; } }
.confirm-box {
  background: var(--surface); border-radius: 18px; padding: 1.6rem 1.6rem 1.3rem; width: min(520px, 100%);
  text-align: center; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); outline: none;
  animation: confirm-pop .18s ease-out;
}
@keyframes confirm-pop { from { transform: scale(.94); } to { transform: scale(1); } }
.confirm-kicker { text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; font-weight: 700; color: var(--muted); }
.confirm-title { font-size: clamp(1.6rem, 6vw, 2.2rem); font-weight: 800; line-height: 1.15; margin: .35rem 0 .2rem; text-transform: uppercase; }
.confirm-sub { color: var(--muted); }
.confirm-meta { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; align-items: center; margin-top: .7rem; font-size: .92rem; }
.confirm-notes { margin-top: .8rem; padding: .55rem .8rem; background: #fff8e6; border: 1px solid #f3dfa8; border-radius: 8px; font-size: .92rem; }
.confirm-question { font-size: 1.25rem; font-weight: 700; margin: 1.3rem 0 .9rem; }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.confirm-actions .btn { font-size: 1.2rem; padding: 1rem; border-radius: 12px; }
.btn.confirm-yes { background: var(--ok); border-color: var(--ok); }
.btn.confirm-no { background: var(--err); border-color: var(--err); }
.cam-btn { width: 100%; padding: .85rem; font-size: 1.05rem; }
.manual-entry { font-size: .92rem; }
.manual-entry summary { cursor: pointer; color: var(--muted); padding: .2rem 0; }
.manual-entry[open] summary { margin-bottom: .5rem; }
.manual-entry .scan-input-row input { font-size: 1.05rem; padding: .6rem .8rem; }

/* --- Vente : confirmation du panier + barre mobile --- */
.confirm-list { list-style: none; margin: .8rem 0 0; padding: 0; text-align: left; max-height: 32vh; overflow-y: auto;
  border-top: 1px solid var(--line); }
.confirm-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem .2rem; border-bottom: 1px solid var(--line); }
.confirm-list b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.sale-bar { display: none; }
@media (max-width: 800px) {
  .sale-bar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; gap: .8rem; align-items: center;
    justify-content: space-between; padding: .7rem 1rem calc(.7rem + env(safe-area-inset-bottom));
    background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(0, 0, 0, .08);
  }
  .sale-bar-info { font: inherit; font-size: 1.05rem; color: var(--ink); background: none; border: 0; padding: 0; cursor: pointer; }
  .sale-bar .btn { padding: .75rem 1.4rem; font-size: 1.05rem; }
  body:has(.sale-bar) main { padding-bottom: 6rem; }
}

/* iPhone : Safari zoome automatiquement sur un champ dont le texte fait moins de 16 px.
   On garde donc 16 px minimum pour tous les champs de saisie. */
input, select, textarea { font-size: max(16px, 1em); }
label input, label select { font-size: 16px; font-weight: 400; }
.kpis .kpi-sold { border-color: #86efac; background: #f0fdf4; }
.kpis .kpi-sold span { color: var(--ok); }
.kpis small { display: block; margin-top: .15rem; color: var(--muted); }
.option-box { border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem .8rem; align-items: flex-start; }
.option-box input { margin-top: .2rem; }
.seller-labels { margin-top: 1rem; }

/* --- Inscription : choix du profil --- */
.role-question { font-weight: 700; margin: .2rem 0 .8rem; }
.role-choices { display: grid; gap: .7rem; }
.role-card, .role-chosen {
  font: inherit; color: inherit; text-align: left; cursor: pointer; background: var(--surface);
  border: 2px solid var(--line); border-radius: var(--radius); transition: border-color .15s, background .15s;
}
.role-card { display: grid; grid-template-columns: auto 1fr; gap: .15rem .8rem; padding: .9rem 1rem; }
.role-card .role-icon { grid-row: span 2; font-size: 1.8rem; align-self: center; }
.role-card:hover, .role-card:focus-visible { border-color: var(--accent); background: var(--accent-soft); }
.role-chosen { display: flex; gap: .7rem; align-items: center; width: 100%; padding: .6rem .8rem; margin-bottom: 1rem;
  border-color: var(--accent); background: var(--accent-soft); }
.role-chosen .role-icon { font-size: 1.5rem; }
.role-chosen > span:last-child { display: flex; flex-direction: column; }

/* --- Récapitulatif financier (orga) --- */
.finance { margin-top: 1.5rem; }
.finance h2 { margin: 0 0 .9rem; }
.finance-grid { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; gap: .6rem; align-items: stretch; }
.fin { display: flex; flex-direction: column; gap: .15rem; padding: .9rem 1rem; border-radius: 10px; border: 1px solid var(--line); background: #faf8f4; }
.fin-label { font-size: .85rem; font-weight: 600; color: var(--muted); }
.fin-value { font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.fin-sub { font-size: .82rem; color: var(--muted); }
.fin-op { align-self: center; font-size: 1.4rem; font-weight: 700; color: var(--muted); }
.fin-due { border-color: #bfdbfe; background: #eff6ff; }
.fin-due .fin-value { color: #1d4ed8; }
.fin-profit { border-color: #86efac; background: #f0fdf4; }
.fin-profit .fin-value { color: var(--ok); }
@media (max-width: 700px) {
  .finance-grid { grid-template-columns: 1fr; }
  .fin-op { justify-self: center; line-height: 1; }
}
