/* Road Runner Solutions — design premium modernisé
   Base institutionnelle (bleu profond, accent rose, bandeau tricolore)
   sublimée : palette slate moderne, typographies Inter / Outfit,
   élévolutions douces multicouches, focus rings précis. */

/* Sommaire
   Bandeau tricolore + utilitaires · En-tête · Boutons · Hero
   Aperçu produit personnalisé · Accès rapides · Bandeau de confiance
   Démo vocale Aminia · Sections · Tarifs · Bandeau CTA · Pied de page
   Authentification · Application · Cartes / grilles · Tableaux
   Formulaires · Badges · Animations · Agent flottant · Responsive */

:root {
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --card: #ffffff;
  --thead-bg: #f8fafc;
  --blue: #004192;
  --blue-2: #2563eb;
  --blue-soft: #dbeafe;
  --blue-pale: #f2f6fc;
  --pink: #ca1c60;
  --pink-soft: #fde8f0;
  --red: #dc2626;
  --red-soft: #fef2f2;
  --green: #15803d;
  --green-soft: #ecfdf3;
  --amber: #a16207;
  --amber-soft: #fefce8;
  --line: #e6eaf1;
  --line-2: #cbd5e1;
  --radius: 14px;
  --radius-sm: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 12px 32px -18px rgba(15, 23, 42, .18);
  --shadow-lg: 0 28px 68px -32px rgba(15, 23, 42, .28);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-head: "Outfit", "Inter", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);

  /* Échelle d'espacement */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;

  /* Typo */
  --text-xs: 12px;
  --text-sm: 13px;
  --text-md: 14px;
  --text-base: 16px;
  --text-lg: 18px;
  --text-xl: 22px;
  --text-2xl: 28px;
  --tap: 44px;

  /* Chrome mobile */
  --m-header-h: 56px;
  --m-footer-h: 82px;
  --m-action-h: 56px;      /* summary / bouton Nouveau fixe */
  --m-action-bar-h: 84px;  /* barre multi-boutons (cockpit) */
  --m-fab-h: 58px;         /* hauteur approx. pilule Aminia */
  --m-fab-gap: 12px;       /* air entre FAB et barre d'actions */

  /* Échelle z-index */
  --z-base: 1;
  --z-sticky: 20;
  --z-m-footer: 40;
  --z-page-actions: 45;
  --z-fab: 50;
  --z-m-header: 60;
  --z-m-backdrop: 70;
  --z-m-drawer: 80;
  --z-agent-panel: 90;
  --z-agent-modal: 100;
  --z-nav-public: 50;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-2); text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; height: auto; }
/* Logos produit : jamais la taille intrinsèque du PNG source (838×562). */
.product-logo,
img.product-logo {
  width: auto;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  background: #fff;
  border-radius: 7px;
}
.product-logo--sm { width: 32px; height: 32px; max-width: 32px; }
.product-logo--md { width: 38px; height: 38px; max-width: 38px; }
.product-logo--lg { width: auto; height: 58px; max-width: 190px; border-radius: 0; background: transparent; }
:focus-visible { outline: 2px solid var(--blue-2); outline-offset: 3px; border-radius: 3px; }
::selection { background: var(--blue-soft); color: var(--ink); }
/* Barres de défilement discrètes (WebKit & Firefox) */
* { scrollbar-width: thin; scrollbar-color: var(--scrollbar-thumb, #cbd5e1) transparent; }
html[data-theme="dark"] { scrollbar-color: var(--scrollbar-thumb) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb, #cbd5e1); border-radius: 999px; border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background-color: #94a3b8; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background-color: rgba(255, 255, 255, 0.3); }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ---------- Bandeau tricolore + utilitaires ---------- */
.tricolore { display: grid; grid-template-columns: 1fr 1fr 1fr; height: 3px; }
.tricolore span:nth-child(1) { background: var(--blue); }
.tricolore span:nth-child(2) { background: #fff; }
.tricolore span:nth-child(3) { background: var(--pink); }

/* ---------- En-tête ---------- */
.nav {
  position: sticky; top: 0; z-index: var(--z-nav-public);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .25s var(--ease);
}
.nav.is-scrolled { box-shadow: 0 10px 30px -24px rgba(0, 65, 146, .55); }
.nav-in { display: flex; align-items: center; justify-content: space-between; gap: 28px; height: 84px; }
.logo { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); }
.logo:hover { text-decoration: none; color: var(--ink); }
.logo img { width: auto; height: 58px; max-width: 190px; display: block; object-fit: contain; }
.logo-text { display: flex; flex-direction: column; line-height: 1.12; }
.logo-text small { font-size: 11.5px; color: var(--muted); letter-spacing: .4px; text-transform: uppercase; font-weight: 500; }

.nav-search {
  flex: 1; max-width: 420px; display: flex; align-items: center;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: #fff; overflow: hidden; transition: border-color .2s, box-shadow .2s;
}
.nav-search:focus-within { border-color: var(--blue-2); box-shadow: 0 0 0 3px rgba(37, 99, 235,.15); }
.nav-search input { flex: 1; border: none; padding: 10px 13px; font-size: 14px; background: transparent; }
.nav-search input:focus { outline: none; box-shadow: none; }
.nav-search button {
  border: none; background: var(--blue); color: #fff; cursor: pointer;
  padding: 0 14px; height: 42px; display: grid; place-items: center;
  transition: background .2s;
}
.nav-search button:hover { background: var(--blue-2); }
.nav-search button svg { width: 18px; height: 18px; }

.nav-links { display: flex; align-items: center; gap: 10px; }
.nav-links a:not(.btn) { color: var(--ink-2); font-size: 14px; font-weight: 500; padding: 8px 10px; border-radius: 4px; }
.nav-links a:not(.btn):hover { color: var(--blue); background: var(--blue-pale); text-decoration: none; }

.mainnav { border-top: 1px solid var(--line); background: #fff; }
.mainnav-in { display: flex; align-items: center; gap: 6px; min-height: 50px; overflow-x: auto; }
.mainnav a {
  position: relative; display: inline-flex; align-items: center; gap: 7px;
  padding: 14px 14px; font-size: 14px; font-weight: 500; color: var(--ink-2);
  white-space: nowrap; border-bottom: 3px solid transparent;
}
.mainnav a:hover { color: var(--blue); background: var(--blue-pale); text-decoration: none; }
.mainnav a.is-active { color: var(--blue); border-bottom-color: var(--pink); font-weight: 700; }
.mainnav .mainnav-cta { margin-left: auto; color: var(--pink); font-weight: 700; }
.mainnav .mainnav-cta:hover { color: var(--pink); background: var(--pink-soft); }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 12px; cursor: pointer;
  padding: 12px 18px; min-height: 44px; font-family: inherit; font-size: 15px; font-weight: 650;
  line-height: 1.2; text-decoration: none; letter-spacing: -0.01em;
  transition: background .2s, border-color .2s, color .2s, transform .15s var(--ease), box-shadow .2s;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 1px 2px rgba(0, 65, 146, .18); }
.btn-primary:hover { background: #003572; color: #fff; transform: translateY(-1px); box-shadow: 0 10px 22px -12px rgba(0, 65, 146, .85); }
.btn-primary:active { transform: scale(.98); }
.btn-accent { background: var(--pink); color: #fff; }
.btn-accent:hover { background: #a91650; color: #fff; transform: translateY(-1px); }
.btn-ghost { background: rgba(0, 65, 146, .06); color: var(--blue); border-color: transparent; }
.btn-ghost:hover { background: var(--blue-pale); color: var(--blue); }
.btn-danger { background: #fff; color: var(--red); border-color: transparent; box-shadow: inset 0 0 0 1px var(--red); }
.btn-danger:hover { background: var(--red-soft); color: var(--red); }
.btn-sm { padding: 8px 14px; min-height: 36px; font-size: 13px; border-radius: 10px; }
.btn-lg { padding: 14px 22px; min-height: 52px; font-size: 16px; border-radius: 14px; }
.btn.is-locked { opacity: .55; }
.btn svg { width: 17px; height: 17px; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  padding: 56px 0 64px;
  background:
    radial-gradient(720px 320px at 92% 8%, rgba(202, 28, 96, .07), transparent 60%),
    radial-gradient(820px 380px at 4% 0%, rgba(37, 99, 235,.09), transparent 62%),
    linear-gradient(180deg, var(--blue-pale) 0%, #fff 100%);
  border-bottom: 1px solid var(--line);
}
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.02fr .98fr; gap: 56px; align-items: center; }
.hero .pill { animation: fadeUp .5s var(--ease) both; }
.hero h1 { animation: fadeUp .55s .05s var(--ease) both; }
.hero .lead { animation: fadeUp .55s .1s var(--ease) both; }
.hero-cta { animation: fadeUp .55s .15s var(--ease) both; }
.siren-box { animation: fadeUp .55s .2s var(--ease) both; }
.hero .micro { animation: fadeUp .55s .25s var(--ease) both; }
.hero .mock { animation: fadeIn .65s .15s var(--ease) both; }
.pill {
  display: inline-flex; align-items: center; gap: 9px;
  background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--pink);
  color: var(--blue); padding: 7px 12px; border-radius: 3px;
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  box-shadow: var(--shadow-sm);
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: pulse 2.4s infinite; }
h1 {
  font-family: var(--font-head);
  font-size: 52px; line-height: 1.04; letter-spacing: -.8px;
  margin: 20px 0 16px; font-weight: 700; color: var(--ink);
}
h1 .accent { color: var(--blue); }
h1 .underlined { position: relative; white-space: nowrap; }
h1 .underlined::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 4px; height: 8px;
  background: var(--pink-soft); z-index: -1;
}
.lead { font-size: 17.5px; line-height: 1.7; color: var(--ink-2); max-width: 560px; margin: 0 0 26px; }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.siren-box {
  display: flex; gap: 8px; background: #fff; border: 1px solid var(--line-2);
  border-radius: var(--radius); padding: 6px; max-width: 470px; margin-top: 24px;
  box-shadow: var(--shadow-sm); transition: border-color .2s, box-shadow .2s;
}
.siren-box:focus-within { border-color: var(--blue-2); box-shadow: 0 0 0 3px rgba(37, 99, 235,.14); }
.siren-box input { flex: 1; border: none; padding: 9px 12px; font-size: 15px; background: transparent; }
.siren-box input:focus { outline: none; box-shadow: none; }
.hero-siren { margin-top: 18px; }
.hero-siren-label {
  margin: 0 0 7px; font-size: 11.5px; font-weight: 700; letter-spacing: .45px;
  text-transform: uppercase; color: var(--muted);
}
.hero-siren .siren-box { margin-top: 0; }
.siren-help { font-size: 12px; color: var(--muted); margin: 8px 0 0; max-width: 470px; }
.siren-result { max-width: 520px; margin-top: 12px; }
.siren-result[hidden] { display: none; }
.siren-card {
  display: grid; grid-template-columns: 1fr auto; gap: 12px 16px; align-items: center;
  background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--blue);
  border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow-sm);
  animation: fadeUp .35s var(--ease) both;
}
.siren-card .siren-kicker {
  display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--blue);
}
.siren-card strong { display: block; font-family: var(--font-head); font-size: 18px; line-height: 1.25; }
.siren-card .siren-meta { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.5; margin-top: 2px; }
.siren-card .btn { white-space: nowrap; }
.siren-result .siren-error,
.siren-result .siren-loading {
  margin: 0; padding: 10px 12px; border-radius: var(--radius); font-size: 13.5px;
}
.siren-result .siren-error { color: var(--red); background: var(--red-soft); border: 1px solid #f5c2c7; }
.siren-result .siren-loading { color: var(--muted); background: var(--blue-pale); }
.siren-box button[disabled] { opacity: .65; cursor: wait; }
.hero-links { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0 0; font-size: 14px; font-weight: 700; }

/* Recherche SIREN / nom dans la fiche client */
.client-lookup {
  margin-bottom: 22px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.client-lookup-head h2 {
  margin: 0 0 4px;
  font-family: var(--font-head);
  font-size: 18px;
}
.client-lookup-head .sub { margin: 0 0 12px; }
.client-lookup-row { display: flex; gap: 8px; align-items: stretch; }
.client-lookup-row input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}
.client-lookup-row input:focus {
  outline: 2px solid var(--blue-2);
  outline-offset: 1px;
}
.client-lookup-row .btn { white-space: nowrap; }
.client-lookup-status {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--muted);
}
.client-lookup-status.is-error { color: var(--red); }
.client-lookup-results {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.client-lookup-results[hidden] { display: none; }
.client-lookup-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.client-lookup-card:hover,
.client-lookup-card:focus-within {
  border-color: var(--blue-2);
  box-shadow: var(--shadow-sm);
}
.client-lookup-card > div { min-width: 0; }
.client-lookup-kicker {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--blue);
}
.client-lookup-card strong {
  display: block;
  font-family: var(--font-head);
  font-size: 16px;
  line-height: 1.3;
}
.client-lookup-meta {
  display: block;
  margin-top: 2px;
  font-size: 12.5px;
  color: var(--muted);
}
.client-lookup-card .btn { flex: 0 0 auto; }

@media (max-width: 560px) {
  .client-lookup-row { flex-direction: column; }
  .client-lookup-row .btn { width: 100%; }
  .client-lookup-card { align-items: flex-start; flex-direction: column; }
}
.hero-links a { color: var(--blue); }
.hero-links span { color: var(--muted); font-weight: 500; }

.search-page {
  padding: 36px 0 72px;
  background: linear-gradient(180deg, var(--blue-pale), #fff 280px);
}
.search-page h1 { font-size: 36px; margin-top: 8px; }
.search-list { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.search-hit {
  display: grid; grid-template-columns: 1fr auto; gap: 12px 16px; align-items: center;
  background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--blue);
  border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow-sm);
  color: inherit; text-decoration: none;
  transition: border-color .2s, transform .2s var(--ease);
}
.search-hit:hover { border-color: var(--blue-2); text-decoration: none; color: inherit; transform: translateY(-1px); }
.search-hit:focus-visible { outline: 2px solid var(--blue-2); outline-offset: 2px; }
.search-hit strong { display: block; font-family: var(--font-head); font-size: 18px; line-height: 1.25; }
.search-meta { display: block; color: var(--muted); font-size: 13px; line-height: 1.5; }
.search-alert { margin-top: 16px; background: var(--amber-soft); border-color: #ffd0b8; }
.search-alert p { margin: 0; }
.signup-steps { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 8px; }
.signup-activities ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 16px; }
.signup-activities li label { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 500; }
.signup-activities input { width: auto; }
.form-actions { display: flex; gap: 10px; margin-top: 18px; }
.form-actions .btn-primary { flex: 1; }

.micro { font-size: 12.5px; color: var(--muted); margin-top: 10px; }

/* ---------- Aperçu produit personnalisé ---------- */
.demo-wrap { position: relative; }
.demo-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 9px 12px; margin-bottom: 10px; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 10px 24px -22px rgba(0, 65, 146, .7);
}
.demo-toolbar-title {
  font-size: 11px; font-weight: 700; letter-spacing: .55px;
  text-transform: uppercase; color: var(--muted);
}
.demo-select { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.demo-select select {
  font: inherit; font-weight: 700; color: var(--blue); background: var(--blue-pale);
  border: 1px solid var(--line-2); border-radius: 999px; padding: 7px 30px 7px 12px;
  cursor: pointer; appearance: none;
  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='%23004192' stroke-width='2.4' 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 10px center;
}
.demo-select select:focus-visible { outline: 2px solid var(--blue-2); outline-offset: 2px; }
.demo-note {
  margin: 10px 2px 0; font-size: 12px; line-height: 1.5;
  color: var(--muted); text-align: center;
}

.mock {
  position: relative; border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: #fff; box-shadow: var(--shadow-lg);
  transition: transform .4s var(--ease), box-shadow .4s var(--ease);
}
.mock:hover { transform: translateY(-4px); box-shadow: 0 30px 70px -34px rgba(0, 65, 146, .55); }
.mock-inner { overflow: hidden; border-radius: var(--radius-lg); }
.mock-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 18px; border-bottom: 1px solid var(--line);
  background: var(--blue-pale); font-size: 12px; color: var(--muted);
}
.mock-top .mock-brand { display: flex; align-items: center; gap: 7px; color: var(--blue); font-weight: 700; }
.mock-body { padding: 20px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.kpi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0 18px; }
.mock .kpi { border: 1px solid var(--line); border-top: 3px solid var(--blue); border-radius: 4px; padding: 12px; background: #fff; }
.mock .kpi .l { font-size: 10.5px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.mock .kpi .v { font-family: var(--font-head); font-size: 21px; font-weight: 700; letter-spacing: -.3px; margin-top: 5px; }
.mock .kpi .d { font-size: 11.5px; margin-top: 3px; color: var(--muted); }
.up { color: var(--green); } .down { color: var(--red); }
.bar { height: 8px; border-radius: 999px; background: var(--blue-pale); overflow: hidden; margin-top: 8px; }
.bar span {
  display: block; height: 100%; border-radius: 999px; background: var(--blue-2);
  animation: grow 1.3s .4s var(--ease) both; transform-origin: left;
}
.mock-list { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.mock-item {
  display: flex; align-items: center; justify-content: space-between;
  border: 1px solid var(--line); border-radius: 4px; padding: 10px 12px; font-size: 13px;
  transition: border-color .2s, background .2s;
}
.mock-item:hover { border-color: var(--blue-2); background: #fbfdff; }

.float-card {
  position: absolute; z-index: 3; display: flex; align-items: center; gap: 10px;
  background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--pink);
  border-radius: 4px; padding: 10px 14px; box-shadow: var(--shadow);
  font-size: 12.5px; font-weight: 600; color: var(--ink);
  animation: float 6s ease-in-out infinite;
}
.float-card small { display: block; color: var(--muted); font-size: 11px; font-weight: 400; }
.float-card .fc-icon {
  width: 30px; height: 30px; border-radius: 4px; display: grid; place-items: center;
  background: var(--blue-soft); color: var(--blue); flex: 0 0 30px;
}
.fc-1 { left: -30px; top: 78px; animation-delay: .3s; border-left-color: var(--blue); }
.fc-2 { right: -24px; bottom: 48px; animation-delay: 1.1s; border-left-color: var(--green); }

/* ---------- Accès rapides ---------- */
.quick { margin-top: -34px; position: relative; z-index: 4; }
.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.quick-card {
  display: flex; align-items: flex-start; gap: 14px;
  background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--blue);
  border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm);
  color: var(--ink); transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s;
}
.quick-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); text-decoration: none; color: var(--ink); }
.quick-card.pink { border-top-color: var(--pink); }
.quick-card.green { border-top-color: var(--green); }
.quick-card .q-icon {
  width: 40px; height: 40px; flex: 0 0 40px; border-radius: 4px;
  background: var(--blue-soft); color: var(--blue);
  display: grid; place-items: center;
}
.quick-card.pink .q-icon { background: var(--pink-soft); color: var(--pink); }
.quick-card.green .q-icon { background: var(--green-soft); color: var(--green); }
.quick-card b { display: block; font-size: 15px; margin-bottom: 2px; }
.quick-card span.q-text { font-size: 13px; color: var(--muted); line-height: 1.5; display: block; }
.quick-card .q-arrow { margin-left: auto; color: var(--muted); transition: transform .2s, color .2s; }
.quick-card:hover .q-arrow { transform: translateX(3px); color: var(--blue); }

/* ---------- Bandeau de confiance ---------- */
.trust { padding: 30px 0 34px; text-align: center; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; background: #fff; border-bottom: 1px solid var(--line); }
.trust-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 15px; }
.trust-row span {
  color: var(--ink-2); font-size: 13px; font-weight: 500; letter-spacing: 0; text-transform: none;
  border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 14px;
  transition: border-color .2s, color .2s, background .2s;
}
.trust-row span:hover { border-color: var(--blue-2); color: var(--blue); background: var(--blue-pale); }

