/* Kit commun des démos vitrine — charte Oniti (oniti.fr) : Sintony pour les titres, Poppins pour le
   texte ; violet profond #2F008C, violet #6D33EE, texte #66538B, accent menthe #62F7B2.
   Fenêtre applicative dans le style de nos applications (socle Quasar + vlank, cf.
   analyses/style-interfaces.md) : menu latéral réduit aux icônes, fond #F4F4F7, cartes blanches très
   arrondies à ombre diffuse, boutons et champs en pilule, puces pleines.
   Changer le style des démos se fait ici : les jetons de :root (couleurs, polices, arrondis, ombres,
   tailles de texte, densité), puis les composants ui- que les démos assemblent.
   Polices hébergées dans kit/fonts (licence SIL OFL 1.1, cf. OFL-*.txt) : aucun appel à un service tiers. */
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/poppins-400-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/poppins-400-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/poppins-500-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/poppins-500-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/poppins-600-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/poppins-600-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Sintony'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/sintony-400-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Sintony'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/sintony-400-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Sintony'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/sintony-700-latin-ext.woff2') format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Sintony'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/sintony-700-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --font-title: "Sintony", "Poppins", system-ui, sans-serif;
  --font-text: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;

  --primary: #2f008c;       /* violet profond Oniti */
  --accent: #6d33ee;        /* violet Oniti */
  --accent-soft: #efe8fe;
  --mint: #62f7b2;          /* accent menthe Oniti */
  --mint-soft: #e3fdf1;

  --page: #f5f2f9;          /* fond de la page vitrine : #2F008C à 5 % sur blanc */
  --site-text: #66538b;     /* texte courant d'oniti.fr (accroche) */
  --app-bg: #f4f4f7;        /* fond des applications vlank */
  --surface: #ffffff;
  --on-color: #ffffff;      /* texte sur un fond plein (primary, accent, états) */
  --surface-2: #f7f7f9;     /* zones secondaires dans une carte */
  --ink: #1f1d24;           /* texte des données */
  --ink-2: #5f5b68;         /* libellés */
  --muted: #8d8996;
  --line: #e8e7ed;
  --line-2: #d2d0da;        /* contour des champs, emplacements libres */
  --dark: #1a0656;          /* fonds sombres (téléphone, en-tête tiers) */

  --ok: #0f9466;
  --ok-soft: #e3fdf1;
  --wait: #b8690b;
  --wait-soft: #fdf3e2;
  --bad: #c4314f;
  --bad-soft: #fcebef;

  --tone-2: #e8913a;        /* deuxième teinte de catégorie */
  --tone-3: #14a89a;        /* troisième teinte de catégorie */
  --tone-4: #c0399f;        /* quatrième teinte de catégorie */

  --person-1: #7a6fd8;      /* avatars des personnes fictives */
  --person-2: #c2703d;
  --person-3: #3f7f99;
  --person-4: #9a5a8c;
  --bad-line: #f1c9d3;      /* bordure d'une zone bloquée */
  --fill-1: color-mix(in srgb, var(--person-1) 25%, var(--surface));   /* échelle de remplissage */
  --fill-2: color-mix(in srgb, var(--person-1) 55%, var(--surface));
  --fill-3: var(--person-1);
  --phone-body: var(--dark);                                    /* téléphone simulé */
  --phone-screen: linear-gradient(160deg, #3b3550, #24222c);
  --phone-notch: #15141a;
  --hatch-bad: repeating-linear-gradient(135deg, var(--bad-soft) 0 8px, #fdf4f6 8px 16px); /* zone bloquée */

  /* Forme : changer ces jetons modifie l'allure de toutes les démos */
  --radius-xs: 4px;         /* cases à cocher, icônes de fichier, variables d'un texte */
  --radius-sm: 8px;         /* cellules modifiables, petites cases */
  --radius-card: 15px;      /* petites cartes (planning, liste), encarts */
  --radius: 14px;           /* notifications, colonnes */
  --radius-md: 25px;        /* cartes, panneaux, menu latéral (vlank : .q-card) */
  --radius-page: 30px;      /* carte qui porte l'écran (vlank : carte de liste, 35px) */
  --radius-lg: 28px;        /* fenêtre applicative */
  --radius-pill: 999px;     /* boutons, champs, puces */
  --shadow: 0 1px 2px rgba(47,0,140,.06), 0 10px 30px rgba(47,0,140,.10);  /* fenêtre sur la page */
  --shadow-soft: 0 0 29px -4px rgba(0,0,0,.1);     /* cartes vlank */
  --shadow-sm: 0 0 10px rgba(0,0,0,.07);           /* petites cartes */
  --shadow-lift: 0 10px 28px rgba(28,27,34,.18);   /* élément saisi au glisser-déposer */
  --focus: inset 0 0 0 1px var(--primary);         /* champ en cours de saisie (contour 2px) */
  --ring: 2px solid var(--accent);                 /* élément sélectionné (outline) */

  /* Texte de l'application recréée */
  --fs-2xs: 11px;           /* pastilles compactes */
  --fs-xs: 11.5px;          /* en-têtes de colonnes, sous-lignes */
  --fs-sm: 12.5px;          /* libellés, légendes */
  --fs-md: 13.5px;          /* données */
  --fs-title: 17px;         /* titre d'un écran */
  --fs-kpi: 34px;           /* chiffre clé */
  --fw-title: 650;

  /* Densité */
  --pad-x: 18px;            /* marge intérieure horizontale d'un écran */
  --pad-y: 16px;
  --gap: 12px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 14.5px/1.55 var(--font-text);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-title); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 48px 16px 64px; }

