/* ==========================================================================
   ModulAI — app.css
   Single stylesheet for the single-index app (modulai.ca).

   The index is not a brochure that leads to an app: the index IS the app.
   Every visual state below is driven by one of three data attributes:

       <body data-auth="anon|user">        session state
       <li class="service-row" data-status="live|soon">   catalog honesty
       <section id="modulePanel" data-state="...">        module state machine

   SECURITY NOTE — READ BEFORE TOUCHING THE data-auth RULES
   ---------------------------------------------------------------------
   Everything keyed on [data-auth] in this file is COSMETIC. It hides a
   balance, draws a padlock, swaps a button label. It is not a security
   boundary and must never be treated as one. The only boundary is the
   relay: without a valid JWT nothing happens server-side. Flipping
   data-auth="user" in devtools unlocks pixels and exactly zero capability.
   ---------------------------------------------------------------------

   TABLE OF CONTENTS
     01  Fonts (self-hosted Inter, no Google Fonts — a strict CSP is coming)
     02  Design tokens
     03  Reset and base
     04  Utilities (container, frame, visually-hidden, focus)
     05  Buttons
     06  Navigation (+ mobile menu)
     07  Hero
     08  Section furniture
     09  Catalog — toolbar, filters, rows, empty state
     10  Module panel — the single shell for all 13 services
     11  Auth states (cosmetic)
     12  How it works — value cards
     13  Vision
     14  Wallet / CTA / pricing
     15  FAQ
     16  Footer
     17  Responsive (one block per breakpoint, consolidated)
     18  Environment queries (reduced motion, coarse pointer, safe area)
   ========================================================================== */


/* ==========================================================================
   01  FONTS
   Inter is self-hosted. The source page named Inter in --sans but never
   loaded it, so every visitor got the system fallback. These are the
   fontsource variable builds (weight axis 100-900), which covers the
   400 / 500 / 650 / 700 / 800 the design system actually uses with two
   files instead of eight.

   Files that must ship in apps/web/assets/fonts/ :
       inter-latin-wght-normal.woff2       (latin subset, variable weight)
       inter-latin-ext-wght-normal.woff2   (latin-ext subset, variable weight)
   ========================================================================== */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("assets/fonts/inter-latin-ext-wght-normal.woff2") format("woff2-variations");
  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: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("assets/fonts/inter-latin-wght-normal.woff2") format("woff2-variations");
  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;
}


/* ==========================================================================
   02  DESIGN TOKENS
   ========================================================================== */

:root {
  --bg: #0d0e10;
  --bg-2: #131416;
  --panel: rgba(20, 21, 24, 0.90);
  --panel-2: rgba(25, 26, 30, 0.95);
  --border: rgba(232, 231, 226, 0.10);
  --border-strong: rgba(232, 231, 226, 0.20);
  --text: #f2f0ea;
  --muted: #aaa9a3;                 /* 8.20:1 on --bg */

  /* --soft was #76767a: 4.27:1 on --bg — below WCAG AA (4.5:1) and used on
     22 elements at 9-13px, including the legal fine print under the 5 $ offer.
     #8e8e92 measures 5.92:1 on --bg #0d0e10 (and higher on the darker panel
     fills), which clears AA for normal text, not just large text. */
  --soft: #8e8e92;                  /* 5.92:1 on --bg */

  --green: #b6bcc8;                 /* 10.13:1 */
  --green-deep: #8f96a3;            /* 6.49:1  */
  --cyan: #d8d2c7;                  /* 12.84:1 */
  --amber: #c6aa7a;                 /* 8.67:1  */
  --danger: #ff7f7f;                /* 7.90:1  */
  --ok: #9fd0a8;

  --shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
  --max: 1220px;
  --page-pad: 32px;
  --nav-h: 68px;

  --focus: #d8d2c7;

  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}


/* ==========================================================================
   03  RESET AND BASE
   ========================================================================== */

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  font-family: var(--sans);
  color: var(--text);
  background:
    radial-gradient(circle at 15% 15%, rgba(184, 188, 198, .08), transparent 32%),
    radial-gradient(circle at 80% 20%, rgba(216, 210, 199, .05), transparent 26%),
    radial-gradient(circle at 50% 100%, rgba(198, 170, 122, .035), transparent 24%),
    linear-gradient(180deg, #0d0e10 0%, #111214 55%, #0d0e10 100%);
  line-height: 1.5;
  overflow-x: hidden;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .015) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(circle at center, black 35%, transparent 95%);
  -webkit-mask-image: radial-gradient(circle at center, black 35%, transparent 95%);
  opacity: .6;
  z-index: 0;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .06;
  background-image: radial-gradient(circle, rgba(255, 255, 255, .9) 0.8px, transparent 0.9px);
  background-size: 5px 5px;
  mix-blend-mode: soft-light;
  z-index: 0;
}

/* Everything real sits above the two texture layers. */
nav, main, footer { position: relative; z-index: 1; }

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; }
img, svg { display: block; max-width: 100%; }
/* ET LA LIGNE AU-DESSUS REND `hidden` INOPÉRANT SUR UNE IMAGE — troisième fois
   que ce piège mord. Une règle d'auteur bat toujours le `[hidden] {display:none}`
   de la feuille du navigateur : le bouton « Télécharger » du pied de page le
   2026-09-27, les commandes de l'éditeur de Vision (voir `.vision-editor
   [hidden]` plus bas), et l'<img> de la Toile, qui charge les octets pendant que
   le canevas les peint — elle s'affichait EN DOUBLE sous son propre aperçu, vu
   sur la capture, invisible au journal.
   ON LE CORRIGE ICI, à la racine, pour les deux seuls sélecteurs que ce reset
   touche. Spécificité (0,1,1) contre (0,0,1) : aucun `!important`. */
img[hidden], svg[hidden] { display: none; }
ul, ol { list-style: none; }

h1, h2, h3, h4 { font-weight: 800; }

h1 {
  font-size: clamp(44px, 7vw, 82px);
  letter-spacing: -.065em;
  line-height: .96;
  max-width: 720px;
}


/* ==========================================================================
   04  UTILITIES
   ========================================================================== */

.container {
  width: min(calc(100% - var(--page-pad) * 2), var(--max));
  margin: 0 auto;
}

.frame {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, .02), rgba(255, 255, 255, .01));
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Focus is never invisible. The source page shipped a :focus-visible rule on
   .service-row that could never fire, because .service-row was a <div> with
   no tabindex. One global ring, plus per-component refinements. */
:where(a, button, input, textarea, select, [tabindex]):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Skip link — first tabbable thing on the page. */
.skip-link {
  position: absolute;
  left: 12px;
  top: -100px;
  z-index: 200;
  padding: 11px 16px;
  border-radius: 10px;
  background: var(--cyan);
  color: #111214;
  font-weight: 700;
  transition: top .18s ease;
}
.skip-link:focus { top: 12px; }


/* ==========================================================================
   05  BUTTONS
   ========================================================================== */

.btn {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .02);
  color: var(--text);
  padding: 11px 16px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 650;
  cursor: pointer;
  transition: .22s ease;
  white-space: nowrap;
  min-height: 44px;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, .05);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  border-color: transparent;
  color: #111214;
  background: linear-gradient(135deg, #c3c7cf, #ddd8cf);
  box-shadow: 0 10px 30px rgba(216, 210, 199, .10), 0 0 0 1px rgba(255, 255, 255, .04) inset;
}

.btn-primary:hover { background: linear-gradient(135deg, #d0d3d9, #eee9df); }

.btn-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}
.btn-ghost:hover { color: var(--text); background: rgba(255, 255, 255, .04); }

.btn-danger {
  border-color: rgba(255, 127, 127, .32);
  color: var(--danger);
}

.btn-sm {
  min-height: 38px;
  padding: 8px 13px;
  border-radius: 10px;
  font-size: 13px;
}


/* ==========================================================================
   06  NAVIGATION
   ========================================================================== */

nav {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(232, 231, 226, .16);
  background: rgba(10, 13, 12, 0.76);
  backdrop-filter: blur(16px);
}

.nav-inner {
  width: min(calc(100% - var(--page-pad) * 2), var(--max));
  margin: 0 auto;
  min-height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  /* Le menu doit pouvoir rétrécir avant de replier. Sans ce min-width, un
     enfant flex refuse de passer sous sa taille de contenu et pousse la barre
     au-delà de la page. */
  min-width: 0;
}

.nav-services { min-width: 0; flex-shrink: 1; }
.brand { flex: 0 0 auto; }

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: -.04em;
}

.brand-badge {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  color: var(--text);
  background: transparent;
  border: 1px solid rgba(232, 231, 226, .18);
  flex: 0 0 auto;
}

.brand small {
  display: block;
  color: var(--soft);
  font-size: 11px;
  font-family: var(--mono);
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 700;
  margin-top: 2px;
}

.nav-services {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(232, 231, 226, .10);
  border-radius: 10px;
  background: rgba(255, 255, 255, .015);
}

.nav-services a {
  padding: 8px 10px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 12px;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: .055em;
}

.nav-services a:hover { color: var(--text); background: rgba(255, 255, 255, .04); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

/* Le solde et le courriel EMPILÉS. Mis côte à côte, ils mangeaient toute la
   largeur laissée au menu, qui repliait alors sur cinq lignes dès qu'on était
   connecté. Rien n'est retiré : la même information, rangée en hauteur. */
.nav-identity {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 1px;
  min-width: 0;
  line-height: 1.15;
}

.nav-identity .nav-balance {
  display: flex;
  align-items: baseline;
  gap: 5px;
  padding: 0;
  border: 0;
  background: none;
}

.nav-identity .nav-account {
  font-size: 10.5px;
  color: var(--soft);
  font-family: var(--mono);
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Live balance chip in the nav — only meaningful once signed in. */
.nav-balance {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, .02);
  font-family: var(--mono);
  font-size: 13px;
  color: var(--amber);
  white-space: nowrap;
}
.nav-balance small {
  color: var(--soft);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
}

/* --- Mobile menu ------------------------------------------------------
   The source hid .nav-login at <=760px with `display:none !important` and
   offered nothing in its place: on a phone there was literally no way to
   sign in. #navToggle + #navMenu replace it. The button is hidden on
   desktop; JS only has to flip aria-expanded, the CSS does the rest. */

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, .02);
  cursor: pointer;
  place-items: center;
  flex: 0 0 auto;
}

.nav-toggle-bars {
  display: block;
  position: relative;
  width: 17px;
  height: 1.5px;
  background: var(--text);
  border-radius: 2px;
  transition: .2s ease;
}
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 17px;
  height: 1.5px;
  background: var(--text);
  border-radius: 2px;
  transition: .2s ease;
}
.nav-toggle-bars::before { top: -5.5px; }
.nav-toggle-bars::after { top: 5.5px; }

.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { top: 0; transform: rotate(-45deg); }

.nav-menu {
  display: none;
  border-top: 1px solid rgba(232, 231, 226, .12);
  background: rgba(10, 13, 12, .97);
  backdrop-filter: blur(18px);
}

.nav-menu-inner {
  width: min(calc(100% - var(--page-pad) * 2), var(--max));
  margin: 0 auto;
  padding: 14px 0 20px;
  display: grid;
  gap: 4px;
}

.nav-menu a {
  padding: 13px 4px;
  color: var(--muted);
  font-size: 15px;
  border-bottom: 1px solid rgba(232, 231, 226, .06);
}
.nav-menu a:hover { color: var(--text); }

.nav-menu-actions {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.nav-menu-actions .btn { width: 100%; }
.nav-menu-actions .nav-balance { justify-content: center; }


/* ==========================================================================
   07  HERO
   ========================================================================== */

.hero { padding: 64px 0 40px; }

.hero-panel {
  border-radius: 28px;
  padding: 28px;
}

.hero-left {
  position: relative;
  overflow: hidden;
  max-width: 1080px;
  margin: 0 auto;
  padding: 76px 56px 54px;
  text-align: center;
  background:
    radial-gradient(circle at 75% 20%, rgba(216, 210, 199, .07), transparent 35%),
    radial-gradient(circle at 15% 10%, rgba(182, 188, 200, .08), transparent 28%),
    linear-gradient(180deg, rgba(20, 27, 23, .95), rgba(10, 13, 12, .96));
}

.hero-left::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .1));
  pointer-events: none;
}

.hero-left > * { position: relative; }

.top-ribbon {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, .03);
  font-size: 13px;
  margin: 0 auto 22px;
}

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 16px rgba(182, 188, 200, .35);
  flex: 0 0 auto;
}

.hero-left h1 {
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.hero-highlight {
  color: var(--green);
  text-shadow: 0 0 24px rgba(182, 188, 200, .10);
}

.hero-copy {
  max-width: 720px;
  margin: 24px auto 0;
  color: var(--muted);
  font-size: 18px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
  justify-content: center;
}

.hero-note {
  margin-top: 18px;
  color: var(--soft);
  font-size: 13px;
  font-family: var(--mono);
  text-align: center;
}

.quick-search {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(3, 5, 5, .35);
  max-width: 760px;
  margin: 32px auto 0;
  text-align: left;
}

.quick-search span {
  color: var(--green);
  font-family: var(--mono);
  flex: 0 0 auto;
}

.quick-search input {
  width: 100%;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--text);
  font-size: 15px;
}

.quick-search input::placeholder { color: var(--soft); }

.quick-search:focus-within {
  border-color: rgba(216, 210, 199, .45);
}

.hero-stats {
  margin-top: 26px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.stat-chip {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .02);
  padding: 14px 16px;
  border-radius: 16px;
  min-width: min(170px, 100%);
  text-align: left;
}

.stat-chip strong {
  display: block;
  font-size: 18px;
  letter-spacing: -.04em;
}

.stat-chip span {
  color: var(--soft);
  font-size: 12px;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: .06em;
}


/* ==========================================================================
   08  SECTION FURNITURE
   ========================================================================== */

section { padding: 38px 0 0; }

#tools { padding-top: 54px; }

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  margin-bottom: 22px;
}

.section-head h2 {
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: -.05em;
  margin-top: 6px;
}

.section-head p {
  max-width: 520px;
  color: var(--muted);
  font-size: 15px;
}

.kicker {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--green);
}


/* ==========================================================================
   09  CATALOG
   The catalog ships as an empty shell. catalog.js renders every row from
   services.json into #serviceList and every filter button into
   #serviceFilters, so the counts are derived from the data and cannot
   drift the way the hard-coded ones did (image said 4 across 5 rows,
   design said 3 across 4 rows).
   ========================================================================== */

.catalog-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  border-top: 1px solid rgba(232, 231, 226, .14);
  border-bottom: 1px solid rgba(232, 231, 226, .16);
  margin-top: 4px;
}

.catalog-search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 0;
  min-width: 0;
}

.catalog-search span {
  font-family: var(--mono);
  color: var(--soft);
  flex: 0 0 auto;
}

.catalog-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 14px;
}

.catalog-search input::placeholder { color: var(--soft); }

.catalog-result {
  color: var(--soft);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .07em;
  text-transform: uppercase;
  /* Pas de nowrap : « 13 services · 2 en ligne » ne doit pas pouvoir pousser
     la barre au-delà de la page sur un écran étroit. */
  min-width: 0;
}

.services-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  border-bottom: 1px solid rgba(232, 231, 226, .16);
}

/* --- filter rail --- */

.services-menu {
  border-right: 1px solid rgba(232, 231, 226, .14);
  padding: 18px 26px 22px 0;
  position: relative;
}

.services-menu-inner { position: sticky; top: calc(var(--nav-h) + 24px); }

.services-menu-title {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--soft);
  margin-bottom: 14px;
}

#serviceFilters { display: block; }

.service-filter {
  width: 100%;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 10px 0;
  cursor: pointer;
  font-size: 14px;
  border-bottom: 1px solid rgba(232, 231, 226, .055);
  transition: color .18s ease, padding-left .18s ease;
}

.service-filter .service-filter-count {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--soft);
}

.service-filter:hover { color: var(--text); padding-left: 4px; }

.service-filter[aria-pressed="true"] { color: var(--text); }

.service-filter[aria-pressed="true"] .service-filter-label::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--cyan);
  display: inline-block;
  margin-right: 9px;
  vertical-align: middle;
}

.services-menu-note {
  margin-top: 20px;
  color: var(--soft);
  font-size: 12px;
  line-height: 1.55;
  font-family: var(--mono);
}

/* --- rows --- */

.services-list { min-width: 0; }

/* Des TUILES, pas des rangées.
   Les sept colonnes fixes faisaient 770 px au minimum : sur un téléphone de
   375 px, la page débordait de 400 px et il fallait un overflow-x: auto pour
   la rendre atteignable — c'est-à-dire un défilement horizontal, ce qu'on ne
   veut nulle part. Une grille auto-fill n'a pas ce problème : elle tombe à
   une colonne toute seule. */
#serviceList {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 248px), 1fr));
  gap: 12px;
  padding: 4px 0 0;
  margin: 0;
  list-style: none;
}

.service-row { position: relative; min-width: 0; }
.service-row[hidden] { display: none; }

/* The row itself is now a real link: keyboard reachable, has an href, and
   announces itself. The source shipped bare <div>s with cursor:pointer and
   an animated arrow — an interaction promise no keyboard user could take. */
.service-link {
  display: grid;
  /* numéro + nom · description · pied (type, prix, état) */
  grid-template-rows: auto 1fr auto;
  gap: 9px;
  height: 100%;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(232, 231, 226, .10);
  border-radius: 12px;
  background: rgba(255, 255, 255, .015);
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
  color: inherit;
}

.service-link:hover { border-color: rgba(232, 231, 226, .22); transform: translateY(-1px); }

@media (prefers-reduced-motion: reduce) {
  .service-link { transition: none; }
  .service-link:hover { transform: none; }
}

