/* L'Atelier v3 (espace artisan Booliwood49).
   Deux registres, comme sur Unpeel : l'interface courante est plate, à filets et ombres teintées ;
   les « moments » (photos, état de publication) portent la matière. Zones tactiles 44 px, survol réservé
   à la souris, champs en 16 px sur téléphone, mouvement réduit respecté, entrées en ease-out sous 300 ms. */
:root {
  --bg: #f7f3ec; --card: #fff; --field: #f4eee5; --soft: #efe8dc;
  --ink: #231711; --sub: #6b5a4e; --faint: #9c8b7e;
  --line: rgba(44,24,16,.09); --line2: rgba(44,24,16,.15);
  --green: #1a3328; --green-2: #2d5a47; --green-soft: #e4eee8; --gold: #e7cf9a;
  --ok: #2d7a4f; --ok-soft: #e3f2e9; --warn: #a3621f; --warn-soft: #fbf0e2; --danger: #b5452b; --danger-soft: #fbece7;
  --r-field: 12px; --r-card: 18px; --r-sheet: 26px; --r-pill: 999px;
  --sh-card: 0 1px 2px rgba(44,24,16,.04), 0 10px 28px -20px rgba(92,58,36,.5);
  --sh-soft: 0 1px 2px rgba(44,24,16,.04), 0 6px 18px -14px rgba(92,58,36,.5);
  --sh-float: 0 1px 3px rgba(44,24,16,.06), 0 14px 40px -14px rgba(44,24,16,.38);
  --sh-sheet: 0 -20px 60px -20px rgba(44,24,16,.45);
  --ease-out: cubic-bezier(.23,1,.32,1); --ease-drawer: cubic-bezier(.32,.72,0,1);
  --sans: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif; --serif: 'Cormorant Garamond', 'Times New Roman', serif;
  --nav-h: 65px; --safe-b: env(safe-area-inset-bottom, 0px); --lab-h: 30px;
  --z-top: 20; --z-nav: 30; --z-veil: 60; --z-sheet: 61; --z-tunnel: 70; --z-toast: 80;
  color-scheme: light only;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.45; font-variant-numeric: lining-nums; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; }
h1, h2, h3, p { text-wrap: pretty; }
svg.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--green-2); outline-offset: 2px; border-radius: 6px; }
.num { font-variant-numeric: tabular-nums; }

.lab-strip { height: var(--lab-h); display: grid; place-items: center; background: var(--ink); color: rgba(255,255,255,.85); font-size: 12px; text-align: center; padding: 0 12px; }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: var(--r-pill);
  font-weight: 600; font-size: 15px; transition: transform 160ms var(--ease-out), background-color .2s ease, opacity .2s ease; user-select: none; text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .45; cursor: default; transform: none; }
.btn--primary { background: var(--green); color: #fff; box-shadow: 0 10px 22px -12px rgba(26,51,40,.7); }
.btn--ghost { background: var(--card); border: 1px solid var(--line2); color: var(--ink); }
.btn--soft { background: var(--soft); color: var(--ink); }
.btn--gold { background: var(--gold); color: var(--ink); }
.btn--danger { background: var(--danger-soft); color: var(--danger); }
.btn--text { min-height: 44px; padding: 0 10px; color: var(--sub); font-weight: 500; }
.btn--block { width: 100%; }
.btn--sm { min-height: 38px; padding: 0 14px; font-size: 14px; }
.btn .spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; animation: spin .6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (hover: hover) and (pointer: fine) {
  .btn--primary:hover { background: var(--green-2); }
  .btn--ghost:hover, .btn--soft:hover { background: var(--field); }
  .row:hover { background: #fcfaf6; }
}
.btn.refus { animation: refus .35s var(--ease-out); }
@keyframes refus { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--ink); transition: background-color .15s ease, transform 160ms var(--ease-out); }
.icon-btn:active { transform: scale(.94); }
@media (hover: hover) and (pointer: fine) { .icon-btn:hover { background: var(--soft); } }
.linkish { color: var(--green-2); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(45,90,71,.35); }

/* ---------- Champs ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.field .help { font-size: 12.5px; color: var(--faint); }
.field .err, .err { font-size: 13px; color: var(--danger); margin: 0; }
.input { width: 100%; min-height: 50px; padding: 12px 14px; border-radius: var(--r-field); background: var(--field); border: 1px solid var(--line2);
  font-size: 16px; transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease; }
.input:focus { outline: none; border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(45,90,71,.15); background: #fff; }
textarea.input { min-height: 110px; resize: vertical; line-height: 1.5; }
.input-euro { position: relative; }
.input-euro .input { padding-right: 38px; font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.input-euro span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--faint); font-weight: 600; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.list-edit { display: flex; gap: 6px; align-items: center; }

/* ---------- Connexion ---------- */
.login { min-height: calc(100svh - var(--lab-h)); display: flex; flex-direction: column; padding: 28px 22px calc(24px + var(--safe-b)); max-width: 440px; margin: 0 auto; }
.login__brand img { height: 34px; display: block; }
.login__head { margin: 48px 0 26px; }
.login h1 { font-family: var(--serif); font-weight: 500; font-size: 42px; line-height: 1.02; margin: 0 0 10px; letter-spacing: -.01em; }
.login p.sub { margin: 0; color: var(--sub); }
.login form { display: flex; flex-direction: column; gap: 16px; }
.login__foot { margin-top: auto; padding-top: 24px; text-align: center; font-size: 13px; color: var(--faint); }
.login__msg { min-height: 20px; font-size: 13.5px; color: var(--danger); margin: 0; }
.otp { position: relative; height: 60px; }
.otp input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; font-size: 16px; letter-spacing: 1em; caret-color: transparent; }
.otp__cells { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; height: 100%; pointer-events: none; }
.otp__cells span { display: grid; place-items: center; border-radius: var(--r-field); background: var(--field); border: 1px solid var(--line2); font-size: 24px; font-weight: 600; }
.otp__cells span.cur { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(45,90,71,.15); background: #fff; }

/* ---------- Coque ---------- */
.shell { min-height: calc(100svh - var(--lab-h)); }
.shell__col { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: var(--z-top); display: flex; align-items: center; gap: 6px; height: 56px; padding: 0 10px;
  background: rgba(247,243,236,.86); -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%); border-bottom: 1px solid transparent; transition: border-color .2s ease; }
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar__t { flex: 1; min-width: 0; margin: 0; padding: 0 4px; font-size: 16px; font-weight: 600; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center;
  opacity: 0; transform: translateY(4px); transition: opacity 160ms ease, transform 200ms var(--ease-out); }