/* ---------- Démo vocale Aminia ---------- */
.voice {
  position: relative; overflow: hidden; padding: 78px 0;
  background:
    radial-gradient(680px 320px at 92% 4%, rgba(202, 28, 96, .38), transparent 62%),
    radial-gradient(760px 400px at 2% 100%, rgba(37, 99, 235,.38), transparent 66%),
    var(--blue);
  color: #fff;
}
.voice::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .12) 1px, transparent 1px);
  background-size: 20px 20px; opacity: .35; pointer-events: none;
}
.voice-grid { position: relative; z-index: 1; display: grid; grid-template-columns: .92fr 1.08fr; gap: 54px; align-items: center; }
.voice .eyebrow { color: #ffd0e0; }
.voice .eyebrow::before { background: #ffd0e0; }
.voice h2 { font-size: 42px; line-height: 1.05; color: #fff; margin: 14px 0 14px; }
.voice h2 span { color: #ffd0e0; }
.voice-lead { color: #dbe8ff; font-size: 17px; line-height: 1.7; max-width: 490px; margin: 0; }
.voice-points { list-style: none; margin: 24px 0 26px; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.voice-points li { display: flex; gap: 10px; align-items: flex-start; color: #eaf1ff; font-size: 14.5px; line-height: 1.5; }
.voice-points .vp-ico {
  width: 24px; height: 24px; flex: 0 0 24px; border-radius: 50%;
  background: rgba(255, 255, 255, .14); color: #fff; display: grid; place-items: center;
}
.voice-points .vp-ico svg { width: 13px; height: 13px; }
.voice-cta { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.voice .btn-accent { background: var(--pink); color: #fff; }
.voice .btn-accent:hover { background: #e0336f; color: #fff; }
.voice .btn-ghost { background: rgba(255, 255, 255, .08); color: #fff; border-color: rgba(255, 255, 255, .36); }
.voice .btn-ghost:hover { background: rgba(255, 255, 255, .16); color: #fff; border-color: #fff; }
.voice-note { color: #9fbcf0; font-size: 12px; margin: 14px 0 0; }
.voice-note a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.voice-note a:hover { color: #ffd0e0; }

.voice-stage {
  position: relative; display: flex; flex-direction: column; min-height: 570px;
  padding: 18px 20px 16px; border: 1px solid rgba(255, 255, 255, .22); border-radius: 16px;
  background: rgba(255, 255, 255, .075); box-shadow: 0 32px 80px -44px rgba(0, 0, 0, .8);
  backdrop-filter: blur(6px);
}
.voice-chat { display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; flex: 1; min-height: 290px; overflow: hidden; }
.voice-msg {
  max-width: 94%; padding: 12px 14px; border-radius: 11px;
  font-size: 13.5px; line-height: 1.55; animation: voiceMsg .38s var(--ease) both;
}
.voice-msg.is-off { display: none; }
.voice-msg.user { align-self: flex-end; background: rgba(202, 28, 96, .20); border: 1px solid rgba(255, 160, 196, .38); border-bottom-right-radius: 3px; }
.voice-msg.agent { align-self: flex-start; background: rgba(255, 255, 255, .13); border: 1px solid rgba(255, 255, 255, .24); border-bottom-left-radius: 3px; }
.voice-role { display: block; margin-bottom: 3px; font-size: 9.5px; font-weight: 700; letter-spacing: .9px; text-transform: uppercase; color: #ffd0e0; }
.voice-msg.agent .voice-role { color: #9fc4ff; }
.voice-msg p { margin: 0; color: #f3f7ff; }
.voice-msg strong { color: #fff; }

.voice-orb-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 8px 0 4px; }
.voice-orb { position: relative; width: 178px; height: 178px; display: grid; place-items: center; }
.voice-ring { position: absolute; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .20); }
.voice-ring.r1 { inset: 0; animation: voiceSpin 26s linear infinite; border-color: var(--blue); }
.voice-ring.r2 { inset: 13%; border-style: dashed; opacity: .55; animation: voiceSpin 34s linear infinite reverse; }
.voice-ring.r3 { inset: 27%; opacity: .35; animation: voicePulse 4s ease-out infinite; }
.voice-core {
  position: relative; width: 118px; height: 118px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .95), rgba(255, 255, 255, .22) 36%, rgba(37, 99, 235,.6) 68%, rgba(0, 65, 146, .65));
  border: 1px solid rgba(255, 255, 255, .55);
  box-shadow: 0 0 60px rgba(125, 180, 255, .45), inset 0 0 40px rgba(255, 255, 255, .22);
  transition: transform .4s var(--ease), box-shadow .4s var(--ease);
}
.voice-stage.is-speaking .voice-core { transform: scale(1.045); box-shadow: 0 0 85px rgba(125, 180, 255, .8), inset 0 0 46px rgba(255, 255, 255, .3); }
.voice-wave { display: flex; align-items: center; gap: 3px; height: 36px; }
.voice-wave i { display: block; width: 3px; border-radius: 2px; background: #fff; animation: voiceWave 2.2s ease-in-out infinite; }
.voice-wave i:nth-child(1) { height: 12px; animation-delay: 0s; }
.voice-wave i:nth-child(2) { height: 24px; animation-delay: .12s; }
.voice-wave i:nth-child(3) { height: 34px; animation-delay: .24s; }
.voice-wave i:nth-child(4) { height: 20px; animation-delay: .36s; }
.voice-wave i:nth-child(5) { height: 30px; animation-delay: .48s; }
.voice-wave i:nth-child(6) { height: 16px; animation-delay: .6s; }
.voice-wave i:nth-child(7) { height: 26px; animation-delay: .72s; }
.voice-stage.is-speaking .voice-wave i { animation-duration: .8s; }
.voice-status { margin-top: 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: #9fbcf0; text-align: center; }

.voice-controls { display: flex; align-items: center; gap: 12px; margin-top: 10px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .14); }
.voice-play {
  width: 40px; height: 40px; flex: 0 0 40px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .4);
  background: #fff; color: var(--blue); display: grid; place-items: center; cursor: pointer;
  transition: transform .2s, background .2s;
}
.voice-play:hover { transform: scale(1.05); background: var(--blue-soft); }
.voice-play .icon { width: 16px; height: 16px; fill: currentColor; stroke-width: 2; }
.voice-play span[hidden] { display: none; }
.voice-dots { display: flex; align-items: center; gap: 6px; flex: 1; }
.voice-dots button {
  width: 18px; height: 4px; padding: 0; border: 0; border-radius: 2px;
  background: rgba(255, 255, 255, .25); cursor: pointer; transition: width .2s, background .2s;
}
.voice-dots button:hover { background: rgba(255, 255, 255, .45); }
.voice-dots button.is-on { width: 30px; background: #ffd0e0; }
.voice-count { font-size: 11px; color: #9fbcf0; font-variant-numeric: tabular-nums; }
.voice-stage.is-static .voice-controls { display: none; }
.voice-stage.is-static .voice-msg { animation: none; }
.voice .voice-controls { justify-content: center; }

@keyframes voiceMsg { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }
@keyframes voiceSpin { to { transform: rotate(360deg); } }
@keyframes voicePulse { 0% { transform: scale(.94); opacity: .4; } 70% { transform: scale(1.08); opacity: 0; } 100% { opacity: 0; } }
@keyframes voiceWave { 0%, 100% { transform: scaleY(.45); opacity: .75; } 50% { transform: scaleY(1); opacity: 1; } }

/* ---------- Sections ---------- */
section { padding: 72px 0; }
.sec-head { max-width: 760px; margin: 0 0 38px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--pink); font-weight: 700; font-size: 12.5px;
  letter-spacing: .7px; text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 20px; height: 3px; background: var(--pink); }
h2 { font-family: var(--font-head); font-size: 36px; letter-spacing: -.5px; margin: 12px 0 10px; font-weight: 700; color: var(--ink); }
.sec-head p { color: var(--muted); font-size: 16.5px; line-height: 1.7; margin: 0; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature {
  background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--blue);
  border-radius: var(--radius); padding: 26px;
  box-shadow: var(--shadow-sm);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s;
}
.feature:nth-child(3n+2) { border-top-color: var(--pink); }
.feature:nth-child(3n) { border-top-color: var(--green); }
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.f-icon {
  width: 46px; height: 46px; border-radius: 4px; display: grid; place-items: center;
  background: var(--blue-soft); color: var(--blue); margin-bottom: 16px;
  transition: transform .25s var(--ease);
}
.feature:nth-child(3n+2) .f-icon { background: var(--pink-soft); color: var(--pink); }
.feature:nth-child(3n) .f-icon { background: var(--green-soft); color: var(--green); }
.feature:hover .f-icon { transform: scale(1.06); }
.f-icon svg { width: 23px; height: 23px; }
.feature h3 { font-family: var(--font-head); font-size: 19px; margin: 0 0 8px; font-weight: 700; letter-spacing: -.2px; }
.feature p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.65; }

/* ---------- Tarifs ---------- */
.pricing { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: stretch; }
.plan {
  position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; display: flex; flex-direction: column; box-shadow: var(--shadow-sm);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s;
}
.plan:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--blue-2); }
.plan.hot { border: 2px solid var(--blue); box-shadow: var(--shadow); }
.plan .tag-top {
  position: absolute; top: -13px; left: 24px;
  background: var(--pink); color: #fff; font-size: 11px; font-weight: 700;
  padding: 4px 11px; border-radius: 3px; text-transform: uppercase; letter-spacing: .5px;
}
.plan h3 { font-family: var(--font-head); margin: 0; font-size: 19px; text-transform: uppercase; letter-spacing: .4px; color: var(--blue); }
.price { font-family: var(--font-head); font-size: 44px; font-weight: 700; letter-spacing: -.8px; margin: 14px 0 2px; }
.price small { font-family: var(--font); font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.plan .desc { color: var(--muted); font-size: 13.5px; margin: 0 0 18px; }
.plan ul { list-style: none; padding: 0; margin: 0 0 24px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; color: var(--ink-2); }
.plan li { display: flex; gap: 9px; align-items: flex-start; }
.check { color: var(--green); font-weight: 800; flex: 0 0 auto; }
.plan .btn { margin-top: auto; width: 100%; }
.pricing-section { background: #fff; border-block: 1px solid var(--line); }
.pricing-section .pricing { padding-top: 8px; }
.plan ul.plan-limits {
  margin: 2px 0 16px; padding: 12px 0; gap: 6px;
  border-block: 1px solid var(--line);
  font-weight: 650; color: var(--ink);
}
.plan ul.plan-limits li { display: block; }
.plan ul.plan-features { margin-bottom: 16px; }
.plan-kicker {
  margin: 0 0 8px; font-size: 11px; font-weight: 700; letter-spacing: .5px;
  text-transform: uppercase; color: var(--muted);
}
.plan-trial { margin: 0 0 16px; color: var(--muted); font-size: 13px; }
.pricing-note {
  margin: 22px 0 0; max-width: 760px; color: var(--muted);
  font-size: 13.5px; line-height: 1.55;
}
.pricing-section .price small { white-space: nowrap; }

/* ---------- Bandeau CTA ---------- */
.cta-band {
  position: relative; overflow: hidden; border-radius: var(--radius-lg); padding: 52px;
  background: var(--blue); color: #fff;
  box-shadow: var(--shadow-lg);
}
.cta-band::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .14) 1px, transparent 1px);
  background-size: 18px 18px; opacity: .5; pointer-events: none;
}
.cta-band::after {
  content: ""; position: absolute; width: 280px; height: 280px; border-radius: 50%;
  right: -90px; top: -120px; background: rgba(202, 28, 96, .35); filter: blur(10px);
}
.cta-band h2 { color: #fff; margin-top: 0; position: relative; }
.cta-band p { color: #d7e4fb; max-width: 620px; margin: 0 0 26px; font-size: 16.5px; line-height: 1.7; position: relative; }
.cta-band .btn-primary { position: relative; background: #fff; color: var(--blue); }
.cta-band .btn-primary:hover { background: var(--blue-soft); color: var(--blue); }

/* ---------- Pied de page ---------- */
.legal-home-links {
  padding: 20px 0 26px;
  background: #fff;
  border-top: 1px solid var(--line);
}
.legal-home-links .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 18px;
  font-size: 13px;
}
.legal-home-links span {
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 11.5px;
}
.legal-home-links a { color: var(--ink-2); font-weight: 600; }
.legal-home-links a:hover { color: var(--blue); }
footer { background: #fff; border-top: 3px solid var(--blue); color: var(--muted); font-size: 13.5px; }
.foot-main { 
  display: grid; 
  grid-template-columns: 1.6fr 1fr 1fr 1fr; 
  gap: 40px; 
  padding: 60px 0 40px; 
  border-top: 1px solid var(--line);
  background: #fcfdfe;
}
.foot-main h4 { 
  font-family: var(--font-head); 
  font-size: 13px; 
  color: var(--ink); 
  margin: 0 0 20px; 
  text-transform: uppercase; 
  letter-spacing: 1px; 
  font-weight: 700;
  position: relative;
}
.foot-main h4::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -8px;
  width: 20px;
  height: 2px;
  background: var(--blue);
}
.foot-main ul { 
  list-style: none; 
  margin: 0; 
  padding: 0; 
  display: flex; 
  flex-direction: column; 
  gap: 12px; 
}
.foot-main a { 
  color: var(--muted); 
  font-size: 14px;
  transition: all 0.2s ease;
  display: inline-block;
}
.foot-main a:hover { 
  color: var(--blue); 
  transform: translateX(4px);
  text-decoration: none;
}
.foot-brand p { margin: 10px 0 0; max-width: 320px; line-height: 1.7; }
.foot-brand img { width: 40px; height: 40px; border-radius: 7px; }
.foot-brand .logo img, .foot-brand .product-logo { width: auto; height: 48px; max-width: 180px; border-radius: 0; background: transparent; }
.foot-bottom { border-top: 1px solid var(--line); padding: 16px 0; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 12.5px; }
.foot-bottom .foot-flag { display: flex; align-items: center; gap: 8px; }
.foot-bottom .foot-flag i { width: 22px; height: 3px; display: block; }
.foot-bottom .foot-flag i:nth-child(1) { background: var(--blue); }
.foot-bottom .foot-flag i:nth-child(2) { background: #fff; border-block: 1px solid var(--line); }
.foot-bottom .foot-flag i:nth-child(3) { background: var(--pink); }

/* ---------- Authentification ---------- */
.auth-wrap {
  min-height: calc(100vh - 260px); display: grid; place-items: center;
  padding: 52px 20px;
  background:
    radial-gradient(720px 340px at 50% 0%, rgba(37, 99, 235,.10), transparent 65%),
    var(--blue-pale);
}
.auth-card {
  position: relative; width: 100%; max-width: 440px; background: #fff;
  border: 1px solid var(--line); border-top: 4px solid var(--blue);
  border-radius: var(--radius); padding: 34px;
  box-shadow: var(--shadow-lg);
  animation: fadeUp .5s var(--ease) both;
}
.auth-card h1 { font-family: var(--font-head); font-size: 26px; margin: 0 0 8px; letter-spacing: -.3px; }
.auth-card .sub { color: var(--muted); font-size: 14px; margin: 0 0 20px; line-height: 1.65; }
.auth-card .brand-text b { font-family: var(--font-head); font-size: 15px; color: var(--ink); }
.auth-card img, .auth-card .product-logo { width: 36px; height: 36px; max-width: 36px; object-fit: contain; border-radius: 7px; background: #fff; flex: 0 0 36px; }
.auth-card .brand-text small { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; font-weight: 500; }
.flash {
  background: var(--blue-soft); border: 1px solid #b9d3ff; color: var(--blue);
  border-radius: var(--radius-sm); padding: 12px 14px; font-size: 13.5px; margin-bottom: 16px;
}
.flash a { color: var(--blue); text-decoration: underline; }
.flash-ok { background: var(--green-soft); border-color: #b7e4cf; color: var(--green); }

/* ---------- Application ---------- */

/* ——— Navigation mobile cockpit (header / drawer / footer) ——— */
.m-header,
.m-footer,
.m-backdrop,
.m-drawer-head { display: none; }
/* Tailles logo chrome même hors @media (évite PNG 838px si CSS mobile absent/partiel) */
.m-header-logo img,
.m-header-logo .product-logo {
  width: 32px; height: 32px; max-width: 32px;
  border-radius: var(--radius-sm); object-fit: contain; background: #fff;
  flex: 0 0 32px;
}
.shell { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: #fff; border-right: 1px solid var(--line); border-top: 3px solid var(--blue);
}
.brand {
  display: flex; align-items: center; gap: 11px; padding: 18px 20px;
  min-height: 80px; border-bottom: 1px solid var(--line); color: var(--ink);
}
.brand:hover { text-decoration: none; color: var(--ink); }
.brand img, .brand .product-logo { width: 38px; height: 38px; max-width: 38px; border-radius: 7px; object-fit: contain; background: #fff; flex: 0 0 38px; }
.brand-text { line-height: 1.15; }
.sidebar .brand-text b { display: block; font-family: var(--font-head); font-size: 15px; color: var(--blue); letter-spacing: -.1px; }
.sidebar .brand-text small { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; font-weight: 500; }
.nav-sec {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .9px;
  color: var(--muted); font-weight: 700; padding: 20px 22px 8px;
}
.side-link {
  display: flex; align-items: center; gap: 11px; margin: 2px 10px;
  padding: 10px 12px; border-radius: var(--radius-sm); border: none; background: none;
  font-family: inherit; font-size: 14px; font-weight: 500; color: var(--ink-2);
  text-decoration: none; cursor: pointer; width: calc(100% - 20px); text-align: left;
  transition: background .18s, color .18s;
}
.side-link:hover { background: var(--blue-pale); color: var(--blue); text-decoration: none; }
.side-link.active { background: var(--blue-soft); color: var(--blue); font-weight: 700; box-shadow: inset 3px 0 0 var(--blue); }
.side-link.is-locked { color: var(--muted); flex-wrap: wrap; }
.side-link.is-locked:hover { color: var(--blue); }
.lock-pill {
  flex: 1 0 100%; margin-left: 31px; font-size: 11px; font-weight: 700;
  color: var(--blue); letter-spacing: 0;
}
a.company.is-locked { opacity: .62; }
a.company.is-locked h3 { color: var(--muted); }
.side-ico { width: 20px; display: inline-flex; justify-content: center; color: currentColor; }
.icon { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--line); padding: 12px 0 8px; }
.sidebar-nav-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px 22px 12px; }
.avatar {
  width: 34px; height: 34px; border-radius: 6px; flex: 0 0 34px;
  background: var(--blue); color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: 13px;
}
.user-chip small { display: block; color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; }
.user-chip b { font-size: 12.5px; color: var(--ink); font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }

.main { display: flex; flex-direction: column; min-width: 0; background: var(--bg); }
.topbar {
  position: sticky; top: 0; z-index: var(--z-sticky); height: 64px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 28px;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(10px) saturate(160%);
  -webkit-backdrop-filter: blur(10px) saturate(160%);
  border-bottom: 1px solid var(--line);
}
.crumbs { font-size: 13px; color: var(--muted); font-weight: 500; margin-right: auto; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.nav-desktop-toggle {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink-2); cursor: pointer;
  transition: background .18s, color .18s, border-color .18s;
}
.nav-desktop-toggle:hover { background: var(--blue-pale); color: var(--blue); border-color: var(--line-2); }
.nav-desktop-toggle:focus-visible { outline: 2px solid var(--blue-2); outline-offset: 2px; }
.nav-desktop-toggle .icon { width: 20px; height: 20px; }
.shell { transition: grid-template-columns .2s var(--ease); }
@media (min-width: 769px) {
  body.sidebar-collapsed .shell { grid-template-columns: 0 minmax(0, 1fr); }
  body.sidebar-collapsed .sidebar {
    visibility: hidden; pointer-events: none; overflow: hidden;
    border-right: 0; box-shadow: none;
  }
}
.content { padding: 32px 28px calc(56px + var(--m-fab-h)); max-width: 1260px; width: 100%; }
.content h1 { font-family: var(--font-head); font-size: 30px; letter-spacing: -.02em; margin: 0 0 6px; font-weight: 700; }
.sub { color: var(--muted); font-size: 14px; margin: 0 0 22px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }

/* Cartes / grilles */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-sm); }
.card-tight { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-head h3 { margin: 0; font-family: var(--font-head); font-size: 17px; font-weight: 700; }
.card-body { padding: 22px; }
.settings-danger { margin-top: 22px; border-color: color-mix(in srgb, var(--red) 28%, var(--line)); }
.settings-danger h2 { margin: 0 0 6px; font-family: var(--font-head); font-size: 18px; }
.settings-danger summary { display: inline-flex; list-style: none; cursor: pointer; }
.settings-danger summary::-webkit-details-marker { display: none; }
.settings-danger details[open] summary { margin-bottom: 4px; }
.grid { display: grid; gap: 16px; }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g2 { grid-template-columns: 1.6fr 1fr; }

.companies { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.company {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px 14px;
  overflow: hidden;
  background:
    radial-gradient(120% 130% at 100% 0%, rgba(37, 99, 235,.09), transparent 48%),
    #ffffff;
  border: 1px solid rgba(0, 65, 146, .14);
  border-radius: 18px;
  padding: 18px;
  color: var(--ink);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .9),
    0 14px 32px -26px rgba(0, 65, 146, .55);
  transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s var(--ease), background .22s var(--ease);
}
.company::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--co-accent, var(--blue));
  opacity: .85;
}
.company:hover {
  transform: translateY(-3px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .9),
    0 22px 44px -26px rgba(0, 65, 146, .55);
  border-color: rgba(37, 99, 235,.38);
  text-decoration: none;
  color: var(--ink);
}
.company:focus-visible {
  outline: none;
  border-color: var(--blue-2);
  box-shadow: 0 0 0 3px rgba(37, 99, 235,.2), 0 18px 38px -26px rgba(0, 65, 146, .55);
}
.company.sel {
  border-color: rgba(37, 99, 235,.5);
  background:
    radial-gradient(120% 130% at 100% 0%, rgba(37, 99, 235,.16), transparent 52%),
    #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .9),
    0 0 0 1px rgba(37, 99, 235,.16),
    0 20px 42px -26px rgba(0, 65, 146, .6);
}
.company.sel::before { width: 4px; opacity: 1; }
.company h3 { grid-column: 1 / -1; margin: 0 0 4px; font-family: var(--font-head); font-size: 17px; font-weight: 700; }
.company .s { grid-column: 1 / -1; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.company > .co-body { grid-column: 2; min-width: 0; }
.company > .co-body h3 { margin: 0 0 4px; }
.company > .co-body .s { display: block; }

.kpi { background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--blue); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm); }
.kpi .l { font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .6px; }
.kpi .v { font-family: var(--font-head); font-size: 30px; font-weight: 700; letter-spacing: -.5px; margin-top: 5px; }
.kpi .d { font-size: 12px; margin-top: 4px; color: var(--muted); }

/* Tableaux */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; padding: 11px 20px; background: var(--thead-bg); border-bottom: 1px solid var(--line); }
td { padding: 12px 20px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: var(--thead-bg); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.num, th.num { white-space: nowrap; }
/* Références facture / devis : ne pas couper FAC-2026-xxxxx */
.card table td:first-child,
.card table td:first-child a,
table td a b { white-space: nowrap; }
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}
.empty { padding: 40px 20px; text-align: center; color: var(--muted); font-size: 13.5px; }
.totals { background: var(--blue-pale); font-weight: 700; }

/* Formulaires */
label { display: block; font-size: 13px; font-weight: 600; color: var(--ink); margin: 16px 0 6px; }
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line-2);
  border-radius: 12px; font-size: 16px; font-family: inherit; min-height: 44px;
  background: #fbfcfe; color: var(--ink); outline: none;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, .03);
  transition: border-color .18s, box-shadow .18s, background .18s;
}
input::placeholder, textarea::placeholder, select::placeholder { color: #94a3b8; }
textarea { min-height: 96px; }
input[type="file"] { width: 100%; }
input:focus, select:focus, textarea:focus { border-color: var(--blue-2); background: #fff; box-shadow: 0 0 0 3px rgba(37, 99, 235,.14); }
select[multiple] { min-height: 132px; }
.error { color: var(--red); font-size: 12.5px; margin-top: 5px; }
.form-errors { color: var(--red); font-size: 13px; background: var(--red-soft); border: 1px solid #f5c2c7; border-radius: var(--radius-sm); padding: 12px 14px 12px 30px; margin: 14px 0; }
.helptext { font-size: 12px; color: var(--muted); margin-top: 5px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.muted { color: var(--muted); }

/* ---------- Badges ---------- */
.badge { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px; letter-spacing: .01em; background: var(--blue-pale); color: var(--ink-2); }
.badge-blue { background: var(--blue-soft); color: var(--blue); }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.tag { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--blue-pale); color: var(--ink-2); }
.tag.blue { background: var(--blue-soft); color: var(--blue); }
.tag.green { background: var(--green-soft); color: var(--green); }
.tag.amber { background: var(--amber-soft); color: var(--amber); }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }

/* ---------- Animations ---------- */
.reveal { opacity: 0; transition: opacity .55s var(--ease); }
.reveal.is-visible { opacity: 1; }
/* Ne jamais animer transform sur un ancêtre d'éléments fixed (barre Actions). */

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(25, 135, 84, .45); } 70% { box-shadow: 0 0 0 8px rgba(25, 135, 84, 0); } 100% { box-shadow: 0 0 0 0 rgba(25, 135, 84, 0); } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- Aminia, barre basse ---------- */
body.agent-open .main { padding-bottom: 92px; }
.agent-fab {
  position: fixed; right: 24px; bottom: 24px; z-index: var(--z-fab);
  display: inline-flex; align-items: center; gap: 10px;
  padding: 7px 16px 7px 7px; border: 1px solid var(--line); border-radius: 999px;
  background: #fff; color: var(--ink); cursor: pointer;
  font-family: var(--font-body); font-size: 14px; font-weight: 700;
  box-shadow: 0 16px 38px -16px rgba(0, 65, 146, .55);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s;
}
body.agent-open .agent-fab { visibility: hidden; pointer-events: none; }
.agent-fab:hover { transform: translateY(-2px); border-color: var(--line-2); box-shadow: 0 22px 46px -18px rgba(0, 65, 146, .65); }
.agent-fab:focus-visible { outline: 2px solid var(--blue-2); outline-offset: 3px; }
.agent-fab-orb {
  position: relative; width: 44px; height: 44px; flex: 0 0 auto;
  display: grid; place-items: center; border-radius: 50%; color: #fff;
  background: radial-gradient(circle at 34% 28%, #5aa0ff, var(--blue) 62%, #00306e);
  box-shadow: 0 8px 18px -8px rgba(0, 65, 146, .8);
}
.agent-fab-orb::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 1px solid rgba(37, 99, 235,.34); animation: agentPulse 2.6s ease-out infinite;
}
.agent-fab-orb svg { width: 22px; height: 22px; position: relative; z-index: 1; }
.agent-fab-text { letter-spacing: .2px; font-family: var(--font-head); }
.agent-panel {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-agent-panel);
  pointer-events: none;
}
.agent-panel[hidden] { display: none; }
.agent-dialog {
  pointer-events: auto;
  display: flex; flex-direction: row; align-items: center; gap: 14px;
  width: 100%; min-height: 76px; padding: 10px 18px;
  text-align: left; border-radius: 0;
  border: 0; border-top: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 -10px 28px -18px rgba(0, 20, 50, .45);
  animation: agentIn .22s var(--ease) both;
}
.agent-copy { flex: 1; min-width: 0; }
.agent-dialog h2 {
  margin: 0; font-family: var(--font-head); font-size: 16px;
  letter-spacing: -.2px; color: var(--ink);
}
.agent-orb {
  position: relative; width: 52px; height: 52px; flex: 0 0 auto;
  display: grid; place-items: center;
}
.agent-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 1px solid rgba(37, 99, 235,.26);
  animation: agentPulse 2.8s ease-out infinite;
}
.agent-ring.r2 { animation-delay: .9s; }
.agent-ring.r3 { animation-delay: 1.8s; }
.agent-core {
  width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #5aa0ff, var(--blue) 62%, #00306e);
  box-shadow: 0 10px 20px -12px rgba(0, 65, 146, .8);
  transition: background .3s, transform .3s;
}
.agent-wave { display: flex; align-items: center; gap: 3px; height: 18px; }
.agent-wave i {
  display: block; width: 3px; height: 8px; border-radius: 3px;
  background: #fff; opacity: .88; animation: agentWave 1.1s ease-in-out infinite;
}
.agent-wave i:nth-child(2) { animation-delay: .1s; }
.agent-wave i:nth-child(3) { animation-delay: .2s; }
.agent-wave i:nth-child(4) { animation-delay: .3s; }
.agent-wave i:nth-child(5) { animation-delay: .4s; }
.agent-wave i:nth-child(6) { animation-delay: .5s; }
.agent-wave i:nth-child(7) { animation-delay: .6s; }
.agent-status {
  min-height: 18px; margin: 2px 0 0;
  font-size: 13px; font-weight: 700; color: var(--blue); line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.agent-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}
.agent-duration { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink-2); }
.agent-wake { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.agent-wake input { width: 13px; height: 13px; }
[hidden] { display: none !important; }
.agent-dialog:not(.is-live) .agent-meta { display: none; }
.agent-live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: 4px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(61, 220, 106, .18);
  animation: pulse 1.6s infinite;
}
.agent-actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.agent-mic {
  width: 46px; height: 46px; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: var(--blue); color: #fff; cursor: pointer;
  box-shadow: 0 10px 20px -12px rgba(0, 65, 146, .9);
  transition: transform .2s var(--ease), background .2s, box-shadow .2s;
}
.agent-mic:hover { transform: translateY(-2px); background: var(--blue-2); }
.agent-mic:focus-visible { outline: 2px solid var(--blue-2); outline-offset: 3px; }
.agent-mic svg { width: 20px; height: 20px; }
.agent-mic.is-listening { background: var(--pink); animation: pulse 1.4s infinite; }
.agent-actions .btn { padding: 9px 14px; font-size: 12.5px; }
.agent-note {
  margin: 2px 0 0; font-size: 12px; line-height: 1.35; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.agent-dialog.is-listening .agent-core { background: radial-gradient(circle at 34% 28%, #ff8fbd, var(--pink) 62%, #8a0e3f); }
.agent-dialog.is-thinking .agent-core { animation: agentThink 1.2s ease-in-out infinite; }
.agent-dialog.is-thinking .agent-wave i { animation-duration: .55s; }
.agent-dialog.is-done .agent-core { background: radial-gradient(circle at 34% 28%, #62d99a, var(--green) 62%, #0b5c36); }
.live-invoice {
  position: fixed; z-index: var(--z-agent-panel);
  left: 50%; bottom: 108px;
  transform: translateX(-50%);
  width: min(640px, calc(100vw - 32px));
  pointer-events: auto;
}
.live-invoice[hidden] { display: none; }
.live-invoice input { font-size: 16px; font-weight: 700; }
.live-invoice input.is-typing { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37, 99, 235,.18); }
.live-invoice input.is-typing { background-image: linear-gradient(var(--blue), var(--blue)); background-size: 2px 1.1em; background-repeat: no-repeat; background-position: right 12px center; }

@keyframes agentIn { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: scale(1); } }
@keyframes agentPulse { 0% { transform: scale(.92); opacity: .9; } 80%, 100% { transform: scale(1.22); opacity: 0; } }
@keyframes agentWave { 0%, 100% { height: 8px; opacity: .55; } 50% { height: 22px; opacity: 1; } }
@keyframes agentThink { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.07); } }

/* ---------- Environnement téléphonique Aminia (SIP/WebRTC) ---------- */
.phone {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  width: 100%; margin: 6px 0 2px; padding: 16px 12px 14px;
  background: var(--blue-pale); border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.phone-peer { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.phone-orb {
  position: relative; width: 72px; height: 72px; border-radius: 50%;
  display: grid; place-items: center; background: #fff;
  border: 1px solid var(--line); overflow: hidden;
}
.phone-orb .agent-ring { position: absolute; inset: -6px; border-radius: 50%; border: 2px solid rgba(37, 99, 235,.3); }
.phone-orb .agent-core { width: 42px; height: 42px; border-radius: 50%; background: var(--blue-soft); display: grid; place-items: center; z-index: 1; }
.phone-orb .agent-wave { height: 18px; }
.phone-orb .agent-wave i { width: 3px; }
.phone-name { font-family: var(--font-head); font-size: 15px; color: var(--blue); }
.phone-ext { font-size: 11.5px; color: var(--muted); letter-spacing: .4px; text-transform: uppercase; }
.phone-status { font-size: 12.5px; color: var(--ink-2); text-align: center; min-height: 18px; }
.phone-timer {
  font-family: var(--font-head); font-size: 18px; letter-spacing: 1.5px;
  color: var(--blue); font-variant-numeric: tabular-nums;
}
.phone-keys {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 6px; width: 100%; max-width: 216px;
}
.phone-key {
  padding: 9px 0; border: 1px solid var(--line); background: #fff;
  border-radius: 8px; font-family: var(--font-head); font-size: 15px;
  color: var(--ink); cursor: pointer;
}
.phone-key:hover { border-color: var(--blue-2); }
.phone-key:active { background: var(--blue-soft); border-color: var(--blue); }
.phone-actions { display: flex; gap: 8px; }
.phone.is-live .phone-orb .agent-ring { border-color: rgba(25, 135, 84, .55); }
.phone.is-live .phone-ext { color: var(--green); }

/* ---------- Wizard de facture / devis (style Qonto) ---------- */
.client-cards {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
  margin: 4px 0 14px;
}
.client-card {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line); background: var(--surface);
  border-radius: 12px; padding: 10px 14px; cursor: pointer; font-family: inherit;
  transition: border-color .15s, background .15s;
}
.client-card:hover { border-color: var(--blue-2); background: var(--blue-pale); }
.client-card.selected, .client-card.selected:hover {
  border-color: var(--blue-2); background: var(--blue-soft);
  box-shadow: inset 3px 0 0 var(--blue);
}
.client-card-body { min-width: 0; flex: 1 1 auto; display: grid; gap: 2px; }
.client-card-body strong { font-size: 13.5px; color: var(--ink); }
.client-card-body span { font-size: 11px; color: var(--muted); }
.client-card-btn {
  flex: 0 0 auto; font-size: 12px; font-weight: 800; color: var(--blue);
  background: var(--blue-soft); border-radius: 999px; padding: 5px 12px;
}
.client-cards-title { margin: 2px 0 6px; }

/* Autocomplétion client : fiches internes + annuaire INSEE */
.client-suggest {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  z-index: var(--z-sticky, 20); background: var(--surface);
  border: 1px solid var(--line-2); border-radius: 12px;
  box-shadow: 0 18px 42px -18px rgba(15, 23, 42, .35);
  max-height: 320px; overflow-y: auto; padding: 6px;
}
.client-suggest-row {
  width: 100%; text-align: left; border: none; background: transparent;
  border-radius: 9px; padding: 8px 12px; cursor: pointer; font-family: inherit;
  display: grid; gap: 2px; transition: background .12s;
}
.client-suggest-row:hover, .client-suggest-row:focus-visible {
  background: var(--blue-pale); outline: none;
}
.client-suggest-row.is-internal { background: var(--blue-pale); }
.client-suggest-row strong { font-size: 13px; color: var(--ink); font-weight: 700; }
.client-suggest-row small { font-size: 11px; color: var(--muted); }
.wizard-step-title { font-size: 18px; margin: 0 0 3px; color: var(--ink); }
.wizard-step .micro { margin: 0 0 14px; }
.due-quick { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.due-chip {
  border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px;
  padding: 8px 16px; font-size: 13px; font-weight: 650; cursor: pointer;
  color: var(--ink); font-family: inherit; transition: border-color .15s, background .15s;
}
.due-chip:hover { border-color: var(--blue-2); }
.due-chip.is-selected { border-color: var(--blue-2); background: var(--blue-soft); color: var(--blue); }
@media (max-width: 768px) {
  .client-cards { grid-template-columns: 1fr; }
  .wizard-step-title { font-size: 17px; }
}

/* Petit bouton "+" d'ajout de ligne : rond et discret sur mobile,
   libellé complet sur grand écran. */
.btn-add-line { display: inline-flex; align-items: center; gap: 6px; }
.btn-add-line-ico { font-size: 17px; font-weight: 800; line-height: 1; }
@media (max-width: 768px) {
  .btn-add-line {
    width: 44px; min-height: 44px; padding: 0;
    border-radius: 999px; justify-content: center; flex: 0 0 auto;
  }
  .btn-add-line-txt { display: none; }
}

/* ---------- Socle app bancaire : pilules, verre clair, skeletons, scanner ----------
   Lot 1a : CTA en pilule (rayon 999px, hauteur --tap), chrome translucide en
   clair (référence : pied sombre rgba(9,9,11,.66)), skeleton partagé, Factures
   au centre surélevée, CTA principal de page (pas de bouton flottant). */
@media (max-width: 768px) {
  .content .btn {
    border-radius: 999px;
  }
  .content .btn-primary,
  .content .btn-ghost,
  .content .btn-danger {
    min-height: var(--tap);
  }
  html:not([data-theme="dark"]) .m-footer,
  html:not([data-theme="dark"]) .m-header {
    background-color: var(--glass-bg, rgba(255, 255, 255, 0.72));
    -webkit-backdrop-filter: var(--glass-blur, blur(20px) saturate(160%));
    backdrop-filter: var(--glass-blur, blur(20px) saturate(160%));
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.4),
      0 18px 40px -26px rgba(15, 23, 42, 0.45);
  }
  html:not([data-theme="dark"]) .m-footer-btn.active .m-footer-ico {
    background: var(--blue-soft);
    color: var(--blue);
    border-color: transparent;
  }
  /* Factures : bouton centrale TOUJOURS rouge, sélectionné ou non. */
  .m-footer-raised .m-footer-ico {
    transform: translateY(-10px);
    width: 48px; height: 48px;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 55%),
      linear-gradient(100deg, #e6244d 0%, #c70424 55%, #9e0320 100%);
    color: #fff;
    border-color: transparent;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.32),
      0 14px 28px -12px rgba(199, 4, 36, 0.6);
  }
  .m-footer-raised .m-footer-ico .icon { width: 21px; height: 21px; }
  html[data-theme="dark"] .m-footer-raised .m-footer-ico {
    color: #fff;
    border-color: transparent;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.26),
      0 14px 28px -12px rgba(199, 4, 36, 0.55);
  }
  /* Boutons (Aminia, Plus) : même texte que les liens du pied (10px compact). */
  .m-footer .m-footer-btn {
    font-family: inherit;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1px;
    line-height: 1.2;
  }
  div.page-actions.m-dock-split,
  div.page-actions.m-dock-single {
    display: none !important;
  }
}

/* Skeletons : états de chargement pour l'OCR, les listes et les KPI.
   Aucune animation déclenchée par la saisie clavier (:focus sans effet). */
.skeleton {
  position: relative; overflow: hidden;
  background: rgba(15, 23, 42, 0.08);
  border-radius: 8px; color: transparent !important;
  pointer-events: none; user-select: none;
}
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: translateX(-100%);
  animation: skeleton-wave 1.4s ease-in-out infinite;
}
@keyframes skeleton-wave { to { transform: translateX(100%); } }
html[data-theme="dark"] .skeleton { background: rgba(255, 255, 255, 0.08); }
html[data-theme="dark"] .skeleton::after {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}
.skeleton-ocr {
  max-width: 340px; margin: 14px auto 0;
  display: grid; gap: 10px;
}
.skeleton-ocr > i { display: block; height: 46px; border-radius: 14px; }
@media (prefers-reduced-motion: reduce) {
  .skeleton::after { animation: none; }
}

/* ---------- Fiche facture : récap et actions cohérentes ---------- */
.invoice-status-card { padding: 16px 18px; }
.invoice-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(108px, 1fr));
  gap: 10px;
}
.invoice-status-item {
  display: grid; gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-2, rgba(248, 249, 252, 0.6));
}
.invoice-status-item small {
  font-size: 10.5px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--muted);
}
.invoice-status-item b {
  font-family: var(--font-head);
  font-size: 15px; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.invoice-status-item b span { font-size: 10.5px; font-weight: 700; color: var(--muted); }
.invoice-status-item a { color: var(--ink); text-decoration: none; }
.invoice-actions {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-top: 14px;
}
.invoice-actions .invoice-main-action { flex: 1 1 220px; }
.invoice-main-action .btn { width: 100%; min-height: 48px; }
.invoice-actions .btn-ghost,
.invoice-actions .btn-danger { min-height: 48px; }
.invoice-sub-link { margin: 12px 0 0; text-align: right; }
html[data-theme="dark"] .invoice-status-item {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line);
}
html[data-theme="dark"] .invoice-status-item a { color: var(--ink); }

/* ---------- Barre de progression des imports ---------- */
.progressbar {
  height: 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.1);
  overflow: hidden;
}
.progressbar > i {
  display: block;
  height: 100%;
  width: 36%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), #4f8dff);
  animation: progress-slide 1.2s ease-in-out infinite;
}
@keyframes progress-slide {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(320%); }
}
html[data-theme="dark"] .progressbar {
  background: rgba(255, 255, 255, 0.08);
}
html[data-theme="dark"] .progressbar > i {
  background: linear-gradient(100deg, #e6244d, #9e0320);
}
@media (prefers-reduced-motion: reduce) {
  .progressbar > i { animation: none; width: 100%; }
}

/* Cartes bancaires (mobile) : liste type Qonto, la table reste pour l'écran large. */
.bank-mobile-list { display: none; }
@media (max-width: 768px) {
  .bank-transactions-table-wrap { display: none; }
  .bank-mobile-list {
    display: grid; gap: 10px;
    padding: 0 2px;
  }
  .bank-item {
    display: flex; align-items: center; gap: 10px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 10px 12px;
    box-shadow: 0 10px 26px -22px rgba(15, 23, 42, 0.5);
  }
  .bank-item.is-ignored { opacity: 0.55; }
  .bank-item-check {
    width: 18px; height: 18px; flex: 0 0 auto; margin: 2px 0 0;
    accent-color: var(--blue);
  }
  .bank-item-body {
    display: flex; align-items: center; gap: 10px;
    flex: 1 1 auto; min-width: 0;
    text-decoration: none; color: inherit;
  }
  .bank-item-ico {
    width: 38px; height: 38px; flex: 0 0 38px;
    display: grid; place-items: center;
    border-radius: 12px;
    font-family: var(--font-head); font-weight: 800; font-size: 16px;
  }
  .bank-item-ico.is-out { background: rgba(255, 61, 120, 0.12); color: #c81b52; }
  .bank-item-ico.is-in { background: rgba(52, 211, 153, 0.16); color: #0f9d6a; }
  .bank-item-main { flex: 1 1 auto; min-width: 0; display: grid; gap: 2px; }
  .bank-item-main b {
    font-size: 13.5px; color: var(--ink);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .bank-item-main small {
    font-size: 11px; color: var(--muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .bank-item-amount {
    flex: 0 0 auto;
    font-family: var(--font-head); font-weight: 800; font-size: 14px;
  }
  .bank-item-amount.is-neg { color: var(--ink); }
  .bank-item-amount.is-pos { color: #0f9d6a; }
}
html[data-theme="dark"] .bank-item {
  background: #121214;
  border-color: var(--line);
  box-shadow: none;
}
html[data-theme="dark"] .bank-item-ico.is-out { background: rgba(255, 61, 120, 0.16); color: #ff8aa0; }
html[data-theme="dark"] .bank-item-ico.is-in { background: rgba(52, 211, 153, 0.14); color: #34d399; }
html[data-theme="dark"] .bank-item-amount.is-neg { color: var(--ink); }
html[data-theme="dark"] .bank-item-amount.is-pos { color: #34d399; }

/* Badge société active dans le topbar desktop (miroir du header mobile). */
.m-company-logo {
  width: 28px; height: 28px; flex: 0 0 28px;
  border-radius: 9px;
  object-fit: contain; background: #fff;
  border: 1px solid var(--line); padding: 2px;
}
.company-active {
  display: inline-flex; align-items: center; gap: 8px;
  margin-left: auto;
  padding: 4px 6px 4px 4px;
  border-radius: 999px;
  max-width: 260px;
}
.company-active b {
  font-family: var(--font-head);
  font-size: 13px; font-weight: 700; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.company-active .m-company-logo { width: 28px; height: 28px; border-radius: 9px; }
.company-active .company-switch-btn { width: 28px; height: 28px; font-size: 13px; }

/* Apparence : aperçu fidèle (PNG du PDF réel) sous les cartes. */
.settings-sheet-preview {
  margin: 0;
  padding: 8px;
  background: var(--bg-2, #eef1f6);
  border-radius: 12px;
}
.settings-sheet-png {
  display: block; width: 100%; margin: 0 auto;
  border-radius: 10px; background: #fff;
  border: 1px solid var(--line);
}
html[data-theme="dark"] .settings-sheet-preview {
  background: rgba(255, 255, 255, 0.05);
}
@supports not (object-fit: cover) {
  .settings-sheet-png { max-width: 100%; }
}

/* Ligne de facture : désignation en multiligne */
.invoice-lines-table textarea[data-multiline] {
  resize: vertical;
  min-height: 44px;
  line-height: 1.35;
  border-radius: 10px;
}
@media (max-width: 768px) {
  .invoice-lines-table td { padding: 8px 10px; }
  .invoice-lines-table textarea[data-multiline] { width: 100%; }
}

/* Wizard mobile : la barre est collée au footer et le contenu passe dessous */
@media (max-width: 768px) {
  body.wizard-active .main .content {
    padding-bottom: calc(var(--m-footer-h) + 92px + env(safe-area-inset-bottom, 0px));
  }
  .wizard-mode .wizard-nav {
    border-top: 1px solid var(--line);
    background: var(--surface);
    backdrop-filter: none;
  }
}

/* ---------- Aminia : panneau de recherche d'entreprises ---------- */
.agent-results {
  position: fixed; right: 16px; bottom: 84px; z-index: var(--z-agent-panel);
  width: min(360px, calc(100vw - 28px));
  animation: fadeUp .3s var(--ease) both;
}
.agent-results-card {
  padding: 14px 14px 12px;
  max-height: calc(100vh - 120px);
  display: flex; flex-direction: column; gap: 8px;
}
.agent-results-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.agent-results-head h2 { margin: 0; font-family: var(--font-head); font-size: 15px; }
.agent-results-sub { margin: 2px 0 0; color: var(--muted); font-size: 11.5px; line-height: 1.4; }
.agent-results-list {
  overflow-y: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  display: grid; gap: 6px; padding-right: 2px;
  flex: 1 1 auto; min-height: 0;
}
.agent-result-row {
  display: flex; align-items: flex-start; gap: 10px; text-align: left;
  background: rgba(255, 255, 255, .72); border: 1px solid var(--line);
  border-radius: 12px; padding: 9px 12px; cursor: pointer; font-family: inherit;
  transition: border-color .15s, background .15s;
}
.agent-result-row:hover { border-color: var(--blue-2); background: var(--blue-soft); }
.agent-result-row.is-on { border-color: var(--blue-2); background: var(--blue-soft); box-shadow: inset 3px 0 0 var(--blue); }
.agent-result-rank {
  flex: 0 0 22px; height: 22px; border-radius: 7px; background: var(--blue); color: #fff;
  display: grid; place-items: center; font-size: 11.5px; font-weight: 800;
}
.agent-result-main { display: grid; gap: 2px; min-width: 0; }
.agent-result-main b { font-size: 13px; color: var(--ink); line-height: 1.3; }
.agent-result-main small { font-size: 11px; color: var(--muted); line-height: 1.35; }
.agent-result-badges { display: grid; gap: 4px; flex: 0 0 auto; }
.agent-result-badges .badge { font-size: 10px; padding: 2px 7px; }
.agent-results-actions { border-top: 1px solid var(--line); padding-top: 8px; display: grid; gap: 6px; flex: 0 0 auto; }
.agent-results-label { margin: 0; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.agent-results-action-links { display: flex; flex-wrap: wrap; gap: 6px; }
.agent-results-close { flex: 0 0 auto; }


/* Collé à la tab bar sur mobile ; le voile laisse lire la FAB en dessous */
@media (max-width: 768px) {
  .agent-results {
    left: 8px; right: 8px; bottom: calc(var(--m-footer-h) + 6px + env(safe-area-inset-bottom, 0px));
    width: auto;
  }
  .agent-results-card { max-height: min(65vh, 480px); }
}

/* Sélecteur de période lisible dans les deux thèmes */
html[data-theme="dark"] .period-switch a { color: #d4d4d8; }
html[data-theme="dark"] .period-switch a:hover { color: #f6f6f4; background: rgba(255, 255, 255, .06); }
html[data-theme="dark"] .period-switch a.is-on { background: var(--blue); color: #070708; }
html[data-theme="dark"] .period-switch { background: #121214; border-color: var(--line); }
html[data-theme="dark"] .global-kpi .v { color: var(--ink); }
html[data-theme="dark"] .socie-stats b { color: var(--ink); }

/* Bouton de lecture vocale des messages du chat Aminia */
.agent-chat-speak {
  margin-top: 6px; border: 1px solid var(--line); background: var(--surface);
  border-radius: 999px; padding: 4px 12px; font-size: 11.5px; font-weight: 650;
  color: var(--blue); cursor: pointer; display: inline-flex; align-items: center;
  transition: background .15s, border-color .15s;
}
.agent-chat-speak:hover { background: var(--blue-pale); border-color: var(--blue-2); }
.agent-chat-speak:disabled { opacity: .6; cursor: wait; }
.agent-chat-bubble--assistant .agent-chat-speak { background: rgba(255, 255, 255, .72); }

html[data-theme="dark"] .agent-chat-speak { background: rgba(255, 255, 255, .06); color: var(--blue-2); }
html[data-theme="dark"] .agent-chat-bubble--assistant .agent-chat-speak { background: rgba(255, 255, 255, .04); }

/* ---------- Dashboard inter-sociétés ---------- */
.period-switch {
  display: inline-flex; gap: 4px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 999px; padding: 4px;
}
.period-switch a {
  padding: 7px 16px; border-radius: 999px; font-size: 13px; font-weight: 650;
  color: var(--muted); text-decoration: none; transition: background .15s, color .15s;
}
.period-switch a:hover { color: var(--blue); background: var(--blue-pale); text-decoration: none; }
.period-switch a.is-on { background: var(--blue); color: #fff; }
.global-kpis {
  display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); gap: 12px;
  margin-bottom: 16px;
}
.global-kpi .v { font-size: 26px; letter-spacing: -.4px; }
.global-kpi .d { display: block; font-size: 11.5px; margin-top: 3px; }
.global-kpi .d.is-up { color: var(--green); }
.global-kpi .d.is-down { color: var(--red); }
.global-chart .card-body { padding: 12px 18px 6px; }
.global-bars { width: 100%; height: auto; display: block; }
.global-bar { fill: var(--blue); rx: 4; transition: fill .15s; }
.global-bar:hover { fill: var(--blue-2); }
.global-bar-prev { fill: var(--line-2); opacity: .55; rx: 4; }
.global-axis { stroke: var(--line); stroke-width: 1; }
.global-bar-label { fill: var(--muted); font-size: 10px; text-anchor: middle; }
.societes-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px;
  margin-top: 16px;
}
.socie-row {
  display: grid; gap: 12px; color: var(--ink); text-decoration: none;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s;
}
.socie-row:hover {
  transform: translateY(-2px); text-decoration: none; color: var(--ink);
  box-shadow: 0 20px 44px -24px rgba(15, 23, 42, .35); border-color: var(--blue-2);
}
.socie-head { display: flex; align-items: center; gap: 11px; }
.socie-avatar {
  flex: 0 0 40px; height: 40px; border-radius: 11px; background: var(--blue); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 16px;
}
.socie-titlebox { min-width: 0; flex: 1 1 auto; }
.socie-titlebox b { display: block; font-size: 15px; letter-spacing: -.2px; }
.socie-titlebox small { color: var(--muted); font-size: 11px; }
.socie-share {
  flex: 0 0 auto; font-size: 12px; font-weight: 800; color: var(--blue);
  background: var(--blue-soft); border-radius: 999px; padding: 4px 10px;
}
.socie-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.socie-stats div { background: var(--blue-pale); border-radius: 10px; padding: 8px 10px; }
.socie-stats small { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.socie-stats b { font-size: 13.5px; letter-spacing: -.2px; }
.socie-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.socie-open {
  margin-left: auto; color: var(--blue); font-size: 12.5px; font-weight: 700;
}

html[data-theme="dark"] .socie-row .card { background: #121214; }
html[data-theme="dark"] .socie-stats div { background: rgba(255, 255, 255, .04); }
html[data-theme="dark"] .socie-share { background: rgba(61, 220, 106, .16); color: #3ddc6a; }
html[data-theme="dark"] .global-bar { fill: #c6ffb1; }
html[data-theme="dark"] .global-bar-prev { fill: rgba(255, 255, 255, .18); }

@media (max-width: 1100px) { .global-kpis { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px) {
  .global-kpis { grid-template-columns: repeat(2, 1fr); }
  .socie-stats { grid-template-columns: repeat(2, 1fr); }
  .socie-open { margin-left: 0; width: 100%; }
}

/* ---------- Responsive ---------- */

@media (max-height: 560px) {
  .agent-note { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}

.model-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 6px;
}
.model-grid-inline {
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  margin-bottom: 12px;
}
.model-pick { margin: 0; min-width: 0; }
.model-card {
  display: flex; flex-direction: column; gap: 4px;
  width: 100%; max-width: 80px; padding: 4px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
  text-align: left; font: inherit; color: inherit;
}
.model-card.is-on {
  outline: 2px solid var(--blue); outline-offset: 1px;
  border-color: transparent;
}
.model-label {
  display: block; font-size: 9.5px; font-weight: 700;
  letter-spacing: .01em; text-align: center; color: var(--ink);
  line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.model-preview {
  display: flex; flex-direction: column; gap: 2px;
  height: 56px; padding: 4px; border-radius: 4px; background: #fff;
  border: 1px solid #e6eaf0; overflow: hidden;
}
.model-preview i, .model-preview b { display: block; height: 2.5px; border-radius: 1px; background: #94a3b8; }
.mp-top, .mp-due { display: flex; justify-content: space-between; align-items: center; gap: 3px; }
.mp-logo { width: 8px; height: 8px; border-radius: 2px; background: #94a3b8; flex: 0 0 auto; }
.mp-id { width: 22px; flex: 0 0 auto; }
.mp-id i { width: 100%; }
.mp-id i + i { width: 70%; margin-top: 2px; }
.mp-who { display: block; }
.mp-who i { width: 58%; }
.mp-who i + i { width: 40%; margin-top: 2px; }
.mp-row { height: 3px; border-radius: 1px; background: #e8edf3; }
.mp-row.short { width: 62%; }
.mp-due { margin-top: auto; }
.mp-due i { width: 18px; }
.mp-due b { width: 14px; height: 5px; }
.model-azur { padding: 0; background: #fff; }
.model-azur .mp-top { background: #0b3d91; padding: 3px; }
.model-azur .mp-logo { background: #fff; }
.model-azur .mp-id i { background: #d6e4ff; }
.model-azur .mp-who, .model-azur .mp-row, .model-azur .mp-due { margin-left: 3px; margin-right: 3px; }
.model-azur .mp-due b { background: #0b3d91; }
.model-carmin { border-left: 3px solid #b42318; }
.model-carmin .mp-logo { background: #b42318; }
.model-carmin .mp-due b { background: #b42318; }
.model-encre { border-color: #161616; border-radius: 2px; }
.model-encre .mp-top { border-bottom: 1.5px solid #161616; padding-bottom: 2px; }
.model-encre .mp-logo { background: #161616; border-radius: 0; }
.model-encre .mp-due { border-top: 1.5px solid #c4a15a; padding-top: 2px; }
.model-encre .mp-due b { background: #161616; }
.model-sauge { background: #f4faf6; border-color: #c9e6d4; border-radius: 8px; }
.model-sauge .mp-logo { background: #1f7a4d; border-radius: 50%; }
.model-sauge .mp-who { background: #fff; border-radius: 3px; padding: 2px; }
.model-sauge .mp-due b { background: #1f7a4d; }
.model-graphite { padding: 0; background: #1c2026; border-color: #2d3440; }
.model-graphite .mp-top { background: #2d3440; padding: 3px; flex: 0 0 auto; }
.model-graphite .mp-logo { background: #e5e7eb; }
.model-graphite .mp-id i { background: #cbd5e1; }
.model-graphite .mp-who i { background: #94a3b8; }
.model-graphite .mp-row { background: #64748b; }
.model-graphite .mp-due { margin-left: 3px; margin-right: 3px; }
.model-graphite .mp-due i { background: #94a3b8; }
.model-graphite .mp-due b { background: #f8fafc; }
/* Indigo : bandeau + barres contrastées (évite gris clair sur fond #fafafe) */
.model-indigo { padding: 0; border-top: 0; background: #fff; border-color: #c7d2fe; }
.model-indigo .mp-top { background: #4f46e5; padding: 3px; flex: 0 0 auto; }
.model-indigo .mp-logo { background: #fff; border-radius: 2px; }
.model-indigo .mp-id i { background: #c7d2fe; }
.model-indigo .mp-who, .model-indigo .mp-row, .model-indigo .mp-due { margin-left: 3px; margin-right: 3px; }
.model-indigo .mp-who i { background: #818cf8; }
.model-indigo .mp-row { background: #a5b4fc; }
.model-indigo .mp-due i { background: #c7d2fe; }
.model-indigo .mp-due b { background: #4f46e5; }
.model-terra { border-left: 3px solid #b45331; background: linear-gradient(90deg, #f6ebe3 16%, #fff 16%); }
.model-terra .mp-logo { background: #b45331; }
.model-terra .mp-who i { background: #d6b09a; }
.model-terra .mp-row { background: #e7cfc0; }
.model-terra .mp-who, .model-terra .mp-row, .model-terra .mp-due { margin-left: 2px; }
.model-terra .mp-due b { background: #b45331; }
.model-vert { border-left: 3px solid #0f9d6a; background: linear-gradient(90deg, #e9faf2 16%, #fff 16%); }
.model-vert .mp-logo { background: #0f9d6a; }
.model-vert .mp-who i { background: #9adec8; }
.model-vert .mp-row { background: #c8f0e1; }
.model-vert .mp-who, .model-vert .mp-row, .model-vert .mp-due { margin-left: 2px; }
.model-vert .mp-due b { background: #0f9d6a; }
.model-monochrome { border-left: 3px solid #242424; background: linear-gradient(90deg, #f4f4f4 16%, #fff 16%); }
.model-monochrome .mp-logo { background: #242424; }
.model-monochrome .mp-who i { background: #bdbdbd; }
.model-monochrome .mp-row { background: #d9d9d9; }
.model-monochrome .mp-who, .model-monochrome .mp-row, .model-monochrome .mp-due { margin-left: 2px; }
.model-monochrome .mp-due b { background: #242424; }
/* Renfort des thèmes d'origine : barres toujours visibles */
.model-carmin .mp-who i { background: #f0b4ae; }
.model-carmin .mp-row { background: #f5d0cc; }
.model-carmin .mp-id i { background: #e8c4c0; }
.model-encre .mp-who i { background: #9ca3af; }
.model-encre .mp-row { background: #d1d5db; }
.model-sauge .mp-who i { background: #86efac; }
.model-sauge .mp-row { background: #bbf7d0; }
.model-azur .mp-who i { background: #93c5fd; }
.model-azur .mp-row { background: #bfdbfe; }

.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
details.page-actions { position: relative; }
details.page-actions > summary.actions-summary {
  list-style: none; cursor: pointer; user-select: none;
}
details.page-actions > summary.actions-summary::-webkit-details-marker { display: none; }
details.page-actions > .actions-list {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
/* Desktop: le résumé « Actions » est masqué, la liste reste visible. */

.theme-card, .theme-mini {
  width: 100%; text-align: left; cursor: pointer;
  border: 1px solid var(--line); background: #fff; border-radius: 8px;
  font-family: var(--font-body);
}
.theme-card { display: flex; align-items: center; gap: 10px; padding: 12px; }
.theme-card.is-on, .theme-mini.is-on { outline: 2px solid var(--blue); }
.theme-swatch { width: 28px; height: 36px; border-radius: 3px; flex: 0 0 auto; }
.theme-azur .theme-swatch { background: linear-gradient(#0b3d91 40%, #fff 40%); }
.theme-carmin .theme-swatch { background: #fff; border-left: 6px solid #b42318; }
.theme-encre .theme-swatch { background: linear-gradient(#161616 28%, #fff 28%); }
.theme-sauge .theme-swatch { background: #e7f3ea; border: 1px solid #1f7a4d; }
.theme-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.theme-mini { padding: 8px 12px; font-weight: 700; font-size: 13px; }
.theme-mini.theme-azur { color: #0b3d91; }
.theme-mini.theme-carmin { color: #b42318; }
.theme-mini.theme-encre { color: #161616; }
.theme-mini.theme-sauge { color: #1f7a4d; }

.sheet {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 28px 32px; box-shadow: var(--shadow-sm);
}
.sheet-head, .sheet-foot { display: flex; justify-content: space-between; gap: 18px; }
.sheet-brand { display: flex; gap: 14px; align-items: flex-start; }
.sheet-logo { width: 64px; height: 64px; object-fit: contain; background: #fff; }
.sheet h2, .sheet h3 { margin: 0 0 4px; font-family: var(--font-head); }
.sheet p { margin: 0; font-size: 13px; line-height: 1.45; }
.sheet-kicker { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.sheet-kind { font-family: var(--font-head); font-size: 28px; letter-spacing: -.4px; }
.sheet-num { font-weight: 700; }
.sheet-meta { text-align: right; }
.sheet-client { margin: 22px 0; }
.sheet-table { width: 100%; border-collapse: collapse; }
.sheet-table th, .sheet-table td { padding: 10px 8px; text-align: left; }
.sheet-table .num { text-align: right; }
.sheet-foot { align-items: flex-end; margin-top: 18px; gap: 18px; }
.sheet-legal { flex: 1; min-width: 0; color: var(--muted); }
.sheet-legal p { font-size: 11.5px; line-height: 1.45; margin: 0 0 4px; }
.sheet-due b { font-family: var(--font-head); font-size: 26px; }

.sheet-azur { overflow: hidden; padding: 0; }
.sheet-azur .sheet-head { background: #0b3d91; color: #fff; padding: 26px 32px; }
.sheet-azur .sheet-kicker, .sheet-azur .sheet-head p { color: #d6e4ff; }
.sheet-azur .sheet-logo { border-radius: 8px; padding: 4px; }
.sheet-azur .sheet-client, .sheet-azur .sheet-table, .sheet-azur .sheet-foot { margin-left: 32px; margin-right: 32px; }
.sheet-azur .sheet-client { margin-top: 22px; }
.sheet-azur .sheet-table th { color: #0b3d91; border-bottom: 2px solid #0b3d91; }
.sheet-azur .sheet-due b { color: #0b3d91; }
.sheet-azur .sheet-foot { padding-bottom: 26px; }

.sheet-carmin { border-left: 8px solid #b42318; }
.sheet-carmin .sheet-kind, .sheet-carmin .sheet-due b, .sheet-carmin .sheet-kicker { color: #b42318; }
.sheet-carmin .sheet-table th { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: #7a1d16; }
.sheet-carmin .sheet-table td { border-bottom: 1px solid #f3d0cc; }
.sheet-carmin .sheet-due { background: #b42318; color: #fff; padding: 10px 14px; border-radius: 6px; }
.sheet-carmin .sheet-due b { color: #fff; }

.sheet-encre { border-radius: 0; border-color: #161616; }
.sheet-encre .sheet-head { border-bottom: 3px solid #161616; padding-bottom: 16px; }
.sheet-encre .sheet-kind { font-weight: 400; letter-spacing: .18em; text-transform: uppercase; font-size: 14px; }
.sheet-encre .sheet-num { font-size: 22px; font-family: var(--font-head); }
.sheet-encre .sheet-table th { border-bottom: 1px solid #161616; font-weight: 500; }
.sheet-encre .sheet-table td { border-bottom: 1px solid #ececec; }
.sheet-encre .sheet-due { border-top: 3px solid #c4a15a; padding-top: 8px; }
.sheet-encre .sheet-due b { font-weight: 500; }

.sheet-sauge { background: #f4faf6; border-color: #c9e6d4; border-radius: 18px; }
.sheet-sauge .sheet-logo { border-radius: 50%; background: #fff; }
.sheet-sauge .sheet-kicker { color: #1f7a4d; }
.sheet-sauge .sheet-client { background: #fff; border-radius: 12px; padding: 14px 16px; }
.sheet-sauge .sheet-table th { color: #1f7a4d; }
.sheet-sauge .sheet-due b { color: #1f7a4d; }

.sheet-graphite { overflow: hidden; padding: 0; background: #1c2026; color: #e8eaed; border-color: #2d3440; }
.sheet-graphite .sheet-head { background: #2d3440; color: #fff; padding: 26px 32px; }
.sheet-graphite .sheet-kicker, .sheet-graphite .sheet-head p { color: #9aa4b2; }
.sheet-graphite .sheet-client, .sheet-graphite .sheet-table, .sheet-graphite .sheet-foot { margin-left: 32px; margin-right: 32px; }
.sheet-graphite .sheet-client { margin-top: 22px; }
.sheet-graphite .sheet-table th { color: #c5cad3; border-bottom: 2px solid #4b5563; }
.sheet-graphite .sheet-table td { border-bottom: 1px solid #2d3440; color: #e8eaed; }
.sheet-graphite .sheet-due b { color: #fff; }
.sheet-graphite .sheet-foot { padding-bottom: 26px; color: #9aa4b2; }

.sheet-indigo { border-top: 5px solid #4f46e5; background: #fafafe; }
.sheet-indigo .sheet-kind, .sheet-indigo .sheet-due b, .sheet-indigo .sheet-kicker { color: #4f46e5; }
.sheet-indigo .sheet-table th { color: #3730a3; border-bottom: 1px solid #c7d2fe; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.sheet-indigo .sheet-table td { border-bottom: 1px solid #eef0ff; }
.sheet-indigo .sheet-client { border-left: 3px solid #4f46e5; padding-left: 12px; }

.sheet-terra { border-left: 0; padding: 0; overflow: hidden; background: #fffaf6; }
.sheet-terra .sheet-head { display: grid; grid-template-columns: 72px 1fr auto; gap: 16px; background: #f6ebe3; padding: 22px 28px 22px 0; align-items: start; }
.sheet-terra .sheet-brand { padding-left: 0; }
.sheet-terra .sheet-brand::before {
  content: ""; display: block; width: 18px; background: #b45331; border-radius: 0 8px 8px 0; margin-right: 14px; align-self: stretch;
}
.sheet-terra .sheet-brand { display: flex; }
.sheet-terra .sheet-kind, .sheet-terra .sheet-due b, .sheet-terra .sheet-kicker { color: #b45331; }
.sheet-terra .sheet-client, .sheet-terra .sheet-table, .sheet-terra .sheet-foot { margin-left: 36px; margin-right: 28px; }
.sheet-terra .sheet-client { margin-top: 18px; background: #fff; border: 1px solid #ead7cb; border-radius: 10px; padding: 12px 14px; }
.sheet-terra .sheet-table th { color: #9a3412; border-bottom: 2px solid #b45331; }
.sheet-terra .sheet-foot { padding-bottom: 24px; }

.theme-graphite .theme-swatch { background: linear-gradient(#1c2026 45%, #9aa4b2 45%); }
.theme-indigo .theme-swatch { background: linear-gradient(#4f46e5 18%, #fafafe 18%); }
.theme-terra .theme-swatch { background: #fffaf6; border-left: 6px solid #b45331; }
.theme-mini.theme-graphite { color: #1c2026; }
.theme-mini.theme-indigo { color: #4f46e5; }
.theme-mini.theme-terra { color: #b45331; }

.sheet-stage { margin-top: 8px; }
.sheet-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.model-card.is-locked { opacity: .55; cursor: pointer; }
.model-lock {
  display: block; font-size: 9px; line-height: 1.2; text-align: center;
  color: var(--blue); font-weight: 700;
}
.plan-banner, .plan-banner-warn {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; padding: 14px 16px; margin-bottom: 16px;
  border-radius: 16px; background: var(--blue-pale); border: 1px solid var(--blue-soft);
}
.plan-banner p, .plan-banner-warn p { margin: 0; }
.plan-banner-warn { background: var(--amber-soft); border-color: #e6d48a; }

.plan.is-current { outline: 2px solid var(--blue); }
.agent-plan-note { margin: 12px 0 0; font-size: 13px; }
.compare td, .compare th { white-space: nowrap; }
.compare td:first-child, .compare th:first-child { white-space: normal; }

/* Aminia — sélecteur Vocal | Chat (matériau glass-panel) */
.agent-chooser {
  position: fixed;
  right: 22px;
  bottom: 92px;
  z-index: var(--z-agent-modal);
  width: min(320px, calc(100vw - 28px));
  padding: 18px 18px 16px;
}
.agent-chooser[hidden] { display: none; }
.agent-chooser-title {
  margin: 0 28px 14px 0;
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 650;
  color: var(--ink);
}
.agent-chooser-actions { display: flex; gap: 10px; }
.agent-chooser-actions .btn { flex: 1; justify-content: center; }
.agent-chooser-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.agent-chooser-close:hover { color: var(--ink); }

/* Aminia — panneau chat */
.agent-chat {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: var(--z-agent-modal);
  width: min(420px, calc(100vw - 24px));
  max-height: min(640px, calc(100vh - 36px));
}
.agent-chat[hidden] { display: none; }
.agent-chat-card {
  display: flex;
  flex-direction: column;
  height: min(640px, calc(100vh - 36px));
  overflow: hidden;
}
.agent-chat-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--line);
}
.agent-chat-head h2 {
  margin: 0;
  font-size: 17px;
  font-family: var(--font-head);
}
.agent-chat-sub { margin: 4px 0 0; color: var(--muted); font-size: 12.5px; }
.agent-chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: linear-gradient(180deg, transparent, rgba(0, 65, 146, .03));
}
.agent-chat-empty { margin: auto; color: var(--muted); text-align: center; font-size: 13.5px; }
.agent-chat-bubble {
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.agent-chat-bubble p { margin: 0; }
.agent-chat-bubble--user {
  align-self: flex-end;
  background: var(--blue);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.agent-chat-bubble--assistant {
  align-self: flex-start;
  background: var(--bg-2, #f3f6fb);
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
}
.agent-chat-error {
  margin: 0 16px 8px;
  color: #b42318;
  font-size: 12.5px;
}
.agent-chat-form {
  display: flex;
  gap: 8px;
  padding: 12px 14px 14px;
  border-top: 1px solid var(--line);
}
.agent-chat-form input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  background: var(--bg, #fff);
  color: var(--ink);
}
.agent-chat-form input:focus {
  outline: 2px solid var(--blue-2);
  outline-offset: 1px;
}
.agent-chat-page {
  max-width: 720px;
  margin: 0 auto 40px;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}
.agent-chat-page .agent-chat-log { min-height: 320px; }
.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;
}

/* Synthèse facturation */
.inv-dash-cards .company h3 { margin: 0 0 4px; font-size: 16px; }
.inv-dash-kpis .kpi .v { font-size: 26px; }

/* Tickets de caisse */
.ticket-filters {
  max-width: 1040px;
  margin-left: auto;
  margin-right: auto;
  padding: 22px;
  text-align: center;
}
.ticket-filters .form-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  gap: 16px;
}
.ticket-filters .form-grid > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 0 1 180px;
  min-width: 150px;
}
.ticket-filters .form-grid > .tf-span {
  flex: 0 1 180px;
}
.ticket-filters label {
  margin: 0;
  text-align: center;
}
.ticket-filter-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.ticket-ocr-raw {
  white-space: pre-wrap;
  font-size: 12px;
  max-height: 320px;
  overflow: auto;
  background: var(--bg-2, #f5f7fb);
  padding: 12px;
  border-radius: 8px;
}
.form-error { color: #b42318; font-size: 12.5px; margin: 4px 0 0; }

.ticket-upload-form { max-width: 560px; margin: 0 auto; }
.ticket-camera-block { margin-bottom: 18px; }
.ticket-camera-hint { margin: 0 0 10px; font-weight: 600; }
.ticket-camera-btn {
  width: 100%;
  min-height: 52px;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  margin: 0;
}
/* label.btn doit rester un vrai bouton primaire (label { color: ink } sinon gagne) */
label.btn,
label.ticket-camera-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0;
  margin-bottom: 0;
  cursor: pointer;
}
label.btn.btn-primary,
label.ticket-camera-btn.btn-primary {
  background: var(--blue);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 0 rgba(0, 65, 146, .15);
}
label.btn.btn-primary:hover,
label.ticket-camera-btn.btn-primary:hover {
  background: #003572;
  color: #fff;
}
.form-stack label.btn.btn-primary,
.ticket-form label.btn.btn-primary,
.ticket-form label.ticket-camera-btn {
  display: inline-flex;
  color: #fff;
  background: var(--blue);
  font-size: 16px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
}
.ticket-camera-block {
  position: relative;
  overflow: hidden;
  max-width: 100%;
}
.ticket-camera-input {
  position: absolute !important;
  left: 0 !important;
  top: 0 !important;
  width: 1px !important;
  height: 1px !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none;
}

/* Cartes société — pastilles de couleur distinctes */
.company .co-avatar {
  grid-column: 1;
  grid-row: 1 / span 2;
  flex: 0 0 44px; width: 44px; height: 44px; border-radius: 14px;
  display: grid; place-items: center;
  font-family: var(--font-head); font-weight: 700; font-size: 17px;
  color: #fff; letter-spacing: -.02em;
  background: var(--co-accent, var(--blue));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18), 0 8px 18px -12px rgba(0, 0, 0, .55);
}
.company.co-c0 { --co-accent: #0b3d91; }
.company.co-c1 { --co-accent: #ca1c60; }
.company.co-c2 { --co-accent: #1f7a4d; }
.company.co-c3 { --co-accent: #b45331; }
.company.co-c4 { --co-accent: #4f46e5; }
.company.co-c5 { --co-accent: #0e7490; }
.company.co-c6 { --co-accent: #a16207; }
.company.co-c7 { --co-accent: #7c3aed; }
.company.co-c8 { --co-accent: #be123c; }
.company.co-c9 { --co-accent: #334155; }
.company.co-c0 .co-avatar,
.company.co-c1 .co-avatar,
.company.co-c2 .co-avatar,
.company.co-c3 .co-avatar,
.company.co-c4 .co-avatar,
.company.co-c5 .co-avatar,
.company.co-c6 .co-avatar,
.company.co-c7 .co-avatar,
.company.co-c8 .co-avatar,
.company.co-c9 .co-avatar { background: var(--co-accent); color: #fff; }

/* ——— Formulaire ticket de caisse (création / édition) ——— */
.ticket-form { max-width: 920px; padding: 0; overflow: hidden; }
.ticket-form-layout { display: flex; flex-direction: column; gap: 0; }
.ticket-section {
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}
.ticket-section:last-of-type { border-bottom: 0; }
.ticket-section-head { margin-bottom: 14px; }
.ticket-section-head h2 {
  margin: 0 0 4px;
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--ink);
}
.ticket-section-head .sub { margin: 0; font-size: 13px; }
.ticket-form .field { margin-bottom: 14px; }
.ticket-form .field:last-child { margin-bottom: 0; }
.ticket-form label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--ink);
}
.ticket-form .req { color: var(--red, #b42318); margin-left: 2px; }
.ticket-form .form-control,
.ticket-form input,
.ticket-form select,
.ticket-form textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 44px;
  font-size: 16px;
  padding: 10px 12px;
  border: 1px solid var(--line, #d5dbe3);
  border-radius: var(--radius-sm, 6px);
  background: #fff;
  color: var(--ink);
}
.ticket-form textarea.form-control,
.ticket-form textarea { min-height: 96px; resize: vertical; }
.ticket-form input[type="file"] {
  min-height: 0;
  padding: 8px 0;
  border: 0;
  background: transparent;
}
.ticket-form .field.has-error .form-control,
.ticket-form .field.has-error input,
.ticket-form .field.has-error select,
.ticket-form .field.has-error textarea {
  border-color: #f04438;
  background: #fff8f7;
}
.ticket-form .field-hint {
  margin: 6px 0 0;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.4;
}
.ticket-form .form-errors {
  margin: 0;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  border-top: 0;
}
.ticket-form .form-errors ul { margin: 8px 0 0; padding-left: 18px; }
.ticket-form .form-errors a { color: inherit; text-decoration: underline; }
.ticket-fields-2,
.ticket-fields-3 {
  display: grid;
  gap: 14px 18px;
  grid-template-columns: 1fr;
}
.ticket-ht {
  margin: 12px 0 0;
  padding: 10px 12px;
  background: var(--blue-soft, #eef4ff);
  border-radius: var(--radius-sm, 6px);
  font-size: 14px;
  color: var(--ink);
}
.ticket-ht strong { font-variant-numeric: tabular-nums; }
.form-actions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

/* Éditeur de lignes de facture */
.invoice-lines-card { padding: 0; overflow: hidden; margin-top: 20px; }
.invoice-lines-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px 8px;
}
.invoice-lines-head h2 { margin: 0 0 4px; font-size: 18px; }
.invoice-lines-head .sub { margin: 0; font-size: 13px; }
.invoice-lines-card .form-errors { margin: 4px 22px 12px; }
.invoice-lines-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.invoice-lines-table { min-width: 960px; font-size: 13px; }
.invoice-lines-table th { padding: 10px 8px; }
.invoice-lines-table td {
  padding: 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.invoice-lines-table input,
.invoice-lines-table select {
  min-height: 40px;
  padding: 8px 10px;
  font-size: 14px;
  border-radius: 9px;
}
.invoice-lines-table .line-product { width: 190px; min-width: 170px; }
.invoice-lines-table .line-description { min-width: 240px; }
.invoice-lines-table .line-qty,
.invoice-lines-table .line-price,
.invoice-lines-table .line-vat { width: 96px; }
.invoice-lines-table .line-total {
  padding-top: 20px;
  vertical-align: middle;
  font-weight: 700;
  white-space: nowrap;
}
.invoice-lines-table .line-remove { width: 92px; text-align: center; vertical-align: middle; padding-top: 16px; }
.line-remove-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  background: #fff;
  color: var(--red);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.line-remove-btn:hover { background: var(--red-soft); }
.line-delete {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  font-size: 11.5px;
  color: var(--red);
  cursor: pointer;
}
.line-delete input { width: 16px; min-height: 0; margin: 0; }
.invoice-line-row.is-deleted { opacity: .45; }
.invoice-line-row.is-deleted td { background: var(--red-soft); }
.invoice-lines-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 22px 18px;
  border-top: 1px solid var(--line);
}
.invoice-preview-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-left: auto;
  font-size: 13px;
  color: var(--muted);
}
.invoice-preview-totals b { color: var(--ink); font-variant-numeric: tabular-nums; }
.invoice-preview-ttc { padding-left: 14px; border-left: 1px solid var(--line); }
.sheet-no-lines { padding: 20px 12px !important; text-align: center; color: var(--muted); }
.sheet-no-lines strong { display: block; margin-bottom: 4px; color: inherit; }
.sheet-no-lines span { display: block; font-size: 12px; }
.ticket-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  padding: 16px 22px;
  border-top: 1px solid var(--line);
  background: #fafbfd;
}


/* ==========================================================================
   MOBILE — breakpoints unifiés : 768px (principal) · 480px (petit)
   Aligné JS : matchMedia("(max-width: 768px)") dans static/js/app.js
   Desktop (>768px) : inchangé (sidebar sticky, topbar, grilles).
   ========================================================================== */

.mobile-only { display: none !important; }
.desktop-only { display: block; }

@media (min-width: 769px) {
  details.page-actions > summary.actions-summary { display: none; }
  details.page-actions > .actions-list { display: flex !important; }

  .ticket-form-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .ticket-section { border-right: 1px solid var(--line); }
  .ticket-section:nth-child(2n) { border-right: 0; }
  .ticket-fields-2 { grid-template-columns: 1fr 1fr; }
  .ticket-fields-3 { grid-template-columns: 1fr 1fr 1fr; }
  .ticket-section:first-child,
  .ticket-section:last-child {
    grid-column: 1 / -1;
    border-right: 0;
  }
}

@media (max-width: 768px), (pointer: coarse) {
  .mobile-only { display: block !important; }
  .desktop-only { display: none !important; }
  .mobile-only.btn,
  a.mobile-only.btn,
  label.mobile-only.btn,
  .mobile-only.ticket-camera-btn { display: inline-flex !important; }
}

@media (max-width: 980px) {
  .pricing-section .pricing { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  /* Landing / marketing */
  .g4 { grid-template-columns: 1fr 1fr; }
  .g2 { grid-template-columns: 1fr; }
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .features, .pricing, .quick-grid { grid-template-columns: 1fr; }
  .pricing-section .pricing { gap: 28px; }
  .pricing-section .plan { padding: 26px 20px 22px; }
  .pricing-section .plan .btn { min-height: 52px; border-radius: 16px; }
  .pricing-section .price { font-size: 40px; }
  .nav-search { display: none; }
  .nav-links a:not(.btn) { display: none; }
  h1 { font-size: 42px; }
  .mock { transform: none; }
  .float-card { display: none; }
  .quick { margin-top: 24px; }
  section { padding: 54px 0; }
  .voice { padding: 58px 0; }
  .voice-grid { grid-template-columns: 1fr; gap: 36px; }
  .voice-stage { min-height: 0; }
  .voice-chat { min-height: 250px; }
  .cta-band { padding: 34px 26px; }
  .foot-main { grid-template-columns: 1fr 1fr; }
  .nav-in { height: 72px; }
  .logo-text small { font-size: 10px; }
  h2 { font-size: 28px; }
  .voice h2 { font-size: 34px; }
  .voice-orb { width: 150px; height: 150px; }
  .voice-core { width: 100px; height: 100px; }
  .voice-msg { font-size: 13px; }

  /* Grilles cockpit */
  .g3, .g4, .form-grid, .kpi-grid { grid-template-columns: 1fr; }
  .inv-dash-kpis, .inv-dash-cards { grid-template-columns: 1fr !important; }
  .companies { grid-template-columns: 1fr; }
  .model-grid, .model-grid-inline {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }
  .model-card { max-width: none; min-height: 88px; padding: 8px; border-radius: 14px; }
  .model-preview { height: 56px; padding: 4px; }
  .model-label { font-size: 12px; white-space: normal; }
  .sheet { padding: 16px; border-radius: 16px; }
  .sheet-head, .sheet-foot { flex-direction: column; align-items: stretch; }
  .sheet-meta, .sheet-kind { text-align: left; }
  .sheet-kind { font-size: 22px; }
  .sheet-azur .sheet-head, .sheet-graphite .sheet-head { padding: 16px; }
  .sheet-azur .sheet-client, .sheet-azur .sheet-table, .sheet-azur .sheet-foot,
  .sheet-graphite .sheet-client, .sheet-graphite .sheet-table, .sheet-graphite .sheet-foot,
  .sheet-terra .sheet-client, .sheet-terra .sheet-table, .sheet-terra .sheet-foot {
    margin-left: 12px; margin-right: 12px;
  }
  .sheet-table { min-width: 560px; }
  .sheet-due b { font-size: 22px; }
  .plan-banner, .plan-banner-warn { align-items: stretch; }
  .plan-banner .btn, .plan-banner-warn .btn { width: 100%; }

  /* Shell */
  .shell {
    grid-template-columns: 1fr;
    padding-top: calc(var(--m-header-h) + env(safe-area-inset-top, 0px));
    padding-bottom: calc(var(--m-footer-h) + env(safe-area-inset-bottom, 0px));
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
  }
  html, body { overflow-x: hidden; max-width: 100%; }
  .main { min-width: 0; max-width: 100%; overflow-x: hidden; }
  .topbar { display: none; }
  .top-mail, .top-site { display: none; }

  /* Header fixe */
  .m-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: var(--z-m-header);
    height: calc(var(--m-header-h) + env(safe-area-inset-top, 0px));
    padding: env(safe-area-inset-top, 0px) var(--space-3) 0;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
  }
  .m-nav-toggle {
    flex: 0 0 auto;
    width: var(--tap); height: var(--tap);
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--surface); color: var(--ink); cursor: pointer;
  }
  .m-nav-toggle-bars,
  .m-nav-toggle-bars::before,
  .m-nav-toggle-bars::after {
    display: block; width: 18px; height: 2px; background: currentColor; border-radius: 1px;
    position: relative;
  }
  .m-nav-toggle-bars::before,
  .m-nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
  .m-nav-toggle-bars::before { top: -6px; }
  .m-nav-toggle-bars::after { top: 6px; }
  .m-header-logo {
    display: inline-flex; align-items: center; gap: var(--space-2);
    color: var(--ink); text-decoration: none; margin-left: auto;
    min-height: var(--tap); padding: var(--space-1) 2px;
  }
  .m-header-logo:hover { text-decoration: none; color: var(--ink); }
  .m-header-logo img, .m-header-logo .product-logo { width: 32px; height: 32px; max-width: 32px; border-radius: var(--radius-sm); object-fit: contain; background: #fff; flex: 0 0 32px; }
  .m-header-brand { line-height: 1.1; text-align: right; }
  .m-company-logo {
    width: 32px; height: 32px; max-width: 32px; flex: 0 0 32px;
    border-radius: var(--radius-sm); object-fit: contain; background: #fff;
    border: 1px solid var(--line); padding: 2px;
  }
  .m-header-brand b {
    display: block; font-family: var(--font-head); font-size: var(--text-sm); color: var(--blue);
    max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .m-header-brand small {
    display: block; font-size: 10px; color: var(--muted);
    text-transform: uppercase; letter-spacing: .5px;
  }

  .m-backdrop {
    display: block;
    position: fixed; inset: 0;
    z-index: var(--z-m-backdrop);
    background: rgba(15, 23, 42, .45);
    border: 0; padding: 0; margin: 0; cursor: pointer;
  }
  .m-backdrop[hidden] { display: none !important; }

  /* Drawer (= sidebar) : flex, nav scrollable, pied épinglé */
  .sidebar {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: min(86vw, 320px);
    height: 100dvh;
    max-height: 100dvh;
    z-index: var(--z-m-drawer);
    transform: translateX(-105%);
    transition: transform .22s var(--ease);
    overflow: hidden;
    padding: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    border-right: 1px solid var(--line);
    border-top: 3px solid var(--blue);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    visibility: hidden;
    pointer-events: none;
  }
  body.nav-open .sidebar {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }
  body.nav-open { overflow: hidden; touch-action: none; }

  .m-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    flex: 0 0 auto;
    padding: calc(var(--space-2) + env(safe-area-inset-top, 0px)) var(--space-3) var(--space-2);
    border-bottom: 1px solid var(--line);
    background: var(--surface);
    z-index: var(--z-base);
  }
  .m-drawer-title { font-family: var(--font-head); font-weight: 700; font-size: 15px; }
  .m-drawer-close {
    width: var(--tap); height: var(--tap);
    border: 0; background: transparent; font-size: 28px; line-height: 1;
    color: var(--muted); cursor: pointer; border-radius: var(--radius);
  }
  .m-drawer-close:hover { color: var(--ink); background: var(--blue-pale); }
  .sidebar .brand { min-height: 0; padding: var(--space-4); flex: 0 0 auto; }
  .sidebar .brand-text { display: block; }
  .nav-sec { display: block; }
  /* Zone scrollable = tout sauf le pied */
  .sidebar-nav-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .sidebar-foot {
    display: block;
    flex: 0 0 auto;
    margin-top: 0;
    border-top: 1px solid var(--line);
    background: var(--surface);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .side-link {
    width: calc(100% - 20px); margin: 2px 10px; padding: var(--space-3);
    font-size: 15px; min-height: var(--tap);
  }

  /* Footer fixe — dock flottant en verre, pastilles circulaires */
  .m-footer {
    display: flex;
    justify-content: space-around;
    align-items: center;
    position: fixed;
    left: max(14px, env(safe-area-inset-left, 0px));
    right: max(14px, env(safe-area-inset-right, 0px));
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    z-index: var(--z-m-footer);
    height: auto;
    padding: 7px 8px;
    gap: 2px;
    background: rgba(255, 255, 255, .74);
    border: 1px solid rgba(255, 255, 255, .38);
    border-radius: 999px;
    box-shadow: var(--glass-shadow);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    backdrop-filter: blur(18px) saturate(180%);
  }
  .m-footer-btn {
    position: relative;
    flex: 1 1 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; min-height: 56px; padding: 4px 2px;
    font-size: 10px; font-weight: 700; letter-spacing: .1px; color: var(--muted);
    text-decoration: none; border-radius: 999px; background: transparent; border: none;
    font-family: inherit;
    transition: color .18s var(--ease), background .18s var(--ease);
  }
  .m-footer-btn:hover { text-decoration: none; color: var(--blue); background: transparent; }
  .m-footer-ico {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 30px; border-radius: 14px;
    color: var(--ink-2);
    background: transparent;
    transition: transform .2s var(--ease), background .2s var(--ease), color .2s;
  }
  .m-footer-ico .icon { width: 22px; height: 22px; }
  .m-footer-btn.active { color: var(--blue); }
  .m-footer-btn.active .m-footer-ico {
    color: #fff;
    background: linear-gradient(135deg, var(--blue) 0%, #2563eb 58%, #4f8dff 100%);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, .35),
      0 8px 20px -6px rgba(37, 99, 235, .55);
    transform: translateY(-1px);
  }
  .m-footer-btn:focus-visible { outline: none; }
  .m-footer-btn:focus-visible .m-footer-ico {
    box-shadow: 0 0 0 3px rgba(37, 99, 235,.28), 0 6px 16px -8px rgba(0, 65, 146, .45);
  }

  /* Contenu — réserve footer + barre actions + FAB */
  .content {
    padding: var(--space-4);
    padding-bottom: calc(
      var(--space-5)
      + var(--m-footer-h)
      + var(--m-fab-h)
      + env(safe-area-inset-bottom, 0px)
    );
    max-width: 100%;
    overflow-x: hidden;
  }
  .shell:has(details.page-actions) .content,
  .shell:has(a.btn.page-actions) .content {
    padding-bottom: calc(
      var(--space-5)
      + var(--m-footer-h)
      + var(--m-action-h)
      + var(--m-fab-h)
      + env(safe-area-inset-bottom, 0px)
    );
  }
  .shell:has(div.page-actions) .content {
    padding-bottom: calc(
      var(--space-5)
      + var(--m-footer-h)
      + var(--m-action-bar-h)
      + var(--m-fab-h)
      + env(safe-area-inset-bottom, 0px)
    );
  }
  .content, .main, .card, .form-stack, .ticket-form, .page-head { max-width: 100%; }
  .content h1 { font-size: var(--text-2xl); }
  .page-head {
    flex-direction: column; align-items: stretch; gap: var(--space-3);
    margin-bottom: var(--space-4);
    /* pas de transform / animation ici : descendants fixed */
    opacity: 1 !important;
    transform: none !important;
  }
  .page-head.reveal { opacity: 1 !important; }
  .kpi, .kpi.reveal { opacity: 1 !important; transform: none !important; }
  .page-head .btn { width: 100%; justify-content: center; min-height: var(--tap); }

  /* Tables : scroll dans la carte, 1re colonne sticky, hint de défilement */
  .card, .card-tight {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    background:
      linear-gradient(90deg, var(--surface) 60%, transparent) left center / 24px 100% no-repeat local,
      linear-gradient(270deg, var(--surface) 60%, transparent) right center / 24px 100% no-repeat local,
      radial-gradient(farthest-side at 0 50%, rgba(15, 23, 42, .14), transparent) left center / 12px 100% no-repeat scroll,
      radial-gradient(farthest-side at 100% 50%, rgba(15, 23, 42, .14), transparent) right center / 12px 100% no-repeat scroll,
      var(--surface);
  }
  .card table { min-width: 520px; width: 100%; }
  .card table th:first-child,
  .card table td:first-child {
    position: sticky;
    left: 0;
    z-index: var(--z-base);
    background: var(--surface);
    box-shadow: 4px 0 8px -6px rgba(15, 23, 42, .28);
  }
  .card table thead th:first-child { background: var(--blue-pale); z-index: var(--z-base); }
  .num, td.num, th.num { white-space: nowrap; font-variant-numeric: tabular-nums; }

  /* Formulaires */
  button, .btn, a, input, select, textarea { touch-action: manipulation; }
  input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
  select, textarea, .form-control {
    font-size: 16px; /* iOS : évite le zoom auto */
    min-height: var(--tap);
    width: 100%;
    max-width: 100%;
  }
  textarea { min-height: 96px; }
  input[type="checkbox"], input[type="radio"] {
    width: auto; min-width: var(--tap); min-height: var(--tap);
  }
  input[type="file"]:not(.ticket-camera-input) {
    min-height: 0; padding: var(--space-2) 0; max-width: 100%;
  }
  input.ticket-camera-input {
    width: 1px !important;
    min-height: 0 !important;
    max-width: 1px !important;
  }
  .form-stack .btn.form-submit,
  .form-stack button[type="submit"],
  .card form .btn.btn-primary[type="submit"] {
    width: 100%; min-height: 48px; justify-content: center; margin-top: var(--space-2);
  }
  .card form .btn + .btn,
  .form-stack .btn + .btn { width: 100%; }

  .ticket-form { max-width: 100%; border-radius: 0; overflow-x: hidden; }
  .ticket-section { padding: var(--space-4); max-width: 100%; }
  .ticket-form-actions,
  .form-actions-bar {
    position: sticky;
    bottom: calc(var(--m-footer-h) + env(safe-area-inset-bottom, 0px));
    z-index: var(--z-page-actions);
    display: flex; flex-wrap: wrap; gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    box-shadow: 0 -4px 16px rgba(15, 23, 42, .08);
    background: #fafbfd;
    border-top: 1px solid var(--line);
    margin-top: var(--space-4);
  }
  .ticket-form-actions .btn,
  .form-actions-bar .btn { flex: 1 1 auto; min-height: var(--tap); justify-content: center; width: auto; }
  .ticket-form-actions .btn-primary,
  .form-actions-bar .btn-primary { flex: 2 1 auto; }

  .ticket-filters {
    padding: 14px 14px 12px !important;
    background: var(--surface) !important;
    border-radius: 16px !important;
  }
  .ticket-filters .form-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 10px 10px !important;
    align-items: end !important;
  }
  .ticket-filters .form-grid > div {
    display: flex !important;
    flex-direction: column !important;
    gap: 5px !important;
  }
  .ticket-filters label {
    font-size: 11px !important;
    font-weight: 700 !important;
    letter-spacing: .02em;
    color: var(--muted) !important;
    margin-bottom: 2px !important;
  }
  .ticket-filters input,
  .ticket-filters select {
    width: 100% !important;
    min-height: 42px !important;
    padding: 8px 10px !important;
    border: 1px solid var(--line-2) !important;
    border-radius: 11px !important;
    font-size: 14px !important;
    transition: all 0.2s ease !important;
  }
  .ticket-filters input:focus,
  .ticket-filters select:focus {
    border-color: var(--blue-2) !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235,0.1) !important;
    outline: none !important;
  }
  /* Le statut se place sous la categorie ; boutons en ligne : Filtrer large
     + Reinitialiser compact, une seule rangee. */
  .ticket-filters .form-grid > .tf-span,
  .ticket-filters .form-grid > div:nth-child(5) {
    grid-column: 1 / -1;
  }
  .ticket-filters .ticket-filter-actions {
    margin-top: 12px !important;
    display: flex !important;
    gap: 10px !important;
  }
  .ticket-filters .ticket-filter-actions .btn {
    min-height: 46px; margin: 0;
  }
  .ticket-filters .ticket-filter-actions .btn-primary {
    flex: 2 1 auto;
  }
  .ticket-filters .ticket-filter-actions .btn-ghost {
    flex: 1 1 auto;
  }

  /* page-actions — pleine largeur au-dessus du footer ; menu VERS LE HAUT */
  details.page-actions, .page-actions {
    position: fixed;
    z-index: var(--z-page-actions);
    left: var(--space-3); right: var(--space-3);
    width: auto;
    max-width: none;
    box-sizing: border-box;
    bottom: calc(var(--space-3) + var(--m-footer-h) + env(safe-area-inset-bottom, 0px));
    display: block; margin: 0;
  }
  a.btn.page-actions {
    position: fixed;
    z-index: var(--z-page-actions);
    left: var(--space-3); right: var(--space-3);
    width: auto;
    max-width: none;
    box-sizing: border-box;
    bottom: calc(var(--space-3) + var(--m-footer-h) + env(safe-area-inset-bottom, 0px));
    min-height: 46px; padding: 10px var(--space-2); font-size: var(--text-sm);
    box-shadow: var(--shadow);
  }
  details.page-actions > summary.actions-summary {
    display: flex; align-items: center; justify-content: center;
    width: 100%; min-height: 46px; margin: 0;
    box-shadow: var(--shadow);
  }
  details.page-actions > .actions-list {
    display: none;
    flex-direction: column;
    gap: var(--space-2);
    position: absolute;
    left: 0; right: 0;
    bottom: calc(100% + 8px);
    max-height: min(50vh, 340px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0;
    padding: 10px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
  }
  details.page-actions[open] > .actions-list { display: flex; }
  details.page-actions[open] > .actions-list .btn {
    width: 100%; min-height: var(--tap); justify-content: center;
  }
  div.page-actions {
    left: 0; right: 0;
    bottom: calc(var(--m-footer-h) + env(safe-area-inset-bottom, 0px));
    display: flex; gap: var(--space-2); flex-wrap: nowrap;
    padding: 10px var(--space-3);
    background: var(--surface); border-top: 1px solid var(--line);
    box-shadow: 0 -8px 24px rgba(8, 22, 45, .12); border-radius: 0;
  }
  div.page-actions .btn {
    flex: 1 1 0; min-width: 0; min-height: 46px;
    padding: 10px var(--space-2); font-size: var(--text-sm);
  }
  /* La barre Aminia se place au-dessus des actions : on ne masque plus les boutons. */
  body.agent-open:has(div.page-actions) .agent-panel {
    bottom: calc(var(--m-footer-h) + var(--m-action-bar-h));
  }
  body.agent-open:has(details.page-actions) .agent-panel,
  body.agent-open:has(a.btn.page-actions) .agent-panel {
    bottom: calc(var(--m-footer-h) + var(--m-action-h) + var(--m-fab-gap));
  }
  body.agent-open .main {
    padding-bottom: calc(var(--m-footer-h) + 118px + env(safe-area-inset-bottom, 0px));
  }
  body.agent-open:has(div.page-actions) .main {
    padding-bottom: calc(var(--m-footer-h) + var(--m-action-bar-h) + 118px + env(safe-area-inset-bottom, 0px));
  }

  /* Aminia FAB — au-dessus du footer ; monte seulement s'il y a une barre d'actions */
  .agent-fab {
    right: var(--space-3);
    bottom: calc(
      var(--space-3)
      + var(--m-footer-h)
      + env(safe-area-inset-bottom, 0px)
    ) !important;
    z-index: var(--z-fab);
    gap: var(--space-2);
    padding: 6px var(--space-3) 6px 6px;
  }
  body:has(details.page-actions) .agent-fab,
  body:has(a.btn.page-actions) .agent-fab,
  .shell:has(details.page-actions) .agent-fab,
  .shell:has(a.btn.page-actions) .agent-fab {
    bottom: calc(
      var(--space-3)
      + var(--m-footer-h)
      + var(--m-action-h)
      + var(--m-fab-gap)
      + env(safe-area-inset-bottom, 0px)
    ) !important;
  }
  body:has(div.page-actions) .agent-fab,
  .shell:has(div.page-actions) .agent-fab {
    bottom: calc(
      var(--space-3)
      + var(--m-footer-h)
      + var(--m-action-bar-h)
      + var(--m-fab-gap)
      + env(safe-area-inset-bottom, 0px)
    ) !important;
  }
  body.agent-open .agent-fab {
    visibility: hidden;
    pointer-events: none;
  }
  body.nav-open .agent-fab,
  body.nav-open .m-footer {
    visibility: hidden;
    pointer-events: none;
  }
  .agent-fab-orb { width: 40px; height: 40px; }
  .agent-fab-orb svg { width: 20px; height: 20px; }
  .agent-fab-text { font-size: var(--text-sm); }
  .agent-panel {
    z-index: var(--z-agent-panel);
    background: var(--surface);
    padding-bottom: calc(var(--m-footer-h) + env(safe-area-inset-bottom, 0px));
  }
  .agent-chooser,
  .agent-chat {
    z-index: var(--z-agent-modal);
    right: var(--space-3); left: var(--space-3); width: auto;
    bottom: calc(
      var(--space-3)
      + var(--m-footer-h)
      + env(safe-area-inset-bottom, 0px)
    );
  }
  .agent-chooser-close {
    width: var(--tap);
    height: var(--tap);
    min-width: var(--tap);
    min-height: var(--tap);
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  /* Panneau de saisie Aminia : compact, intégral, collé à la tab bar */
  .live-invoice {
    left: 8px; right: 8px; width: auto; transform: none;
    bottom: calc(var(--m-footer-h) + 6px + env(safe-area-inset-bottom, 0px));
  }
  .live-invoice .card { padding: 10px 12px 12px; border-radius: 14px; }
  .live-invoice .card-head { padding: 6px 8px; }
  .live-invoice .card-head h3 { font-size: 13.5px; }
  .live-invoice label { margin: 7px 0 3px; font-size: 11px; }
  .live-invoice input { font-size: 14px; padding: 7px 10px; min-height: 34px; font-weight: 700; }
  .live-invoice .sub { font-size: 11px; margin-top: 6px; }

  html:not([data-theme="dark"]) .m-footer-agent .m-footer-ico,
  html[data-theme="dark"] .m-footer-agent .m-footer-ico {
    color: inherit;
  }

  /* Le sélecteur Vocal/Chat d'Aminia devient un dialogue centré, lisible,
     au-dessus de la barre d'onglets (il flottait collé au coin bas-droit). */
  .agent-chooser {
    position: fixed;
    left: 50%; right: auto; bottom: calc(var(--m-footer-h) + 16px);
    top: auto;
    transform: translateX(-50%);
    width: min(320px, calc(100vw - 28px));
  }

  /* Relecture du brouillon rédigé par Aminia : plein écran, barre d'onglets
     cachée tant que l'utilisateur n'a pas validé. Après validation, la
     navigation ferme l'appel, le panneau Aminia et la barre réapparaît. */
  body:has([data-live-invoice]:not([hidden])) .live-invoice {
    position: fixed; inset: 0;
    z-index: 70; overflow-y: auto;
    background: var(--bg);
    padding: 12px 12px calc(14px + env(safe-area-inset-bottom, 0px));
  }
  body:has([data-live-invoice]:not([hidden])) .live-invoice .card {
    min-height: 100%;
    display: flex; flex-direction: column;
  }
  body:has([data-live-invoice]:not([hidden])) .live-invoice .card .card-body,
  body:has([data-live-invoice]:not([hidden])) .live-sheet-holder {
    flex: 1 1 auto;
    display: flex; flex-direction: column;
    min-height: 300px;
  }
  body:has([data-live-invoice]:not([hidden])) .live-sheet-holder [data-live-sheet] {
    flex: 1 1 auto;
  }
  .live-actions-bar {
    display: flex; gap: 10px; margin-top: 12px;
  }
  .live-actions-bar .btn {
    flex: 1; min-height: 48px; border-radius: 999px;
    display: inline-flex; align-items: center; justify-content: center;
  }
  .live-validate {
    box-shadow: 0 12px 26px -14px rgba(0, 65, 146, 0.55);
  }
  body:has([data-live-invoice]:not([hidden])) .m-footer,
  body:has([data-live-invoice]:not([hidden])) .m-dock-primary,
  body:has([data-live-invoice]:not([hidden])) .agent-fab {
    display: none !important;
  }
  .agent-dialog { padding: var(--space-2) var(--space-3); gap: var(--space-2); }
  .agent-note { display: none; }
  .agent-mic { width: var(--tap); height: var(--tap); }

  .btn, .m-nav-toggle, .m-footer-btn, .side-link { min-height: var(--tap); }
}

@media (max-width: 768px) and (prefers-reduced-motion: reduce) {
  .sidebar { transition: none; }
  .reveal, .reveal.is-visible { opacity: 1; transition: none; }
}

@media (max-width: 480px) {
  .siren-card { grid-template-columns: 1fr; }
  .siren-card .btn { justify-self: start; }
  .nav-in { gap: 10px; }
  .logo img { height: 44px; }
  .logo-text { display: none; }
  .nav-links .btn { padding: 9px 12px; font-size: 13px; }
  .mainnav-in { overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .mainnav-in::-webkit-scrollbar { display: none; }
  .hero { padding: 34px 0 40px; }
  .hero-cta { flex-direction: column; align-items: stretch; }
  .hero-cta .btn { width: 100%; justify-content: center; }
  .hero-siren .siren-box { flex-direction: column; }
  .hero-siren .siren-box .btn { width: 100%; justify-content: center; }
  .search-hit { grid-template-columns: 1fr; }
  .form-actions { flex-direction: column; }
  .form-actions .btn { width: 100%; justify-content: center; }
  .demo-toolbar { align-items: stretch; }
  .demo-select { justify-content: space-between; width: 100%; }
  .demo-select select { flex: 1; }
  .demo-note { font-size: 11.5px; }
  .mock-top { flex-wrap: wrap; gap: 6px; }
  .mock-body { padding: var(--space-4); }
  .foot-main { grid-template-columns: 1fr; padding: 30px 0 20px; }
  .container { padding: 0 var(--space-4); }
  .content { padding-left: var(--space-3); padding-right: var(--space-3); }
  .m-header-brand small { display: none; }
  .agent-fab { right: var(--space-3); }
  h1 { font-size: 34px; }
  .content h1 { font-size: 24px; }
}

/* ---------- Dashboard & Data Visualization ---------- */
:root {
  --data-indigo: #6366f1;
  --data-emerald: #10b981;
  --data-amber: #f59e0b;
  --data-rose: #f43f5e;
  --data-sky: #0ea5e9;
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.4);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  padding: 24px 0;
}

.stat-card {
  background: var(--glass-bg) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border: 1px solid var(--glass-border) !important;
  border-radius: 24px !important;
  padding: 24px !important;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02) !important;
  transition: transform 0.3s ease, box-shadow 0.3s ease !important;
}

.stat-card:hover {
  transform: translateY(-5px) !important;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1) !important;
}

.stat-card .value {
  font-size: 2rem !important;
  font-weight: 800 !important;
  background: linear-gradient(135deg, var(--ink) 0%, var(--muted) 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  margin-bottom: 4px !important;
}

/* Stylisation des graphiques (Camemberts/Barres) */
.chart-container {
  background: var(--glass-bg) !important;
  backdrop-filter: blur(12px) !important;
  border-radius: 24px !important;
  border: 1px solid var(--glass-border) !important;
  padding: 20px !important;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05) !important;
}

.chart-legend {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 20px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.legend-color {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

/* Tableaux de bord modernes */
.data-table {
  width: 100%;
  border-collapse: separate !important;
  border-spacing: 0 8px !important;
  margin-top: 20px !important;
}

.data-table thead th {
  background: transparent !important;
  color: var(--muted) !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
  font-size: 11px !important;
  letter-spacing: 0.5px !important;
  padding: 12px 16px !important;
  border: none !important;
}

.data-table tbody td {
  background: #fff !important;
  padding: 16px !important;
  border-top: 1px solid var(--line) !important;
  border-bottom: 1px solid var(--line) !important;
  font-size: 14px !important;
}

.data-table tbody tr td:first-child {
  border-left: 1px solid var(--line) !important;
  border-top-left-radius: 12px !important;
  border-bottom-left-radius: 12px !important;
}

.data-table tbody tr td:last-child {
  border-right: 1px solid var(--line) !important;
  border-top-right-radius: 12px !important;
  border-bottom-right-radius: 12px !important;
}

.data-table tbody tr:hover td {
  background: #f8faff !important;
  color: var(--blue-2) !important;
  cursor: pointer;
}

/* Badges de couleur pour camemberts/status */
.badge-indigo { background: var(--data-indigo); color: white; }
.badge-emerald { background: var(--data-emerald); color: white; }
.badge-amber { background: var(--data-amber); color: white; }
.badge-rose { background: var(--data-rose); color: white; }
.badge-sky { background: var(--data-sky); color: white; }

.badge {
  padding: 4px 10px !important;
  border-radius: 20px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  text-transform: uppercase !important;
}

/* ---------- Contacts et signature email ---------- */
.signature-preview {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  min-height: 72px;
  padding: 14px 16px;
  border: 1px dashed var(--line-2);
  border-radius: 12px;
  background: var(--blue-pale);
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.65;
}
.actions-list form { margin: 0; }

/* ---------- Pages juridiques ---------- */
.legal-head { margin-bottom: 18px; }
.legal-kicker {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.legal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}
.legal-nav + .legal-doc { margin-bottom: 18px; }
.legal-nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color .18s var(--ease), background .18s var(--ease), color .18s var(--ease);
}
.legal-nav-link:hover { border-color: var(--blue); color: var(--blue); }
.legal-nav-link.is-on {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}
.legal-doc {
  max-width: 860px;
  padding: 32px 38px;
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink-2);
}
.legal-doc > :first-child { margin-top: 0; }
.legal-doc h2 {
  margin: 34px 0 10px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-family: var(--font-head);
  font-size: 21px;
  line-height: 1.25;
}
.legal-doc h3 {
  margin: 22px 0 8px;
  color: var(--ink);
  font-family: var(--font-head);
  font-size: 17px;
}
.legal-doc p { margin: 0 0 12px; }
.legal-doc ul { margin: 0 0 14px; padding-left: 22px; }
.legal-doc li { margin-bottom: 6px; }
.legal-doc a { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; }
.legal-doc .legal-updated {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.legal-doc .legal-note {
  padding: 11px 14px;
  border-left: 3px solid var(--blue);
  border-radius: 0 10px 10px 0;
  background: var(--blue-pale);
  font-size: 14px;
}
.legal-doc .legal-copyright {
  margin-top: 30px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
}
.legal-facts {
  display: grid;
  gap: 1px;
  margin: 0 0 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--line);
}
.legal-facts > div {
  display: grid;
  grid-template-columns: minmax(150px, 220px) 1fr;
  gap: 16px;
  padding: 11px 16px;
  background: var(--surface);
}
.legal-facts dt { color: var(--muted); font-size: 13px; font-weight: 600; }
.legal-facts dd { margin: 0; color: var(--ink); }
.legal-facts--compact > div { padding: 9px 14px; }
@media (max-width: 640px) {
  .legal-doc { padding: 22px 18px; font-size: 14.5px; }
  .legal-facts > div { grid-template-columns: 1fr; gap: 2px; }
  .legal-nav-link { flex: 1 1 auto; justify-content: center; }
}
@media print {
  .legal-nav, .m-header, .m-footer, .sidebar, .m-actions, .page-actions { display: none !important; }
  .legal-doc { max-width: none; border: 0; box-shadow: none; padding: 0; }
  .legal-doc h2 { break-after: avoid; }
}
@media (max-width: 860px) {
  .actions-list form { width: 100%; }
  .actions-list form .btn { width: 100%; }
}

/* ---------- Sélecteur de société dans la barre supérieure ---------- */
.company-switch {
  display: flex; align-items: center; gap: 4px;
  max-width: 260px; overflow-x: auto; scrollbar-width: none;
  padding: 2px; flex: 0 0 auto;
}
.company-switch::-webkit-scrollbar { display: none; }
.company-switch-btn {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-size: 12px; font-weight: 800;
  color: #fff; background: #334155; text-decoration: none;
  border: 2px solid transparent; transition: transform .18s var(--ease), box-shadow .18s;
}
.company-switch-btn:hover { text-decoration: none; color: #fff; transform: translateY(-1px); }
.company-switch-btn.is-on { border-color: var(--ink); box-shadow: 0 0 0 2px #fff inset; }
.company-switch-btn.co-c0 { background: #0b3d91; }
.company-switch-btn.co-c1 { background: #ca1c60; }
.company-switch-btn.co-c2 { background: #1f7a4d; }
.company-switch-btn.co-c3 { background: #b45331; }
.company-switch-btn.co-c4 { background: #4f46e5; }
.company-switch-btn.co-c5 { background: #0e7490; }
.company-switch-btn.co-c6 { background: #a16207; }
.company-switch-btn.co-c7 { background: #7c3aed; }
.company-switch-btn.co-c8 { background: #be123c; }
.company-switch-btn.co-c9 { background: #334155; }

/* ---------- Mini-tendances des KPI ---------- */
.kpi-spark {
  display: flex; align-items: flex-end; gap: 3px;
  height: 34px; margin-top: 12px;
}
.kpi-spark i {
  flex: 1 1 0; min-height: 3px; border-radius: 4px 4px 1px 1px;
  background: linear-gradient(180deg, var(--blue-2), var(--blue));
  opacity: .8;
}
.kpi-spark-clients i { background: linear-gradient(180deg, #62d99a, #1f7a4d); }
.kpi-spark-vat i { background: linear-gradient(180deg, #ffcf70, #b45309); }

.tag-late { background: var(--red-soft); color: var(--red); border: 1px solid rgba(255, 61, 120, .28); }
.sheet-bank { overflow-wrap: anywhere; }

.mail-google-box {
  margin: 14px 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--blue-pale);
}
.mail-google-box[hidden] { display: none; }
.mail-google-box p { margin: 5px 0 10px; font-size: 13px; line-height: 1.45; }

/* Logos plus généreux sur les modèles qui ont de la place. */
.sheet-azur .sheet-logo { width: 96px; height: 96px; }
.sheet-graphite .sheet-logo { width: 92px; height: 92px; }
.sheet-indigo .sheet-logo { width: 84px; height: 84px; }
.sheet-sauge .sheet-logo { width: 84px; height: 84px; }
.sheet-carmin .sheet-logo { width: 78px; height: 78px; }

@media (max-width: 900px) {
  .top-mail { display: none; }
  .company-switch { max-width: 150px; }
}
@media (max-width: 560px) {
  .company-switch { max-width: 96px; }
  .company-switch-btn { width: 26px; height: 26px; font-size: 10.5px; }
}

/* ---------- Tickets : import et détail ---------- */
.ticket-upload-head { align-items: flex-end; }
.ticket-upload-form {
  max-width: 640px;
  margin: 0 auto;
  padding: 26px;
  border-radius: 16px;
}
.ticket-upload-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--blue-pale);
}
.ticket-upload-icon {
  width: 46px; height: 46px; flex: 0 0 auto;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--blue);
  color: #fff;
}
.ticket-upload-icon .icon { width: 24px; height: 24px; }
.ticket-upload-hero h2 { margin: 0 0 4px; font-size: 18px; }
.ticket-upload-hero p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.45; }
.ticket-dropzone {
  padding: 18px;
  border: 2px dashed var(--line-2);
  border-radius: 14px;
  background: var(--bg-2);
}
.ticket-dropzone label { display: block; margin-bottom: 10px; font-weight: 700; }
.ticket-dropzone input[type="file"] { width: 100%; font-size: 13px; }
.ticket-dropzone input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 10px 14px;
  border: 0;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.ticket-upload-submit { width: 100%; min-height: 50px; margin-top: 6px; }
.ticket-upload-safe { margin: 0; text-align: center; color: var(--muted); font-size: 12px; }

.ticket-detail-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 16px;
  margin-bottom: 18px;
}
.ticket-card-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 10px; margin-bottom: 10px;
}
.ticket-card-head h3 { margin: 0; }
.ticket-amount {
  margin: 2px 0 0;
  font-family: var(--font-head);
  font-size: 34px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.ticket-category {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--blue-pale);
  color: var(--blue);
  font-size: 11.5px;
  font-weight: 700;
}
.ticket-mini-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 14px 0;
}
.ticket-mini-stats > div {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-2);
}
.ticket-mini-stats span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.ticket-mini-stats b { font-size: 18px; font-variant-numeric: tabular-nums; }
.ticket-mini-stats small { color: var(--muted); margin-left: 4px; }
.ticket-meta { display: grid; gap: 8px; margin: 0; }
.ticket-meta > div {
  display: flex; justify-content: space-between; gap: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.ticket-meta dt { color: var(--muted); font-size: 12.5px; }
.ticket-meta dd { margin: 0; text-align: right; font-size: 13.5px; }
.ticket-image-preview {
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.ticket-image-preview img {
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: contain;
}
.ticket-file-link {
  display: flex; align-items: center; gap: 10px;
  padding: 18px;
  border: 1px dashed var(--line-2);
  border-radius: 12px;
  color: var(--ink);
}
.ticket-file-link .icon { width: 24px; height: 24px; }

.ledger-drafts-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 28px 0 12px;
}
.ledger-drafts-head h2 { margin: 0 0 4px; font-size: 19px; }

/* ---------- Facturation : synthèse mobile ---------- */
.bank-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}
.bank-row-actions form { margin: 0; }

.supplier-lookup-card {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.supplier-lookup-card h2 { margin: 0 0 4px; font-size: 17px; }
.supplier-lookup-card p { margin: 0; }
.supplier-lookup-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 1 520px;
}
.supplier-lookup-row input { flex: 1 1 auto; min-width: 0; }
.supplier-lookup-search { padding: 18px; margin-bottom: 16px; }
.supplier-lookup-search .supplier-lookup-row { flex: 1 1 auto; }
.supplier-lookup-search .micro { margin: 8px 0 0; }
.supplier-lookup-results { display: grid; gap: 10px; }
.supplier-lookup-hit { grid-template-columns: 1fr auto; }
.supplier-lookup-hit strong { margin: 2px 0; }

.product-autocomplete { position: relative; }
.product-autocomplete .micro { margin: 6px 0 0; }
.product-suggestions {
  position: absolute;
  z-index: var(--z-sticky);
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 280px;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.product-suggestions[hidden] { display: none; }
.product-suggestion {
  padding: 9px 10px;
  border-radius: 7px;
  cursor: pointer;
}
.product-suggestion:hover,
.product-suggestion[aria-selected="true"] {
  background: var(--blue-pale);
}
.product-suggestion b { display: block; font-size: 13.5px; }
.product-suggestion span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

/* ---------- Écriture comptable : confort mobile ---------- */
.entry-lines-title { margin: 26px 0 4px; font-size: 18px; }
.entry-lines-hint { margin: 0 0 12px; }
.entry-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
  flex-wrap: wrap;
}

/* ---------- Coque vocale persistante ---------- */
.voice-shell-frame {
  position: fixed;
  inset: 0;
  z-index: 80;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}
body.voice-shell-active { overflow: hidden; }
body.voice-shell-active .agent-fab,
body.voice-shell-active .agent-panel,
body.voice-shell-active .agent-chooser,
body.voice-shell-active .agent-chat { z-index: 130 !important; }
body.voice-shell-active .live-invoice { z-index: 125 !important; }

/* ---------- Modèles de facture A4 : 5 mises en page ---------- */
[data-style-status] { min-height: 16px; margin: 6px 0 0; }
[data-style-status].is-error { color: var(--red); }
.settings-page { display: flex; flex-direction: column; gap: 18px; }
.settings-preview-head { margin: 0; }
.settings-preview-head h2 { margin: 0 0 4px; font-size: 20px; }
.settings-sheet-preview { max-width: 900px; margin: 0 auto 10px; }

.form-section {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  overflow: hidden;
}
.form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-2);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.form-header::-webkit-details-marker { display: none; }
.form-header::after {
  content: "+";
  flex: 0 0 auto;
  font-size: 20px;
  line-height: 1;
  color: var(--muted);
}
.form-section[open] > .form-header::after { content: "−"; }
.form-header-hint {
  margin-left: auto;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
}
.form-section-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px;
}
.form-section-body > .form-grid { margin: 0; }

@media (max-width: 768px) {
  .settings-page { gap: 12px; }
  .settings-page .grid.g2 { grid-template-columns: 1fr; }
  .settings-page .card {
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  }
  .settings-page > .page-head { margin-bottom: 0; }
  .settings-page .page-head h1 { font-size: 24px; }
  .form-section { margin-top: 0; }
  .form-header { padding: 12px 13px; font-size: 14px; }
  .form-header-hint { display: none; }
  .form-section-body { padding: 12px; gap: 9px; }
  .model-grid { gap: 6px; }
  .model-card {
    max-width: 64px;
    min-height: 58px;
    padding: 4px;
    border-radius: 9px;
  }
  .model-preview { height: 36px; padding: 3px; }
  .model-label { font-size: 9px; line-height: 1.15; }
  .model-picker-label { margin: 10px 0 6px; font-size: 9.5px; }
  .settings-preview-section .form-section-body {
    max-height: 65vh;
    overflow: auto;
    padding: 10px;
  }
  .settings-sheet-preview { margin: 0; }
  .settings-sheet-preview .sheet { font-size: 10px; }
  .settings-sheet-preview .sheet-table { min-width: 480px; }
}

.model-picker-label {
  margin: 18px 0 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.sheet-azur { --sheet-ink: #0b3d91; --sheet-accent: #00a8e8; --sheet-soft: #eef6ff; --sheet-line: #cfe0f7; }
.sheet-carmin { --sheet-ink: #b42318; --sheet-accent: #eab308; --sheet-soft: #fff5f3; --sheet-line: #f1d4cf; }
.sheet-encre { --sheet-ink: #161616; --sheet-accent: #d4af37; --sheet-soft: #f8f6f0; --sheet-line: #e6dfcf; }
.sheet-sauge { --sheet-ink: #1f7a4d; --sheet-accent: #0e7490; --sheet-soft: #effaf4; --sheet-line: #cfe9dc; }
.sheet-graphite { --sheet-ink: #2d3440; --sheet-accent: #94a3b8; --sheet-soft: #f4f6f8; --sheet-line: #d8dee6; }
.sheet-indigo { --sheet-ink: #4f46e5; --sheet-accent: #3b82f6; --sheet-soft: #eef2ff; --sheet-line: #d6d9fb; }
.sheet-terra { --sheet-ink: #b45331; --sheet-accent: #eab308; --sheet-soft: #fdf5ef; --sheet-line: #f0d9c9; }

.sheet.layout-royal .sheet-head {
  position: relative;
  overflow: hidden;
  padding: 26px 32px 30px;
  border-radius: 0;
  background: var(--sheet-ink);
  color: #fff;
}
.sheet.layout-royal .sheet-head::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 10px;
  background: linear-gradient(90deg, var(--sheet-ink), var(--sheet-accent) 52%, var(--sheet-ink));
  clip-path: polygon(0 55%, 12% 25%, 27% 65%, 44% 30%, 61% 68%, 78% 28%, 100% 58%, 100% 100%, 0 100%);
}
.sheet.layout-royal .sheet-head h2,
.sheet.layout-royal .sheet-head p { color: #fff; }
.sheet.layout-royal .sheet-kicker { color: color-mix(in srgb, var(--sheet-accent) 55%, #fff); }
.sheet.layout-royal .sheet-logo { border-radius: 8px; padding: 4px; background: #fff; }
.sheet.layout-royal .sheet-kind { color: var(--sheet-accent); }
.sheet.layout-royal .sheet-table th { color: #fff; background: var(--sheet-ink); border-bottom: 2px solid var(--sheet-accent); }
.sheet.layout-royal .sheet-due b { color: var(--sheet-accent); }

.sheet.layout-emerald { background: var(--sheet-soft); border-color: var(--sheet-line); }
.sheet.layout-emerald .sheet-head {
  padding: 26px 32px;
  border-radius: 0;
  background: linear-gradient(135deg, var(--sheet-ink), var(--sheet-accent));
  color: #fff;
}
.sheet.layout-emerald .sheet-head h2,
.sheet.layout-emerald .sheet-head p { color: #fff; }
.sheet.layout-emerald .sheet-kicker { color: #d1fae5; }
.sheet.layout-emerald .sheet-logo { border-radius: 50%; padding: 4px; background: #fff; }
.sheet.layout-emerald .sheet-kind { color: #d1fae5; }
.sheet.layout-emerald .sheet-client { background: #fff; border-radius: 12px; padding: 14px 16px; }
.sheet.layout-emerald .sheet-table th { color: var(--sheet-ink); border-bottom: 2px solid var(--sheet-ink); }
.sheet.layout-emerald .sheet-due b { color: var(--sheet-ink); }

.sheet.layout-imperial { background: #fff; color: #111; }
.sheet.layout-imperial .sheet-head {
  padding: 22px 32px;
  border-radius: 0;
  border-bottom: 3px solid var(--sheet-accent);
  background: #111;
  color: #fff;
}
.sheet.layout-imperial .sheet-head h2,
.sheet.layout-imperial .sheet-head p { color: #fff; }
.sheet.layout-imperial .sheet-kicker { color: var(--sheet-accent); }
.sheet.layout-imperial .sheet-logo { padding: 4px; background: #fff; }
.sheet.layout-imperial .sheet-kind { color: var(--sheet-accent); font-size: 13px; letter-spacing: .2em; text-transform: uppercase; }
.sheet.layout-imperial .sheet-table th { color: #111; border-bottom: 1px solid #111; }
.sheet.layout-imperial .sheet-table td { border-bottom: 1px solid #ececec; }
.sheet.layout-imperial .sheet-due { border-top: 3px solid var(--sheet-accent); padding-top: 8px; }
.sheet.layout-imperial .sheet-due b { color: #111; font-weight: 500; }

.sheet.layout-bordeaux {
  background: #fffaf6;
  border-left: 8px solid var(--sheet-ink);
  border-color: var(--sheet-line);
}
.sheet.layout-bordeaux .sheet-head {
  padding: 24px 30px 20px;
  border-radius: 0;
  border-bottom: 2px solid var(--sheet-ink);
  background: var(--sheet-soft);
}
.sheet.layout-bordeaux .sheet-kind,
.sheet.layout-bordeaux .sheet-kicker,
.sheet.layout-bordeaux .sheet-due b { color: var(--sheet-ink); }
.sheet.layout-bordeaux .sheet-logo { border-radius: 8px; padding: 4px; background: #fff; }
.sheet.layout-bordeaux .sheet-client { background: #fff; border-left: 4px solid var(--sheet-ink); border-radius: 8px; padding: 14px 16px; }
.sheet.layout-bordeaux .sheet-table th { color: var(--sheet-ink); border-bottom: 2px solid var(--sheet-ink); }

.sheet.layout-sapphire { background: #fff; border-color: var(--sheet-line); }
.sheet.layout-sapphire .sheet-head {
  padding: 24px 32px;
  border-radius: 0;
  background: var(--sheet-ink);
  color: #fff;
}
.sheet.layout-sapphire .sheet-head h2,
.sheet.layout-sapphire .sheet-head p { color: #fff; }
.sheet.layout-sapphire .sheet-kicker { color: color-mix(in srgb, var(--sheet-accent) 55%, #fff); }
.sheet.layout-sapphire .sheet-logo { padding: 4px; background: #fff; }
.sheet.layout-sapphire .sheet-kind { color: #e2e8f0; }
.sheet.layout-sapphire .sheet-table th { color: var(--sheet-ink); background: var(--sheet-soft); border-bottom: 1px solid var(--sheet-line); }
.sheet.layout-sapphire .sheet-due b { color: var(--sheet-ink); }

.model-layout-auto { background: linear-gradient(135deg, #f8fafc 55%, #e2e8f0); }
.model-layout-auto .mp-logo { background: #64748b; }
.model-layout-auto .mp-due b { background: #64748b; }
.model-layout-royal { padding: 0; background: #fff; }
.model-layout-royal .mp-top { padding: 3px; background: linear-gradient(90deg, #0b3d91 68%, #00a8e8); }
.model-layout-royal .mp-logo { background: #fff; }
.model-layout-royal .mp-due b { background: #00a8e8; }
.model-layout-emerald { padding: 0; background: #effaf4; border-color: #cfe9dc; }
.model-layout-emerald .mp-top { padding: 3px; background: linear-gradient(135deg, #1f7a4d, #0e7490); }
.model-layout-emerald .mp-logo { background: #fff; border-radius: 50%; }
.model-layout-emerald .mp-due b { background: #1f7a4d; }
.model-layout-imperial { padding: 0; background: #fff; border-color: #e6dfcf; }
.model-layout-imperial .mp-top { padding: 3px; background: #111; border-bottom: 2px solid #d4af37; }
.model-layout-imperial .mp-logo { background: #d4af37; }
.model-layout-imperial .mp-due b { background: #111; }
.model-layout-bordeaux { padding: 0; background: #fffaf6; border-left: 3px solid #b42318; border-color: #f1d4cf; }
.model-layout-bordeaux .mp-top { padding: 3px; background: #fdf5ef; border-bottom: 1px solid #b42318; }
.model-layout-bordeaux .mp-logo { background: #b42318; }
.model-layout-bordeaux .mp-due b { background: #b42318; }
.model-layout-sapphire { padding: 0; background: #fff; border-color: #d6d9fb; }
.model-layout-sapphire .mp-top { padding: 3px; background: #4f46e5; }
.model-layout-sapphire .mp-logo { background: #e2e8f0; }
.model-layout-sapphire .mp-due b { background: #4f46e5; }

/* Modèles basiques : sobres, lisibles, une signature discrète. */
.model-layout-classique { padding: 0; background: #fff; border-color: #e2e8f0; }
.model-layout-classique .mp-top { padding: 3px 2px; border-bottom: 1px solid #cbd5e1; }
.model-layout-classique .mp-logo { background: #64748b; }
.model-layout-classique .mp-due b { background: #334155; }
.model-layout-minimal { padding: 0; background: #fff; border-color: #f1f5f9; }
.model-layout-minimal .mp-top { padding: 1px 2px; border-bottom: 1px solid #94a3b8; }
.model-layout-minimal .mp-logo { background: #94a3b8; }
.model-layout-minimal .mp-who, .model-layout-minimal .mp-row { opacity: .8; }
.model-layout-minimal .mp-due b { background: #94a3b8; }
.model-layout-moderne { padding: 0; background: #fff; border-color: #dbeafe; }
.model-layout-moderne .mp-top { padding: 3px 2px 3px 6px; border-left: 4px solid #2563eb; }
.model-layout-moderne .mp-logo { background: #2563eb; }
.model-layout-moderne .mp-due b { background: #2563eb; }
.model-layout-compact { padding: 0; background: #fff; border-color: #e5e7eb; }
.model-layout-compact .mp-top { padding: 2px; border-top: 3px solid #0f172a; background: #f1f5f9; }
.model-layout-compact .mp-logo { background: #0f172a; }
.model-layout-compact .mp-due b { background: #0f172a; }

@media (max-width: 600px) {
  .agent-meta { gap: 7px; }
  .agent-wake span { display: none; }
  .agent-actions .btn-sm { padding: 8px 10px; font-size: 11.5px; }
}

@media (max-width: 768px) {
  .entry-form-card { padding: 16px; border-radius: 14px; }
  .entry-form-card .form-grid { grid-template-columns: 1fr; gap: 10px; }
  .entry-form-card .table-wrap { overflow: visible; }
  .entry-lines-table { display: block; min-width: 0; }
  .entry-lines-table thead { display: none; }
  .entry-lines-table tbody { display: grid; gap: 12px; }
  .entry-lines-table tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
  }
  .entry-lines-table td { display: block; padding: 0; border: 0; }
  .entry-lines-table td:first-child { grid-column: 1 / -1; }
  .entry-lines-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
  }
  .entry-lines-table select,
  .entry-lines-table input { width: 100%; }
  .entry-lines-table .num { text-align: left; }
  .entry-form-actions { flex-direction: column-reverse; }
  .entry-form-actions .btn { width: 100%; }
}

@media (max-width: 640px) {
  .supplier-lookup-card { flex-direction: column; align-items: stretch; }
  .supplier-lookup-row { flex-direction: column; align-items: stretch; }
  .supplier-lookup-row .btn { width: 100%; }
  .supplier-lookup-hit { grid-template-columns: 1fr; }
  .supplier-lookup-hit .btn { width: 100%; }
}

.inv-mobile-list { display: none; }
.inv-mobile-card {
  display: block;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: inherit;
  text-decoration: none;
}
.inv-mobile-card:hover { text-decoration: none; color: inherit; border-color: var(--blue-2); }
.inv-mobile-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.inv-mobile-top b { font-family: var(--font-head); font-size: 15px; }
.inv-mobile-client { margin: 6px 0 10px; color: var(--ink-2); font-size: 13.5px; }
.inv-mobile-bottom {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 9px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
}
.inv-mobile-bottom b { color: var(--ink); font-size: 15px; }

/* Bandeau mode démo lecture seule */
.demo-readonly-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  padding: 10px 14px;
  border: 1px solid #efd58a;
  border-radius: 10px;
  background: #fff8e6;
  color: #6b4e00;
  font-size: 13px;
  line-height: 1.35;
}
.demo-readonly-banner b { color: #4d3800; }

@media (max-width: 768px) {
  .ticket-upload-head { align-items: flex-start; }
  .ticket-upload-form { padding: 18px 16px; border-radius: 14px; }
  .ticket-upload-hero { align-items: flex-start; padding: 14px; }
  .ticket-upload-icon { width: 40px; height: 40px; }
  .ticket-detail-grid { grid-template-columns: 1fr; }
  .ticket-amount { font-size: 30px; }
  .ticket-meta > div { flex-direction: column; gap: 2px; }
  .ticket-meta dd { text-align: left; }
  .ticket-image-preview img { max-height: 320px; }
  .ledger-drafts-head { flex-direction: column; align-items: flex-start; }
  .inv-dash-kpis { grid-template-columns: 1fr !important; gap: 10px; }
  .inv-dash-cards { grid-template-columns: 1fr 1fr !important; gap: 10px; }
  .inv-dash-cards .company { padding: 14px; }
  .inv-dash-cards h3 { font-size: 15px; }
  .inv-dash-table { display: none; }
  .inv-mobile-list { display: grid; gap: 10px; }
}

/* Options de facturation repliables */
.invoice-advanced {
  padding: 0;
  margin-top: 4px;
}
.invoice-advanced > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  cursor: pointer;
  list-style: none;
  font-weight: 700;
}
.invoice-advanced > summary::-webkit-details-marker { display: none; }
.invoice-advanced > summary .micro {
  font-weight: 400;
  text-align: right;
}
.invoice-advanced > summary::after {
  content: "+";
  font-size: 20px;
  line-height: 1;
  color: var(--muted);
}
.invoice-advanced[open] > summary::after { content: "−"; }
.invoice-advanced-body {
  display: grid;
  gap: 14px;
  padding: 0 20px 20px;
}

/* Facture mobile : lignes en cartes compactes, sans scroll horizontal */
@media (max-width: 768px) {
  .invoice-page-head .sub { display: none; }
  .invoice-form-card { padding: 14px; }
  .invoice-form .form-grid { gap: 12px; }
  .invoice-form label { font-size: 12.5px; }
  .invoice-form input,
  .invoice-form select { min-height: 44px; font-size: 16px; }
  .invoice-form .micro {
    margin-top: 3px;
    font-size: 11px;
    line-height: 1.35;
  }
  .invoice-advanced > summary { padding: 14px 16px; }
  .invoice-advanced > summary .micro { display: none; }
  .invoice-advanced-body { padding: 0 16px 16px; gap: 12px; }

  .invoice-lines-head { padding: 14px 16px 6px; }
  .invoice-lines-head .sub { display: none; }
  .invoice-lines-scroll { overflow: visible; }
  .invoice-lines-table {
    display: block;
    width: 100%;
    min-width: 0;
    font-size: 13px;
  }
  .invoice-lines-table thead { display: none; }
  .invoice-lines-table tbody { display: block; }
  .invoice-line-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px 8px;
    position: relative;
    margin: 0 0 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
  }
  .invoice-line-row td {
    display: block;
    width: auto;
    min-width: 0;
    padding: 0;
    border: 0;
  }
  .invoice-line-row td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--muted);
  }
  .invoice-line-row .line-product,
  .invoice-line-row .line-description { grid-column: 1 / -1; }
  .invoice-line-row .line-product { padding-right: 38px; }
  .invoice-line-row .line-qty,
  .invoice-line-row .line-price,
  .invoice-line-row .line-vat { grid-column: span 1; }
  .invoice-line-row .line-total {
    grid-column: 1 / -1;
    padding-top: 2px;
    font-size: 16px;
  }
  .invoice-line-row .line-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: auto;
  }
  .invoice-line-row .line-remove::before { display: none; }
  .invoice-line-row .line-remove-btn {
    width: 30px;
    height: 30px;
    font-size: 18px;
  }
  .invoice-line-row .line-delete {
    font-size: 0;
    gap: 0;
  }
  .invoice-line-row .line-delete input {
    width: 20px;
    height: 20px;
    min-height: 0;
  }
  .invoice-line-row .line-delete span { display: none; }
  .invoice-lines-table input,
  .invoice-lines-table select {
    min-height: 42px;
    padding: 8px;
    font-size: 16px;
  }
  .invoice-lines-card .form-errors { margin: 4px 16px 10px; }
  .invoice-lines-toolbar {
    padding: 12px 16px 14px;
    gap: 10px;
  }
  .invoice-lines-toolbar [data-add-line] {
    width: 100%;
    justify-content: center;
  }
  .invoice-preview-totals {
    width: 100%;
    margin-left: 0;
    justify-content: space-between;
    gap: 8px;
    font-size: 12.5px;
  }
  .invoice-preview-ttc {
    padding-left: 0;
    border-left: 0;
  }
}

/* ==========================================================================
   MOBILE — corrections d'usage : drawer scrollable, actions dans le flux,
   tableaux de cartes en fiches libellées.
   ========================================================================== */
@media (max-width: 768px) {
  /* Le pied du menu ne prend plus une hauteur fixe : tout le tiroir défile. */
  .sidebar {
    display: block;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }
  .sidebar-nav-scroll {
    flex: 0 0 auto;
    min-height: 0;
    overflow: visible;
  }
  .m-drawer-head {
    position: sticky;
    top: 0;
    z-index: 3;
  }
  .sidebar-foot {
    margin-top: 10px;
    padding-top: 10px;
    padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--line);
    background: var(--surface);
  }

  /* Les actions de page restent sous le titre, pas en barre fixe au-dessus du dock. */
  .page-head > div.page-actions,
  .page-head div.page-actions {
    position: static;
    left: auto;
    right: auto;
    bottom: auto;
    z-index: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .page-head > div.page-actions .btn,
  .page-head div.page-actions .btn {
    flex: 1 1 150px;
    width: auto;
    min-height: var(--tap);
    justify-content: center;
  }
  .shell:has(.page-head div.page-actions) .content {
    padding-bottom: calc(
      var(--space-5)
      + var(--m-footer-h)
      + var(--m-fab-h)
      + env(safe-area-inset-bottom, 0px)
    ) !important;
  }
  body:has(.page-head div.page-actions) .agent-fab,
  .shell:has(.page-head div.page-actions) .agent-fab {
    bottom: calc(
      var(--space-3) + var(--m-footer-h) + env(safe-area-inset-bottom, 0px)
    ) !important;
  }

  /* Tableaux des cartes compacts : une fiche par ligne, libellés à gauche. */
  .card-tight.mobile-cards {
    overflow-x: hidden;
    background: var(--surface);
  }
  .card-tight.mobile-cards .table-wrap { overflow: visible; }
  .card-tight.mobile-cards table {
    display: block;
    width: 100%;
    min-width: 0;
    border-collapse: collapse;
  }
  .card-tight.mobile-cards thead { display: none; }
  .card-tight.mobile-cards tbody { display: block; }
  .card-tight.mobile-cards tbody tr {
    display: block;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
  }
  .card-tight.mobile-cards tbody tr:last-child { border-bottom: 0; }
  .card-tight.mobile-cards tbody td {
    position: static;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    width: auto;
    padding: 4px 0;
    border: 0;
    text-align: right;
    white-space: normal;
    background: transparent;
    box-shadow: none;
  }
  .card-tight.mobile-cards tbody td::before {
    content: attr(data-label);
    flex: 0 0 38%;
    text-align: left;
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
  }
  .card-tight.mobile-cards tbody td:empty { display: none; }
  .card-tight.mobile-cards tbody td[colspan] {
    display: block;
    padding: 10px 0;
    text-align: center;
  }
  .card-tight.mobile-cards tbody td[colspan]::before { display: none; }
  .card-tight.mobile-cards tbody td:not([data-label]) {
    display: flex;
    justify-content: flex-end;
    text-align: right;
  }
  .card-tight.mobile-cards tbody td:not([data-label])::before { display: none; }
}

/* Aperçu live de l'écriture bancaire */
.entry-preview {
  margin-top: 4px;
  background: #fbfcff;
}
.entry-preview h3 {
  margin: 0 0 10px;
  font-size: 17px;
}
.entry-preview-lines {
  display: grid;
  gap: 8px;
}
.entry-preview-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  font-size: 13.5px;
}
.entry-preview-line span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  color: var(--muted);
}
.entry-preview-line b {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.entry-preview-line[hidden] { display: none; }
.entry-preview-status { margin: 10px 0 0; }
.entry-preview-status.is-warn { color: #b45309; }

@media (max-width: 480px) {
  .entry-preview-line { align-items: flex-start; }
}

/* Import d'historique */
.import-source-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.import-source {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-height: 132px;
  padding: 16px;
  border: 1px dashed var(--line-2);
  border-radius: 14px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color .18s, background .18s, transform .18s;
}
.import-source:hover { border-color: var(--blue); background: var(--blue-pale); transform: translateY(-1px); }
.import-source input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.import-source-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 10px;
  color: var(--blue); background: var(--blue-pale);
}
.import-source strong { font-size: 14px; color: var(--ink); }
.import-source small { font-size: 12px; line-height: 1.35; color: var(--muted); }
.import-file-summary { margin: 0; font-weight: 600; color: var(--blue); }

.import-batch-list { display: grid; gap: 8px; }
.import-batch-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  color: var(--ink); text-decoration: none; background: var(--surface);
}
.import-batch-row:hover { border-color: var(--blue); text-decoration: none; }
.import-batch-row small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }

.import-progress-card { margin-bottom: 16px; }
.import-progress-bar {
  height: 9px; margin: 12px 0 8px; border-radius: 99px; overflow: hidden;
  background: var(--line); box-shadow: inset 0 1px 2px rgba(15, 23, 42, .08);
}
.import-progress-bar i {
  display: block; height: 100%; width: 0; border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), #4f8dff);
  transition: width .3s var(--ease);
}
.import-agent-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 4px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(61, 220, 106, .16);
  animation: pulse 1.6s infinite;
}
.import-activity {
  list-style: none;
  margin: 12px 0 14px;
  padding: 10px 12px;
  max-height: 190px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-2);
}
.import-activity li {
  display: flex;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
  line-height: 1.35;
}
.import-activity li:last-child { border-bottom: 0; }
.import-activity-time {
  flex: 0 0 auto;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
}
.import-activity small { color: var(--muted); }

.import-tabs {
  display: flex; gap: 6px; overflow-x: auto; margin: 18px 0 12px;
  padding-bottom: 2px; -webkit-overflow-scrolling: touch;
}
.import-tabs a {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  padding: 8px 12px; border: 1px solid var(--line); border-radius: 99px;
  color: var(--muted); text-decoration: none; font-size: 13px; background: var(--surface);
}
.import-tabs a.is-on { color: var(--blue); border-color: var(--blue); background: var(--blue-pale); }
.import-tabs b { font-size: 11px; }

.import-select-all {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; margin-bottom: 12px;
}
.import-doc-list { display: grid; gap: 10px; }
.import-doc-card {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
}
.import-doc-check { flex: 0 0 auto; padding-top: 2px; }
.import-doc-check input { width: 20px; height: 20px; }
.import-doc-main { flex: 1 1 auto; min-width: 0; }
.import-doc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.import-doc-head strong { display: block; font-size: 14px; overflow-wrap: anywhere; }
.import-doc-head small { display: block; margin-top: 2px; color: var(--muted); font-size: 11.5px; }
.import-doc-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.import-doc-meta b { color: var(--ink); font-variant-numeric: tabular-nums; }
.import-doc-warning { margin: 8px 0 0; color: #9a5b00; line-height: 1.35; }
.import-doc-card > .btn { flex: 0 0 auto; }

.import-review {
  display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(340px, .92fr);
  gap: 18px; align-items: start;
}
.import-preview-card { min-width: 0; }
.import-pdf-frame {
  width: 100%; height: calc(100vh - 235px); min-height: 520px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
.import-image-preview {
  display: block; width: 100%; max-height: calc(100vh - 235px);
  object-fit: contain; border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
.import-raw-text {
  max-height: 460px; overflow: auto; white-space: pre-wrap; word-break: break-word;
  padding: 12px; border: 1px solid var(--line); border-radius: 10px;
  background: #fbfbfd; font-size: 12px; line-height: 1.45;
}
.import-doc-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.import-doc-actions form { margin: 0; }

@media (max-width: 768px) {
  .import-source-grid { grid-template-columns: 1fr; }
  .import-source { min-height: 96px; flex-direction: row; align-items: center; }
  .import-source small { display: none; }
  .import-review { grid-template-columns: 1fr; }
  .import-pdf-frame { height: 55vh; min-height: 320px; }
  .import-image-preview { max-height: 55vh; }
  .import-doc-card { flex-wrap: wrap; }
  .import-doc-card > .btn { width: 100%; }
  .import-select-all .btn { width: 100%; }
  .import-doc-head { align-items: flex-start; }
}

/* ==================================================================
   Matériau « Liquid Glass » (iOS 26) pour les panneaux Aminia
   Voile translucide, rim-light, reflet supérieur, ombre douce.
   ================================================================== */
:root {
  --glass-blur: blur(22px) saturate(180%);
  --glass-bg: rgba(255, 255, 255, .68);
  --glass-bg-strong: rgba(255, 255, 255, .78);
  --glass-rim: rgba(255, 255, 255, .55);
  --glass-rim-line: rgba(15, 23, 42, .07);
  --glass-specular: linear-gradient(180deg, rgba(255, 255, 255, .34), rgba(255, 255, 255, .06) 38%, rgba(255, 255, 255, 0) 60%);
  --glass-shadow:
    0 1px 0 rgba(255, 255, 255, .32) inset,
    0 28px 70px -30px rgba(8, 24, 48, .40),
    0 8px 22px -12px rgba(8, 24, 48, .18);
  --glass-radius: 20px;
}
html[data-theme="dark"] {
  --glass-bg: rgba(18, 18, 21, .58);
  --glass-bg-strong: rgba(24, 24, 28, .66);
  --glass-rim: rgba(255, 255, 255, .14);
  --glass-rim-line: rgba(255, 255, 255, .06);
  --glass-specular: linear-gradient(180deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .02) 40%, rgba(255, 255, 255, 0) 60%);
  --glass-shadow:
    0 1px 0 rgba(255, 255, 255, .08) inset,
    0 30px 70px -28px rgba(0, 0, 0, .72),
    0 8px 24px -12px rgba(0, 0, 0, .45);
}

/* Panneau de verre : voile, reflet, bord brillant, ombres doubles. */
.glass-panel {
  position: relative;
  border-radius: var(--glass-radius);
  border: 1px solid var(--glass-rim-line);
  background-color: var(--glass-bg);
  background-image: var(--glass-specular);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow);
  isolation: isolate;
}
/* Trait lumineux en haut du panneau (rim-light Apple) */
.glass-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(180deg, var(--glass-rim), rgba(255, 255, 255, 0) 42%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass-panel {
    background-color: var(--surface);
    background-image: none;
  }
}

/* Ajout de ticket : la photo en premier appel (priorité), champs rangés. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass-panel {
    background-color: var(--surface);
    background-image: none;
  }
}
.ticket-camera-cta {
  display: flex; align-items: center; gap: 12px; cursor: pointer;
  border: 1.5px dashed var(--blue-2); border-radius: 16px;
  padding: 14px 16px; background: var(--blue-soft);
  margin: 0 0 8px;
  transition: border-color .15s, background .15s;
}
.ticket-camera-cta:hover { border-color: var(--blue); background: var(--blue-soft); }
.ticket-camera-orb {
  flex: 0 0 44px; height: 44px; border-radius: 12px; background: var(--blue);
  color: #fff; display: grid; place-items: center;
}
.ticket-camera-text { flex: 1 1 auto; display: grid; gap: 1px; }
.ticket-camera-text b { font-size: 15px; color: var(--ink); }
.ticket-camera-text small { color: var(--muted); font-size: 11.5px; }
.ticket-camera-arrow { color: var(--blue); font-weight: 800; }
.ticket-camera-input { width: 1px; height: 1px; opacity: 0; }
.ticket-file-cta {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 12px;
  padding: 9px 12px; color: var(--muted); font-size: 13px;
}
.ticket-fields-grid { margin: 14px 0 6px; }
.ticket-upload-submit { width: 100%; margin-top: 16px; }
.ticket-recent summary::-webkit-details-marker { display: none; }

@media (max-width: 768px) {
  .ticket-upload-head { flex-direction: column-reverse; gap: 14px; }
  .ticket-camera-cta { padding: 18px 16px; border-radius: 18px; }
  .ticket-camera-orb { flex: 0 0 48px; height: 48px; }
  .ticket-camera-text b { font-size: 16px; }
  .ticket-camera-input:focus-visible ~ .ticket-camera-cta,
  .ticket-camera-cta:has(.ticket-camera-input:focus) {
    outline: 2px solid var(--blue-2); outline-offset: 3px;
  }
}

/* Lignes du panneau de recherche : lisibles dans les deux thèmes. */
html[data-theme="dark"] .agent-result-row {
  background: rgba(255, 255, 255, .055);
  border-color: rgba(255, 255, 255, .10);
}
html[data-theme="dark"] .agent-result-row:hover,
html[data-theme="dark"] .agent-result-row.is-on {
  background: rgba(255, 255, 255, .13);
  border-color: rgba(255, 255, 255, .22);
}
html[data-theme="dark"] .agent-result-main b { color: #f6f6f4; }
html[data-theme="dark"] .agent-result-main small { color: #a4a4ab; }
html[data-theme="dark"] .agent-result-badges .badge { color: #d4d4d8; }

/* Le thème sombre ne doit pas opacifier le matériau (dark-app.css chargé après). */
html[data-theme="dark"] .glass-panel {
  background-color: var(--glass-bg) !important;
  background-image: var(--glass-specular) !important;
  border-color: var(--glass-rim-line) !important;
  box-shadow: var(--glass-shadow) !important;
}
html[data-theme="dark"] .glass-panel::before {
  background: linear-gradient(180deg, var(--glass-rim), rgba(255, 255, 255, 0) 42%) !important;
}

/* Pied du panneau de recherche : même voile, pleine largeur. */
.agent-results-actions {
  border-top: 1px solid var(--glass-rim-line);
  background: rgba(255, 255, 255, .38);
  margin: 4px -14px -12px;
  padding: 10px 14px 10px;
  display: grid; gap: 6px; flex: 0 0 auto;
}
html[data-theme="dark"] .agent-results-actions { background: rgba(255, 255, 255, .05); }

/* Boutons primaires : voile iOS léger (reflet + liseré + léger fond translucide). */
.btn-primary {
  background-color: color-mix(in srgb, var(--blue) 88%, transparent);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, .20), rgba(255, 255, 255, 0) 58%);
  border: 1px solid rgba(255, 255, 255, .16);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .22) inset,
    0 10px 26px -14px rgba(0, 65, 146, .55);
}
html[data-theme="dark"] .btn-primary {
  background-image: linear-gradient(180deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, 0) 58%);
  border-color: rgba(255, 255, 255, .10);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .16) inset,
    0 14px 30px -16px rgba(0, 0, 0, .55);
}
/* ---- Shell et contenu : carte arrondie posée sur le fond ---- */
.shell { background: #eef2f7; }
.main {
  border-radius: 24px 24px 0 0;
  background: #ffffff;
  box-shadow: 0 -6px 24px rgba(15, 23, 42, .05);
}
@media (min-width: 769px) {
  /* Desktop : la carte est marginée comme la page de l'app */
  .content { border-radius: 0 0 24px 0; }
}

html[data-theme="dark"] .shell { background: #050506; }
html[data-theme="dark"] .main {
  background: #08080a;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .5);
}

/* Barre mobile : ré-assertions après le matériau (ordre de fichier). */
html[data-theme="dark"] .m-footer {
  background: rgba(16, 16, 19, .66);
  border-color: rgba(255, 255, 255, .10);
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .7);
}
html[data-theme="dark"] .m-footer-btn { color: #a4a4ab; }
html[data-theme="dark"] .m-footer-ico { color: #d4d4d8; }
html[data-theme="dark"] .m-footer-btn.active { color: #3ddc6a; }
html[data-theme="dark"] .m-footer-btn.active .m-footer-ico {
  color: #070708;
  background: linear-gradient(135deg, #3ddc6a 0%, #c6ffb1 100%);
  box-shadow: 0 8px 20px -6px rgba(61, 220, 106, .45);
}


/* ---- Les panneaux flottants d'Aminia gardent leur ancrage fixed,
   malgré le matériau .glass-panel (position: relative) chargé après. ---- */
.agent-chooser,
.agent-chat,
.agent-panel,
.agent-results,
.live-invoice {
  position: fixed;
}


/* ---- PWA : pilule a Installer l application ---- */
.pwa-install-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); color: var(--ink); cursor: pointer;
  font-family: var(--font-body); font-size: 13px; font-weight: 700;
  box-shadow: var(--shadow-sm);
  animation: pwa-pill-in .3s var(--ease) both;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.pwa-install-pill .icon { width: 17px; height: 17px; color: var(--blue); }
.pwa-install-pill:hover { border-color: var(--line-2); box-shadow: var(--shadow-md); }
@keyframes pwa-pill-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}
@media (max-width: 768px) {
  .pwa-install-pill {
    position: fixed; left: 50%; transform: translateX(-50%);
    bottom: calc(var(--m-footer-h) + env(safe-area-inset-bottom, 0px) + 12px);
    z-index: 60;
    box-shadow: 0 14px 30px -14px rgba(0, 20, 50, .45);
  }
  .pwa-install-pill .icon { display: none; }
  @keyframes pwa-pill-in {
    from { opacity: 0; transform: translate(-50%, 6px); }
    to { opacity: 1; transform: translate(-50%, 0); }
  }
}
html[data-theme='dark'] .pwa-install-pill {
  background: #141416; color: var(--ink); border-color: var(--line);
  box-shadow: 0 14px 30px -14px rgba(0, 0, 0, .6);
}


/* ---- PWA : invite iOS (Safari n'a pas d'evenement d'installation). ---- */
.pwa-ios-hint {
  position: fixed;
  left: max(12px, env(safe-area-inset-left, 0px));
  right: max(12px, env(safe-area-inset-right, 0px));
  bottom: calc(var(--m-footer-h) + env(safe-area-inset-bottom, 0px) + 66px);
  z-index: 60;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, .28);
  background: rgba(20, 20, 22, .92);
  color: #f4f4f5;
  font-family: var(--font-body); font-size: 12.5px; font-weight: 600;
  box-shadow: 0 18px 44px -18px rgba(0, 0, 0, .85);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  backdrop-filter: blur(14px) saturate(180%);
  animation: pwa-pill-in .35s var(--ease) both;
}
.pwa-ios-hint-copy { display: block; line-height: 1.45; }
.pwa-ios-hint-copy b { font-weight: 800; }
.pwa-ios-hint-copy .icon {
  width: 15px; height: 15px; display: inline-block; vertical-align: -3px;
  color: #3ddc6a;
}
.pwa-ios-hint-close {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .2); background: transparent;
  color: #c9c9cf; font-size: 16px; cursor: pointer; line-height: 1;
}
.pwa-ios-hint-close:active { transform: scale(.94); }


/* ---- PWA : invites d'installation revoquees (centrees, pleines, lisibles).
   Les regles precedentes (topbar / icone) sont remplacees ici : ceci est
   charge en dernier fichier de la feuille et gagne a specificite egale. ---- */
.pwa-install-pill {
  position: fixed;
  right: 24px; bottom: 104px; left: auto;
  z-index: 80;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 16px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); color: var(--ink); cursor: pointer;
  font-family: var(--font-body); font-size: 13px; font-weight: 700;
  box-shadow: var(--shadow-sm);
  animation: pwa-pill-in .3s var(--ease) both;
}
.pwa-install-pill .icon { display: none; }
.pwa-banner-emoji, .pwa-pill-emoji { flex: 0 0 auto; }

@media (max-width: 768px) {
  .pwa-install-pill,
  .pwa-ios-hint {
    /* au-dessus de la barre d'onglets ET de la zone gestuelle du systeme */
    left: max(12px, env(safe-area-inset-left, 0px));
    right: max(12px, env(safe-area-inset-right, 0px));
    bottom: calc(
      var(--m-footer-h) + env(safe-area-inset-bottom, 0px) + 26px
    );
    z-index: 80;
    justify-content: center; align-items: center; text-align: center;
    padding: 13px 16px; border-radius: 18px;
    font-size: 13.5px; line-height: 1.45; flex-wrap: wrap;
    box-shadow: 0 18px 44px -16px rgba(0, 20, 50, .5);
  }
  .pwa-ios-hint-copy { text-align: center; }
}
html[data-theme='dark'] .pwa-install-pill {
  background: #141416; color: var(--ink); border-color: var(--line);
}


/* ---- Scan de ticket en direct : barre de progression + texte qui defile. ---- */
.scan-live {
  margin-top: 16px; padding: 16px 18px; border-radius: 16px;
  border: 1px solid var(--line); background: var(--card, var(--surface));
}
.scan-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.scan-orb {
  flex: 0 0 auto; width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #5aa0ff, var(--blue) 62%, #00306e);
  animation: agentPulse 1.6s ease-out infinite;
}
.scan-pct {
  margin-left: auto; font-weight: 800; font-size: 12.5px;
  font-variant-numeric: tabular-nums; color: var(--blue);
}
.scan-progress {
  height: 8px; border-radius: 999px; overflow: hidden;
  background: rgba(15, 23, 42, .10);
}
.scan-progress i {
  display: block; width: 0; height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), #4f8dff, #7ba7ff);
  background-size: 200% 100%;
  animation: scanSweep 1.6s linear infinite;
  transition: width .45s var(--ease, ease);
}
@keyframes scanSweep {
  from { background-position: 200% 0; }
  to { background-position: -60% 0; }
}
.scan-text {
  margin: 12px 0 10px; max-height: 132px; overflow: auto;
  padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, .035);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11.5px; line-height: 1.55; color: var(--ink-2);
  display: flex; flex-direction: column; gap: 3px;
}
.scan-text span { white-space: nowrap; }
html[data-theme='dark'] .scan-text {
  background: rgba(255, 255, 255, .04); border-color: var(--line);
  color: #c9c9cf;
}
html[data-theme='dark'] .scan-progress {
  background: rgba(255, 255, 255, .08);
}


/* ---- Boutons mobiles normaliss: mme chelle, mmme largeur d'empiles,
   retour d'appui. Gagne en fin de feuille. ---- */
@media (max-width: 768px) {
  .btn, .btn-sm, .btn-lg, .actions-summary {
    -webkit-tap-highlight-color: transparent;
    transition: transform .12s ease, box-shadow .15s ease, background .15s ease,
      filter .15s ease;
  }
  .btn:active, .btn-sm:active, .btn-lg:active, .actions-summary:active {
    transform: scale(.975); filter: brightness(.96);
  }
  .btn { min-height: 46px; padding: 12px 20px; font-size: 14.5px; }
  .btn-sm { min-height: 40px; padding: 9px 14px; font-size: 13.5px; }
  .btn-lg { min-height: 52px; padding: 14px 22px; font-size: 15.5px; }

  /* CTA empils en pleine largeur: listes d'actions, barres d'actions, formulaires */
  .actions-list .btn,
  .form-actions-bar .btn,
  .form-actions .btn,
  .scan-form-actions .btn,
  .ticket-upload-submit,
  .live-actions-bar .btn,
  .invoice-actions .btn {
    width: 100%; margin: 0;
  }
  .actions-list, .form-actions-bar, .form-actions {
    display: flex; flex-direction: column; gap: 10px;
  }
  .form-actions-bar a.btn-secondary + button,
  .form-actions-bar .btn + .btn { margin-top: 0; }

  /* Sommaire mobile du bloc page-actions, cohrent avec les CTA */
  details.page-actions > summary.actions-summary {
    min-height: 46px; font-size: 14.5px; padding: 12px 20px;
  }

  /* Les paires Ouvrir/Corriger des tableaux restent compactes mais tactiles */
  .bank-row-actions .btn-sm, .card-head .btn-sm { min-height: 40px; }

  /* Danger: mme gabarit que les tertiaires, lisible */
  .btn-danger { min-height: 46px; font-weight: 800; }
}
html[data-theme='dark'] .btn:active {
  filter: brightness(1.08);
}


/* ---- Bandeau d'echeance urgente (<= 14 jours), shell entier. ---- */
.deadline-strip {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 16px; padding: 11px 15px; border-radius: 13px;
  border: 1px solid rgba(214, 124, 24, .35);
  background: linear-gradient(135deg, var(--amber-soft), #fff7ea);
  color: var(--amber); font-size: 13.5px; line-height: 1.4;
  box-shadow: 0 10px 26px -18px rgba(161, 98, 7, .4);
}
.deadline-strip-ico { flex: 0 0 auto; font-size: 15px; }
.deadline-strip-copy b { font-weight: 800; }
.deadline-strip-link {
  margin-left: auto; flex: 0 0 auto;
  padding: 6px 12px; border-radius: 999px; text-decoration: none;
  background: var(--amber); color: #fff; font-size: 12.5px; font-weight: 800;
}
.deadline-strip-link:hover { filter: brightness(1.06); text-decoration: none; }
html[data-theme='dark'] .deadline-strip {
  background: linear-gradient(135deg, rgba(161, 98, 7, .22), rgba(161, 98, 7, .10));
  border-color: rgba(244, 190, 108, .38); color: #ffd28a;
}
html[data-theme='dark'] .deadline-strip-link { color: #201400; }
@media (max-width: 768px) {
  .deadline-strip { font-size: 12.5px; padding: 10px 12px; gap: 8px; }
  .deadline-strip-link { padding: 5px 10px; font-size: 12px; }
}


/* ---- Popup d'installation centre: glass, barre de progression, boutons. ---- */
.pwa-popup-backdrop {
  position: fixed; inset: 0; z-index: 120;
  display: grid; place-items: center; padding: 20px;
  background: rgba(7, 7, 8, .52);
  -webkit-backdrop-filter: blur(6px) saturate(140%);
  backdrop-filter: blur(6px) saturate(140%);
}
.pwa-popup {
  width: min(340px, 100%); padding: 24px 22px 20px;
  border-radius: 22px; text-align: center;
  background: #fff; color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: 0 40px 110px -30px rgba(0, 20, 50, .55);
  animation: pwaPopupIn .28s var(--ease, ease) both;
}
@keyframes pwaPopupIn {
  from { opacity: 0; transform: translateY(14px) scale(.97); }
  to { opacity: 1; transform: none; }
}
.pwa-popup-emoji { display: block; font-size: 34px; margin: 0 0 10px; }
.pwa-popup h3 {
  margin: 0 0 8px; font-family: var(--font-head);
  font-size: 18px; letter-spacing: -.02em; color: var(--ink);
}
.pwa-popup-copy {
  margin: 0 0 14px; font-size: 13px; line-height: 1.55; color: var(--ink-2);
}
.pwa-popup-copy b { font-weight: 800; color: var(--ink); }
.pwa-popup-progress {
  height: 8px; border-radius: 999px; overflow: hidden; margin: 0 0 8px;
  background: rgba(15, 23, 42, .10);
}
.pwa-popup-progress i {
  display: block; width: 0; height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), #4f8dff, #7ba7ff);
  transition: width 1.4s var(--ease, ease);
}
.pwa-popup-state {
  margin: 0 0 14px; font-size: 12px; font-weight: 700; color: var(--muted);
}
.pwa-popup-actions { display: flex; flex-direction: column; gap: 9px; }
.pwa-popup-actions .btn { width: 100%; min-height: 46px; }
html[data-theme='dark'] .pwa-popup {
  background: #141416; color: var(--ink); border-color: var(--line);
  box-shadow: 0 40px 110px -30px rgba(0, 0, 0, .85);
}
html[data-theme='dark'] .pwa-popup-progress {
  background: rgba(255, 255, 255, .08);
}


/* ---- Popup de scan de ticket: centre, au-dessus de tout. ---- */
.scan-popup-backdrop {
  position: fixed; inset: 0; z-index: 130;
  display: grid; place-items: center; padding: 20px;
  background: rgba(7, 7, 8, .52);
  -webkit-backdrop-filter: blur(6px) saturate(140%);
  backdrop-filter: blur(6px) saturate(140%);
}
.scan-popup {
  width: min(400px, 100%); padding: 20px 20px 14px;
  border-radius: 22px; text-align: left;
  background: #fff; color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: 0 40px 110px -30px rgba(0, 20, 50, .55);
  animation: pwaPopupIn .28s var(--ease, ease) both;
}
.scan-popup .scan-head { margin-bottom: 12px; }
.scan-popup .scan-text { max-height: 190px; margin-bottom: 4px; }
.scan-popup .scan-foot { display: flex; justify-content: center; margin-top: 8px; min-height: 34px; }
html[data-theme='dark'] .scan-popup {
  background: #141416; color: var(--ink); border-color: var(--line);
  box-shadow: 0 40px 110px -30px rgba(0, 0, 0, .85);
}


/* ---- Popup de scan revoque: verre liquide, largeur adaptee,
   hauteur fixe (le texte defile a l'interieur, la carte ne bouge plus). ---- */
.scan-popup {
  width: min(92vw, 380px);
  height: 322px;
  display: flex; flex-direction: column;
  padding: 18px 18px 12px;
  background: rgba(255, 255, 255, .68);
  border: 1px solid rgba(255, 255, 255, .55);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 34px 90px -28px rgba(0, 20, 50, .5);
}
.scan-popup .scan-text {
  flex: 1 1 auto; min-height: 0; height: auto;
  max-height: none; overflow: auto;
  background: rgba(255, 255, 255, .35);
  border-color: rgba(15, 23, 42, .08);
}
html[data-theme='dark'] .scan-popup {
  background: rgba(23, 23, 26, .66);
  border-color: rgba(255, 255, 255, .14);
  box-shadow: 0 34px 90px -28px rgba(0, 0, 0, .85);
  color: var(--ink, #f4f4f5);
}
html[data-theme='dark'] .scan-popup .scan-text {
  background: rgba(255, 255, 255, .05);
  border-color: rgba(255, 255, 255, .09);
  color: #c9c9cf;
}


/* ---- Aminia en bulle ronde flottante : jamais au-dessus des contenus,
   s'agrandit en carte compacte au toucher. ---- */
.agent-panel {
  left: auto !important; right: 18px !important;
  bottom: calc(30px + env(safe-area-inset-bottom, 0px)) !important;
}
.agent-panel .agent-dialog {
  width: 96px; height: 96px; min-height: 0; padding: 0;
  flex-direction: column; align-items: center; justify-content: center;
  gap: 0; border: 1px solid rgba(255, 255, 255, .22); border-radius: 50% !important;
  background: rgba(255, 255, 255, .72);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 26px 62px -20px rgba(0, 20, 50, .5);
  cursor: pointer; overflow: hidden;
  transition: width .3s var(--ease, ease), height .3s var(--ease, ease),
    border-radius .3s var(--ease, ease), padding .3s var(--ease, ease);
}
.agent-panel .agent-orb { width: 58px; height: 58px; }
.agent-panel .agent-copy,
.agent-panel .agent-actions { display: none; }
.agent-panel.is-expanded .agent-dialog {
  width: min(92vw, 320px); height: auto; padding: 12px 16px;
  flex-direction: row; align-items: center; gap: 14px;
  border-radius: 22px !important;
  cursor: default; overflow: visible;
}
.agent-panel.is-expanded .agent-orb { width: 48px; height: 48px; flex: 0 0 auto; }
.agent-panel.is-expanded .agent-copy {
  display: block !important; flex: 1; min-width: 0; text-align: left;
}
.agent-panel.is-expanded .agent-actions {
  display: flex !important; flex-direction: column; align-items: center;
  gap: 8px; padding: 0;
}
.agent-panel.is-expanded .agent-mic { width: var(--tap); height: var(--tap); }
@media (max-width: 768px) {
  .agent-panel {
    right: 14px !important;
    bottom: calc(var(--m-footer-h) + env(safe-area-inset-bottom, 0px) + 30px) !important;
  }
  .agent-panel .agent-dialog { width: 78px; height: 78px; }
  .agent-panel .agent-orb { width: 44px; height: 44px; }
  .agent-panel .agent-actions .btn-sm { min-height: 40px; }
}


/* ---- Champ date : aucun debordement sur telephone (tous ecrans). ---- */
@media (max-width: 768px) {
  input[type='date'],
  input[type='datetime-local'],
  input[type='month'] {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    min-height: 42px;
    padding: 6px 6px !important;
    font-size: 13.5px !important;
    -webkit-appearance: none !important;
    appearance: none !important;
  }
  input[type='date']::-webkit-calendar-picker-indicator {
    flex-shrink: 0; width: 15px; height: 15px; opacity: .55;
  }
  /* Les conteneurs laissent leurs enfants retrecir (source des debordements). */
  .form-grid > *, .field, form > div, label[for]:has(input[type='date']) {
    min-width: 0 !important;
    max-width: 100%;
  }
  .field input, .form-grid input, .form-grid select {
    max-width: 100% !important;
  }
}


/* ---- Densite mobile : cartes et pages plus compactes (gagne sur tout). ---- */
@media (max-width: 768px) {
  .dashboard-grid {
    gap: 12px !important;
    padding: 12px 0 !important;
  }
  .stat-card {
    padding: 16px 14px !important;
  }
  .legal-doc {
    padding: 18px 16px !important;
  }
  .ticket-upload-form {
    padding: 16px 14px !important;
  }
  .scan-popup, .pwa-popup { padding: 16px 16px 14px; }
}


/* ---- Aminia a une tete : ecran noir, yeux ivoire qui clignent,
   bouche-vague qui parle. Palette panel #111110 / ivoire / or. ---- */
.agent-core {
  background: linear-gradient(180deg, #1c1c1e 0%, #131314 56%, #0a0a0b 100%) !important;
  border: 1px solid rgba(255, 255, 255, .16) !important;
  border-radius: 18px !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08),
    0 12px 26px -14px rgba(0, 0, 0, .85) !important;
}
/* Yeux */
.agent-core::before,
.agent-core::after {
  content: ''; position: absolute; top: 28%;
  width: 12%; height: 22%; min-width: 5px; min-height: 8px;
  border-radius: 3px; background: #f4f4f4;
  box-shadow: 0 0 8px rgba(244, 244, 244, .5);
  animation: rrsBlink 4.6s ease-in-out infinite;
}
.agent-core::before { left: 26%; }
.agent-core::after { right: 26%; }
/* Bouche simple : barre arrondie qui s ouvre et se ferme quand elle parle. */
.agent-wave i { display: none; }
.agent-wave { height: auto; bottom: 22%; }
.agent-wave::before {
  content: ''; display: block;
  width: 12px; height: 4px; border-radius: 999px;
  background: #e8e8ea; opacity: .92;
  transform-origin: center;
  transition: width .2s ease, background .3s ease;
}
/* Pendant l interaction : la bouche s ouvre, se ferme, passe au vert ok */
.agent-dialog.is-listening .agent-wave::before,
.agent-dialog.is-thinking .agent-wave::before,
.agent-dialog.is-speaking .agent-wave::before {
  background: #8fce9a; width: 14px; height: 6px;
  animation: rrsTalk 380ms ease-in-out infinite;
}
.agent-dialog.is-listening .agent-core::before,
.agent-dialog.is-listening .agent-core::after {
  animation: rrsLook .8s ease-in-out infinite alternate;
}

/* Anneau discret etoile or */
.agent-ring { border-color: rgba(207, 207, 207, .32) !important; }
@keyframes rrsBlink {
  0%, 90%, 100% { height: 22%; }
  94% { height: 6%; }
}
@keyframes rrsTalk {
  0%, 100% { transform: scaleY(.35); }
  50% { transform: scaleY(1.5); }
}

@keyframes rrsLook {
  from { transform: translateX(-22%); }
  to { transform: translateX(22%); }
}

/* ---- Aminia : tete noire + vague ronde reetablie.
   Elle parle : les barres ondulent (vert ok).
   L utilisateur parle : traits d'ecoute qui pulsent. ---- */
.agent-core {
  background: linear-gradient(180deg, #1c1c1e 0%, #131314 56%, #0a0a0b 100%) !important;
  border: 1px solid rgba(255, 255, 255, .16) !important;
  border-radius: 18px !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08),
    0 12px 26px -14px rgba(0, 0, 0, .85) !important;
}
.agent-core::before,
.agent-core::after {
  content: ''; position: absolute; top: 28%;
  width: 12%; height: 22%; min-width: 5px; min-height: 8px;
  border-radius: 3px; background: #f4f4f4;
  box-shadow: 0 0 8px rgba(244, 244, 244, .5);
  animation: rrsBlink 4.6s ease-in-out infinite;
}
.agent-core::before { left: 26%; }
.agent-core::after { right: 26%; }
.agent-ring { border-color: rgba(207, 207, 207, .32) !important; }
.agent-wave {
  position: static; display: flex; align-items: center; justify-content: center;
  gap: 3px; height: 16px;
}
.agent-wave::before { content: none !important; }
.agent-wave i {
  display: block; width: 3px; height: 8px; border-radius: 3px;
  background: #e8e8ea; opacity: .88; animation: none;
}
.agent-dialog.is-speaking .agent-wave i,
.agent-dialog.is-thinking .agent-wave i {
  background: #8fce9a;
  animation: agentWave 1.1s ease-in-out infinite;
}
.agent-dialog.is-speaking .agent-wave i:nth-child(2) { animation-delay: .1s; }
.agent-dialog.is-speaking .agent-wave i:nth-child(3) { animation-delay: .2s; }
.agent-dialog.is-speaking .agent-wave i:nth-child(4) { animation-delay: .3s; }
.agent-dialog.is-speaking .agent-wave i:nth-child(5) { animation-delay: .4s; }
.agent-dialog.is-speaking .agent-wave i:nth-child(6) { animation-delay: .5s; }
.agent-dialog.is-speaking .agent-wave i:nth-child(7) { animation-delay: .6s; }
.agent-dialog.is-listening .agent-wave i {
  width: 4px; height: 12px; background: #f4f4f4; opacity: .55;
  animation: rrsListen 900ms ease-in-out infinite;
}
.agent-dialog.is-listening .agent-wave i:nth-child(2) { animation-delay: .12s; }
.agent-dialog.is-listening .agent-wave i:nth-child(3) { animation-delay: .24s; }
.agent-dialog.is-listening .agent-wave i:nth-child(4) { animation-delay: .36s; }
.agent-dialog.is-listening .agent-wave i:nth-child(5) { animation-delay: .48s; }
.agent-dialog.is-listening .agent-wave i:nth-child(6) { animation-delay: .6s; }
.agent-dialog.is-listening .agent-wave i:nth-child(7) { animation-delay: .72s; }
.agent-dialog.is-listening .agent-core::before,
.agent-dialog.is-listening .agent-core::after {
  animation: rrsLook .8s ease-in-out infinite alternate;
}
.agent-wave::after { content: none !important; }
@keyframes rrsListen { 0%, 100% { opacity: .25; } 50% { opacity: .95; } }
@keyframes rrsBlink { 0%, 90%, 100% { height: 22%; } 94% { height: 6%; } }
@keyframes rrsLook { from { transform: translateX(-22%); } to { transform: translateX(22%); } }


/* ---- Urgences d'echeance: point sur le selecteur + carte globale. ---- */
.m-company-dot {
  flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%;
  background: #d67c18; box-shadow: 0 0 0 3px rgba(214, 124, 24, .18);
  margin-left: auto;
  animation: pulse 1.6s infinite;
}
.m-company-row-text small { color: var(--muted); }
.socie-urgent {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 9px; border-radius: 999px;
  background: var(--red-soft); color: var(--red);
  font-size: 11px; font-weight: 800; margin-left: 6px;
}
html[data-theme='dark'] .socie-urgent {
  background: rgba(220, 38, 38, .16); color: #ff8aa0;
}


/* =====================================================================
   Aminia en plein écran — coque identique à la démo vocale (landing).
   L'ouverture de l'agent verrouille l'écran : overlay bleu + vague.
   ===================================================================== */
.agent-panel {
  position: fixed !important;
  inset: 0 !important;
  left: 0 !important; right: 0 !important; top: 0 !important; bottom: 0 !important;
  display: flex; align-items: center; justify-content: center;
  padding: 24px !important;
  background: rgba(0, 122, 255, .18) !important;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  pointer-events: auto;
  z-index: var(--z-agent-panel);
}
.agent-panel[hidden] { display: none !important; }
.agent-panel .agent-dialog,
.agent-panel.is-expanded .agent-dialog {
  position: relative !important;
  pointer-events: auto;
  opacity: 1 !important;
  display: flex; flex-direction: column; align-items: stretch; gap: 14px;
  width: min(560px, 100%) !important;
  height: min(660px, calc(100dvh - 48px)) !important;
  margin: 0 auto;
  min-height: 0; max-height: calc(100vh - 48px);
  padding: 18px 20px 16px !important; overflow-y: auto;
  text-align: left; border-radius: 16px !important;
  border: 1px solid rgba(255, 255, 255, .22) !important;
  background:
    radial-gradient(680px 320px at 92% 4%, rgba(202, 28, 96, .38), transparent 62%),
    radial-gradient(760px 400px at 2% 100%, rgba(37, 99, 235, .38), transparent 66%),
    #004192 !important;
  color: #fff;
  box-shadow: 0 32px 80px -44px rgba(0, 0, 0, .8);
  animation: agentIn .22s var(--ease) both;
  cursor: default;
}
.agent-panel .agent-dialog h2,
.agent-dialog.voice-stage .voice-agent-title {
  margin: 0; font-family: var(--font-head); font-size: 17px;
  letter-spacing: -.2px; color: #fff; text-align: left;
}
.agent-dialog.voice-stage .voice-chat {
  min-height: 0; max-height: none; flex: 1 1 auto;
  overflow-y: auto; justify-content: flex-end;
}
/* Pas de bulle tant que la transcription en temps réel est vide. */
.agent-dialog.voice-stage .voice-msg:has(p:empty) { display: none; }
.agent-dialog.voice-stage .voice-orb-wrap { padding: 6px 0 2px; }
.agent-dialog.voice-stage .voice-orb { width: 150px; height: 150px; }
.agent-dialog.voice-stage .voice-core { width: 100px; height: 100px; }
.agent-dialog.voice-stage .voice-status { display: none !important; }
.agent-dialog.voice-stage .agent-mic {
  width: 40px; height: 40px; flex: 0 0 40px; border-radius: 50%;
  background: #fff; color: #0b3d91;
  border: 1px solid rgba(255, 255, 255, .4);
  box-shadow: 0 8px 18px -10px rgba(0, 65, 146, .9);
  transition: transform .2s var(--ease), background .2s;
}
.agent-dialog.voice-stage .agent-mic:hover { transform: scale(1.05); background: #dbe8ff; }
.agent-dialog.voice-stage .agent-mic.is-listening {
  background: var(--pink); color: #fff; animation: pulse 1.4s infinite;
}
.agent-dialog.voice-stage .btn-ghost {
  background: rgba(255, 255, 255, .08); color: #fff; border-color: rgba(255, 255, 255, .36);
}
.agent-dialog.voice-stage .btn-ghost:hover {
  background: rgba(255, 255, 255, .16); color: #fff; border-color: #fff;
}
.agent-dialog.voice-stage .agent-log {
  display: flex;
  max-height: 150px;
  background: rgba(255, 255, 255, .08);
  border-color: rgba(255, 255, 255, .18);
  color: #dbe8ff;
}
.agent-dialog.voice-stage .agent-log:empty { display: none; }
.agent-dialog.voice-stage .voice-stage-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
}
.agent-dialog.voice-stage .agent-close-top {
  flex: 0 0 auto;
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 1px solid rgba(255, 255, 255, .36); border-radius: 50%;
  background: rgba(255, 255, 255, .08); color: #fff; cursor: pointer;
  transition: background .2s;
}
.agent-dialog.voice-stage .agent-close-top:hover { background: rgba(255, 255, 255, .2); }
.agent-dialog.voice-stage .agent-close-top .agent-close-x {
  display: inline; font-size: 20px; line-height: 1; font-weight: 700;
}
.agent-dialog.voice-stage .agent-log li.ok { color: #9fe6c3; }
.agent-dialog.voice-stage .agent-log li.error { color: #ff9ab5; }
.agent-dialog.voice-stage.is-listening .voice-core {
  background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .95), rgba(255, 255, 255, .22) 36%, rgba(202, 28, 96, .6) 68%, rgba(138, 14, 63, .65));
  box-shadow: 0 0 60px rgba(255, 143, 189, .5), inset 0 0 40px rgba(255, 255, 255, .22);
}
.agent-dialog.voice-stage.is-thinking .voice-wave i { animation-duration: .55s; }
.agent-dialog.voice-stage.is-done .voice-core {
  background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .95), rgba(255, 255, 255, .22) 36%, rgba(21, 128, 61, .62) 68%, rgba(6, 78, 59, .65));
  box-shadow: 0 0 60px rgba(94, 234, 178, .5), inset 0 0 40px rgba(255, 255, 255, .22);
}
.agent-dialog.voice-stage .voice-chat-box {
  display: flex; flex-direction: column; gap: 8px;
  border-top: 1px solid rgba(255, 255, 255, .14); padding-top: 12px;
}
.agent-dialog.voice-stage .voice-chat-box .agent-chat-log {
  flex: 0 0 auto; max-height: 180px; overflow-y: auto;
  padding: 4px 2px; background: transparent;
  display: flex; flex-direction: column; gap: 8px;
}
.agent-dialog.voice-stage .voice-chat-box .agent-chat-bubble {
  max-width: 92%; font-size: 13px;
}
.agent-dialog.voice-stage .voice-chat-box .agent-chat-bubble--user {
  background: rgba(202, 28, 96, .85); color: #fff;
}
.agent-dialog.voice-stage .voice-chat-box .agent-chat-bubble--assistant {
  background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .24); color: #f3f7ff;
}
.agent-dialog.voice-stage .voice-chat-box .agent-chat-error { color: #ff9ab5; margin: 0; }
.agent-dialog.voice-stage .voice-chat-box .agent-chat-form {
  display: flex; gap: 8px; padding: 0; border-top: 0;
}
.agent-dialog.voice-stage .voice-controls:not(:has(> :not([hidden]))) { display: none; }
.agent-dialog.voice-stage .voice-chat-actions {
  display: flex; align-items: center; gap: 8px;
}
.agent-dialog.voice-stage .voice-chat-actions .agent-chat-form {
  flex: 1; min-width: 0;
}
.agent-dialog.voice-stage .voice-chat-box .agent-chat-form input {
  flex: 1; min-width: 0; border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 12px; padding: 10px 12px; background: rgba(255, 255, 255, .12);
  color: #fff; font: inherit;
}
.agent-dialog.voice-stage .voice-chat-box .agent-chat-form input::placeholder {
  color: rgba(255, 255, 255, .55);
}
.agent-dialog.voice-stage .voice-chat-box .agent-chat-form input:focus {
  outline: 2px solid #9fc4ff; outline-offset: 1px;
}
.agent-dialog.voice-stage .voice-chat-box .agent-chat-form .btn-primary {
  background: #2563eb; color: #fff;
}
.agent-dialog.voice-stage .voice-ring.r1 { border-color: #4f8dff; }

/* ---- Mode réduit : pendant une opération, l'overlay laisse voir l'app ---- */
.agent-panel.is-minimized {
  inset: auto !important;
  left: auto !important;
  top: auto !important;
  right: 16px !important;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
  display: block;
  width: auto !important;
  height: auto !important;
  padding: 0 !important;
  background: transparent !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  pointer-events: none;
}
.agent-panel.is-minimized .agent-dialog,
.agent-panel.is-minimized.is-expanded .agent-dialog {
  pointer-events: auto;
  width: min(360px, calc(100vw - 32px)) !important;
  height: auto !important;
  max-height: min(46dvh, 420px) !important;
  margin: 0;
  padding: 14px 14px 12px !important;
  overflow-y: auto;
  cursor: pointer;
}
.agent-panel.is-minimized .voice-chat,
.agent-panel.is-minimized .voice-orb-wrap,
.agent-panel.is-minimized .voice-controls,
.agent-panel.is-minimized .voice-chat-box { display: none; }
.agent-panel.is-minimized .agent-log { display: flex; max-height: 34dvh; }

@media (max-width: 768px) {
  .agent-panel { padding: 12px !important; }
  .agent-panel .agent-dialog,
  .agent-panel.is-expanded .agent-dialog {
    max-height: calc(100vh - 24px); padding: 14px 14px 12px !important;
  }
  .agent-dialog.voice-stage .voice-orb { width: 128px; height: 128px; }
  .agent-dialog.voice-stage .voice-core { width: 84px; height: 84px; }
}