.service-link:hover { background: rgba(255, 255, 255, .022); }
.service-link:hover .service-arrow {
  transform: translateX(4px);
  color: var(--text);
  border-color: rgba(232, 231, 226, .10);
  background: rgba(255, 255, 255, .025);
}

.service-link:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
  border-radius: 0;
  background: rgba(255, 255, 255, .03);
}

.service-num {
  font-family: var(--mono);
  color: var(--soft);
  font-size: 12px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(232, 231, 226, .09);
  border-radius: 8px;
  background: rgba(255, 255, 255, .015);
}

/* En-tête de tuile : le numéro puis le nom, sur une ligne. */
.service-link { grid-template-columns: auto minmax(0, 1fr); }
.service-num { grid-row: 1; grid-column: 1; }
.service-name { grid-row: 1; grid-column: 2; }
.service-desc { grid-row: 2; grid-column: 1 / -1; }
.service-foot { grid-row: 3; grid-column: 1 / -1; }

/* La flèche n'a plus de colonne à elle ; le survol de la tuile suffit. */
.service-arrow { display: none; }

.service-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.service-name {
  font-size: 16px;
  letter-spacing: -.025em;
  font-weight: 650;
  line-height: 1.18;
  display: block;
}

.service-name small {
  display: block;
  margin-top: 5px;
  color: var(--soft);
  font-size: 11px;
  font-family: var(--mono);
  font-weight: 500;
  letter-spacing: .035em;
  line-height: 1.3;
}

.service-desc {
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
  display: block;
  min-width: 0;
  /* Trois lignes au plus : les tuiles d'une rangée gardent la même hauteur
     sans qu'on ait à la fixer. */
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.service-category {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--soft);
  text-transform: uppercase;
  letter-spacing: .07em;
  width: max-content;
  max-width: 100%;
  border: 1px solid rgba(232, 231, 226, .08);
  border-radius: 999px;
  padding: 6px 8px;
  background: rgba(255, 255, 255, .012);
}

.service-price {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--cyan);
  padding: 0;
  white-space: nowrap;
  margin-left: auto;
}

.service-free { color: var(--text); }

.service-state {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

/* Padlock, drawn in CSS boxes: no data: URI, no icon font, nothing for a
   strict CSP to argue with. Shown on live services while signed out. */
.service-lock {
  display: none;
  position: relative;
  width: 11px;
  height: 9px;
  border: 1.5px solid var(--soft);
  border-radius: 2px;
  flex: 0 0 auto;
  margin-top: 5px;
}
.service-lock::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -6.5px;
  transform: translateX(-50%);
  width: 7px;
  height: 7px;
  border: 1.5px solid var(--soft);
  border-bottom: 0;
  border-radius: 4px 4px 0 0;
}

.service-badge {
  display: none;
  align-items: center;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--amber);
  border: 1px solid rgba(198, 170, 122, .30);
  background: rgba(198, 170, 122, .07);
  border-radius: 999px;
  padding: 5px 8px;
  white-space: nowrap;
}

.service-badge-live {
  color: var(--ok);
  border-color: rgba(159, 208, 168, .32);
  background: rgba(159, 208, 168, .07);
}

/* A service with no working pipeline says so, and reads dimmer than one
   that works. Honesty is a visual state, not a disclaimer at the bottom. */
/* `:not(.service-badge-live)` : la pastille « en ligne » porte elle aussi la
   classe .service-badge, donc sans cette exclusion un service en préparation
   affichait « BIENTÔT » ET « EN LIGNE » côte à côte. Vu le 2026-09-23 sur une
   capture du catalogue — invisible en lisant la règle. */
.service-row[data-status="soon"] .service-badge:not(.service-badge-live) { display: inline-flex; }
.service-row[data-status="soon"] .service-name,
.service-row[data-status="soon"] .service-price { color: var(--muted); }
.service-row[data-status="soon"] .service-price { color: var(--soft); }
.service-row[data-status="soon"] .service-arrow { opacity: .45; }
.service-row[data-status="live"] .service-badge-live { display: inline-flex; }

.service-arrow {
  color: var(--soft);
  transition: transform .18s ease, color .18s ease, background .18s ease, border-color .18s ease;
  font-size: 18px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid transparent;
  justify-self: end;
}

.service-empty {
  padding: 34px 26px;
  color: var(--muted);
  font-size: 14px;
  border-bottom: 1px solid rgba(232, 231, 226, .10);
}
.service-empty[hidden] { display: none; }


/* ==========================================================================
   10  MODULE PANEL
   One shell, thirteen services. #modulePanel carries data-state and the
   state machine is expressed entirely here:

       locked -> soon | input -> quote -> confirmed -> running -> result
                                                              \-> error

   Only the step matching data-state is displayed. Nothing else needs to
   know which service is open.
   ========================================================================== */

.module-panel {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: end center;
  padding: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: rgba(6, 7, 9, .72);
  backdrop-filter: blur(6px);
}

.module-panel[hidden] { display: none; }

/* No page scrolling behind an open module. */
body:has(#modulePanel:not([hidden])) { overflow: hidden; }

.module-shell {
  width: min(100%, 760px);
  margin: auto;
  border-radius: 24px;
  border: 1px solid var(--border-strong);
  background:
    radial-gradient(circle at 85% 0%, rgba(216, 210, 199, .05), transparent 30%),
    linear-gradient(180deg, rgba(20, 21, 25, .99), rgba(10, 11, 13, .99));
  box-shadow: 0 30px 90px rgba(0, 0, 0, .55);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 48px);
}

.module-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid rgba(232, 231, 226, .10);
}

.module-kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: var(--soft);
}

.module-title {
  font-size: 24px;
  letter-spacing: -.04em;
  margin-top: 6px;
}

.module-head-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--soft);
  text-transform: uppercase;
  letter-spacing: .07em;
}

.module-close {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, .02);
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: .18s ease;
}
.module-close:hover { color: var(--text); border-color: var(--border-strong); }

.module-body {
  padding: 22px 24px;
  overflow-y: auto;
  flex: 1;
}

/* --- step visibility ------------------------------------------------- */

.module-step { display: none; }

.module-panel[data-state="locked"]    .module-step[data-step="locked"],
.module-panel[data-state="soon"]      .module-step[data-step="soon"],
.module-panel[data-state="input"]     .module-step[data-step="input"],
.module-panel[data-state="quote"]     .module-step[data-step="quote"],
.module-panel[data-state="confirmed"] .module-step[data-step="quote"],
.module-panel[data-state="running"]   .module-step[data-step="running"],
.module-panel[data-state="result"]    .module-step[data-step="result"],
.module-panel[data-state="error"]     .module-step[data-step="error"] {
  display: block;
}

/* Action buttons declare which states they belong to with data-when.
   `data-when="input quote"` shows in both. */
.module-actions [data-when] { display: none; }
.module-panel[data-state="locked"]    .module-actions [data-when~="locked"],
.module-panel[data-state="soon"]      .module-actions [data-when~="soon"],
.module-panel[data-state="input"]     .module-actions [data-when~="input"],
.module-panel[data-state="quote"]     .module-actions [data-when~="quote"],
.module-panel[data-state="confirmed"] .module-actions [data-when~="confirmed"],
.module-panel[data-state="running"]   .module-actions [data-when~="running"],
.module-panel[data-state="result"]    .module-actions [data-when~="result"],
.module-panel[data-state="error"]     .module-actions [data-when~="error"] {
  display: inline-flex;
}

/* --- locked / soon --------------------------------------------------- */

.module-notice {
  display: grid;
  gap: 12px;
  padding: 26px 22px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, .015);
  text-align: center;
}

.module-notice h3 { font-size: 19px; letter-spacing: -.03em; }
.module-notice p { color: var(--muted); font-size: 14px; }

.module-notice-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .02);
  font-size: 18px;
}

/* The padlock glyph is display:none by default (it is an auth cue on rows);
   inside the notice it is the illustration, so it always shows. */
.module-notice-icon .service-lock {
  display: block;
  margin-top: 4px;
  border-color: var(--muted);
}
.module-notice-icon .service-lock::before { border-color: var(--muted); }

.module-notify {
  display: inline-flex;
  margin: 4px auto 0;
}

/* Le champ courriel du « prévenez-moi », centré dans la notice. */
.module-notice .module-field {
  max-width: 340px;
  margin: 6px auto 0;
  text-align: left;
  width: 100%;
}

/* --- input step / drop zone ------------------------------------------ */

.module-dropzone {
  border: 1px dashed rgba(232, 231, 226, .22);
  border-radius: 18px;
  background: rgba(7, 8, 10, .45);
  padding: 34px 22px;
  text-align: center;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
  display: grid;
  gap: 8px;
  place-items: center;
}

.module-dropzone:hover,
.module-dropzone:focus-visible {
  border-color: rgba(216, 210, 199, .45);
  background: rgba(255, 255, 255, .025);
}

.module-dropzone[data-dragover="true"] {
  border-color: var(--cyan);
  border-style: solid;
  background: rgba(216, 210, 199, .06);
}

.module-dropzone-label { font-size: 15px; font-weight: 650; }
.module-dropzone-browse { color: var(--cyan); text-decoration: underline; text-underline-offset: 3px; }
.module-dropzone-hint {
  color: var(--soft);
  font-size: 12px;
  font-family: var(--mono);
  letter-spacing: .04em;
}

.module-files { display: grid; gap: 8px; margin-top: 14px; }
.module-files:empty { display: none; }

.module-file {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: rgba(255, 255, 255, .02);
  font-size: 13px;
}

.module-file-name { overflow-wrap: anywhere; }
.module-file-size { color: var(--soft); font-family: var(--mono); font-size: 11px; white-space: nowrap; }

.module-file-remove {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 8px;
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.module-file-remove:hover { color: var(--danger); border-color: rgba(255, 127, 127, .32); }

/* fields rendered from services.json */
.module-fields { display: grid; gap: 16px; margin-top: 20px; }
.module-fields:empty { display: none; }

.module-field { display: grid; gap: 8px; }

.module-field > label,
.module-label {
  color: var(--soft);
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .10em;
}

.module-input,
.module-select,
.module-textarea {
  width: 100%;
  border-radius: 13px;
  border: 1px solid rgba(232, 231, 226, .12);
  background: rgba(7, 8, 10, .55);
  color: var(--text);
  padding: 13px 14px;
  font-size: 15px;
  outline: none;
  transition: border-color .18s ease;
}

.module-textarea {
  min-height: 130px;
  resize: vertical;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
}

.module-input:focus,
.module-select:focus,
.module-textarea:focus { border-color: rgba(216, 210, 199, .45); }

.module-field-hint { color: var(--soft); font-size: 12px; }

.module-field-error { color: var(--danger); font-size: 12px; }
.module-field-error:empty { display: none; }

/* « On vous écrira à … » — le champ courriel a disparu : la personne est
   connectée, on a déjà son adresse, et le backend refuse tout corps portant
   `email`. Reste à lui dire où ça s'en va. */
.module-notify-to { color: var(--soft); font-size: 13px; font-family: var(--mono); }
.module-notify-to:empty { display: none; }

.module-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* --- quote step ------------------------------------------------------ */

.module-quote {
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, .015);
  overflow: hidden;
}

.module-quote-head {
  padding: 18px 20px;
  border-bottom: 1px solid rgba(232, 231, 226, .10);
}

.module-quote-total {
  font-family: var(--mono);
  font-size: 30px;
  letter-spacing: -.03em;
  color: var(--amber);
}

.module-quote-caption { color: var(--soft); font-size: 12px; margin-top: 6px; }

.module-quote-lines { display: grid; }

.module-quote-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
  padding: 13px 20px;
  border-bottom: 1px solid rgba(232, 231, 226, .06);
  color: var(--muted);
  font-size: 13px;
}
.module-quote-line:last-child { border-bottom: 0; }
.module-quote-line strong { font-family: var(--mono); color: var(--text); }

.module-quote-note {
  margin-top: 14px;
  color: var(--soft);
  font-size: 12px;
  font-family: var(--mono);
  line-height: 1.6;
}

.module-quote-insufficient {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(198, 170, 122, .30);
  background: rgba(198, 170, 122, .07);
  border-radius: 13px;
  color: var(--amber);
  font-size: 13px;
}
.module-quote-insufficient[hidden] { display: none; }

/* --- running step ---------------------------------------------------- */

.module-progress {
  height: 6px;
  border-radius: 999px;
  background: rgba(232, 231, 226, .09);
  overflow: hidden;
}

.module-progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #8f96a3, #d8d2c7);
  transition: width .4s ease;
}

/* Indeterminate: the backend gave no percentage yet. */
.module-progress[data-indeterminate="true"] .module-progress-bar {
  width: 38%;
  animation: module-slide 1.5s ease-in-out infinite;
}

@keyframes module-slide {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(263%); }
}

.module-progress-label {
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
}

.module-progress-sub {
  margin-top: 6px;
  color: var(--soft);
  font-size: 12px;
  font-family: var(--mono);
}

/* --- result step ----------------------------------------------------- */

.module-result {
  border: 1px solid rgba(159, 208, 168, .22);
  border-radius: 18px;
  background: rgba(159, 208, 168, .05);
  padding: 22px;
  display: grid;
  gap: 12px;
}

.module-result h3 { font-size: 18px; letter-spacing: -.03em; }
.module-result p { color: var(--muted); font-size: 14px; }

.module-result-preview {
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(7, 8, 10, .5);
}
.module-result-preview img { width: 100%; height: auto; }

.module-result-text {
  max-height: 260px;
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(7, 8, 10, .55);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.module-result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  color: var(--soft);
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .07em;
}

/* --- error step ------------------------------------------------------ */

.module-error {
  border: 1px solid rgba(255, 127, 127, .26);
  border-radius: 18px;
  background: rgba(255, 127, 127, .06);
  padding: 22px;
  display: grid;
  gap: 10px;
}

.module-error h3 { font-size: 18px; letter-spacing: -.03em; color: var(--danger); }
.module-error p { color: var(--muted); font-size: 14px; }

.module-error-code {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--soft);
  letter-spacing: .07em;
  text-transform: uppercase;
}

/* --- footer / status ------------------------------------------------- */

.module-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  padding: 18px 24px;
  border-top: 1px solid rgba(232, 231, 226, .10);
  background: rgba(255, 255, 255, .012);
}

.module-actions .module-actions-spacer { flex: 1; }

/* aria-live region. Never display:none — a hidden live region announces
   nothing. Empty simply collapses to no text. */
.module-status {
  padding: 0 24px 16px;
  color: var(--soft);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .05em;
  min-height: 0;
}
.module-status:empty { padding-bottom: 0; }


/* ==========================================================================
   11  AUTH STATES — COSMETIC ONLY
   These rules move pixels. They do not grant anything. The relay validates
   the JWT, applies the rate limit and is the one and only gate; a user who
   edits data-auth in devtools sees an unlocked page and still gets 401 on
   every call. Keep it that way: never make a rule here the reason some
   request is or is not sent.
   ========================================================================== */

[data-auth="anon"] [data-auth-show="user"] { display: none !important; }
[data-auth="user"] [data-auth-show="anon"] { display: none !important; }

/* Padlocks on working services while signed out. */
[data-auth="anon"] .service-row[data-status="live"] .service-lock { display: block; }

/* Wallet block: promise -> real balance. */
.wallet-balance {
  display: grid;
  gap: 6px;
}

.wallet-balance-amount {
  font-family: var(--mono);
  font-size: clamp(32px, 5vw, 46px);
  letter-spacing: -.04em;
  color: var(--amber);
  line-height: 1;
}

.wallet-balance-caption {
  color: var(--soft);
  font-size: 12px;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.wallet-ledger-title { margin-top: 22px; }

.wallet-ledger { display: grid; gap: 2px; margin-top: 10px; }

.wallet-ledger-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid rgba(232, 231, 226, .08);
  color: var(--muted);
  font-size: 13px;
}
.wallet-ledger-row strong { color: var(--amber); font-family: var(--mono); }
.wallet-ledger-row .wallet-ledger-debit { color: var(--muted); }

.wallet-ledger-empty {
  padding: 14px 0;
  color: var(--soft);
  font-size: 13px;
}

/* Vision block: read-only mockup -> real editor. */
[data-auth="anon"] .vision-editor { position: relative; }

[data-auth="anon"] .vision-textarea {
  color: var(--muted);
  cursor: default;
}

.vision-mock-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 9px;
}

/* `hidden` DOIT GAGNER DANS L'ÉDITEUR DE VISION — deuxième fois que ce piège se
   présente, première fois qu'il est attrapé AVANT de livrer. `.vision-save`,
   `.vision-toggle` et `.vision-label` posent un `display` explicite ; une règle
   d'auteur bat toujours le `[hidden] { display: none }` de la feuille du
   navigateur. Les commandes marquées `hidden` en attendant leur câblage
   seraient donc restées VISIBLES, exactement comme le bouton « Télécharger »
   du pied de page le 2026-09-27. Spécificité (0,2,0) contre (0,1,0) : aucun
   `!important` nécessaire. */
.vision-editor [hidden] { display: none; }

