/* Le brief de Deborah : simple, dans l'esprit de macOS.
   Gris clair, fenêtres blanches, bleu système, police du système sur Mac. */

:root {
  --bg: #f5f5f7;
  --panel: #ffffff;
  --ink: #1d1d1f;
  --ink-2: #6e6e73;
  --ink-3: #86868b;
  --line: #e5e5ea;
  --line-2: #d2d2d7;
  --accent: #0071e3;
  --accent-hi: #0077ed;
  --accent-lo: #0062c4;
  --accent-soft: rgba(0, 113, 227, 0.16);
  --ok: #248a3d;
  --warn: #ff9f0a;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Geist", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Geist Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.22, 0.8, 0.2, 1);
  --shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.06);
  --wall: radial-gradient(60% 50% at 15% 15%, #cfe0ff 0%, transparent 70%), radial-gradient(50% 50% at 90% 25%, #ffd9ea 0%, transparent 70%), radial-gradient(70% 60% at 60% 100%, #ffe6c4 0%, transparent 70%), #eef1f8;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--wall) fixed;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
body.in-book { background: var(--bg); }

button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
h1, h2, h3, p, ul, ol, fieldset { margin: 0; padding: 0; }
ul, ol { list-style: none; }
em { font-style: normal; color: var(--accent); }

/* ---------- Boutons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 52px;
  padding: 0 22px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 500;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 1px 2px rgba(0, 60, 130, 0.35);
  transition: background 0.25s var(--ease), transform 0.2s var(--ease), box-shadow 0.25s;
}
.btn > span::after { content: "→"; display: inline-block; margin-left: 12px; transition: transform 0.4s var(--ease); }
.btn:hover { background: var(--accent-hi); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 4px 12px rgba(0, 113, 227, 0.35); }
.btn:hover > span::after { transform: translateX(4px); }
.btn:active { transform: scale(0.975); background: var(--accent-lo); box-shadow: none; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.btn:disabled { cursor: progress; background: var(--ink-3); box-shadow: none; }
.btn--xl { width: 100%; min-height: 60px; font-size: 1.08rem; }
.btn.is-sending > span::after { content: "…"; animation: blink 1.1s steps(2) infinite; }
.btn.is-sent { background: var(--ok); }
.btn.is-sent > span::after { content: "✓"; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 14px 0 10px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.96rem;
  color: var(--ink-2);
  transition: color 0.25s, background 0.25s, transform 0.2s;
}
.btn-ghost::before { content: "←"; transition: transform 0.4s var(--ease); }
.btn-ghost:hover { color: var(--ink); background: rgba(0, 0, 0, 0.06); }
.btn-ghost:hover::before { transform: translateX(-3px); }
.btn-ghost:active { transform: scale(0.97); background: rgba(0, 0, 0, 0.1); }
.btn-ghost:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-ghost--add { margin-top: 12px; border: 1px dashed var(--line-2); padding: 0 16px 0 12px; }
.btn-ghost--add::before { content: "+"; font-family: var(--mono); }
.btn-ghost--add:hover { border-color: var(--ink); background: var(--panel); }
.btn-ghost--add:hover::before { transform: rotate(90deg); }

.link { font: inherit; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.link:hover { text-decoration-thickness: 2px; }

@keyframes blink { 50% { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- L'accueil ---------- */

.intro, .done {
  position: fixed;
  inset: 0;
  z-index: 5;
  overflow: auto;
  display: grid;
  place-items: center;
  padding: 40px 16px 72px;
  background: var(--wall);
}

.frame { width: min(100%, 660px); animation: rise 0.9s var(--ease) both; }
.win { overflow: hidden; border-radius: 12px; background: var(--panel); box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.2), 0 36px 70px -18px rgba(30, 40, 80, 0.42), 0 10px 20px -10px rgba(0, 0, 0, 0.18); }
.win-bar { display: grid; grid-template-columns: 52px 1fr 52px; align-items: center; gap: 10px; padding: 9px 12px; background: #f6f6f6; border-bottom: 1px solid #dcdcdc; }
.win-bar::after { content: ""; }
.win-dots { display: flex; gap: 8px; }
.win-dots i { width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.14); }
.win-dots i:nth-child(1) { background: #ff5f57; }
.win-dots i:nth-child(2) { background: #febc2e; }
.win-dots i:nth-child(3) { background: #28c840; }
.win-url { display: flex; align-items: center; justify-content: center; min-height: 30px; padding: 0 12px; border-radius: 8px; background: #e9e9eb; font-size: 0.88rem; color: var(--ink); white-space: nowrap; }
.caret { width: 1.5px; height: 1.1em; margin-left: 1px; background: var(--accent); animation: blink 1s steps(2) infinite; }
.win.is-loaded .caret { display: none; }
.win-load { height: 2px; background: transparent; }
.win-load i { display: block; height: 100%; width: 0; background: var(--accent); }
.win.is-loading .win-load i { width: 100%; transition: width 0.85s var(--ease); }
.win.is-loaded .win-load i { opacity: 0; transition: opacity 0.4s 0.2s; }

.win-body { padding: clamp(26px, 7vw, 52px) clamp(20px, 6vw, 52px) clamp(26px, 6vw, 44px); }
.win-body > * { opacity: 0; transform: translateY(12px); transition: opacity 0.7s var(--ease), transform 0.8s var(--ease); }
.win.is-loaded .win-body > * { opacity: 1; transform: none; }
.win-body > :nth-child(2) { transition-delay: 0.08s; }
.win-body > :nth-child(3) { transition-delay: 0.18s; }
.win-body > :nth-child(4) { transition-delay: 0.26s; }
.win-body > :nth-child(5) { transition-delay: 0.36s; }
.win-body > :nth-child(6) { transition-delay: 0.44s; }

.status { display: inline-flex; align-items: center; gap: 8px; padding: 5px 11px 5px 9px; border-radius: 7px; background: var(--bg); font-size: 0.8rem; font-weight: 500; color: var(--ink-2); }
.status i { width: 7px; height: 7px; border-radius: 50%; background: var(--warn); animation: blink 1.6s steps(2) infinite; }
.win-body h1 { margin-top: 20px; font-weight: 600; font-size: clamp(2.2rem, 9.6vw, 3.7rem); line-height: 1.02; letter-spacing: -0.04em; text-wrap: balance; }
.win-lead { margin-top: 18px; font-size: clamp(1.08rem, 4.4vw, 1.25rem); font-weight: 500; line-height: 1.35; letter-spacing: -0.01em; text-wrap: balance; }
.win-text { margin-top: 10px; max-width: 34em; color: var(--ink-2); text-wrap: pretty; }
.win-body .btn { margin-top: 28px; }
.win-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 18px; font-size: 0.82rem; color: var(--ink-3); }
.win-meta i { width: 3px; height: 3px; border-radius: 50%; background: var(--line-2); }

/* ---------- Le brief ---------- */

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0 12px;
  padding: 0 16px;
  background: rgba(245, 245, 247, 0.78);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
.crumb { justify-self: start; display: inline-flex; align-items: center; gap: 6px; min-height: 48px; font-size: 0.9rem; transition: color 0.25s; }
.crumb b { font-weight: 600; }
.crumb span { color: var(--ink-3); }
.crumb:hover b { color: var(--accent); }
.crumb:active { opacity: 0.6; }
.crumb:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 6px; }
.top-where { display: none; font-size: 0.86rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.top-where b { font-weight: 500; color: var(--ink); }
.top-where span { margin-left: 10px; font-family: var(--sans); font-weight: 500; font-size: 0.9rem; color: var(--ink); }
.top-saved { display: inline-flex; align-items: center; gap: 7px; font-size: 0.8rem; color: var(--ink-3); opacity: 0.55; transition: opacity 0.4s, color 0.4s; }
.top-saved i { width: 7px; height: 7px; border-radius: 50%; background: #34c759; transition: box-shadow 0.4s; }
.top-saved.is-on { opacity: 1; color: var(--ink); }
.top-saved.is-on i { box-shadow: 0 0 0 4px rgba(52, 199, 89, 0.22); }
.ticks { grid-column: 1 / -1; display: flex; gap: 3px; margin: 0 -16px; padding: 0 16px; }
.ticks li { flex: 1; }
.ticks button { position: relative; display: block; width: 100%; height: 16px; }
.ticks button::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; border-radius: 2px 2px 0 0; background: var(--line-2); transition: background 0.35s, height 0.25s; }
.ticks button.is-past::before { background: rgba(0, 113, 227, 0.4); }
.ticks button.is-now::before { background: var(--accent); }
.ticks button:hover::before { height: 6px; }
.ticks button:focus-visible { outline: 2px solid var(--accent); outline-offset: -1px; }

.spread { max-width: 1240px; margin: 0 auto; padding: 0 18px; }
.side { display: none; }
.page { max-width: 640px; margin: 0 auto; padding: clamp(30px, 8vw, 60px) 0 36px; }

.page--enter > * { animation: rise 0.7s var(--ease) both; }
.page--enter > :nth-child(2) { animation-delay: 0.05s; }
.page--enter > :nth-child(3) { animation-delay: 0.1s; }
.page--enter > :nth-child(4) { animation-delay: 0.16s; }
.page--enter > :nth-child(5) { animation-delay: 0.22s; }
.page--enter > :nth-child(n + 6) { animation-delay: 0.28s; }

.chapter { font-size: 0.88rem; font-weight: 500; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.chapter b { font-weight: 500; color: var(--accent); }
.title { margin-top: 12px; font-weight: 600; font-size: clamp(2.6rem, 12vw, 4.2rem); line-height: 1; letter-spacing: -0.045em; }
.lead { margin-top: 14px; max-width: 30em; font-size: clamp(1.08rem, 4.4vw, 1.22rem); line-height: 1.4; color: var(--ink-2); text-wrap: pretty; }

.q { margin-top: clamp(36px, 8vw, 48px); }
.q-label { font-weight: 600; font-size: 1.14rem; line-height: 1.25; letter-spacing: -0.015em; }
.q-hint { margin-top: 3px; font-size: 0.94rem; color: var(--ink-2); text-wrap: pretty; }
.q-count { display: block; margin-top: 10px; font-size: 0.82rem; color: var(--ink-3); }

/* Champs */
.field {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 14px 15px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--panel);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.06rem;
  line-height: 1.45;
  outline: 0;
  transition: border-color 0.2s, box-shadow 0.2s;
}
textarea.field { resize: vertical; min-height: 6.2em; }
.field::placeholder { color: var(--ink-3); }
.field:hover { border-color: var(--ink-3); }
.field:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* Suggestions à piocher : bord pointillé, un clic les pose dans le champ */
.ideas { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 10px; }
.ideas > span { flex-basis: 100%; font-size: 0.8rem; color: var(--ink-3); }
.idea {
  min-height: 38px;
  padding: 6px 12px 6px 10px;
  border: 1px dashed var(--line-2);
  border-radius: 8px;
  text-align: left;
  font-size: 0.92rem;
  line-height: 1.3;
  color: var(--ink-2);
  transition: color 0.2s, border-color 0.2s, background 0.2s, transform 0.2s;
}
.idea::before { content: "+ "; font-weight: 500; color: var(--accent); }
.idea:hover { color: var(--accent); border-color: var(--accent); border-style: solid; background: var(--panel); }
.idea:active { transform: scale(0.98); background: var(--accent-soft); border-color: var(--accent); }
.idea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Réponses à cocher */
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 8px 15px;
  border: 0;
  border-radius: 9px;
  background: var(--panel);
  box-shadow: var(--shadow);
  font-size: 0.97rem;
  font-weight: 500;
  line-height: 1.25;
  text-align: left;
  transition: background 0.2s var(--ease), color 0.2s, box-shadow 0.2s, transform 0.15s;
}
.tag::before { content: "✓"; width: 0; overflow: hidden; opacity: 0; font-size: 0.85em; transition: width 0.25s var(--ease), opacity 0.2s, margin 0.25s var(--ease); }
.tag:hover { box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.2), 0 3px 8px rgba(0, 0, 0, 0.1); }
.tag:active { transform: scale(0.97); }
.tag[aria-pressed="true"] { background: var(--accent); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 60, 130, 0.35); }
.tag[aria-pressed="true"]::before { width: 1em; margin-right: 6px; opacity: 1; }
.tag[aria-pressed="true"]:hover { background: var(--accent-hi); }
.tag:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tag-free {
  flex: 1 1 10em;
  min-width: 0;
  min-height: 46px;
  padding: 0 14px;
  border: 1px dashed var(--line-2);
  border-radius: 9px;
  background: transparent;
  font-family: var(--sans);
  font-size: 0.97rem;
  color: var(--ink);
  outline: 0;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.tag-free::placeholder { color: var(--ink-3); }
.tag-free:hover { border-color: var(--ink-3); }
.tag-free:focus { border: 1px solid var(--accent); background: var(--panel); box-shadow: 0 0 0 3px var(--accent-soft); }

/* Cartes à choisir : contour bleu et halo quand elles sont sélectionnées */
.cards { display: grid; gap: 12px; margin-top: 14px; grid-template-columns: repeat(2, 1fr); }
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 7px 7px 13px;
  border: 0;
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
  text-align: left;
  transition: transform 0.25s var(--ease), box-shadow 0.25s;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.16), 0 12px 24px -12px rgba(0, 0, 0, 0.28); }