/* Accroche */
.pitch { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 36px; align-items: end; margin-bottom: 30px; }
.eyebrow { font-size: 12.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin: 0 0 10px; }
.pitch h1 { font-size: 36px; line-height: 1.15; margin: 0; font-weight: 700; color: var(--primary); }
/* Mot clé souligné en menthe, comme sur oniti.fr */
h1 em { font-style: normal; background: linear-gradient(transparent 82%, var(--mint) 82%, var(--mint) 96%, transparent 96%); }
.pitch p { color: var(--site-text); margin: 0 0 14px; }
.benefits { list-style: none; margin: 0; padding: 0; display: grid; }
.benefits li { display: flex; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--mint); color: var(--primary); font-weight: 500; }
.benefits li:last-child { border-bottom: 0; }
.benefits li::before {
  content: ""; width: 20px; height: 20px; border-radius: 50%; flex: none;
  background: var(--mint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m6 10.3 2.6 2.6L14 7.5' fill='none' stroke='%232f008c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 20px no-repeat;
}

/* Fenêtre applicative */
/* demo.js range le contenu dans .app-page (la carte blanche de l'écran) et ajoute le menu .app-rail
   (icône active : data-rail="planning|liste|finance|documents|equipe|stock|stats|reglages" sur .frame ;
   data-rail="off" : pas de menu). */
.frame { position: relative; background: var(--app-bg); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; user-select: none; }
.frame.has-rail { display: grid; grid-template-columns: 62px minmax(0, 1fr); grid-template-rows: auto 1fr; }
.frame.has-rail > .app-rail { grid-row: 1 / 3; }
.app-page { margin: 0 12px 12px; background: var(--surface); border-radius: var(--radius-page); box-shadow: var(--shadow-soft); overflow: hidden; }
.has-rail > .app-page { margin-left: 4px; }
.app-rail { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 8px 0 8px 8px; padding: 8px 0; background: var(--surface); border-radius: var(--radius-md); box-shadow: 0 0 10px -4px rgba(0,0,0,.18); }
.app-rail span { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: var(--primary); }
.app-rail span.on { color: var(--accent); background: var(--accent-soft); }
.app-rail svg { width: 20px; height: 20px; }
.app-rail .end { margin-top: auto; }
.app-rail .logo { width: 22px; height: 22px; margin-top: 6px; border-radius: 50%; background: var(--primary); box-shadow: inset 0 0 0 6px var(--primary), inset 0 0 0 11px var(--mint); }
.bar { display: flex; align-items: center; gap: 12px; padding: 14px 18px 10px; min-height: 52px; color: var(--ink-2); }
.has-rail > .bar { padding-left: 8px; }
.dots { display: none; }
.bar .app { font-weight: 600; font-size: 13px; color: var(--muted); }
.bar .crumb { color: var(--primary); font-size: 13px; font-weight: 600; }
.bar .spacer { flex: 1; }
.bar .chip { background: var(--surface); border-color: transparent; box-shadow: var(--shadow-sm); }
.bar .chip.on { background: var(--primary); color: var(--on-color); }
.caption { color: var(--muted); font-size: 12.5px; margin-top: 12px; text-align: center; }

/* Éléments d'interface courants */
.chip { font-size: 12px; padding: 3px 10px; border-radius: var(--radius-pill); border: 1px solid var(--line); color: var(--ink-2); background: var(--surface); white-space: nowrap; }
.chip.on { background: var(--primary); border-color: transparent; color: var(--on-color); font-weight: 600; }
/* Puce d'état, pleine à texte blanc comme les q-chip de nos applications */
.pill { font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: var(--radius-pill); background: var(--accent); color: var(--on-color); white-space: nowrap; transition: background .3s, color .3s; }
.pill.ok { background: var(--ok); }
.pill.wait { background: var(--wait); }
.pill.bad { background: var(--bad); }
.pill.sm { font-size: var(--fs-2xs); padding: 1px 7px; }
.pill.off { background: var(--surface-2); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.pill.ico { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; }
.pill svg { width: 13px; height: 13px; }
.btn { font: inherit; font-size: 13px; font-weight: 600; border-radius: var(--radius-pill); padding: 7px 18px; border: 1px solid var(--primary); background: var(--primary); color: var(--on-color); white-space: nowrap; transition: transform .15s, background .3s, color .3s, border-color .3s; }
.btn.ghost { background: var(--surface); color: var(--primary); border-color: var(--line-2); }
.btn.press { transform: scale(.96); }
.btn.done { background: var(--ok); color: var(--on-color); border-color: var(--ok); }
.btn.sm { font-size: 12px; padding: 4px 12px; }
.btn.block { width: 100%; }
.btn.mint { background: var(--mint); border-color: var(--mint); color: var(--primary); }
.btn[aria-disabled="true"], .btn:disabled { opacity: .5; }
.btn.locked { background: var(--surface-2); color: var(--muted); border-color: var(--line); display: inline-flex; align-items: center; gap: 6px; }
.btn.locked svg { width: 13px; height: 13px; }
.flash { animation: demo-flash 1s ease; }
.in { animation: demo-in .45s ease both; }
@keyframes demo-flash { 0% { background: var(--mint-soft); } 100% { background: transparent; } }
@keyframes demo-blink { 50% { opacity: 0; } }
@keyframes demo-in { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: none; } }

/* Composants de l'application recréée (préfixe ui-). Une démo les assemble et ne garde dans son
   propre <style> que sa mise en page. Pour changer leur allure, modifier les jetons ou ce bloc. */
.ui-head { display: flex; align-items: center; gap: var(--gap); padding: var(--pad-y) var(--pad-x) 4px; flex-wrap: wrap; }
.ui-head h2 { font-size: var(--fs-title); margin: 0; font-weight: var(--fw-title); }
.ui-head h2 svg { width: 24px; height: 24px; color: var(--accent); vertical-align: -5px; margin-right: 8px; }
.ui-ref { color: var(--muted); font-size: 13px; }
.ui-spacer { flex: 1; }
.ui-body { padding: 12px var(--pad-x) 20px; }
.ui-split { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; }
.ui-sub { display: block; font-weight: 400; color: var(--muted); font-size: var(--fs-xs); }
.ui-label { font-size: var(--fs-sm); color: var(--ink-2); }
.ui-kpi { font-size: var(--fs-kpi); font-weight: 700; line-height: 1.1; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.ui-sep { height: 1px; background: var(--line); }
.ui-sec { display: block; font-size: var(--fs-xs); font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 0 0 6px; }
.ui-ico { width: 14px; height: 14px; flex: none; }

/* Barre d'outils : navigation, titre de période, légende */
.ui-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 14px 16px 6px; }
.ui-toolbar .ui-title { font-weight: var(--fw-title); font-size: 16px; }
.ui-nav { display: flex; gap: 4px; }
.ui-nav span { width: 28px; height: 28px; border: 1px solid var(--line-2); border-radius: 50%; display: grid; place-items: center; color: var(--muted); font-size: 13px; }
.ui-legend { margin-left: auto; display: flex; gap: 14px; font-size: 12px; color: var(--ink-2); }
.ui-legend span { display: flex; align-items: center; gap: 6px; }
.ui-legend.inline { margin-left: 0; flex-wrap: wrap; gap: 4px 14px; }   /* dans un panneau, reste visible sur mobile */
.ui-dot { width: 8px; height: 8px; border-radius: 50%; display: block; flex: none; background: var(--accent); }
.ui-dot.sq { border-radius: 2px; }

/* Tableau. `.figures` : colonnes chiffrées alignées à droite, sauf la première */
.ui-table { width: 100%; border-collapse: collapse; font-size: var(--fs-md); }
.ui-table th { text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-2); padding: 10px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ui-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.ui-table .num, .ui-table.figures th:not(:first-child), .ui-table.figures td:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ui-table.figures td:first-child { font-weight: 550; }
.ui-table .muted td { color: var(--ink-2); }
.ui-table .muted td:first-child { font-weight: 450; }
.neg { color: var(--bad); }

/* Champ de saisie et cellule modifiable. `.edit` : saisie en cours, avec curseur clignotant */
.ui-input { display: flex; align-items: center; min-height: 40px; padding: 0 16px; border: 1px solid var(--line-2); border-radius: var(--radius-pill); background: var(--surface); font-size: var(--fs-md); transition: border-color .2s, box-shadow .2s; }
.ui-cell { display: inline-block; min-width: 62px; padding: 3px 7px; border-radius: var(--radius-sm); border: 1px solid transparent; transition: border-color .2s, background .2s, box-shadow .2s; }
.ui-input.sm { min-height: 34px; padding: 0 14px; font-size: var(--fs-sm); }
.ui-input.trunc { display: block; line-height: 32px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ui-input.focus { border-color: var(--primary); box-shadow: var(--focus); }   /* sélection sans curseur de saisie */
.ui-input.ok { border-color: var(--ok); }
.ui-input.bad { border-color: var(--bad); color: var(--bad); }
.ui-input.edit, .ui-cell.edit { border-color: var(--primary); background: var(--surface); box-shadow: var(--focus); }
.ui-input.edit::after, .ui-cell.edit::after { content: "|"; color: var(--primary); margin-left: 1px; animation: demo-blink .8s steps(1) infinite; }

/* Panneau latéral ou récapitulatif ; `.plain` : encart blanc plus discret */
.ui-panel { display: flex; flex-direction: column; gap: var(--gap); padding: 18px 20px; background: var(--surface); border-radius: var(--radius-md); box-shadow: var(--shadow-soft); }
.ui-panel.plain { gap: 8px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-card); box-shadow: none; font-size: var(--fs-sm); }
.ui-line { display: flex; align-items: center; gap: 7px; }
.ui-line b { margin-left: auto; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Légende chiffrée : libellé (avec pastille) à gauche, valeur à droite */
.ui-keys { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; font-size: var(--fs-sm); }
.ui-keys span { display: flex; align-items: center; gap: 7px; color: var(--ink-2); }
.ui-keys b { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.ui-keys.lines { gap: 0 12px; }   /* avec filets ; valeur coupée si trop longue */
.ui-keys.lines > * { padding: 7px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.ui-keys.lines b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Barres : jauge de remplissage, barre empilée */
.ui-meter { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.ui-meter i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 2px; transition: width .5s ease; }
.ui-meter.lg { height: 8px; border-radius: var(--radius-pill); background: var(--accent-soft); }
.ui-meter.lg i { border-radius: var(--radius-pill); }
.ui-meter.ok i { background: var(--ok); }
.ui-meter.wait i { background: var(--wait); }
.ui-meter.bad i { background: var(--bad); }
.ui-meter.muted i { background: var(--muted); }
.ui-stack { display: flex; height: 12px; border-radius: 4px; overflow: hidden; gap: 2px; }
.ui-stack i { display: block; height: 100%; transition: width .6s ease; }

/* Avatar d'une personne fictive : .p1 à .p4 */
.ui-av { width: 20px; height: 20px; border-radius: 50%; font-size: 10px; font-weight: 700; display: grid; place-items: center; color: var(--on-color); flex: none; background: var(--person-1); }
.ui-av.p2 { background: var(--person-2); }
.ui-av.p3 { background: var(--person-3); }
.ui-av.p4 { background: var(--person-4); }

/* Carte (planning, liste) : blanche, sans bordure, ombre légère. La catégorie se montre par une
   étiquette .ui-tag, jamais par une bordure colorée. .lift : saisie ; .ghost : emplacement quitté */
.ui-card { background: var(--surface); border-radius: var(--radius-card); padding: 9px 11px; box-shadow: var(--shadow-sm); transition: opacity .3s, transform .3s, box-shadow .2s; }
/* Étiquette de catégorie, en contour (q-chip outline) ; .t2 à .t4 : teinte */
.ui-tag { display: inline-block; font-size: var(--fs-2xs); font-weight: 600; line-height: 1.5; padding: 0 8px; border: 1px solid currentColor; border-radius: var(--radius-pill); color: var(--accent); white-space: nowrap; }
.ui-tag.t2 { color: var(--tone-2); }
.ui-tag.t3 { color: var(--tone-3); }
.ui-tag.t4 { color: var(--tone-4); }
.ui-card.ghost { opacity: .25; }
.ui-card.lift { box-shadow: var(--shadow-lift); transform: rotate(-1.5deg) scale(1.03); }
.ui-slot { border: 1.5px dashed var(--accent); border-radius: var(--radius-card); background: var(--accent-soft); }

/* Interrupteur ; .off : désactivé */
.ui-switch { flex: none; position: relative; width: 38px; height: 22px; border-radius: var(--radius-pill); background: var(--accent); transition: background .25s; }
.ui-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); transform: translateX(16px); transition: transform .25s; }
.ui-switch.off { background: var(--line-2); }
.ui-switch.off::after { transform: none; }

/* Case à cocher ; .on : cochée ; .off : indisponible. .ui-choice : choix en pilule contenant une case */
.ui-check { display: block; flex: none; width: 16px; height: 16px; border-radius: var(--radius-xs); border: 1.5px solid var(--muted); background: var(--surface); position: relative; transition: background-color .2s, border-color .2s; }
.ui-check::after { content: ""; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px; border: solid var(--surface); border-width: 0 2px 2px 0; transform: rotate(45deg) scale(0); transition: transform .2s; }
.ui-check.on { background: var(--primary); border-color: var(--primary); }
.ui-check.on::after { transform: rotate(45deg) scale(1); }
.ui-check.off { border-style: dashed; border-color: var(--line-2); background: var(--surface-2); }
.ui-choice { display: inline-flex; align-items: center; gap: 7px; font-size: var(--fs-sm); padding: 5px 12px 5px 9px; border: 1px solid var(--line-2); border-radius: var(--radius-pill); color: var(--ink-2); background: var(--surface); transition: background .25s, border-color .25s, color .25s, transform .15s; }
.ui-choice .ui-check { width: 15px; height: 15px; border-color: var(--line-2); }
.ui-choice.on { background: var(--accent-soft); border-color: transparent; color: var(--accent); font-weight: 600; }
.ui-choice.on .ui-check { background: var(--accent); border-color: var(--accent); }
.ui-choice.on .ui-check::after { transform: rotate(45deg) scale(1); }
.ui-choice.press { transform: scale(.96); }

/* Liste déroulante : .ui-select (champ avec flèche) et .ui-menu (.show) ; élément .on : courant, .hi : survolé */
.ui-select { justify-content: space-between; gap: 10px; }
.ui-select::after { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-2px) rotate(45deg); flex: none; }
.ui-select.open { border-color: var(--primary); box-shadow: var(--focus); }
.ui-menu { position: absolute; z-index: 8; left: 0; top: calc(100% + 6px); min-width: 200px; background: var(--surface); border-radius: var(--radius-card); box-shadow: var(--shadow-soft); padding: 6px; visibility: hidden; opacity: 0; transform: translateY(-4px); transition: opacity .2s, transform .2s, visibility .2s; }
.ui-menu.show { visibility: visible; opacity: 1; transform: none; }
.ui-menu-item { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 10px; border-radius: var(--radius-pill); font-size: var(--fs-sm); transition: background .15s; }
.ui-menu-item.on { color: var(--accent); font-weight: 600; }
.ui-menu-item.hi { background: var(--accent-soft); color: var(--accent); }

/* Fenêtre ou panneau flottant posé sur l'écran (.show), position réglée dans la démo ;
   .ui-pop-head : bandeau primaire des fenêtres vlank */
.ui-pop { position: absolute; z-index: 6; background: var(--surface); border-radius: var(--radius-md); box-shadow: var(--shadow-lift); padding: 16px 18px; visibility: hidden; opacity: 0; transform: translateY(-6px); transition: opacity .25s, transform .25s, visibility .25s; overflow: hidden; }
.ui-pop.show { visibility: visible; opacity: 1; transform: none; }
.ui-pop h3 { font: 600 14px/1.3 var(--font-title); margin: 0 0 10px; color: var(--primary); }
.ui-pop-head { display: flex; align-items: center; gap: 8px; margin: -16px -18px 14px; padding: 12px 18px; background: var(--primary); color: var(--on-color); font-weight: 600; }
.ui-pop-head h3 { margin: 0; color: inherit; }
.ui-pop-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

/* Bulles : .ui-tip sombre (aide sous un bouton), .ui-bubble claire (valeur d'un graphique) ; .show */
.ui-tip { width: fit-content; max-width: 100%; background: var(--ink); color: var(--surface); font-size: 12px; padding: 5px 12px; border-radius: var(--radius-pill); visibility: hidden; opacity: 0; transition: opacity .25s; }
.ui-bubble { position: absolute; z-index: 5; pointer-events: none; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 7px 12px; font-size: 12px; white-space: nowrap; visibility: hidden; opacity: 0; transition: opacity .2s; }
.ui-bubble b { font-size: 14px; display: block; }
.ui-bubble span { color: var(--muted); }
.ui-tip.show, .ui-bubble.show { visibility: visible; opacity: 1; }

/* Bandeau de message : rouge par défaut, .ok / .wait ; avec .ui-reveal pour une apparition */
.ui-alert { display: flex; gap: 8px; align-items: flex-start; font-size: var(--fs-sm); font-weight: 600; line-height: 1.4; border-radius: var(--radius-card); padding: 8px 12px; background: var(--bad-soft); color: var(--bad); transition: opacity .35s, background .4s, color .4s; }
.ui-alert svg { width: 15px; height: 15px; flex: none; margin-top: 1px; }
.ui-alert.ok { background: var(--ok-soft); color: var(--ok); }
.ui-alert.wait { background: var(--wait-soft); color: var(--wait); }
.ui-alert.ui-reveal { transition: opacity .35s, visibility .35s, background .4s, color .4s; }

/* Étapes d'un circuit : li.done, li.current, li.bad (rejet) ; .closed : circuit terminé */
.ui-steps { display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; gap: 6px; list-style: none; margin: 0; padding: 0; }
.ui-steps li { position: relative; font-size: 12px; color: var(--muted); padding-top: 12px; line-height: 1.3; transition: color .3s; }
.ui-steps li::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; border-radius: var(--radius-pill); background: var(--line); transition: background .4s; }
.ui-steps li.done { color: var(--ink-2); }
.ui-steps li.done::before { background: var(--accent); }
.ui-steps li.current { color: var(--ink); font-weight: 600; }
.ui-steps li.current::before { background: linear-gradient(90deg, var(--accent) 50%, var(--accent-soft) 50%); }
.ui-steps.closed li::before { background: var(--ok); }
.ui-steps li.bad { color: var(--bad); font-weight: 600; }
.ui-steps li.bad::before { background: var(--bad); }