.vision-save {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.vision-save-status {
  color: var(--soft);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .06em;
}


/* ==========================================================================
   12  HOW IT WORKS — VALUE CARDS
   ========================================================================== */

.value-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.value-card {
  border-radius: 22px;
  padding: 22px;
  background: linear-gradient(180deg, rgba(17, 24, 21, .95), rgba(10, 14, 13, .95));
}

.value-card h3 {
  font-size: 18px;
  margin: 14px 0 8px;
  letter-spacing: -.03em;
}

.value-card p {
  color: var(--muted);
  font-size: 14px;
}

.value-num {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #111214;
  background: linear-gradient(135deg, #c3c7cf, #ddd8cf);
  font-family: var(--mono);
  font-weight: 800;
  font-size: 12px;
}


/* ==========================================================================
   13  VISION
   ========================================================================== */

.vision-wrap {
  margin-top: 28px;
  border-radius: 28px;
  overflow: hidden;
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  background:
    radial-gradient(circle at 12% 20%, rgba(198, 170, 122, .055), transparent 28%),
    linear-gradient(180deg, rgba(18, 19, 22, .98), rgba(10, 11, 13, .98));
}

.vision-copy {
  padding: 38px 34px;
  border-right: 1px solid rgba(232, 231, 226, .12);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.vision-copy h2 {
  font-size: clamp(31px, 4vw, 50px);
  line-height: 1.02;
  letter-spacing: -.055em;
  margin-top: 8px;
  max-width: 560px;
}

.vision-copy > p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
  margin-top: 16px;
  max-width: 560px;
}

.vision-rules {
  margin-top: 24px;
  border-top: 1px solid rgba(232, 231, 226, .10);
}

.vision-rule {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid rgba(232, 231, 226, .075);
  color: var(--muted);
  font-size: 13px;
}

.vision-rule code {
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 11px;
  padding-top: 2px;
}

.vision-editor {
  padding: 26px;
  background: rgba(255, 255, 255, .012);
}

.vision-editor-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(232, 231, 226, .10);
}

.vision-editor-title {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .10em;
  text-transform: uppercase;
  color: var(--soft);
}

.vision-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  cursor: pointer;
  min-height: 34px;
}

.vision-switch {
  width: 34px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid rgba(232, 231, 226, .20);
  background: rgba(232, 231, 226, .12);
  position: relative;
  flex: 0 0 auto;
  transition: background .18s ease;
}

.vision-switch::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  top: 2px;
  right: 2px;
  background: var(--cyan);
  box-shadow: 0 0 12px rgba(216, 210, 199, .18);
  transition: right .18s ease;
}

.vision-toggle[aria-pressed="false"] .vision-switch::after {
  right: calc(100% - 14px);
  background: var(--soft);
  box-shadow: none;
}

.vision-label {
  display: block;
  margin-top: 18px;
  margin-bottom: 9px;
  color: var(--soft);
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .10em;
}

.vision-textarea {
  min-height: 168px;
  width: 100%;
  resize: vertical;
  border-radius: 14px;
  border: 1px solid rgba(232, 231, 226, .12);
  background: rgba(7, 8, 10, .55);
  color: var(--text);
  padding: 16px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.7;
  outline: none;
}

.vision-textarea:focus { border-color: rgba(232, 231, 226, .28); }

/* Le champ du NOM. Une Vision en a besoin — l'API l'exige — et la maquette
   n'en avait aucun : elle ne montrait qu'une seule direction sans nom. */
.vision-nom {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: rgba(255, 255, 255, .02);
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
}
.vision-nom:focus { border-color: rgba(232, 231, 226, .28); outline: none; }

.vision-projects {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.vision-project {
  border: 1px solid rgba(232, 231, 226, .10);
  background: rgba(255, 255, 255, .018);
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 9px;
  font-size: 11px;
  font-family: var(--mono);
  min-height: 34px;
  display: inline-flex;
  align-items: center;
}

.vision-project[aria-pressed="true"] { color: var(--text); border-color: rgba(232, 231, 226, .20); }

button.vision-project { cursor: pointer; }

.vision-propagation {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(232, 231, 226, .10);
  display: grid;
  gap: 8px;
}

.vision-propagation-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.vision-propagation-row span:last-child {
  color: var(--soft);
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .06em;
}


/* ==========================================================================
   14  WALLET / CTA / PRICING
   ========================================================================== */

.big-cta {
  margin-top: 28px;
  border-radius: 28px;
  padding: 34px;
  background:
    radial-gradient(circle at 12% 15%, rgba(140, 255, 106, .09), transparent 25%),
    radial-gradient(circle at 88% 25%, rgba(216, 210, 199, .06), transparent 22%),
    linear-gradient(180deg, rgba(16, 21, 19, .98), rgba(8, 10, 10, .98));
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 24px;
  align-items: start;
}

.big-cta h2 {
  font-size: clamp(30px, 4.5vw, 48px);
  letter-spacing: -.055em;
  line-height: 1.02;
}

.big-cta p {
  color: var(--muted);
  font-size: 15px;
  margin-top: 14px;
  max-width: 620px;
}

.big-cta .hero-actions {
  justify-content: flex-start;
  margin-top: 20px;
}

.pricing-list {
  display: grid;
  gap: 10px;
}

.pricing-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .02);
  color: var(--muted);
  font-size: 14px;
}

.pricing-item strong {
  font-family: var(--mono);
  color: var(--text);
}

.legal-note {
  grid-column: 1 / -1;
  margin-top: 4px;
  color: var(--soft);
  font-size: 12px;
  font-family: var(--mono);
  line-height: 1.6;
}


/* ==========================================================================
   15  FAQ
   ========================================================================== */

.faq-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.faq-card {
  border-radius: 20px;
  padding: 20px;
  background: linear-gradient(180deg, rgba(17, 24, 21, .95), rgba(10, 14, 13, .95));
}

.faq-card h3 {
  font-size: 16px;
  letter-spacing: -.02em;
  margin-bottom: 8px;
}

.faq-card p {
  color: var(--muted);
  font-size: 14px;
}


/* ==========================================================================
   16  FOOTER
   ========================================================================== */

footer {
  padding: 40px 0 50px;
  margin-top: 40px;
}

.footer-box {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding-top: 18px;
  border-top: 1px solid rgba(232, 231, 226, .08);
  color: var(--soft);
  font-size: 13px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.footer-links a:hover { color: var(--text); }


/* ==========================================================================
   17  RESPONSIVE
   One block per breakpoint. The source had three separate
   @media (max-width: 760px) blocks fighting each other; they are merged.
   ========================================================================== */

@media (max-width: 1120px) {
  :root { --page-pad: 24px; }

  .services-shell { grid-template-columns: 210px minmax(0, 1fr); }
  .services-menu { padding-right: 20px; }

  /* Plus de colonnes fixes à rétrécir : les tuiles se réarrangent seules.
     L'ancienne règle demandait 702 px de minimum à un écran qui en a 375. */
}

@media (max-width: 1100px) {
  .big-cta { grid-template-columns: 1fr; }
  .value-grid { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
  .nav-services { display: none; }

  /* minmax(0, 1fr), PAS 1fr. « 1fr » vaut « minmax(auto, 1fr) », et ce
     minimum « auto » est le contenu insécable le plus large de la colonne.
     Les deux enfants — le rail de catégories et la liste — partagent cette
     colonne : les pilules `white-space: nowrap` faisaient 592 px bout à bout
     et étiraient les tuiles à 592 px sur un écran de 492. Mesuré le
     2026-09-23. Le reste de la feuille écrit déjà minmax(0, 1fr) ; cette
     ligne-ci était la seule à l'oublier. */
  .services-shell { grid-template-columns: minmax(0, 1fr); }

  /* Ceinture : un rail qui défile horizontalement ne doit jamais imposer sa
     largeur à la colonne qui le contient. */
  .services-menu { min-width: 0; }
  #serviceFilters { min-width: 0; }

  .services-menu {
    border-right: 0;
    border-bottom: 1px solid rgba(232, 231, 226, .14);
    padding: 12px 0;
    position: sticky;
    top: var(--nav-h);
    z-index: 20;
    background: rgba(13, 14, 16, .94);
    backdrop-filter: blur(18px);
  }

  .services-menu-inner {
    position: static;
    margin: 0 -2px;
    padding: 0 2px 2px;
  }

  .services-menu-title,
  .services-menu-note { display: none; }

  #serviceFilters {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  #serviceFilters::-webkit-scrollbar { display: none; }

  .service-filter {
    width: auto;
    flex: 0 0 auto;
    min-height: 40px;
    white-space: nowrap;
    border: 1px solid rgba(232, 231, 226, .09);
    border-bottom: 1px solid rgba(232, 231, 226, .09);
    padding: 8px 11px;
    border-radius: 999px;
  }
  .service-filter:hover { padding-left: 11px; }
  .service-filter .service-filter-count { display: none; }
  .service-filter[aria-pressed="true"] {
    color: #111214;
    border-color: transparent;
    background: linear-gradient(135deg, #c3c7cf, #ddd8cf);
  }
  .service-filter[aria-pressed="true"] .service-filter-label::before { display: none; }

  /* Les tuiles n'ont plus besoin d'une disposition mobile séparée : la grille
     auto-fill tombe à une colonne d'elle-même, et le pied se replie. Ce bloc
     redéfinissait quatre colonnes et des zones nommées — 162 px de minimum
     rien que pour le numéro, le prix et la flèche. */

  .vision-wrap { grid-template-columns: 1fr; }
  .vision-copy { border-right: 0; border-bottom: 1px solid rgba(232, 231, 226, .12); }
}

@media (max-width: 760px) {
  :root { --page-pad: 16px; --nav-h: 62px; }

  /* nav */
  .nav-inner { gap: 12px; }
  .brand { gap: 9px; }
  .brand-badge { width: 32px; height: 32px; }
  .brand small { display: none; }
  .nav-actions .nav-balance,
  .nav-actions .nav-login,
  .nav-actions .nav-logout { display: none; }
  .nav-toggle { display: grid; }
  .nav-explore { min-height: 38px; padding: 8px 12px; border-radius: 9px; font-size: 13px; }
  /* Two ways in, so the menu works whether the JS agent flips aria-expanded
     on #navToggle (preferred — it is the accessible state) or data-open on
     #navMenu. :has() covers the first since the button and the panel are
     not siblings. */
  nav:has(.nav-toggle[aria-expanded="true"]) .nav-menu,
  .nav-menu[data-open="true"] { display: block; }

  /* hero */
  .hero { padding-top: 28px; }
  .hero-left { padding: 38px 18px 26px; border-radius: 20px; }
  .top-ribbon {
    max-width: 100%;
    font-size: 11px;
    line-height: 1.35;
    padding: 7px 10px;
  }
  h1 { font-size: clamp(40px, 13.2vw, 58px); line-height: .98; letter-spacing: -.06em; }
  .hero-copy { font-size: 15px; line-height: 1.6; }
  .hero-actions { display: grid; grid-template-columns: 1fr; width: 100%; }
  .hero-actions .btn { width: 100%; }
  .hero-note { font-size: 11px; line-height: 1.55; }

  .quick-search { padding: 14px; border-radius: 14px; }
  .quick-search span { display: none; }
  .quick-search input { font-size: 16px; }

  .hero-stats { display: grid; grid-template-columns: 1fr; gap: 8px; }
  .stat-chip { min-width: 0; width: 100%; padding: 12px 14px; border-radius: 13px; }
  .stat-chip strong { font-size: 16px; }

  /* sections */
  #tools { padding-top: 46px; }
  .section-head { flex-direction: column; align-items: start; gap: 12px; margin-bottom: 18px; }
  .section-head h2 { font-size: 30px; }
  .section-head p { font-size: 14px; line-height: 1.6; }

  /* catalog */
  .catalog-toolbar { grid-template-columns: 1fr; gap: 0; }
  .catalog-search { padding: 13px 0 9px; }
  .catalog-search input { font-size: 16px; }
  .catalog-result { padding-bottom: 11px; }

  .services-menu {
    top: var(--nav-h);
    margin-left: calc(var(--page-pad) * -1);
    margin-right: calc(var(--page-pad) * -1);
    padding-left: var(--page-pad);
    padding-right: var(--page-pad);
    border-bottom-color: rgba(232, 231, 226, .11);
  }
  #serviceFilters { gap: 7px; }
  .service-filter { padding: 7px 11px; font-size: 12px; }

  .service-link { padding: 13px; gap: 8px; }
  .service-num { width: 30px; height: 30px; border-radius: 7px; font-size: 11px; }
  .service-name { font-size: 16px; overflow-wrap: anywhere; }
  .service-name small { font-size: 10px; margin-top: 4px; }
  .service-desc { font-size: 13px; line-height: 1.5; padding-right: 4px; overflow-wrap: anywhere; }
  .service-category { font-size: 9px; padding: 5px 7px; margin-top: 5px; }
  .service-state { justify-self: start; margin-top: 5px; }
  .service-price { justify-self: start; align-self: center; margin-top: 2px; font-size: 11px; }
  .service-empty { padding: 28px 0; }

  /* module */
  .module-panel { place-items: stretch; }
  .module-shell {
    width: 100%;
    margin: auto 0 0;
    max-height: 94vh;
    border-radius: 22px 22px 0 0;
    border-bottom: 0;
  }
  .module-head { padding: 18px 18px 14px; }
  .module-title { font-size: 21px; }
  .module-body { padding: 18px; }
  .module-actions { padding: 14px 18px; }
  .module-actions .btn { flex: 1 1 auto; }
  .module-status { padding: 0 18px 14px; }
  .module-row-2 { grid-template-columns: 1fr; }
  .module-dropzone { padding: 26px 16px; }

  /* the rest */
  .value-grid { gap: 10px; }
  .value-card { padding: 18px; border-radius: 18px; }

  .big-cta { padding: 22px 18px; border-radius: 20px; }
  .pricing-list { margin-top: 2px; }
  .pricing-item { padding: 13px 14px; }

  .vision-copy { padding: 26px 20px; }
  .vision-editor { padding: 18px; }

  .faq-grid { grid-template-columns: 1fr; gap: 10px; }
  .faq-card { border-radius: 16px; padding: 18px; }

  .footer-box { flex-direction: column; }
}

@media (max-width: 620px) {
  .vision-wrap { border-radius: 20px; }
  .vision-copy h2 { font-size: 31px; }
  .vision-textarea { min-height: 190px; }
}

@media (max-width: 480px) {
  :root { --page-pad: 12px; }

  .nav-explore { padding-inline: 10px; }
  .hero-left { padding-inline: 15px; }
  .top-ribbon { border-radius: 12px; }
  h1 { font-size: clamp(38px, 13vw, 52px); }
  .section-head h2 { font-size: 28px; }

  .service-price { font-size: 11px; }

  .footer-links { display: grid; grid-template-columns: 1fr 1fr; }
}


/* ==========================================================================
   18  ENVIRONMENT QUERIES
   ========================================================================== */

/* Nothing in this page needs motion to be understood. Honour the setting:
   no transforms, no sliding progress bar, no smooth scroll jump. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }

  .btn:hover,
  .service-link:hover .service-arrow,
  .service-filter:hover { transform: none; }

  .module-progress[data-indeterminate="true"] .module-progress-bar {
    width: 100%;
    animation: none;
    opacity: .35;
  }
}

/* Touch devices: no sticky hover states left behind after a tap. */
@media (hover: none) {
  .btn:hover,
  .service-link:hover,
  .service-filter:hover {
    transform: none;
    padding-left: revert;
    background: inherit;
  }
  .service-link:active { background: rgba(255, 255, 255, .025); }
  .service-link:active .service-arrow { transform: translateX(3px); }
}

@supports (padding: max(0px)) {
  nav .nav-inner {
    padding-left: max(0px, env(safe-area-inset-left));
    padding-right: max(0px, env(safe-area-inset-right));
  }
  footer { padding-bottom: max(50px, env(safe-area-inset-bottom)); }
  .module-shell { padding-bottom: env(safe-area-inset-bottom); }
}

/* ── Wallet: trial + top-up buttons (wallet.js) ─────────────────────────── */
.wallet-note {
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--soft);
  max-width: 52ch;
}
.wallet-topup {
  margin-top: 22px;
}
.wallet-topup .vision-label {
  margin-bottom: 10px;
}
.wallet-topup-amounts {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.wallet-topup-amounts .btn {
  min-width: 88px;
  justify-content: center;
}
[data-wallet][aria-busy="true"] {
  opacity: .6;
  cursor: progress;
}
.wallet-status {
  min-height: 1.5em;
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
}
.wallet-status[data-tone="success"] { color: var(--text); }
.wallet-status[data-tone="error"]   { color: var(--danger); }

/* Which account is signed in — an Outlook account and a Gmail account are two
   different ModulAI accounts, and the page must never leave that ambiguous. */
.nav-account {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.nav-account-mobile { max-width: none; margin: 0 0 4px; }
.wallet-account {
  margin: 0 0 6px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--soft);
}
@media (max-width: 1240px) { .nav-account { max-width: 130px; } }
@media (max-width: 1020px) { .nav-actions .nav-account { display: none; } }

/* ── Mes travaux (works.js) ─────────────────────────────────────────────── */
/* The nav sat on two lines between ~760 and ~1100px: the labels themselves
   wrapped ("Comment ça marche"). Links never wrap now, and the two least
   useful ones step aside before anything else does. */
.nav-services a { white-space: nowrap; }
@media (max-width: 1140px) {
  .nav-services a[data-nav="faq"] { display: none; }
}
@media (max-width: 1020px) {
  .nav-services a[data-nav="how"] { display: none; }
  .nav-services { gap: 2px; }
  .nav-services a { padding: 8px; letter-spacing: .03em; }
}
@media (max-width: 880px) {
  .nav-services a[data-nav="vision"] { display: none; }
}

.works-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  padding: 16px 20px;
  margin-bottom: 18px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .015);
}
.works-summary-item { display: flex; flex-direction: column; gap: 2px; }
.works-summary-value { font-size: 20px; letter-spacing: -.02em; }
.works-summary-label {
  font-family: var(--mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--soft);
}
.works-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.works-search { flex: 1 1 280px; }
.works-card-id { font-family: var(--mono); font-size: 11px; color: var(--soft); }

/* « 3 jours payés · 0,87 $ consommés · 12 jours de solde »
   Délibérément à côté du bouton d'hébergement : c'est la seule chose qui
   empêche quelqu'un de découvrir dans soixante-dix jours qu'il payait pour une
   page qu'il n'a jamais rouverte. */
.works-hosting {
  margin: 6px 0 0;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--soft);
}
.works-hosting[data-etat="arret_demande"],
.works-hosting[data-etat="solde_epuise"],
.works-hosting[data-etat="en_arret"] { color: var(--amber); }
.works-hosting:empty { display: none; }
.works-card-note { margin: 6px 0 0; font-family: var(--mono); font-size: 12px; color: var(--soft); }
.works-more {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--muted);
  background: none;
  border: 0;
  border-bottom: 1px dashed var(--border-strong);
  padding: 2px 0;
  cursor: pointer;
}
.works-more:hover { color: var(--text); }
#travaux { padding: 72px 0; }
.works-badge { margin-left: 4px; color: var(--amber); font-family: var(--mono); font-size: .85em; }
.works-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 24px; }
.works-filter[aria-pressed="true"] { border-color: var(--text); color: var(--text); }
.works-group { margin-bottom: 32px; }
.works-group-title {
  display: flex; align-items: baseline; gap: 12px;
  margin: 0 0 12px;
  font-size: 18px;
}
.works-group-count { font-family: var(--mono); font-size: 12px; color: var(--soft); }
.works-card { padding: 18px 20px; margin-bottom: 12px; }
.works-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.works-card-title { margin: 0; font-size: 16px; overflow-wrap: anywhere; }
.works-card-meta { margin: 6px 0 0; font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.works-status-badge {
  flex-shrink: 0;
  padding: 3px 9px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
}
.works-status-badge[data-tone="ok"]  { color: var(--text); border-color: var(--text); }
.works-status-badge[data-tone="run"] { color: var(--amber); border-color: var(--amber); }
.works-status-badge[data-tone="bad"] { color: var(--danger); border-color: var(--danger); }
.works-progress {
  height: 6px;
  margin-top: 14px;
  border-radius: 3px;
  background: var(--border);
  overflow: hidden;
}
.works-progress-fill {
  height: 100%;
  background: var(--amber);
  transition: width .6s ease;
}
.works-progress-label { margin: 8px 0 0; font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.works-card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.works-price { font-family: var(--mono); font-size: 14px; }
.works-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.works-delete { color: var(--muted); }
.works-delete:hover { color: var(--danger); border-color: var(--danger); }
.works-empty, .works-status { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.works-toast { display: flex; align-items: center; gap: 12px; }
.works-toast[data-visible="true"] { pointer-events: auto; }
.works-toast-action {
  border: 1px solid var(--text); background: none; color: var(--text);
  padding: 4px 10px; font: inherit; cursor: pointer;
}
.module-result-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
@media (prefers-reduced-motion: reduce) { .works-progress-fill { transition: none; } }

/* ── Sample preview — ported from pdf-t app.css:1302-1470, ModulAI colours ─ */
.module-sample { margin-top: 18px; }
.module-sample-note {
  margin: 8px 0 0;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--soft);
}
.module-sample-status {
  min-height: 1.4em;
  margin: 10px 0 0;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--muted);
}
.sample-carousel { display: flex; flex-direction: column; gap: 1rem; margin-top: .75rem; }
.carousel-slide {
  display: grid;
  grid-template-columns: repeat(var(--slide-cols, 2), 1fr);
  gap: 12px;
}
.sample-side { display: flex; flex-direction: column; gap: 6px; }
.sample-label {
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.sample-side-overflow .sample-label { color: var(--amber); }
.overflow-badge {
  display: inline-block;
  margin-left: 5px;
  padding: 1px 6px;
  border-radius: 10px;
  background: var(--amber);
  color: var(--bg);
  font-size: .62rem;
  font-weight: 700;
  vertical-align: middle;
}
.sample-img {
  width: 100%;
  display: block;
  background: #fff;                 /* pages are white paper, even on a dark site */
  border: 1px solid var(--border-strong);
  cursor: zoom-in;
  transition: box-shadow .15s, transform .15s;
  user-select: none;
  -webkit-user-drag: none;
}
.sample-img:hover, .sample-img:focus-visible {
  box-shadow: 0 4px 16px rgba(0, 0, 0, .35);
  transform: translateY(-1px);
}
.carousel-nav { display: flex; align-items: center; justify-content: center; gap: 1rem; }
.carousel-btn {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--panel);
  color: var(--text);
  font-size: 1.3rem; line-height: 1;
  cursor: pointer;
}
.carousel-btn:hover { border-color: var(--text); }
.carousel-indicator {
  min-width: 40px;
  text-align: center;
  font-family: var(--mono);
  font-size: .82rem;
  color: var(--muted);
}
dialog.lightbox {
  width: 100vw; max-width: 100vw;
  height: 100vh; max-height: 100vh;
  margin: 0; padding: 0;
  border: 0;
  background: rgba(0, 0, 0, .9);
}
dialog.lightbox[open] { display: flex; align-items: center; justify-content: center; }
dialog.lightbox::backdrop { background: rgba(0, 0, 0, .6); }
.lb-img {
  max-width: min(900px, 88vw);
  max-height: 86vh;
  object-fit: contain;
  background: #fff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}
.lb-close {
  position: absolute; top: 16px; right: 20px;
  border: 0; background: none;
  color: rgba(255, 255, 255, .8);
  font-size: 2.2rem; line-height: 1;
  cursor: pointer;
}
.lb-label {
  position: absolute; bottom: 20px; left: 50%;
  transform: translateX(-50%);
  margin: 0;
  color: rgba(255, 255, 255, .6);
  font-family: var(--mono);
  font-size: .82rem;
  white-space: nowrap;
}
.lb-arrow {
  position: absolute; top: 50%;
  transform: translateY(-50%);
  width: 52px; height: 80px;
  display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 6px;
  background: rgba(255, 255, 255, .08);
  color: rgba(255, 255, 255, .85);
  font-size: 2.5rem;
  cursor: pointer;
}
.lb-arrow:hover { background: rgba(255, 255, 255, .18); }
.lb-prev { left: 12px; }
.lb-next { right: 12px; }
@media (max-width: 680px) {
  .carousel-slide { --slide-cols: 2; }
  .sample-side-overflow { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
  .lb-arrow { display: none; }
  .carousel-slide { grid-template-columns: 1fr; }
  .sample-side-overflow { grid-column: auto; }
}

/* ── Pre-sign-in dialog ─────────────────────────────────────────────────────
   Built by auth.js (<dialog>, showModal). Reuses .frame, .kicker and .btn. */
.auth-dialog {
  width: min(calc(100% - 32px), 480px);
  padding: 28px 28px 24px;
  border: 1px solid var(--border-strong);
  background: var(--panel-2);
  color: var(--text);
  box-shadow: var(--shadow);
}
.auth-dialog::backdrop {
  background: rgba(8, 9, 10, 0.72);
  backdrop-filter: blur(4px);
}
.auth-dialog h2 {
  margin: 6px 0 14px;
  font-size: 22px;
  letter-spacing: -0.02em;
}
.auth-dialog p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.55;
}
.auth-dialog .auth-dialog-hint {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--soft);
}
.auth-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}
@media (max-width: 480px) {
  .auth-dialog-actions .btn { flex: 1 1 100%; }
}

