/* InvexQR — feuille de style principale
   Identité : encre anthracite + rouge INVEXCAM ; Archivo (variable, largeur 62–125 %).
   Élément signature : les « coins de visée » rouges qui encadrent chaque code, comme un viseur de scan. */

@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url(../fonts/archivo-latin-wdth-normal.woff2) format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url(../fonts/archivo-latin-ext-wdth-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --ink: #231F20;
  --ink-2: #3A3536;
  --red: #E2120B;
  --red-dark: #B30E08;
  --red-tint: #FDECEB;
  --paper: #F3F4F5;
  --card: #FFFFFF;
  --line: #DCDFE3;
  --line-strong: #B9BEC4;
  --muted: #5B6066;
  --ok: #0E7A4E;
  --ok-tint: #E6F4EE;
  --warn: #8A5300;
  --warn-tint: #FFF4E0;
  --info-tint: #EAF0FB;
  --radius: 10px;
  --font: 'Archivo', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --wide: 118%;
  color-scheme: light;
  accent-color: var(--red);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  font-variant-numeric: tabular-nums;
}
img, svg { max-width: 100%; }
a { color: var(--ink); text-decoration-color: var(--red); text-underline-offset: 3px; }
a:hover { color: var(--red-dark); }
:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.12; margin: 0 0 .5em; font-stretch: var(--wide); letter-spacing: -0.01em; }
h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.2rem); font-weight: 800; }
h2 { font-size: 1.3rem; font-weight: 750; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 1em; max-width: 72ch; }
small, .muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .88em; background: var(--paper); padding: .1em .35em; border-radius: 4px; word-break: break-all; }

