/* Les Ricains, compta.
   Layout: dark cosmic hero glowing into a white spec sheet; floating pill nav; 1200px column of hairline cards. */
:root {
  color-scheme: light;

  /* Couleurs */
  --iris: #0036ff;          /* seul aplat saturé : boutons principaux, indicateurs actifs */
  --iris-deep: #0029c7;
  --cyan: #0093ff;          /* accents, badges */
  --sky: #80bfef;           /* bleu clair */
  --sky-2: #44a4e9;
  --void: #05061b;
  --cosmos: #0f071d;
  --ink: #141414;
  --charcoal: #333333;
  --steel: #656565;
  --quiet: #9b9ca8;
  --hair: #e5e7eb;
  --hair-soft: #eff1f5;
  --paper: #ffffff;
  --mist: #f6f8fc;
  --frost: #e1ecff;
  --frost-line: #cfdcff;
  --mint: #e6fff7;
  --good: #07875b;
  --bad: #d4373c;
  --bad-soft: #fff1f1;

  /* Typo */
  --f-display: 'Inter Tight', 'Satoshi', 'General Sans', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --f-body: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --f-mono: 'Geist Mono', 'JetBrains Mono', 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Formes */
  --r-sm: 6px;
  --r-md: 10px;
  --r-card: 14px;
  --r-lg: 20px;
  --r-hero: 24px;
  --r-block: 32px;
  --r-pill: 999px;

  --sh-hair: rgba(0, 0, 0, 0.04) 0 0 0 1px;
  --sh-float: rgba(0, 0, 0, 0.06) 0 12px 12px -3px, rgba(0, 0, 0, 0.04) 0 6px 6px -3px, rgba(0, 0, 0, 0.02) 0 3px 3px -1.5px, rgba(0, 0, 0, 0.03) 0 1px 1px -0.5px;
  --sh-lg: rgba(0, 0, 0, 0.04) 0 24px 32px -3px, rgba(0, 0, 0, 0.06) 0 12px 24px -3px, rgba(0, 0, 0, 0.04) 0 6px 6px -3px, rgba(0, 0, 0, 0.03) 0 1px 1px -0.5px;
  --sh-btn: rgba(255, 255, 255, 0.12) 0 1px 2px -0.5px inset, rgba(255, 255, 255, 0.16) 0 0.5px 0.5px 0 inset, rgba(255, 255, 255, 0.16) 0 8px 24px -4px inset;
  --sh-dark: rgba(255, 255, 255, 0.06) 0 0.5px 0.5px 0 inset, rgba(5, 6, 27, 0.5) 0 16px 56px 0, rgba(5, 6, 27, 0.16) 0 2px 4px 0;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --nav-top: calc(env(safe-area-inset-top, 0px) + 14px);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.63 var(--f-body);
  letter-spacing: -0.01em;
  font-feature-settings: "cv01", "ss01";
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

.ic { width: 20px; height: 20px; flex: none; }
.ic svg { width: 100%; height: 100%; }

.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;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: clamp(16px, 4vw, 32px);
}

.num { font-variant-numeric: tabular-nums; }

/* ---------- Barre de progression ---------- */
.progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 3px;
  z-index: 60;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--sky), var(--cyan) 40%, var(--iris));
  pointer-events: none;
}

/* ---------- Navigation pilule ---------- */
.nav-wrap {
  position: fixed;
  top: var(--nav-top);
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  justify-content: center;
  padding-inline: 16px;
  pointer-events: none;
}

.nav-wrap::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: calc(-1 * var(--nav-top));
  height: calc(var(--nav-top) + 76px);
  background: linear-gradient(180deg, var(--paper) 35%, rgba(255, 255, 255, 0));
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  pointer-events: none;
}

.nav-wrap.is-solid::before { opacity: 1; }

.nav {
  position: relative;
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 6px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border: 1px solid var(--hair);
  border-radius: var(--r-hero);
  box-shadow: var(--sh-float);
  transition: box-shadow 0.4s var(--ease), transform 0.5s var(--ease);
  animation: navIn 0.9s var(--ease) backwards;
}

.nav.is-scrolled { box-shadow: var(--sh-lg); }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 4px 4px;
  text-decoration: none;
  flex: none;
}

.brand-mark {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: #fff;
  font: 600 16px/1 var(--f-display);
  background: linear-gradient(145deg, var(--sky-2), var(--iris) 70%);
  box-shadow: var(--sh-btn);
  overflow: hidden;
  transition: transform 0.5s var(--spring);
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.55) 50%, transparent 70%);
  transform: translateX(-110%);
  animation: sheen 5s 1.5s var(--ease) infinite;
}

.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.06); }

.brand-name {
  font: 500 15px/1 var(--f-display);
  letter-spacing: -0.015em;
  white-space: nowrap;
}

.nav-links {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-links::-webkit-scrollbar { display: none; }

.nav-links a {
  position: relative;
  z-index: 1;
  padding: 8px 12px;
  border-radius: var(--r-pill);
  font: 500 13.5px/1 var(--f-body);
  color: var(--steel);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.25s;
}

.nav-links a:hover,
.nav-links a.is-active { color: var(--ink); }

.nav-links a.is-active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 3px;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--iris);
  animation: pop 0.4s var(--spring);
}

.nav-hl {
  position: absolute;
  z-index: 0;
  top: 50%;
  left: 0;
  height: 32px;
  width: 0;
  margin-top: -16px;
  border-radius: var(--r-pill);
  background: var(--mist);
  border: 1px solid var(--hair);
  opacity: 0;
  transition: transform 0.45s var(--ease), width 0.45s var(--ease), opacity 0.25s;
  pointer-events: none;
}

.sync {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  height: 32px;
  padding: 0 12px 0 10px;
  border-radius: var(--r-pill);
  background: var(--mist);
  border: 1px solid var(--hair);
  font: 500 11px/1 var(--f-mono);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--steel);
  white-space: nowrap;
}

.sync i {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--quiet);
}

.sync[data-state="live"] i { background: var(--good); }
.sync[data-state="live"] i::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--good);
  animation: ping 2s var(--ease) infinite;
}
.sync[data-state="local"] i { background: var(--cyan); }
.sync[data-state="demo"] i { background: #f5a524; }
.sync[data-state="archive"] i { background: var(--sky-2); }
.sync[data-state="offline"] i,
.sync[data-state="readonly"] i { background: var(--bad); }

/* ---------- Boutons ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 20px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  font: 500 14px/1.2 var(--f-body);
  letter-spacing: -0.005em;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.35s var(--ease), background-color 0.25s, border-color 0.25s, color 0.25s, box-shadow 0.35s var(--ease);
}

.btn .ic { width: 16px; height: 16px; transition: transform 0.35s var(--ease); }
.btn:hover .ic-arrow { transform: translateX(3px); }
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--iris);
  color: #fff;
  box-shadow: var(--sh-btn), 0 10px 24px -10px rgba(0, 54, 255, 0.7);
}

.btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(110deg, transparent 25%, rgba(255, 255, 255, 0.38) 50%, transparent 75%);
  transform: translateX(-120%);
  transition: transform 0.9s var(--ease);
}

.btn-primary:hover { background: #0a3fff; box-shadow: var(--sh-btn), 0 14px 32px -10px rgba(0, 54, 255, 0.85); }
.btn-primary:hover::after { transform: translateX(120%); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.btn-ghost:hover { background: var(--ink); color: #fff; }

.btn-ghost-dark {
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.32);
  backdrop-filter: blur(6px);
}
.btn-ghost-dark:hover { background: #fff; color: var(--ink); border-color: #fff; }

.btn-soft {
  background: var(--mist);
  color: var(--ink);
  border-color: var(--hair);
}
.btn-soft:hover { background: #fff; border-color: #c9cdd6; }

.btn-block { width: 100%; }
.btn-sm { min-height: 34px; padding: 6px 14px; font-size: 13px; }

.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.link-btn {
  background: none;
  border: 0;
  padding: 0;
  font: 500 14px/1.4 var(--f-body);
  color: rgba(255, 255, 255, 0.7);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: rgba(255, 255, 255, 0.3);
  transition: color 0.2s, text-decoration-color 0.2s;
}
.link-btn:hover { color: #fff; text-decoration-color: #fff; }

/* ---------- Héros ---------- */
.hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  padding: calc(env(safe-area-inset-top, 0px) + 132px) 0 0;
  background:
    radial-gradient(70% 46% at 50% 100%, rgba(255, 255, 255, 0.95) 0%, rgba(206, 232, 252, 0.85) 22%, rgba(128, 191, 239, 0.55) 42%, rgba(16, 149, 229, 0) 70%),
    radial-gradient(120% 60% at 50% 104%, #44a4e9 0%, #1095e5 22%, #1046e9 40%, #061db6 58%, rgba(6, 29, 182, 0) 78%),
    linear-gradient(180deg, var(--void) 0%, var(--cosmos) 34%, #0a0f45 62%, #0c2aa8 82%, #9fd0f5 96%, #ffffff 100%);
}

.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 22px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  background: var(--hair-soft);
  border: 1px solid var(--hair);
  font: 500 11px/1.45 var(--f-mono);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ink);
}

.eyebrow .ic { width: 14px; height: 14px; color: var(--iris); }

.eyebrow--dark {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.86);
  animation: rise 0.9s 0.1s var(--ease) backwards;
}