/* ── Auth notice ───────────────────────────────────────────────────────────
   Created on demand by auth.js for the few honest "not yet" / "that failed"
   answers to a sign-in click. role=status + aria-live=polite: announced, never
   stealing focus. */
.auth-notice {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 200;
  max-width: min(calc(100% - 32px), 520px);
  padding: 12px 16px;
  border: 1px solid var(--border-strong);
  background: var(--panel-2);
  color: var(--text);
  box-shadow: var(--shadow);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.45;
  transform: translate(-50%, 12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.auth-notice[data-visible="true"] {
  opacity: 1;
  transform: translate(-50%, 0);
}
@media (prefers-reduced-motion: reduce) {
  .auth-notice { transition: none; }
}

@media print {
  nav, .module-panel, .catalog-toolbar, .services-menu, footer { display: none !important; }
  body { background: #fff; color: #000; }
}

/* ===========================================================================
   Le studio — une seule colonne.

   La version à deux colonnes volait la moitié de la largeur au fil pour
   afficher une liste de colonnes qu'on lit une fois. Le fichier est devenu un
   bandeau repliable en haut, le fil prend toute la place, et le résultat
   arrive tout en bas — c'est la fin du parcours, pas un panneau permanent.
   ======================================================================== */

.module-panel[data-studio] .module-shell { width: min(100%, 980px); }
.module-panel[data-studio="on"][data-state="input"] .module-step[data-step="input"] { display: none; }
.module-panel[data-studio="on"][data-state="input"] .module-step[data-step="studio"] { display: block; }

/* Le pied du module appartient au formulaire. Le studio a ses propres actions. */
.module-panel[data-studio="on"] .module-actions { display: none; }
.module-panel[data-studio="on"] .module-body { padding-top: 12px; }

.studio { display: flex; flex-direction: column; gap: 12px; font-size: .94rem; }

/* ── Le fichier, en bandeau ──────────────────────────────────────────────── */

.studio-file {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, .02);
}

.studio-file[hidden] { display: none; }

.studio-file-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 13px;
  cursor: pointer;
  list-style: none;
  font-size: .88rem;
}

.studio-file-summary::-webkit-details-marker { display: none; }
.studio-file-line { font-weight: 600; word-break: break-word; }

.studio-file-more {
  color: var(--muted);
  font-size: .8rem;
  white-space: nowrap;
}

.studio-file[open] .studio-file-more::after { content: " ▲"; }
.studio-file:not([open]) .studio-file-more::after { content: " ▼"; }

.studio-file-body { padding: 0 13px 13px; border-top: 1px solid var(--border); }

.studio-columns {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr));
  gap: 2px 18px;
}

.studio-columns li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: .82rem;
  padding: 3px 0;
  border-bottom: 1px solid var(--border);
}

.studio-col-type { color: var(--muted); white-space: nowrap; }
.studio-swap { margin-top: 12px; }

/* Le nom du fichier au-dessus de SES colonnes. N'apparaît qu'à partir de deux
   fichiers : avec un seul, le bandeau le dit déjà et le répéter est du bruit. */
.studio-fichier-nom {
  margin: 14px 0 0;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--soft);
}
.studio-fichier-nom:first-child { margin-top: 10px; }

.studio-dropzone[hidden] { display: none; }
.studio-dropzone.is-over { border-color: var(--border-strong); background: rgba(216, 210, 199, .06); }

/* ── Le fil, qui prend toute la largeur ──────────────────────────────────── */

.studio-messages {
  flex: 1;
  min-height: 300px;
  max-height: min(58vh, 620px);
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 6px;
}

.studio-msg {
  border-radius: 12px;
  padding: 9px 13px;
  border: 1px solid var(--border);
  max-width: 88%;
}

.studio-msg-assistant { background: rgba(255, 255, 255, .03); }

.studio-msg-user {
  align-self: flex-end;
  background: rgba(216, 210, 199, .08);
  border-color: var(--border-strong);
}

.studio-msg-title {
  margin: 0 0 4px;
  font-size: .7rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}

.studio-line { margin: 0 0 4px; line-height: 1.5; font-size: .92rem; }
.studio-line:last-child { margin-bottom: 0; }

.studio-thinking { opacity: .72; }
.studio-thinking .studio-line::after {
  content: '…';
  animation: studio-pulse 1.4s ease-in-out infinite;
}
@keyframes studio-pulse { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .studio-thinking .studio-line::after { animation: none; }
}

.studio-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* ── La saisie ───────────────────────────────────────────────────────────── */

.studio-compose { border-top: 1px solid var(--border); padding-top: 12px; }
.studio-input { width: 100%; resize: vertical; min-height: 48px; font-size: .92rem; }

.studio-compose-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}

.studio-budget { font-size: .78rem; color: var(--muted); }

/* ── Le résultat, tout en bas ────────────────────────────────────────────── */

.studio-result {
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 14px;
  background: rgba(255, 255, 255, .03);
}

.studio-result[hidden] { display: none; }
.studio-result h4 { margin: 12px 0 5px; font-size: .84rem; }
.studio-muted { color: var(--muted); font-size: .86rem; margin: 0 0 8px; }
.studio-hint { color: var(--muted); font-size: .8rem; line-height: 1.5; margin: 8px 0 0; }
.studio-steps { margin: 0; padding-left: 18px; font-size: .82rem; line-height: 1.55; color: var(--muted); }
/* Les deux actions du résultat. « Visualiser en ligne » d'abord, et il prend
   toute la largeur sur téléphone : c'est l'action qu'on recommande, et le .zip
   demande un ordinateur de toute façon. */
.studio-actions-resultat { margin-top: 4px; }
.studio-actions-resultat .btn { flex: 1 1 auto; }

/* L'attente de la mise en ligne. La barre lit le TEMPS ÉCOULÉ, pas un
   avancement réel — on ne le connaît pas. Elle est bornée à 92 % : une barre
   qui atteint le bout et s'arrête dit « c'est fini » quand ça ne l'est pas. */
.studio-attente { margin-top: 12px; }

.studio-attente-piste {
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  overflow: hidden;
}
.studio-attente-piste > span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--cyan, var(--text));
  transition: width .5s linear;
}

/* Le prix, sous les boutons, avant le clic qui débite. */
.studio-tarif:empty { display: none; }
.studio-tarif { margin-top: 10px; }

@media (max-width: 480px) {
  .studio-actions-resultat { flex-direction: column; }
  .studio-actions-resultat .btn { width: 100%; }
}

@media (max-width: 700px) {
  .studio-messages { max-height: none; }
  .studio-columns { grid-template-columns: 1fr; }
}

/* ===========================================================================
   « Mes travaux » en tuiles, replié par défaut.

   La liste empilait des cartes pleine largeur : trente travaux faisaient une
   page interminable qu'on parcourait au doigt. Une grille de tuiles en met
   quatre par rangée sur un écran large et une seule sur un téléphone, sans
   qu'on ait à écrire les deux cas.
   ======================================================================== */

.works-toggle {
  display: block;
  width: 100%;
  margin: 14px 0 0;
  padding: 11px 14px;
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  background: none;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: .04em;
  cursor: pointer;
  transition: color .18s ease, border-color .18s ease;
}

.works-toggle:hover { color: var(--text); border-color: var(--border-strong); }
.works-toggle[hidden] { display: none; }

.works-list[hidden] { display: none; }

.works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 12px;
  margin-top: 10px;
}

/* La carte devient une tuile : plus compacte, et elle occupe toute la hauteur
   de sa cellule pour que les pieds d'une rangée s'alignent. */
