/* Figtree (SIL OFL 1.1, assets/fonts/OFL.txt), self-hosted: no request to
   Google Fonts, so visitors' IP addresses are never sent to a third party.
   Variable font, weights 300-900, split in latin / latin-ext subsets. */
@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-display: swap;
  font-weight: 300 900;
  src: url("/assets/fonts/figtree-latin-wght-normal.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;
}
@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-display: swap;
  font-weight: 300 900;
  src: url("/assets/fonts/figtree-latin-ext-wght-normal.woff2") format("woff2");
  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;
}

/* ==========================================================================
   Webconvert.fr — charte « Pierre »
   Soft stone background, one application window for the tool, Figtree.
   Colours: --bg #e7e4dd (stone), --win #fbfaf8 (window), --side #f2f0eb
   (sidebar), --ink #23221f (text), --muted #5d5a53 (secondary
   text, 5.4:1 on --bg), --line #dcd8cf (hairlines), --ok #2f6b3b (gains),
   --accent #5f6f1d (olive: buttons, icons, links; 6.1:1 with white,
   --accent-text #59681b reads 4.8:1 on --bg).
   ========================================================================== */

:root {
  --bg: #e7e4dd;
  --win: #fbfaf8;
  --side: #f2f0eb;
  --ink: #23221f;
  --text: #3a3833;
  --muted: #5d5a53;
  --line: #dcd8cf;
  --line-strong: #c9c4b9;
  --dash: #bdb8ad;
  --seg: #e6e3dc;
  --track: #d5d1c7;
  --bar: #ebe8e1;
  --ok: #2f6b3b;
  --accent: #5f6f1d;
  --accent-hover: #515e19;
  --accent-text: #59681b;
  --accent-soft: #e5e8db;
  --accent-line: #b7be99;
  --error: #8f2a1c;
  --white: #fff;

  --font: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;

  --radius-win: 18px;
  --radius-box: 14px;
  --radius: 10px;
  --shadow-win: 0 1px 2px rgba(35, 34, 31, 0.06);

  --gutter: 40px;
  --wrap: 1280px;
}

@media (max-width: 899px) {
  :root { --gutter: 24px; }
}
@media (max-width: 639px) {
  :root { --gutter: 16px; }
}

* { box-sizing: border-box; }

html {
  background: var(--bg);
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; }
img { max-width: 100%; }
button, input, select { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent-text);
  outline-offset: 2px;
}

.wrap {
  width: min(var(--wrap), 100% - 2 * var(--gutter));
  margin-inline: auto;
}

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

.skip-link {
  position: absolute;
  left: 16px;
  top: -64px;
  z-index: 100;
  background: var(--accent);
  color: var(--white);
  padding: 12px 16px;
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.btn--dark {
  background: var(--accent);
  color: var(--white);
}
.btn--dark:hover { background: var(--accent-hover); }
.btn:disabled { cursor: progress; opacity: 0.7; }
.btn[hidden] { display: none; }

/* ---------- Header ---------- */

.site-header {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand__mark {
  position: relative;
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--accent);
}
.brand__mark::after {
  content: "";
  position: absolute;
  inset: 7px;
  border: 2px solid var(--bg);
  border-radius: 3px;
}

.site-nav {
  display: flex;
  gap: 4px;
  font-size: 15px;
  font-weight: 500;
}
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 8px;
  text-decoration: none;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-text); }