/* Chiffre clé en tuile ; .solid : tuile pleine primaire. Grille : .ui-stats (3 ou 4 colonnes) */
.ui-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.ui-stats.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }   /* nombre de colonnes imposé */
.ui-stats.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ui-stat { background: var(--surface); border-radius: var(--radius-card); box-shadow: var(--shadow-sm); padding: 10px 16px; min-width: 0; }
.ui-stat .ui-kpi { font-size: 24px; color: var(--primary); }
.ui-stat.solid { background: var(--primary); color: var(--on-color); }
.ui-stat.solid .ui-kpi, .ui-stat.solid .ui-label { color: inherit; }

/* Compteur en pastille (dans une puce, un onglet) */
.chip.on .ui-count, .btn .ui-count { background: var(--on-color); color: var(--primary); }
.ui-count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: var(--radius-pill); background: var(--primary); color: var(--on-color); font-size: var(--fs-2xs); font-weight: 700; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; }

/* Étapes numérotées : .ui-stepper > span (numéro en <b>) ; .current, .done */
.ui-stepper { display: flex; flex-wrap: wrap; gap: 8px; }
.ui-stepper > span { display: inline-flex; align-items: center; gap: 7px; padding: 4px 12px 4px 4px; border-radius: var(--radius-pill); background: var(--surface-2); color: var(--muted); font-size: var(--fs-sm); transition: background .3s, color .3s; }
.ui-stepper b { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: inherit; font-size: var(--fs-2xs); box-shadow: var(--shadow-sm); }
.ui-stepper .current { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.ui-stepper .done { background: var(--ok-soft); color: var(--ok); }

/* Curseur de réglage : .ui-slider > i (remplissage, largeur en %) + b (poignée, left en %) */
.ui-slider { position: relative; height: 5px; border-radius: var(--radius-pill); background: var(--accent-soft); }
.ui-slider i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: inherit; background: var(--accent); transition: width .4s; }
.ui-slider b { position: absolute; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); box-shadow: var(--shadow-sm); transition: left .4s; }

