/* Atelier Luc Villard : feuille commune (atelier privé et pages publiques).
   Univers : gesso blanc, encre noire franche, cinq pigments purs posés en aplats légèrement décalés sous le trait
   (sérigraphie mal calée), comme sur les toiles de Luc. L'interface reste sobre : les tableaux sont toujours la
   chose la plus colorée de l'écran. */

@font-face { font-family: "Bricolage"; src: url("../fonts/bricolage-grotesque-latin-standard-normal.477b564b86e0.woff2") format("woff2");
  font-weight: 200 800; font-stretch: 75% 100%; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Bricolage"; src: url("../fonts/bricolage-grotesque-latin-ext-standard-normal.cc70a62e2cd3.woff2") format("woff2");
  font-weight: 200 800; font-stretch: 75% 100%; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Atkinson"; src: url("../fonts/atkinson-hyperlegible-next-latin-wght-normal.825fabef695f.woff2") format("woff2");
  font-weight: 200 800; font-style: normal; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Atkinson"; src: url("../fonts/atkinson-hyperlegible-next-latin-ext-wght-normal.290c109915a4.woff2") format("woff2");
  font-weight: 200 800; font-style: normal; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Atkinson"; src: url("../fonts/atkinson-hyperlegible-next-latin-wght-italic.740db8084ae9.woff2") format("woff2");
  font-weight: 200 800; font-style: italic; font-display: swap; }

:root {
  color-scheme: light dark;
  --gesso: #f7f6f2;
  --gesso-2: #eeece5;
  --panel: #ffffff;
  --ink: #161514;
  --ink-2: #4b4741;
  --ink-3: #6e6960;
  --line: #d7d2c7;
  --ultramarine: #2a3fd0;
  --cadmium: #f6c200;
  --vermilion: #e0401b;
  --emerald: #0d8a5c;
  --magenta: #c4175a;
  --danger: #b3261e;
  --ok: #0a7a50;
  --focus: #2a3fd0;
  --radius: 10px;
  --step: var(--ultramarine);
  --shift: 4px;
  --font-ui: "Atkinson", system-ui, sans-serif;
  --font-title: "Bricolage", "Atkinson", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --gesso: #1b1a18;
    --gesso-2: #24221f;
    --panel: #262421;
    --ink: #f2efe8;
    --ink-2: #cdc7bb;
    --ink-3: #a7a092;
    --line: #3d3a35;
    --ultramarine: #7c8cff;
    --cadmium: #f6c200;
    --vermilion: #ff6a45;
    --emerald: #36c08b;
    --magenta: #ff5c95;
    --danger: #ff8a80;
    --ok: #57d49c;
    --focus: #9aa6ff;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--gesso); color: var(--ink);
  font: 400 1.0625rem/1.55 var(--font-ui);
  font-variant-numeric: tabular-nums;
}
::selection { background: var(--cadmium); color: #161514; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
a { color: inherit; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--step); }
img { max-width: 100%; height: auto; }
h1, h2, h3 { font-family: var(--font-title); line-height: 1.12; text-wrap: balance; margin: 0 0 .5em; letter-spacing: -0.015em; }
h1 { font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.5rem); font-weight: 750; }
h2 { font-size: 1.35rem; font-weight: 700; margin-top: 1.6em; }
h3 { font-size: 1.08rem; font-weight: 700; }
p { text-wrap: pretty; max-width: 68ch; }
.muted { color: var(--ink-2); }
.small { font-size: .9rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
input, select, textarea, button { font: inherit; color: inherit; }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 12px; border: 3px solid var(--gesso); }

