/* ImageOptimizer — design system. Voir DESIGN.md. Aucune couleur brute hors de :root. */

@font-face {
  font-family: "Hanken Grotesk";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/assets/fonts/hanken-grotesk-latin.woff2") format("woff2");
  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;
}

:root {
  color-scheme: light;

  --paper: #fafafd;
  --surface: #ffffff;
  --ink: #16152b;
  --ink-2: #4a4964;
  --ink-3: #6b6a85;
  --line: #e3e1f1;
  --line-strong: #cfcce6;
  --primary: #4b2fe0;
  --primary-hover: #3b20c6;
  --primary-tint: #efecfd;
  --primary-ring: rgb(75 47 224 / 0.4);
  --success: #0f7a55;
  --success-tint: #e5f5ee;
  --warn: #8a5200;
  --warn-tint: #fff3dc;
  --danger: #c0263a;
  --danger-tint: #fdebed;

  --font: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --t-display: clamp(2.25rem, 5.2vw, 3.75rem);
  --t-h1: clamp(1.875rem, 3.6vw, 2.75rem);
  --t-h2: 1.75rem;
  --t-h3: 1.125rem;
  --t-body: 1rem;
  --t-small: 0.875rem;
  --t-micro: 0.8125rem;

  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;

  --shadow-pop: 0 10px 28px -10px rgb(22 21 43 / 0.25), 0 2px 6px rgb(22 21 43 / 0.06);

  --w-page: 1160px;
  --w-tool: 1080px;
  --w-text: 68ch;

  --ease: 120ms ease-out;
  --ease-open: 200ms ease-out;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--t-body) / 1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--primary); text-underline-offset: 3px; }
a:hover { color: var(--primary-hover); }
p { margin: 0 0 var(--s-4); }
h1, h2, h3 { margin: 0; color: var(--ink); text-wrap: balance; }
ul, ol { margin: 0; padding: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: var(--r-sm); }

.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.icon--lg { width: 24px; height: 24px; }
.icon--sm { width: 16px; height: 16px; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.skip-link { position: absolute; left: var(--s-4); top: -64px; z-index: 100; background: var(--ink); color: var(--surface); padding: var(--s-2) var(--s-4); border-radius: var(--r-md); text-decoration: none; }
.skip-link:focus { top: var(--s-3); color: var(--surface); }

.container { width: 100%; max-width: var(--w-page); margin-inline: auto; padding-inline: var(--s-4); }
.container--tool { max-width: var(--w-tool); }
@media (min-width: 640px) { .container { padding-inline: var(--s-5); } }

.section { padding-block: var(--s-7); }
@media (min-width: 900px) { .section { padding-block: var(--s-8); } }
.section--line { border-top: 1px solid var(--line); }
.section__head { max-width: var(--w-text); margin-bottom: var(--s-6); }
.section__title { font-size: var(--t-h2); line-height: 1.2; font-weight: 700; letter-spacing: -0.02em; }
.section__lead { margin: var(--s-3) 0 0; color: var(--ink-2); }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 44px; padding: 0 var(--s-5);
  border: 1px solid transparent; border-radius: var(--r-md);
  font-weight: 650; font-size: var(--t-body); line-height: 1; text-decoration: none; white-space: nowrap;
  cursor: pointer; background: transparent;
  transition: background-color var(--ease), border-color var(--ease), color var(--ease), transform var(--ease);
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover:not(:disabled) { background: var(--primary-hover); color: #fff; }
.btn--secondary { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn--secondary:hover:not(:disabled) { border-color: var(--ink-3); color: var(--ink); }
.btn--quiet { color: var(--ink-2); padding-inline: var(--s-3); }
.btn--quiet:hover:not(:disabled) { background: var(--primary-tint); color: var(--primary); }
.btn--sm { min-height: 36px; padding-inline: var(--s-3); font-size: var(--t-small); }
.btn--block { width: 100%; }
.btn--icon { width: 36px; min-height: 36px; padding: 0; }

.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin 700ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- En-tête ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgb(250 250 253 / 0.94); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line); }
.site-header__bar { display: flex; align-items: center; gap: var(--s-5); min-height: 64px; }
.logo { display: inline-flex; align-items: center; gap: var(--s-2); color: var(--ink); text-decoration: none; font-weight: 750; font-size: 1.25rem; letter-spacing: -0.03em; }
.logo:hover { color: var(--ink); }
.logo__mark { width: 26px; height: 26px; }
.nav { display: none; flex: 1; align-items: center; gap: var(--s-1); }
.nav__link, .nav__trigger { display: inline-flex; align-items: center; gap: var(--s-1); min-height: 40px; padding: 0 var(--s-3); border: 0; border-radius: var(--r-sm); background: none; color: var(--ink-2); font-weight: 600; font-size: var(--t-small); text-decoration: none; cursor: pointer; transition: color var(--ease), background-color var(--ease); }
.nav__link:hover, .nav__trigger:hover, .nav__trigger[aria-expanded="true"] { color: var(--ink); background: var(--primary-tint); }
.nav__link[aria-current="page"] { color: var(--primary); }
.menu { position: relative; }
.menu__panel { position: absolute; top: calc(100% + 6px); left: 0; z-index: 60; width: 560px; padding: var(--s-3); display: grid; grid-template-columns: 1fr 1fr; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-pop); }
.menu__item { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-2) var(--s-3); border-radius: var(--r-sm); color: var(--ink); font-weight: 600; font-size: var(--t-small); text-decoration: none; }
.menu__item:hover { background: var(--primary-tint); color: var(--primary); }
.menu__item .icon { color: var(--primary); }
.site-header__cta { display: none; margin-left: auto; }
.burger { margin-left: auto; }
@media (min-width: 900px) {
  .nav { display: flex; }
  .site-header__cta { display: inline-flex; margin-left: 0; }
  .burger { display: none; }
}
.drawer { border-top: 1px solid var(--line); background: var(--surface); max-height: calc(100dvh - 64px); overflow-y: auto; }
.drawer__list { list-style: none; display: grid; padding-block: var(--s-3); }
.drawer__link { display: flex; align-items: center; gap: var(--s-3); min-height: 48px; padding: 0 var(--s-2); color: var(--ink); font-weight: 600; text-decoration: none; border-radius: var(--r-sm); }
.drawer__link .icon { color: var(--primary); }
.drawer__link:hover { background: var(--primary-tint); }
@media (min-width: 900px) { .drawer { display: none !important; } }

