/* Comptarapide — site public. Un seul système : jetons, grille, boutons, cartes.
   Polices IBM Plex (licence OFL, fichiers hébergés avec le site : polices/LICENCE-OFL.txt). */

@font-face { font-family: "Plex"; src: url("polices/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Plex"; src: url("polices/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Plex"; src: url("polices/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("polices/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }

:root {
  /* Fonds de page */
  --g-main: #ffffff;
  --g-alt: #f3f3f0;
  --g-dark: #10161d;
  /* Encre */
  --ink: #1a1d21;
  --muted: #5b626b;
  --faint: #6f7680;
  --line: rgba(26, 29, 33, .13);
  --line-soft: rgba(26, 29, 33, .08);
  /* Rouge Comptarapide : le logo en #fe0000, les boutons en #d40000 (texte blanc 5:1) */
  --brand: #fe0000;
  --action: #d40000;
  --action-deep: #a30000;
  --tone: #efefec;
  --tone-hover: #e2e2de;

  /* Jetons de l’application (maquettes) */
  --a-fond: #f7f7f5;
  --a-surface: #ffffff;
  --a-entete: #f2f2ef;
  --a-texte: #1a1d21;
  --a-doux: #5f6670;
  --a-bord: #e3e3df;
  --a-bord-fin: #efefec;
  --a-rail: #17202a;
  --a-rail-texte: #b4bfca;
  --a-ok-fond: #e4f2e9;
  --a-ok: #0f5c31;
  --a-alerte-fond: #fdf0dc;
  --a-alerte: #8a4008;
  --a-danger-fond: #fbeae7;
  --a-danger: #93211a;

  /* Rythme */
  --nav: 72px;
  --padt: 120px;
  --padb: 72px;
  --gut: 80px;
  --hgap: 48px;
  --hpadb: 64px;

  /* Rayons (souples) */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 20px;
  --r-btn: 8px;
  --r-win: 12px;

  /* Type */
  --font: "Plex", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --t-h1: 72px;
  --t-h2: 48px;
  --t-h3: 24px;
  --t-lead: 20px;
  --t-card: 20px;
  --t-body: 16px;
  --t-small: 14px;
  --t-label: 13px;

  /* Mouvement */
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-enter: cubic-bezier(.22, 1, .36, 1);
  --m-in: 150ms;
  --m-out: 120ms;
  --m-press: 90ms;
}

@media (max-width: 1279px) { :root { --t-h1: 64px; --t-h2: 44px; } }
@media (max-width: 1023px) { :root { --gut: 48px; --t-h1: 52px; --t-h2: 40px; --padt: 112px; } }
@media (max-width: 639px) {
  :root { --nav: 56px; --padt: 96px; --padb: 48px; --gut: 24px; --hgap: 40px; --hpadb: 24px;
          --t-h1: 32px; --t-h2: 30px; --t-h3: 20px; --t-lead: 18px; --t-card: 18px; }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
html { scroll-padding-top: 0; scroll-behavior: auto; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  background: var(--g-main);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--t-body);
  line-height: 1.625;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; }
.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; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; border-radius: 4px; }

.wrap { width: min(100% - 2 * var(--gut), 1280px); margin-inline: auto; position: relative; z-index: 1; }

h1, h2, h3 { font-weight: 500; text-wrap: balance; hyphens: manual; }
h1 { font-size: var(--t-h1); line-height: 1.04; letter-spacing: -0.032em; }
h2 { font-size: var(--t-h2); line-height: 1.08; letter-spacing: -0.026em; }
h3 { font-size: var(--t-card); line-height: 1.3; letter-spacing: -0.01em; }
.muted { color: var(--muted); }
.lead { font-size: var(--t-lead); line-height: 1.5; color: var(--ink); }
.small { font-size: var(--t-small); line-height: 1.55; color: var(--muted); }
.label { font-size: var(--t-label); font-weight: 500; color: var(--muted); }
.measure { max-width: 62ch; }

/* ---------- Grille ---------- */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; row-gap: 24px; }
.span-2 { grid-column-end: span 2; } .span-3 { grid-column-end: span 3; } .span-4 { grid-column-end: span 4; } .span-5 { grid-column-end: span 5; }
.span-6 { grid-column-end: span 6; } .span-7 { grid-column-end: span 7; } .span-8 { grid-column-end: span 8; }
.span-12 { grid-column: 1 / -1; }
.start-7 { grid-column-start: 7; } .start-5 { grid-column-start: 5; } .start-8 { grid-column-start: 8; }
.start-6 { grid-column-start: 6; }

/* ---------- Liens et boutons ---------- */
.link {
  color: var(--ink); text-decoration: none; font-weight: 500;
  background-image: linear-gradient(var(--ink), var(--ink)), linear-gradient(var(--line), var(--line));
  background-size: 0 1px, 100% 1px; background-position: 0 100%, 0 100%; background-repeat: no-repeat;
  transition: background-size var(--m-out) var(--ease);
  padding-bottom: 2px;
}
.link:hover, .link:focus-visible { background-size: 100% 1px, 100% 1px; transition-duration: var(--m-in); }
.link .m-arrow { display: inline-block; width: 14px; height: 14px; vertical-align: -2px; margin-left: 4px; transition: transform var(--m-out) var(--ease); }
.link:hover .m-arrow { transform: translateX(3px); transition-duration: var(--m-in); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 24px; border-radius: var(--r-btn);
  font-size: 16px; font-weight: 500; line-height: 1; text-decoration: none; white-space: nowrap;
  border: 1px solid transparent; cursor: pointer;
  transition: background-color var(--m-out) var(--ease), border-color var(--m-out) var(--ease), transform var(--m-out) var(--ease);
}
.btn--primary { background: var(--action); color: #fff; }
.btn--secondary { background: var(--tone); color: var(--ink); }
.btn .m-arrow { width: 16px; height: 16px; transition: transform var(--m-out) var(--ease); }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { transform: translateY(-1px); transition-duration: var(--m-in); }
  .btn--primary:hover { background: #b70000; }
  .btn--secondary:hover { background: var(--tone-hover); }
  .btn:hover .m-arrow { transform: translateX(3px); }
}
.btn:active { transform: translateY(1px) scale(.985); transition-duration: var(--m-press); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.btn--xl { height: 88px; width: 100%; font-size: 32px; border-radius: var(--r-md); letter-spacing: -0.02em; justify-content: space-between; padding: 0 40px; }
.btn--xl .m-arrow { width: 32px; height: 32px; }
@media (hover: hover) and (pointer: fine) { .btn--xl:hover { transform: translateY(-2px); } }

/* ---------- En-tête ---------- */
.skip-link {
  position: absolute; left: 0; top: 12px; z-index: 30;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--r-sm);
  text-decoration: none; font-weight: 500; transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

.nav {
  position: fixed; inset: 0 0 auto 0; height: var(--nav); z-index: 20;
  background: var(--g-main); border-bottom: 1px solid var(--line);
}
.nav > .wrap { height: 100%; display: flex; align-items: center; gap: 32px; }
.nav__logo { display: flex; align-items: center; flex: none; border-radius: 4px; }
.nav__logo img { height: 40px; width: auto; }
.nav__links { display: flex; gap: 28px; margin-inline: auto; }
.nav__links a, .nav__plain {
  font-size: 15px; font-weight: 500; text-decoration: none; color: var(--ink); white-space: nowrap;
  position: relative; padding: 6px 0;
}
.nav__links a::after, .nav__plain::after, .footer__col a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right; transition: transform var(--m-out) var(--ease);
}
.nav__links a:hover::after, .nav__plain:hover::after, .footer__col a:hover::after,
.nav__links a:focus-visible::after, .nav__plain:focus-visible::after {
  transform: scaleX(1); transform-origin: left; transition-duration: var(--m-in);
}
.nav__end { display: flex; align-items: center; gap: 24px; margin-left: auto; }
.nav__links + .nav__end { margin-left: 0; }
.nav__toggle {
  display: none; width: 44px; height: 44px; border-radius: var(--r-btn); border: 0;
  background: var(--tone); cursor: pointer; align-items: center; justify-content: center;
}
.nav__toggle svg { width: 20px; height: 20px; }
.nav__toggle .ico-close { display: none; }
.nav__toggle[aria-expanded="true"] .ico-open { display: none; }
.nav__toggle[aria-expanded="true"] .ico-close { display: block; }

.sheet {
  position: fixed; inset: var(--nav) 0 0 0; z-index: 19; background: var(--g-main);
  padding: 16px var(--gut) 32px; overflow-y: auto;
}
.sheet[hidden] { display: none; }
.sheet ul { border-top: 1px solid var(--line); }
.sheet li a { display: flex; align-items: center; height: 56px; border-bottom: 1px solid var(--line); text-decoration: none; font-size: 18px; font-weight: 500; }
.sheet .btn { width: 100%; margin-top: 24px; height: 48px; }

@media (max-width: 1023px) {
  .nav__links, .nav__plain { display: none; }
  .nav__toggle { display: inline-flex; }
  .nav__end, .nav__links + .nav__end { gap: 12px; margin-left: auto; }
}
@media (max-width: 639px) {
  .nav__logo img { height: 28px; }
  .nav__end .btn { display: none; }
}
@media (min-width: 1024px) { .sheet { display: none !important; } }

/* ---------- Sections ---------- */
main > section, .closing {
  position: relative;
  min-height: calc(var(--h, 1) * 100svh);
  padding: var(--padt) 0 var(--padb);
}
.ground-surface { background: var(--g-alt); }
.section-head { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; row-gap: 16px; align-items: start; }
.section-head h2 { grid-column: span 6; }
.section-head .head-side { grid-column: 7 / span 6; display: flex; flex-direction: column; gap: 16px; align-items: flex-start; padding-top: 6px; }
.section-head .head-side p { font-size: 18px; line-height: 1.6; color: var(--muted); }
@media (max-width: 1023px) {
  .section-head h2, .section-head .head-side { grid-column: 1 / -1; }
}

/* Deux écrans, deux groupes : le second commence sous le haut du second écran */
.g2 { display: grid; grid-template-rows: calc(100svh - var(--padt) + var(--padt)) auto; }
.g2 > .g2__row + .g2__row { padding-top: 0; }
@media (max-width: 1023px) { .g2 { display: block; } .g2 > .g2__row + .g2__row { margin-top: 24px; } }

/* ---------- Héros (centré) ---------- */
.hero {
  min-height: 100svh; height: 100svh;
  padding: calc(var(--nav) + var(--hgap)) 0 var(--hpadb);
  display: flex; overflow: hidden;
}
.hero > .wrap { display: flex; flex-direction: column; align-items: center; text-align: center; min-height: 0; }
.hero__pill {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 999px; font-size: 14px; color: var(--ink);
}
.hero__pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); flex: none; }
.hero h1 { margin-top: 20px; max-width: 20ch; }
.hero__lead { margin-top: 20px; max-width: 46ch; font-size: var(--t-lead); line-height: 1.5; color: var(--muted); }
.hero__lead strong { color: var(--ink); font-weight: 500; }
.hero .btn-row { margin-top: 28px; justify-content: center; }
.hero .btn { border-radius: 999px; }
.hero__frame {
  margin-top: 40px; width: 100%; flex: 1; min-height: 160px; position: relative;
  border-radius: var(--r-lg) var(--r-lg) 0 0; background: var(--g-alt);
  padding: 32px 40px 0; overflow: hidden; text-align: left;
}
.hero__frame::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 18%; min-height: 56px;
  background: linear-gradient(rgba(255,255,255,0), var(--g-main)); pointer-events: none; z-index: 2;
}
@media (max-width: 1023px) {
  .hero h1 { max-width: 14ch; }
  .hero__frame { padding: 24px 24px 0; margin-top: 32px; }
}
@media (max-width: 639px) {
  .hero > .wrap { align-items: stretch; text-align: left; }
  .hero__pill { align-self: flex-start; }
  .hero h1 { margin-top: 16px; max-width: none; }
  .hero__lead { margin-top: 16px; font-size: 17px; }
  .hero .btn-row { margin-top: 24px; justify-content: stretch; }
  .hero .btn { width: 100%; height: 48px; }
  .hero__frame { margin-top: 28px; padding: 16px 16px 0; border-radius: var(--r-md) var(--r-md) 0 0; min-height: 120px; }
}
@media (max-height: 760px) and (min-width: 640px) {
  .hero h1 { margin-top: 16px; }
  .hero__lead { margin-top: 14px; }
  .hero .btn-row { margin-top: 20px; }
  .hero__frame { margin-top: 28px; }
}