/* --- Trait de pinceau sous un titre : la plaque de couleur de l'étape, posée de travers --- */
.brush { position: relative; display: inline-block; z-index: 0; }
.brush::after {
  content: ""; position: absolute; z-index: -1; left: -.15em; right: -.25em; bottom: .02em; height: .42em;
  background: var(--step);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 20' preserveAspectRatio='none'%3E%3Cpath d='M2 11c18-6 40-8 63-6 24 2 40 7 66 6 22-1 44-6 67-4l-1 7c-24 1-45 6-69 6-25 0-41-5-65-6-21-1-41 1-60 5z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 20' preserveAspectRatio='none'%3E%3Cpath d='M2 11c18-6 40-8 63-6 24 2 40 7 66 6 22-1 44-6 67-4l-1 7c-24 1-45 6-69 6-25 0-41-5-65-6-21-1-41 1-60 5z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  opacity: .9; transform: rotate(-1deg);
}

/* --- Boutons : face blanche cernée d'encre, plaque de couleur décalée dessous --- */
.btn {
  --plate: var(--step);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 46px; padding: .55em 1.15em; border: 2px solid var(--ink); border-radius: 12px 14px 11px 13px;
  background: var(--panel); color: var(--ink); font-weight: 650; text-decoration: none; cursor: pointer;
  /* Plaque de couleur décalée sous le bouton, comme une seconde couche de peinture */
  box-shadow: var(--shift) var(--shift) 0 0 var(--plate);
  transition: transform .16s cubic-bezier(.2, .8, .2, 1), box-shadow .16s cubic-bezier(.2, .8, .2, 1);
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: calc(var(--shift) + 2px) calc(var(--shift) + 2px) 0 0 var(--plate); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 0 var(--plate); }
.btn.primary { background: var(--cadmium); color: #161514; border-color: #161514; --plate: var(--ink); }
.btn.quiet { border-color: var(--line); --plate: transparent; }
.btn.danger { --plate: var(--danger); }
.btn.small { min-height: 36px; padding: .3em .8em; font-size: .92rem; }
.btn[disabled], .btn.busy { opacity: .55; cursor: not-allowed; transform: none; }
.btn.busy { cursor: progress; }
.btn svg { width: 1.2em; height: 1.2em; flex: none; }
.link-btn { background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; cursor: pointer; }

/* --- Icônes dessinées (SVG, trait rond) --- */
.icon { width: 1.25em; height: 1.25em; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; vertical-align: -0.22em; }

/* --- En-tête de l'atelier --- */
.topbar { border-bottom: 2px solid var(--ink); background: var(--gesso); position: sticky; top: 0; z-index: 20; }
.topbar-inner { display: flex; align-items: center; gap: 1.25rem; max-width: 1320px; margin: 0 auto; padding: .55rem 1.25rem; }
.mark { display: flex; align-items: baseline; gap: .45rem; text-decoration: none; font-family: var(--font-title); white-space: nowrap; }
.mark strong { font-size: 1.3rem; font-weight: 800; letter-spacing: -0.02em; }
.mark span { font-size: .95rem; color: var(--ink-2); font-weight: 500; }
.mainnav { display: flex; gap: .2rem; overflow-x: auto; scrollbar-width: none; flex: 1; }
.mainnav a { padding: .45rem .8rem; border-radius: 999px; text-decoration: none; font-weight: 600; white-space: nowrap; color: var(--ink-2); }
.mainnav a:hover { color: var(--ink); background: var(--gesso-2); }
.mainnav a[aria-current="page"] { color: var(--ink); background: var(--gesso-2); box-shadow: inset 0 -3px 0 var(--cadmium); }
.account { position: relative; }
.account summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .4rem; padding: .35rem .6rem; border-radius: 999px; font-weight: 600; }
.account summary::-webkit-details-marker { display: none; }
.account summary:hover { background: var(--gesso-2); }
.account-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: var(--panel); border: 2px solid var(--ink); border-radius: 12px; padding: .4rem; box-shadow: 0 10px 30px rgb(0 0 0 / .14); }
.account-menu a, .account-menu button { display: block; width: 100%; text-align: left; padding: .55rem .7rem; border-radius: 8px; text-decoration: none; background: none; border: 0; cursor: pointer; }
.account-menu a:hover, .account-menu button:hover { background: var(--gesso-2); }
@media (max-width: 760px) {
  .topbar-inner { flex-wrap: wrap; gap: .3rem .8rem; padding: .5rem .9rem; }
  .mainnav { order: 3; flex-basis: 100%; margin: 0 -.9rem; padding: 0 .6rem .2rem; }
  .account { margin-left: auto; }
  .mark span { display: none; }
}