.works-card {
  padding: 13px 14px;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.works-card-title { font-size: 14.5px; line-height: 1.25; }
.works-card-meta { font-size: 11.5px; margin: 0; }
.works-card-note { font-size: 11.5px; }
.works-card-id { font-size: 10px; margin-top: auto; padding-top: 6px; }

.works-card-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.works-actions { display: flex; flex-wrap: wrap; gap: 6px; }

/* Les boutons d'une tuile tiennent sur deux lignes au plus. */
.works-actions .btn {
  padding: 6px 10px;
  font-size: 11.5px;
  min-height: 0;
}

.works-price { font-size: 11.5px; }

@media (max-width: 700px) {
  .works-grid { grid-template-columns: 1fr; }
}


/* ===========================================================================
   Aucun défilement horizontal, nulle part.

   Les causes ont été corrigées une à une — la grille des services à sept
   colonnes valait 770 px de minimum, celle de secours 702 px, et il y avait
   un overflow-x: auto pour rendre le reste atteignable. Ce bloc est la
   ceinture : une chaîne insécable (un courriel, une URL, un identifiant de
   travail) suffit à rouvrir le problème, et personne ne le remarque avant
   qu'un usager le signale depuis son téléphone.
   ======================================================================== */

html, body { max-width: 100%; overflow-x: hidden; }

/* Les conteneurs de grille refusent de passer sous la taille de leur contenu
   si on ne le leur dit pas. C'est LA cause d'à peu près tous les débordements
   en CSS moderne. */
.container, .nav-inner, main, section { min-width: 0; }

/* Ce qui ne se coupe pas naturellement : adresses, identifiants, noms de
   fichiers déposés par l'usager. */
.nav-account,
.works-card-id,
.works-card-title,
.studio-filename,
.studio-file-line,
.service-name { overflow-wrap: anywhere; }

/* ===========================================================================
   Téléphone : une seule colonne de tuiles, et des champs qui ne poussent pas.

   Signalé le 2026-09-23 : deux colonnes de services sur téléphone, la seconde
   coupée — et comme on ne peut plus défiler latéralement, elle était devenue
   inatteignable. Masquer le débordement sans corriger la largeur avait
   transformé un défaut visible en défaut invisible.

   Deux causes. La grille auto-fill calculait sur un conteneur plus large que
   l'écran, et un <input> porte une largeur minimale intrinsèque d'environ
   vingt caractères qui pousse son parent — le classique, et la raison pour
   laquelle le conteneur était trop large.
   ======================================================================== */

/* Aucun champ ne doit imposer sa largeur à la page. */
input, select, textarea { min-width: 0; max-width: 100%; }

@media (max-width: 980px) {
  /* Une colonne, dite explicitement plutôt que déduite d'un calcul de largeur
     qui s'est déjà trompé deux fois. Le seuil est celui où la barre latérale
     des catégories s'empile : en dessous, la zone utile est trop étroite pour
     deux tuiles, et un téléphone en PAYSAGE fait 844 px — pile dans la plage
     où l'ancien seuil de 720 px ne s'appliquait pas. */
  #serviceList,
  .works-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {

  /* Un libellé court : celui du bureau ne tient pas et se coupe en plein mot. */
  .catalog-search input::placeholder { font-size: 13px; }
}

/* ===========================================================================
   Studio : la zone de saisie reste atteignable.

   Signalé le 2026-09-23 : « j'ai eu de la misère à scroller pour aller le
   chercher ». Le fil peut faire 620 px, et avec le bandeau du fichier et la
   zone de dépôt au-dessus, le bouton finissait sous la ligne de flottaison
   sur un téléphone.

   La saisie est maintenant collée au bas du panneau : elle ne bouge plus quand
   le fil s'allonge, ce qui est le comportement qu'on attend d'une conversation.
   ======================================================================== */

/* « Vos fichiers ne sont pas conservés »
   Discret : une ligne sous la zone de dépôt, le détail à un clic. Là où la
   question se pose vraiment — pas dans une page de politique que personne
   n'ouvre, et sans occuper la moitié du panneau. */
/* « — optionnel », à côté du titre de la zone de dépôt. C'est le seul
   endroit du panneau où l'on dit que le fichier n'est pas obligatoire ; la
   question elle-même est posée par l'assistant, dans le fil. */
.studio-optionnel {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 400;
  letter-spacing: .02em;
}

.studio-privacy { margin: 8px 0 0; }

.studio-privacy > summary {
  cursor: pointer;
  list-style: none;
  color: var(--soft);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .02em;
}
.studio-privacy > summary::-webkit-details-marker { display: none; }
.studio-privacy > summary::before { content: "// "; opacity: .6; }
.studio-privacy > summary::after { content: " ▾"; opacity: .5; }
.studio-privacy[open] > summary::after { content: " ▴"; }
.studio-privacy > summary:hover { color: var(--text); }

.studio-privacy p {
  margin: 6px 0 0;
  padding-left: 14px;
  border-left: 1px solid rgba(232, 231, 226, .12);
  color: var(--soft);
  font-size: 12px;
  line-height: 1.55;
}
.studio-privacy strong { color: var(--text); font-weight: 600; }

.studio-compose {
  position: sticky;
  bottom: 0;
  z-index: 2;
  /* Le fil défile DERRIÈRE : sans fond opaque, les messages transparaissent
     sous le champ. */
  background: linear-gradient(180deg, rgba(13, 14, 16, .86), rgba(13, 14, 16, .99) 28%);
  backdrop-filter: blur(6px);
  padding-bottom: 4px;
}

@media (max-width: 720px) {
  /* Le fil prend ce qui reste, plutôt qu'une hauteur fixe qui repousse la
     saisie hors de l'écran. */
  .studio-messages { max-height: 46vh; min-height: 180px; }
  .studio-compose-actions { gap: 8px; }
  .studio-compose-actions .btn { flex: 0 0 auto; }
}


/* Dernière ceinture sur le catalogue : quoi qu'un enfant demande, la liste ne
   dépasse pas son parent. Sans quoi la grille auto-fill calcule ses colonnes
   sur une largeur imaginaire et en place deux là où une seule tient. */
.services-list, #serviceList, .works-list, .works-grid { max-width: 100%; }

/* ===========================================================================
   Tuiles denses.

   Signalé le 2026-09-23 : « ils sont quand même trop longs, il faudrait qu'ils
   soient plus petits pour être capable de les fitter sur un écran ». Le
   problème n'était pas la largeur mais la HAUTEUR — une tuile faisait environ
   170 px, donc trois par écran de téléphone.

   Chaque ligne retirée compte plus qu'un ajustement de marge : la description
   passe de trois lignes à deux, le sous-titre du nom repasse sur la même ligne,
   et les espacements se resserrent. Environ 110 px, soit une tuile de plus par
   écran et demi.
   ======================================================================== */

.service-link { gap: 7px; padding: 12px 13px; }

.service-name { font-size: 15px; line-height: 1.2; }

/* Le « PDF → PDF » sous le nom valait une ligne entière pour trois mots. */
.service-name small {
  display: inline;
  margin-top: 0;
  margin-left: 7px;
  font-size: 10px;
  white-space: nowrap;
}

.service-desc {
  font-size: 12px;
  line-height: 1.45;
  -webkit-line-clamp: 2;
}

.service-foot { gap: 6px; }

.service-category { padding: 4px 7px; font-size: 10px; }

.service-num { width: 30px; height: 30px; font-size: 11px; }

/* Même traitement pour « Mes travaux » : mêmes tuiles, même densité. */
.works-card { padding: 11px 12px; gap: 5px; }
.works-card-title { font-size: 13.5px; }
.works-card-meta, .works-card-note { font-size: 11px; }
.works-card-id { font-size: 9.5px; padding-top: 4px; }
.works-actions .btn { padding: 5px 9px; font-size: 11px; }

@media (max-width: 560px) {
  /* ======================================================================
     Téléphone : la tuile passe de trois rangées à deux.

     Mesuré le 2026-09-23 sur un écran de 480 px : 131 px par tuile, soit
     nom 30 + description 33 + pied 32 + 22 de padding + 12 de gouttières.
     Trois tuiles par écran. Signalé trois fois comme « trop long ».

     La description est le plus gros bloc et celui qui sert le moins ici : on
     choisit un service par son nom, son prix et son état, et le détail est à
     un toucher. La catégorie part avec elle — le rail de filtres juste
     au-dessus dit déjà dans laquelle on se trouve.

     Le pied remonte sous le nom, dans la colonne 2, plutôt que de traverser
     toute la tuile. Environ 71 px : neuf tuiles par écran au lieu de trois.

     Pour revenir en arrière, il suffit de retirer les deux `display: none`.
     ====================================================================== */

  .service-desc { display: none; }
  .service-category { display: none; }

  .service-link { padding: 10px 12px; gap: 5px; }
  .service-foot { grid-row: 2; grid-column: 2; gap: 7px; }

  .service-num { width: 26px; height: 26px; font-size: 10.5px; border-radius: 7px; }

  .service-name { font-size: 14.5px; }
  .service-name small { font-size: 9.5px; margin-left: 6px; }

  .service-price { font-size: 11px; }
  .service-badge { font-size: 9.5px; padding: 3px 7px; line-height: 1.3; }
  .service-state { gap: 6px; }

  .works-card { padding: 9px 11px; gap: 4px; }
}

/* ===========================================================================
   LES SANDBOXES
   ---------------------------------------------------------------------------
   Une différence de fond avec les tableaux de bord gouverne cet affichage :
   une sandbox NE S'ENDORT PAS TOUTE SEULE. Un agent peut travailler des heures
   sans trafic HTTP, donc l'arrêt automatique le tuerait — c'est l'usager qui
   met en veille, et tant qu'il ne le fait pas, ça coûte.

   Une sandbox oubliée coûte vingt fois plus qu'un tableau de bord oublié. La
   consommation n'est donc pas repliée derrière un détail : elle est écrite sur
   chaque carte, sous le titre, avant les boutons.
   ======================================================================== */

.sandbox-shell { margin-top: 18px; }

.sandbox-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* Le tarif est visible AVANT le clic qui engage, et il vient du serveur. */
.sandbox-tarif {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .01em;
}

.sandbox-empty {
  margin: 16px 0 0;
  color: var(--soft);
  font-size: .9rem;
  line-height: 1.6;
  max-width: 60ch;
}
.sandbox-empty[hidden] { display: none; }

.sandbox-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 12px;
  margin-top: 16px;
}

.sandbox-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  background: var(--panel, transparent);
}

/* L'état se lit à la bordure avant même d'avoir lu le texte. */
.sandbox-card[data-etat="actif"] { border-color: var(--cyan, var(--border-strong)); }
.sandbox-card[data-etat="solde_epuise"] { border-color: var(--danger, var(--border-strong)); }

.sandbox-head h4 { margin: 0; font-size: .98rem; }

.sandbox-conso {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.55;
}
/* En marche, la consommation monte — et elle doit se remarquer. */
.sandbox-conso[data-etat="actif"] { color: var(--soft); }
.sandbox-conso[data-etat="solde_epuise"] { color: var(--danger, var(--soft)); }

.sandbox-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

/* Discret : il détruit le disque, il ne doit pas inviter au clic. */
.sandbox-delete { color: var(--muted); }
.sandbox-delete:hover { color: var(--danger, var(--text)); }

/* ── Le terminal, encadré ──────────────────────────────────────────────────
   Plein écran : un terminal dans une vignette est inutilisable, et c'est le
   seul endroit d'où l'on accède à la sandbox — jamais l'adresse brute. */
.sandbox-frame {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  background: var(--bg, #0d0e10);
}
.sandbox-frame[hidden] { display: none; }

.sandbox-frame-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--soft);
}

.sandbox-frame iframe {
  flex: 1 1 auto;
  width: 100%;
  border: 0;
  background: #000;
}

/* ── La zone de dépôt du terminal ──────────────────────────────────────────
   Dans la barre du cadre, pas dans l'iframe : celle-ci affiche la page de
   ttyd, dont nous ne contrôlons pas le DOM. */
.sandbox-depot {
  margin-left: auto;
  margin-right: .75rem;
  padding: .3rem .7rem;
  border: 1px dashed rgba(232, 231, 226, .35);
  border-radius: 8px;
  font-size: .8rem;
  color: rgba(232, 231, 226, .7);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 22rem;
}
.sandbox-depot:hover,
.sandbox-depot.is-survol {
  border-color: rgba(232, 231, 226, .8);
  border-style: solid;
  color: #e8e7e2;
}
@media (max-width: 560px) {
  .sandbox-depot { max-width: 9rem; }
}

/* =============================================================================
   LE SANDBOX STUDIO
   Vue plein écran : panneau gauche, scène à droite, et le compteur de dépense
   en haut — qui n'est pas décoratif. Le studio supprime la friction qui masque
   la dépense, donc ce chiffre est le garde-fou de la page.

   MOBILE D'ABORD, comme partout ici : sous 900 px la scène passe SOUS le
   panneau, et rien ne déborde horizontalement. Une grille à deux colonnes
   figées donnerait un défilement latéral sur téléphone, ce que ce produit
   n'accepte nulle part.
   ========================================================================== */

.sbx-studio {
  position: fixed;
  inset: 0;
  z-index: 130;                     /* au-dessus du panneau de module (120) */
  display: flex;
  flex-direction: column;
  /* UNE COULEUR PLEINE SOUS LES DÉGRADÉS, et ce n'est pas de la ceinture et
     bretelles. Les deux dégradés s'arrêtaient à `.99` d'opacité, sans flou : un
     pour cent de la page d'accueil transparaissait derrière — assez pour lire
     « L'IA utile. Sans la complexité. » en fantôme sous un terminal. Vu sur une
     capture, jamais en regardant le code.

     `.module-panel` s'en tire avec `.72` PARCE QU'il a un `backdrop-filter:
     blur(6px)` : translucide ET flou, c'est un effet. Presque opaque et net,
     c'est un défaut. Et un espace de travail n'a rien à gagner à laisser voir du
     texte de vitrine derrière un terminal. */
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 85% 0%, rgba(216, 210, 199, .04), transparent 35%),
    linear-gradient(180deg, rgba(16, 17, 20, .99), rgba(9, 10, 12, .99));
}

.sbx-studio[hidden] { display: none; }

/* Pas de défilement de la page derrière le studio ouvert. */
body.sbx-studio-ouvert { overflow: hidden; }

.sbx-studio-head {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px var(--page-pad);
  border-bottom: 1px solid var(--border-strong);
}

.sbx-studio-head-titre h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: .01em;
}

/* LE CHIFFRE. Assez gros pour se lire sans le chercher — c'est la seule raison
   pour laquelle cette page peut exister sans être un piège. En chasse fixe
   parce qu'il change toutes les quinze secondes : en proportionnelle, la ligne
   entière tremble à chaque mise à jour. */
.sbx-studio-depense {
  margin: 6px 0 0;
  font-family: var(--mono);
  font-size: 15px;
  color: var(--cyan);
  font-variant-numeric: tabular-nums;
}

.sbx-studio-detail {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--soft);
  font-variant-numeric: tabular-nums;
}

.sbx-studio-body {
  flex: 1 1 auto;
  min-height: 0;                    /* sinon les enfants ne défilent pas */
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  overflow: hidden;
}

.sbx-studio-panneau {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px var(--page-pad);
  overflow-y: auto;
  overscroll-behavior: contain;
  border-bottom: 1px solid var(--border);
}

.sbx-studio-liste {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sbx-studio-vide {
  margin: 0;
  font-size: 13px;
  color: var(--soft);
}

.sbx-carte {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  padding: 10px 12px;
}

/* La bordure dit l'état d'un coup d'œil, sans lire. Même code couleur que les
   tuiles de la section ordinaire — deux conventions différentes pour les mêmes
   états seraient pires que pas de couleur du tout. */
.sbx-carte[data-etat="actif"]        { border-color: var(--cyan); }
.sbx-carte[data-etat="solde_epuise"] { border-color: var(--danger); }
.sbx-carte[data-etat="en_veille"]    { border-color: var(--border-strong); }

.sbx-carte-titre {
  margin: 0;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
}

.sbx-carte-etat {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
}

/* LE COÛT PAR SANDBOX. Le total en haut dit combien on brûle ; cette ligne dit
   LAQUELLE brûle — sans elle, on ne sait pas quoi mettre en veille. */
.sbx-carte-cout {
  margin: 4px 0 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--amber);
  font-variant-numeric: tabular-nums;
}

.sbx-carte-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.sbx-carte-actions .btn {
  font-size: 12px;
  padding: 5px 10px;
}

/* LA SCÈNE. Centrée quand elle ne porte qu'un message, mais ÉTIRÉE dès qu'un
   terminal s'y trouve — `place-items: center` sur un terminal le réduirait à sa
   hauteur naturelle, soit presque rien, et on verrait une bande noire au milieu
   du vide. D'où `:has()` plutôt qu'une classe posée en JavaScript : l'état est
   déjà dans le DOM, le dupliquer dans une classe c'est deux vérités à garder
   d'accord. */
.sbx-studio-scene {
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 24px var(--page-pad);
  overflow: auto;
}

/* DÈS QU'IL Y A UNE GRILLE, la scène devient une COLONNE : la barre d'outils en
   haut, la grille qui prend le reste. `place-items: center` conviendrait à un
   message seul, mais il écraserait la grille à sa hauteur naturelle — soit
   presque rien — et on verrait une bande au milieu du vide.

   `:has()` plutôt qu'une classe posée en JavaScript : l'état est déjà dans le
   DOM, le dupliquer dans une classe c'est deux vérités à garder d'accord. */
.sbx-studio-scene:has(.sbx-grille) {
  display: flex;
  flex-direction: column;
  place-items: stretch;
  padding: 12px;
  overflow: hidden;
}

.sbx-terminal {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}

.sbx-terminal-barre {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 12px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

.sbx-terminal-nom {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--soft);
}

.sbx-terminal iframe {
  flex: 1 1 auto;
  min-height: 320px;
  width: 100%;
  border: 0;
  background: #000;
}

.sbx-scene-vide {
  margin: 0;
  max-width: 34ch;
  text-align: center;
  font-size: 13px;
  color: var(--soft);
}

@media (min-width: 900px) {
  .sbx-studio-body {
    grid-template-columns: minmax(240px, 300px) 1fr;
  }

  .sbx-studio-panneau {
    border-bottom: 0;
    border-right: 1px solid var(--border);
  }
}

/* Les métriques Fly d'une sandbox, dans sa carte du studio.
   Une grille à deux colonnes : le nom à gauche, la valeur à droite en chasse
   fixe et en chiffres tabulaires — sans quoi la colonne tremble à chaque relevé,
   toutes les quinze secondes. */
.sbx-carte-metriques {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  display: grid;
  gap: 2px;
}

.sbx-metrique {
  margin: 0;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
}

.sbx-metrique-nom { color: var(--soft); }