/* Zone de dépôt : vide (pointillés), .over (survolée), .filled (remplie) */
.ui-drop { border: 1.5px dashed var(--line-2); border-radius: var(--radius-card); background: var(--surface-2); color: var(--muted); transition: border-color .2s, background .2s; }
.ui-drop.over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.ui-drop.filled { border-style: solid; border-color: transparent; background: var(--surface); box-shadow: var(--shadow-sm); color: var(--ink); }

/* Fichier ou document : icône à extension, nom, détail */
.ui-file { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ui-file-ico { flex: none; display: grid; place-items: center; width: 40px; height: 48px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent); font: 700 10.5px/1 var(--font-title); letter-spacing: .04em; }
.ui-file-ico.sm { width: 24px; height: 28px; border-radius: var(--radius-xs); font-size: 8.5px; }
.ui-file-txt { min-width: 0; flex: 1; }
.ui-file-txt b, .ui-file-txt small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ui-file-txt b { color: var(--ink); font-weight: 600; }
.ui-file-txt small { color: var(--muted); font-size: var(--fs-xs); }
.ui-file.box { padding: 10px 12px; border-radius: var(--radius-card); background: var(--surface-2); }   /* pièce jointe, fichier produit */
.ui-file.att { display: inline-flex; gap: 8px; padding: 4px 12px 4px 4px; border-radius: var(--radius-pill); background: var(--surface-2); font-size: var(--fs-sm); }