.page { max-width: 1320px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }
.page.narrow { max-width: 820px; }
.page-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: .8rem 1.5rem; margin-bottom: 1.25rem; }
.page-head h1 { margin: 0; }
.page-head .lede { margin: .35rem 0 0; color: var(--ink-2); }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }

/* --- Messages --- */
.messages { list-style: none; padding: 0; margin: 0 0 1.25rem; display: grid; gap: .5rem; }
.messages li { padding: .75rem 1rem; border: 2px solid var(--ink); border-radius: 10px; background: var(--panel); display: flex; gap: .6rem; align-items: flex-start; }
.messages .success { border-color: var(--ok); }
.messages .error { border-color: var(--danger); }
.messages .success .icon { color: var(--ok); }
.messages .error .icon { color: var(--danger); }

/* --- Étapes d'un tableau : cinq godets de pigment --- */
.workspace-head { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; margin-bottom: 1.25rem; }
.workspace-head h1 { margin: 0; font-size: 1.6rem; }
.workspace-head .thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; border: 2px solid var(--ink); }
.steps { display: flex; gap: .4rem; list-style: none; margin: 0; padding: 0; overflow-x: auto; scrollbar-width: none; }
.steps a { display: flex; align-items: center; gap: .45rem; padding: .4rem .85rem .4rem .45rem; border-radius: 999px; text-decoration: none; font-weight: 650; color: var(--ink-2); white-space: nowrap; border: 2px solid transparent; }
.steps a:hover { color: var(--ink); border-color: var(--line); }
.steps .pot { width: 26px; height: 26px; border-radius: 48% 52% 46% 54%; background: var(--pot); border: 2px solid var(--ink); display: grid; place-items: center; color: #fff; font-size: .78rem; font-weight: 800; }
.steps [aria-current="step"] { color: var(--ink); border-color: var(--ink); background: var(--panel); }
.step-crop { --pot: var(--ultramarine); }
.step-colors { --pot: var(--cadmium); }
.step-details { --pot: var(--vermilion); }
.step-share { --pot: var(--magenta); }
.step-qr { --pot: var(--emerald); }
.theme-crop { --step: var(--ultramarine); }
.theme-colors { --step: var(--cadmium); }
.theme-details { --step: var(--vermilion); }
.theme-share { --step: var(--magenta); }
.theme-qr { --step: var(--emerald); }

/* --- Panneaux et formulaires --- */
.panel { background: var(--panel); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.panel + .panel { margin-top: 1rem; }
.panel > h2:first-child, .panel > h3:first-child { margin-top: 0; }
.field { display: grid; gap: .35rem; margin-bottom: 1rem; }
.field label, .field legend, .label { font-weight: 650; }
.field .help, .helptext { color: var(--ink-3); font-size: .9rem; }
.field .errorlist, .errorlist { list-style: none; margin: 0; padding: 0; color: var(--danger); font-weight: 600; font-size: .95rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=date],
input[type=datetime-local], input[type=search], input[type=tel], select, textarea {
  width: 100%; min-height: 46px; padding: .55rem .75rem; border: 1.5px solid var(--ink-3); border-radius: 9px;
  background: var(--panel); color: var(--ink);
}
textarea { min-height: 7rem; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--focus); outline-offset: 0; border-color: var(--ink); }
input[type=color] { width: 4rem; height: 46px; padding: 3px; border: 1.5px solid var(--ink-3); border-radius: 9px; background: var(--panel); }
input[type=checkbox], input[type=radio] { width: 1.2rem; height: 1.2rem; accent-color: var(--ink); }
input[type=file] { max-width: 100%; }
input[type=file]::file-selector-button { font: inherit; font-weight: 650; padding: .45rem .9rem; margin-right: .8rem; border: 2px solid var(--ink); border-radius: 10px; background: var(--panel); color: var(--ink); cursor: pointer; }
.choices { display: flex; flex-wrap: wrap; gap: .4rem .9rem; list-style: none; padding: 0; margin: 0; }
.choices label, .check { display: inline-flex; align-items: center; gap: .5rem; font-weight: 500; cursor: pointer; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 1rem; }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); } }
fieldset { border: 0; padding: 0; margin: 0 0 1rem; min-width: 0; }