.sbx-metrique-val {
  font-family: var(--mono);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* Les sparklines des 24 dernières heures, sous les métriques d'une carte.
   Tracées en SVG à la main : la CSP dit `script-src 'self'`, donc aucune
   bibliothèque externe ne se charge — et c'est ce qui garantit qu'une page de
   ModulAI n'exécute que notre code. */
.sbx-carte-courbes {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  display: grid;
  gap: 4px;
}

.sbx-courbe {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  color: var(--soft);
}

/* Largeur fixe pour les deux étiquettes : sans elle, les courbes ne s'alignent
   pas verticalement et l'œil ne peut plus les comparer. */
.sbx-courbe-nom { flex: 0 0 52px; }

/* LE PIC, aligné à droite et en largeur fixe : c'est une colonne de nombres
   qu'on compare d'une ligne à l'autre. Sans largeur fixe, les courbes se
   décalent selon la longueur du chiffre et l'œil ne peut plus les superposer. */
.sbx-courbe-pic {
  flex: 0 0 62px;
  text-align: right;
  font-family: var(--mono);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* LE RÉSUMÉ DU BLOC REPLIABLE. Il porte les PICS quand il est fermé, donc il
   doit rester lisible et cliquable sur toute sa largeur — pas seulement sur le
   petit triangle. */
.sbx-courbes-titre {
  margin: 0;
  padding: 2px 0;
  font-size: 10px;
  color: var(--soft);
  cursor: pointer;
  list-style: none;          /* le marqueur par défaut de Safari */
  font-variant-numeric: tabular-nums;
}

.sbx-courbes-titre::-webkit-details-marker { display: none; }

/* Notre propre chevron : celui du navigateur ne suit pas la couleur du thème et
   saute d'une plateforme à l'autre. */
.sbx-courbes-titre::before {
  content: '▸';
  display: inline-block;
  width: 10px;
  color: var(--muted);
  transition: transform .12s ease;
}

.sbx-carte-courbes[open] > .sbx-courbes-titre::before { transform: rotate(90deg); }

.sbx-courbes-titre:hover { color: var(--muted); }

.sbx-spark {
  flex: 1 1 auto;
  /* `min-width: 0` sinon le SVG refuse de se réduire dans un conteneur flex et
     déborde — c'est ce qui donnerait un défilement horizontal sur téléphone. */
  min-width: 0;
  height: 28px;
  display: block;
  overflow: visible;
}

/* =============================================================================
   LA GRILLE DE TERMINAUX DU STUDIO

   LA CONTRAINTE QUI DÉCIDE DE TOUT : déplacer un iframe dans le DOM le RECHARGE.
   La grille ne réordonne donc jamais ses enfants en JavaScript — elle écrit des
   `order`. C'est pour ça que tout le réagencement est ici, en CSS, et pas dans le
   script.
   ========================================================================== */

.sbx-outils {
  flex: 0 0 auto;
  display: flex;
  gap: 6px;
  padding: 0 0 8px;
}

.sbx-outil {
  font-size: 11px;
  padding: 4px 10px;
  min-width: 34px;
}

.sbx-outil.est-actif {
  border-color: var(--cyan);
  color: var(--text);
}

.sbx-grille {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  gap: 8px;
  /* Une seule case par défaut. Les dispositions ci-dessous redéfinissent. */
  grid-template-columns: 1fr;
  grid-auto-rows: 1fr;
}

/* MOBILE D'ABORD : sous 900 px, tout s'empile, quelle que soit la disposition
   choisie. Deux terminaux côte à côte sur un téléphone ne sont lisibles ni l'un
   ni l'autre — et la règle du produit est qu'il n'y a JAMAIS de défilement
   horizontal. */
@media (min-width: 900px) {
  .sbx-grille[data-disposition="2h"] { grid-template-columns: 1fr 1fr; }
  .sbx-grille[data-disposition="4"]  { grid-template-columns: 1fr 1fr; }
}

/* Le cadrage : la case agrandie prend toute la grille. Les autres sont déjà
   `hidden` côté script — ici on s'assure qu'aucune colonne ne reste réservée. */
.sbx-grille[data-focus="oui"] { grid-template-columns: 1fr !important; }

.sbx-terminal-bouton {
  font-size: 11px;
  padding: 3px 8px;
}

/* LA BARRE EST LA POIGNÉE. On ne glisse jamais l'iframe : il avale les
   événements de pointeur. `cursor: grab` le dit sans texte. */
.sbx-terminal-barre { cursor: grab; }
.sbx-terminal-barre:active { cursor: grabbing; }

/* PENDANT LE GLISSEMENT, LES IFRAMES DEVIENNENT TRANSPARENTS AU POINTEUR. Sans
   ça, survoler la case VOISINE ne serait pas détecté — et c'est justement
   l'information dont on a besoin pour savoir où lâcher. */
body.sbx-glisse .sbx-terminal iframe { pointer-events: none; }

.sbx-terminal.est-cible { outline: 2px dashed var(--cyan); outline-offset: -2px; }

.sbx-terminal.est-focalisee { grid-column: 1 / -1; }

.sbx-case-vide,
.sbx-scene-statut {
  margin: 0;
  align-self: center;
  justify-self: center;
  max-width: 34ch;
  text-align: center;
  font-size: 13px;
  color: var(--soft);
}

.sbx-scene-statut { color: var(--amber); }

/* Le parc, en troisième ligne de l'en-tête du studio. Plus discret que les deux
   lignes d'argent au-dessus : c'est de l'information, pas le garde-fou. */
.sbx-studio-parc {
  margin: 2px 0 0;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Le sélecteur de fenêtre des courbes — visible seulement quand le bloc est
   déplié, parce que le résumé porte déjà les pics quand il est fermé. */
.sbx-fenetres {
  display: flex;
  gap: 4px;
  margin: 4px 0 6px;
}

.sbx-fenetre {
  font-size: 10px;
  padding: 2px 8px;
}

.sbx-fenetre.est-actif {
  border-color: var(--cyan);
  color: var(--text);
}

/* =============================================================================
   LE BADGE ÉDITORIAL ET LE BOUTON D'ACTION D'UNE TUILE

   Deux ajouts au catalogue, et ils ne servent pas la même chose : le badge MET EN
   AVANT (déclaré dans services.json, jamais calculé — on n'a aucune donnée
   d'usage), le bouton REMPLACE le lien pour un service qui n'est pas un travail.
   ========================================================================== */

.service-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--amber);
  /* `vertical-align` plutôt qu'une marge : le badge suit la ligne de base du nom
     du service, sinon il flotte au-dessus sur les tuiles à deux lignes. */
  vertical-align: middle;
  white-space: nowrap;
}

.service-bouton {
  font-size: 11px;
  padding: 4px 12px;
  /* Poussé à droite du pied, là où l'œil cherche l'action — et loin du prix, pour
     qu'on ne clique pas en croyant lire un montant. */
  margin-left: auto;

  /* `.btn` impose `min-height: 44px`, la cible tactile minimale. Posée exprès,
     et on ne la retire pas pour rien : MESURÉ, elle rendait le pied de cette
     tuile 44 px haut contre 27 pour une puce, donc toute la première rangée
     grandissait de 17 px — une rangée de grille s'aligne sur sa tuile la plus
     haute, alors deux tuiles voisines payaient pour ce bouton.
     28 px ici, et les 44 px REVIENNENT sous 560 px : c'est là que l'écran est
     tactile et que le doigt a besoin de la cible. Au bureau, c'est une souris. */
  min-height: 28px;
  border-radius: 999px;
}

/* Une tuile d'action n'est pas un lien : pas de curseur main sur toute sa
   surface, sinon on clique partout en attendant qu'il se passe quelque chose. */
div.service-link { cursor: default; }

/* ─────────────────────────────────────────────────────────────────────────────
   LE BOUTON D'ACTION REPREND SA TAILLE TACTILE SUR TÉLÉPHONE.
   Il est réduit à 28 px au bureau pour que sa tuile ne dépasse pas ses
   voisines de rangée (voir `.service-bouton`). Ici la grille n'a qu'une
   colonne : plus personne ne paie pour sa hauteur, et c'est un doigt qui vise.
   ───────────────────────────────────────────────────────────────────────── */
@media (max-width: 560px) {
  .service-bouton { min-height: 40px; padding: 8px 14px; }
}

/* ─────────────────────────────────────────────────────────────────────────────
   LA RANGÉE DE MÉTA D'UNE TUILE — badge et libellé de flux.

   Ils étaient en ligne derrière le nom : le flux se posait là où le nom
   finissait, donc à un endroit différent sur chaque tuile, et il poussait des
   noms courts à passer à la ligne pour trois mots. MESURÉ avec
   tools/mesure-tuiles : « Traduire un document » occupait deux lignes de nom
   alors qu'il en tient une.

   `min-height` plutôt qu'un contenu factice : une tuile sans badge ni flux
   garde sa rangée, sinon elle aurait une ligne de moins que ses voisines et on
   retomberait sur le désalignement qu'on corrige ici.
   ───────────────────────────────────────────────────────────────────────── */
.service-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 18px;
  margin-top: 2px;
}

/* Le libellé de flux n'a plus à se décaler du nom : il commence la rangée. */
.service-meta small { margin-left: 0; margin-top: 0; }

/* Le lecteur audio d'un travail terminé. Contrôles NATIFS : le navigateur sait
   déjà faire la barre de progression, le volume et la vitesse de lecture, et
   son rendu suit les réglages d'accessibilité de l'usager. */
.works-audio {
  display: block;
  width: 100%;
  margin-top: 10px;
  border-radius: 8px;
}

/* Pourquoi un travail a échoué. Lisible, pas alarmant : la retenue a été
   relâchée, personne n'a rien payé — c'est une explication, pas une alerte. */
.works-error {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted, #9aa0a6);
  max-width: 62ch;
}

/* ── Le choix d'une voix ──────────────────────────────────────────────────────
   Choisir une voix, c'est l'écouter. Les six sont donc visibles d'un coup,
   chacune avec son bouton, au lieu d'une liste qu'il faut ouvrir et refermer. */

/* Le `select` reste la source de vérité du formulaire : masqué à l'œil, JAMAIS
   retiré du flux. `display:none` l'aurait rendu inatteignable au clavier et
   invisible pour un lecteur d'écran. */