/* "Outils" menu (native <details>, closed on outside click by js/nav.js) */
.nav-menu { position: relative; }
.nav-menu summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 8px;
  cursor: pointer;
  list-style: none;
}
.nav-menu summary::-webkit-details-marker { display: none; }
.nav-menu summary .icon { transition: transform 0.15s ease; }
.nav-menu[open] summary .icon { transform: rotate(180deg); }
.nav-menu summary:hover,
.nav-menu[open] summary,
.nav-menu summary[aria-current="page"] { background: var(--accent-soft); color: var(--accent-text); }
.nav-menu summary:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.nav-menu__panel {
  position: absolute;
  z-index: 60;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 20px 28px;
  width: min(760px, calc(100vw - 32px));
  padding: 22px 24px 18px;
  background: var(--win);
  border: 1px solid var(--line);
  border-radius: var(--radius-box);
  box-shadow: var(--shadow-win);
}
.nav-menu__panel ul { margin: 8px 0 0; padding: 0; list-style: none; }
.site-nav .nav-menu__panel a {
  display: block;
  min-height: 0;
  padding: 5px 0;
  border-radius: 0;
  font-size: 14.5px;
  color: var(--text);
}
.site-nav .nav-menu__panel a:hover { background: none; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.site-nav .nav-menu__panel .nav-menu__cat {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}
.site-nav .nav-menu__panel .nav-menu__all {
  grid-column: 1 / -1;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-weight: 600;
  color: var(--accent-text);
}

/* ---------- Breadcrumbs ---------- */

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 8px;
  font-size: 14px;
  color: var(--muted);
}
.breadcrumbs a {
  text-decoration: none;
  padding: 4px 0;
}
.breadcrumbs a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.breadcrumbs [aria-current] { color: var(--accent-text); font-weight: 500; }

/* ---------- Intro (tool pages) ----------
   Fixed height on desktop, text bottom-aligned: the tool window below
   starts at the same y on every tool page whatever the headline length. */

.intro {
  position: relative;
  /* min-height, not height: a three-line headline grows the band instead of
     climbing over the breadcrumbs (padding-top keeps their room). */
  min-height: 300px;
  padding-top: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 44px;
  text-align: center;
}
.intro .breadcrumbs {
  position: absolute;
  top: 12px;
  left: 0;
  right: 0;
  justify-content: center;
}
.intro h1 {
  max-width: 760px;
  margin: 0 auto 16px;
  font-size: 58px;
  line-height: 1.06;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.intro p {
  max-width: 640px;
  margin: 0 auto;
  font-size: 18px;
  color: var(--muted);
  text-wrap: pretty;
}

/* ---------- Application window ---------- */

.app {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: 480px;
  background: var(--win);
  border: 1px solid var(--line);
  border-radius: var(--radius-win);
  box-shadow: var(--shadow-win);
  overflow: hidden;
}

.app__side {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 24px;
  background: var(--side);
  border-right: 1px solid var(--line);
}

.side-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 20px;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

/* Format picker: native selects over a styled face */
.picker {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin: 0;
}

.fcard {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 12px 0 14px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
}
.fcard:hover { border-color: var(--line-strong); }
.fcard:focus-within {
  outline: 2px solid var(--accent-text);
  outline-offset: 2px;
}
.fcard__label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fcard__hint {
  flex: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}
.fcard:not(.is-empty) .fcard__hint { display: none; }
.fcard__chevron {
  display: flex;
  flex: none;
  color: var(--muted);
}
.fcard__select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  font-size: 16px;
  appearance: none;
}

.swap {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  margin-right: -8px;
  padding: 0 8px;
  background: none;
  border: 0;
  border-radius: 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
/* 44px hit area around a compact visual */
.swap::after {
  content: "";
  position: absolute;
  inset: -8px -4px;
}
.swap:hover:not(:disabled) { background: rgba(35, 34, 31, 0.07); }
.swap:disabled {
  color: var(--muted);
  opacity: 0.55;
  cursor: not-allowed;
}

/* Quality */
.quality.is-hidden { display: none; }
.quality__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.quality__row .side-label { margin: 0; }
.quality__value {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}

.slider {
  position: relative;
  height: 44px;
  margin: -8px 0 -12px;
  cursor: pointer;
  touch-action: none;
}
.slider:focus-visible { outline: none; }
.slider__track {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 6px;
  margin-top: -3px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--track);
}
.slider__fill {
  width: 66.67%;
  height: 100%;
  background: var(--accent);
}
.slider__thumb {
  position: absolute;
  top: 50%;
  left: 66.67%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  background: var(--white);
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.06);
}
.slider:focus-visible .slider__thumb {
  outline: 2px solid var(--accent-text);
  outline-offset: 2px;
}
.quality__note {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.app__privacy {
  display: flex;
  gap: 10px;
  margin: auto 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}
.app__privacy .icon {
  flex: none;
  margin-top: 1px;
}

/* Main pane */
.app__main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 24px 28px;
  container-type: inline-size;
}