/* Entrée du héros : une fois au chargement, transform et opacité seulement */
@keyframes rise { from { opacity: 0; transform: translateY(0.45em); } to { opacity: 1; transform: none; } }
@keyframes fadeup { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes settle { from { transform: scale(.98); } to { transform: none; } }
html.m-enter [data-enter] h1 { animation: rise 700ms var(--ease-enter) both; }
html.m-enter [data-enter] .hero__pill { animation: fadeup 520ms var(--ease-enter) both; }
html.m-enter [data-enter] .hero__lead { animation: fadeup 520ms var(--ease-enter) 380ms both; }
html.m-enter [data-enter] .btn-row { animation: fadeup 520ms var(--ease-enter) 440ms both; }
html.m-enter [data-enter] .hero__frame { animation: settle 900ms var(--ease-enter) both; transform-origin: 50% 0; }

/* ---------- Fenêtre de l’application (maquettes) ---------- */
.ui {
  font-family: var(--font); color: var(--a-texte); font-size: 13px; line-height: 1.45;
  background: var(--a-fond); border: 1px solid var(--a-bord); border-radius: var(--r-win);
  box-shadow: 0 1px 2px rgba(23, 32, 42, .06), 0 12px 32px -12px rgba(23, 32, 42, .18);
  overflow: hidden; text-align: left;
}
.ui .num { font-size: 13px; }
.ui-rail { display: flex; align-items: baseline; gap: 14px; background: var(--a-rail); color: var(--a-rail-texte); padding: 10px 18px; white-space: nowrap; overflow: hidden; }
.ui-rail b { color: #fff; font-weight: 600; font-size: 14px; }
.ui-rail .ui-rail__end { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.ui-rail .ui-pill { background: rgba(255,255,255,.12); color: #fff; border-radius: 999px; padding: 1px 10px; }
.ui-body { display: grid; grid-template-columns: 210px minmax(0, 1fr); min-height: 0; }
.ui-menu { background: var(--a-surface); border-right: 1px solid var(--a-bord); padding: 14px 8px; }
.ui-menu p { font-size: 13px; color: var(--a-doux); padding: 10px 10px 4px; }
.ui-menu p:first-child { padding-top: 0; }
.ui-menu span { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 6px; color: var(--a-texte); }
.ui-menu span svg { width: 16px; height: 16px; color: var(--a-doux); flex: none; }
.ui-menu span.is-on { background: var(--a-entete); font-weight: 600; }
.ui-menu span.is-on svg { color: var(--a-texte); }
.ui-main { padding: 18px 22px; min-width: 0; }
.ui-title { font-size: 17px; font-weight: 600; }
.ui-sub { color: var(--a-doux); margin-top: 2px; }
.ui-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.ui-kpi { background: var(--a-surface); border: 1px solid var(--a-bord); border-radius: 8px; padding: 10px 12px; }
.ui-kpi span { color: var(--a-doux); display: block; }
.ui-kpi strong { display: block; font-family: var(--mono); font-weight: 400; font-size: 18px; margin-top: 2px; letter-spacing: -0.01em; }
.ui-h { font-size: 14px; font-weight: 600; margin-top: 16px; }
.ui-table { width: 100%; border-collapse: collapse; background: var(--a-surface); border: 1px solid var(--a-bord); border-radius: 8px; overflow: hidden; margin-top: 8px; }
.ui-box { background: var(--a-surface); border: 1px solid var(--a-bord); border-radius: 8px; overflow: hidden; margin-top: 8px; }
.ui-table th { background: var(--a-entete); text-align: left; font-weight: 500; color: var(--a-doux); padding: 6px 10px; white-space: nowrap; }
.ui-table td { padding: 7px 10px; border-top: 1px solid var(--a-bord-fin); white-space: nowrap; }
.ui-table .r { text-align: right; }
.ui-table .wrap-cell { white-space: normal; }
.ui-table td .ui-dim { color: var(--a-doux); margin-left: 6px; }
.chip { display: inline-block; border-radius: 999px; padding: 1px 9px; font-weight: 600; font-size: 13px; white-space: nowrap; }
.chip--ok { background: var(--a-ok-fond); color: var(--a-ok); }
.chip--warn { background: var(--a-alerte-fond); color: var(--a-alerte); }
.chip--late { background: var(--a-danger-fond); color: var(--a-danger); }
.chip--neutral { background: var(--a-entete); color: var(--a-doux); }
.tag { display: inline-block; border-radius: 4px; padding: 0 6px; background: var(--a-entete); color: var(--a-doux); margin-left: 6px; }
.ui-row { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-top: 1px solid var(--a-bord-fin); }
.ui-row:first-child { border-top: 0; }
.ui-row .ui-row__main { min-width: 0; flex: 1; }
.ui-row .ui-row__main span { display: block; color: var(--a-doux); }
.ui-row .ui-row__main span.tag { display: inline-block; }
.ui-row .ui-row__end { margin-left: auto; text-align: right; white-space: nowrap; }
.ui-ico { width: 30px; height: 30px; border-radius: 8px; background: var(--a-entete); display: grid; place-items: center; flex: none; }
.ui-ico svg { width: 16px; height: 16px; }
.ui-ico--red { background: #fde8e8; color: var(--action); }
.ui-btn { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 6px; background: var(--action); color: #fff; font-weight: 600; white-space: nowrap; }
.ui-btn--line { background: var(--a-surface); color: var(--a-texte); border: 1px solid #d5d5d0; font-weight: 500; }

/* Héros : la fenêtre en entier, coupée par le bas */
.hero__frame .ui { height: 560px; }
@media (max-width: 1023px) { .hero__frame .ui-menu { display: none; } .hero__frame .ui-body { grid-template-columns: minmax(0, 1fr); } .ui-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 639px) {
  .hero__frame .ui-rail .ui-rail__end, .hero__frame .ui-rail .ui-ex { display: none; }
  .hero__frame .ui-main { padding: 14px; }
}

/* ---------- Facturation : la liste à côté de la facture ouverte ---------- */
.app.ui { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); margin-top: 48px; height: min(540px, calc(100svh - 390px)); min-height: 400px; background: var(--a-fond); }
.app > .app__pane { position: relative; min-width: 0; min-height: 0; overflow: hidden; }
.app > .app__pane + .app__pane { border-left: 1px solid var(--a-bord); }
.app > .app__pane::after { content: ""; position: absolute; inset: auto 0 0 0; height: 64px; background: linear-gradient(rgba(247,247,245,0), var(--a-fond)); pointer-events: none; }
.app__bar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--a-bord); background: var(--a-surface); }
.app__bar .ui-title { font-size: 15px; }
.app__bar .ui-btn { margin-left: auto; }
.doc-list .ui-row { background: var(--a-surface); padding: 10px 16px; }
.doc-list .ui-row.is-open { background: #fff7f7; box-shadow: inset 3px 0 0 var(--action); }
.doc-list .ui-row b { font-family: var(--mono); font-weight: 400; }
.app__pane--open { padding: 20px 28px; }
.paper {
  background: #fff; border: 1px solid var(--a-bord); border-radius: 6px; padding: 28px 32px;
  box-shadow: 0 1px 2px rgba(23,32,42,.05); font-size: 13px;
}
.paper__top { display: flex; justify-content: space-between; gap: 24px; }
.paper__brand { display: flex; gap: 10px; align-items: flex-start; }
.paper__mark { width: 36px; height: 36px; border-radius: 8px; background: var(--a-rail); flex: none; }
.paper__title { text-align: right; }
.paper__title strong { display: block; font-size: 18px; font-weight: 600; letter-spacing: .01em; }
.paper__to { margin-top: 18px; display: flex; justify-content: flex-end; }
.paper__to div { min-width: 46%; border: 1px solid var(--a-bord-fin); border-radius: 6px; padding: 8px 12px; }
.paper table { width: 100%; border-collapse: collapse; margin-top: 18px; }
.paper th { text-align: left; color: var(--a-doux); font-weight: 500; border-bottom: 1px solid var(--a-bord); padding: 6px 4px; }
.paper td { padding: 7px 4px; border-bottom: 1px solid var(--a-bord-fin); }
.paper .r { text-align: right; }
.paper__totals { margin-left: auto; width: 52%; margin-top: 12px; }
.paper__totals div { display: flex; justify-content: space-between; padding: 3px 0; }
.paper__totals div:last-child { border-top: 1px solid var(--a-texte); margin-top: 4px; padding-top: 6px; font-weight: 600; }
.paper__foot { margin-top: 18px; color: var(--a-doux); display: grid; gap: 4px; }
.facturx { position: absolute; right: 28px; bottom: 28px; z-index: 3; display: flex; align-items: center; gap: 10px; background: var(--a-surface); border: 1px solid var(--a-bord); border-radius: 10px; padding: 10px 14px; box-shadow: 0 8px 24px -8px rgba(23,32,42,.25); }
@media (min-width: 1024px) and (max-width: 1279px) { .app.ui { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); } .doc-list .ui-row .ui-row__main span { display: none; } }
@media (max-width: 1023px) {
  .app.ui { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); height: 780px; }
  .app > .app__pane--list { max-height: 252px; }
  .app > .app__pane--list::after { display: none; }
  .app > .app__pane + .app__pane { border-left: 0; border-top: 1px solid var(--a-bord); }
}
@media (max-width: 639px) {
  .app.ui { grid-template-rows: minmax(0, 1fr); height: 520px; min-height: 0; margin-top: 32px; }
  .app > .app__pane--list { display: none; }
  .app > .app__pane + .app__pane { border-top: 0; }
  .app__pane--open { padding: 12px; }
  .paper { padding: 16px; }
  .paper__to div { min-width: 70%; }
  .paper__totals { width: 80%; }
  .facturx { right: 12px; bottom: 16px; left: 12px; }
}

/* ---------- Cartes ---------- */
.cards { margin-top: 48px; }
.card { display: flex; flex-direction: column; min-width: 0; }
.card h3 { font-size: var(--t-card); }
.card > p { margin-top: 8px; color: var(--ink); max-width: 46ch; }
.panel {
  margin-top: 20px; height: var(--p-h, 300px); border-radius: var(--r-lg); background: var(--g-alt);
  position: relative; overflow: hidden;
}
.panel .stage { position: absolute; inset: 0; }
.panel .piece { position: absolute; left: 24px; right: 24px; top: 28px; }
.panel::after { content: ""; position: absolute; inset: auto 0 0 0; height: 56px; background: linear-gradient(rgba(243,243,240,0), var(--g-alt)); pointer-events: none; }
.panel--clear::after { display: none; }
#comptabilite .panel { --p-h: 370px; }
#comptabilite .g2__row + .g2__row .panel { --p-h: 300px; }
.panel .piece, .frame .piece, .panel .phone { font-size: 13px; line-height: 1.45; color: var(--a-texte); }
.also { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px 32px; align-items: baseline; }
.also strong { font-weight: 500; }
.also span { color: var(--muted); }
@media (min-width: 1024px) and (max-width: 1279px) {
  .bento .span-8 { grid-column: 1 / -1; }
  .bento .span-4 { grid-column: span 6; }
  .bento .span-4:last-child { grid-column: 1 / -1; }
}
@media (max-width: 1023px) {
  .bento > .card, .bento .span-8, .bento .span-4 { grid-column: 1 / -1; }
}
@media (max-width: 639px) {
  .cards { margin-top: 32px; }
  .grid { column-gap: 12px; row-gap: 32px; }
  #comptabilite .panel { --p-h: 260px; }
}

/* Pièces des cartes */
.phone {
  position: absolute; left: 32px; top: 28px; width: 220px; height: 420px; border-radius: 30px;
  background: var(--a-rail); padding: 10px; box-shadow: 0 16px 40px -16px rgba(23,32,42,.4);
}
.phone__screen { height: 100%; border-radius: 22px; background: var(--a-fond); overflow: hidden; padding: 14px 12px; font-size: 13px; }
.phone__screen .ui-title { font-size: 15px; }
.receipt {
  margin: 12px auto 0; width: 120px; background: #fff; border: 1px solid var(--a-bord); border-radius: 4px;
  padding: 10px 10px 14px; display: grid; gap: 5px; transform: rotate(-2deg);
}
.receipt i { display: block; height: 5px; border-radius: 3px; background: #dedcd6; }
.receipt i:nth-child(1) { width: 60%; margin: 0 auto 4px; background: #c9c6be; }
.receipt i:nth-child(3) { width: 80%; } .receipt i:nth-child(5) { width: 70%; }
.receipt b { font-family: var(--mono); font-weight: 400; font-size: 13px; text-align: right; }
.phone .ui-btn { width: 100%; justify-content: center; margin-top: 14px; height: 34px; }
.justif-list { position: absolute; left: 290px; right: -40px; top: 56px; }
.justif-list .ui-box { margin-top: 0; }
@media (max-width: 1279px) { .justif-list { left: 280px; right: -120px; } }
@media (max-width: 639px) {
  .phone { left: 50%; margin-left: -110px; top: 24px; }
  .justif-list { display: none; }
}

.chips-row { display: flex; gap: 8px; flex-wrap: wrap; }
.file-chip { display: inline-flex; align-items: center; gap: 8px; background: var(--a-surface); border: 1px solid var(--a-bord); border-radius: 8px; padding: 6px 10px; font-size: 13px; font-weight: 500; }
.file-chip i { width: 18px; height: 22px; border-radius: 3px; display: block; position: relative; }
.file-chip i::after { content: ""; position: absolute; right: 0; top: 0; border: 4px solid transparent; border-right-color: var(--a-surface); border-top-color: var(--a-surface); }
.fc-xls i { background: #1f7a45; } .fc-csv i { background: #5f6670; } .fc-ofx i { background: #2c5d9b; } .fc-txt i { background: #5f6670; } .fc-pdf i { background: #c4271b; }

/* ---------- Énoncé (moment : les mots s’allument au défilement) ---------- */
.statement h2 {
  font-size: clamp(30px, 3.4vw + 8px, 60px); line-height: 1.14; letter-spacing: -0.028em; max-width: 30ch;
}
.statement .w { color: var(--ink); transition: color 200ms linear; }
html.js-moments .statement[data-lit] .w { color: #7a8089; }
html.js-moments .statement[data-lit] .w.is-lit { color: var(--ink); }
.statement__foot { margin-top: 48px; display: flex; gap: 12px 40px; flex-wrap: wrap; color: var(--muted); font-size: 18px; }
.statement__foot span { display: inline-flex; align-items: center; gap: 10px; }
.statement__foot svg { width: 20px; height: 20px; color: var(--ink); }

/* ---------- Partage texte / visuel ---------- */
.split { align-items: start; }
.split__text h2 + p { margin-top: 24px; font-size: 20px; line-height: 1.55; }
.facts { margin-top: 24px; display: grid; gap: 0; border-top: 1px solid var(--line); }
.facts li { padding: 12px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; }
.facts li span:last-child { color: var(--muted); text-align: right; }
.split__text .link { display: inline-block; margin-top: 24px; }
.frame { position: relative; border-radius: var(--r-lg); background: var(--g-alt); overflow: hidden; aspect-ratio: 5 / 4; }
.ground-surface .frame { background: #e8e8e4; }
.frame .piece { position: absolute; left: 48px; top: 48px; right: -48px; }
.frame::after { content: ""; position: absolute; inset: auto 0 0 0; height: 64px; background: linear-gradient(rgba(232,232,228,0), #e8e8e4); pointer-events: none; z-index: 2; }
.frame--main { background: var(--g-alt); }
.frame--main::after { background: linear-gradient(rgba(243,243,240,0), var(--g-alt)); }
.over { position: absolute; right: 24px; bottom: 40px; z-index: 3; display: flex; align-items: center; gap: 12px; background: var(--a-surface); border: 1px solid var(--a-bord); border-radius: 10px; padding: 12px 16px; box-shadow: 0 10px 28px -10px rgba(23,32,42,.3); font-size: 13px; max-width: 320px; }
.over span { display: block; color: var(--a-doux); }
@media (max-width: 1023px) {
  .split > * { grid-column: 1 / -1 !important; }
  .split .frame { margin-top: 24px; aspect-ratio: 4 / 3; }
}
@media (max-width: 639px) {
  .frame { aspect-ratio: 1 / 1; }
  .frame .piece { left: 16px; top: 24px; right: -120px; }
  .over { left: 16px; right: 16px; bottom: 16px; max-width: none; }
}

/* ---------- Mise en route (moment : étapes épinglées) ---------- */
.steps { margin-top: 40px; display: grid; gap: 0; border-top: 1px solid var(--line); }
.step { padding: 20px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 4px 12px; }
.step__n { font-family: var(--mono); font-size: 15px; color: var(--muted); padding-top: 3px; }
.step h3 { transition: color 200ms linear; }
.step p { grid-column: 2; color: var(--muted); }
/* Au repos (sans script, mouvement réduit, tablette, téléphone) : chaque étape avec son visuel */
.step__vis { grid-column: 1 / -1; position: relative; margin-top: 16px; height: 300px; }
.step__vis .frame { position: absolute; inset: 0; aspect-ratio: auto; }
.pin__frame { display: none; }
@media (max-width: 639px) { .step__vis { height: 280px; } .step__vis .piece { right: 16px !important; } }
/* Le moment, sur grand écran : la section tient deux écrans, le contenu reste épinglé */
@media (min-width: 1024px) {
  html.js-moments #mise-en-route { padding: 0; min-height: 200svh; }
  html.js-moments .pin { position: sticky; top: 0; height: 100svh; padding: var(--padt) 0 var(--padb); }
  html.js-moments .pin .grid { height: 100%; align-items: start; }
  html.js-moments .pin__frame { display: block; position: relative; height: min(460px, 100%); }
  html.js-moments .pin__frame .step__vis { position: absolute; inset: 0; margin: 0; height: auto; opacity: 0; transition: opacity 300ms var(--ease); }
  html.js-moments .pin__frame .step__vis.is-on { opacity: 1; }
  html.js-moments .step:not(.is-on) h3 { color: var(--faint); }
}
.form-mock { display: grid; gap: 10px; }
.form-mock label { display: block; color: var(--a-doux); margin-bottom: 4px; }
.form-mock .field { height: 34px; border: 1px solid #d5d5d0; border-radius: 6px; background: #fff; padding: 0 10px; display: flex; align-items: center; }
.form-mock .field--focus { border-color: var(--action); box-shadow: 0 0 0 3px rgba(212,0,0,.12); }

/* ---------- Tarifs ---------- */
.switch { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 4px; background: var(--g-main); }
.switch button { border: 0; background: transparent; border-radius: 999px; height: 36px; padding: 0 16px; font-size: 15px; font-weight: 500; color: var(--muted); cursor: pointer; transition: background-color var(--m-out) var(--ease), color var(--m-out) var(--ease); }
.switch button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.plans { margin-top: 48px; align-items: stretch; }
.plan { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 28px 28px 32px; background: var(--g-main); display: flex; flex-direction: column; }
.plan.is-featured { border: 2px solid var(--action); padding: 27px 27px 31px; }
.plan__name { font-size: 22px; font-weight: 500; letter-spacing: -0.01em; }
.plan__for { color: var(--muted); margin-top: 2px; }
.price { margin-top: 20px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.price strong { font-size: 44px; font-weight: 500; letter-spacing: -0.03em; line-height: 1; }
.price span { color: var(--muted); }
.price__note { min-height: 26px; margin-top: 6px; color: var(--a-ok); font-size: 15px; }
.plan ul { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.plan li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; line-height: 1.5; }
.plan li svg { width: 16px; height: 16px; margin-top: 4px; color: var(--a-ok); }
.plan li.plan__base { font-weight: 500; }
.plan__aside { margin-top: auto; padding-top: 20px; font-size: 14px; line-height: 1.55; color: var(--muted); }
.pricing-more { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; row-gap: 32px; align-items: start; }
.pricing-more h3 { font-size: var(--t-h3); }
.pricing-more .rows { margin-top: 16px; border-top: 1px solid var(--line); }
.pricing-more .rows li { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.pricing-more .rows li span:last-child { color: var(--muted); text-align: right; }
.soon { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 999px; background: var(--a-alerte-fond); color: var(--a-alerte); font-size: 13px; font-weight: 500; margin-left: 8px; vertical-align: 4px; }
.legal-note { margin-top: 24px; font-size: 14px; color: var(--muted); }
@media (max-width: 1023px) {
  .plans > .plan { grid-column: 1 / -1; }
  .pricing-more > * { grid-column: 1 / -1 !important; }
}

/* ---------- Questions ---------- */
.faq { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; margin-top: 48px; border-top: 1px solid var(--line); }
@media (max-width: 1023px) { .faq { grid-template-columns: minmax(0, 1fr); margin-top: 32px; } }
.faq__item { padding: 20px 24px 20px 0; border-bottom: 1px solid var(--line); }
.faq__item h3 { font-size: 19px; line-height: 1.35; }
.faq__item p { margin-top: 8px; color: var(--ink); }
.faq-side p { margin-top: 16px; font-size: 18px; color: var(--muted); }
.faq-side .link { display: inline-block; margin-top: 20px; }
@media (max-width: 1023px) { .faq-wrap > * { grid-column: 1 / -1 !important; } .faq { margin-top: 32px; } }

/* ---------- Pied de page ---------- */
.closing { padding-bottom: 32px; display: flex; }
.closing > .wrap { display: grid; grid-template-rows: auto 1fr auto; }
.close--type h2 { max-width: 18ch; }
.close--type p { margin-top: 16px; color: var(--muted); font-size: 18px; }
.close--type .btn--xl { margin-top: 40px; }
.footer { margin-top: 96px; align-self: end; }
.footer__top { align-items: start; }
.footer__brand img { height: 36px; width: auto; }
.footer__lede { margin-top: 20px; font-size: 22px; line-height: 1.35; letter-spacing: -0.01em; max-width: 20ch; }
.footer__col h3 { font-size: 13px; font-weight: 500; color: var(--muted); }
.footer__col ul { margin-top: 12px; display: grid; gap: 4px; }
.footer__col a { position: relative; text-decoration: none; font-size: 15px; display: inline-flex; align-items: center; min-height: 32px; }
.footer__col a::after { bottom: 4px; }
.footer__legal { margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 14px; color: var(--muted); }
.footer__legal a { color: var(--muted); }
@media (max-width: 1023px) {
  .footer__brand { grid-column: 1 / -1; }
  .footer__col { grid-column: span 6; }
}
@media (max-width: 639px) {
  .btn--xl { height: 56px; font-size: 18px; padding: 0 20px; border-radius: var(--r-btn); }
  .btn--xl .m-arrow { width: 20px; height: 20px; }
  .close--type .btn--xl { margin-top: 28px; }
  .footer { margin-top: 64px; }
  .footer__col { grid-column: span 6; }
  .footer__col a { min-height: 44px; }
  .footer__legal { flex-direction: column; }
}

/* ---------- Mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-property: color, background-color, border-color, opacity !important; }
  .btn:hover, .btn:active { transform: none !important; }
}

/* ---------- Ajustements tablette et téléphone ---------- */
@media (max-width: 1023px) {
  #mise-en-route .grid > * { grid-column: 1 / -1; }
}
@media (max-width: 639px) {
  .ui-kpi strong { font-size: 15px; white-space: nowrap; }
  .paper .num, .paper td { white-space: nowrap; }
  .paper th:nth-child(2), .paper td:nth-child(2), .paper th:nth-child(3), .paper td:nth-child(3), .paper th:nth-child(4), .paper td:nth-child(4) { display: none; }
  .paper td:first-child { white-space: normal; }
  .paper__top { flex-direction: column; gap: 12px; }
  .paper__title { text-align: left; }
  .paper__to { justify-content: flex-start; }
  #paie .frame { aspect-ratio: 4 / 5; }
}
@media (max-width: 639px) {
  .pricing-more .rows li, .facts li { flex-direction: column; gap: 2px; }
  .pricing-more .rows li span:last-child, .facts li span:last-child { text-align: left; }
}
@media (min-width: 1024px) and (max-width: 1279px) {
  .nav > .wrap { gap: 24px; }
  .nav__links { gap: 20px; }
  .nav__links a:last-child { display: none; }
  .nav__end { gap: 20px; }
}