.module-select-cache {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.voix-grille {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  gap: 8px;
  margin-top: 8px;
}

.voix-carte {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line, #3a3f45);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.voix-carte:hover { border-color: var(--fg, #e8eaed); }
.voix-carte:focus-visible {
  outline: 2px solid var(--accent, #8ab4f8);
  outline-offset: 2px;
}
/* La carte choisie se voit SANS couleur seule : bordure ET fond. Une
   différence de teinte seule serait invisible pour qui distingue mal les
   couleurs. */
.voix-carte.est-choisie {
  border-color: var(--fg, #e8eaed);
  background: rgba(255, 255, 255, .06);
}

.voix-texte { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.voix-nom { font-size: 14px; }
.voix-note {
  font-size: 12px;
  color: var(--muted, #9aa0a6);
  line-height: 1.35;
}

.voix-play {
  flex: 0 0 auto;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  font: inherit; font-size: 13px;
  color: var(--fg, #e8eaed);
  background: transparent;
  border: 1px solid var(--line, #3a3f45);
  border-radius: 999px;
  cursor: pointer;
}
.voix-play:hover { border-color: var(--fg, #e8eaed); }

/* ── L'extrait audio d'un document ────────────────────────────────────────────
   Le lecteur, la page d'origine, et le texte EXACT qui a été lu. Le texte n'est
   pas décoratif : sans lui, on entend trente secondes sans savoir d'où elles
   sortent ni si le document a été lu correctement. */
.echantillon-audio { display: flex; flex-direction: column; gap: 10px; }

.echantillon-lecteur { width: 100%; border-radius: 8px; }

.echantillon-source {
  margin: 0;
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted, #9aa0a6);
}

/* Le passage lu, présenté comme une citation : c'est le texte de l'usager, pas
   le nôtre. Hauteur bornée — un extrait de cinq cents caractères ne doit pas
   pousser le bouton « Confirmer » hors de l'écran sur un téléphone. */
.echantillon-texte {
  margin: 0;
  padding: 10px 14px;
  max-height: 9.5em;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.55;
  color: var(--fg, #e8eaed);
  border-left: 2px solid var(--line, #3a3f45);
  background: rgba(255, 255, 255, .03);
  border-radius: 0 8px 8px 0;
}

/* ── Le plan d'un document découpé ────────────────────────────────────────────
   Replié par défaut : un roman fait quinze chapitres, et le bouton
   « Confirmer » doit rester visible sans faire défiler. */
.plan-chapitres { margin-top: 4px; }
.plan-chapitres > summary {
  cursor: pointer;
  padding: 6px 0;
  font-size: 13px;
  color: var(--muted, #9aa0a6);
}
.plan-chapitres > summary:hover { color: var(--fg, #e8eaed); }

.plan-ligne {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: baseline;
  gap: 10px;
  padding: 6px 0;
  border-top: 1px solid var(--line, #3a3f45);
  font-size: 13px;
}
.plan-titre { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.plan-titre > strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-pages, .plan-duree { font-size: 12px; color: var(--muted, #9aa0a6); }
.plan-prix { white-space: nowrap; }

.plan-note {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted, #9aa0a6);
}

/* « Celui-ci » — acheter UN chapitre. Discret : le geste principal reste
   « Confirmer » pour le livre entier ; celui-ci est l'alternative, pas
   l'appel à l'action. */
.plan-lancer {
  padding: 4px 10px;
  font: inherit;
  font-size: 12px;
  white-space: nowrap;
  color: var(--fg, #e8eaed);
  background: transparent;
  border: 1px solid var(--line, #3a3f45);
  border-radius: 999px;
  cursor: pointer;
}
.plan-lancer:hover { border-color: var(--fg, #e8eaed); }

/* ═══ LE STUDIO D'IMAGE ═══════════════════════════════════════════════════════
   Ajouté au BAS du fichier, comme les cartes de voix et l'échantillon avant lui :
   un seul .css, un composant par bloc commenté, aucun préprocesseur.

   RIEN DE CE QUI SUIT N'EXISTAIT. Vérifié sur les 4073 lignes précédentes : ni
   vignette, ni miniature, ni bande défilante, ni spinner, ni squelette, ni tuile
   générique. Le préfixe `.rendu-` était libre dans tout le dépôt — `.studio-`
   appartient au studio des tableaux de bord et `.sbx-` à celui des sandboxes.

   MOBILE D'ABORD, ET AUCUN DÉFILEMENT HORIZONTAL DE PAGE (tâche #27). La bande de
   vignettes défile, elle — c'est un défilement DE COMPOSANT, voulu et borné, pas
   une page trop large. La seule occurrence existante de masquage de barre de
   défilement vit sur `#serviceFilters` dans une media query : elle est recopiée
   ici plutôt que réutilisée, parce qu'un sélecteur d'ID ne se partage pas.

   LES VARIABLES SONT LES VRAIES. Huit endroits du fichier écrivent
   `var(--fg, #e8eaed)` alors que `--fg` n'est déclaré NULLE PART : ils tombent
   silencieusement sur la valeur de repli. On utilise `--text`, `--muted`,
   `--soft`, `--border`, `--panel` — celles qui existent. */

.rendu-studio {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* `min-width: 0` — UNE CEINTURE, ET LE COMMENTAIRE QUI ÉTAIT ICI RACONTAIT UN
   INCIDENT QUI N'A PAS EU LIEU.

   J'avais écrit que la première version débordait à droite sur un téléphone, et
   que cette règle l'avait corrigé. Les deux étaient faux. Le débordement que je
   croyais voir était un ARTEFACT DE MA CAPTURE : Edge headless refuse une fenêtre
   de 390 px, rend la page à 492 px CSS, puis écrit un PNG de 390 px de large en
   coupant la droite. La mesure dans le navigateur l'a dit sans ambiguïté —
   `documentElement.scrollWidth == clientWidth`, et zéro élément au-delà de la
   fenêtre.

   ET MA « CORRECTION » N'AVAIT RIEN CHANGÉ À L'IMAGE : c'est ça qui aurait dû
   m'alerter tout de suite. Une correction qui ne change rien ne corrige rien.

   La règle RESTE, parce qu'elle est juste en soi : `min-width: auto` sur un enfant
   de flex ou de grid laisse un contenu intrinsèquement large pousser son parent,
   et une image de 1200 px est exactement ce contenu-là. C'est une ceinture posée
   avant l'accident, pas après — et elle est déclarée comme telle. */
.rendu-studio > *,
.rendu-scene,
.rendu-verbes,
.rendu-bande { min-width: 0; }

/* LA SCÈNE — l'image en grand. Hauteur BORNÉE en unités de fenêtre : un rendu
   d'architecture en 1536×1024 pousserait sinon les boutons-verbes hors de l'écran
   sur un téléphone, et l'usager paierait un geste qu'il ne voit pas. */
.rendu-scene {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 220px;
  padding: 10px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.rendu-apercu {
  display: block;
  max-width: 100%;
  max-height: 52vh;
  border-radius: 10px;
  /* CONTAIN, JAMAIS COVER : un rendu recadré par le navigateur montrerait autre
     chose que ce qui a été livré, et l'usager jugerait un cadrage qu'on n'a pas
     fait. */
  object-fit: contain;
}

/* PENDANT QU'UN GESTE TOURNE. On garde l'image PRÉCÉDENTE à l'écran, atténuée :
   un cadre vide ferait croire que le travail précédent a disparu, et c'est
   justement ce que la clause de continuité promet de ne pas faire. L'animation
   est `studio-pulse`, déjà déclarée pour l'autre studio — une troisième pulsation
   dans le même fichier serait trois fois la même idée. */
.rendu-scene[data-etat="en-cours"] .rendu-apercu {
  animation: studio-pulse 1.6s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .rendu-scene[data-etat="en-cours"] .rendu-apercu { animation: none; opacity: .55; }
}

.rendu-attente {
  position: absolute;
  bottom: 10px;
  margin: 0;
  padding: 4px 10px;
  font-size: 12px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 999px;
}

/* DEUX MESSAGES PEUVENT COEXISTER : l'attente d'un geste et l'échec d'un lien
   d'affichage. Ils ne s'excluent pas — un renouvellement refusé PENDANT un geste
   doit se dire, et le taire était le défaut. Celui de l'échec monte d'un cran,
   mais SEULEMENT quand un geste tourne : seul, il reste en bas comme les autres. */
.rendu-scene[data-etat="en-cours"] .rendu-attente-panne { bottom: 44px; }

/* LES VERBES — ce qu'on peut faire ensuite, avec leur prix AVANT le clic. Le prix
   est la moitié du bouton : chaque geste est un travail facturé, et un studio qui
   cache son prix fait cliquer à l'aveugle. */
.rendu-verbes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 168px), 1fr));
  gap: 8px;
}

.rendu-verbe {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 9px 12px;
  text-align: left;
  line-height: 1.25;
  /* `.btn` POSE `white-space: nowrap`, ET ÇA SE VOYAIT. À 980 px la grille donne
     cinq colonnes de 168 px ; « Lumière de fin de journée » ne rentre pas, et
     sans retour à la ligne il débordait SUR LE BOUTON VOISIN — « Lumière de fin
     de journéeCiel couvert », lisible tel quel dans la capture. Un libellé qui
     empiète sur le bouton d'à côté fait cliquer sur le mauvais geste, et chaque
     geste est facturé. */
  white-space: normal;
}

.rendu-verbe-prix {
  font-size: 12px;
  color: var(--soft);
  font-variant-numeric: tabular-nums;
}

/* LA BANDE — l'historique, et il est RAMIFIABLE : on paie chaque clic, donc il
   faut pouvoir repartir de l'étape 3 si la 4 est moins bonne. Sans ce retour en
   arrière, chaque erreur coûte la séance et l'usager arrête d'essayer.

   `scroll-snap` pour que les vignettes s'arrêtent alignées au doigt, et le
   masquage de la barre recopié depuis `#serviceFilters`. */
.rendu-bande {
  display: flex;
  gap: 8px;
  padding: 2px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}
.rendu-bande::-webkit-scrollbar { display: none; }

.rendu-etape {
  position: relative;
  flex: 0 0 auto;
  width: 68px;
  height: 68px;
  padding: 0;
  overflow: hidden;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  scroll-snap-align: start;
}

.rendu-etape img {
  width: 100%;
  height: 100%;
  /* COVER ICI, et c'est l'inverse de la scène : une vignette est un REPÈRE, pas
     un livrable. Elle doit remplir son carré pour être reconnaissable d'un coup
     d'œil ; c'est la grande image qui doit être fidèle. */
  object-fit: cover;
  display: block;
}

.rendu-etape:hover { border-color: var(--border-strong); }
.rendu-etape:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* L'ÉTAPE COURANTE. `aria-current` porte l'information pour le lecteur d'écran ET
   pour le style : un état visuel qui n'existe que dans une classe est un état
   qu'une synthèse vocale ne dit pas. */
.rendu-etape[aria-current="true"] {
  border-color: var(--cyan);
  box-shadow: 0 0 0 1px var(--cyan);
}

.rendu-etape-num {
  position: absolute;
  top: 3px;
  left: 3px;
  min-width: 17px;
  padding: 0 4px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  line-height: 17px;
  text-align: center;
  color: var(--text);
  background: rgba(13, 14, 16, 0.78);
  border-radius: 6px;
}

/* LE POINT DE DÉPART. L'original de la séance n'est pas une étape comme les
   autres : c'est ce que l'usager a déposé, et il doit se distinguer sans mot —
   la bande n'a pas la place d'une étiquette. */
.rendu-etape[data-role="original"] .rendu-etape-num {
  color: var(--bg);
  background: var(--amber);
}

/* CE QUE LA SÉANCE A COÛTÉ, EN DIRECT. Il n'y a AUCUN plafond de séance — c'est
   sa décision du 2026-09-27, et elle tient parce que chaque geste est un travail
   visible au grand livre. Mais « visible » veut dire visible ICI aussi : un total
   qu'il faut aller chercher dans « Mes travaux » n'informe personne pendant qu'il
   clique. */
.rendu-total {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
  font-size: 12px;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: var(--muted);
}

.rendu-total strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* Sur un téléphone, la scène cède de la hauteur aux verbes : c'est le geste
   suivant qui doit rester atteignable sans défiler, pas l'image d'être grande. */
@media (max-width: 560px) {
  .rendu-apercu { max-height: 38vh; }
  .rendu-etape { width: 58px; height: 58px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   LA FILE D'ATTENTE — six vues d'un projet, six travaux.

   Une ligne par vue, et CHAQUE LIGNE PORTE SON PROPRE ÉTAT. C'est la raison
   d'être de cet écran : à six travaux, « c'est prêt » ne veut plus rien dire
   tant qu'on ne sait pas lesquels. Un badge par ligne, et le motif de l'échec
   écrit sous celle qui a manqué — pas un compte global qui laisse chercher.
   ═════════════════════════════════════════════════════════════════════════ */

/* `hidden` DOIT GAGNER SUR LA RÈGLE D'ÉTAT, et ça a été vu sur capture : le
   journal du banc disait « Télécharger masqué : true » pendant que le bouton
   était à l'écran. La règle `[data-state="result"] … [data-when~="result"]`
   pose un `display` EXPLICITE, et une règle d'auteur bat le
   `[hidden] { display: none }` de la feuille du navigateur. Un `hidden` posé en
   JS ne masquait donc rien du tout — sur ces boutons-là, et sur eux seuls.
   Spécificité volontairement plus forte que la règle d'état, pour ne pas
   dépendre de l'ordre du fichier. */
.module-panel[data-state] .module-actions [data-when][hidden] { display: none; }

/* La note de la Vision sous les verbes du studio : elle occupe toute la rangée
   de la grille, sinon elle se glisserait dans une colonne de verbe. */
.rendu-note {
  grid-column: 1 / -1;
  margin: 6px 0 0;
  font-family: var(--mono); font-size: 11.5px; color: var(--soft);
}

.vue-liste { display: grid; gap: 10px; margin-top: 14px; padding: 0; list-style: none; }

.vue-ligne {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: rgba(255, 255, 255, .02);
  font-size: 13px;
}
/* La vue dont le studio est ouvert dessous : on la désigne, sinon rien ne dit
   laquelle des six on est en train de retoucher. */
.vue-ligne[aria-current="true"] { border-color: var(--text); }

.vue-tete { display: flex; align-items: center; gap: 10px; min-width: 0; }
.vue-rang {
  flex: 0 0 auto;
  font-family: var(--mono); font-size: 11px; color: var(--soft);
}
.vue-nom { overflow-wrap: anywhere; }

.vue-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
/* `.btn` pose `white-space: nowrap` ; sur un téléphone deux boutons côte à côte
   se chevauchaient. On les laisse passer à la ligne plutôt que déborder. */
.vue-actions .btn { white-space: normal; padding: 7px 12px; font-size: 12px; }

.vue-motif {
  grid-column: 1 / -1;
  margin: 0;
  font-family: var(--mono); font-size: 12px;
  color: var(--danger);
  overflow-wrap: anywhere;
}

.vue-total {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin: 16px 0 0;
  font-family: var(--mono); font-size: 12px;
  letter-spacing: .06em; text-transform: uppercase; color: var(--soft);
}
.vue-total strong { font-family: var(--sans); font-size: 15px; color: var(--text); letter-spacing: 0; }

@media (max-width: 560px) {
  .vue-ligne { grid-template-columns: 1fr; }
  .vue-actions { justify-content: flex-start; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   LA TOILE — le studio d'image par projets (ADR 0012)

   LE QUATRIÈME PRÉFIXE, ET IL A ÉTÉ VÉRIFIÉ LIBRE avant d'être pris, dans ce
   fichier ET dans tous les apps/web/*.js. La discipline est écrite plus haut :
   `.sbx-` appartient au Sandbox Studio, `.studio-` à celui des tableaux de
   bord, `.rendu-` au studio d'image. `.toile-` est le sien.

   LA GÉOMÉTRIE EST CELLE DE `.sbx-studio`, DÉLIBÉRÉMENT. Elle est éprouvée :
   en-tête fixe, panneau qui défile, scène qui prend le reste, une colonne sous
   900 px et deux au-dessus. Réinventer une seconde mise en page plein écran
   n'aurait apporté qu'une seconde série de défauts.
   ═══════════════════════════════════════════════════════════════════════════ */

/* Z-INDEX 125 : AU-DESSUS du panneau de module (120), SOUS le Sandbox Studio
   (130). Monter au-dessus de 130 cacherait son compteur de dépense, ce qu'un
   test interdit explicitement. Les deux ne peuvent plus être ouverts ensemble —
   `toile.js` ferme les autres — mais un z-index choisi au hasard est exactement
   ce qui a mis l'ancien cadre de la sandbox SOUS son propre studio, en silence. */
.toile {
  position: fixed;
  inset: 0;
  z-index: 125;
  display: flex;
  flex-direction: column;
  /* OPAQUE, ET PAS TRANSPARENT. Sans fond plein, le catalogue transparaît
     derrière les images et on ne sait plus ce qu'on regarde. */
  background-color: var(--bg);
}

.toile[hidden] { display: none; }

body.toile-ouverte { overflow: hidden; }

.toile-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: var(--page-pad);
  border-bottom: 1px solid var(--border);
}

.toile-head-titre { display: flex; flex-direction: column; gap: 2px; }

/* CHASSE FIXE SUR L'ARGENT. Le solde bouge à chaque rendu ; en proportionnelle
   la ligne tremblerait à chaque chiffre. Même raison que `.sbx-studio-depense`. */
.toile-solde {
  margin: 0;
  font-family: var(--mono);
  font-size: 15px;
  color: var(--cyan);
  font-variant-numeric: tabular-nums;
}

.toile-depense {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* `min-height: 0` EST OBLIGATOIRE, pas cosmétique : sans lui, un enfant en
   `overflow: auto` dans une grille ne défile pas — il pousse la grille. */
.toile-body {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr;
  min-height: 0;
}

.toile-rail {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: var(--page-pad);
  border-bottom: 1px solid var(--border);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.toile-liste { display: flex; flex-direction: column; gap: 10px; }

.toile-vide {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}

.toile-scene {
  display: grid;
  place-items: center;
  padding: var(--page-pad);
  min-height: 0;
  overflow-y: auto;
}

/* DEUX COLONNES À PARTIR DE 900 px, le même point de rupture que le Sandbox
   Studio. En deçà, le rail passe AU-DESSUS de la scène et tout s'empile : c'est
   la règle « mobile d'abord, aucun défilement horizontal ». */
@media (min-width: 900px) {
  .toile-body { grid-template-columns: minmax(240px, 320px) 1fr; }
  .toile-rail {
    border-bottom: none;
    border-right: 1px solid var(--border);
  }
}

/* Les cartes du rail. Un BOUTON et pas un div : on choisit un projet au clavier
   comme à la souris, et `aria-pressed` dit lequel est ouvert. Même choix que les
   puces de la Vision — ce sont des boutons dans un groupe, pas des onglets. */
.toile-projet {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  text-align: left;
  border: 1px solid rgba(232, 231, 226, .10);
  border-radius: 10px;
  background: rgba(255, 255, 255, .015);
  color: inherit;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease;
}

.toile-projet:hover { border-color: rgba(232, 231, 226, .22); }
.toile-projet-actif { border-color: var(--cyan); background: rgba(255, 255, 255, .03); }

/* `min-width: 0` + `overflow-wrap` : un nom de projet est ce que quelqu'un tape,
   et soixante caractères sans espace existent. Sans ça, la carte pousse le rail
   et la page défile horizontalement — la règle qu'il a posée le 2026-09-23. */
.toile-projet-nom {
  font-size: 14px;
  font-weight: 500;
  min-width: 0;
  overflow-wrap: anywhere;
}

.toile-projet-vision { font-size: 12px; color: var(--muted); }

.toile-scene-vide {
  margin: 0;
  max-width: 34ch;
  text-align: center;
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
}

/* LA SECONDE PORTE D'UNE TUILE — « Studio » à côté du prix, DANS le pied.
   POURQUOI LE PIED SORT DE L'ANCRE. Un <button> dans un <a> est invalide et le
   clic naviguerait en plus d'agir. La première tentative posait le bouton SOUS
   la tuile : photographié, il flottait hors de la carte, et MESURÉ la rangée
   passait de 140 à 174 px — deux tuiles voisines payaient pour lui, exactement
   ce que tools/mesure-tuiles existe pour attraper.
   Ici c'est le `li` qui porte le cadre de la carte, l'ancre n'a plus que le
   titre et la description, et le pied est son frère. La tuile reste un vrai
   lien, le bouton un vrai bouton, et le pied garde sa place. */
.service-row:has(.service-seconde-porte) {
  display: flex;
  flex-direction: column;
  padding: 14px;
  border: 1px solid rgba(232, 231, 226, .10);
  border-radius: 12px;
  background: rgba(255, 255, 255, .015);
  transition: background .18s ease, border-color .18s ease;
}

.service-row:has(.service-seconde-porte):hover {
  border-color: rgba(232, 231, 226, .22);
  background: rgba(255, 255, 255, .022);
}

/* L'ANCRE PERD LE CADRE — il est monté d'un cran. Sans ça, deux bordures
   imbriquées et deux fonds : la carte aurait un liseré en double. */
.service-row:has(.service-seconde-porte) .service-link {
  flex: 1;
  padding: 0;
  border: none;
  background: none;
  border-radius: 0;
  grid-template-rows: auto 1fr;
}

.service-row:has(.service-seconde-porte) .service-link:hover {
  transform: none;
  background: none;
  border-color: transparent;
}

.service-row:has(.service-seconde-porte) > .service-foot { margin-top: 9px; }

.service-seconde-porte {
  font-size: 11px;
  /* Poussé à droite du pied, comme le bouton de la tuile d'action, et loin du
     prix pour qu'on ne clique pas en croyant lire un montant. */
  margin-left: auto;
  /* 28 px, PAS 44. `.btn` impose la cible tactile de 44 px, et MESURÉ le
     2026-09-23 elle faisait grandir toute la rangée de 17 px. Les 44 px
     REVIENNENT sous 560 px, là où l'écran est tactile. */
  min-height: 28px;
  padding: 4px 12px;
  border-radius: 999px;
}

@media (max-width: 560px) {
  .service-seconde-porte { min-height: 44px; }
}

/* Le dépôt, l'aperçu et les ateliers de la Toile. */
.toile-depot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 28px 24px;
  max-width: 32rem;
  border: 1px dashed rgba(232, 231, 226, .22);
  border-radius: 14px;
  text-align: center;
}
.toile-depot-survol { border-color: var(--cyan); background: rgba(255, 255, 255, .02); }
.toile-depot-titre { margin: 0; font-size: 16px; font-weight: 500; }
.toile-depot-indice { margin: 0; font-size: 13px; line-height: 1.6; color: var(--muted); }

/* L'ENTRÉE EST CACHÉE, PAS SUPPRIMÉE : le <label> la déclenche à la souris, et
   elle reste atteignable au clavier et aux lecteurs d'écran. `display: none`
   l'aurait retirée de l'ordre de tabulation. */
.toile-depot-entree {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.toile-depot-bouton { cursor: pointer; }

.toile-apercu { display: grid; place-items: center; max-width: 100%; }
/* LA VITRE — elle n'entoure QUE l'image. « Redresser » agrandit pour combler
   les coins ; sans `overflow: hidden` ce débordement irait peindre par-dessus
   le bouton « Voir le croquis » et la vignette voisine. Le bouton reste hors de
   la vitre, donc jamais recouvert. */
.toile-apercu-vitre {
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 10px;
  max-width: 100%;
  /* LE CADRE DE RECADRAGE EST POSITIONNÉ PAR RAPPORT À ELLE, en pourcentages.
     La vitre épouse le canevas — c'est ce qui rend la correspondance exacte
     sans une ligne de trigonométrie. */
  position: relative;
}

/* LE CANEVAS DE LA CIBLE. Il porte les mêmes bornes que l'<img> qu'il remplace,
   sinon une photo de 4000 px pousserait tout le reste hors de l'écran. */
.toile-apercu-toile {
  display: block;
  max-width: 100%;
  max-height: 56vh;
  border-radius: 10px;
}

/* LE CADRE DE RECADRAGE. L'extérieur est assombri par une ombre portée
   démesurée plutôt que par quatre rectangles à tenir en place — une seule
   propriété, et elle suit le cadre sans calcul. */
.toile-recadre {
  position: absolute;
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, .9);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, .55);
  cursor: move;
  /* `touch-action: none` — SANS LUI, LE DOIGT FAIT DÉFILER LA PAGE AU LIEU DE
     DÉPLACER LE CADRE. Le navigateur décide du geste avant que le premier
     `pointermove` n'arrive ; c'est au CSS de lui dire de ne pas le prendre. */
  touch-action: none;
}
.toile-poignee {
  position: absolute;
  width: 26px; height: 26px;
  background: transparent;
  touch-action: none;
}
/* LE ROND VISIBLE FAIT 12 px, LA CIBLE TACTILE 26. On dessine petit pour ne pas
   masquer l'image, et on attrape large pour que le coin se prenne au doigt. */
.toile-poignee::after {
  content: '';
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .55);
}
/* LES POIGNÉES SE POSENT À L'INTÉRIEUR DU CADRE, pas à cheval sur ses coins.
   Vu sur la CAPTURE : en 4:5 sur une image paysage, le cadre touche le haut et
   le bas, et des poignées centrées sur les coins étaient coupées en deux par la
   vitre — des demi-ronds qu'on n'ose pas attraper. Rentrées, elles restent
   entières quelle que soit la position du cadre. */
.toile-poignee-hg { left: -3px; top: -3px; cursor: nwse-resize; }
.toile-poignee-hd { right: -3px; top: -3px; cursor: nesw-resize; }
.toile-poignee-bg { left: -3px; bottom: -3px; cursor: nesw-resize; }
.toile-poignee-bd { right: -3px; bottom: -3px; cursor: nwse-resize; }

/* LES RAPPORTS — « Libre » compris, parce que c'est une valeur et pas l'absence
   de choix : sans lui on ne peut plus sortir d'un rapport une fois pris. */
.toile-rapports { display: flex; flex-wrap: wrap; gap: 6px; }
.toile-rapport { flex: 1 1 auto; font-size: 12px; min-height: 36px; padding: 6px 10px; }
.toile-rapport-actif { border-color: var(--text); color: var(--text); }
.toile-apercu img {
  max-width: 100%;
  /* Bornée en HAUTEUR, comme l'aperçu du studio d'image : une image de 4000 px
     de haut pousserait tout le reste hors de l'écran. */
  max-height: 56vh;
  border-radius: 10px;
}

.toile-choix {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}
.toile-choix-titre { font-size: 12px; color: var(--muted); }
.toile-atelier,
.toile-geste,
.toile-encore,
.toile-plus-anciennes { font-size: 12px; min-height: 32px; padding: 6px 14px; border-radius: 999px; }

.toile-erreur {
  margin: 0 0 10px;
  max-width: 34rem;
  font-size: 13px;
  line-height: 1.6;
  color: var(--danger);
  text-align: center;
}

@media (max-width: 560px) {
  .toile-apercu img,
  .toile-apercu-toile { max-height: 40vh; }
  .toile-atelier { min-height: 44px; }
}

/* LA RANGÉE DE VIGNETTES — elle a REMPLACÉ le sélecteur 1 / 2 / 4.
   « Des images beaucoup plus petites mais cliquables pour les voir plus
   grandes. » Deux systèmes de navigation sur le même écran se contredisent, et
   « beaucoup plus petites » est incompatible avec quatre grandes.

   ELLE DÉFILE HORIZONTALEMENT, ET C'EST LA SEULE EXCEPTION DE CET ÉCRAN à la
   règle « aucun défilement horizontal ». La règle vise la PAGE : une page qui
   déborde cache du contenu qu'on ne sait pas chercher. Une rangée de vignettes
   qui défile est une commande dont c'est le fonctionnement, bornée à elle-même
   — et `overflow-x: auto` l'empêche de pousser quoi que ce soit hors du cadre.
   Le banc mesure `scrollWidth > clientWidth` sur la Toile, le corps, le rail et
   la scène : aucun des quatre n'est ce conteneur-ci. */
.toile-vignettes {
  /* UNE SEULE SOURCE POUR LA TAILLE D'UNE VIGNETTE. Elle sert à trois endroits
     — largeur, hauteur, et la hauteur minimale de la rangée ci-dessous — et
     trois nombres écrits à la main dériveraient au premier ajustement. */
  --vignette: 76px;
  display: flex;
  gap: 8px;
  /* ELLE SE CENTRE QUAND ELLE TIENT, ELLE DÉFILE QUAND ELLE DÉBORDE.
     `width: 100%` la collait à gauche sur grand écran pendant que tout le reste
     de la scène était centré — vu sur la capture. `max-width` sans largeur
     imposée laisse la grille de la scène (`place-items: center`) la centrer
     tant qu'elle rentre, et la borne au cadre dès qu'il y a trop de vignettes.
     `justify-content: center` aurait été le piège : au-delà du cadre, il
     centre le contenu DÉBORDANT et rend les premières vignettes inatteignables
     au défilement. */
  max-width: 100%;
  margin-top: 12px;
  padding-bottom: 4px;
  /* `min-height` EXPLICITE, ET C'EST UNE CORRECTION MESURÉE. `overflow-x: auto`
     fait de cette rangée un conteneur de défilement, ce qui met sa TAILLE
     MINIMALE AUTOMATIQUE À ZÉRO. La scène est une grille (`place-items:
     center`) : sa rangée ne réservait donc pas les 80 px du contenu, et la
     rangée de vignettes DÉBORDAIT des deux côtés — par-dessus le bouton
     « Voir le croquis » au-dessus et le panneau de réglages en dessous.
     Vu sur la capture mobile, puis MESURÉ : la rangée faisait 42 px pour un
     contenu de 80. Aucune assertion de DOM ne pouvait le voir — les trois
     nœuds existaient, dans le bon ordre, avec les bonnes classes ; ce qui se
     chevauchait, ce sont des BOÎTES. Le banc les compare maintenant. */
  min-height: calc(var(--vignette) + 6px);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  /* AU DOIGT, ON S'ARRÊTE SUR UNE VIGNETTE, pas entre deux. */
  scroll-snap-type: x proximity;
}
.toile-vignette {
  flex: 0 0 auto;
  width: var(--vignette);
  height: var(--vignette);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, .02);
  overflow: hidden;
  cursor: pointer;
  scroll-snap-align: start;
  /* LA CIBLE TACTILE FAIT 76 px DE CÔTÉ — bien au-delà des 44 recommandés. Une
     vignette qu'on rate au doigt ne sert à rien : on la voulait petite à l'œil,
     pas petite au toucher. */
}
.toile-vignette img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.toile-vignette-choisie { border-color: var(--text); }
/* CELLE QU'ON REGARDE SE VOIT SANS COULEUR : un contour clair, pas une teinte.
   La rangée montre des images — les colorer changerait ce qu'on croit voir. */
.toile-vignette:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
/* UNE VIGNETTE DONT LE LIEN A EXPIRÉ NE LAISSE PAS UN TROU. Elle reste
   cliquable : c'est la GRANDE image qui dira que le lien est mort, avec sa
   sortie. Une vignette muette et morte n'apprendrait rien. */
.toile-vignette-morte {
  background: repeating-linear-gradient(45deg,
    rgba(255,255,255,.04) 0 6px, transparent 6px 12px);
}

/* LE PANNEAU DE RÉGLAGES — la couche GRATUITE.
   Posé SOUS l'image et au-dessus des gestes : l'ordre du prix. Ce qui ne coûte
   rien se rencontre d'abord ; ce qui coûte vient après. Sur un écran étroit la
   colonne de droite de la maquette n'existe pas — la même pile sert des deux
   côtés, et c'est ce qui la rend lisible au doigt. */
.toile-reglages {
  width: min(100%, 34rem);
  margin: 18px auto 0;
  box-sizing: border-box;
  padding: 14px 16px;
  background: rgba(255, 255, 255, .02);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.toile-reglages-tete { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.toile-reglages-titre { font-size: 13px; font-weight: 700; }
.toile-reglages-prix { font-size: 11px; color: var(--green); }

.toile-curseur { display: flex; flex-direction: column; gap: 6px; }
.toile-curseur-tete { display: flex; align-items: baseline; justify-content: space-between; }
.toile-curseur-nom { font-size: 12px; color: var(--text); }
.toile-curseur-valeur { font-size: 11px; color: var(--muted); font-family: var(--mono); }

/* LA PISTE EST DESSINÉE À LA MAIN parce que l'apparence native d'un `range`
   ignore le thème sombre sur la moitié des navigateurs. LA POIGNÉE FAIT 22 px :
   la recommandation d'accessibilité est 44 px de cible, et le `range` étend la
   zone tactile au-delà du rond visible — un rond de 15 px, lui, se rate au doigt
   sur un téléphone. */
.toile-curseur-piste { -webkit-appearance: none; appearance: none; width: 100%; background: transparent; }
.toile-curseur-piste::-webkit-slider-runnable-track { height: 3px; border-radius: 2px; background: var(--border-strong); }
.toile-curseur-piste::-moz-range-track { height: 3px; border-radius: 2px; background: var(--border-strong); }
.toile-curseur-piste::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px; margin-top: -10px;
  border-radius: 50%; background: var(--text); cursor: pointer;
}
.toile-curseur-piste::-moz-range-thumb {
  width: 22px; height: 22px; border: 0;
  border-radius: 50%; background: var(--text); cursor: pointer;
}
.toile-curseur-piste:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
.toile-curseur-piste:disabled { opacity: .5; cursor: not-allowed; }

/* DEUX GROUPES — « Lumière et couleur », « Cadrage ». Un filet entre eux plutôt
   qu'un cadre autour de chacun : six curseurs dans deux boîtes imbriquées, sur
   un téléphone, c'est plus de bordure que de contenu. */
.toile-reglages-groupe { display: flex; flex-direction: column; gap: 12px; }
.toile-reglages-groupe + .toile-reglages-groupe {
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.toile-reglages-groupe-titre {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}

/* LES DEUX BOUTONS DE PIVOT, à parts égales et hauts de 40 px — ce sont des
   cibles tactiles, pas des pastilles de catalogue. */
.toile-pivots { display: flex; gap: 8px; }
.toile-pivot { flex: 1 1 0; font-size: 12px; min-height: 40px; }

.toile-reglages-barre { display: flex; flex-wrap: wrap; gap: 8px; }
.toile-telecharger { flex-grow: 1; font-size: 13px; min-height: 40px; }
.toile-reinit { font-size: 12px; min-height: 40px; }
.toile-reinit:disabled { opacity: .45; cursor: not-allowed; }

/* LA RANGÉE DES DOUZE GESTES. Bornée en largeur, et c'est une correction vue sur
   la CAPTURE : sans borne, les onze premiers s'étalaient sur toute la scène et
   « Cadrer plus large » restait seul sur sa ligne. Douze pastilles sont une
   PALETTE — elle se lit en bloc, pas en bandeau. */
.toile-gestes { width: min(100%, 46rem); margin-inline: auto; }

/* « Voir le croquis déposé » — la bascule avant / après, sous chaque rendu qui a
   un original. Posée SOUS l'image et non dessus : un bouton en surimpression
   cache ce qu'on est venu regarder, et sur une grille de quatre il tombe sur le
   sujet. */
.toile-avant-apres {
  margin-top: 8px;
  font-size: 12px;
  padding: 7px 13px;
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--border);
}
.toile-avant-apres[aria-pressed="true"] {
  color: var(--bg);
  background: var(--cyan);
  border-color: var(--cyan);
}

/* La direction du classeur — le choix de Vision, par projet (ADR 0012). Il est
   posé EN HAUT de la scène et ne bouge pas d'une étape à l'autre : c'est la
   réponse à « pourquoi ces deux images se ressemblent ». On nomme la Vision, on
   ne montre jamais son texte. */
.toile-direction {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: min(100%, 34rem);
  padding: 12px 14px;
  margin-bottom: 18px;
  background: rgba(255, 255, 255, .02);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.toile-direction-titre { font-size: 12px; color: var(--muted); }
.toile-direction-note { margin: 0; font-size: 12px; line-height: 1.6; color: var(--muted); }

.toile-direction-choix {
  width: 100%;
  padding: 9px 12px;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  /* `--panel`, ET PAS un `--surface` que j'ai failli écrire : il n'existe pas
     dans `:root`. Un token inventé ne lève rien — la déclaration est simplement
     ignorée, et c'est ainsi que les bordures de cet écran avaient TOUTES disparu
     sous un `var(--line)` imaginaire. Un `<select>` presque transparent est en
     plus illisible : ses `<option>` sont peints par le système, pas par nous. */
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.toile-direction-choix:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.toile-direction-choix:disabled { opacity: .55; cursor: not-allowed; }

/* Le champ de précision — le « prompt manuel ». Il vient du catalogue, comme
   tout le reste de cet écran ; son libellé et son indice sont ceux du service. */
.toile-libre { display: flex; flex-direction: column; gap: 6px; width: min(100%, 34rem); margin-top: 14px; }
.toile-libre-titre { font-size: 12px; color: var(--muted); }

.toile-libre-zone {
  width: 100%;
  min-height: 62px;
  padding: 10px 12px;
  font: inherit;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  background: rgba(255, 255, 255, .02);
  border: 1px solid var(--border);
  border-radius: 10px;
  resize: vertical;
}
.toile-libre-zone:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* LES DEUX FIDÉLITÉS — « garder la géométrie » ou « interpréter librement ».
   Déclarées au catalogue depuis des semaines, offertes par aucun écran jusqu'ici,
   donc `elevee` était imposée en silence. DES PASTILLES ET PAS UN MENU : deux
   valeurs se montrent, et un déroulant à deux entrées demande deux gestes pour
   en voir un. */
.toile-fidelite {
  width: min(100%, 34rem);
  margin: 14px auto 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toile-fidelite-choix { display: flex; flex-wrap: wrap; gap: 8px; }
.toile-fid { flex: 1 1 12rem; font-size: 12px; min-height: 40px; padding: 6px 12px; }
.toile-fid-actif { border-color: var(--text); color: var(--text); }

/* DÉCRIRE LE CHANGEMENT. Le champ est posé AVANT les douze pastilles : on lit
   ce qu'on peut écrire, puis ce qu'on peut cliquer. L'inverse ferait croire que
   les pastilles sont le seul chemin — c'est justement ce qu'il était. */
.toile-retouche {
  width: min(100%, 34rem);
  margin: 10px auto 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
/* LE BOUTON PORTE SON PRIX, comme les gestes. Il reste éteint tant que le champ
   est vide : le serveur refuserait une retouche sans instruction, et un bouton
   qui part chercher un 400 est un bouton qui ment. */
.toile-appliquer { align-self: flex-end; font-size: 13px; min-height: 40px; }
.toile-appliquer:disabled { opacity: .45; cursor: not-allowed; }

/* LES IMAGES DE RÉFÉRENCE — « un modèle de chaise à reprendre dans mon croquis ».
   Petites et carrées, comme la rangée du mur : ce sont des pièces jointes, pas
   des sujets. Elles ne prennent la place ni de la scène ni des ateliers. */
.toile-refs {
  width: min(100%, 34rem);
  margin: 14px auto 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toile-refs-tete { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.toile-refs-compte { font-size: 11px; color: var(--muted); font-family: var(--mono); }
.toile-refs-rangee {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.toile-ref {
  position: relative;
  width: 64px;
  height: 64px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  flex: 0 0 auto;
}
.toile-ref img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* LE « × » EST UNE CIBLE DE 28 px SUR UNE VIGNETTE DE 64 : plus petit, on retire
   la mauvaise référence au doigt — et retirer la mauvaise se paie en la
   redéposant. */
.toile-ref-oter {
  position: absolute;
  top: 2px; right: 2px;
  width: 28px; height: 28px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .68);
  color: #fff;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}
.toile-ref-oter:disabled { opacity: .4; cursor: not-allowed; }
.toile-ref-oter:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.toile-ref-ajouter {
  flex: 0 0 auto;
  min-height: 64px;
  font-size: 12px;
  padding: 6px 14px;
  border-style: dashed;
}

/* DEUX COLONNES SUR GRAND ÉCRAN — l'image à gauche, les commandes à droite.
   Sous 900 px elles s'empilent dans l'ordre écrit : image, rangée de vignettes,
   puis réglages. C'est exactement la pile d'avant, donc « mobile d'abord » est
   respecté par construction et non contourné. */
.toile-deux {
  display: grid;
  gap: 18px;
  width: 100%;
  justify-items: center;
}
.toile-colonne-image,
.toile-colonne-outils {
  display: grid;
  gap: 0;
  justify-items: center;
  width: 100%;
  min-width: 0;   /* sans ça, une image large refuse de rétrécir dans sa colonne */
}

@media (min-width: 900px) {
  /* LE MÊME SEUIL QUE `.toile-body` ET QUE LE SANDBOX STUDIO. Un second ferait
     basculer deux parties du même écran à deux largeurs différentes. */
  .toile-deux {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 26rem);
    align-items: start;
    gap: 24px;
  }
  /* L'IMAGE PREND LA HAUTEUR QU'ELLE PEUT quand elle n'a plus à partager la
     verticale avec le panneau : c'est tout l'intérêt de la colonne. */
  .toile-deux .toile-apercu-toile,
  .toile-deux .toile-apercu img { max-height: 62vh; }
  /* LES BLOCS DE DROITE NE SE CENTRENT PLUS DANS UNE COLONNE ÉTROITE : ils la
     remplissent. `min(100%, 34rem)` les laissait flotter au milieu de 26 rem. */
  .toile-colonne-outils > * { width: 100%; }
  .toile-colonne-outils { justify-items: stretch; }
}

/* LE GROUPEMENT DE LA RANGÉE PAR CROQUIS D'ORIGINE.
   UN FILET, PAS UN TITRE : le mur d'une designer qui a huit croquis porterait
   huit titres avant sa première image. Ce qu'il faut voir, c'est où une série
   finit — pas comment elle s'appelle. */
.toile-vignette-coupure {
  flex: 0 0 auto;
  width: 1px;
  align-self: stretch;
  margin: 4px 4px;
  background: var(--border-strong);
}
/* LA RACINE D'UNE SÉRIE PORTE UN LISERÉ EN PIED — c'est le croquis dont tout le
   reste descend. Discret : il distingue, il ne classe pas. */
.toile-vignette-racine { box-shadow: inset 0 -3px 0 0 var(--cyan); }

/* LE STATUT ET LA NOTE (étape ⑥) — la seule commande de cet écran qui écrive
   chez nous sans rien coûter, et elle le dit. */
.toile-note {
  width: min(100%, 34rem);
  margin: 14px auto 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toile-note-tete { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.toile-note-gratuit { font-size: 11px; color: var(--green); }
.toile-note-statuts { display: flex; flex-wrap: wrap; gap: 8px; }
.toile-statut { flex: 1 1 8rem; font-size: 12px; min-height: 40px; padding: 6px 12px; }
/* CELUI QUI EST ACTIF SE VOIT PAR SON CONTOUR, pas par un aplat : trois pastilles
   colorées côte à côte se liraient comme un feu de circulation, et « à revoir »
   n'est pas un avertissement. */
.toile-statut-actif { border-color: var(--text); color: var(--text); }
.toile-statut-a_revoir.toile-statut-actif { border-color: var(--amber, #d8a657); }
.toile-statut-retenue.toile-statut-actif { border-color: var(--green); }

/* DANS LA RANGÉE, UN POINT — pas une bordure de plus. La vignette porte déjà un
   liseré pour la racine et un contour pour la sélection ; un troisième trait
   rendrait les trois illisibles. `brouillon` n'a PAS de point : c'est l'état de
   tout ce qui sort du fournisseur, et le marquer couvrirait le mur de bruit. */
.toile-vignette-a_revoir::before,
.toile-vignette-retenue::before {
  content: '';
  position: absolute;
  top: 4px; left: 4px;
  width: 9px; height: 9px;
  border-radius: 50%;
  box-shadow: 0 0 0 1.5px rgba(0, 0, 0, .55);
  z-index: 1;
}
.toile-vignette-a_revoir::before { background: var(--amber, #d8a657); }
.toile-vignette-retenue::before { background: var(--green); }
/* LA VIGNETTE DEVIENT LE REPÈRE DU POINT — sans ça il se placerait par rapport
   à la rangée, et les douze points s'empileraient dans un coin. */
.toile-vignette { position: relative; }