.eyebrow--dark i.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sky);
  box-shadow: 0 0 12px var(--sky);
}

.hero-title {
  margin: 0;
  font: 500 clamp(56px, 11vw, 112px)/0.98 var(--f-display);
  letter-spacing: -0.035em;
  text-wrap: balance;
  font-feature-settings: "ss02", "ss05";
}

.hero-title .ch {
  display: inline-block;
  background: linear-gradient(180deg, #ffffff 30%, #b9dcf8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: charIn 1s var(--ease) backwards;
  animation-delay: calc(0.18s + var(--i) * 0.045s);
}

.hero-title .sp { display: inline-block; width: 0.26em; }

.hero-sub {
  max-width: 560px;
  margin: 0;
  font-size: clamp(16px, 2vw, 18px);
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.72);
  text-wrap: balance;
  animation: rise 0.9s 0.55s var(--ease) backwards;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
  animation: rise 0.9s 0.7s var(--ease) backwards;
}

.hero-demo { animation: rise 0.9s 0.8s var(--ease) backwards; }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
  max-width: 820px;
  margin-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  animation: rise 0.9s 0.85s var(--ease) backwards;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 22px 12px 4px;
  min-width: 0;
}

.hero-stat + .hero-stat { border-left: 1px solid rgba(255, 255, 255, 0.12); }

.hero-stat .ic-box {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--sky);
  margin-bottom: 4px;
}

.hero-stat b {
  font: 500 clamp(20px, 3vw, 28px)/1.1 var(--f-display);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.hero-stat span {
  font-size: 13px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.62);
}

/* Fenêtre façon macOS */
.hero-stage {
  position: relative;
  margin-top: 56px;
  perspective: 1400px;
  padding-bottom: 72px;
}

.window {
  position: relative;
  max-width: 920px;
  margin-inline: auto;
  border-radius: var(--r-card);
  background: var(--paper);
  box-shadow: 0 40px 80px -20px rgba(5, 6, 27, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.5), var(--sh-float);
  overflow: hidden;
  transform-origin: 50% 0%;
  transform: rotateX(var(--tilt, 14deg)) scale(var(--scale, 0.96));
  will-change: transform;
  animation: windowIn 1.3s 0.6s var(--ease) backwards;
}

.window-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  background: #f1f1f1;
  border-bottom: 1px solid var(--hair);
  color: var(--steel);
  font: 500 12px/1 var(--f-body);
}

.window-bar .dots { display: flex; gap: 8px; }
.window-bar .dots i { width: 12px; height: 12px; border-radius: 50%; background: #ff5f57; }
.window-bar .dots i:nth-child(2) { background: #febc20; }
.window-bar .dots i:nth-child(3) { background: #28c840; }
.window-bar .title { flex: 1; text-align: center; margin-right: 52px; }

.terminal {
  background: var(--void);
  color: #fff;
  padding: 20px 22px 22px;
  font: 400 12.5px/2 var(--f-mono);
  min-height: 300px;
  overflow: hidden;
}

.term-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
  white-space: nowrap;
  min-width: 0;
}

.term-line .p { color: #656565; }
.term-line .cmd { color: #fff; }
.term-line .flag { color: var(--sky); }
.term-line .ok { color: #5be0a6; }
.term-line .tag {
  flex: none;
  min-width: 64px;
  color: #9fb4ff;
}
.term-line .what {
  overflow: hidden;
  text-overflow: ellipsis;
  color: rgba(255, 255, 255, 0.86);
}
.term-line .dots-fill {
  flex: 1;
  min-width: 16px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.18);
}
.term-line .amt { flex: none; color: #fff; font-variant-numeric: tabular-nums; }
.term-line.is-new { animation: termIn 0.7s var(--ease) both; }
.term-line.muted { color: rgba(255, 255, 255, 0.45); }
.term-sum {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(255, 255, 255, 0.14);
}
.term-sum .amt { color: var(--sky); }

.caret {
  display: inline-block;
  width: 8px;
  height: 15px;
  margin-left: 2px;
  vertical-align: -2px;
  background: var(--sky);
  animation: blink 1.1s steps(1) infinite;
}

/* ---------- Bandeau défilant ---------- */
.marquee {
  position: relative;
  overflow: hidden;
  border-block: 1px solid var(--hair);
  background: var(--paper);
  padding: 14px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.marquee-track {
  display: flex;
  width: max-content;
  will-change: transform;
}

.marquee-item {
  display: inline-flex;
  align-items: center;
  gap: 28px;
  padding-right: 28px;
  font: 500 12px/1 var(--f-mono);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--steel);
  white-space: nowrap;
  transition: color 0.2s;
}

.marquee-item:hover { color: var(--iris); }
.marquee-item::after {
  content: "";
  width: 6px;
  height: 6px;
  transform: rotate(45deg);
  background: var(--sky);
  border-radius: 1px;
}

/* ---------- Sections ---------- */
.section {
  position: relative;
  padding-block: clamp(72px, 9vw, 120px);
}

.section--mist { background: var(--mist); border-block: 1px solid var(--hair); }

.sec-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  max-width: 720px;
  margin-bottom: 36px;
}

.sec-title {
  margin: 0;
  font: 500 clamp(34px, 5vw, 52px)/1.1 var(--f-display);
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.sec-title .w {
  display: inline-block;
  white-space: pre;
}

.sec-sub {
  margin: 0;
  max-width: 62ch;
  color: var(--steel);
  font-size: 17px;
  line-height: 1.7;
}

/* Apparition au défilement : les éléments restent visibles au repos,
   l'animation ne se joue qu'à l'instant où ils entrent dans l'écran. */
.reveal.is-in { animation: revealIn 0.95s var(--ease) backwards; animation-delay: var(--d, 0s); }
.sec-title.is-in .w { animation: wordIn 0.9s var(--ease) backwards; animation-delay: calc(var(--i) * 0.06s); }

/* ---------- Cartes ---------- */
.card {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--hair);
  border-radius: var(--r-card);
  padding: 24px;
  min-width: 0;
}

.spot { isolation: isolate; }

.spot::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: inherit;
  background: radial-gradient(520px circle at var(--mx, 50%) var(--my, 50%), rgba(0, 147, 255, 0.08), transparent 45%);
  opacity: 0;
  transition: opacity 0.45s var(--ease);
  pointer-events: none;
}

.spot::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(0, 54, 255, 0.6), rgba(0, 147, 255, 0.25) 40%, transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.45s var(--ease);
  pointer-events: none;
}

.spot:hover::before,
.spot:hover::after,
.spot:focus-within::before { opacity: 1; }

.card-title {
  margin: 0 0 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  font: 500 20px/1.3 var(--f-display);
  letter-spacing: -0.015em;
}

.card-title small {
  margin-left: auto;
  font: 500 11px/1 var(--f-mono);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--steel);
}

.ic-box {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--frost);
  border: 1px solid var(--frost-line);
  color: var(--iris);
}

.ic-box .ic { width: 20px; height: 20px; }

.split {
  display: grid;
  grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.split > .form-card { position: sticky; top: 96px; }

/* ---------- Tuiles de stats ---------- */
.tiles {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.tiles-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tiles-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tiles-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.tiles-auto { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  background: var(--paper);
  border: 1px solid var(--hair);
  border-radius: var(--r-card);
  min-width: 0;
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease), border-color 0.3s;
}

.tile:hover {
  transform: translateY(-4px);
  border-color: #d5dae4;
  box-shadow: var(--sh-lg);
}

.tile-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.tile .k {
  font: 500 11px/1.45 var(--f-mono);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--steel);
}

.tile .v {
  font: 500 clamp(22px, 2.4vw, 30px)/1.1 var(--f-display);
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.tile .s { font-size: 13px; color: var(--steel); line-height: 1.4; }

.tile .ic-box { width: 34px; height: 34px; border-radius: 10px; }
.tile .ic-box .ic { width: 17px; height: 17px; }

.tile:hover .ic-box { animation: wiggle 0.6s var(--ease); }

/* Tuiles cliquables (onglets braquage) */
button.tile {
  text-align: left;
  font: inherit;
  cursor: pointer;
}

button.tile[aria-selected="true"] {
  border-color: var(--iris);
  box-shadow: 0 0 0 3px rgba(0, 54, 255, 0.12), var(--sh-float);
  background: linear-gradient(180deg, #fff, #f3f7ff);
}

button.tile[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: -1px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--iris);
  animation: grow 0.5s var(--ease);
}

/* ---------- Formulaires ---------- */
.form { display: flex; flex-direction: column; gap: 18px; }

.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font: 500 11px/1.45 var(--f-mono);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--steel);
}

.label em {
  font-style: normal;
  color: var(--quiet);
}

.input,
.select {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--hair);
  border-radius: var(--r-sm);
  background: var(--paper);
  font-size: 15px;
  color: var(--ink);
  transition: border-color 0.2s, box-shadow 0.25s var(--ease), background-color 0.2s;
}

.input::placeholder { color: var(--quiet); }
.input:hover, .select:hover { border-color: #cfd3dc; }
.input:focus, .select:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 4px rgba(0, 147, 255, 0.14);
}

.input-money { position: relative; }
.input-money .input { padding-right: 30px; font-variant-numeric: tabular-nums; }
.input-money::after {
  content: "$";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--quiet);
  font: 500 14px/1 var(--f-mono);
  pointer-events: none;
}