/* ---------- Accueil : hero ---------- */
.hero { padding-block: var(--s-7) var(--s-6); }
@media (min-width: 900px) { .hero { padding-block: var(--s-8) var(--s-7); } }
.hero__title { font-size: var(--t-h1); line-height: 1.1; font-weight: 750; letter-spacing: -0.03em; max-width: 30ch; }
.hero__lead { margin: var(--s-4) 0 0; max-width: 56ch; font-size: 1.1875rem; color: var(--ink-2); }
.hero__tool { margin-top: var(--s-6); }
.presets { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-bottom: var(--s-4); }
.chip { display: inline-flex; align-items: center; min-height: 36px; padding: 0 var(--s-4); border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--ink-2); font-weight: 650; font-size: var(--t-small); cursor: pointer; transition: all var(--ease); }
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- Page d'outil : en-tête ---------- */
.tool-head { padding-block: var(--s-6) var(--s-5); }
@media (min-width: 900px) { .tool-head { padding-block: var(--s-7) var(--s-5); } }
.crumbs { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: 0 0 var(--s-4); padding: 0; list-style: none; font-size: var(--t-small); color: var(--ink-3); }
.crumbs a { color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { color: var(--primary); text-decoration: underline; }
.crumbs li + li::before { content: "/"; margin-right: var(--s-2); color: var(--line-strong); }
.tool-head__title { font-size: var(--t-h1); line-height: 1.1; font-weight: 750; letter-spacing: -0.03em; max-width: 22ch; }
.tool-head__lead { margin: var(--s-3) 0 0; max-width: 62ch; color: var(--ink-2); font-size: 1.0625rem; }

/* ---------- Outil ---------- */
.tool { display: grid; gap: var(--s-5); align-items: start; }
@media (min-width: 900px) { .tool.has-files { grid-template-columns: minmax(0, 1fr) 320px; } }
.tool:not(.has-files) .tool__side { display: none; }
.tool__main { min-width: 0; display: grid; gap: var(--s-4); }
.tool__side { min-width: 0; }
@media (min-width: 900px) { .tool__side { position: sticky; top: 88px; } }
.tool.is-busy .panel { opacity: 0.6; pointer-events: none; }

.dropzone {
  position: relative; display: grid; place-items: center; text-align: center; gap: var(--s-4);
  min-height: 280px; padding: var(--s-6) var(--s-4);
  border: 1.5px dashed var(--line-strong); border-radius: var(--r-lg); background: var(--surface);
  cursor: pointer; transition: border-color var(--ease), background-color var(--ease);
}
.dropzone:hover { border-color: var(--ink-3); }
.dropzone.is-over { border-style: solid; border-color: var(--primary); background: var(--primary-tint); }
.dropzone:focus-within { border-color: var(--primary); }
.dropzone__input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dropzone__inner { display: grid; justify-items: center; gap: var(--s-3); pointer-events: none; }
.dropzone__icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: var(--r-md); background: var(--primary-tint); color: var(--primary); }
.dropzone__icon .icon { width: 28px; height: 28px; }
.dropzone__title { font-size: 1.375rem; font-weight: 700; letter-spacing: -0.02em; }
.dropzone__hint { margin: 0; color: var(--ink-3); font-size: var(--t-small); }
.dropzone__btn { pointer-events: none; }
.dropzone--compact { min-height: 0; grid-auto-flow: column; justify-content: center; padding: var(--s-4); }
.dropzone--compact .dropzone__icon { width: 36px; height: 36px; }
.dropzone--compact .dropzone__icon .icon { width: 20px; height: 20px; }
.dropzone--compact .dropzone__inner { grid-auto-flow: column; gap: var(--s-3); }
.dropzone--compact .dropzone__title { font-size: var(--t-body); }
.dropzone--compact .dropzone__hint, .dropzone--compact .dropzone__btn { display: none; }