.topbar.scrolled .topbar__t, .topbar.titled .topbar__t { opacity: 1; transform: none; }
.topbar__side { display: flex; align-items: center; justify-content: flex-end; gap: 4px; min-width: 44px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--green-soft); color: var(--green); font-weight: 700; font-size: 14px; text-transform: uppercase; }
.avatar-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; transition: transform 160ms var(--ease-out); }
.avatar-btn:active { transform: scale(.94); }
/* Pilule « Publier » : présente sur tous les écrans dès qu'une modification attend (schéma Framer) */
.pubpill { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 6px 0 12px; border-radius: var(--r-pill); background: var(--ink); color: #fff; font-weight: 600; font-size: 14px; text-decoration: none;
  box-shadow: var(--sh-soft); transition: transform 160ms var(--ease-out); }
.pubpill:active { transform: scale(.96); }
.pubpill svg.i { width: 17px; height: 17px; }
.pubpill__n { min-width: 24px; height: 24px; padding: 0 7px; border-radius: 12px; display: grid; place-items: center; background: var(--gold); color: var(--ink); font-size: 12.5px; font-variant-numeric: tabular-nums;
  animation: pop 320ms var(--ease-out); }
@keyframes pop { from { transform: scale(.6); } 60% { transform: scale(1.12); } to { transform: none; } }
.main { padding: 6px 16px calc(var(--nav-h) + 48px + var(--safe-b)); max-width: 680px; margin: 0 auto; }
.page-h { margin: 10px 2px 4px; font-family: var(--serif); font-weight: 500; font-size: 36px; line-height: 1.04; letter-spacing: -.012em; }
.lead { margin: 0 2px 18px; color: var(--sub); }
.page-h + .group, .page-h + .tlist, .page-h + .card { margin-top: 18px; }

/* Barre du bas (téléphone) : encoche concave et « + » au centre, reprise de la barre d'Unpeel.
   Trois morceaux (flanc, encoche SVG, flanc) qui se chevauchent d'1 px ; se cache quand on défile vers le bas. */