/* Vues superposées : la scène prend la hauteur de la plus haute, une seule est visible (.on) */
.ui-stage { display: grid; }
.ui-view { grid-area: 1 / 1; min-width: 0; visibility: hidden; opacity: 0; transition: opacity .3s, visibility .3s; }
.ui-view.on { visibility: visible; opacity: 1; }

/* Téléphone simulé (illustration) : la taille se règle dans la démo ; .ui-sheet : volet montant (.on) */
.ui-phone { flex: none; border-radius: 22px; background: var(--phone-body); padding: 7px; box-shadow: var(--shadow); }
.ui-phone-scr { position: relative; height: 100%; border-radius: 16px; background: var(--phone-screen); overflow: hidden; }
.ui-phone-scr::before { content: ""; position: absolute; z-index: 6; top: 7px; left: 50%; width: 36px; height: 5px; margin-left: -18px; border-radius: 3px; background: var(--phone-notch); }
.ui-sheet { position: absolute; z-index: 4; left: 0; right: 0; bottom: 0; background: var(--surface); border-radius: var(--radius-md) var(--radius-md) 0 0; padding: 12px 14px; transform: translateY(105%); transition: transform .45s cubic-bezier(.3,.7,.3,1); color: var(--ink); }
.ui-sheet.on { transform: none; }
.ui-sheet::before { content: ""; display: block; width: 36px; height: 4px; border-radius: var(--radius-pill); background: var(--line); margin: 0 auto 10px; }