.trust { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); margin: var(--s-3) 0 0; padding: 0; list-style: none; color: var(--ink-3); font-size: var(--t-small); }
.trust li { display: inline-flex; align-items: center; gap: var(--s-2); }
.trust .icon { color: var(--success); width: 18px; height: 18px; }

/* Panneau d'options */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.panel__section { padding: var(--s-4); display: grid; gap: var(--s-4); }
.panel__section + .panel__section { border-top: 1px solid var(--line); }
.panel__title { font-size: var(--t-h3); line-height: 1.35; font-weight: 650; }
.panel__foot { padding: var(--s-4); border-top: 1px solid var(--line); display: grid; gap: var(--s-3); }
.field { display: grid; gap: var(--s-2); min-width: 0; }
.field__label { display: flex; justify-content: space-between; align-items: baseline; font-size: var(--t-small); font-weight: 650; color: var(--ink); }
.field__value { color: var(--primary); font-variant-numeric: tabular-nums; font-weight: 700; }
.field__help { margin: 0; font-size: var(--t-micro); color: var(--ink-3); line-height: 1.45; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
.input, .select {
  width: 100%; min-height: 44px; padding: 0 var(--s-3);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  transition: border-color var(--ease), box-shadow var(--ease);
}
.input:hover, .select:hover { border-color: var(--ink-3); }
.input:focus, .select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-ring); }
.input[aria-invalid="true"] { border-color: var(--danger); }
.select { appearance: none; padding-right: var(--s-6); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b6a85' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; }
.input--color { padding: 4px; }
.range { width: 100%; height: 24px; accent-color: var(--primary); cursor: pointer; }
.check { display: flex; align-items: flex-start; gap: var(--s-3); font-size: var(--t-small); cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--primary); flex: none; }
.check__text { display: grid; gap: 2px; }
.check__help { font-size: var(--t-micro); color: var(--ink-3); }

.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; padding: 2px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); }
.segmented__btn { min-height: 36px; padding: 0 var(--s-2); border: 0; border-radius: var(--r-sm); background: none; color: var(--ink-2); font-weight: 650; font-size: var(--t-small); cursor: pointer; transition: all var(--ease); }
.segmented__btn:hover { color: var(--ink); }
.segmented__btn[aria-pressed="true"] { background: var(--surface); color: var(--primary); box-shadow: 0 0 0 1px var(--line-strong); }
.tilegrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-2); }
.tilebtn { display: grid; place-items: center; gap: 2px; min-height: 52px; padding: var(--s-2); border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--ink-2); font-size: var(--t-micro); font-weight: 650; cursor: pointer; transition: all var(--ease); }
.tilebtn:hover { border-color: var(--ink-3); color: var(--ink); }
.tilebtn[aria-pressed="true"] { border-color: var(--primary); background: var(--primary-tint); color: var(--primary); }
.poslist { display: grid; grid-template-columns: repeat(3, 28px); gap: 4px; }
.poslist .tilebtn { min-height: 28px; padding: 0; }
.poslist .tilebtn::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