.dropzone {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  min-height: 128px;
  padding: 20px;
  background: color-mix(in srgb, var(--accent-soft) 60%, transparent);
  border: 1.5px dashed var(--accent-line);
  border-radius: var(--radius-box);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.app__main.has-files .dropzone { flex: 0 0 128px; }
.dropzone.is-dragover {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.dropzone__title {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
}
.dropzone__hint {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.tool-notice {
  display: none;
  margin: 14px 0 0;
  padding: 10px 14px;
  background: #f5e6e1;
  color: var(--error);
  border-radius: var(--radius);
  font-size: 14px;
}
.tool-notice.is-visible { display: block; }

/* File list (rows rendered by js/ui.js) */
.files {
  display: none;
  flex: 1;
  flex-direction: column;
  margin-top: 18px;
}
.files.is-visible { display: flex; }
.files__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.file {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 120px 150px 64px 44px;
  align-items: center;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.file__thumb {
  display: block;
  width: 48px;
  height: 36px;
  overflow: hidden;
  border-radius: 6px;
  background: var(--bar);
}
.file__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.file__name {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.file__filename {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 600;
}
.file__conv {
  font-size: 13px;
  color: var(--muted);
}
.file__bar {
  position: relative;
  height: 6px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--bar);
}
.file__bar i {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0;
  border-radius: 3px;
  background: var(--ok);
}
.file.is-converting .file__bar i {
  width: 35%;
  opacity: 0.45;
  animation: file-progress 0.9s ease-in-out infinite alternate;
}
@keyframes file-progress {
  from { left: 0; }
  to { left: 65%; }
}
.file.is-grew .file__bar i { background: var(--dash); }
.file__size {
  font-size: 14px;
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
}
.file.is-error .file__size { color: var(--error); }
.file__gain {
  font-size: 15px;
  font-weight: 700;
  color: var(--ok);
  text-align: right;
  white-space: nowrap;
}
.file.is-grew .file__gain { color: var(--muted); }
/* Compression pages: the result is still above the chosen weight limit. */
.file.is-over .file__bar i { background: var(--error); }
.file.is-over .file__gain,
.file.is-over .file__conv { color: var(--error); }
.file__dl {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  cursor: pointer;
}
.file__dl:hover { border-color: var(--accent); }

.files__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  margin-top: auto;
  padding-top: 18px;
}
.files__summary {
  font-size: 14px;
  color: var(--muted);
}

@container (max-width: 620px) {
  .file {
    grid-template-columns: 44px minmax(0, 1fr) auto 44px;
    grid-template-areas:
      "th name gain dl"
      "th size gain dl";
    column-gap: 12px;
    row-gap: 0;
  }
  .file__thumb { grid-area: th; width: 44px; height: 44px; }
  .file__name { grid-area: name; }
  .file__conv { display: none; }
  .file.is-over .file__conv { display: block; }
  .file__bar { display: none; }
  .file__size { grid-area: size; text-align: left; font-size: 13px; }
  .file__gain { grid-area: gain; }
  .file__dl, .file__dl-slot { grid-area: dl; }
}

/* ---------- Tool cards (homepage + /outils/) ---------- */
.sec-wide {
  padding: 48px 0;
  border-top: 1px solid var(--line);
}
.app + .sec-wide { margin-top: 8px; border-top: 0; }
.sec-wide__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 24px;
  margin-bottom: 24px;
}
.sec-wide__head h2 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.sec-wide__head .sec__intro { flex: 1 1 360px; margin: 0; }
.tool-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tool-cards li[hidden] { display: none; }
.tool-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
  padding: 18px 18px 20px;
  color: var(--ink);
  text-decoration: none;
  background: var(--win);
  border: 1px solid var(--line);
  border-radius: var(--radius-box);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.tool-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.tool-card:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.tool-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-bottom: 8px;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent-text);
}
.tool-card__title { font-size: 16px; font-weight: 700; line-height: 1.25; }
.tool-card__desc { font-size: 14px; line-height: 1.45; color: var(--muted); }