.nav { position: fixed; left: 12px; right: 12px; bottom: calc(10px + var(--safe-b)); z-index: var(--z-nav); max-width: 460px; margin: 0 auto; transition: transform .34s cubic-bezier(.4,0,.2,1); }
.nav.hide { transform: translateY(calc(100% + 70px)); }
.nav__bar { display: flex; filter: drop-shadow(0 1px 4px rgba(44,24,16,.05)) drop-shadow(0 6px 30px rgba(44,24,16,.09)); }
.nav__flat { flex: 1; height: 65px; background: #fff; }
.nav__flat:first-child { margin-right: -1px; }
.nav__flat:last-child { margin-left: -1px; }
.nav__svg { display: block; flex: none; position: relative; z-index: 1; }
.nav__items { position: absolute; left: 0; right: 0; top: 0; height: 65px; display: flex; align-items: center; }
.nav__grp { flex: 1; min-width: 0; display: flex; justify-content: center; }
.nav__gap { width: 85px; flex: none; }
.nav a { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; color: var(--faint); font-size: clamp(9.5px, 2.9vw, 11px); font-weight: 600; white-space: nowrap; padding: 6px 0; }
.nav a[aria-current="page"] { color: var(--green); }
.nav a::after { content: ""; display: block; width: 4px; height: 4px; border-radius: 50%; background: transparent; margin-top: 1px; }
.nav a[aria-current="page"]::after { background: var(--green); }
.nav__ic { display: grid; place-items: center; }
.nav__ic svg.i { width: 22px; height: 22px; }
.nav__ic.bounce { animation: navb 360ms cubic-bezier(.23,1,.32,1); }
@keyframes navb { 0% { transform: none; } 30% { transform: translateY(-3px); } 65% { transform: translateY(1px); } 100% { transform: none; } }
.nav .badge { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; display: grid; place-items: center; background: var(--gold); color: var(--ink); font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; animation: pop 320ms var(--ease-out); }
.nav__fab { position: absolute; left: 50%; top: 0; transform: translate(-50%, -50%); width: 60px; height: 60px; border-radius: 50%; border: 1px solid rgba(44,24,16,.08); background: #fff; display: grid; place-items: center;
  filter: drop-shadow(0 6px 14px rgba(26,51,40,.32)); transition: transform .14s cubic-bezier(.2,.7,.2,1); }
.nav__fab:active { transform: translate(-50%, -50%) scale(.9); }
.nav__fab i { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: linear-gradient(150deg, #35684f, var(--green)); box-shadow: inset 0 1px 0 rgba(255,255,255,.28), inset 0 -2px 4px rgba(0,0,0,.18); }
.nav__fab i svg.i { width: 24px; height: 24px; stroke-width: 2.4; }

/* Ordinateur : barre latérale, carte « Publier » en bas (schéma Framer) */
.side { display: none; }
@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: 264px 1fr; }
  .side { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: calc(100svh - var(--lab-h)); overflow-y: auto; padding: 22px 14px 14px; border-right: 1px solid var(--line); background: rgba(255,255,255,.35); }
  .side__brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; }
  .side__brand img { height: 28px; }
  .side__brand b { font-family: var(--serif); font-size: 22px; font-weight: 500; }
  .side a.nl { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 12px; text-decoration: none; color: var(--sub); font-weight: 600; transition: background-color .15s ease; }
  .side a.nl:hover { background: var(--soft); }
  .side a.nl[aria-current="page"] { background: var(--card); color: var(--green); box-shadow: var(--sh-soft); }
  .side a.nl .badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; display: grid; place-items: center; background: var(--gold); color: var(--ink); font-size: 12px; font-weight: 700; }
  .side__pub { margin-top: auto; padding: 14px; border-radius: 16px; background: var(--card); box-shadow: var(--sh-card); }
  .side__pub b { display: block; font-size: 14px; }
  .side__pub p { margin: 2px 0 10px; font-size: 12.5px; color: var(--sub); }
  .side__pub--on { background: var(--ink); color: #fff; }
  .side__pub--on p { color: rgba(255,255,255,.65); }
  .side__foot { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; margin-top: 8px; padding: 0 8px; border-radius: 12px; text-align: left; text-decoration: none; transition: background-color .15s ease; }
  .side__foot[aria-current="page"] { background: var(--card); box-shadow: var(--sh-soft); }
  .side__foot:hover { background: var(--soft); }
  .side__foot .avatar { flex: none; }
  .side__foot span:last-child { flex: 1; min-width: 0; font-size: 13px; color: var(--sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav, .topbar .pubpill { display: none; }
  .topbar { padding-left: max(10px, calc((100% - 680px) / 2 + 10px)); padding-right: max(10px, calc((100% - 680px) / 2 + 10px)); }
  .topbar__t { text-align: left; }
  .main { padding-bottom: 80px; }
}

/* ---------- Groupes et lignes (listes encastrées, filet aligné sur le texte) ---------- */
.group { margin-top: 22px; }
.group__t { margin: 0 2px 8px; font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); }
.group__n { margin: 8px 4px 0; font-size: 12.5px; color: var(--faint); display: flex; gap: 6px; align-items: flex-start; }
.group__n svg.i { width: 15px; height: 15px; margin-top: 2px; }
.list { background: var(--card); border-radius: var(--r-card); box-shadow: var(--sh-card); overflow: hidden; }
.row { --inset: 16px; position: relative; display: flex; align-items: center; gap: 14px; width: 100%; min-height: 60px; padding: 11px 16px; text-align: left; text-decoration: none; color: inherit; transition: background-color .15s ease; }
.row + .row::before { content: ""; position: absolute; left: var(--inset); right: 0; top: 0; height: 1px; background: var(--line); }
.row:active { background: var(--field); }
.row--ic { --inset: 66px; }
.row--thumb { --inset: 86px; }
.row__body { flex: 1; min-width: 0; }
.row__title { font-weight: 600; }
.row__meta { font-size: 13.5px; color: var(--sub); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.row__chev { color: var(--faint); margin-right: -4px; }
.row__thumb { width: 56px; height: 56px; border-radius: 14px; object-fit: cover; flex: none; background: var(--field); }
.row__ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; flex: none; background: var(--green-soft); color: var(--green-2); }
.row__ic svg.i { width: 18px; height: 18px; }
.row--add .row__title { color: var(--green-2); }
.row--add .row__ic { background: var(--green); color: #fff; }
.row--danger, .row--danger .row__title { color: var(--danger); }
.row--danger .row__ic { background: var(--danger-soft); color: var(--danger); }
.row .price { font-size: 17px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: var(--r-pill); font-size: 12px; font-weight: 700; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill--ok { background: var(--ok-soft); color: var(--ok); }
.pill--warn { background: var(--warn-soft); color: var(--warn); }
.pill--mute { background: var(--soft); color: var(--sub); }
.pill--draft { background: #fff3d1; color: #8a6200; }
.pill--plain::before { display: none; }
.card { background: var(--card); border-radius: var(--r-card); box-shadow: var(--sh-card); padding: 18px; }
.empty { text-align: center; padding: 36px 20px; color: var(--sub); }
.empty .ic { width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 18px; display: grid; place-items: center; background: var(--green-soft); color: var(--green-2); }
.empty p { margin: 0 0 14px; }

/* ---------- Tables : la liste ---------- */
.tlist { display: flex; flex-direction: column; gap: 10px; }
.trow { display: flex; align-items: center; gap: 14px; padding: 10px 14px 10px 10px; border-radius: var(--r-card); background: var(--card); box-shadow: var(--sh-card); text-decoration: none; color: inherit; transition: transform 160ms var(--ease-out), background-color .15s ease; }
.trow:active { transform: scale(.985); }
.trow__img { width: 84px; height: 84px; border-radius: 14px; object-fit: cover; flex: none; background: var(--field); }
.trow__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.trow__name { font-family: var(--serif); font-weight: 500; font-size: 25px; line-height: 1; letter-spacing: -.01em; }
.trow__meta { font-size: 13.5px; color: var(--sub); font-variant-numeric: tabular-nums; }
.trow__st { display: flex; gap: 6px; margin-top: 3px; }
.trow__grip { width: 36px; height: 44px; margin-right: -6px; border-radius: 10px; display: grid; place-items: center; color: var(--faint); cursor: grab; touch-action: none; }
.trow__grip:active { cursor: grabbing; }
.trow--ghost { opacity: .35; }
.trow--chosen { box-shadow: var(--sh-float); }
@media (hover: hover) and (pointer: fine) { .trow__grip:hover { background: var(--soft); color: var(--ink); } }
.trow--add { justify-content: flex-start; min-height: 64px; background: transparent; box-shadow: none; border: 1.5px dashed var(--line2); color: var(--green-2); font-weight: 600; }
.trow--add .row__ic { background: var(--green); color: #fff; }

/* ---------- Fiche d'une table ---------- */
.thead { margin: 10px 2px 0; }
.thead .page-h { margin: 0; }
.thead__tag { margin: 4px 0 0; color: var(--sub); }
.thead__pills { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 10px; font-size: 13px; }
.thead__pills a { margin-left: auto; display: inline-flex; align-items: center; gap: 3px; min-height: 32px; font-size: 13.5px; }
.thead__pills a svg.i { width: 15px; height: 15px; }
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photo { position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: var(--field); touch-action: manipulation; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; user-select: none; -webkit-user-drag: none; }
.photo__n { position: absolute; left: 6px; top: 6px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; display: grid; place-items: center; background: rgba(28,20,18,.55); color: #fff; font-size: 11.5px; font-weight: 700; }
.photo__main { position: absolute; left: 6px; top: 6px; height: 22px; padding: 0 8px; border-radius: 11px; display: grid; place-items: center; background: var(--green); color: #fff; font-size: 11px; font-weight: 700; }
.photo__label { position: absolute; left: 6px; bottom: 6px; max-width: calc(100% - 12px); height: 20px; padding: 0 7px; border-radius: 10px; display: grid; place-items: center; background: rgba(28,20,18,.55); color: #fff; font-size: 10.5px; font-weight: 600; white-space: nowrap; overflow: hidden; }
.photo__x { position: absolute; right: 4px; top: 4px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: rgba(28,20,18,.55); color: #fff; }
.photo__x::before { content: ""; position: absolute; inset: -6px; }
.photo__x svg.i { width: 16px; height: 16px; }
.photo--add { display: grid; place-items: center; align-content: center; gap: 6px; border: 1.5px dashed var(--line2); background: transparent; color: var(--sub); font-size: 13px; font-weight: 600; cursor: pointer; }
.photo.sortable-ghost { opacity: .35; }
.photo.sortable-chosen { transform: scale(1.04); box-shadow: var(--sh-float); }
.sec__toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 44px; margin: 22px 0 6px; padding: 0 2px; font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); }
.sec__toggle svg.i { transition: transform 240ms var(--ease-out); }
.sec__toggle svg.i.rot { transform: rotate(180deg); }
.switch { position: relative; width: 50px; height: 30px; flex: none; border-radius: 15px; background: #e2d7c9; transition: background-color .2s cubic-bezier(.2,.7,.2,1); }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(44,24,16,.25); transition: transform .2s cubic-bezier(.2,.7,.2,1); }
.switch[aria-checked="true"] { background: var(--green-2); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }
.confirm { margin-top: 10px; padding: 14px; border-radius: 14px; background: var(--danger-soft); display: flex; flex-direction: column; gap: 10px; }
.confirm p { margin: 0; color: var(--danger); font-weight: 600; }
.confirm div { display: flex; gap: 8px; }
.confirm .btn { flex: 1; min-height: 44px; }
.stepper { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px; border-radius: 16px; background: var(--field); border: 1px solid var(--line2); }
.stepper b { font-size: 26px; font-variant-numeric: tabular-nums; min-width: 3ch; text-align: center; }
.stepper button { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--card); box-shadow: var(--sh-soft); }
.stepper button:active { transform: scale(.95); }
.stepper button[disabled] { opacity: .35; }

/* Fonctionnalité à venir : grisée, mais ouvrable pour l'aperçu */
.row--soon .row__title, .row--soon .row__meta, .row--soon .row__chev { opacity: .5; }
.row--soon .row__ic { background: var(--soft); color: var(--faint); }
.soon { display: flex; gap: 14px; align-items: flex-start; margin-top: 4px; padding: 16px; border-radius: var(--r-card); border: 1.5px dashed var(--line2); }
.soon__ic { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; flex: none; background: #fff3d1; color: #8a6200; }
.soon b { display: block; }
.soon p { margin: 3px 0 0; font-size: 14px; color: var(--sub); }
.sitecard { display: flex; flex-direction: column; gap: 2px; padding: 18px; border-radius: var(--r-card); background: var(--green); color: #fff; box-shadow: 0 14px 30px -20px rgba(26,51,40,.9); }
.sitecard small { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: rgba(255,255,255,.65); }
.sitecard b { font-family: var(--serif); font-weight: 500; font-size: 28px; line-height: 1.1; margin-top: 4px; }
.sitecard span { color: rgba(255,255,255,.85); font-size: 14px; }
.sitecard em { font-style: normal; align-self: flex-start; margin-top: 12px; min-height: 38px; padding: 0 16px; border-radius: var(--r-pill); display: inline-flex; align-items: center; background: var(--gold); color: var(--ink); font-weight: 600; font-size: 14px; }
.preview .list { opacity: .6; pointer-events: none; }
.preview .switch { background: #e2d7c9; }

.lotphoto { position: relative; display: block; border-radius: 14px; overflow: hidden; cursor: pointer; }
.lotphoto img { width: 100%; aspect-ratio: 16/10; object-fit: cover; display: block; }
.lotphoto__btn { position: absolute; right: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px; border-radius: var(--r-pill); background: rgba(28,20,18,.62); color: #fff; font-size: 13.5px; font-weight: 600; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.lotphoto__btn svg.i { width: 16px; height: 16px; }
.lotphoto--empty { aspect-ratio: 16/10; background: var(--field); border: 1.5px dashed var(--line2); }
.lotphoto__ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--sub); font-size: 13.5px; font-weight: 600; padding: 0 60px 0 16px; text-align: center; }
.lotphoto:focus-within { outline: 2px solid var(--green-2); outline-offset: 2px; }

/* ---------- Publier ---------- */
.pub { padding: 20px; border-radius: 22px; background: var(--card); box-shadow: var(--sh-card); }
.pub--on { background: var(--green); color: #fff; background-image: radial-gradient(120% 90% at 100% 0%, rgba(231,207,154,.18), transparent 60%); box-shadow: 0 18px 40px -22px rgba(26,51,40,.9); }
.pub__top { display: flex; align-items: center; gap: 14px; }
.pub__ic { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; flex: none; background: var(--ok-soft); color: var(--ok); }
.pub--on .pub__ic { background: rgba(255,255,255,.12); color: var(--gold); }
.pub h2 { margin: 0; font-family: var(--serif); font-weight: 500; font-size: 27px; line-height: 1.08; }
.pub p { margin: 3px 0 0; color: var(--sub); font-size: 14px; }
.pub--on p { color: rgba(255,255,255,.72); }
.changes { margin: 16px 0 4px; border-top: 1px solid rgba(255,255,255,.14); }
.change { display: flex; align-items: center; gap: 10px; min-height: 50px; border-bottom: 1px solid rgba(255,255,255,.14); font-size: 14.5px; }
.change span { flex: 1; }
.change .btn--text { color: rgba(255,255,255,.75); }
.pub .btn--gold { margin-top: 14px; }
.pub .btn--ghost { margin-top: 14px; }
.pub-bar { height: 5px; border-radius: 3px; background: rgba(255,255,255,.16); overflow: hidden; margin-top: 18px; }
.pub-bar i { display: block; height: 100%; width: 0; background: var(--gold); animation: pubfill 5s linear forwards; }
@keyframes pubfill { from { width: 0; } to { width: 100%; } }
.hist .row__title { font-weight: 500; }
.hist .row__meta b { color: var(--ink); font-weight: 600; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green-2); flex: none; margin: 0 4px; }
.dot--old { background: var(--line2); }
.help-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; color: var(--sub); }
.help-list b { color: var(--ink); }
.account { display: flex; align-items: center; gap: 12px; padding: 4px 0 6px; }
.account .avatar { width: 46px; height: 46px; font-size: 18px; }
.account b { display: block; }
.account span { font-size: 13px; color: var(--sub); }

/* ---------- Feuille du bas ---------- */
.veil { position: fixed; inset: 0; z-index: var(--z-veil); background: rgba(28,20,18,.42); opacity: 0; transition: opacity 400ms ease; }
.veil.on { opacity: 1; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-sheet); max-width: 520px; margin: 0 auto; max-height: 92svh; display: flex; flex-direction: column;
  background: var(--bg); border-radius: var(--r-sheet) var(--r-sheet) 0 0; box-shadow: var(--sh-sheet); transform: translateY(100%); transition: transform 400ms var(--ease-drawer); }
.sheet.on { transform: none; }
.sheet.closing { transition-duration: 260ms; }
.sheet__grab { flex: none; padding: 10px 0 4px; touch-action: none; cursor: grab; }
.sheet__grab i { display: block; width: 38px; height: 4px; margin: 0 auto; border-radius: 2px; background: var(--line2); }
.sheet__head { flex: none; display: flex; align-items: center; gap: 8px; padding: 2px 10px 6px 20px; touch-action: none; }
.sheet__head h2 { flex: 1; margin: 0; font-family: var(--serif); font-weight: 500; font-size: 27px; line-height: 1.12; }
.sheet__body { overflow-y: auto; overscroll-behavior: contain; padding: 8px 20px 14px; display: flex; flex-direction: column; gap: 16px; }
.sheet__body .list { box-shadow: var(--sh-soft); }
.sheet__foot { flex: none; display: flex; flex-direction: column; gap: 6px; padding: 10px 20px calc(16px + var(--safe-b)); border-top: 1px solid var(--line); background: var(--bg); }
@media (min-width: 900px) {
  .sheet { bottom: auto; top: 50%; border-radius: var(--r-sheet); max-height: 86vh; transform: translateY(-46%) scale(.97); opacity: 0; transition: transform 260ms var(--ease-out), opacity 200ms ease; }
  .sheet.on { transform: translateY(-50%); opacity: 1; }
  .sheet__grab { display: none; }
  .sheet__head { padding-top: 16px; }
}

/* ---------- Parcours plein écran (créer) ---------- */
.tunnel { position: fixed; inset: 0; z-index: var(--z-tunnel); display: flex; flex-direction: column; background: var(--bg); transform: translateY(24px); opacity: 0; transition: transform 320ms var(--ease-out), opacity 240ms ease; }
.tunnel.on { transform: none; opacity: 1; }
.tunnel__head { flex: none; display: flex; align-items: center; gap: 4px; padding: 8px 8px 0; padding-top: max(8px, env(safe-area-inset-top)); }
.tunnel__head h2 { flex: 1; text-align: center; margin: 0; font-size: 15px; font-weight: 600; }
.progress { display: grid; gap: 6px; padding: 10px 20px 0; }
.progress i { height: 4px; border-radius: 2px; background: var(--soft); overflow: hidden; position: relative; }
.progress i::after { content: ""; position: absolute; inset: 0; background: var(--green-2); transform: scaleX(0); transform-origin: left; transition: transform 320ms var(--ease-out); }
.progress i.done::after { transform: none; }
.tunnel__body { flex: 1; overflow-y: auto; padding: 22px 20px 20px; max-width: 560px; width: 100%; margin: 0 auto; }
.tunnel__body h3 { font-family: var(--serif); font-weight: 500; font-size: 34px; line-height: 1.06; margin: 0 0 6px; }
.tunnel__body > p { margin: 0 0 20px; color: var(--sub); }
.tunnel__foot { flex: none; padding: 12px 20px calc(16px + var(--safe-b)); max-width: 560px; width: 100%; margin: 0 auto; }
.tunnel__why { min-height: 20px; font-size: 13px; color: var(--sub); text-align: center; margin: 0 0 8px; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice { min-height: 56px; padding: 10px 14px; border-radius: 16px; background: var(--card); box-shadow: var(--sh-soft); border: 1.5px solid transparent; text-align: left; font-weight: 600; font-size: 14.5px; line-height: 1.25; transition: border-color .15s ease, background-color .15s ease, transform 160ms var(--ease-out); }
.choice:active { transform: scale(.98); }
.choice[aria-pressed="true"] { border-color: var(--green-2); background: var(--green-soft); color: var(--green); }
.choice small { display: block; font-weight: 500; font-size: 12px; color: var(--faint); margin-top: 2px; }
.choice--img { display: flex; flex-direction: column; gap: 6px; }
.choice--img img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 10px; }
.choice__ph { width: 100%; aspect-ratio: 4/3; border-radius: 10px; display: grid; place-items: center; border: 1.5px dashed var(--line2); background: var(--field); color: var(--faint); transition: border-color .15s ease, color .15s ease, background-color .15s ease; }
.choice__ph svg.i { width: 26px; height: 26px; }
.choice--blank[aria-pressed="true"] .choice__ph { border-color: var(--green-2); color: var(--green-2); background: #fff; }
.preview-card { display: flex; flex-direction: column; overflow: hidden; border-radius: var(--r-card); background: var(--card); box-shadow: var(--sh-card); }
.preview-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.preview-card div { display: flex; flex-direction: column; gap: 4px; padding: 16px; }
.preview-card b { font-family: var(--serif); font-size: 26px; font-weight: 500; }
.preview-card span { color: var(--sub); font-size: 14px; }
.preview-card em { font-style: normal; font-weight: 700; font-size: 20px; margin-top: 6px; }
.preview-card small { font-weight: 500; font-size: 12px; color: var(--faint); }

/* ---------- Messages (annuler plutôt que confirmer) ---------- */
.toasts { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + 24px + var(--safe-b)); z-index: var(--z-toast); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; max-width: 480px; min-height: 48px; padding: 6px 6px 6px 16px; border-radius: 16px; background: var(--ink); color: #fff; font-size: 14px; box-shadow: var(--sh-float);
  opacity: 0; transform: translateY(12px) scale(.98); transition: opacity 200ms ease, transform 260ms var(--ease-out); }
.toast.on { opacity: 1; transform: none; }
.toast svg.i { width: 18px; height: 18px; color: #9fd3b5; }
.toast button { min-height: 36px; padding: 0 12px; border-radius: 12px; background: rgba(255,255,255,.14); color: #fff; font-weight: 600; font-size: 13.5px; }
.toast--solo { padding-right: 16px; }
body.has-overlay .toasts { top: calc(12px + env(safe-area-inset-top, 0px)); bottom: auto; padding-left: 16px; }
@media (min-width: 900px) { .toasts { bottom: 24px; padding-left: 264px; } }

@media (max-width: 380px) { .choices { grid-template-columns: 1fr; } .trow__name { font-size: 22px; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; }
}

/* Haut de l'écran (01/10) : plus de bandeau ni de flèche « voir le site » ; l'en-tête ne prend plus de place.
   Il flotte au-dessus du contenu (sticky + marge négative), transparent en haut, en verre dès qu'on défile.
   Écrans principaux : le grand titre commence tout en haut. Sous-écrans : le retour est aligné sur le titre. */
:root { --lab-h: 0px; }
.topbar { height: 52px; margin-bottom: -52px; padding: 0 10px; padding-top: env(safe-area-inset-top, 0px); height: calc(52px + env(safe-area-inset-top, 0px)); margin-bottom: calc(-52px - env(safe-area-inset-top, 0px));
  background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; border-bottom-color: transparent; transition: background-color .2s ease, border-color .2s ease; }
.topbar.scrolled { background: rgba(247,243,236,.86); -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%); border-bottom-color: var(--line); }
.topbar__side { min-width: 44px; }
.main { padding-top: calc(10px + env(safe-area-inset-top, 0px)); }
.shell--sub .main { padding-top: calc(52px + env(safe-area-inset-top, 0px)); }
.page-h { margin-top: 6px; padding-right: 120px; }
.shell--sub .page-h, .shell--sub .thead .page-h { padding-right: 0; }
.shell--sub .thead { margin-top: 0; }
@media (min-width: 900px) { .main { padding-top: 28px; } .shell--sub .main { padding-top: 60px; } .topbar { height: 56px; margin-bottom: -56px; padding-top: 0; } .page-h { padding-right: 0; } }
/* alignements : la pilule « Publier » centrée sur le grand titre tant qu'on n'a pas défilé ; titres des sous-écrans à la même hauteur */
.topbar__side { transition: transform .25s cubic-bezier(.23,1,.32,1); }
.shell:not(.shell--sub) .topbar:not(.scrolled) .topbar__side { transform: translateY(9px); }
.shell--sub .page-h { margin-top: 0; }
.shell--sub .main > .page-h:first-child, .shell--sub .thead { padding-top: 0; }
@media (min-width: 900px) { .shell:not(.shell--sub) .topbar:not(.scrolled) .topbar__side { transform: translateY(20px); } }

/* Historique vide (vu seulement avant la première publication) : la table de l'Atelier se monte une fois,
   pieds qui se dépl­ient, banc puis plateau qui se posent avec un ressort, petit écrasement, ombre ; puis plus rien ne bouge. */
.hist-empty { text-align: center; padding: 18px 20px 6px; }
.hist-empty b { display: block; font-size: 15.5px; margin-top: 10px; }
.hist-empty p { margin: 4px auto 0; max-width: 300px; font-size: 13.5px; color: var(--sub); }
.he-table { width: 64px; height: 64px; display: block; margin: 0 auto; overflow: visible; fill: none; stroke: var(--green-2); stroke-width: 1.7; stroke-linecap: round; }
.he-table .he-l, .he-table .he-b, .he-table .he-t { transform-box: view-box; opacity: 0; }
.he-l1 { transform-origin: 4px 18px; transform: rotate(62deg); animation: heHinge .5s cubic-bezier(.23,1,.32,1) .15s forwards; }
.he-l2 { transform-origin: 20px 18px; transform: rotate(-62deg); animation: heHinge .5s cubic-bezier(.23,1,.32,1) .2s forwards; }
.he-b { transform: translateY(-5px); animation: heDrop .55s var(--he-spring) .45s forwards; }
.he-t { transform-origin: 12px 7px; transform: translateY(-8px) rotate(-8deg); animation: heDrop .6s var(--he-spring) .58s forwards; }
.he-rig { transform-box: view-box; transform-origin: 12px 18px; animation: heSquash .32s cubic-bezier(.23,1,.32,1) .95s; }
.he-sh { fill: var(--green-2); stroke: none; opacity: 0; transform-box: fill-box; transform-origin: center; transform: scaleX(.4); animation: heSh .5s cubic-bezier(.23,1,.32,1) .9s forwards; }
.hist-empty b, .hist-empty p { opacity: 0; transform: translateY(4px); animation: heIn .4s cubic-bezier(.23,1,.32,1) .1s forwards; }
.hist-empty p { animation-delay: .14s; }
:root { --he-spring: linear(0, 0.059, 0.197, 0.377, 0.569, 0.748, 0.9, 1.017, 1.098, 1.145, 1.163, 1.159, 1.139, 1.111, 1.08, 1.05, 1.024, 1.003, 0.987, 0.978, 0.974, 0.974, 0.976, 0.98, 0.985, 0.99, 0.995, 0.999, 1.001, 1.003, 1.004, 1.004, 1.004, 1.003, 1.003, 1.002, 1.001, 1, 1, 1, 0.999, 1); }
@keyframes heHinge { 0% { opacity: 0 } 15% { opacity: 1 } 100% { opacity: 1; transform: none } }
@keyframes heDrop { 0% { opacity: 0 } 12% { opacity: 1 } 100% { opacity: 1; transform: none } }
@keyframes heSquash { 0%, 100% { transform: none } 35% { transform: scale(1.05, .92) } }
@keyframes heSh { to { opacity: .14; transform: none } }
@keyframes heIn { to { opacity: 1; transform: none } }
@media (prefers-reduced-motion: reduce) { .he-table *, .hist-empty b, .hist-empty p { animation: none !important; opacity: 1 !important; transform: none !important; } .he-sh { opacity: .14 !important; } }

/* Tournées : la camionnette en tête de l'aperçu, pour donner envie ; se rejoue au toucher */
.tour-scene { margin: 2px -8px 14px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.tour-scene .sea { display: block; width: 100%; height: auto; overflow: hidden; }

/* « C'est en ligne » : la petite table se monte une fois (0,6 s), à la place de la coche */
.pt-table { width: 26px; height: 26px; overflow: visible; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.pt-table .pt-l, .pt-table .pt-b, .pt-table .pt-t { transform-box: view-box; opacity: 0; }
.pt-l1 { transform-origin: 4px 18px; transform: rotate(60deg); animation: heHinge .3s cubic-bezier(.23,1,.32,1) forwards; }
.pt-l2 { transform-origin: 20px 18px; transform: rotate(-60deg); animation: heHinge .3s cubic-bezier(.23,1,.32,1) .03s forwards; }
.pt-b { transform: translateY(-5px); animation: heDrop .32s var(--he-spring) .14s forwards; }
.pt-t { transform-origin: 12px 7px; transform: translateY(-7px) rotate(-8deg); animation: heDrop .36s var(--he-spring) .22s forwards; }
.pt-rig { transform-box: view-box; transform-origin: 12px 18px; animation: heSquash .26s cubic-bezier(.23,1,.32,1) .44s; }
@media (prefers-reduced-motion: reduce) { .pt-table * { animation: none !important; opacity: 1 !important; transform: none !important; } }
/* historique : une publication s'ouvre en douceur (hauteur qui glisse + fondu), chevron qui pivote */
.hist__tap { appearance: none; -webkit-appearance: none; display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.hist__txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hist__chev { flex: none; width: 16px; height: 16px; fill: none; stroke: var(--faint); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .3s cubic-bezier(.32,.72,0,1); }
.hist--open .hist__chev { transform: rotate(90deg); }
.hist__more { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .32s cubic-bezier(.32,.72,0,1); }
.hist--open .hist__more { grid-template-rows: 1fr; }
.hist__in { overflow: hidden; min-height: 0; opacity: 0; transform: translateY(-4px); transition: opacity .2s ease, transform .32s cubic-bezier(.32,.72,0,1); }
.hist--open .hist__in { opacity: 1; transform: none; transition-delay: .06s; }
.hist__list { list-style: none; margin: 10px 0 0; padding: 0; }
.hist__list li { position: relative; padding: 7px 0 7px 14px; font-size: 14px; color: var(--ink); border-top: 1px solid var(--line, rgba(44,24,16,.08)); }
.hist__list li::before { content: ""; position: absolute; left: 0; top: 50%; width: 5px; height: 5px; margin-top: -2.5px; border-radius: 50%; background: var(--green-2); opacity: .55; }
.hist__date { margin: 8px 0 2px; font-size: 12.5px; color: var(--faint); }
/* tout reste ancré sur la première ligne : rien ne bouge quand la ligne s'ouvre */
.row.hist { align-items: flex-start; }
.hist .dot { margin-top: 7px; }
.hist > .btn, .hist > .pill { margin-top: 2px; }
@media (prefers-reduced-motion: reduce) { .hist__more, .hist__in, .hist__chev { transition: none; } }

/* détail avant → après */
.hist__list--det li b { display: block; font-weight: 600; font-size: 13.5px; }
.hist__ab { display: flex; flex-direction: column; gap: 1px; margin-top: 2px; font-size: 13.5px; line-height: 1.45; }
.hist__ab s { color: var(--faint); text-decoration-color: rgba(44,24,16,.35); }
.hist__ab .to::before { content: '→ '; color: var(--faint); }
.hist__ab span { color: var(--ink); }
.hist__list--det li::before { top: 15px; }

/* à publier : une ligne par modification, avant → après */
.change { align-items: flex-start; padding: 11px 0; }
.change > .btn--text { margin-top: -4px; flex: none; }
.change__t { flex: 1; min-width: 0; }
.change__t b { display: block; font-weight: 600; }
.change__ab { display: flex; flex-direction: column; margin-top: 2px; font-size: 13.5px; line-height: 1.45; }
.change__ab s { color: rgba(255,255,255,.5); text-decoration-color: rgba(255,255,255,.4); }
.change__ab .to::before { content: '→ '; color: rgba(255,255,255,.55); }