.card:active { transform: scale(0.985); }
.card[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--accent), 0 0 0 5px var(--accent-soft); }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; }
.card-name { margin: 11px 6px 0; font-weight: 600; font-size: 1.04rem; letter-spacing: -0.015em; }
.card[aria-pressed="true"] .card-name { color: var(--accent); }
.card-text { margin: 3px 6px 0; font-size: 0.86rem; line-height: 1.4; color: var(--ink-2); }
.card--font { container-type: inline-size; }
.specimen { display: grid; align-items: center; min-height: 92px; padding: 10px 8px; border-radius: 9px; background: var(--bg); font-size: 13cqi; line-height: 1; }

/* Vignettes animées */
.art { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 9px; container-type: inline-size; --a1: var(--ink); --a2: var(--accent); --a3: var(--bg); background: var(--a3); }
.art > *, .cube > i { position: absolute; display: block; font-style: normal; }

.art--mood { background: var(--bg); }
.art--mood b { left: 8%; bottom: 4%; font-size: 40cqi; line-height: 1; color: var(--ink); letter-spacing: -0.03em; }
.art--mood i { right: 9%; top: 14%; width: 22cqi; height: 22cqi; border-radius: 50%; background: var(--ac); }
.art--mood u { right: 9%; bottom: 14%; width: 26cqi; height: 1px; background: var(--ink); opacity: 0.5; }