.cat-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 20px;
}
.cat-tabs[hidden] { display: none; }
.cat-tab {
  min-height: 40px;
  padding: 0 16px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  background: var(--win);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
}
.cat-tab:hover { border-color: var(--accent); }
.cat-tab {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.tool-group {
  padding: 32px 0 8px;
  scroll-margin-top: 16px;
}
.tool-group + .tool-group { border-top: 1px solid var(--line); }
.tool-group__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 20px;
  margin-bottom: 18px;
}
.tool-group__head h2 { margin: 0; font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.tool-group__head .sec__intro { flex: 1 1 360px; margin: 0; }
.cat-tab:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }

/* Measured results on threshold pages */
.measures {
  width: 100%;
  margin: 0 0 18px;
  border-collapse: collapse;
  font-size: 15px;
}
.measures th,
.measures td {
  padding: 10px 12px 10px 0;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.measures thead th { font-size: 13px; font-weight: 600; color: var(--muted); }
.measures tbody th { font-weight: 600; color: var(--text); }
.measures td { font-variant-numeric: tabular-nums; color: var(--ink); }
.measures__note { font-size: 14px; color: var(--muted); }
@media (max-width: 639px) {
  .measures { font-size: 13.5px; }
  .measures th, .measures td { padding-right: 8px; }
}

/* Official spec table on platform pages */
.spec {
  width: 100%;
  margin: 0 0 18px;
  border-collapse: collapse;
  font-size: 15px;
}
.spec th,
.spec td {
  padding: 10px 0;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.spec th { width: 38%; padding-right: 16px; font-weight: 600; color: var(--muted); }
.spec td { color: var(--ink); font-weight: 600; }
.spec a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 2px; font-weight: 500; }

/* ---------- Tools: resize, PDF, metadata ---------- */
.dims {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dims__box { flex: 1; min-width: 0; }
.dims input {
  width: 100%;
  height: 48px;
  padding: 0 12px;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.dims input:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.dims input:disabled { color: var(--muted); background: var(--seg); }
.dims__x { color: var(--muted); font-weight: 600; }
.check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--text);
  cursor: pointer;
}
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }

.side-list {
  margin: 0;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
}

.editor {
  margin-top: 18px;
  padding: 16px;
  background: var(--side);
  border: 1px solid var(--line);
  border-radius: var(--radius-box);
}
.editor[hidden] { display: none; }
.editor__stage {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 120px;
  /* Checkerboard behind the frame: shows transparent areas (PNG/WebP). */
  background: repeating-conic-gradient(#e9e6df 0 25%, #f4f2ed 0 50%) 0 0 / 16px 16px;
  border-radius: var(--radius);
  overflow: hidden;
}
.editor__canvas {
  display: block;
  max-width: 100%;
  cursor: grab;
  touch-action: none;
  box-shadow: 0 0 0 1px var(--line-strong);
}
.editor__canvas:active { cursor: grabbing; }
.editor__canvas:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 3px; }
.editor.is-static .editor__canvas { cursor: default; }
.editor.is-static .editor__bar { display: none; }
.editor__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
  margin-top: 12px;
}
.editor__zoom {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}
.editor__zoom input { width: 180px; accent-color: var(--ok); }
.editor__hint { font-size: 13px; color: var(--muted); }
.editor__zones-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}
.editor__zones-toggle[hidden] { display: none; }
.editor__zones-toggle input { width: 18px; height: 18px; margin: 0; accent-color: #c9521c; }
.editor__legend {
  display: grid;
  gap: 6px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--text);
}
.editor__legend[hidden] { display: none; }
.editor__legend li { display: flex; gap: 8px; align-items: flex-start; }
.editor__swatch {
  flex: none;
  width: 14px;
  height: 14px;
  margin-top: 2px;
  border: 2px solid var(--zone, #c9521c);
  border-radius: 3px;
}
.editor__swatch.is-hatched {
  border-style: dashed;
  background: repeating-linear-gradient(-45deg, rgba(201, 82, 28, 0.5) 0 2px, rgba(201, 82, 28, 0.15) 2px 5px);
}

.file__pick {
  padding: 0;
  font: inherit;
  text-align: left;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}
.file__pick:hover .file__filename { text-decoration: underline; text-underline-offset: 3px; }
.file.is-selected { box-shadow: inset 3px 0 0 var(--ok); padding-left: 8px; }

/* PDF: page order controls in place of bar/size/gain/download */
.app--pdf .file { grid-template-columns: 48px minmax(0, 1fr) auto; }
.file__acts { display: flex; gap: 6px; }
.file__act {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
}
.file__act:hover:not(:disabled) { border-color: var(--accent); }
.file__act:disabled { opacity: 0.35; cursor: default; }
.files__summary.is-over { color: var(--error); }

/* Metadata: what was found, under each row */
.meta {
  grid-column: 1 / -1;
  margin: 2px 0 6px 64px;
  font-size: 14px;
}
.meta__none { margin: 0; color: var(--muted); }
.meta__list {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 4px 16px;
  margin: 0;
}
.meta__list dt { font-weight: 600; color: var(--muted); }
.meta__list dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }
.meta__map { color: var(--accent-text); text-decoration: underline; text-underline-offset: 2px; }