/* --- Tableaux de données --- */
.table-wrap { overflow-x: auto; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--panel); }
table.data { width: 100%; border-collapse: collapse; font-size: .97rem; }
table.data th, table.data td { padding: .65rem .85rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { font-weight: 700; font-size: .88rem; color: var(--ink-2); background: var(--gesso-2); }
table.data tr:last-child td { border-bottom: 0; }
table.data .num { text-align: right; white-space: nowrap; }
table.data tfoot td { font-weight: 700; border-top: 2px solid var(--ink); }

.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .1rem .6rem; border-radius: 999px; font-size: .84rem; font-weight: 700; border: 1.5px solid currentColor; white-space: nowrap; }
.badge.ok { color: var(--ok); }
.badge.warn { color: var(--vermilion); }
.badge.err { color: var(--danger); }
.badge.neutral { color: var(--ink-2); }

/* --- Liste des tableaux de l'atelier --- */
.dropzone { position: relative; display: grid; place-items: center; text-align: center; gap: .4rem; padding: 1.6rem 1rem; border: 2.5px dashed var(--ink-3); border-radius: 16px; background: var(--panel); cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone:hover, .dropzone.over { border-color: var(--ink); background: var(--gesso-2); }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone strong { font-family: var(--font-title); font-size: 1.25rem; }
.dropzone .icon { width: 2.2rem; height: 2.2rem; }
.filters { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin: 1.5rem 0 1rem; }
.filters input[type=search] { max-width: 320px; }
.filters select { width: auto; }
.works { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1.4rem 1.1rem; }
.work { display: grid; gap: .45rem; text-decoration: none; }
.work .frame { aspect-ratio: 1; display: grid; place-items: center; background: var(--gesso-2); border-radius: 10px; overflow: hidden; padding: 10px; }
.work .frame img { max-height: 100%; object-fit: contain; box-shadow: 0 6px 14px -6px rgb(0 0 0 / .35); }
.work:hover .frame { background: var(--line); }
.work h3 { margin: 0; font-size: 1rem; }
.work .meta { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; color: var(--ink-2); font-size: .88rem; }
.empty { padding: 2.5rem 1rem; text-align: center; color: var(--ink-2); }
.empty strong { display: block; font-family: var(--font-title); font-size: 1.2rem; color: var(--ink); margin-bottom: .3rem; }

/* --- Éditeurs (cadrage, couleurs, mur, certificat) --- */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.5rem; align-items: start; }
@media (max-width: 980px) { .editor { grid-template-columns: minmax(0, 1fr); } }
.stage { position: relative; background: #2b2926; border-radius: 12px; padding: clamp(10px, 2.5vw, 28px); display: grid; place-items: center; min-height: 320px; touch-action: none; user-select: none; -webkit-user-select: none; }
.stage-inner { position: relative; line-height: 0; max-width: 100%; }
.stage img, .stage canvas { display: block; max-width: 100%; max-height: 74vh; width: auto; height: auto; }
.stage svg.overlay { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.overlay .shade { fill: rgb(10 10 10 / .55); fill-rule: evenodd; }
.overlay .edge { fill: none; stroke: #fff; stroke-width: 2; vector-effect: non-scaling-stroke; }
.overlay .edge-ink { fill: none; stroke: var(--step); stroke-width: 4; vector-effect: non-scaling-stroke; opacity: .9; }
.handle { position: absolute; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; cursor: grab; touch-action: none; display: grid; place-items: center; background: none; border: 0; padding: 0; }
.handle::before { content: ""; width: 22px; height: 22px; border-radius: 50%; background: var(--step); border: 3px solid #fff; box-shadow: 0 2px 8px rgb(0 0 0 / .5); }
.handle:active { cursor: grabbing; }
.handle:focus-visible { outline: 3px solid #fff; outline-offset: -6px; }
.handle.white::before { background: #fff; border-color: #161514; }
.handle.black::before { background: #161514; border-color: #fff; }
.handle.off { opacity: .35; }
.loupe { position: absolute; width: 132px; height: 132px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 6px 20px rgb(0 0 0 / .5); pointer-events: none; overflow: hidden; display: none; background: #000; }
.loupe canvas { width: 100%; height: 100%; max-height: none; }
.loupe.on { display: block; }
.side { display: grid; gap: 1rem; position: sticky; top: 84px; }
@media (max-width: 980px) { .side { position: static; } }
.slider { display: grid; grid-template-columns: 1fr auto; gap: .2rem .6rem; align-items: center; margin-bottom: .85rem; }
.slider label { font-weight: 650; }
.slider output { font-variant-numeric: tabular-nums; color: var(--ink-2); min-width: 3.5ch; text-align: right; }
.slider input[type=range] { grid-column: 1 / -1; width: 100%; accent-color: var(--ink); height: 28px; }
.swatch { width: 28px; height: 28px; border-radius: 6px; border: 2px solid var(--ink); flex: none; }
.point-row { display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.point-row .check { margin-left: auto; }
.compare-hint { color: var(--ink-3); font-size: .88rem; }
.preset-list { display: flex; flex-wrap: wrap; gap: .4rem; }
.preset { display: inline-flex; align-items: center; border: 1.5px solid var(--ink-3); border-radius: 999px; overflow: hidden; }
.preset button { background: none; border: 0; padding: .35rem .75rem; cursor: pointer; font-weight: 600; }
.preset button:hover { background: var(--gesso-2); }
.preset button + button { border-left: 1.5px solid var(--line); padding: .35rem .5rem; color: var(--ink-3); }
.bottom-bar { display: flex; justify-content: flex-end; gap: .75rem; flex-wrap: wrap; margin-top: 1rem; }

/* --- Diffusion --- */
.network-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .5rem; list-style: none; padding: 0; margin: 0; }
.network-list label { display: flex; align-items: center; gap: .6rem; padding: .6rem .8rem; border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer; background: var(--panel); }
.network-list label:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.network-list .not-ready { color: var(--ink-3); }
.network-list small { display: block; color: var(--ink-3); font-size: .8rem; }
.pub-list { display: grid; gap: .6rem; list-style: none; padding: 0; margin: 0; }
.pub { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: .9rem; align-items: center; padding: .7rem; border: 1.5px solid var(--line); border-radius: 10px; background: var(--panel); }
.pub img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; }
.pub .error-text { color: var(--danger); font-size: .9rem; margin: .2rem 0 0; }
@media (max-width: 640px) { .pub { grid-template-columns: 48px minmax(0, 1fr); } .pub img { width: 48px; height: 48px; } .pub .actions { grid-column: 1 / -1; } }
.copy-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem; align-items: start; }
.copy-field textarea, .copy-field input { font-size: .95rem; }

/* --- QR --- */
.qr-sheet { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 1.5rem; align-items: center; }
.qr-sheet svg { width: 100%; height: auto; background: #fff; border-radius: 10px; padding: 12px; border: 2px solid var(--ink); }
@media (max-width: 640px) { .qr-sheet { grid-template-columns: minmax(0, 1fr); } }
.qr-label { display: none; }

/* --- Comptabilité --- */
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.figure { padding: 1rem 1.1rem; border: 2px solid var(--ink); border-radius: 12px; background: var(--panel); }
.figure .label { font-size: .9rem; color: var(--ink-2); font-weight: 650; }
.figure .value { font-family: var(--font-title); font-size: 1.6rem; font-weight: 750; margin-top: .15rem; }
.figure.in { border-color: var(--emerald); }
.figure.out { border-color: var(--vermilion); }
.months { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: .4rem; align-items: end; height: 170px; padding: .5rem 0 0; }
.month { display: grid; grid-template-rows: 1fr auto; height: 100%; gap: .3rem; }
.month .bars { display: flex; gap: 2px; align-items: flex-end; justify-content: center; height: 100%; }
.month .bar { width: 42%; border-radius: 3px 3px 0 0; min-height: 2px; }
.month .bar.in { background: var(--emerald); }
.month .bar.out { background: var(--vermilion); }
.month .name { text-align: center; font-size: .75rem; color: var(--ink-3); }
.legend { display: flex; gap: 1rem; font-size: .88rem; color: var(--ink-2); margin-top: .6rem; }
.legend span::before { content: ""; display: inline-block; width: .8em; height: .8em; border-radius: 2px; margin-right: .35em; vertical-align: -.05em; background: var(--c); }
.amount-in { color: var(--ok); }
.amount-out { color: var(--vermilion); }
.offers { display: grid; gap: .6rem; list-style: none; padding: 0; margin: 0; }
.offer { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .2rem 1rem; padding: .85rem 1rem; border: 1.5px solid var(--line); border-radius: 10px; background: var(--panel); }
.offer:first-child { border: 2px solid var(--ink); }
.offer .price { font-family: var(--font-title); font-size: 1.35rem; font-weight: 750; grid-row: span 2; align-self: center; }
.offer .details { color: var(--ink-2); font-size: .9rem; }

/* --- Connexion --- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.login-card { width: min(420px, 100%); background: var(--panel); border: 2px solid var(--ink); border-radius: 18px; padding: 2rem 1.75rem;
  /* deux aplats de couleur décalés sous la carte, comme des couches de peinture */
  box-shadow: 10px 10px 0 -2px var(--ultramarine), -9px 14px 0 -2px var(--cadmium); }
.login-card h1 { font-size: 2rem; margin-bottom: .2rem; }

.error-page { min-height: 70vh; display: grid; place-content: center; text-align: center; gap: .5rem; padding: 2rem; }
.error-page .code { font-family: var(--font-title); font-size: 5rem; font-weight: 800; line-height: 1; }

@media print {
  .topbar, .steps, .no-print, .messages, .workspace-head { display: none !important; }
  body { background: #fff; color: #000; }
  .qr-label { display: grid; grid-template-columns: 38mm 1fr; gap: 6mm; align-items: center; width: 100mm; padding: 5mm; border: 0.3mm solid #000; }
  .qr-label svg { width: 38mm; height: 38mm; }
  .qr-label h2 { margin: 0 0 2mm; font-size: 14pt; }
  .qr-label p { margin: 0; font-size: 9pt; }
  .qr-sheet { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
.mt { margin-top: .8rem; }
.legend .in { --c: var(--emerald); }
.legend .out { --c: var(--vermilion); }

/* --- Mise en page des certificats --- */
.sheet { position: relative; width: min(100%, 620px); margin: 0 auto; background: #fff; box-shadow: 0 12px 30px -14px rgb(0 0 0 / .45); line-height: 1.15; }
.sheet img { display: block; width: 100%; height: auto; pointer-events: none; user-select: none; }
.field-box { position: absolute; border: 1.5px dashed var(--vermilion); background: rgb(255 255 255 / .55); color: var(--ink); overflow: hidden; cursor: move; touch-action: none; padding: 0 2px; display: block; white-space: nowrap; font-family: var(--font-ui); }
.field-box.image { display: grid; place-items: center; font-size: .8rem; background: rgb(229 86 54 / .12); }
.field-box.selected, .field-box:focus-visible { border-style: solid; border-width: 2px; outline: none; background: rgb(255 255 255 / .8); }
.field-box .grip { position: absolute; right: -1px; bottom: -1px; width: 14px; height: 14px; background: var(--vermilion); cursor: nwse-resize; }

.tool-row .btn[aria-pressed="true"] { border-color: var(--ink); background: var(--gesso-2); }
.handle.shadow::before { background: #555; width: 18px; height: 18px; }