.select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23656565' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.input.shake, .picker.shake, .choices.shake { animation: shake 0.45s var(--ease); }
.input[readonly] { background: var(--mist); color: var(--steel); cursor: not-allowed; }
.input.is-error { border-color: var(--bad); box-shadow: 0 0 0 4px rgba(212, 55, 60, 0.12); }

/* Total calculé */
.total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: var(--void);
  color: #fff;
  overflow: hidden;
  position: relative;
}

.total::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(240px 80px at 100% 50%, rgba(68, 164, 233, 0.35), transparent 70%);
  pointer-events: none;
}

.total .k {
  position: relative;
  font: 500 11px/1.45 var(--f-mono);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}

.total .v {
  position: relative;
  font: 500 24px/1.1 var(--f-display);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.total .v.bump { animation: bump 0.4s var(--spring); }

.total small {
  display: block;
  margin-top: 2px;
  font: 400 12px/1.3 var(--f-body);
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0;
}

/* Cartes de choix (radios) */
.choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.choices-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.choice { position: relative; display: block; min-width: 0; }

.choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-body {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 100%;
  padding: 11px 12px;
  border: 1px solid var(--hair);
  border-radius: 12px;
  background: var(--paper);
  cursor: pointer;
  transition: transform 0.35s var(--ease), border-color 0.25s, background-color 0.25s, box-shadow 0.35s var(--ease);
}

.choice-body .ic-box { width: 32px; height: 32px; border-radius: 9px; background: var(--mist); border-color: var(--hair); color: var(--steel); transition: background-color 0.25s, color 0.25s, border-color 0.25s, transform 0.45s var(--spring); }
.choice-body .ic-box .ic { width: 16px; height: 16px; }
.choice-body .txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.choice-body b { font-weight: 500; font-size: 14px; letter-spacing: 0; overflow-wrap: break-word; hyphens: auto; }
.choice-body small { font-size: 12px; color: var(--steel); }

.choice:hover .choice-body { border-color: #c4d2f2; transform: translateY(-2px); box-shadow: var(--sh-float); }
.choice:hover .ic-box { transform: rotate(-8deg) scale(1.08); }

.choice input:checked + .choice-body {
  border-color: var(--iris);
  background: #f5f8ff;
  box-shadow: 0 0 0 3px rgba(0, 54, 255, 0.1);
}

.choice input:checked + .choice-body .ic-box {
  background: var(--frost);
  border-color: var(--frost-line);
  color: var(--iris);
}

.choice input:focus-visible + .choice-body { outline: 2px solid var(--cyan); outline-offset: 2px; }

/* Choix compacts : pastilles à leur largeur naturelle, qui passent à la ligne entières */
.choices.compact { display: flex; flex-wrap: wrap; gap: 8px; }
.choices.compact .choice { flex: 0 1 auto; }
.choices.compact .choice-body { padding: 7px 16px 7px 7px; gap: 9px; border-radius: var(--r-pill); }
.choices.compact .choice-body .ic-box { width: 28px; height: 28px; border-radius: 50%; }
.choices.compact .choice-body .ic-box .ic { width: 14px; height: 14px; }
.choices.compact .choice-body b { font-size: 14px; white-space: nowrap; }

/* Contrôle segmenté */
.seg {
  position: relative;
  display: inline-flex;
  padding: 4px;
  border-radius: var(--r-pill);
  background: var(--mist);
  border: 1px solid var(--hair);
  max-width: 100%;
}

.seg-block { display: flex; }
.seg-block label { flex: 1; }

.seg label { position: relative; z-index: 1; }

.seg input { position: absolute; opacity: 0; pointer-events: none; }

.seg span {
  display: block;
  padding: 8px 16px;
  border-radius: var(--r-pill);
  font: 500 12px/1.2 var(--f-mono);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-align: center;
  white-space: nowrap;
  color: var(--steel);
  cursor: pointer;
  transition: color 0.3s;
}

.seg label:hover span { color: var(--ink); }
.seg input:checked + span { color: #fff; }
.seg input:focus-visible + span { outline: 2px solid var(--cyan); outline-offset: 2px; }

.seg-thumb {
  position: absolute;
  z-index: 0;
  top: 4px;
  bottom: 4px;
  left: 0;
  width: 0;
  border-radius: var(--r-pill);
  background: var(--ink);
  box-shadow: 0 6px 14px -6px rgba(20, 20, 20, 0.6);
  transition: transform 0.5s var(--spring), width 0.4s var(--ease);
}

/* Sélecteur de membres */
.picker { position: relative; }

.picker-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 5px;
  border: 1px solid var(--hair);
  border-radius: var(--r-sm);
  background: var(--paper);
  transition: border-color 0.2s, box-shadow 0.25s var(--ease);
}

.picker.is-open .picker-box {
  border-color: var(--cyan);
  box-shadow: 0 0 0 4px rgba(0, 147, 255, 0.14);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 6px 0 4px;
  border-radius: var(--r-pill);
  border: 1px solid var(--frost-line);
  background: var(--frost);
  color: var(--ink);
  font: 500 13px/1 var(--f-body);
  animation: chipIn 0.4s var(--spring);
  transition: background-color 0.2s, border-color 0.2s;
}

.chip .x {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--steel);
  padding: 0;
  transition: background-color 0.2s, color 0.2s, transform 0.3s var(--spring);
}

.chip .x .ic { width: 12px; height: 12px; }
.chip .x:hover { background: var(--bad); color: #fff; transform: rotate(90deg); }

.avatar {
  --h: 214;
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: 600 10px/1 var(--f-body);
  letter-spacing: 0;
  color: #fff;
  background: linear-gradient(140deg, hsl(var(--h) 85% 68%), hsl(calc(var(--h) + 18) 90% 46%));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.picker-add {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--r-pill);
  border: 1px dashed #c6ccd8;
  background: transparent;
  color: var(--steel);
  font: 500 13px/1 var(--f-body);
  transition: border-color 0.2s, color 0.2s, background-color 0.2s;
}

.picker-add .ic { width: 14px; height: 14px; transition: transform 0.35s var(--spring); }
.picker-add:hover { border-color: var(--iris); color: var(--iris); background: #f5f8ff; }
.picker-add:hover .ic { transform: rotate(90deg); }
.picker-add[disabled] { opacity: 0.5; cursor: not-allowed; }

.picker-pop {
  position: relative;
  margin-top: 6px;
  padding: 6px;
  background: var(--paper);
  border: 1px solid var(--hair);
  border-radius: 12px;
  box-shadow: var(--sh-lg);
  transform-origin: 50% 0;
  animation: popIn 0.3s var(--ease);
}

.picker-search {
  width: 100%;
  height: 36px;
  margin-bottom: 4px;
  padding: 0 10px;
  border: 1px solid var(--hair);
  border-radius: var(--r-sm);
  font-size: 14px;
  background: var(--mist);
}

.picker-search:focus { outline: none; border-color: var(--cyan); background: #fff; }

.picker-list {
  max-height: 240px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.picker-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  font-size: 14px;
  transition: background-color 0.15s, transform 0.25s var(--ease);
}

.picker-opt:hover:not([disabled]) { background: var(--mist); transform: translateX(3px); }
.picker-opt[aria-selected="true"] { background: #f2f6ff; }
.picker-opt[disabled] { opacity: 0.4; cursor: not-allowed; }
.picker-opt .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.picker-opt .check {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1px solid #cdd2dc;
  display: grid;
  place-items: center;
  color: #fff;
  transition: background-color 0.2s, border-color 0.2s;
}

.picker-opt .check .ic { width: 12px; height: 12px; opacity: 0; transform: scale(0.5); transition: opacity 0.2s, transform 0.3s var(--spring); }
.picker-opt[aria-selected="true"] .check { background: var(--iris); border-color: var(--iris); }
.picker-opt[aria-selected="true"] .check .ic { opacity: 1; transform: none; }

.picker-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  padding: 6px 4px 0 8px;
  border-top: 1px solid var(--hair-soft);
  font: 500 11px/1.45 var(--f-mono);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--steel);
}

.picker-empty {
  padding: 14px 10px;
  font-size: 13px;
  color: var(--steel);
  line-height: 1.5;
}

.picker-empty a { color: var(--iris); font-weight: 500; }

/* ---------- Listes / tableaux ---------- */
.list-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.list-head h3 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  font: 500 20px/1.3 var(--f-display);
  letter-spacing: -0.015em;
}

.count-pill {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--r-pill);
  background: var(--frost);
  color: var(--iris);
  font: 500 11px/1 var(--f-mono);
  letter-spacing: 0.03em;
}

.table-wrap {
  position: relative; /* garde les libellés masqués (sr-only) dans la zone défilante */
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.table th {
  padding: 10px;
  border-bottom: 1px solid var(--hair);
  text-align: left;
  font: 500 11px/1.45 var(--f-mono);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--steel);
  white-space: nowrap;
}

.table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--hair-soft);
  vertical-align: middle;
}

.table th.r, .table td.r { text-align: right; }
.table td.strong { font-weight: 600; }
.table td.nw { white-space: nowrap; }
.table .people { max-width: 230px; }
.cell-sub { display: block; margin-top: 6px; font-size: 12px; color: var(--steel); white-space: nowrap; }
.table td.muted { color: var(--steel); }
.table td.date { color: var(--steel); white-space: nowrap; font-size: 13px; }