@container (max-width: 620px) {
  .app--pdf .file {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    grid-template-areas: "th name acts";
  }
  .app--pdf .file__acts { grid-area: acts; }
  .app--pdf .file__conv { display: block; }
  .file--meta .meta { grid-area: auto; margin-left: 0; }
  .app--resize .file__conv { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  .file.is-converting .file__bar i { animation: none; left: 0; }
  .dropzone { transition: none; }
}

/* ---------- Content sections: heading left, content right ---------- */

.sec {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 56px;
  padding: 48px 0;
  border-top: 1px solid var(--line);
}
.app + .sec {
  margin-top: 8px;
  border-top: 0;
}
.sec h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.sec__intro {
  margin: 12px 0 0;
  color: var(--muted);
}
.sec__body { min-width: 0; }
.sec__body > p:last-child { margin-bottom: 0; }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  background: var(--win);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.chip:hover { border-color: var(--accent); background: var(--accent-soft); }

.catalog__group + .catalog__group { margin-top: 28px; }
.catalog__label {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.pair-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}
.pair-list li { border-bottom: 1px solid var(--line); }
.pair-list a {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 16px;
  align-items: baseline;
  padding: 13px 0;
  text-decoration: none;
}
.pair {
  font-weight: 700;
  white-space: nowrap;
}
.pair__desc { color: var(--muted); }
.pair-list a:hover .pair { text-decoration: underline; text-underline-offset: 3px; }
.pair-list--cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 32px;
  border-top: 0;
}
.pair-list--cols li:nth-child(-n + 2) { border-top: 1px solid var(--line); }
/* Tool / démarche lists: titles longer than "PNG → WebP", stacked above
   their description instead of sharing a fixed-width column. */
.pair-list--stack a { display: flex; flex-direction: column; gap: 3px; }
.pair-list--stack .pair { white-space: normal; }

.points {
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}
.points li {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  color: var(--text);
}
.points strong { color: var(--ink); font-weight: 700; }

.link-arrow {
  font-weight: 600;
  color: var(--accent-text);
  text-decoration: none;
}
.link-arrow:hover { text-decoration: underline; text-underline-offset: 3px; }

.prose { color: var(--text); }
.prose p { margin: 0 0 14px; max-width: 68ch; }
.prose ul,
.prose ol { margin: 0 0 14px; padding-left: 20px; max-width: 72ch; }
.prose li { margin-bottom: 4px; }
.prose a,
.article a:not(.btn),
.faq-item__answer a {
  text-decoration: underline;
  text-decoration-color: var(--accent-line);
  text-underline-offset: 3px;
}
.prose a:hover,
.article a:not(.btn):hover { color: var(--accent-text); text-decoration-color: var(--accent-text); }
code {
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(35, 34, 31, 0.07);
  font-size: 0.9em;
}

.duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 28px;
}
.duo__item {
  padding: 20px 22px;
  background: var(--win);
  border: 1px solid var(--line);
  border-radius: var(--radius-box);
}
.duo__item h3 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 700;
}
.duo__sub {
  font-weight: 500;
  color: var(--muted);
}
.duo__item p {
  margin: 0 0 12px;
  font-size: 15px;
  color: var(--text);
}

.guide-rows {
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}
.guide-rows li { border-bottom: 1px solid var(--line); }
.guide-rows a {
  display: block;
  padding: 16px 0;
  text-decoration: none;
}
.guide-row__title {
  display: block;
  font-size: 17px;
  font-weight: 700;
}
.guide-row__desc {
  display: block;
  margin-top: 2px;
  color: var(--muted);
}
.guide-rows a:hover .guide-row__title { text-decoration: underline; text-underline-offset: 3px; }

/* FAQ */
.faq .sec__body { border-top: 1px solid var(--line); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item h3 {
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
}
.faq-item__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-height: 56px;
  padding: 14px 0;
  background: none;
  border: 0;
  text-align: left;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
}
.faq-item__sign {
  flex: none;
  width: 24px;
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
  text-align: center;
  color: var(--muted);
}
.faq-item__answer {
  display: none;
  max-width: 68ch;
  margin: 0 0 18px;
  color: var(--text);
}
.faq-item[data-open="true"] .faq-item__answer { display: block; }

/* ---------- Text pages (guides, article, confidentialité) ---------- */

.page { padding-bottom: 24px; }

.page-intro {
  max-width: 760px;
  padding: 24px 0 36px;
}
.page-intro .breadcrumbs { margin-bottom: 28px; }
.page-intro h1,
.article h1 {
  margin: 0 0 16px;
  font-size: 48px;
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.page-intro p {
  margin: 0;
  font-size: 18px;
  color: var(--muted);
}

.panel {
  background: var(--win);
  border: 1px solid var(--line);
  border-radius: var(--radius-win);
  box-shadow: var(--shadow-win);
}

.guide-list {
  margin: 0;
  padding: 0 28px;
  list-style: none;
}
.guide-list li + li { border-top: 1px solid var(--line); }
.guide-item {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  grid-template-areas:
    "meta title"
    "meta desc";
  gap: 4px 32px;
  padding: 24px 0;
  text-decoration: none;
}
.guide-item__meta {
  grid-area: meta;
  padding-top: 4px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}
.guide-item__title {
  grid-area: title;
  font-size: 20px;
  line-height: 1.3;
  font-weight: 700;
}
.guide-item__desc {
  grid-area: desc;
  color: var(--muted);
}
.guide-item:hover .guide-item__title { text-decoration: underline; text-underline-offset: 3px; }

.article {
  max-width: 760px;
  margin: 0 auto;
  padding-top: 24px;
  color: var(--text);
}
.article > .breadcrumbs { margin-bottom: 28px; }
.article h1 { color: var(--ink); }
.article__meta {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}
.article .lede {
  margin: 0 0 32px;
  font-size: 20px;
  line-height: 1.5;
  color: var(--muted);
}
.article h2 {
  margin: 44px 0 12px;
  font-size: 26px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.article h3 {
  margin: 28px 0 8px;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
}
.article p,
.article li {
  font-size: 17px;
  line-height: 1.7;
}
.article p { margin: 0 0 16px; }
.article ul,
.article ol { margin: 0 0 16px; padding-left: 22px; }
.article li { margin-bottom: 6px; }
.article strong { color: var(--ink); }
figure.diagram { margin: 8px 0 24px; }
.sec__body figure.diagram { max-width: 760px; }
.sec__body .diagram-grid figure.diagram { max-width: none; }
.diagram-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; margin: 8px 0 8px; }
.diagram-grid figure.diagram { margin: 0 0 20px; }
@media (max-width: 599px) { .diagram-grid { grid-template-columns: 1fr; } }
figure.diagram svg { display: block; width: 100%; height: auto; }
figure.diagram figcaption {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
}

.article table {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 24px 0;
  overflow-x: auto;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--win);
  border: 1px solid var(--line);
  border-radius: var(--radius-box);
  font-size: 15px;
  line-height: 1.45;
}
/* The table itself is a scroll container on narrow screens; its body is
   laid out as the real table so rows still span the full width. */