details.advanced > summary { display: flex; align-items: center; justify-content: space-between; cursor: pointer; list-style: none; font-size: var(--t-small); font-weight: 650; color: var(--ink-2); }
details.advanced > summary::-webkit-details-marker { display: none; }
details.advanced > summary .icon { transition: transform var(--ease-open); }
details.advanced[open] > summary .icon { transform: rotate(180deg); }
details.advanced > .advanced__body { display: grid; gap: var(--s-4); margin-top: var(--s-4); }

/* Notes et alertes */
.alert { display: flex; gap: var(--s-3); padding: var(--s-3) var(--s-4); border-radius: var(--r-md); border-left: 3px solid var(--ink-3); background: var(--paper); font-size: var(--t-small); line-height: 1.5; }
.alert .icon { margin-top: 1px; }
.alert--info { border-color: var(--warn); background: var(--warn-tint); color: var(--warn); }
.alert--error { border-color: var(--danger); background: var(--danger-tint); color: var(--danger); }
.alert--success { border-color: var(--success); background: var(--success-tint); color: var(--success); }
.alert__body { color: var(--ink); }
.alert--info .alert__body, .alert--error .alert__body, .alert--success .alert__body { color: var(--ink); }
.note { display: flex; gap: var(--s-2); margin: 0; font-size: var(--t-micro); color: var(--ink-3); line-height: 1.45; }
.note .icon { width: 16px; height: 16px; margin-top: 1px; color: var(--ink-3); }

/* Liste de fichiers */
.files { display: grid; gap: var(--s-2); list-style: none; }
.file { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--s-3); align-items: center; padding: var(--s-3); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.file.is-error { border-color: var(--danger); }
.file__thumbs { display: flex; align-items: center; gap: var(--s-2); color: var(--ink-3); }
.file__thumb { width: 56px; height: 56px; border-radius: var(--r-sm); background: var(--paper) center / cover no-repeat; border: 1px solid var(--line); object-fit: cover; }
.file__thumb--after { border-color: var(--success); }
.file__body { min-width: 0; display: grid; gap: 2px; }
.file__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; font-size: var(--t-small); }
.file__meta { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 2px var(--s-3); font-size: var(--t-micro); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.file__badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); font-weight: 650; color: var(--ink-2); }
.file__badge--server { background: var(--warn-tint); border-color: transparent; color: var(--warn); }
.file__badge .icon { width: 12px; height: 12px; }
.file__error { margin: 0; font-size: var(--t-micro); color: var(--danger); font-weight: 600; }
.file__actions { display: flex; align-items: center; gap: var(--s-2); }
.progress { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; margin-top: var(--s-2); }
.progress__bar { height: 100%; width: 0; background: var(--primary); transition: width var(--ease-open); }
.progress--indeterminate .progress__bar { width: 40%; animation: slide 1.1s ease-in-out infinite; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }

/* Jauge d'économie : le poids réel avant / après */
.saving { display: grid; gap: 4px; margin-top: var(--s-2); }
.saving__track { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.saving__fill { height: 100%; background: var(--success); border-radius: 3px; transition: width var(--ease-open); }
.saving--grew .saving__fill { background: var(--warn); }
.saving__text { display: flex; flex-wrap: wrap; gap: 2px var(--s-3); font-size: var(--t-micro); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.saving__pct { font-weight: 750; color: var(--success); }
.saving--grew .saving__pct { color: var(--warn); }

.summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3) var(--s-5); padding: var(--s-4); background: var(--success-tint); border: 1px solid transparent; border-radius: var(--r-md); }
.summary__text { display: grid; gap: 2px; }
.summary__title { font-weight: 700; color: var(--success); }
.summary__detail { font-size: var(--t-small); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.summary__actions { display: flex; flex-wrap: wrap; gap: var(--s-2); }

/* Recadrage */
.cropper { position: relative; margin-inline: auto; width: fit-content; max-width: 100%; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; touch-action: none; user-select: none; }
.cropper__img { display: block; max-width: 100%; max-height: 460px; width: auto; height: auto; }
.cropper__shade { position: absolute; inset: 0; pointer-events: none; }
.cropper__box { position: absolute; border: 2px solid var(--surface); box-shadow: 0 0 0 9999px rgb(22 21 43 / 0.5); cursor: move; outline: 1px solid var(--primary); }
.cropper__handle { position: absolute; width: 18px; height: 18px; background: var(--surface); border: 2px solid var(--primary); border-radius: 4px; }
.cropper__handle[data-h="nw"] { left: -9px; top: -9px; cursor: nwse-resize; }
.cropper__handle[data-h="ne"] { right: -9px; top: -9px; cursor: nesw-resize; }
.cropper__handle[data-h="sw"] { left: -9px; bottom: -9px; cursor: nesw-resize; }
.cropper__handle[data-h="se"] { right: -9px; bottom: -9px; cursor: nwse-resize; }
.resizer__stage { position: relative; margin-inline: auto; max-width: 100%; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); touch-action: none; user-select: none; }
.resizer__orig { position: absolute; left: 0; top: 0; border: 1px dashed var(--ink-3); pointer-events: none; }
.resizer__box { position: absolute; left: 0; top: 0; outline: 2px solid var(--primary); }
.resizer__box:focus-visible { outline-width: 3px; outline-offset: 2px; }
.resizer__img { display: block; width: 100%; height: 100%; pointer-events: none; }
.resizer__handle[data-rh="e"] { right: -9px; top: calc(50% - 9px); cursor: ew-resize; }
.resizer__handle[data-rh="s"] { bottom: -9px; left: calc(50% - 9px); cursor: ns-resize; }
.resizer__handle[data-rh="se"] { right: -9px; bottom: -9px; cursor: nwse-resize; }
.cropper__info { text-align: center; margin: var(--s-2) 0 0; font-size: var(--t-small); color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* Notifications */
.toasts { position: fixed; right: var(--s-4); bottom: var(--s-4); left: var(--s-4); z-index: 90; display: grid; gap: var(--s-2); justify-items: end; pointer-events: none; }
.toast { display: flex; align-items: center; gap: var(--s-3); max-width: 420px; padding: var(--s-3) var(--s-4); background: var(--ink); color: #fff; border-radius: var(--r-md); box-shadow: var(--shadow-pop); font-size: var(--t-small); pointer-events: auto; animation: toast-in var(--ease-open) both; }
.toast--error { background: var(--danger); }
.toast--success .icon { color: #7ee3b8; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Grille d'outils ---------- */
.toolgrid { display: grid; gap: var(--s-4); list-style: none; grid-template-columns: 1fr; }
@media (min-width: 640px) { .toolgrid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .toolgrid { grid-template-columns: repeat(4, 1fr); } }
.toolcard { display: grid; grid-template-rows: auto auto 1fr auto; gap: var(--s-3); height: 100%; padding: var(--s-5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); color: var(--ink); text-decoration: none; transition: border-color var(--ease), transform var(--ease); }
.toolcard:hover { border-color: var(--primary); color: var(--ink); transform: translateY(-2px); }
.toolcard__icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-sm); background: var(--primary-tint); color: var(--primary); }
.toolcard__title { font-size: var(--t-h3); font-weight: 650; line-height: 1.3; }
.toolcard__desc { margin: 0; color: var(--ink-2); font-size: var(--t-small); line-height: 1.55; }
.toolcard__tag { font-size: var(--t-micro); font-weight: 650; color: var(--ink-3); }
.toolcard:hover .toolcard__tag { color: var(--primary); }

/* ---------- Contenus ---------- */
.steps { display: grid; gap: var(--s-5); list-style: none; counter-reset: step; }
@media (min-width: 900px) { .steps { grid-template-columns: repeat(3, 1fr); gap: var(--s-6); } }
.step { counter-increment: step; display: grid; gap: var(--s-2); align-content: start; padding-top: var(--s-4); border-top: 2px solid var(--ink); }
.step::before { content: counter(step); font-weight: 750; font-size: var(--t-h2); line-height: 1; letter-spacing: -0.03em; color: var(--primary); }
.step__title { font-size: var(--t-h3); font-weight: 650; }
.step__text { margin: 0; color: var(--ink-2); }

.split { display: grid; gap: var(--s-6); }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1.4fr; gap: var(--s-8); } }
.facts { display: grid; gap: 0; list-style: none; }
.fact { display: grid; grid-template-columns: auto 1fr; gap: var(--s-4); padding-block: var(--s-4); border-top: 1px solid var(--line); }
.fact:last-child { border-bottom: 1px solid var(--line); }
.fact .icon { color: var(--primary); margin-top: 2px; }
.fact__title { font-weight: 650; }
.fact__text { margin: 2px 0 0; color: var(--ink-2); font-size: var(--t-small); line-height: 1.55; }