.table tbody tr {
  position: relative;
  transition: background-color 0.2s;
}

.table tbody tr:hover { background: var(--mist); }
.table tbody tr.row-new { animation: rowIn 1.1s var(--ease); }

.table tfoot td {
  padding: 14px 12px 4px;
  border-bottom: 0;
  font-weight: 600;
}

.table tfoot td.lbl {
  font: 500 11px/1.45 var(--f-mono);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--steel);
}

.people { display: flex; flex-wrap: wrap; gap: 4px; }

.person {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 8px 0 2px;
  border-radius: var(--r-pill);
  background: var(--mist);
  border: 1px solid var(--hair);
  font-size: 12.5px;
  white-space: nowrap;
}

.person .avatar { width: 20px; height: 20px; font-size: 9px; }
.person.gone { color: var(--quiet); text-decoration: line-through; text-decoration-color: rgba(0, 0, 0, 0.2); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: var(--r-pill);
  font: 500 11px/1 var(--f-mono);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
  background: var(--frost);
  color: var(--iris);
}

.badge .ic { width: 13px; height: 13px; }
.badge--dark { background: var(--ink); color: #fff; }
.badge--cyan { background: #e3f3ff; color: #006fc2; }
.badge--mint { background: var(--mint); color: var(--good); }
.badge--soft { background: var(--mist); color: var(--steel); border: 1px solid var(--hair); }

.del {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  background: transparent;
  color: var(--quiet);
  font: 500 12px/1 var(--f-body);
  white-space: nowrap;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s, padding 0.3s var(--ease);
}

.del .ic { width: 16px; height: 16px; }
.del:hover { color: var(--bad); background: var(--bad-soft); }
.del.armed {
  color: #fff;
  background: var(--bad);
  padding: 0 12px;
  animation: pop 0.35s var(--spring);
}

.more-row {
  display: flex;
  justify-content: center;
  padding-top: 14px;
}

/* États vides */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 36px 16px;
  border: 1px dashed #d7dbe3;
  border-radius: 12px;
  background: repeating-linear-gradient(135deg, transparent 0 10px, rgba(225, 236, 255, 0.35) 10px 11px);
  color: var(--steel);
}

.empty .ic-box { animation: float 4s ease-in-out infinite; }
.empty b { color: var(--ink); font: 500 16px/1.3 var(--f-display); }
.empty p { margin: 0; max-width: 40ch; font-size: 14px; line-height: 1.6; }
.empty a { color: var(--iris); font-weight: 500; }

/* ---------- Fiches membres (Actions) ---------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.search {
  position: relative;
  flex: 1 1 260px;
  max-width: 360px;
}

.search .ic {
  position: absolute;
  left: 12px;
  top: 50%;
  width: 16px;
  height: 16px;
  transform: translateY(-50%);
  color: var(--quiet);
  pointer-events: none;
}

.search .input { padding-left: 36px; border-radius: var(--r-pill); }

.fiches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}

.fiche {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  padding: 20px;
  border: 1px solid var(--hair);
  border-radius: var(--r-card);
  background: var(--paper);
  text-align: left;
  transform-style: preserve-3d;
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease), border-color 0.3s;
}

.fiche:hover {
  border-color: #d3d9e5;
  box-shadow: var(--sh-lg);
}

.fiche-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.fiche-head .avatar { width: 44px; height: 44px; font-size: 15px; }
.fiche-name { display: flex; flex-direction: column; min-width: 0; }
.fiche-name b { font: 500 18px/1.25 var(--f-display); letter-spacing: -0.015em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fiche-name span { font-size: 13px; color: var(--steel); }

.fiche-total {
  font: 500 28px/1.1 var(--f-display);
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
}

.fiche-total small {
  display: block;
  margin-bottom: 4px;
  font: 500 11px/1.45 var(--f-mono);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--steel);
}

.stack {
  display: flex;
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--hair-soft);
  overflow: hidden;
  gap: 2px;
}

.stack i {
  height: 100%;
  border-radius: var(--r-pill);
  transform-origin: 0 50%;
  transition: flex-grow 0.8s var(--ease);
}

.fiche:hover .stack i { animation: grow 0.7s var(--ease) both; }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 12px;
  color: var(--steel);
}

.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 8px; height: 8px; border-radius: 2px; }

.fiche-open {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 500 13px/1 var(--f-body);
  color: var(--iris);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}

.fiche-open .ic { width: 14px; height: 14px; }
.fiche:hover .fiche-open, .fiche:focus-visible .fiche-open { opacity: 1; transform: none; }
@media (hover: none) { .fiche-open { opacity: 1; transform: none; } }

/* ---------- Tiroir (fiche détaillée) ---------- */
.drawer {
  margin: 0 0 0 auto;
  width: min(540px, 100%);
  height: 100%;
  max-height: 100%;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: var(--paper);
  color: var(--ink);
  box-shadow: -30px 0 80px -20px rgba(5, 6, 27, 0.35);
  overflow: hidden;
}

.drawer[open] { animation: drawerIn 0.55s var(--ease); }
.drawer.closing { animation: drawerOut 0.35s var(--ease) forwards; }
.drawer::backdrop { background: rgba(5, 6, 27, 0.42); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: fadeIn 0.4s var(--ease); }
.drawer.closing::backdrop { animation: fadeOut 0.35s var(--ease) forwards; }

.drawer-inner {
  height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.drawer-head {
  position: relative;
  padding: calc(env(safe-area-inset-top, 0px) + 28px) 24px 24px;
  background:
    radial-gradient(90% 120% at 100% 0%, rgba(68, 164, 233, 0.45), transparent 60%),
    linear-gradient(180deg, var(--void), #0b1660);
  color: #fff;
  overflow: hidden;
}

.drawer-close {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 16px);
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  display: grid;
  place-items: center;
  transition: transform 0.4s var(--spring), background-color 0.2s;
}

.drawer-close:hover { transform: rotate(90deg); background: rgba(255, 255, 255, 0.16); }
.drawer-close .ic { width: 16px; height: 16px; }

.drawer-who { display: flex; align-items: center; gap: 14px; }
.drawer-who .avatar { width: 56px; height: 56px; font-size: 18px; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.15); }
.drawer-who h3 { margin: 0; font: 500 26px/1.15 var(--f-display); letter-spacing: -0.02em; overflow-wrap: anywhere; }
.drawer-who p { margin: 2px 0 0; color: rgba(255, 255, 255, 0.6); font-size: 14px; }

.drawer-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 22px;
}

.drawer-kpis div {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.drawer-kpis small { display: block; font: 500 10px/1.45 var(--f-mono); letter-spacing: 0.03em; text-transform: uppercase; color: rgba(255, 255, 255, 0.55); }
.drawer-kpis b { font: 500 22px/1.2 var(--f-display); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

.drawer-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.drawer-body h4 {
  margin: 0 0 12px;
  font: 500 11px/1.45 var(--f-mono);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--steel);
}

.act-list { display: flex; flex-direction: column; gap: 6px; }

.act {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 10px 12px;
  border: 1px solid var(--hair);
  border-radius: 12px;
  transition: border-color 0.2s, transform 0.35s var(--ease), background-color 0.2s;
}

.act:hover { border-color: #d3d9e5; transform: translateX(4px); background: var(--mist); }
.act.row-new { animation: rowIn 1.1s var(--ease); }
.act .ic-box { width: 34px; height: 34px; border-radius: 10px; }
.act .ic-box .ic { width: 16px; height: 16px; }
.act .meta { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.act .meta b { font-weight: 500; font-size: 14px; }
.act .meta span { font-size: 12.5px; color: var(--steel); }
.act .amt { font: 600 15px/1 var(--f-body); font-variant-numeric: tabular-nums; white-space: nowrap; }
.act .amt-none { font: 500 11px/1.3 var(--f-mono); letter-spacing: 0.03em; text-transform: uppercase; color: var(--steel); }

.no-amount { display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 12px 14px; border: 1px solid var(--hair); border-radius: 12px; background: var(--mist); font-size: 13.5px; line-height: 1.5; color: var(--charcoal); animation: noteIn 0.35s var(--ease); }
@keyframes noteIn { from { opacity: 0; transform: translateY(-4px); } }
.no-amount .ic { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--iris); }

/* ---------- Membres ---------- */
.members-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: stretch;
  margin-bottom: 16px;
}

.member-form {
  display: flex;
  gap: 10px;
  align-items: center;
}

.member-form .input { flex: 1; min-width: 0; }

.capacity {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
}

.ring { width: 56px; height: 56px; flex: none; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 6; }
.ring .bg { stroke: var(--hair-soft); }
.ring .fg { stroke: var(--iris); stroke-linecap: round; transition: stroke-dashoffset 1s var(--ease); }
.capacity b { display: block; font: 500 24px/1.1 var(--f-display); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.capacity span { font-size: 13px; color: var(--steel); }

.members {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
}

.member {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--hair);
  border-radius: var(--r-card);
  background: var(--paper);
  min-width: 0;
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease), border-color 0.3s;
}