.article table > tbody,
.article table > thead {
  display: table;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.article th,
.article td {
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.article th {
  font-weight: 700;
  color: var(--ink);
  background: var(--side);
  white-space: nowrap;
}
.article tr:last-child td { border-bottom: 0; }

.callout {
  margin: 24px 0;
  padding: 18px 22px;
  background: var(--win);
  border: 1px solid var(--line);
  border-radius: var(--radius-box);
}
.callout p:last-child { margin-bottom: 0; }

.article-footer-cta {
  margin-top: 56px;
  padding: 28px 32px;
  background: var(--win);
  border: 1px solid var(--line);
  border-radius: var(--radius-win);
  box-shadow: var(--shadow-win);
}
.article-footer-cta h2 { margin-top: 0; }
.article-footer-cta p:last-child { margin: 20px 0 0; }

/* ---------- Footer ---------- */

.site-footer {
  margin-top: 48px;
  border-top: 3px solid var(--accent);
}
.site-footer__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding: 20px 0 28px;
  font-size: 14px;
  color: var(--muted);
}
.site-footer__brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--ink);
}
.site-footer__brand .brand__mark {
  width: 20px;
  height: 20px;
  border-radius: 6px;
}
.site-footer__brand .brand__mark::after {
  inset: 5px;
  border-width: 1.5px;
  border-radius: 2px;
}
.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 20px;
}
.site-footer__links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
}
.site-footer__links a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Consent banner (js/consent.js) ---------- */

.consent {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
  width: min(420px, 100% - 32px);
  padding: 18px 20px;
  background: var(--win);
  border: 1px solid var(--line);
  border-radius: var(--radius-box);
  box-shadow: 0 8px 28px rgba(35, 34, 31, 0.14);
}
.consent[hidden] { display: none; }
.consent__text {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
}
.consent__text strong { color: var(--ink); }
.consent__text a { text-decoration: underline; text-underline-offset: 3px; }
.consent__actions {
  display: flex;
  gap: 8px;
}
/* Same style for both buttons: refusing is as easy as accepting. */
.consent__btn {
  flex: 1;
  background: var(--white);
  border-color: var(--ink);
  color: var(--ink);
}
.consent__btn:hover { background: var(--side); }

/* ---------- Responsive ---------- */

@media (max-width: 1060px) {
  .sec { grid-template-columns: 260px minmax(0, 1fr); gap: 40px; }
}

@media (max-width: 899px) {
  .site-header { height: 64px; }

  .intro {
    height: auto;
    padding: 16px 0 24px;
    justify-content: flex-start;
  }
  .intro .breadcrumbs {
    position: static;
    margin-bottom: 14px;
  }
  .intro h1 { font-size: 42px; margin-bottom: 12px; }
  .intro p { font-size: 17px; }

  /* The sidebar dissolves into the window: picker and quality on top,
     then the dropzone and file list, then the privacy note. */
  .app {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
  }
  .app__side { display: contents; }
  .picker {
    flex-direction: row;
    gap: 12px;
    padding: 16px 16px 14px;
    background: var(--side);
  }
  .picker__field { flex: 1; min-width: 0; }
  .quality {
    padding: 0 16px 14px;
    background: var(--side);
  }
  .quality__note { display: none; }
  .app__main {
    order: 1;
    padding: 16px;
    border-top: 1px solid var(--line);
  }
  .app__privacy {
    order: 2;
    margin: 0;
    padding: 0 16px 16px;
  }
  .dropzone,
  .app__main.has-files .dropzone {
    flex: none;
    flex-direction: column;
    gap: 14px;
    min-height: 0;
    padding: 22px 16px;
    text-align: center;
  }

  .sec {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    padding: 36px 0;
  }
  .app + .sec { margin-top: 0; }
  .sec h2 { font-size: 23px; }
  .pair-list--cols { grid-template-columns: minmax(0, 1fr); }
  .pair-list--cols li:nth-child(2) { border-top: 0; }
  .duo { grid-template-columns: minmax(0, 1fr); }

  .guide-item {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "meta" "title" "desc";
  }
  .guide-item__meta { padding-top: 0; }
}