/* ---------- Boutons et formulaires ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  font: inherit; font-weight: 650; font-size: .95rem; line-height: 1;
  padding: .8em 1.15em; border-radius: 8px; border: 1.5px solid var(--ink);
  background: var(--card); color: var(--ink); cursor: pointer; text-decoration: none;
  min-height: 44px; transition: background .15s, color .15s, border-color .15s;
}
.btn:hover { background: var(--ink); color: #fff; }
.btn-primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); border-color: var(--red-dark); color: #fff; }
.btn-quiet { border-color: transparent; background: transparent; text-decoration: underline; text-decoration-color: var(--line-strong); }
.btn-quiet:hover { background: transparent; color: var(--red-dark); }
.btn-danger { border-color: var(--red-dark); color: var(--red-dark); }
.btn-danger:hover { background: var(--red-dark); color: #fff; }
.btn-sm { min-height: 34px; padding: .5em .8em; font-size: .85rem; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }

label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .3em; }
.field { margin-bottom: 1rem; }
.field-hint { font-size: .82rem; color: var(--muted); margin-top: .25em; }
.field-error { font-size: .85rem; color: var(--red-dark); margin-top: .25em; font-weight: 600; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=tel], input[type=number],
input[type=date], input[type=datetime-local], select, textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--ink);
  padding: .65em .75em; border: 1.5px solid var(--line-strong); border-radius: 8px; background: #fff; min-height: 44px;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px rgba(226, 18, 11, .18); }
input[aria-invalid="true"] { border-color: var(--red-dark); }
input[type=color] { width: 44px; height: 40px; padding: 2px; border: 1.5px solid var(--line-strong); border-radius: 8px; background: #fff; cursor: pointer; }
.check { display: flex; gap: .55em; align-items: flex-start; font-weight: 500; }
.check input { margin-top: .3em; width: 18px; height: 18px; accent-color: var(--red); }
.row { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }

/* ---------- Messages ---------- */
.flash { padding: .8em 1em; border-radius: 8px; margin-bottom: 1rem; border-left: 4px solid; font-weight: 500; }
.flash-success { background: var(--ok-tint); border-color: var(--ok); }
.flash-error { background: var(--red-tint); border-color: var(--red-dark); }
.flash-info { background: var(--info-tint); border-color: #1D4ED8; }
.flash-warn { background: var(--warn-tint); border-color: var(--warn); }
.notice { background: var(--warn-tint); border-radius: 8px; padding: .75em 1em; font-size: .9rem; }
.notice ul { margin: .3em 0 0; padding-left: 1.2em; }

/* ---------- Signature : coins de visée ---------- */
.viewfinder { position: relative; padding: 18px; display: inline-block; }
.viewfinder::before, .viewfinder::after,
.viewfinder > .vf-b::before, .viewfinder > .vf-b::after {
  content: ''; position: absolute; width: 28px; height: 28px; border: 0 solid var(--red); pointer-events: none;
}
.viewfinder::before { top: 0; left: 0; border-top-width: 4px; border-left-width: 4px; border-top-left-radius: 6px; }
.viewfinder::after { top: 0; right: 0; border-top-width: 4px; border-right-width: 4px; border-top-right-radius: 6px; }
.viewfinder > .vf-b::before { bottom: 0; left: 0; border-bottom-width: 4px; border-left-width: 4px; border-bottom-left-radius: 6px; }
.viewfinder > .vf-b::after { bottom: 0; right: 0; border-bottom-width: 4px; border-right-width: 4px; border-bottom-right-radius: 6px; }
.qr-preview { width: 100%; max-width: 300px; aspect-ratio: auto; display: grid; place-items: center; background: #fff; }
.qr-preview svg { width: 100%; height: auto; display: block; }
.qr-preview .placeholder { color: var(--muted); font-size: .9rem; padding: 3rem 1rem; text-align: center; }
@media (prefers-reduced-motion: no-preference) {
  .viewfinder.scanning::before, .viewfinder.scanning::after,
  .viewfinder.scanning > .vf-b::before, .viewfinder.scanning > .vf-b::after { animation: lock .45s ease-out; }
}
@keyframes lock { from { transform: scale(1.35); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---------- Mise en page publique ---------- */
.site-header { background: var(--card); border-bottom: 1px solid var(--line); }
.site-header .inner, .site-footer .inner, .wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.site-header .inner { display: flex; align-items: center; gap: 1rem; min-height: 64px; flex-wrap: wrap; }
.logo { display: inline-flex; align-items: center; gap: .5em; font-weight: 850; font-stretch: 125%; font-size: 1.2rem; text-decoration: none; color: var(--ink); letter-spacing: -0.02em; }
.logo-mark { width: 26px; height: 26px; }
.logo .x { color: var(--red); }
.site-nav { display: flex; gap: .25rem 1.1rem; margin-left: auto; align-items: center; flex-wrap: wrap; }
.site-nav a { text-decoration: none; font-weight: 600; font-size: .95rem; }
.site-nav a:hover { text-decoration: underline; }
main.public { padding: 2rem 0 4rem; }
.site-footer { border-top: 1px solid var(--line); background: var(--card); padding: 2rem 0; font-size: .9rem; color: var(--muted); }
.site-footer .inner { display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; }
.site-footer a { color: var(--muted); }

.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: 3rem; align-items: center; padding: 2.5rem 0 3rem; }
.hero h1 { font-size: clamp(2.2rem, 1.4rem + 3.6vw, 4rem); font-weight: 850; font-stretch: 112%; letter-spacing: -0.025em; line-height: 1.0; margin-bottom: .45em; }
.hero .lead { font-size: 1.15rem; color: var(--ink-2); max-width: 52ch; }
.hero-try { background: var(--card); border: 1.5px solid var(--ink); border-radius: 14px; padding: 1.25rem; display: grid; gap: 1rem; justify-items: center; }
.hero-try form { width: 100%; display: flex; gap: .5rem; }
.hero-try input { flex: 1; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.proof { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1.5px solid var(--ink); margin-top: 1rem; }
.proof > div { padding: 1.25rem 1.25rem 1.25rem 0; }
.proof > div + div { padding-left: 1.25rem; border-left: 1px solid var(--line); }
.proof h3 { margin-bottom: .3em; }
.proof p { font-size: .95rem; color: var(--ink-2); margin: 0; }
.how { margin-top: 3rem; }
.how ol { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; counter-reset: s; }
.how li { counter-increment: s; border-top: 3px solid var(--ink); padding-top: .75rem; }
.how li::before { content: counter(s); font-weight: 850; font-stretch: 125%; color: var(--red); font-size: 1.4rem; display: block; }

.auth-box { max-width: 440px; margin: 1rem auto; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 2rem; }
.hp { position: absolute; left: -10000px; }

/* Tarifs */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border: 1.5px solid var(--ink); border-radius: 14px; overflow: hidden; background: var(--card); margin-top: 1.5rem; }
.plan { padding: 1.5rem; display: flex; flex-direction: column; gap: .75rem; }
.plan + .plan { border-left: 1px solid var(--line); }
.plan.featured { background: var(--ink); color: #fff; }
.plan.featured .muted { color: #C9C5C6; }
.plan .price { font-size: 2rem; font-weight: 850; font-stretch: 110%; }
.plan .price small { font-size: .9rem; font-weight: 500; }
.plan ul { padding-left: 1.1em; margin: 0; font-size: .95rem; }
.plan li { margin-bottom: .3em; }
.plan .btn { margin-top: auto; }
.plan.featured .btn { border-color: #fff; }

/* Tableaux */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { padding: .7em .9em; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 650; background: #FAFAFB; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; white-space: nowrap; }
.badge { display: inline-block; padding: .15em .55em; border-radius: 99px; font-size: .78rem; font-weight: 650; background: var(--paper); border: 1px solid var(--line); white-space: nowrap; }
.badge-ok { background: var(--ok-tint); border-color: #B8E0CC; color: var(--ok); }
.badge-red { background: var(--red-tint); border-color: #F6BDBA; color: var(--red-dark); }
.badge-warn { background: var(--warn-tint); border-color: #F0D6A8; color: var(--warn); }
.badge-ink { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- Espace client ---------- */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.sidebar { background: var(--ink); color: #fff; padding: 1.25rem 1rem; display: flex; flex-direction: column; gap: 1.5rem; position: sticky; top: 0; height: 100vh; }
.sidebar .logo { color: #fff; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a { color: #E4E1E2; text-decoration: none; padding: .6em .75em; border-radius: 8px; font-weight: 600; font-size: .95rem; display: flex; gap: .65em; align-items: center; }
.sidebar nav a svg { width: 18px; height: 18px; flex: none; }
.sidebar nav a:hover { background: var(--ink-2); color: #fff; }
.sidebar nav a[aria-current="page"] { background: #fff; color: var(--ink); }
.sidebar .create { margin-top: .25rem; }
.sidebar .create .btn { width: 100%; }
.sidebar-foot { margin-top: auto; font-size: .85rem; color: #C9C5C6; display: grid; gap: .5rem; }
.sidebar-foot .plan-chip { display: inline-block; border: 1px solid #5A5455; border-radius: 99px; padding: .2em .7em; color: #fff; }
.sidebar-foot form { margin: 0; }
.sidebar-foot button { background: none; border: 0; color: #C9C5C6; font: inherit; padding: 0; cursor: pointer; text-decoration: underline; }
.content { padding: 1.75rem 2rem 4rem; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-head h1 { margin: 0; }
.page-head p { margin: .3em 0 0; color: var(--muted); }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.panel + .panel, .panel-gap { margin-top: 1.25rem; }
.grid-2 > .panel { margin-top: 0; }
.panel h2 { font-size: 1.05rem; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.5rem; align-items: start; }
.sticky { position: sticky; top: 1rem; }
.mobilebar { display: none; }

/* Bande des indicateurs : un seul bloc divisé, pas des cartes séparées */
.kpis { display: grid; grid-template-columns: repeat(5, 1fr); background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--ink); border-radius: 0 0 var(--radius) var(--radius); }
.kpi { padding: 1rem 1.1rem; }
.kpi + .kpi { border-left: 1px solid var(--line); }
.kpi .v { font-size: 1.9rem; font-weight: 800; font-stretch: 105%; line-height: 1.1; display: block; }
.kpi .l { font-size: .85rem; color: var(--muted); }
.kpi.accent .v { color: var(--red); }
.freshness { font-size: .82rem; color: var(--muted); margin: .5rem 0 1.5rem; }

.filters { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; margin-bottom: 1rem; }
.filters .field { margin: 0; }
.filters select, .filters input { min-height: 40px; padding: .45em .6em; }
.seg { display: inline-flex; border: 1.5px solid var(--ink); border-radius: 8px; overflow: hidden; }
.seg a { padding: .5em .8em; text-decoration: none; font-weight: 600; font-size: .88rem; }
.seg a + a { border-left: 1px solid var(--ink); }
.seg a[aria-current="true"] { background: var(--ink); color: #fff; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; margin-top: 1.25rem; }
.chart { width: 100%; height: auto; display: block; }
.chart .axis { stroke: var(--line); }
.chart text { font-size: 11px; fill: var(--muted); font-family: var(--font); }
.legend { display: flex; flex-wrap: wrap; gap: 1rem; font-size: .85rem; margin-bottom: .5rem; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: .35em; vertical-align: -1px; }
.bars { display: grid; gap: .45rem; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; gap: .6rem; align-items: center; font-size: .9rem; }
.bar-row .track { display: block; background: var(--paper); border-radius: 4px; height: 12px; overflow: hidden; }
.bar-row .fill { display: block; background: var(--ink); height: 100%; border-radius: 4px; min-width: 2px; }
.bar-row .fill[style="width:0%"] { min-width: 0; }
.bar-row .fill.red { background: var(--red); }
.bar-row .n { font-weight: 650; min-width: 3ch; text-align: right; }
.empty { text-align: center; padding: 2.5rem 1rem; }
.empty p { margin-left: auto; margin-right: auto; color: var(--muted); }

/* Bibliothèque */
.qr-list { display: grid; gap: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.qr-item { display: grid; grid-template-columns: 64px 1fr auto; gap: 1rem; align-items: center; padding: .9rem 1rem; text-decoration: none; color: inherit; }
.qr-item + .qr-item { border-top: 1px solid var(--line); }
.qr-item:hover { background: #FAFAFB; }
.qr-thumb { width: 64px; height: 64px; display: grid; place-items: center; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 4px; }
.qr-thumb svg { width: 100%; height: 100%; }
.qr-item .meta { font-size: .85rem; color: var(--muted); }
.qr-item .count { text-align: right; }
.qr-item .count strong { font-size: 1.3rem; font-weight: 800; display: block; line-height: 1.1; }

.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.choice { display: flex; flex-direction: column; gap: .5rem; padding: 1.25rem; background: var(--card); border: 1.5px solid var(--line); border-radius: 12px; text-decoration: none; color: inherit; }
.choice:hover { border-color: var(--ink); }
.choice.primary { border-color: var(--ink); border-width: 2px; }
.choice .tag { align-self: flex-start; }
.choice p { margin: 0; color: var(--ink-2); font-size: .95rem; }

/* Éditeur MultiLink */
.links-editor { display: grid; gap: .6rem; }
.link-row { display: grid; grid-template-columns: auto 150px 1fr 1fr auto; gap: .5rem; align-items: start; padding: .6rem; border: 1px solid var(--line); border-radius: 10px; background: #FCFCFD; }
.link-row.has-error { border-color: var(--red-dark); background: var(--red-tint); }
.link-row .handle { display: flex; flex-direction: column; gap: 2px; }
.link-row .handle button, .link-row .del { border: 1px solid var(--line); background: #fff; border-radius: 6px; width: 32px; height: 21px; cursor: pointer; display: grid; place-items: center; padding: 0; color: var(--ink); }
.link-row .del { height: 44px; width: 40px; }
.link-row .handle button:hover, .link-row .del:hover { border-color: var(--ink); }
.link-row .active-toggle { grid-column: 2 / -1; font-size: .85rem; }
.link-row .err { grid-column: 2 / -1; }
.theme-picks { display: flex; flex-wrap: wrap; gap: .5rem; }
.theme-pick { position: relative; }
.theme-pick input { position: absolute; opacity: 0; }
.theme-pick span { display: grid; gap: 4px; padding: 6px; border: 2px solid var(--line); border-radius: 10px; cursor: pointer; width: 92px; font-size: .78rem; font-weight: 600; text-align: center; }
.theme-pick span i { display: block; height: 34px; border-radius: 6px; }
.theme-pick input:checked + span { border-color: var(--red); }
.theme-pick input:focus-visible + span { outline: 3px solid var(--red); outline-offset: 2px; }
.colors-row { display: flex; flex-wrap: wrap; gap: 1rem; }
.colors-row label { font-weight: 500; font-size: .85rem; }
.phone { width: 300px; max-width: 100%; border: 10px solid var(--ink); border-radius: 34px; overflow: hidden; height: 560px; background: #fff; }
.phone-screen { height: 100%; overflow-y: auto; }
.url-box { display: flex; gap: .5rem; align-items: center; }
.url-box code { flex: 1; padding: .55em .6em; }

/* Concepteur QR */
.designer { display: grid; gap: 1rem; }
.designer fieldset { border: 0; padding: 0; margin: 0; }
.designer legend { font-weight: 700; font-size: .95rem; margin-bottom: .4rem; }
.opt-row { display: flex; flex-wrap: wrap; gap: .4rem; }
.opt { position: relative; }
.opt input { position: absolute; opacity: 0; }
.opt span { display: inline-block; padding: .45em .75em; border: 1.5px solid var(--line-strong); border-radius: 8px; font-size: .88rem; font-weight: 600; cursor: pointer; background: #fff; }
.opt input:checked + span { border-color: var(--ink); background: var(--ink); color: #fff; }
.opt input:focus-visible + span { outline: 3px solid var(--red); outline-offset: 2px; }
.opt input:disabled + span { opacity: .4; cursor: not-allowed; }
.locked { font-size: .8rem; color: var(--muted); }
.downloads { display: flex; flex-wrap: wrap; gap: .5rem; }
.warnings:empty { display: none; }
.type-tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }

/* Admin */
.admin-bar { background: var(--red); color: #fff; padding: .4rem 16px; font-size: .85rem; font-weight: 600; }
.admin-bar a { color: #fff; }
.maintenance-bar { background: #FFF4D6; color: #5A4300; border-bottom: 1px solid #F0D58A; padding: .5rem 16px; font-size: .88rem; font-weight: 600; }
.maintenance-bar a { color: inherit; }
.inline-form { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.inline-form select, .inline-form input { min-height: 34px; padding: .3em .5em; width: auto; font-size: .88rem; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; position: fixed; inset: 0; z-index: 30; height: auto; overflow-y: auto; }
  .sidebar.open { display: flex; }
  .mobilebar { display: flex; align-items: center; justify-content: space-between; background: var(--ink); padding: .6rem 16px; position: sticky; top: 0; z-index: 20; }
  .mobilebar .logo { color: #fff; }
  .mobilebar button { background: none; border: 1px solid #5A5455; color: #fff; border-radius: 8px; padding: .45em .8em; font: inherit; font-weight: 600; }
  .content { padding: 1.25rem 16px 4rem; }
  .split { grid-template-columns: 1fr; }
  .sticky { position: static; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .kpi + .kpi { border-left: 0; }
  .kpi:nth-child(even) { border-left: 1px solid var(--line); }
  .kpi:nth-child(n+3) { border-top: 1px solid var(--line); }
  .kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .grid-2, .choices, .hero, .plans { grid-template-columns: 1fr; }
  .plan + .plan { border-left: 0; border-top: 1px solid var(--line); }
  .how ol { grid-template-columns: 1fr 1fr; }
  .proof { grid-template-columns: 1fr; }
  .proof > div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .link-row { grid-template-columns: auto 1fr auto; }
  .link-row select { grid-column: 2 / 3; }
  .link-row .del { grid-row: 1; grid-column: 3; }
  .link-row input[name$="[label]"], .link-row input[name$="[value]"] { grid-column: 2 / -1; }
  .link-row .active-toggle, .link-row .err { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .chart text { font-size: 22px; }
  .seg { max-width: 100%; overflow-x: auto; }
  .seg a { white-space: nowrap; }
  .how ol { grid-template-columns: 1fr; }
  .hero-try form { flex-direction: column; }
  .qr-item { grid-template-columns: 48px 1fr; }
  .qr-thumb { width: 48px; height: 48px; }
  .qr-item .count { grid-column: 2; text-align: left; }
  .qr-item .count strong { display: inline; font-size: 1rem; }
  .bar-row { grid-template-columns: minmax(80px, 40%) 1fr auto; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- Lot 4 : intégrations ---------- */
.seg-wrap { flex-wrap: wrap; }
.secret-box { display: flex; gap: .5rem; align-items: stretch; flex-wrap: wrap; background: var(--ink); color: #fff; border-radius: 10px; padding: .9rem 1rem; margin: .5rem 0 1rem; }
.secret-box code { background: transparent; color: #fff; font-size: .95rem; flex: 1 1 260px; padding: .4em 0; word-break: break-all; }
.secret-box .btn { border-color: #fff; color: #fff; background: transparent; }
.secret-box .btn:hover { background: #fff; color: var(--ink); }
.status-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; }
.status-card { background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--ink); border-radius: 0 0 var(--radius) var(--radius); padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .4rem; text-decoration: none; color: inherit; }
.status-card:hover { border-top-color: var(--red); }
.status-card h2 { margin: 0; font-size: 1.05rem; }
.status-card p { margin: 0; font-size: .9rem; color: var(--muted); }
.dns-table td code { font-size: .85rem; }
.meter { height: 10px; background: var(--paper); border-radius: 99px; overflow: hidden; margin: .35rem 0; }
.meter > span { display: block; height: 100%; background: var(--ink); border-radius: 99px; }
pre.code { background: #1B1819; color: #F3F1F1; padding: 1rem; border-radius: 10px; overflow-x: auto; font-size: .82rem; line-height: 1.5; margin: .5rem 0 1rem; }
pre.code code { background: none; color: inherit; padding: 0; word-break: normal; }
.events-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: .35rem 1rem; margin: .5rem 0 1rem; }
.scope-list { display: grid; gap: .35rem; margin: .5rem 0 1rem; }
.ext-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.25rem; }
.ext { display: flex; flex-direction: column; gap: .6rem; }
.ext ol { margin: 0; padding-left: 1.2em; font-size: .93rem; }
.ext .btn { align-self: flex-start; }
.doc-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 2rem; align-items: start; }
.doc-nav { position: sticky; top: 1rem; font-size: .9rem; display: grid; gap: .15rem; max-height: calc(100vh - 2rem); overflow-y: auto; }
.doc-nav a { text-decoration: none; padding: .2em .4em; border-radius: 6px; }
.doc-nav a:hover { background: var(--card); }
.doc-nav strong { margin-top: .75rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.endpoint { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.15rem; margin-bottom: 1rem; scroll-margin-top: 1rem; }
.endpoint h3 { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .35rem; font-stretch: 100%; }
.endpoint h3 code { font-size: .95rem; background: var(--paper); }
.verb { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .78rem; font-weight: 700; padding: .2em .55em; border-radius: 6px; color: #fff; background: var(--ink); }
.verb-post { background: #0E7A4E; } .verb-patch { background: #8A5300; } .verb-delete { background: var(--red-dark); }
.endpoint .params { font-size: .88rem; margin: .5rem 0 0; }
.endpoint .params td, .endpoint .params th { padding: .4em .6em; }
@media (max-width: 860px) { .doc-layout { grid-template-columns: 1fr; } .doc-nav { position: static; max-height: none; } }

/* Lot 4 — Extensions */
.steps-list { margin: .25rem 0 0; padding-left: 1.25rem; }
.steps-list li { margin: .4rem 0; }
.status-card h3 { margin: 0; font-size: 1rem; }

/* ---------- Lot 5 : InvexQR AI ---------- */
.quota-meter { min-width: 230px; font-size: .88rem; color: var(--muted); }
.quota-meter strong { color: var(--ink); font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.quota-meter .bar { height: 8px; margin-top: .35rem; background: var(--paper); border: 1px solid var(--line); border-radius: 99px; overflow: hidden; }
.quota-meter .bar span { display: block; height: 100%; background: var(--ink); }
.quota-meter .bar.high span { background: var(--red); }
.ai-mode { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; font-size: .9rem; color: var(--muted); margin: 0 0 1.25rem; }
.ai-mode .badge svg, .ai-engine svg, .btn svg { width: 16px; height: 16px; vertical-align: -3px; }
.ai-tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.ai-tool { position: relative; display: flex; flex-direction: column; gap: .4rem; padding: 1.1rem 1.15rem 1.2rem; background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--ink); border-radius: 0 0 var(--radius) var(--radius); text-decoration: none; color: inherit; }
.ai-tool:hover { border-top-color: var(--red); }
.ai-tool:hover h2 { text-decoration: underline; text-decoration-color: var(--red); text-underline-offset: 3px; }
.ai-tool h2 { margin: 0; font-size: 1.05rem; }
.ai-tool p { margin: 0; font-size: .9rem; color: var(--muted); }
.ai-tool-icon { color: var(--red); }
.ai-form { max-width: 860px; }
.ai-form fieldset { border: 0; padding: 0; margin: 0 0 1rem; }
.ai-form legend { font-weight: 650; margin-bottom: .4rem; }
.ai-form .check + .check { margin-top: .4rem; }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; margin-top: .5rem; }
.channel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .35rem 1rem; }
.channel-grid .check + .check { margin-top: 0; }
.ai-title { font-size: 1.45rem; max-width: 40ch; }
.ai-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.ai-actions form { margin: 0; }
.ai-engine { display: inline-block; font-size: .88rem; padding: .45em .8em; border-radius: 8px; background: var(--paper); border: 1px solid var(--line); margin: 0 0 1.25rem; }
.ai-engine.ok, .ai-engine.corrige { background: var(--ok-tint); border-color: #B8E0CC; }
.ai-engine.remplace, .ai-engine.erreur { background: var(--warn-tint); border-color: #F0D6A8; }
.ai-report { max-width: 980px; }
.ai-summary { background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--red); border-radius: 0 0 var(--radius) var(--radius); padding: 1rem 1.25rem; }
.ai-summary p { margin: 0; font-size: 1.12rem; line-height: 1.55; }
.ai-block { margin-top: 2rem; }
.ai-block > h2 { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; font-size: 1.15rem; margin: 0 0 .4rem; }
.ai-block h3 { font-size: 1rem; margin: 1.25rem 0 .5rem; }
.ai-explain { margin: 0 0 .8rem; font-size: .88rem; color: var(--muted); }
.ai-question { font-style: italic; color: var(--ink-2); }
.ai-label { font-size: .72rem; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; padding: .25em .6em; border-radius: 4px; line-height: 1.2; }
.ai-label-obs { background: var(--ink); color: #fff; }
.ai-label-hyp { background: var(--warn-tint); color: var(--warn); outline: 1.5px dashed var(--warn); outline-offset: -1.5px; }
.ai-obs, .ai-hyp { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; }
.ai-obs li { padding: .7rem 1rem; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--ink); border-radius: 0 8px 8px 0; line-height: 1.5; }
.ai-obs li.positif { border-left-color: var(--ok); }
.ai-obs li.negatif { border-left-color: var(--red); }
.ai-hyp li { padding: .7rem 1rem; background: #FFFCF5; border: 1.5px dashed #D9B77A; border-radius: 8px; line-height: 1.5; }
.ai-hyp .verif { margin-top: .35rem; font-size: .88rem; color: var(--ink-2); }
.fact-chip { display: inline-block; font-size: .72rem; font-weight: 700; font-variant-numeric: tabular-nums; padding: .05em .45em; margin-left: .25em; border-radius: 4px; background: var(--paper); border: 1px solid var(--line); color: var(--ink-2); text-decoration: none; vertical-align: .1em; }
a.fact-chip:hover { border-color: var(--red); color: var(--red-dark); }
.ai-reco { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.ai-reco-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; display: flex; flex-direction: column; align-items: flex-start; gap: .4rem; }
.ai-reco-card h3 { margin: .1rem 0 0; font-size: 1rem; }
.ai-reco-card p { margin: 0; font-size: .93rem; color: var(--ink-2); }
.ai-reco-card > .btn, .ai-reco-card .card-actions { margin-top: auto; }
.card-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.ai-reco-card.prio-haute { border-left: 4px solid var(--red); }
.ai-pick { background: var(--card); border: 2px solid var(--ink); border-radius: 12px; padding: 1.25rem 1.4rem; }
.ai-pick h2 { margin: .5rem 0 .4rem; font-size: 1.35rem; }
.ai-pick ul { margin: 0 0 1rem; padding-left: 1.2rem; }
.cta-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.cta-chip { display: inline-flex; align-items: center; gap: .25rem; border: 1.5px solid var(--ink); border-radius: 99px; padding: .3em .35em .3em .95em; font-weight: 700; background: var(--card); }
.cta-chip .btn { min-height: 0; padding: .25em .6em; }
.ai-copy { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .5rem; }
.ai-copy li { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .55rem .6rem .55rem .9rem; background: var(--card); border: 1px solid var(--line); border-radius: 8px; }
.ai-copy li .btn { flex: none; }
.text-block { white-space: pre-wrap; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: .8rem 1rem; margin: 0; font-size: .95rem; }
.counter { font-size: .8rem; color: var(--muted); margin: .3rem 0 0; display: flex; align-items: center; gap: .5rem; }
.ai-texts { margin-top: 0; }
.tpl-swatch { width: 100%; display: flex; align-items: center; gap: .75rem; padding: .6rem; border-radius: 8px; background: var(--paper); }
.tpl-swatch span { width: 38px; height: 38px; flex: none; border-radius: 6px; background: linear-gradient(90deg, var(--fg) 0 30%, transparent 30% 45%, var(--fg) 45% 100%); -webkit-mask: radial-gradient(circle at 25% 25%, #000 28%, transparent 29%) 0 0 / 50% 50%; mask: radial-gradient(circle at 25% 25%, #000 28%, transparent 29%) 0 0 / 50% 50%; }
.tpl-swatch em { font-style: normal; font-weight: 750; font-size: .85rem; color: #fff; background: var(--fr); padding: .3em .7em; border-radius: 6px; }
.ai-lexique { display: grid; grid-template-columns: minmax(150px, 220px) 1fr; gap: .45rem 1rem; margin: 0; font-size: .93rem; }
.ai-lexique dt { font-weight: 700; }
.ai-lexique dd { margin: 0; color: var(--ink-2); }
.ai-limits ul { margin: 0; padding-left: 1.2rem; color: var(--ink-2); font-size: .93rem; }
.facts-table td:first-child { font-weight: 700; white-space: nowrap; }
.facts-table tr:target td { background: var(--red-tint); }
.facts-table .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ai-cta-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1rem; padding: .85rem 1.1rem; border: 1px solid var(--line); border-left: 4px solid var(--red); border-radius: 0 var(--radius) var(--radius) 0; background: var(--card); margin: 1.25rem 0; }
.ai-cta-banner p { margin: 0; }
@media (max-width: 980px) { .ai-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ai-reco { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .ai-tools { grid-template-columns: 1fr; } .ai-lexique { grid-template-columns: 1fr; } .ai-lexique dd { margin-bottom: .5rem; } .quota-meter { min-width: 0; width: 100%; } }

/* ---------- Lot 6 : support et back-office ---------- */
.support-plan { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; font-size: .92rem; color: var(--ink-2); margin: 0 0 1.25rem; }
.support-form { max-width: 820px; }
.support-form fieldset { border: 0; padding: 0; margin: 0 0 1rem; }
.support-form legend { font-weight: 650; margin-bottom: .4rem; }
.ticket-title { font-size: 1.4rem; max-width: 46ch; }
.thread { list-style: none; padding: 0; margin: 0 0 1.25rem; display: grid; gap: .75rem; max-width: 820px; }
.msg { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .85rem 1.1rem; }
.msg-staff { border-left: 4px solid var(--red); }
.msg-client { border-left: 4px solid var(--ink); }
.msg-system { background: var(--paper); border-style: dashed; font-size: .9rem; }
.msg-internal { background: #FFFCF5; border: 1.5px dashed #D9B77A; border-left-width: 4px; }
.msg-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem 1rem; font-size: .88rem; margin-bottom: .4rem; }
.msg-head time { color: var(--muted); }
.msg-body { line-height: 1.55; overflow-wrap: anywhere; }
.msg-file { margin: .6rem 0 0; font-size: .9rem; display: flex; align-items: center; gap: .35rem; }
.msg-file svg { width: 16px; height: 16px; }
.ticket-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.25rem; align-items: start; }
.ticket-side { display: grid; gap: 1rem; position: sticky; top: 1rem; }
.ticket-side .panel + .panel { margin-top: 0; }
.ticket-side h2 { font-size: 1rem; }
.ticket-side p { font-size: .92rem; margin: .4rem 0; }
.plain-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; font-size: .9rem; }
.stack-forms { display: grid; gap: .9rem; }
.stack-forms form { display: grid; gap: .4rem; margin: 0; }
.stack-forms .btn { justify-self: start; }
.stack-forms label { font-size: .88rem; }
.nav-count { display: inline-block; min-width: 1.4em; padding: 0 .4em; margin-left: auto; border-radius: 99px; background: var(--red); color: #fff; font-size: .75rem; font-weight: 700; text-align: center; line-height: 1.5; }
.health th { font-weight: 600; white-space: nowrap; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: .5rem; vertical-align: 1px; }
.dot-ok { background: var(--ok); }
.dot-warn { background: #D99A1E; }
.dot-ko { background: var(--red); }
.config-table th { width: 38%; font-weight: 600; }
.config-table td:last-child { width: 1%; white-space: nowrap; }
.error-message { font-weight: 650; font-size: 1.05rem; overflow-wrap: anywhere; }
.trace { background: var(--ink); color: #F3F4F5; padding: 1rem; border-radius: 8px; overflow-x: auto; font-size: .8rem; line-height: 1.5; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 1rem; }
.tpl-admin { display: flex; gap: 1rem; align-items: center; padding: .9rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: inherit; }
.tpl-admin:hover { border-color: var(--ink); }
.tpl-admin.inactive { opacity: .6; }
.tpl-admin img { flex: none; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.tpl-preview { width: 100%; max-width: 260px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.code-input { font-size: 1.6rem; letter-spacing: .35em; text-align: center; font-variant-numeric: tabular-nums; }
@media (max-width: 980px) { .ticket-layout { grid-template-columns: 1fr; } .ticket-side { position: static; } }
.kpis-3 { grid-template-columns: repeat(3, 1fr); }
.kpis-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px) { .kpis-3, .kpis-4 { grid-template-columns: repeat(2, 1fr); } .kpis-4 .kpi:nth-child(3) { border-left: 0; } .kpis-4 .kpi:nth-child(n+3) { border-top: 1px solid var(--line); } }
@media (max-width: 560px) { .kpis-3 { grid-template-columns: 1fr; } .kpis-3 .kpi + .kpi { border-left: 0; border-top: 1px solid var(--line); } }
.ticket-layout > * { min-width: 0; }

/* Lot 7 — pages légales */
.legal-page { max-width: 760px; }
.legal-page h2 { font-size: 1.1rem; margin-top: 1.75rem; }
.legal-page li { margin-bottom: .35rem; }
.legal-list { display: grid; grid-template-columns: minmax(9rem, max-content) 1fr; gap: .35rem 1rem; margin: .5rem 0 1rem; }
.legal-list dt { font-weight: 600; color: var(--muted, #5B6066); }
.legal-list dd { margin: 0; overflow-wrap: anywhere; }
.legal-page code { white-space: nowrap; }
@media (max-width: 520px) { .legal-list { grid-template-columns: 1fr; gap: .1rem; } .legal-list dd { margin-bottom: .5rem; } }