.member:hover { transform: translateY(-3px); box-shadow: var(--sh-float); border-color: #d3d9e5; }
.member.row-new { animation: chipIn 0.6s var(--spring); }
.member .avatar { width: 40px; height: 40px; font-size: 14px; transition: transform 0.5s var(--spring); }
.member:hover .avatar { transform: rotate(-10deg) scale(1.08); }
.member .meta { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.member .meta b { font: 500 16px/1.3 var(--f-display); letter-spacing: -0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member .meta span { font-size: 12.5px; color: var(--steel); }
.member .tools { display: flex; gap: 2px; opacity: 0.55; transition: opacity 0.25s; }
.member:hover .tools, .member:focus-within .tools { opacity: 1; }

.icon-btn {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--steel);
  transition: background-color 0.2s, color 0.2s;
}

.icon-btn:hover { background: var(--mist); color: var(--ink); }
.icon-btn .ic { width: 16px; height: 16px; }

.rename { display: flex; gap: 6px; flex: 1; min-width: 0; }
.rename .input { height: 36px; font-size: 14px; }

/* ---------- Récap ---------- */
.recap-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.recap-bar p { margin: 0; color: var(--steel); font-size: 14px; }

.recap-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(24px, 4vw, 40px);
  border-radius: var(--r-hero);
  color: #fff;
  background:
    radial-gradient(60% 90% at 100% 100%, rgba(68, 164, 233, 0.5), transparent 60%),
    radial-gradient(50% 70% at 0% 0%, rgba(16, 70, 233, 0.35), transparent 60%),
    var(--void);
  box-shadow: var(--sh-dark);
  margin-bottom: 12px;
}

.recap-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: radial-gradient(80% 80% at 70% 60%, #000, transparent);
  mask-image: radial-gradient(80% 80% at 70% 60%, #000, transparent);
  pointer-events: none;
}

.recap-hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 32px;
  align-items: end;
}

.recap-hero .k {
  font: 500 11px/1.45 var(--f-mono);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}

.recap-big {
  margin: 10px 0 0;
  font: 500 clamp(44px, 8vw, 84px)/1 var(--f-display);
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
  background: linear-gradient(180deg, #fff 40%, #a9d4f7);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.recap-hero .meta { margin-top: 10px; color: rgba(255, 255, 255, 0.6); font-size: 14px; }

.channels { display: flex; flex-direction: column; gap: 14px; }

.channel { display: flex; flex-direction: column; gap: 8px; }
.channel-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.channel-top span { font: 500 12px/1.45 var(--f-mono); letter-spacing: 0.03em; text-transform: uppercase; color: rgba(255, 255, 255, 0.75); }
.channel-top b { font: 500 22px/1.2 var(--f-display); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

.meter {
  height: 8px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.meter i {
  display: block;
  height: 100%;
  width: var(--w, 0%);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sky), #fff);
  transition: width 1.2s var(--ease);
}

.meter.alt i { background: linear-gradient(90deg, var(--iris), var(--sky-2)); }

.equation {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 12px;
}

.equation .eq { flex: 1 1 150px; }
.equation + .equation { margin-top: -4px; }

.eq-title { display: flex; align-items: center; gap: 10px; margin: 18px 0 10px; font: 500 12px/1.4 var(--f-mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--steel); }
.eq-title:first-of-type { margin-top: 0; }

.eq {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--hair);
  border-radius: var(--r-card);
  background: var(--paper);
  min-width: 0;
  transform-style: preserve-3d;
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}

.eq:hover { box-shadow: var(--sh-lg); }
.eq .k { font: 500 11px/1.45 var(--f-mono); letter-spacing: 0.03em; text-transform: uppercase; color: var(--steel); }
.eq .v { font: 500 clamp(20px, 2.2vw, 26px)/1.1 var(--f-display); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.eq .s { font-size: 12.5px; color: var(--steel); line-height: 1.4; }
.eq.is-dirty { background: linear-gradient(180deg, #fff, #f3f7ff); }
.eq.is-cut .v { color: var(--bad); }
.eq.is-clean {
  border-color: #b9ecd8;
  background: linear-gradient(180deg, var(--mint), #fff);
}
.eq.is-clean .v { color: var(--good); }
.eq.is-loss .v { color: var(--bad); }

.op {
  display: grid;
  place-items: center;
  width: 28px;
  font: 500 20px/1 var(--f-display);
  color: var(--quiet);
}

.recap-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.repart {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}

.rep {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 12px 14px;
  border: 1px solid var(--hair);
  border-radius: 12px;
  background: var(--paper);
  overflow: hidden;
  min-width: 0;
  transform-style: preserve-3d;
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease), border-color 0.25s, opacity 0.3s;
}

.rep:hover { box-shadow: var(--sh-float); border-color: #cfd8ea; z-index: 1; }
.rep.zero { opacity: 0.5; }
.rep.zero:hover { opacity: 1; }
.rep .name { font-size: 12.5px; font-weight: 500; color: var(--charcoal); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rep .amt { font: 500 18px/1.15 var(--f-display); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.rep .qty { font: 400 11px/1.4 var(--f-mono); letter-spacing: 0.01em; color: var(--steel); }
.rep .bar {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: var(--w, 0%);
  background: linear-gradient(90deg, var(--sky), var(--iris));
  border-radius: 0 3px 3px 0;
  transition: width 1.2s var(--ease);
}
.rep.top { border-color: var(--frost-line); background: linear-gradient(180deg, #f5f8ff, #fff); }
.rep.top::before {
  content: "Top";
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 2px 6px;
  border-radius: var(--r-pill);
  background: var(--iris);
  color: #fff;
  font: 500 9px/1.4 var(--f-mono);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.side-stack { display: flex; flex-direction: column; gap: 12px; }

.kv { display: flex; flex-direction: column; gap: 2px; }
.kv-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--hair-soft);
  font-size: 14px;
}
.kv-row:last-child { border-bottom: 0; }
.kv-row span { color: var(--steel); display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.kv-row b { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

.big-line {
  font: 500 34px/1.1 var(--f-display);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
  margin-bottom: 8px;
}

.big-line.bad { color: var(--bad); }

.hint { margin: 10px 0 0; font-size: 12.5px; color: var(--steel); line-height: 1.5; }

/* ---------- Pied de page ---------- */
.footer {
  border-top: 1px solid var(--hair);
  padding-block: 40px;
  background: var(--paper);
}

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.footer p { margin: 0; color: var(--steel); font-size: 14px; max-width: 60ch; }
.footer-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Bandeau démo ---------- */
.demo-bar {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 18px);
  z-index: 55;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 8px 16px;
  border-radius: var(--r-pill);
  background: #fff7e6;
  border: 1px solid #f3d9a4;
  box-shadow: var(--sh-lg);
  font-size: 14px;
  color: #6b4a06;
  transform: translateX(-50%);
  animation: barIn 0.6s var(--spring);
  max-width: calc(100% - 32px);
}

.demo-bar b { font-weight: 600; }
.demo-bar .btn { flex: none; }

/* ---------- Toasts ---------- */
.toasts {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 80px);
  z-index: 70;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transform: translateX(-50%);
  pointer-events: none;
  width: max-content;
  max-width: calc(100% - 32px);
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 10px 12px;
  border-radius: var(--r-pill);
  background: var(--void);
  color: #fff;
  font-size: 14px;
  box-shadow: var(--sh-dark);
  animation: toastIn 0.5s var(--spring);
}

.toast .ic { width: 18px; height: 18px; color: #5be0a6; }
.toast.bad .ic { color: #ff8a8d; }
.toast.out { animation: toastOut 0.35s var(--ease) forwards; }

/* ---------- Écran code d'accès ---------- */
.lock {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(5, 6, 27, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: fadeIn 0.4s var(--ease);
}

.lock-card {
  width: min(420px, 100%);
  padding: 28px;
  border-radius: var(--r-hero);
  background: var(--paper);
  box-shadow: var(--sh-lg);
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: popIn 0.5s var(--spring);
}

.lock-card h3 { margin: 0; font: 500 24px/1.2 var(--f-display); letter-spacing: -0.02em; }
.lock-card p { margin: 0; color: var(--steel); font-size: 14px; }

/* ---------- Profil connecté ---------- */
.me-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  height: 36px;
  padding: 2px 4px 2px 2px;
  border-radius: var(--r-pill);
  border: 1px solid var(--hair);
  background: var(--paper);
}

.me-avatar { display: grid; place-items: center; flex: none; }
.me-avatar .avatar { width: 30px; height: 30px; font-size: 11px; }
.me-avatar.big .avatar { width: 52px; height: 52px; font-size: 18px; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.15); }
.avatar.has-img { background: var(--mist); overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: inherit; }

.me-txt { display: flex; flex-direction: column; min-width: 0; max-width: 140px; line-height: 1.15; padding-right: 2px; }
.me-txt b { font: 500 13px/1.2 var(--f-body); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-txt small { font: 500 9.5px/1.3 var(--f-mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--steel); white-space: nowrap; }
.me-chip .icon-btn { width: 30px; height: 30px; }

/* ---------- Écran de connexion ---------- */
html[data-gate] { overflow: hidden; }

.gate {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: calc(env(safe-area-inset-top, 0px) + 24px) 16px calc(env(safe-area-inset-bottom, 0px) + 24px);
  overflow-y: auto;
  color: #fff;
  background:
    radial-gradient(75% 50% at 50% 112%, rgba(255, 255, 255, 0.9) 0%, rgba(206, 232, 252, 0.7) 20%, rgba(128, 191, 239, 0.35) 40%, rgba(16, 149, 229, 0) 65%),
    radial-gradient(120% 65% at 50% 118%, #44a4e9 0%, #1095e5 20%, #1046e9 38%, #061db6 56%, rgba(6, 29, 182, 0) 78%),
    linear-gradient(180deg, var(--void) 0%, var(--cosmos) 45%, #0a0f45 78%, #0c2aa8 100%);
}

.gate-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 20px;
  max-width: 540px;
  animation: rise 0.9s var(--ease) backwards;
}

.gate-mark { width: 64px; height: 64px; border-radius: 18px; font-size: 30px; animation: float 5s ease-in-out infinite; }
.gate[data-state="denied"] .gate-mark { background: linear-gradient(145deg, #ff9a9c, var(--bad) 70%); }

.gate-title {
  margin: 0;
  font: 500 clamp(52px, 11vw, 96px)/1 var(--f-display);
  letter-spacing: -0.035em;
  background: linear-gradient(180deg, #fff 30%, #b9dcf8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.gate-text { margin: 0; max-width: 46ch; font-size: 17px; line-height: 1.7; color: rgba(255, 255, 255, 0.78); text-wrap: balance; }
.gate-text b { color: #fff; font-weight: 600; }
.gate-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.gate .btn .ic { width: 18px; height: 18px; }
.gate-note { margin: 0; font-size: 13px; line-height: 1.6; color: rgba(255, 255, 255, 0.5); max-width: 44ch; }
.gate-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; }
.gate-text code { padding: 4px 10px; border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 8px; background: rgba(255, 255, 255, 0.08); font: 500 13px/1.5 var(--f-mono); color: #fff; overflow-wrap: anywhere; user-select: all; }
.gate-redirect { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 18px; font-size: 14px; color: rgba(255, 255, 255, 0.65); }

/* ---------- Fenêtre « associer ma fiche » ---------- */
.modal {
  width: min(520px, calc(100% - 32px));
  max-height: calc(100% - 48px);
  padding: 0;
  border: 0;
  border-radius: var(--r-hero);
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--sh-lg);
  overflow: auto;
}

.modal[open] { animation: popIn 0.45s var(--spring); }
.modal::backdrop { background: rgba(5, 6, 27, 0.5); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }

.modal-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px;
  color: #fff;
  background: radial-gradient(90% 140% at 100% 0%, rgba(68, 164, 233, 0.45), transparent 60%), linear-gradient(180deg, var(--void), #0b1660);
}

.modal-head h3 { margin: 0; font: 500 22px/1.25 var(--f-display); letter-spacing: -0.015em; }
.modal-head p { margin: 6px 0 0; font-size: 14px; line-height: 1.6; color: rgba(255, 255, 255, 0.72); }
.modal-body { display: flex; flex-direction: column; gap: 12px; padding: 22px 24px 12px; }
.modal-body h4 { margin: 0; font: 500 11px/1.45 var(--f-mono); letter-spacing: 0.03em; text-transform: uppercase; color: var(--steel); }
.modal-foot { display: flex; justify-content: flex-end; padding: 8px 24px 22px; }

.link-list { display: flex; flex-direction: column; gap: 6px; max-height: 240px; overflow-y: auto; }

.link-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--hair);
  border-radius: 12px;
  background: var(--paper);
  text-align: left;
  font-size: 15px;
  transition: border-color 0.2s, background-color 0.2s, transform 0.3s var(--ease);
}

.link-opt:hover { border-color: var(--iris); background: #f5f8ff; transform: translateX(4px); }
.link-opt .avatar { width: 32px; height: 32px; font-size: 12px; }
.link-opt .name { flex: 1; min-width: 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.or { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--quiet); }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--hair); }
.link-create { display: flex; flex-direction: column; gap: 8px; }
.link-create-row { display: flex; gap: 8px; }
.link-create-row .input { flex: 1; min-width: 0; }

/* ---------- Bandeau d'information ---------- */
.notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid var(--frost-line);
  border-radius: var(--r-card);
  background: linear-gradient(90deg, #f3f7ff, var(--paper));
}

.notice p { flex: 1 1 260px; margin: 0; font-size: 14px; line-height: 1.6; color: var(--charcoal); }
.notice b { font-weight: 600; color: var(--ink); }

/* ---------- Grades et membres ---------- */
.member-form .select { flex: 0 0 170px; }
.member-note { display: flex; align-items: center; gap: 14px; padding: 16px 20px; }
.member-note p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--steel); }

.grade {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 8px;
  border-radius: var(--r-pill);
  background: var(--frost);
  color: var(--iris);
  font: 500 10px/1 var(--f-mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.grade.is-top { background: var(--ink); color: #fff; }
.grade-line { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 3px; }

.hierarchy { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }

.hier {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 5px 0 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--hair);
  background: var(--paper);
  font: 500 11.5px/1 var(--f-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--charcoal);
  transition: transform 0.35s var(--ease), border-color 0.2s, box-shadow 0.35s var(--ease);
}

.hier:hover { transform: translateY(-2px); border-color: #cfd8ea; box-shadow: var(--sh-float); }
.hier .lvl { color: var(--quiet); }
.hier b { min-width: 24px; height: 24px; padding: 0 7px; border-radius: var(--r-pill); display: grid; place-items: center; background: var(--mist); font: 600 11px/1 var(--f-body); letter-spacing: 0; color: var(--ink); }
.hier.is-top b { background: var(--ink); color: #fff; }
.hier .ic { width: 13px; height: 13px; color: var(--iris); }

.member.editing { align-items: flex-start; }
.member-edit { display: flex; flex-direction: column; gap: 10px; flex: 1; min-width: 0; }
.member-edit .input, .member-edit .select { height: 38px; font-size: 14px; }
.member-edit .row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.discord-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--steel); }
.discord-tag .ic { width: 14px; height: 14px; color: var(--iris); }
.link-btn-dark { background: none; border: 0; padding: 0; font: 500 12.5px/1.4 var(--f-body); color: var(--bad); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Paramètres ---------- */
.settings {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.set-tabs {
  position: sticky;
  top: 96px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  border: 1px solid var(--hair);
  border-radius: var(--r-card);
  background: var(--paper);
}

.set-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  text-align: left;
  font: 500 14px/1.3 var(--f-body);
  color: var(--steel);
  transition: background-color 0.2s, color 0.2s, transform 0.3s var(--ease);
}

.set-tab .ic { width: 18px; height: 18px; }
.set-tab:hover { background: var(--mist); color: var(--ink); transform: translateX(3px); }
.set-tab[aria-selected="true"] { background: var(--ink); color: #fff; transform: none; }

.set-panel { display: flex; flex-direction: column; gap: 22px; padding: 28px; }
.set-panel > * { animation: revealIn 0.5s var(--ease) backwards; }
.set-head h3 { margin: 0 0 6px; font: 500 24px/1.25 var(--f-display); letter-spacing: -0.02em; }
.set-head p { margin: 0; max-width: 70ch; font-size: 15px; line-height: 1.65; color: var(--steel); }
.set-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.help { margin: 0; font-size: 13px; line-height: 1.55; color: var(--steel); }
.help b { color: var(--ink); font-weight: 600; }

.input-pct { position: relative; }
.input-pct .input { padding-right: 34px; }
.input-pct::after { content: "%"; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--quiet); font: 500 14px/1 var(--f-mono); pointer-events: none; }

.switches { display: flex; flex-direction: column; gap: 10px; }

.switch {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--hair);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}

.switch:hover { border-color: #cfd8ea; background: var(--mist); }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-ui { position: relative; flex: none; width: 40px; height: 24px; margin-top: 1px; border-radius: var(--r-pill); background: #d3d8e2; transition: background-color 0.25s; }
.switch-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.4s var(--spring); }
.switch input:checked + .switch-ui { background: var(--iris); }
.switch input:checked + .switch-ui::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-ui { outline: 2px solid var(--cyan); outline-offset: 2px; }
.switch-txt { display: flex; flex-direction: column; gap: 3px; }
.switch-txt b { font-size: 15px; font-weight: 500; }
.switch-txt small { font-size: 13px; line-height: 1.55; color: var(--steel); }
.switch.mini { padding: 0; border: 0; align-items: center; gap: 8px; background: none; font-size: 13px; white-space: nowrap; }
.switch.mini .switch-ui { margin-top: 0; }

.set-list { display: flex; flex-direction: column; gap: 8px; }

.set-row {
  display: grid;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--hair);
  border-radius: 12px;
  background: var(--paper);
  transition: border-color 0.2s, box-shadow 0.3s var(--ease);
}

.set-row:hover { border-color: #d3d9e5; box-shadow: var(--sh-float); }
.set-row.is-new { animation: rowIn 1.1s var(--ease); }
.set-row .input { height: 38px; font-size: 14px; }
.mono { font-family: var(--f-mono) !important; font-size: 13px !important; }

.grade-row {
  grid-template-areas: "rank name role check tools";
  grid-template-columns: 30px minmax(0, 1fr) minmax(0, 200px) auto auto;
}

.grade-row .rank { grid-area: rank; }
.grade-row .g-name { grid-area: name; }
.grade-row .g-role { grid-area: role; }
.grade-row .g-check { grid-area: check; }
.grade-row .row-tools { grid-area: tools; }

.rank { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--mist); font: 600 12px/1 var(--f-mono); color: var(--steel); }
.grade-row.is-top .rank { background: var(--ink); color: #fff; }

.check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--charcoal); white-space: nowrap; cursor: pointer; padding: 0 4px; }
.check input { width: 16px; height: 16px; accent-color: var(--iris); }
.row-tools { display: flex; align-items: center; gap: 2px; }
.row-tools .icon-btn[disabled] { opacity: 0.3; cursor: not-allowed; }
.row-tools .icon-btn.danger:hover { background: var(--bad-soft); color: var(--bad); }

.simple-row { grid-template-columns: minmax(0, 1fr) auto; }
.price-row { grid-template-columns: minmax(0, 1fr) minmax(0, 160px) auto; }
.heist-row,
.action-row { grid-template-columns: minmax(0, 1fr) auto auto; }

/* Nombre de membres : un interrupteur et un maximum par partie */
.limit-all { display: flex; flex-wrap: wrap; gap: 8px; }
.limit-row { grid-template-columns: minmax(0, 1fr) 132px 84px; padding: 8px 8px 8px 10px; }
.limit-row.is-group { grid-template-columns: minmax(0, 1fr); }
.limit-name { display: flex; align-items: center; gap: 12px; min-width: 0; }
.limit-name > span:last-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.limit-name b { font-size: 15px; font-weight: 500; overflow-wrap: anywhere; }
.limit-name small { font-size: 12.5px; line-height: 1.45; color: var(--steel); }
.limit-name .ic-box { width: 34px; height: 34px; border-radius: 10px; flex: none; }
.limit-name .ic-box .ic { width: 16px; height: 16px; }
.limit-row .limit-max { text-align: center; font-family: var(--f-mono); transition: opacity 0.2s, background-color 0.2s; }
.limit-row .limit-max:disabled { opacity: 0.45; background: var(--mist); cursor: not-allowed; }
.limit-state { min-width: 74px; color: var(--charcoal); transition: color 0.2s; }
.limit-row.is-off .limit-state { color: var(--steel); }
.limit-row.is-group { background: var(--mist); }
.limit-row.is-group .ic-box { opacity: 0.7; }

.set-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.set-tools .search { max-width: 320px; }

.set-table-wrap { position: relative; overflow: auto; max-height: 540px; border: 1px solid var(--hair); border-radius: 12px; }
.set-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.set-table th { position: sticky; top: 0; z-index: 1; padding: 10px; background: var(--mist); border-bottom: 1px solid var(--hair); text-align: left; font: 500 11px/1.45 var(--f-mono); letter-spacing: 0.03em; text-transform: uppercase; color: var(--steel); white-space: nowrap; }
.set-table td { padding: 6px 8px; border-bottom: 1px solid var(--hair-soft); }
.set-table tr:last-child td { border-bottom: 0; }
.set-table tbody tr { transition: background-color 0.2s; }
.set-table tbody tr:hover { background: #fafbfe; }
.set-table .input { height: 36px; min-width: 110px; font-size: 14px; }
.set-table td.w-name .input { min-width: 180px; }
.set-table td.w-tool { width: 1%; }

.set-add {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border: 1px dashed #c6cedd;
  border-radius: 12px;
  background: repeating-linear-gradient(135deg, transparent 0 10px, rgba(225, 236, 255, 0.35) 10px 11px);
}

.set-add .input { flex: 1 1 160px; height: 40px; }
.set-add .input-money { flex: 1 1 130px; }
.set-add .btn { flex: none; }
.set-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.set-sub { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font: 500 17px/1.3 var(--f-display); letter-spacing: -0.01em; }
.set-sub .ic-box { width: 32px; height: 32px; border-radius: 9px; }
.set-sub .ic-box .ic { width: 16px; height: 16px; }

.info-list { display: grid; gap: 8px; }
.info-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; padding: 12px 14px; border: 1px solid var(--hair); border-radius: 12px; font-size: 14px; }
.info-row > span { color: var(--steel); }
.info-row > b { font-weight: 500; text-align: right; overflow-wrap: anywhere; }
.info-row code { font: 500 12.5px/1.4 var(--f-mono); background: var(--mist); border: 1px solid var(--hair); border-radius: 6px; padding: 2px 6px; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: var(--r-pill); font: 500 12px/1 var(--f-body); background: var(--mint); color: var(--good); }
.status-pill.warn { background: #fff4dc; color: #8a5a00; }

.save-bar {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 18px);
  z-index: 57;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100% - 32px);
  padding: 8px 8px 8px 18px;
  border-radius: var(--r-pill);
  background: var(--void);
  color: #fff;
  font-size: 14px;
  box-shadow: var(--sh-dark);
  transform: translateX(-50%);
  animation: barIn 0.6s var(--spring);
}

.save-bar .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, 0.3); }
.save-bar .btn-ghost:hover { background: #fff; color: var(--ink); }

@media (max-width: 1280px) {
  .me-txt { display: none; }
}

@media (max-width: 900px) {
  .settings { grid-template-columns: minmax(0, 1fr); }
  .set-tabs { position: relative; top: 0; flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  .set-tabs::-webkit-scrollbar { display: none; }
  .set-tab { flex: none; white-space: nowrap; }
  .set-tab:hover { transform: none; }
  .set-cols { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .set-panel { padding: 18px; }
  .grade-row { grid-template-areas: "rank name tools" ". role role" ". check check"; grid-template-columns: 30px minmax(0, 1fr) auto; }
  .price-row { grid-template-columns: minmax(0, 1fr) auto; }
  .price-row .input-money { grid-column: 1; }
  .heist-row,
  .action-row { grid-template-columns: minmax(0, 1fr) auto; }
  .limit-row { grid-template-columns: minmax(0, 1fr) 76px; }
  .limit-row .switch.mini { grid-column: 1; grid-row: 2; padding-left: 46px; }
  .limit-row .limit-max { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .member-form { flex-wrap: wrap; }
  .member-form .input { flex: 1 1 100%; }
  .member-form .select { flex: 1 1 140px; }
  .demo-bar { gap: 8px; padding: 6px 6px 6px 14px; font-size: 13px; white-space: nowrap; }
  .demo-bar .rest { display: none; }
  .save-bar span { display: none; }
  .gate-text { font-size: 16px; }
}

/* ---------- Note de mode (aperçu sans connexion, archive) ---------- */
.mode-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 560px;
  margin: 0;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  line-height: 1.5;
  text-wrap: balance;
  animation: rise 0.9s 0.9s var(--ease) backwards;
}

.mode-note .ic { width: 16px; height: 16px; color: var(--sky); flex: none; }
.mode-note.is-archive { background: rgba(128, 191, 239, 0.16); border-color: rgba(128, 191, 239, 0.45); color: #fff; }

/* ---------- Argent sale / propre ---------- */
.badge--sale { background: #fff4dc; color: #8a5a00; }
.badge--propre { background: var(--mint); color: var(--good); }
.money-seg input[value="propre"]:checked + span { color: #fff; }
.money-tag { display: inline-flex; margin-top: 6px; }

/* ---------- Paye ---------- */
.pay-rules { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }

.rule {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: var(--r-pill);
  border: 1px solid var(--hair);
  background: var(--paper);
  font-size: 13px;
  color: var(--charcoal);
}

.rule .ic { width: 15px; height: 15px; color: var(--iris); }
.rule > span { line-height: 1.45; }
.rule b { font-weight: 600; color: var(--ink); }

.pay-list { display: flex; flex-direction: column; gap: 8px; }

.pay-card {
  border: 1px solid var(--hair);
  border-radius: var(--r-card);
  background: var(--paper);
  overflow: hidden;
  transition: border-color 0.25s, box-shadow 0.4s var(--ease), transform 0.4s var(--ease);
}

.pay-card:hover { border-color: #d3d9e5; box-shadow: var(--sh-float); }
.pay-card[open] { border-color: var(--frost-line); box-shadow: var(--sh-lg); }

.pay-card summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1.2fr) minmax(0, 2.4fr) auto auto;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  cursor: pointer;
  list-style: none;
}

.pay-card summary::-webkit-details-marker { display: none; }
.pay-card summary:focus-visible { outline: 2px solid var(--cyan); outline-offset: -2px; }
.pay-card .avatar { width: 40px; height: 40px; font-size: 14px; }
.pay-who { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.pay-who b { font: 500 16px/1.3 var(--f-display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pay-parts { display: flex; flex-wrap: wrap; gap: 6px; }

.pay-part {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: var(--mist);
  border: 1px solid var(--hair);
  font-size: 12.5px;
  color: var(--steel);
  white-space: nowrap;
}

.pay-part b { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.pay-part.zero { opacity: 0.45; }

.pay-total {
  font: 500 24px/1.1 var(--f-display);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-align: right;
}

.pay-total small { display: block; font: 500 10px/1.45 var(--f-mono); letter-spacing: 0.03em; text-transform: uppercase; color: var(--steel); }

.pay-chev { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--mist); color: var(--steel); transition: transform 0.4s var(--spring), background-color 0.2s; }
.pay-chev .ic { width: 14px; height: 14px; }
.pay-card[open] .pay-chev { transform: rotate(180deg); background: var(--frost); color: var(--iris); }

.pay-detail { border-top: 1px solid var(--hair-soft); padding: 6px 18px 14px; animation: revealIn 0.45s var(--ease) backwards; }

.pay-line {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--hair-soft);
  font-size: 14px;
}

.pay-line:last-child { border-bottom: 0; }
.pay-line .when { color: var(--steel); font-size: 12.5px; white-space: nowrap; }
.pay-line .what { min-width: 0; }
.pay-line .what small { display: block; color: var(--steel); font-size: 12.5px; }
.pay-line .amt { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pay-line .what small .badge { margin-left: 4px; vertical-align: 1px; }

/* ---------- Paramètres : identifiants, archives, zone dangereuse ---------- */
.ids-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ids-field .input { font-family: var(--f-mono); font-size: 13px; }
.ids-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.id-chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px 0 3px; border-radius: var(--r-pill); background: var(--mist); border: 1px solid var(--hair); font-size: 12px; }
.id-chip .avatar { width: 18px; height: 18px; font-size: 8px; }
.id-chip.unknown { padding-left: 8px; color: var(--steel); font-family: var(--f-mono); }

.grade-row .g-ids { grid-column: 2 / -1; }
.lock-note { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: #fff7e6; border: 1px solid #f3d9a4; color: #6b4a06; font-size: 14px; line-height: 1.5; }
.lock-note .ic { width: 18px; height: 18px; flex: none; }

.archive-list { display: flex; flex-direction: column; gap: 8px; }
.archive-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 12px 14px; border: 1px solid var(--hair); border-radius: 12px; transition: border-color 0.2s, box-shadow 0.3s var(--ease); }
.archive-row:hover { border-color: #d3d9e5; box-shadow: var(--sh-float); }
.archive-row b { font-weight: 600; }
.archive-row small { display: block; color: var(--steel); font-size: 12.5px; }
.archive-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.arch-del:hover { color: var(--bad); }
.arch-del.armed { background: var(--bad); border-color: var(--bad); color: #fff; }

.danger-zone { display: flex; flex-direction: column; gap: 12px; padding: 18px; border: 1px solid #f2c4c6; border-radius: 14px; background: linear-gradient(180deg, var(--bad-soft), var(--paper)); }
.danger-zone h4 { margin: 0; display: flex; align-items: center; gap: 8px; font: 500 17px/1.3 var(--f-display); color: var(--bad); }
.danger-zone h4 .ic { width: 18px; height: 18px; }
.danger-zone p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--charcoal); }
.danger-row { display: flex; flex-wrap: wrap; gap: 8px; }
.danger-row .input { flex: 1 1 200px; font-family: var(--f-mono); letter-spacing: 0.05em; }

.btn-danger { background: var(--bad); color: #fff; box-shadow: 0 10px 24px -12px rgba(212, 55, 60, 0.8); }
.btn-danger:hover { background: #bf2c31; }

.pay-mode { min-width: 0; }
.pay-row { grid-template-columns: minmax(0, 1fr) minmax(0, 130px) minmax(0, 280px); }
.pct-row { grid-template-columns: minmax(0, 1fr) minmax(0, 140px); }

@media (max-width: 900px) {
  .pay-card summary { grid-template-columns: auto minmax(0, 1fr) auto auto; }
  .pay-card .pay-parts { grid-column: 1 / -1; grid-row: 2; }
}

@media (max-width: 640px) {
  .pay-card summary { gap: 10px 12px; padding: 12px 14px; }
  .pay-total { font-size: 20px; }
  .pay-line { grid-template-columns: minmax(0, 1fr) auto; }
  .pay-line .when { grid-column: 1 / -1; }
  .pay-row { grid-template-columns: minmax(0, 1fr) minmax(0, 120px); }
  .pay-row .pay-mode { grid-column: 1 / -1; }
}

/* ---------- Effets de survol ---------- */
.tilt.is-tilting { transition: transform 0.15s linear, box-shadow 0.5s var(--ease), border-color 0.3s !important; }
.del-txt:empty { display: none; }

/* ---------- Lecture seule ---------- */
[data-ro] .form-card,
[data-ro] .member-form,
[data-ro] .del,
[data-ro] #actForm,
[data-ro] .member .tools,
[data-ro] .footer-actions,
[data-ro] .hero-ctas .btn-primary { display: none !important; }
[data-ro] .split { grid-template-columns: minmax(0, 1fr); }
[data-ro] .members-top { grid-template-columns: minmax(0, 1fr); }

/* ---------- Animations ---------- */
@keyframes navIn { from { opacity: 0; transform: translateY(-16px) scale(0.98); } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); filter: blur(6px); } }
@keyframes charIn { from { opacity: 0; transform: translateY(0.45em) rotate(6deg); filter: blur(10px); } }
@keyframes windowIn { from { opacity: 0; transform: rotateX(28deg) translateY(60px) scale(0.92); } }
@keyframes revealIn { from { opacity: 0; transform: translateY(36px) scale(0.985); filter: blur(8px); } }
@keyframes wordIn { from { opacity: 0; transform: translateY(0.6em); filter: blur(6px); } }
@keyframes termIn { from { opacity: 0; transform: translateX(-14px); background: rgba(128, 191, 239, 0.18); } 40% { background: rgba(128, 191, 239, 0.12); } }
@keyframes rowIn { 0% { opacity: 0; transform: translateY(-8px); background: var(--frost); } 30% { opacity: 1; transform: none; background: var(--frost); } 100% { background: transparent; } }
@keyframes chipIn { from { opacity: 0; transform: scale(0.6); } }
@keyframes popIn { from { opacity: 0; transform: translateY(-6px) scale(0.97); } }
@keyframes pop { 0% { transform: scale(0.6); } 100% { transform: scale(1); } }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes wiggle { 30% { transform: rotate(-10deg) scale(1.08); } 60% { transform: rotate(6deg) scale(1.04); } }
@keyframes float { 50% { transform: translateY(-6px); } }
@keyframes grow { from { transform: scaleX(0); } }
@keyframes ping { 0% { transform: scale(0.6); opacity: 0.9; } 100% { transform: scale(1.6); opacity: 0; } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes sheen { 0% { transform: translateX(-110%); } 30%, 100% { transform: translateX(110%); } }
@keyframes drawerIn { from { transform: translateX(100%); } }
@keyframes drawerOut { to { transform: translateX(100%); } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(0.9); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px) scale(0.95); } }
@keyframes barIn { from { opacity: 0; transform: translate(-50%, 24px); } }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .brand-name { display: none; }
  .brand { padding-right: 4px; }
  .equation .op { display: none; }
  .equation .eq { flex-basis: calc(33.333% - 6px); }
  .equation .eq:last-child { flex-basis: 100%; }
  .recap-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 1180px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .split > .form-card { position: relative; top: 0; }
}

@media (max-width: 900px) {
  .tiles-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiles-5 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .tiles-5 > * { grid-column: span 2; }
  .tiles-5 > :nth-child(4), .tiles-5 > :nth-child(5) { grid-column: span 3; }
  .recap-hero-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .sync span { display: none; }
  .sync { padding: 0 11px; }
}

@media (max-width: 640px) {
  html { scroll-padding-top: 84px; }
  .nav-links {
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent);
    mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent);
  }
  .hero { padding-top: calc(env(safe-area-inset-top, 0px) + 112px); }
  .hero-stats { grid-template-columns: minmax(0, 1fr); }
  .hero-stat + .hero-stat { border-left: 0; border-top: 1px solid rgba(255, 255, 255, 0.12); }
  .hero-stat { flex-direction: row; justify-content: space-between; padding: 14px 4px; text-align: left; }
  .hero-stat .ic-box { display: none; }
  .hero-stat span { order: -1; }
  .hero-stage { margin-top: 36px; padding-bottom: 48px; }
  .terminal { padding: 16px; font-size: 11.5px; min-height: 260px; }
  .term-line .tag { min-width: 52px; }
  .window-bar .title { margin-right: 0; }
  .tiles-3 { grid-template-columns: minmax(0, 1fr); }
  .tiles-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tiles-5 > *, .tiles-5 > :nth-child(4) { grid-column: span 1; }
  .tiles-5 > :nth-child(5) { grid-column: 1 / -1; }
  .choices-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field-row { grid-template-columns: minmax(0, 1fr); }
  .members-top { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 18px; }
  .equation .eq { flex-basis: calc(50% - 4px); padding: 14px; gap: 8px; }
  .tiles-auto { grid-template-columns: repeat(2, minmax(0, 1fr)); }

}

@media (max-width: 780px) {
  /* Tableaux en cartes */
  .table thead { display: none; }
  .table, .table tbody, .table tfoot, .table tr, .table td { display: block; width: 100%; }
  .table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 12px;
    padding: 12px 4px;
    border-bottom: 1px solid var(--hair-soft);
  }
  .table td { padding: 0; border: 0; text-align: left !important; }
  .table td[data-l]::before {
    content: attr(data-l);
    display: block;
    font: 500 10px/1.45 var(--f-mono);
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--quiet);
  }
  .table td.full { grid-column: 1 / -1; }
  .table td.act-cell { grid-column: 2; grid-row: 1; justify-self: end; }
  .table tfoot tr { display: flex; justify-content: space-between; padding-top: 6px; }
  .table tfoot td { width: auto; padding: 8px 4px 0; }
  .table tfoot td:empty { display: none; }
}

@media (max-width: 420px) {
  .nav-links a { padding: 8px 9px; font-size: 13px; }
  .choices { grid-template-columns: minmax(0, 1fr); }
  .choices.compact, .choices-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

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