.art--flat i:nth-child(1) { left: 14%; top: 18%; width: 34%; height: 58%; background: var(--a1); }
.art--flat i:nth-child(2) { left: 40%; top: 32%; width: 34%; height: 50%; border: 1px solid var(--a1); }
.art--flat i:nth-child(3) { right: 12%; top: 20%; width: 9%; aspect-ratio: 1; background: var(--a2); }

.art--cube { perspective: 90cqi; }
.cube { left: 50%; top: 50%; width: 30cqi; height: 30cqi; margin: -15cqi; transform-style: preserve-3d; animation: spin 16s linear infinite; }
.cube > i { inset: 0; display: grid; place-items: center; background: var(--a1); border: 1px solid #fff; color: #fff; font-family: var(--sans); font-weight: 600; font-size: 15cqi; opacity: 0.95; }
.cube > i:nth-child(odd) { background: var(--a2); }
.cube > i:nth-child(1) { transform: translateZ(15cqi); }
.cube > i:nth-child(2) { transform: rotateY(90deg) translateZ(15cqi); }
.cube > i:nth-child(3) { transform: rotateY(180deg) translateZ(15cqi); }
.cube > i:nth-child(4) { transform: rotateY(-90deg) translateZ(15cqi); }
.cube > i:nth-child(5) { transform: rotateX(90deg) translateZ(15cqi); }
.cube > i:nth-child(6) { transform: rotateX(-90deg) translateZ(15cqi); }
@keyframes spin { from { transform: rotateX(-22deg) rotateY(0); } to { transform: rotateX(-22deg) rotateY(360deg); } }

.art--depth i { left: 50%; bottom: 0; border: 1px solid var(--a1); border-bottom: 0; border-radius: 999px 999px 0 0; animation: sway 7s ease-in-out infinite alternate; }
.art--depth i:nth-child(1) { width: 12cqi; height: 12cqi; bottom: 22%; margin-left: -6cqi; border: 0; border-radius: 50%; background: var(--a2); --d: 1cqi; }
.art--depth i:nth-child(2) { width: 30cqi; height: 34cqi; margin-left: -15cqi; --d: 3cqi; opacity: 0.5; }
.art--depth i:nth-child(3) { width: 54cqi; height: 46cqi; margin-left: -27cqi; --d: 7cqi; opacity: 0.75; }
.art--depth i:nth-child(4) { width: 84cqi; height: 58cqi; margin-left: -42cqi; --d: 13cqi; border-width: 2px; }
@keyframes sway { from { transform: translateX(calc(var(--d) * -1)); } to { transform: translateX(var(--d)); } }

.art--star i { inset: 0; display: grid; place-items: center; font-size: 26cqi; color: var(--a2); animation: turn 18s linear infinite; }
.art--star::before { content: ""; position: absolute; left: 50%; top: 50%; width: 44cqi; height: 44cqi; margin: -22cqi; border: 1px dashed var(--a1); border-radius: 50%; opacity: 0.45; }
@keyframes turn { to { transform: rotate(360deg); } }

/* Couleurs */
.swatches { display: flex; gap: 14px; margin-top: 14px; }
.swatch { display: grid; cursor: pointer; }
.swatch-chip { position: relative; display: block; width: 76px; height: 76px; border: 1px solid var(--line-2); border-radius: 14px; box-shadow: inset 0 0 0 4px var(--panel); transition: transform 0.25s var(--ease), border-color 0.2s; }
.swatch-chip input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.swatch:hover .swatch-chip { border-color: var(--ink); transform: translateY(-2px); }
.swatch:active .swatch-chip { transform: scale(0.96); }
.swatch-chip:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.swatch-name { margin-top: 8px; font-weight: 600; font-size: 0.95rem; }
.swatch-hex { font-family: var(--mono); font-size: 0.74rem; text-transform: uppercase; color: var(--ink-3); }

/* Curseurs de ton */
.tones { display: grid; gap: 2px; margin-top: 10px; }
.tone { display: grid; grid-template-columns: 5.6em 1fr 5.6em; align-items: center; gap: 12px; font-size: 0.95rem; font-weight: 500; }
.tone span:last-child { text-align: right; }
.tone input { -webkit-appearance: none; appearance: none; width: 100%; height: 46px; margin: 0; background: transparent; cursor: pointer; }
.tone input::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: var(--line-2); }
.tone input::-moz-range-track { height: 4px; border-radius: 2px; background: var(--line-2); }
.tone input::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; margin-top: -10px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.14), 0 2px 6px rgba(0, 0, 0, 0.26); transition: transform 0.2s var(--ease), box-shadow 0.2s; }
.tone input::-moz-range-thumb { width: 24px; height: 24px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.14), 0 2px 6px rgba(0, 0, 0, 0.26); }
.tone input:hover::-webkit-slider-thumb { transform: scale(1.12); }
.tone input:active::-webkit-slider-thumb { transform: scale(1.1); box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.14), 0 2px 6px rgba(0, 0, 0, 0.26), 0 0 0 6px var(--accent-soft); }
.tone input:focus-visible { outline: 2px solid var(--accent); outline-offset: -8px; border-radius: 8px; }