/* Place réservée dès le départ : l'élément apparaît sans changer la hauteur de la fenêtre */
.ui-reveal { visibility: hidden; opacity: 0; transition: opacity .4s; }
.ui-reveal.show { visibility: visible; opacity: 1; }

/* Curseur simulé */
.cursor { position: absolute; left: 0; top: 0; width: 22px; height: 22px; z-index: 30; pointer-events: none; transition: transform .8s cubic-bezier(.45,.05,.25,1), opacity .3s; opacity: 0; filter: drop-shadow(0 2px 3px rgba(47,0,140,.3)); }
.cursor.click::after { content: ""; position: absolute; left: -9px; top: -9px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--accent); animation: demo-ring .45s ease-out forwards; }
@keyframes demo-ring { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.4); opacity: 0; } }

/* Notification */
.toast { position: absolute; right: 18px; top: 58px; z-index: 25; background: var(--primary); color: var(--on-color); border-radius: var(--radius); padding: 10px 14px; font-size: 13px; display: flex; gap: 10px; align-items: center; box-shadow: var(--shadow); opacity: 0; transform: translateY(-8px); transition: opacity .3s, transform .3s; pointer-events: none; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: none; }
.toast svg { width: 16px; height: 16px; flex: none; color: var(--mint); }

/* Mode intégré (?embed=1, posé par demo.js) : seule la fenêtre animée est affichée, pour une
   iframe dans une page du site. Une marge est conservée pour que l'ombre ne soit pas rognée. */