.prose { max-width: var(--w-text); }
.prose h2 { font-size: var(--t-h2); line-height: 1.2; font-weight: 700; letter-spacing: -0.02em; margin: var(--s-7) 0 var(--s-3); }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: var(--t-h3); font-weight: 650; margin: var(--s-5) 0 var(--s-2); }
.prose p, .prose li { color: var(--ink-2); }
.prose ul, .prose ol { padding-left: 1.25rem; margin: 0 0 var(--s-4); display: grid; gap: var(--s-2); }
.prose strong { color: var(--ink); }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 var(--s-4); font-size: var(--t-small); }
.prose th, .prose td { text-align: left; padding: var(--s-2) var(--s-3); border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { color: var(--ink); font-weight: 650; }
.prose td { color: var(--ink-2); }

.faq { max-width: var(--w-text); border-top: 1px solid var(--line); }
.faq__item { border-bottom: 1px solid var(--line); }
.faq__q { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); padding-block: var(--s-4); cursor: pointer; list-style: none; font-weight: 650; }
.faq__q::-webkit-details-marker { display: none; }
.faq__q .icon { color: var(--ink-3); transition: transform var(--ease-open); }
.faq__item[open] .faq__q .icon { transform: rotate(180deg); color: var(--primary); }
.faq__a { padding-bottom: var(--s-4); color: var(--ink-2); }
.faq__a p:last-child { margin-bottom: 0; }

.related { display: flex; flex-wrap: wrap; gap: var(--s-2); list-style: none; }
.related a { display: inline-flex; align-items: center; gap: var(--s-2); min-height: 40px; padding: 0 var(--s-4); border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); color: var(--ink); font-weight: 600; font-size: var(--t-small); text-decoration: none; transition: all var(--ease); }
.related a:hover { border-color: var(--primary); color: var(--primary); }
.related .icon { color: var(--primary); }

/* ---------- Publicité (rendue seulement si configurée) ---------- */
.ad { display: grid; gap: 4px; margin-block: var(--s-6); justify-items: center; }
.ad__label { font-size: var(--t-micro); color: var(--ink-3); }
.ad__slot { width: 100%; max-width: 728px; min-height: 90px; display: block; }
.ad--rect .ad__slot { max-width: 336px; min-height: 280px; }

.consent { position: fixed; left: var(--s-4); right: var(--s-4); bottom: var(--s-4); z-index: 80; max-width: 560px; padding: var(--s-5); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-md); box-shadow: var(--shadow-pop); display: grid; gap: var(--s-3); }
.consent__title { font-size: var(--t-h3); font-weight: 650; }
.consent__text { margin: 0; font-size: var(--t-small); color: var(--ink-2); }
.consent__actions { display: flex; flex-wrap: wrap; gap: var(--s-2); }

/* ---------- Pied de page ---------- */
.site-footer { margin-top: var(--s-8); padding-block: var(--s-7) var(--s-6); border-top: 1px solid var(--line); background: var(--surface); }
.footer__grid { display: grid; gap: var(--s-6); }
@media (min-width: 900px) { .footer__grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.footer__about { max-width: 34ch; margin: var(--s-3) 0 0; color: var(--ink-2); font-size: var(--t-small); }
.footer__title { font-size: var(--t-small); font-weight: 700; margin-bottom: var(--s-3); }
.footer__list { list-style: none; display: grid; gap: var(--s-2); }
.footer__list a { color: var(--ink-2); font-size: var(--t-small); text-decoration: none; }
.footer__list a:hover { color: var(--primary); text-decoration: underline; }
.footer__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-2) var(--s-5); margin-top: var(--s-7); padding-top: var(--s-5); border-top: 1px solid var(--line); font-size: var(--t-micro); color: var(--ink-3); }
.footer__bottom a { color: inherit; }
.footer__bottom a:hover { color: var(--primary); }
.footer__bottom button { background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; cursor: pointer; font-size: inherit; }

.page-simple { padding-block: var(--s-7) var(--s-6); }
.page-simple h1 { font-size: var(--t-h1); line-height: 1.1; font-weight: 750; letter-spacing: -0.03em; margin-bottom: var(--s-3); }
.page-simple .meta { color: var(--ink-3); font-size: var(--t-small); margin-bottom: var(--s-6); }
.placeholder { background: var(--warn-tint); color: var(--warn); padding: 0 4px; border-radius: 3px; font-weight: 650; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

@media (max-width: 639px) {
  .file { grid-template-columns: minmax(0, 1fr) auto; }
  .file__thumbs { grid-column: 1 / -1; }
  .menu__panel { width: 92vw; grid-template-columns: 1fr; }
  .dropzone:not(.dropzone--compact) { min-height: 240px; }
}