/* Dépôt de fichiers */
.drop {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 2px;
  margin-top: 12px;
  padding: 26px 18px;
  border: 1.5px dashed var(--line-2);
  border-radius: 14px;
  background: var(--panel);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.drop input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.drop::before { content: "↑"; display: grid; place-items: center; width: 38px; height: 38px; margin-bottom: 8px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 600; transition: background 0.2s, transform 0.3s var(--ease); }
.drop-title { font-weight: 600; font-size: 1.04rem; }
.drop-or { font-size: 0.9rem; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; }
.drop:hover { border-color: var(--accent); border-style: solid; }
.drop:hover::before { background: var(--accent); color: #fff; transform: translateY(-3px); }
.drop:active { transform: scale(0.99); }
.drop.is-over { border: 1.5px solid var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.drop.is-over::before { background: var(--accent); color: #fff; }
.drop:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.drop-note { margin-top: 8px; font-size: 0.9rem; color: #b3261e; }
.drop-note:empty { display: none; }
.files { margin-top: 8px; }
.files li { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 12px; min-height: 48px; padding: 0 4px 0 12px; margin-top: 6px; border-radius: 10px; background: var(--panel); box-shadow: var(--shadow); }
.file-name { font-weight: 500; font-size: 0.95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-size { font-size: 0.8rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.file-rm { min-height: 40px; padding: 0 10px; border-radius: 6px; font-size: 0.88rem; color: var(--ink-2); transition: color 0.2s, background 0.2s; }
.file-rm:hover { color: #b3261e; background: rgba(179, 38, 30, 0.08); }
.file-rm:active { background: rgba(179, 38, 30, 0.16); }
.file-rm:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Projets */
.projects { display: grid; gap: 14px; margin-top: 14px; }
.project { position: relative; min-width: 0; padding: 14px 14px 16px; border: 0; border-radius: 14px; background: var(--panel); box-shadow: var(--shadow); }
.project legend { float: left; width: 100%; padding: 0; margin-bottom: 2px; font-size: 0.84rem; font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.project .field { clear: both; background: var(--bg); border-color: var(--line); font-size: 1rem; padding: 12px 13px; }
.project .field:focus { border-color: var(--accent); background: var(--panel); }
.project textarea.field { min-height: 4.4em; }
.project-rm { position: absolute; right: 6px; top: 4px; }

.note { margin-top: 30px; padding: 14px 16px; border-radius: 12px; background: rgba(0, 113, 227, 0.08); font-size: 0.98rem; color: var(--ink); }
.note a { color: var(--accent); font-weight: 500; text-underline-offset: 3px; }

/* Récapitulatif et envoi */
.recap ul { margin-top: 10px; border-radius: 14px; background: var(--panel); box-shadow: var(--shadow); overflow: hidden; }
.recap li + li { border-top: 1px solid var(--line); }
.recap button { display: grid; grid-template-columns: 2.6em 1fr auto; align-items: center; width: 100%; min-height: 50px; padding: 0 14px; text-align: left; transition: background 0.2s; }
.recap button:hover { background: var(--bg); }
.recap button:active { background: var(--accent-soft); }
.recap button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.recap-num { font-size: 0.84rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.recap-name { font-weight: 500; }
.recap-state { font-size: 0.84rem; color: var(--ink-3); }
.recap-state.is-full { color: var(--ok); }

.send { margin-top: 28px; }
.send-cap { margin-top: 12px; font-size: 0.92rem; color: var(--ink-2); text-align: center; text-wrap: balance; }
.log { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: #1d1d1f; color: #d6d6dc; font-family: var(--mono); font-size: 0.76rem; line-height: 1.7; }
.log:empty { display: none; }
.log li { display: flex; justify-content: space-between; gap: 12px; }
.log li span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log li b { font-weight: 400; color: #7ee2a8; }
.log li b.is-wait { color: var(--ink-3); animation: blink 1s steps(2) infinite; }
.log li b.is-bad { color: #ff8f85; }
.send-status { margin-top: 12px; font-size: 0.95rem; color: var(--ink); text-wrap: pretty; }
.send-status:empty { display: none; }

/* Barre du bas */
.foot {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(245, 245, 247, 0.8);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}
.foot .btn-ghost { justify-self: start; }
.foot .btn { justify-self: end; grid-column: 3; }
.peek {
  grid-column: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 14px 0 12px;
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
  font-weight: 500;
  font-size: 0.94rem;
  transition: box-shadow 0.2s, color 0.2s, transform 0.2s;
}
.peek i { width: 12px; height: 15px; border: 1.5px solid var(--accent); border-radius: 2px; box-shadow: inset 0 3px 0 var(--accent); }
.peek:hover { color: var(--accent); box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.2), 0 3px 8px rgba(0, 0, 0, 0.1); }
.peek:active { transform: scale(0.97); }
.peek:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- La maquette ---------- */

.canvas-tag { font-size: 0.84rem; font-weight: 600; color: var(--ink-3); }
.canvas .mock { margin-top: 12px; }
.side-note { margin-top: 14px; font-size: 0.88rem; color: var(--ink-3); }

.m {
  position: relative;
  container-type: inline-size;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 12px;
  background: var(--m-bg);
  color: var(--m-ink);
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.2), 0 30px 50px -22px rgba(30, 40, 80, 0.45);
  font-family: "Manrope", var(--sans);
  transition: background 0.6s var(--ease), color 0.6s var(--ease);
}
.m-bar { display: flex; align-items: center; gap: 1.2cqi; height: 7cqi; padding: 0 3cqi; border-bottom: 1px solid color-mix(in srgb, var(--m-ink) 14%, transparent); }
.m-bar i { width: 2cqi; height: 2cqi; border-radius: 50%; background: #ff5f57; }
.m-bar i:nth-child(2) { background: #febc2e; }
.m-bar i:nth-child(3) { background: #28c840; }
.m-bar span { flex: 1; margin-right: 8cqi; text-align: center; font-size: 2.6cqi; letter-spacing: 0.04em; opacity: 0.6; }
.m-nav { display: flex; align-items: baseline; gap: 3cqi; padding: 4cqi 6cqi 0; font-size: 2.2cqi; letter-spacing: 0.14em; text-transform: uppercase; white-space: nowrap; }
.m-nav b { margin-right: auto; font-family: var(--m-font); font-weight: var(--m-w); font-size: 4.6cqi; letter-spacing: 0; text-transform: none; }
.m-nav span { opacity: 0.7; overflow: hidden; text-overflow: ellipsis; }
.m-nav span:empty { display: none; }
.m-hero { position: relative; z-index: 2; padding: 8cqi 6cqi 0; }
.m-kicker { font-size: 2.5cqi; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: var(--m-ac); }
.m-name { margin: 2.5cqi 0 3cqi; font-family: var(--m-font); font-weight: var(--m-w); font-size: 15.5cqi; line-height: 0.94; letter-spacing: -0.02em; }
.m-tag { max-width: 64%; font-size: 3.5cqi; line-height: 1.45; opacity: 0.82; }
.m-words { margin-top: 3cqi; font-size: 2.2cqi; letter-spacing: 0.2em; text-transform: uppercase; opacity: 0.6; white-space: pre-wrap; }
.m-cta { display: inline-block; margin-top: 4.5cqi; padding: 2.6cqi 4.4cqi; background: var(--m-ac); color: var(--m-bg); font-size: 2.3cqi; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; }
.m-art { position: absolute; z-index: 1; right: -3cqi; bottom: 8cqi; width: 50cqi; }
.m-art .art { background: transparent; overflow: visible; --a1: var(--m-ink); --a2: var(--m-ac); }
.m-art .art--cube .cube > i { background: var(--m-bg); border-color: var(--m-ink); color: var(--m-ac); font-family: var(--m-font); font-weight: var(--m-w); }
.m-art .art--flat i:nth-child(1) { background: var(--m-ac); opacity: 0.9; }
.m-foot { position: absolute; left: 6cqi; right: 6cqi; bottom: 0; display: flex; justify-content: space-between; align-items: center; height: 8cqi; border-top: 1px solid color-mix(in srgb, var(--m-ink) 14%, transparent); font-size: 2.2cqi; letter-spacing: 0.16em; text-transform: uppercase; opacity: 0.6; }

/* Feuillet de la maquette, sur téléphone */
.sheet { width: 100%; max-width: 460px; max-height: 94dvh; margin: auto auto 0; padding: 12px 18px calc(20px + env(safe-area-inset-bottom)); border: 0; border-radius: 18px 18px 0 0; background: var(--bg); color: var(--ink); }
.sheet[open] { animation: sheet 0.5s var(--ease) both; }
.sheet::backdrop { background: rgba(0, 0, 0, 0.35); }
@keyframes sheet { from { transform: translateY(100%); } to { transform: none; } }
.sheet-head { display: flex; justify-content: space-between; align-items: center; }
.sheet-close { min-height: 44px; padding: 0 12px; margin-right: -12px; border-radius: 8px; font-weight: 500; font-size: 0.92rem; color: var(--ink-2); transition: background 0.2s, color 0.2s; }
.sheet-close:hover { color: var(--ink); background: rgba(13, 13, 16, 0.07); }
.sheet-close:active { background: rgba(13, 13, 16, 0.12); }
.sheet-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
.sheet .mock { max-width: min(100%, 54dvh); margin: 8px auto 0; }

/* ---------- Après l'envoi ---------- */

.done { align-content: center; justify-items: center; gap: 14px; text-align: center; }
.done-mark { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; background: #34c759; color: #fff; font-size: 2rem; box-shadow: 0 10px 24px -8px rgba(52, 199, 89, 0.7); animation: rise 0.8s var(--ease) both; }
.done h2 { margin-top: 10px; font-weight: 600; font-size: clamp(2.8rem, 12vw, 4.2rem); line-height: 1; letter-spacing: -0.045em; }
.done p { max-width: 25em; color: var(--ink-2); text-wrap: balance; }
.done .done-sign { font-weight: 600; font-size: 1.2rem; color: var(--ink); }
.done .done-missed { color: #b25000; }

.credit { position: fixed; z-index: 6; left: 0; right: 0; bottom: calc(18px + env(safe-area-inset-bottom)); text-align: center; font-size: 0.78rem; color: var(--ink-3); }
.credit a { color: var(--ink-2); text-underline-offset: 3px; transition: color 0.2s; }
.credit a:hover { color: var(--accent); }
.in-book .credit { position: static; padding: 8px 16px calc(104px + env(safe-area-inset-bottom)); }

/* ---------- Écrans plus larges ---------- */

@media (min-width: 560px) {
  .cards--3 { grid-template-columns: repeat(3, 1fr); }
  .top { grid-template-columns: 1fr auto 1fr; padding: 0 28px; }
  .top-where { display: block; }
  .top-saved { justify-self: end; }
  .ticks { margin: 0 -28px; padding: 0 28px; }
  .foot { padding-inline: 28px; }
}

@media (min-width: 1040px) {
  .top { padding: 0 40px; }
  .ticks { margin: 0 -40px; padding: 0 40px; }
  .spread { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 72px; padding: 0 40px; align-items: start; }
  .page { margin: 0; justify-self: end; width: 100%; }
  .side { display: block; position: sticky; top: 100px; padding: 60px 0 40px; }
  .peek { display: none; }
  .foot { padding-inline: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; }
}