@media (max-width: 639px) {
  .site-header { position: relative; height: 60px; gap: 8px; }
  .brand { font-size: 18px; gap: 8px; }
  .brand__mark { width: 24px; height: 24px; }
  .brand__mark::after { inset: 6px; }
  .site-nav { gap: 0; font-size: 14px; }
  .site-nav a { padding: 0 9px; }
  /* Five links don't fit next to the logo: keep the two sections with their
     own pages; Formats and FAQ are anchors of the homepage, reachable from it. */
  .site-nav a[href="/#formats"],
  .site-nav a[href="/#questions"] { display: none; }
  .nav-menu summary { padding: 0 9px; }
  .nav-menu { position: static; }
  .nav-menu__panel {
    position: absolute;
    top: 60px;
    left: 16px;
    right: 16px;
    width: auto;
    grid-template-columns: 1fr 1fr;
    gap: 16px 20px;
  }
  .sec-wide__head h2 { font-size: 22px; }
  .tool-cards { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tool-card { padding: 14px 14px 16px; }

  .intro { padding: 8px 0 20px; }
  .intro h1 { font-size: 32px; line-height: 1.1; letter-spacing: -0.025em; }
  .intro p { font-size: 16px; }

  .app { border-radius: var(--radius-box); }
  .fcard { padding: 0 10px 0 12px; gap: 6px; }
  .fcard__hint { font-size: 13px; }
  .dropzone__title { font-size: 17px; }

  .pair-list a { grid-template-columns: minmax(0, 1fr); gap: 0; }

  .page-intro { padding: 8px 0 24px; }
  .page-intro .breadcrumbs,
  .article > .breadcrumbs { margin-bottom: 18px; }
  .page-intro h1,
  .article h1 { font-size: 34px; }
  .article { padding-top: 8px; }
  .article .lede { font-size: 18px; }
  .article h2 { font-size: 23px; margin-top: 36px; }
  .article p,
  .article li { font-size: 16px; }
  .guide-list { padding: 0 18px; }
  .guide-item { padding: 18px 0; }
  .guide-item__title { font-size: 18px; }
  .article-footer-cta { padding: 22px 20px; }
  .article-footer-cta .btn { white-space: normal; }

  .site-footer__bar { flex-direction: column; align-items: flex-start; padding-top: 16px; }

  .consent {
    right: 0;
    bottom: 0;
    left: 0;
    width: auto;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    border-width: 1px 0 0;
    border-radius: var(--radius-box) var(--radius-box) 0 0;
  }
  .consent__text { margin-bottom: 10px; font-size: 13px; }
  .consent__extra { display: none; }
}

@media (max-width: 399px) {
  .fcard__hint { display: none; }
  .intro { padding-bottom: 16px; }
  .intro .breadcrumbs { margin-bottom: 10px; }
  .intro h1 { font-size: 29px; margin-bottom: 10px; }
  .intro p { font-size: 15px; }
  .picker { padding-top: 14px; }
  .dropzone,
  .app__main.has-files .dropzone { padding: 18px 14px; gap: 12px; }
}

/* ---------- Gabarits (downloadable templates) ---------- */
.gabarit { display: grid; gap: 20px; }
.gabarit__preview {
  background: #8fa0b2 linear-gradient(135deg, #a7b6c4, #7d8fa3);
  border-radius: var(--radius-box);
  padding: 12px;
  line-height: 0;
}
.gabarit__img { display: block; width: 100%; height: auto; max-height: 360px; object-fit: contain; margin: 0 auto; }
.gabarit-grid { list-style: none; margin: 8px 0 40px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 28px; }
.gabarit-card__title { margin: 14px 0 2px; font-size: 19px; }
.gabarit-card__dims { margin: 0 0 12px; color: var(--muted); font-size: 15px; }
.gabarit-card__acts { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 0; }
.gabarit-card .gabarit__preview { height: 196px; display: flex; align-items: center; justify-content: center; }
.gabarit-card .gabarit__img { max-height: 172px; width: auto; max-width: 100%; }
.gabarit-notes { max-width: 720px; margin-bottom: 40px; }