html.embed body { background: transparent; }
html.embed .wrap { max-width: none; padding: 10px 14px 24px; }
html.embed .pitch, html.embed .caption { display: none; }

@media (max-width: 820px) {
  .ui-split { grid-template-columns: minmax(0, 1fr); }
  .ui-legend:not(.inline) { display: none; }
  .pitch { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .pitch h1 { font-size: 28px; }
  .bar .chip:not(.on) { display: none; }
}
@media (max-width: 600px) {
  .frame.has-rail { display: block; }
  .app-rail { display: none; }
  .has-rail > .bar { padding-left: 14px; }
  .app-page, .has-rail > .app-page { margin: 0 8px 8px; border-radius: var(--radius-md); }
}
@media (max-width: 520px) {
  .ui-head, .ui-body { padding-left: 12px; padding-right: 12px; }
  .ui-table { font-size: 12.5px; }
  .ui-table th, .ui-table td { padding: 8px 4px; }
  .ui-cell { min-width: 0; padding: 2px 4px; }
  .ui-kpi { font-size: 30px; }
  .ui-stats.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ui-stepper { gap: 6px; }
  .ui-stepper > span { padding: 3px 9px 3px 3px; gap: 5px; font-size: var(--fs-xs); }
  .ui-stepper b { width: 18px; height: 18px; flex: none; }
  .ui-stat .ui-kpi { font-size: 20px; }
}
@media (max-width: 460px) {
  .bar .crumb { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .cursor { display: none; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
