/* Constellae — habillage Cobalt V5.
 * Les tokens (couleurs, radius, ombres, motion) viennent de theme.css.
 * Police : Montserrat pour les titres, system-ui pour le corps. */

:root {
    /* Mappage sémantique vers les tokens Cobalt */
    --bg: var(--color-neutral-background-soft);        /* fond de page doux */
    --surface: var(--color-neutral-background-medium); /* cartes / panneaux (blanc) */
    --surface-2: var(--color-neutral-background-soft);
    --border: var(--color-neutral-border-medium);
    --border-strong: var(--color-neutral-border-strong);
    --text: var(--color-neutral-content-strong);
    --muted: var(--color-neutral-content-medium);
    --accent: var(--color-brand-content);              /* bleu numérique #5B28F5 */
    --accent-hover: var(--color-action-primary-background-interacting);
    --danger: var(--color-status-content-error);
    --danger-bg: var(--color-status-background-error);
    --ok: var(--color-status-content-success);
    --ok-bg: var(--color-status-background-success);
    --warn: var(--color-status-content-warning);
    --warn-bg: var(--color-status-background-warning);
    --radius: var(--number-radius-3xsmall);            /* 2px */
    --radius-round: var(--number-radius-round);
    --shadow: var(--effect-drop-small);
    --shadow-m: var(--effect-drop-medium);
    --shadow-l: var(--effect-drop-large);

    /* Barre de navigation : neutre clair (Cobalt), accents bleus */
    --nav-bg: rgba(255, 255, 255, .82);
    --nav-text: var(--color-neutral-content-strong);
    --nav-text-dim: var(--color-neutral-content-medium);
    --nav-hover: var(--color-neutral-background-soft);
    --nav-active: #5B28F5;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: Montserrat, system-ui, sans-serif; letter-spacing: -0.02em; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.center { text-align: center; }
.error { color: var(--danger); }
code {
    background: var(--color-neutral-background-soft); padding: 1px 6px;
    border-radius: var(--radius); font-size: .9em;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

/* ===== Boutons (Cobalt : primaire / secondaire / ghost / danger) ===== */
button {
    font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap;
    border: 1px solid transparent; border-radius: var(--radius);
    padding: 9px 16px;
    background: var(--color-action-primary-background-default);
    color: var(--color-action-primary-content-default);
    transition: background var(--motion-duration-fast) var(--motion-easing-move),
                border-color var(--motion-duration-fast), opacity var(--motion-duration-fast);
}
button:hover { background: var(--color-action-primary-background-interacting); }
button:focus-visible { outline: 2px solid var(--color-global-border-focus); outline-offset: 2px; }
button:disabled { opacity: .5; cursor: default; }
button.ghost {
    background: var(--color-action-secondary-background-default);
    color: var(--color-action-secondary-content-default); border-color: transparent;
}
button.ghost:hover { background: var(--color-action-secondary-background-interacting); }
button.small { padding: 6px 12px; font-size: .85rem; }
button.danger {
    background: transparent; color: var(--danger); border-color: var(--border-strong);
}
button.danger:hover { background: var(--danger-bg); border-color: var(--danger); }
button.danger-solid { background: var(--color-status-background-error-accent); color: #fff; }
button.danger-solid:hover { background: var(--danger); }

input[type=text], input[type=password], input[type=email], input[type=search], select, textarea {
    font: inherit; width: 100%; padding: 9px 12px;
    border-radius: var(--radius);
    border: 1px solid var(--color-edition-border-default);
    background: var(--color-edition-background-default);
    color: var(--color-edition-content-default);
    transition: border-color var(--motion-duration-fast), box-shadow var(--motion-duration-fast);
}
input[type=text]:focus, input[type=password]:focus, input[type=email]:focus, input[type=search]:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--color-edition-border-interacting);
    box-shadow: 0 0 0 3px rgba(48, 103, 255, .18);
}
input[type=file] { font: inherit; color: var(--muted); width: 100%; }

/* ===== Login ===== */
.login-view { min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card {
    width: 350px; max-width: 100%;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-m);
    padding: 32px; display: flex; flex-direction: column; gap: 12px;
}
.login-logo { width: 60px; height: 60px; display: grid; place-items: center; margin: 0 auto 4px; }
.login-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.login-card h1 { margin: 0 0 6px; font-size: 1.5rem; text-align: center; }
.login-card label { display: grid; gap: 5px; font-size: .85rem; color: var(--muted); }
.login-card button { margin-top: 6px; }

/* ===== Chrome : barre flottante BLEUE, révélée au survol ===== */
.hover-zone { position: fixed; top: 0; left: 0; right: 0; height: 16px; z-index: 50; }
.chrome {
    position: fixed; top: 10px; left: 12px; right: 12px; z-index: 60;
    display: flex; align-items: center; gap: 14px; padding: 8px 14px;
    background: var(--nav-bg); color: var(--nav-text);
    border: 1px solid var(--color-neutral-border-medium);
    border-radius: 20px;                                  /* barre bien arrondie */
    -webkit-backdrop-filter: blur(16px) saturate(1.6);
    backdrop-filter: blur(16px) saturate(1.6);
    opacity: 0; transform: translateY(-180%);
    transition: transform var(--motion-duration-medium) var(--motion-easing-enter),
                opacity var(--motion-duration-fast) ease;
    box-shadow: var(--shadow-l);
}
.hover-zone:hover + .chrome, .chrome:hover, .chrome:focus-within { transform: translateY(0); opacity: 1; }
.chrome-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.chrome-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.chrome-runner { display: flex; align-items: center; gap: 8px; }
.brand {
    font-family: Montserrat, system-ui, sans-serif; font-weight: 700; font-size: .98rem;
    white-space: nowrap; color: var(--nav-text); display: inline-flex; align-items: center; gap: 8px;
}
.brand-bird { height: 20px; width: auto; display: block; }

.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav-btn {                                                /* boutons ovales (pilule) */
    background: transparent; color: var(--nav-text-dim); font-weight: 500;
    border: 1px solid transparent; padding: 8px 16px; font-size: .88rem;
    border-radius: var(--radius-round);
    transition: background var(--motion-duration-fast), color var(--motion-duration-fast);
}
.nav-btn:hover { background: var(--nav-hover); color: var(--nav-text); }
.nav-btn:focus-visible { outline: 2px solid var(--color-global-border-focus); outline-offset: 1px; }
.nav-btn.active { background: var(--nav-active); color: #fff; }
.nav-btn.active .count { background: #fff; color: var(--accent); }

/* Menu déroulant « Administration » */
.nav-dropdown { position: relative; display: inline-flex; }
.nav-dropdown > .nav-btn { display: inline-flex; align-items: center; gap: 6px; }
.caret { font-size: .7rem; opacity: .85; }
.nav-menu {
    position: absolute; top: calc(100% + 8px); left: 0; min-width: 210px;
    background: var(--surface); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-l); padding: 8px; z-index: 70;
    display: flex; flex-direction: column; gap: 3px;
}
.menu-item {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    width: 100%; text-align: left; background: transparent; color: var(--text);
    font-weight: 500; padding: 10px 12px; border-radius: 9px;
}
.menu-item:hover { background: var(--color-neutral-background-soft); color: var(--accent); }

/* Menu utilisateur (à droite) */
.user-menu { position: relative; display: inline-flex; }
.user-btn { display: inline-flex; align-items: center; gap: 7px; max-width: 220px; }
.user-btn #user-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-dropdown { left: auto; right: 0; min-width: 316px; }
.user-card {
    display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
    padding: 10px 11px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--border);
}
.user-card-name { font-weight: 700; font-family: Montserrat, sans-serif; }
.user-card-mail { font-size: .82rem; color: var(--muted); word-break: break-all; }
.user-card .role-chip { margin-top: 2px; }
.menu-label {
    font-size: .7rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
    color: var(--muted); padding: 6px 11px 2px;
}
.menu-sep { height: 1px; background: var(--border); margin: 5px 0; }
.menu-lang { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 12px; font-size: 13px; color: var(--text); }
.menu-lang select { flex: 0 0 auto; padding: 5px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface, #fff); color: var(--text); font-size: 13px; cursor: pointer; }
/* Menu : groupes repliables */
/* Hauteur : descend jusqu'au bas de la fenêtre ; l'ascenseur n'apparaît que si le contenu dépasse. */
.user-dropdown { max-height: calc(100dvh - 60px); overflow-y: auto; }
.menu-group { border-radius: 10px; margin: 2px 0; }
.menu-group-h {
    width: 100%; text-align: left; background: none; border: none; cursor: pointer;
    display: flex; align-items: center; gap: 8px; padding: 11px 12px;
    font-size: .74rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
    color: var(--muted); border-radius: 10px;
}
.menu-group-h:hover { background: var(--surface-2, #f0f0f4); color: var(--accent); }
.menu-group-h .mg-caret { margin-left: 6px; transition: transform .15s; font-size: .9rem; }
.menu-group.open .menu-group-h .mg-caret { transform: rotate(180deg); }
.menu-group-body { display: none; padding: 2px 0 6px; }
.menu-group.open .menu-group-body { display: block; }
.menu-group-body .menu-item { padding-left: 20px; }
.menu-group-body .mg-note { padding: 4px 20px 8px; line-height: 1.35; opacity: .9; }
/* Pastille de rôle (qui a accès à la section) */
.mg-role { margin-left: auto; font-size: .58rem; font-weight: 700; letter-spacing: .02em; text-transform: none;
    padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.mg-role-you     { background: #eef0f4; color: #5a5a66; }
.mg-role-admin   { background: #e8f0fe; color: #1a56c4; }
.mg-role-dev     { background: #e6f6ef; color: #0a7d52; }
.mg-role-partner { background: #fdf1dc; color: #9a6a00; }
.mg-role-super   { background: #f0eaff; color: #5b28f5; }
/* Teinte de section très claire (identification visuelle, reste lisible).
   Le corps de la section prend une teinte très légère ; l'en-tête (survol ou déplié)
   prend la teinte de la pastille avec un texte de couleur lisible — jamais de fond foncé. */
.menu-group.mg-admin.open    { background: #f6f9ff; }
.menu-group.mg-dev.open      { background: #f3fbf7; }
.menu-group.mg-partner.open  { background: #fefaf1; }
.menu-group.mg-platform.open { background: #f8f5ff; }
.menu-group.mg-perso.open    { background: #fafafb; }
.mg-admin    .menu-group-h:hover, .mg-admin.open    > .menu-group-h { background: #e8f0fe; color: #1a56c4; }
.mg-dev      .menu-group-h:hover, .mg-dev.open      > .menu-group-h { background: #e3f5ec; color: #0a7d52; }
.mg-partner  .menu-group-h:hover, .mg-partner.open  > .menu-group-h { background: #fbeecd; color: #8a5f00; }
.mg-platform .menu-group-h:hover, .mg-platform.open > .menu-group-h { background: #ece4ff; color: #5b28f5; }
.mg-perso    .menu-group-h:hover, .mg-perso.open    > .menu-group-h { background: #eceef3; color: #4a4a55; }
/* Aide intégrée aux modules complexes (repliable, native <details>). */
.module-help { margin: 0 0 16px; border: 1px solid var(--border); border-radius: 12px; background: #f8f9fc; overflow: hidden; }
.module-help > summary { cursor: pointer; padding: 12px 16px; font-weight: 600; font-size: .9rem; color: var(--accent, #5B28F5); list-style: none; display: flex; align-items: center; gap: 8px; }
.module-help > summary::-webkit-details-marker { display: none; }
.module-help[open] > summary { border-bottom: 1px solid var(--border); }
.module-help-body { padding: 12px 18px 16px; font-size: .9rem; color: var(--text); line-height: 1.55; }
.module-help-body p { margin: 8px 0; }
.module-help-body ol, .module-help-body ul { margin: 6px 0 8px 20px; }
.mcp-tools li { margin: 4px 0; }
.module-help-body li { margin: 4px 0; }
.module-help-body code { background: var(--surface-2,#f0f0f4); padding: 1px 5px; border-radius: 5px; font-size: .86em; }
.help-code { background: #1e1e2a; color: #e6e6f0; padding: 12px 14px; border-radius: 8px; font-size: .82rem; overflow-x: auto; margin: 6px 0; white-space: pre; }
/* Tableau de bord de pilotage */
.dash-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin: 4px 0 18px; }
.dash-kpi { background: var(--surface,#fff); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.dash-kpi-v { font-size: 1.6rem; font-weight: 700; font-family: Montserrat, sans-serif; }
.dash-kpi-l { font-size: .82rem; color: var(--text-dim,#5A5A66); margin-top: 2px; }
.dash-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 900px) { .dash-cols { grid-template-columns: 1fr; } }
.dash-bars { display: flex; flex-direction: column; gap: 8px; }
.dash-bar-row { display: flex; align-items: center; gap: 10px; font-size: .85rem; }
.dash-bar-lab { flex: 0 0 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-bar-track { flex: 1 1 auto; height: 10px; background: var(--surface-2,#f0f0f4); border-radius: 999px; overflow: hidden; }
.dash-bar-fill { display: block; height: 100%; background: var(--accent,#5B28F5); border-radius: 999px; }
.dash-bar-val { flex: 0 0 auto; font-variant-numeric: tabular-nums; color: var(--text-dim,#5A5A66); }
/* Éditeur de plan */
.plan-flags { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 10px 0; }
.plan-modgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px 14px; margin: 6px 0 12px; }
.plan-modgrid .check { font-size: .88rem; }

/* Éléments réservés au foot-menu mobile (masqués sur ordinateur) */
.menu-burger { display: none; font-size: 1.05rem; line-height: 1; }
.menu-mobile-nav { display: none; }

/* Zone de dépôt (glisser-déposer) */
.dropzone {
    border: 2px dashed var(--color-neutral-border-strong); border-radius: var(--radius);
    background: var(--color-neutral-background-soft); color: var(--color-neutral-content-medium);
    padding: 26px 18px; text-align: center; cursor: pointer; margin-bottom: 14px;
    transition: border-color var(--motion-duration-fast), background var(--motion-duration-fast);
}
.dropzone:hover, .dropzone.dragover {
    border-color: var(--accent); background: var(--color-brand-background); color: var(--accent);
}
.dropzone-icon { display: inline-block; color: var(--accent); }
.dropzone-text { font-weight: 600; color: var(--text); margin: 8px 0 2px; }
.dropzone-sub { font-size: .8rem; color: var(--muted); margin: 0 0 10px; }
.dropzone-file { margin: 12px 0 0; font-size: .88rem; font-weight: 600; color: var(--accent); word-break: break-all; }

/* --- Dépôt compact réutilisable (glisser-déposer + aperçu) ----------------
 * Variante « tuile » utilisée pour l'icône, l'image marketing, les captures,
 * l'image de carte et l'icône PWA — dans la fenêtre de dépôt Cosmos et la
 * fenêtre d'upload des Novas personnelles (même format partout). */
.dz {
    position: relative; display: flex; align-items: center; gap: 12px;
    border: 2px dashed var(--color-neutral-border-strong); border-radius: var(--radius);
    background: var(--color-neutral-background-soft); color: var(--color-neutral-content-medium);
    padding: 12px 14px; cursor: pointer; text-align: left;
    transition: border-color var(--motion-duration-fast), background var(--motion-duration-fast);
}
.dz:hover, .dz.dragover { border-color: var(--accent); background: var(--color-brand-background); }
.dz-thumb {
    flex: 0 0 auto; width: 54px; height: 54px; border-radius: 10px; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    background: var(--color-neutral-background); border: 1px solid var(--color-neutral-border);
    color: var(--accent);
}
.dz-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dz-thumb svg { opacity: .7; }
.dz-square .dz-thumb { border-radius: 12px; }
.dz-square .dz-thumb img { object-fit: contain; }
.dz-body { flex: 1 1 auto; min-width: 0; }
.dz-title { font-weight: 600; color: var(--text); font-size: .9rem; }
.dz-hint { font-size: .78rem; color: var(--muted); margin-top: 2px; line-height: 1.35; }
.dz-file { font-size: .82rem; font-weight: 600; color: var(--accent); margin-top: 3px; word-break: break-all; }
.dz-clear {
    flex: 0 0 auto; border: none; background: transparent; color: var(--muted);
    font-size: 1.1rem; line-height: 1; cursor: pointer; padding: 4px 6px; border-radius: 8px;
}
.dz-clear:hover { color: var(--danger, #dc2626); background: var(--color-neutral-background); }
.dz-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
@media (max-width: 640px) { .dz-grid { grid-template-columns: 1fr; } }

/* Analyse auto (usages + sécurité) dans la fenêtre d'upload */
.up-analysis {
    border: 1px solid var(--color-neutral-border); border-radius: 10px;
    padding: 10px 12px; line-height: 1.4; background: var(--color-neutral-background-soft);
}
.up-analysis.ok   { border-color: color-mix(in srgb, #16a34a 45%, transparent); background: color-mix(in srgb, #16a34a 8%, transparent); color: var(--text); }
.up-analysis.warn { border-color: color-mix(in srgb, #d97706 50%, transparent); background: color-mix(in srgb, #d97706 10%, transparent); color: var(--text); }
.up-analysis.err  { border-color: color-mix(in srgb, #dc2626 55%, transparent); background: color-mix(in srgb, #dc2626 10%, transparent); color: var(--text); }

/* Chrome côté runner : on garde le bandeau lisible par-dessus l'artifact */
.who { font-size: .82rem; color: var(--nav-text-dim); }
.runner-title { font-size: .88rem; color: var(--nav-text-dim); max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Pastille de comptage (accent bleu sur barre claire) */
.count {
    display: inline-grid; place-items: center; min-width: 19px; height: 19px;
    padding: 0 6px; border-radius: var(--radius-round);
    background: var(--accent); color: #fff; font-size: .72rem; font-weight: 700;
}
.menu-item .count { background: var(--accent); color: #fff; }

/* ===== Main / vues ===== */
#main { min-height: 100vh; min-height: 100dvh; }
.view { max-width: 1100px; margin: 0 auto; padding: 64px 22px 60px; }
/* Vues à tableaux larges (inventaire, usage IA) : on profite de la largeur
   disponible pour éviter que les colonnes ne se serrent et que les pastilles
   ne soient coupées ou ne passent sur deux lignes. */
#view-history, #view-aiusage { max-width: 1360px; }
/* Pages « Agents IA » (org) et admin plateforme : on occupe TOUTE la largeur utile.
   La section officielle Constellae (4 cartes/ligne) s'étend ainsi sur toute la fenêtre. */
#view-platagents, #view-agents { max-width: none; }
.view-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; gap: 12px; }
.view-head h2 { margin: 0; font-size: 1.5rem; }

/* ===== Cartes ===== */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column;
    transition: transform var(--motion-duration-fast), box-shadow var(--motion-duration-fast);
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-m); }
.card .thumb {
    height: 122px; display: grid; place-items: center; cursor: pointer;
    background: linear-gradient(135deg, #5B28F5, #9B7DFF);
    color: #fff; font-size: 2.2rem; font-weight: 700; font-family: Montserrat, sans-serif;
}
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .body { padding: 13px 14px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.card .title { font-weight: 600; line-height: 1.25; overflow: hidden; }
.card .subtitle { font-size: .82rem; color: var(--muted); }
.card .meta { display: flex; align-items: center; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.card .actions { display: flex; gap: 6px; padding: 0 14px 13px; flex-wrap: wrap; }
.card .actions button { flex: 1; }

.badge { display: inline-block; white-space: nowrap; font-size: .7rem; padding: 2px 9px; border-radius: var(--radius-round); border: 1px solid var(--border); color: var(--muted); }
.badge.pending { color: var(--warn); border-color: transparent; background: var(--warn-bg); }
.badge.rejected { color: var(--danger); border-color: transparent; background: var(--danger-bg); }
.badge.shared { color: var(--accent); border-color: transparent; background: var(--color-brand-background); }

/* ===== Comptes (tableau, style KPI) ===== */
.panel {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 22px 24px; overflow: hidden;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.panel-title {
    margin: 0; font-size: .8rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
    color: var(--color-neutral-content-medium);
}
.panel-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.panel-actions #user-new { flex: none; }
.acct-search { width: 220px; max-width: 100%; flex: 1 1 160px; min-width: 140px; }
.table-scroll { overflow-x: auto; }
.utable { width: 100%; border-collapse: collapse; min-width: 720px; }
.utable th, .utable td { text-align: left; padding: 14px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.utable thead th { font-size: .82rem; font-weight: 500; color: var(--color-neutral-content-medium); border-bottom: 1px solid var(--border); }
.utable tbody tr { transition: background var(--motion-duration-fast); }
.utable tbody tr:hover { background: var(--color-neutral-background-soft); }
.utable tbody tr:last-child td { border-bottom: none; }
.utable tr.inactive .col-name, .utable tr.inactive .col-email { opacity: .5; }
.utable .col-name { font-weight: 600; white-space: nowrap; }
.utable .nowrap { white-space: nowrap; }
.utable .col-email { font-size: .92rem; }
.ta-right { text-align: right; }

.me-badge {
    font-size: .68rem; font-weight: 600; padding: 1px 8px; border-radius: var(--radius-round);
    background: var(--color-brand-background); color: var(--accent); vertical-align: middle;
}
.role-chip {
    display: inline-block; font-size: .78rem; padding: 3px 12px; border-radius: var(--radius-round);
    background: var(--color-neutral-background-soft); color: var(--color-neutral-content-medium);
}
.admin-pill {
    display: inline-block; font-size: .78rem; font-weight: 600; padding: 3px 12px; border-radius: var(--radius-round);
    background: var(--color-brand-background); color: var(--accent);
}

.row-actions { display: flex; gap: 8px; justify-content: flex-end; }
.icon-btn {
    width: 34px; height: 34px; padding: 0; display: grid; place-items: center;
    background: var(--surface); color: var(--color-neutral-content-medium);
    border: 1px solid var(--border); border-radius: var(--radius-round);
    transition: background var(--motion-duration-fast), color var(--motion-duration-fast), border-color var(--motion-duration-fast);
}
.icon-btn:hover { background: var(--color-neutral-background-soft); color: var(--accent); border-color: var(--border-strong); }
/* Action destructive : même FORME que les autres (icône cernée), couleur danger
   — plus de cercle rouge plein, pour un jeu d'actions homogène dans les tableaux. */
.icon-btn.danger { color: var(--danger); background: var(--surface); border-color: var(--border); }
.icon-btn.danger:hover { color: var(--danger); border-color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, #fff); }
.icon-btn:disabled { opacity: .4; cursor: default; }

@media (max-width: 560px) {
    .panel { padding: 16px; }
    .panel-head { flex-direction: column; align-items: stretch; }
    .acct-search { width: 100%; max-width: none; }
}

/* ===== Page Mises à jour ===== */
.cob-panel {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 22px; margin-bottom: 26px;
}
.cob-panel h3 { margin: 0 0 6px; font-size: 1.05rem; }
/* Mon profil */
.profile-head { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.profile-av { width: 96px; height: 96px; border-radius: 50%; flex: none; display: grid; place-items: center;
    font-weight: 800; font-size: 2rem; color: var(--accent, #5B28F5);
    background: color-mix(in srgb, var(--accent, #5B28F5) 8%, #fff) url("avatar-voila-faint.png") center/cover no-repeat;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent, #5B28F5) 22%, transparent); }
.profile-av.user-av-img { color: transparent; background: #ECE7FB center/cover no-repeat; box-shadow: inset 0 0 0 1px rgba(91,40,245,.25); }
.profile-av-actions { display: flex; flex-direction: column; gap: 6px; min-width: 220px; }
.profile-display { margin: 0; font-size: 1.15rem; }
.btn-file { display: inline-block; font-weight: 500; cursor: pointer; border-radius: var(--radius);
    padding: 6px 12px; font-size: .85rem; background: var(--color-action-secondary-background-default);
    color: var(--color-action-secondary-content-default); border: 1px solid transparent; }
.btn-file:hover { background: var(--color-action-secondary-background-interacting); }
.danger-zone { border-color: var(--danger, #E71616); }
.danger-zone h3 { color: var(--danger, #E71616); }
.login-lang { margin-top: 12px; font-size: .85rem; color: var(--muted); }
/* Modération */
.mod-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.mod-row { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius); }
.mod-row code { background: var(--color-neutral-background-soft); padding: 1px 7px; border-radius: 5px; }
.mod-row button { margin-left: auto; }
.card-mod-flag { margin-top: 8px; padding: 7px 10px; border-radius: var(--radius);
    background: var(--danger-bg, #ffedeb); color: var(--danger, #C0341A); font-size: .8rem; line-height: 1.4; }
/* Recadrage photo de profil */
.crop-stage { display: flex; justify-content: center; margin: 6px 0 12px; }
.crop-viewport { position: relative; width: 260px; height: 260px; border-radius: 10px; overflow: hidden;
    background: #1b1530; cursor: grab; touch-action: none; user-select: none; }
.crop-viewport:active { cursor: grabbing; }
.crop-img { position: absolute; max-width: none; pointer-events: none; }
.crop-ring { position: absolute; inset: 0; pointer-events: none;
    box-shadow: 0 0 0 9999px rgba(20,16,40,.55); border-radius: 50%; }
.version-line { font-size: 1rem; margin: 0 0 4px; }
.version-line strong { color: var(--accent); }
.update-form { display: grid; gap: 12px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.changelog { display: grid; gap: 14px; }
.release {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 16px 18px;
}
.release-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.release-ver {
    font-family: Montserrat, sans-serif; font-weight: 700; font-size: .8rem;
    background: var(--accent); color: #fff; padding: 2px 9px; border-radius: var(--radius-round);
}
.release-title { font-weight: 600; }
.release-date { font-size: .8rem; color: var(--muted); margin-left: auto; }
.release ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.release li { font-size: .9rem; color: var(--muted); }

/* ===== Aide développeur (capacités d'un artifact) ===== */
.help-dev {
    margin: 4px 0 12px; border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--color-neutral-background-soft); padding: 0 14px;
}
.help-dev > summary {
    cursor: pointer; list-style: none; padding: 11px 0; font-weight: 600; font-size: .9rem;
    display: flex; align-items: center; gap: 8px; color: var(--accent);
}
.help-dev > summary::-webkit-details-marker { display: none; }
.help-dev > summary::before { content: "＋"; font-weight: 700; }
.help-dev[open] > summary::before { content: "−"; }
.help-dev .help-body { padding: 2px 0 14px; }
.help-dev p { margin: 8px 0; font-size: .85rem; color: var(--muted); }
.help-dev code { background: var(--surface); }
.prompt-block {
    margin: 12px 0; border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--surface); overflow: hidden;
}
.prompt-head {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 8px 10px 8px 12px; border-bottom: 1px solid var(--border);
    background: var(--color-neutral-background-soft);
}
.prompt-title { font-weight: 600; font-size: .85rem; color: var(--text); }
.copy-btn { padding: 5px 12px; font-size: .8rem; border-radius: var(--radius-round); }
/* Confirmation « Copié » : fond = couleur de succès, texte auto-contrasté (lisible). */
.copy-btn.copied { background: var(--color-status-background-success-accent); color: var(--color-status-content-on-success, #fff); border-color: transparent; }
.prompt-block pre {
    margin: 0; padding: 12px; white-space: pre-wrap; word-break: break-word;
    font-family: system-ui, sans-serif; font-size: .82rem; line-height: 1.5;
    color: var(--text); background: var(--surface);
}

/* ===== Runner plein écran ===== */
.runner-view { max-width: none; margin: 0; padding: 0; display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.runner-titlebar {
    flex: none; background: #fff; border-bottom: 1px solid var(--border);
    padding: 8px 18px; font-family: Montserrat, system-ui, sans-serif; font-weight: 700;
    font-size: .98rem; color: var(--brand-primary, #5B28F5); text-align: center;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.runner-frames { position: relative; flex: 1 1 auto; min-height: 0; background: #fff; }
.runner-frame { display: none; position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.runner-frame.active { display: block; }

/* Onglets de sessions d'artifacts (bascule sans relancer l'init) */
.runner-tabs { display: flex; align-items: center; gap: 4px; flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; scroll-behavior: smooth; }
.runner-tabs::-webkit-scrollbar { display: none; }
/* Flèches de défilement des onglets (visibles seulement quand la barre déborde). */
.runner-tabs-nav { flex: none; display: flex; align-items: center; gap: 2px; }
.tabs-arrow { width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--border, #e4e7f0);
    background: var(--surface, #fff); color: var(--text-dim, #6b7180); font-size: 16px; line-height: 1; cursor: pointer; padding: 0; }
.tabs-arrow:hover:not(:disabled) { color: var(--text, #1a1a27); border-color: var(--text-dim, #9aa); }
.tabs-arrow:disabled { opacity: .35; cursor: default; }
.runner-tab {
    display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto;
    max-width: 200px; padding: 5px 8px 5px 12px; border-radius: 999px;
    background: var(--nav-hover); color: var(--nav-text-dim);
    font-size: .82rem; cursor: pointer; border: 1px solid transparent; white-space: nowrap;
}
.runner-tab:hover { color: var(--nav-text); }
.runner-tab.active { background: var(--nav-active); color: #fff; border-color: transparent; }
.runner-tab .rt-label { overflow: hidden; text-overflow: ellipsis; }
.runner-tab .rt-close {
    display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%;
    font-size: .9rem; line-height: 1; background: transparent; color: inherit; opacity: .7;
}
.runner-tab .rt-close:hover { opacity: 1; background: var(--color-global-overlay-medium); }

/* ===== Catalogue (storefront type App Store) ===== */
.cat-hero { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.cat-hero h2 { margin: 0; }
.cat-search { flex: 1 1 280px; max-width: 420px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: .9rem; }
.cat-section-title { font-family: Montserrat, system-ui, sans-serif; margin: 18px 0 10px; }
.cat-featured-wrap { margin-bottom: 6px; }
.cat-featured { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(280px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.cat-feat-card { scroll-snap-align: start; position: relative; border-radius: 18px; padding: 20px; color: #fff; min-height: 150px; display: flex; flex-direction: column; justify-content: flex-end; cursor: pointer; overflow: hidden; background: linear-gradient(135deg, var(--brand-primary,#5B28F5), var(--brand-accent,#6E3DFF)); }
.cat-feat-card .ff-eyebrow { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; opacity: .85; }
.cat-feat-card .ff-title { font-family: Montserrat, system-ui, sans-serif; font-size: 1.3rem; font-weight: 700; margin: 2px 0; }
.cat-feat-card .ff-sub { font-size: .85rem; opacity: .92; }
.cat-feat-card .ff-icon { position: absolute; top: 16px; right: 16px; width: 52px; height: 52px; border-radius: 13px; background: rgba(255,255,255,.18); object-fit: cover; }

.cat-toolbar { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin: 8px 0 16px; }
.cat-toolbar select { padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font-size: .85rem; }

.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.cat-card { display: flex; gap: 13px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 14px; cursor: pointer; transition: box-shadow .15s, transform .15s; }
.cat-card:hover { box-shadow: var(--shadow-m); transform: translateY(-2px); }
.cat-card-icon { width: 56px; height: 56px; border-radius: 13px; object-fit: cover; flex: none; background: linear-gradient(135deg, var(--brand-primary,#5B28F5), var(--brand-accent,#6E3DFF)); }
.cat-card-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.cat-card-body h4 { margin: 0; font-size: .98rem; line-height: 1.2; }
.cat-card-sub { font-size: .8rem; color: var(--text-dim,#5A5A66); margin: 2px 0; flex: 1 1 auto; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cat-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.cat-rate { font-size: .78rem; color: var(--text-dim,#5A5A66); white-space: nowrap; }
.cat-pill { font-size: .72rem; font-weight: 700; padding: 4px 11px; border-radius: 999px; border: none; cursor: pointer; background: var(--color-brand-background,#F0EBFF); color: var(--accent,#5B28F5); }
.cat-pill.installed { background: var(--ok-bg,#e6f4e6); color: var(--ok,#008800); cursor: default; }

/* Grilles « liste » (Constellation, Builder) : auto-fit → les cartes occupent
   toute la largeur disponible (une carte seule s'étire au lieu de rester étroite). */
#bld-grid, #cst-grid { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
/* Cartes « liste » (Constellation, Builder) : contenu pleine largeur + menu ⋯ en coin. */
.cat-card-list { display: block; position: relative; }
.cat-card-list .cat-card-body { padding-right: 34px; }
.cat-card-list .cat-card-actions { position: absolute; top: 8px; right: 8px; margin: 0; }
.cat-card-list .cst-badges { margin-top: 10px; }

.cat-strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(180px,1fr); gap: 10px; overflow-x: auto; padding-bottom: 6px; }

/* Fiche détail */
.cd-head { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.cd-icon { width: 84px; height: 84px; border-radius: 19px; object-fit: cover; background: linear-gradient(135deg, var(--brand-primary,#5B28F5), var(--brand-accent,#6E3DFF)); flex: none; }
.cd-head-body { flex: 1 1 200px; min-width: 0; }
.cd-head-body h3 { margin: 0 0 2px; }
.cd-meta { font-size: .82rem; color: var(--text-dim,#5A5A66); margin-top: 6px; }
.cd-cta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.cd-price { font-weight: 700; font-family: Montserrat, system-ui, sans-serif; }
.cd-uses { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0; }
.cd-use { font-size: .76rem; padding: 4px 10px; border-radius: 999px; background: var(--surface-2,#f0f0f4); border: 1px solid var(--border); }
.cd-desc { white-space: pre-wrap; line-height: 1.55; margin: 8px 0 14px; }
.cd-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.cd-tag { font-size: .74rem; padding: 3px 10px; border-radius: 999px; background: var(--color-brand-background,#F0EBFF); color: var(--accent,#5B28F5); }
.cd-rate { margin: 8px 0; }
.cd-star { font-size: 1.4rem; cursor: pointer; color: var(--border-strong,#AAAAB6); }
.cd-star.on { color: #f5a623; }

/* ===== Console de validation catalogue ===== */
.cr-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.cr-scan-out { display: flex; flex-direction: column; gap: 6px; margin: 6px 0; }
.cr-verdict { font-weight: 700; padding: 8px 12px; border-radius: 8px; }
.cr-verdict.clean { background: var(--ok-bg,#e6f4e6); color: var(--ok,#008800); }
.cr-verdict.review { background: var(--warn-bg,#fff3e0); color: var(--warn,#CE4600); }
.cr-verdict.danger { background: var(--danger-bg,#fde8e8); color: var(--danger,#E71616); }
.cr-finding { display: flex; gap: 8px; align-items: baseline; font-size: .84rem; padding: 5px 10px; border-radius: 7px; background: var(--surface-2,#f0f0f4); }
.cr-sev { font-size: .68rem; font-weight: 700; padding: 1px 7px; border-radius: 999px; flex: none; }
.cr-sev.high { background: var(--danger-bg,#fde8e8); color: var(--danger,#E71616); }
.cr-sev.medium { background: var(--warn-bg,#fff3e0); color: var(--warn,#CE4600); }
.cr-sev.low { background: var(--surface,#fff); color: var(--text-dim,#5A5A66); border: 1px solid var(--border); }
.cr-ai-out { white-space: pre-wrap; font-size: .86rem; line-height: 1.5; margin: 6px 0; }
/* Verdict de sécurité « grand public » : clair, sans jargon. */
.cr-secbanner { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 16px; padding: 14px 18px; border-radius: 12px; border: 2px solid transparent; }
.cr-secbanner.clean { background: var(--ok-bg,#e6f4e6); border-color: var(--ok,#008800); }
.cr-secbanner.review { background: var(--warn-bg,#fff3e0); border-color: var(--warn,#CE4600); }
.cr-secbanner.danger { background: var(--danger-bg,#fde8e8); border-color: var(--danger,#E71616); }
.cr-secmain { font-size: 1.18rem; font-weight: 800; letter-spacing: .2px; }
.cr-secbanner.clean .cr-secmain { color: var(--ok,#008800); }
.cr-secbanner.review .cr-secmain { color: var(--warn,#CE4600); }
.cr-secbanner.danger .cr-secmain { color: var(--danger,#E71616); }
.cr-secscore { grid-row: 1 / span 2; text-align: center; line-height: 1.05; }
.cr-secscore b { font-size: 1.9rem; font-weight: 800; }
.cr-secscore span { font-size: .9rem; opacity: .7; }
.cr-secscore em { display: block; font-style: normal; font-size: .62rem; text-transform: uppercase; letter-spacing: .5px; opacity: .65; }
.cr-sechead { font-size: .86rem; opacity: .85; }
.cr-tech { margin: 8px 0; }
.cr-tech summary { cursor: pointer; font-size: .8rem; color: var(--text-dim,#5A5A66); }
.cr-tech[open] { display: flex; flex-direction: column; gap: 6px; }
.cr-comp-hint { font-size: .74rem; color: var(--accent,#6E3DFF); margin: 6px 0 2px; }
/* Overlay de test plein écran (au-dessus de la fenêtre de revue). */
.test-overlay { position: fixed; inset: 0; z-index: 150; background: #fff; display: flex; flex-direction: column; }
.test-overlay .to-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 16px; background: var(--brand-ink,#0f172a); color: #fff; }
.test-overlay .to-title { font-weight: 700; font-size: .92rem; }
.test-overlay .to-body { position: relative; flex: 1 1 auto; min-height: 0; background: #fff; }
/* Popup d'attente d'analyse au dépôt + résultat de compliance. */
.csa-wait { text-align: center; padding: 18px 8px 8px; }
.csa-spinner { width: 46px; height: 46px; margin: 4px auto 14px; border-radius: 50%; border: 4px solid var(--surface-2,#e6e6ee); border-top-color: var(--accent,#6E3DFF); animation: csa-spin .9s linear infinite; }
@keyframes csa-spin { to { transform: rotate(360deg); } }
.csa-compliance { margin: 12px 0; font-weight: 600; }
/* Assistant de dépôt en 4 étapes. */
.wiz-steps { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 14px; }
.wiz-steps span { font-size: .76rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--surface-2,#f0f0f4); color: var(--text-dim,#5A5A66); }
.wiz-steps span.active { background: var(--accent,#6E3DFF); color: #fff; }
.cs-step { display: block; }
.cs-step.hidden { display: none; }
.csa-compat { margin: 12px 0; }
.compat-list { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 6px; }
.compat-list li { padding: 8px 12px; border-radius: 8px; font-size: .86rem; background: var(--surface-2,#f0f0f4); border-left: 3px solid var(--border); }
.compat-list li.compat-err { background: var(--danger-bg,#fde8e8); border-left-color: var(--danger,#E71616); }
.compat-list li.compat-warn { background: var(--warn-bg,#fff3e0); border-left-color: var(--warn,#CE4600); }
.cat-compbadge { display: inline-block; font-size: .72rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--surface-2,#f0f0f4); color: var(--text-dim,#5A5A66); }
.cat-compbadge.standard { background: var(--color-brand-background,#EFEAFE); color: var(--accent,#5B28F5); }
.cat-compbadge.certified { background: var(--ok-bg,#e6f4e6); color: var(--ok,#008800); }
.cat-compbadge.basic { background: var(--warn-bg,#fff3e0); color: var(--warn,#CE4600); }
/* Badges sécurité / compliance dans « Mes artifacts ». */
.cat-mine-sec { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.cat-secbadge { font-size: .72rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.cat-secbadge.clean { background: var(--ok-bg,#e6f4e6); color: var(--ok,#008800); }
.cat-secbadge.review { background: var(--warn-bg,#fff3e0); color: var(--warn,#CE4600); }
.cat-secbadge.danger { background: var(--danger-bg,#fde8e8); color: var(--danger,#E71616); }
/* Carte développeur dans la fiche catalogue + page développeur. */
.cd-dev { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin: 14px 0; }
.cd-dev-head { display: flex; align-items: center; gap: 12px; }
.cd-dev-avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; background: var(--accent,#6E3DFF); flex: none; }
.cd-dev-name { font-weight: 700; }
.cd-dev-bio { margin: 8px 0; }
.cd-dev-links { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 6px; }
.cd-dev-web { font-size: .82rem; color: var(--accent,#6E3DFF); text-decoration: none; }
.cd-dev-web:hover { text-decoration: underline; }
/* Contrat & API (Swagger embarqué). */
.cd-tools { margin: 12px 0; }
.cs-contract textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem; }
.ct-body { display: flex; flex-direction: column; gap: 16px; margin: 6px 0 4px; }
.ct-sec h4 { margin: 0 0 6px; font-size: .95rem; }
.ct-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ct-chips span { background: var(--surface-2,#f0f0f4); border: 1px solid var(--border); border-radius: 8px; padding: 5px 10px; font-size: .84rem; }
.ct-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.ct-table th, .ct-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.ct-table th { color: var(--text-dim,#5A5A66); font-weight: 600; font-size: .78rem; }
.ct-pill { display: inline-block; font-size: .64rem; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--surface-2,#f0f0f4); color: var(--text-dim,#5A5A66); margin-left: 4px; }
.ct-pill.det { background: var(--color-brand-background,#EFEAFE); color: var(--accent,#5B28F5); }
.ct-sec .empty { margin: 0; }
/* Installation : popup d'autorisations (type iPhone). */
.inst-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.inst-head h3 { margin: 0; }
.inst-caps { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.inst-cap { background: var(--surface-2,#f0f0f4); border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; font-size: .88rem; }
.inst-h { margin: 14px 0 4px; font-size: .98rem; }
.inst-channels { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.inst-ch { display: flex; align-items: flex-start; gap: 9px; background: var(--surface-2,#f0f0f4); border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; font-size: .88rem; cursor: pointer; }
.inst-ch input { margin-top: 3px; }
.inst-pill { display: inline-block; font-size: .64rem; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--surface,#fff); color: var(--text-dim,#5A5A66); border: 1px solid var(--border); margin-left: 4px; }
.inst-pill.new { background: var(--color-brand-background,#EFEAFE); color: var(--accent,#5B28F5); border-color: transparent; }
/* Concentrateur d'API. */
.badge-ok { font-size: .74rem; font-weight: 700; color: var(--ok,#008800); }
.badge-warn { font-size: .74rem; font-weight: 700; color: var(--warn,#CE4600); }
.apihub-modes { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.utable td.small, .utable th.small { font-size: .8rem; }
.token-value { background: var(--surface-2,#f0f0f4); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin: 8px 0; word-break: break-all; font-family: ui-monospace, monospace; font-size: .82rem; }
/* Suites (« Docker virtuel »). */
.suite-card { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.suite-ic { width: 44px; height: 44px; border-radius: 12px; flex: none; display: grid; place-items: center; font-weight: 800; color: #fff; background: var(--accent,#6E3DFF); font-size: 1.1rem; }
.suite-launch h3 { margin: 0 0 4px; }
.cr-curate { border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; margin: 14px 0; }
.cr-curate legend { font-size: .82rem; color: var(--text-dim,#5A5A66); padding: 0 6px; }
.cd-compliance { font-size: .72rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--ok-bg,#e6f4e6); color: var(--ok,#008800); }
.cat-compliance { position: absolute; top: 8px; left: 8px; font-size: .64rem; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: rgba(0,136,0,.9); color: #fff; }

/* ===== Catalogue : dépôt & validation ===== */
.cs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.cs-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.cs-uses { border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; margin: 10px 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.cs-uses legend { font-size: .8rem; color: var(--text-dim, #5A5A66); padding: 0 6px; }
.cat-mine { display: flex; flex-direction: column; gap: 10px; }
.cat-mine-card { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; }
.cat-mine-icon { width: 48px; height: 48px; border-radius: 11px; object-fit: cover; background: var(--surface-2,#f0f0f4); flex: none; }
.cat-mine-body { flex: 1 1 auto; min-width: 0; }
.cat-mine-body h4 { margin: 0 0 2px; font-size: 1rem; }
.cat-mine-meta { font-size: .8rem; color: var(--text-dim,#5A5A66); }
.cat-status { font-size: .72rem; padding: 2px 9px; border-radius: 999px; font-weight: 600; }
.cat-status.pending { background: var(--warn-bg,#fff3e0); color: var(--warn,#CE4600); }
.cat-status.approved { background: var(--ok-bg,#e6f4e6); color: var(--ok,#008800); }
.cat-status.rejected { background: var(--danger-bg,#fde8e8); color: var(--danger,#E71616); }
@media (max-width: 700px){ .cs-grid, .cs-grid-3 { grid-template-columns: 1fr; } }

/* Connecteurs externes de Voilà (super-admin) */
.conn-list { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.conn-params { margin: 6px 0 2px; }
.conn-params-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.conn-param-row { display: grid; grid-template-columns: 1.2fr .9fr .9fr auto 2fr auto; gap: 6px; align-items: center; margin-bottom: 6px; }
.conn-param-row .check { white-space: nowrap; font-size: .8rem; }
@media (max-width: 760px){ .conn-param-row { grid-template-columns: 1fr 1fr; } }

/* ===== Bandeau d'administration d'organisation (super-admin) ===== */
.imp-banner {
    position: sticky; top: 0; z-index: 60; display: flex; align-items: center; justify-content: center; gap: 12px;
    padding: 7px 14px; background: var(--brand-warning, #CE4600); color: #fff;
    font-size: .85rem; font-weight: 600;
}
.imp-back {
    background: rgba(255,255,255,.18); color: #fff; border: 1px solid rgba(255,255,255,.4);
    border-radius: 999px; padding: 3px 12px; font-size: .82rem; cursor: pointer;
}
.imp-back:hover { background: rgba(255,255,255,.3); }

/* ===== Console organisations ===== */
.orgs-totals { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.orgs-totals .stat { flex: 1 1 120px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; }
.orgs-totals .stat b { display: block; font-size: 1.3rem; font-family: Montserrat, system-ui, sans-serif; }
.orgs-totals .stat span { font-size: .76rem; color: var(--text-dim, #5A5A66); }
.org-badge-home { font-size: .7rem; background: var(--nav-active); color: #fff; border-radius: 999px; padding: 1px 7px; margin-left: 6px; }
.org-status-suspended { color: var(--brand-danger, #E71616); }

details.cob-panel > summary { cursor: pointer; font-size: .95rem; list-style: revert; }
details.cob-panel[open] > summary { margin-bottom: 8px; }
.padmins-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 6px; }
.padmin-row { font-size: .85rem; padding: 4px 8px; background: var(--surface); border-radius: 6px; }

.twofa-qr { text-align: center; margin: 8px 0; }
.twofa-qr img { width: 180px; height: 180px; image-rendering: pixelated; }
.twofa-secret { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.05rem; letter-spacing: 2px; background: var(--surface-2, #f0f0f4); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; word-break: break-all; user-select: all; margin: 6px 0; }

/* ===== Logo de marque ===== */
.logo-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 12px 0 2px; }
.logo-preview { height: 34px; max-width: 140px; object-fit: contain; border: 1px solid var(--border); border-radius: 6px; padding: 3px 6px; background: #fff; }
.logo-pick { font-size: .82rem; color: var(--text-dim, #5A5A66); display: inline-flex; flex-direction: column; gap: 3px; }

/* ===== Éditeur de palette ===== */
.palette-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 16px; margin: 10px 0; }
.palette-item { display: flex; flex-direction: column; gap: 4px; }
.palette-item label { font-size: .78rem; color: var(--text-dim, #5A5A66); }
.palette-row { display: flex; align-items: center; gap: 6px; }
.palette-row input[type=color] { width: 34px; height: 30px; padding: 0; border: 1px solid var(--border); border-radius: 6px; background: none; cursor: pointer; }
.palette-row input[type=text] { flex: 1 1 auto; min-width: 0; }

/* ===== Modales (Cobalt) ===== */
.modal-root { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 18px; }
.modal-backdrop { position: absolute; inset: 0; background: var(--color-global-overlay-medium); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.modal {
    position: relative; width: 620px; max-width: 100%; max-height: 90vh; overflow: auto;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-l); padding: 30px 32px;
}
.modal h3 { margin: 0 0 14px; font-size: 1.25rem; }
.modal h4 { margin: 16px 0 8px; font-size: .9rem; color: var(--muted); }
.field { display: grid; gap: 6px; margin-bottom: 12px; font-size: .85rem; color: var(--muted); }
.field label { display: grid; gap: 6px; margin-bottom: 8px; }
.field input, .field select { color: var(--text); }
.check { display: flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--text); margin: 6px 0; }
.check input { width: auto; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.modal-actions.inline { justify-content: flex-start; margin-top: 0; }
.msg { min-height: 18px; font-size: .85rem; margin: 6px 0 0; }
.msg.err { color: var(--danger); }
.msg.ok { color: var(--ok); }

.seg { display: flex; gap: 4px; background: var(--color-neutral-background-soft); padding: 4px; border-radius: var(--radius); margin-bottom: 14px; }
.seg-btn { flex: 1; background: transparent; color: var(--text); border: none; padding: 8px; font-size: .85rem; }
.seg-btn.active { background: var(--surface); box-shadow: var(--shadow); color: var(--accent); }

.share-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.share-list li { display: flex; align-items: center; justify-content: space-between; padding: 9px 11px; background: var(--color-neutral-background-soft); border-radius: var(--radius); font-size: .88rem; }
.share-list button { padding: 3px 10px; }

.update-log {
    margin-top: 4px; padding: 12px; background: var(--color-neutral-background-soft);
    border: 1px solid var(--border); border-radius: var(--radius);
    white-space: pre-wrap; word-break: break-word; font-size: .8rem;
    max-height: 240px; overflow: auto; font-family: ui-monospace, Menlo, Consolas, monospace;
}

/* ===== Toast ===== */
.toast {
    position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
    background: var(--color-neutral-content-strong); color: var(--color-neutral-background-medium);
    padding: 12px 18px; border-radius: var(--radius);
    box-shadow: var(--shadow-l); z-index: 200; font-size: .9rem; max-width: 90vw;
}

/* =========================================================================
   Responsive — tablette & téléphone : FOOT-MENU
   Sur écran tactile ou étroit, la barre passe EN BAS (foot-menu) et se résume
   à un seul bouton « ☰ Menu » qui ouvre tout le menu en feuille (bottom-sheet).
   ========================================================================= */
@media (hover: none), (max-width: 768px) {
    .hover-zone { display: none; }
    .chrome {
        top: auto; bottom: 0; left: 0; right: 0; margin: 0;
        border-radius: 0; border-left: 0; border-right: 0; border-bottom: 0;
        opacity: 1; transform: none;
        flex-wrap: nowrap; gap: 8px;
        padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
    }
    /* Hors runner : on ne garde que le bouton Menu (les entrées passent dans la feuille). */
    .chrome-left { display: none; }
    .nav { display: none; }
    #nav-help { display: none; }
    .chrome-right { flex: 1 1 auto; margin-left: 0; gap: 8px; }
    .user-menu { flex: 1 1 auto; }

    /* Le bouton « Menu » occupe toute la largeur du foot-menu. */
    .user-btn {
        width: 100%; max-width: none; justify-content: center; gap: 8px;
        background: var(--nav-active); color: #fff; padding: 12px 16px; font-weight: 600;
    }
    .user-btn #user-name { display: none; }
    .user-btn .caret { display: none; }
    .menu-burger { display: inline-block; }
    .user-btn::after { content: 'Menu'; font-weight: 600; }
    .user-btn .count { background: #fff; color: var(--accent); }

    /* Entrées primaires visibles dans la feuille sur mobile. */
    .menu-mobile-nav { display: flex; flex-direction: column; gap: 2px; }

    /* Mode runner : la barre du bas affiche les contrôles du runner + le Menu. */
    .chrome-runner { flex: 1 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
    .chrome-runner::-webkit-scrollbar { display: none; }
    body.in-runner .chrome-right, body.in-runner .user-menu { flex: 0 0 auto; }
    body.in-runner .user-btn { width: auto; padding: 10px 14px; }

    /* La feuille de menu remonte depuis le bas, au-dessus du foot-menu. */
    .nav-menu, .user-dropdown {
        position: fixed; left: 8px; right: 8px; top: auto;
        bottom: calc(56px + env(safe-area-inset-bottom, 0px));
        min-width: 0; max-height: 72dvh; overflow-y: auto;
        border-radius: 18px; box-shadow: 0 18px 44px -12px rgba(15,20,40,.35);
    }
    .menu-item { padding: 13px 13px; }      /* cibles tactiles plus grandes */

    /* Le contenu laisse la place au foot-menu en bas. */
    .view { padding: 18px 16px calc(86px + env(safe-area-inset-bottom, 0px)); }
    .view.runner-view { padding: 0; }
    .runner-view .runner-frames { min-height: 0; }
}

/* Popups : en feuille (bottom-sheet) plein largeur sur téléphone */
@media (max-width: 560px) {
    .modal-root { place-items: end stretch; padding: 0; }
    .modal, .modal-wide, #modal-detail {
        width: 100%; max-width: 100%; max-height: 92vh;
        border-radius: 16px 16px 0 0;
        padding: 20px 16px calc(18px + env(safe-area-inset-bottom, 0px));
    }
    .modal h3 { font-size: 1.15rem; }
    .modal-actions { flex-wrap: wrap; }
    .modal-actions:not(.inline) button { flex: 1 1 auto; }
    /* Champs et listes confortables au doigt */
    .field input, .field select, .field textarea { font-size: 16px; }   /* évite le zoom iOS */
    .detail-share-add, .seg { flex-direction: column; }
    .detail-share-add select, .detail-share-add button { width: 100%; }
}

/* Téléphone : ajustements fins */
@media (max-width: 560px) {
    .view-head { flex-wrap: wrap; }
    .who { display: none; }
    .runner-title { max-width: 42vw; }
    /* Téléphone : l'oiseau seul identifie l'app, on masque le texte de marque. */
    .brand { font-size: 0; gap: 0; }

    /* Modale d'upload : empile le sélecteur de type de carte */
    .seg { flex-direction: column; }

    /* Page Comptes : on masque les colonnes secondaires plutôt que de scroller */
    .panel { padding: 16px; }
    .panel-head { flex-direction: column; align-items: stretch; }
    .acct-search { width: 100%; max-width: none; flex: 1 1 auto; }
    .utable { min-width: 0; }
    .utable th, .utable td { padding: 12px 8px; }
    .utable .col-email { word-break: break-all; white-space: normal; }
    /* Colonnes Rôle (3) et Dernière connexion (5) masquées sur très petit écran */
    .utable th:nth-child(3), .utable td:nth-child(3),
    .utable th:nth-child(5), .utable td:nth-child(5) { display: none; }
    .icon-btn { width: 32px; height: 32px; }
}

/* Largeur intermédiaire : on masque seulement « Dernière connexion » */
@media (min-width: 561px) and (max-width: 760px) {
    .utable { min-width: 0; }
    .utable th:nth-child(5), .utable td:nth-child(5) { display: none; }
}

/* ===== Lien « guide » dans la modale d'upload ===== */
.guide-link {
    display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
    background: var(--color-brand-background); color: var(--accent);
    border: 1px solid transparent; border-radius: var(--radius);
    padding: 11px 14px; font-weight: 500; font-size: .88rem; margin-bottom: 14px;
    white-space: normal;
}
.guide-link:hover { background: var(--color-brand-background); filter: brightness(.97); }
.guide-link-ic { font-size: 1.2rem; line-height: 1; }

/* ===== Guide : créer un artifact ===== */
.modal-wide { width: 1000px; }
.modal-xwide { width: 1140px; max-width: 96vw; }
/* La fiche détaillée a besoin de plus de largeur (tableaux, discussion). */
#modal-detail { width: 880px; }

/* Fiche détaillée : section Administration (staff) */
.detail-admin { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin: 8px 0 4px; background: var(--color-neutral-background-soft); }
.detail-admin h4 { margin: 0 0 10px; }
.detail-admin-row { display: flex; flex-wrap: wrap; gap: 10px; }
.detail-admin .muted { margin: 10px 0 0; }

/* Fiche détaillée : accès des utilisateurs */
.detail-access { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin: 8px 0 4px; }
.detail-access h4 { margin: 0 0 10px; }
.detail-share-add { display: flex; gap: 10px; margin-top: 10px; align-items: center; }
.detail-share-add select { flex: 1 1 auto; min-width: 0; }
.detail-share-add button { flex: none; }
.detail-access .muted { margin: 8px 0 0; }
.gov-mode { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.gov-mode label { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; font-size: 0.92em; }
.danger-text { color: #c0392b; }
.pill { display: inline-block; font-size: .72rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--surface-2,#f0f0f4); color: var(--text-dim,#5A5A66); }
.cap-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.cap-tags .risk-medium { background: #fdf1dc; color: #9a6a00; }
.cap-tags .risk-high { background: #fbe3e3; color: #b3261e; }
.cap-body h4 { margin: 14px 0 6px; }
.cap-list { list-style: none; padding: 0; margin: 4px 0; display: flex; flex-direction: column; gap: 4px; }
.cap-list li { padding: 3px 0; }
@media (max-width: 560px) { .detail-share-add { flex-direction: column; align-items: stretch; } .detail-share-add button { width: 100%; } }

/* Fiche détaillée : zone de saisie pleine largeur + boutons en ligne dessous */
.detail-compose-area { width: 100%; box-sizing: border-box; min-height: 70px; margin-top: 4px; }
.detail-foot { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 12px; }
@media (max-width: 560px) { .detail-foot { flex-direction: column-reverse; align-items: stretch; } .detail-foot button { width: 100%; } }
.guide-hero {
    text-align: center; padding: 4px 6px 20px; margin-bottom: 18px;
    border-bottom: 1px solid var(--border);
}
.guide-bird { height: 46px; width: auto; margin-bottom: 10px; }
.guide-hero h3 { margin: 0 0 8px; font-size: 1.45rem; }
.guide-hero p { margin: 0 auto; max-width: 520px; color: var(--muted); font-size: .92rem; line-height: 1.55; }

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.step { display: flex; gap: 14px; align-items: flex-start; }
.step-num {
    flex: none; width: 34px; height: 34px; border-radius: var(--radius-round);
    display: grid; place-items: center; background: var(--accent); color: #fff;
    font-family: Montserrat, sans-serif; font-weight: 700; font-size: 1rem;
}
.step-body { flex: 1; min-width: 0; }
.step-body h4 { margin: 4px 0 6px; font-size: 1.02rem; }
.step-body p { margin: 6px 0; font-size: .9rem; color: var(--color-neutral-content-medium); line-height: 1.55; }
.step-body em { color: var(--text); font-style: italic; }
.guide-list { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 7px; }
.guide-list li { font-size: .9rem; color: var(--color-neutral-content-medium); line-height: 1.5; }

.guide-section { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); }
.guide-h { margin: 0 0 4px; font-size: 1.05rem; }

.callout {
    display: flex; gap: 12px; align-items: flex-start;
    margin-top: 22px; padding: 14px 16px;
    background: var(--color-status-background-information);
    border-radius: var(--radius); font-size: .88rem; line-height: 1.55;
    color: var(--color-neutral-content-strong);
}
.callout-ic { font-size: 1.25rem; line-height: 1; }
.callout strong { color: var(--text); }

@media (max-width: 560px) {
    .guide-hero h3 { font-size: 1.25rem; }
    .step-num { width: 30px; height: 30px; font-size: .9rem; }
}

/* Option « partager à tous » (mise en avant) */
.share-all-row {
    align-items: flex-start; gap: 10px;
    background: var(--color-brand-background); border-radius: var(--radius);
    padding: 12px 14px; margin: 0 0 6px;
}
.share-all-row input { margin-top: 3px; }

/* Constructeur de prompt (aide) */
.pb-options { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; margin: 10px 0 12px; }
.pb-options .check { margin: 0; }
.pb-output {
    margin: 12px 0 4px; padding: 12px; white-space: pre-wrap; word-break: break-word;
    font-family: system-ui, sans-serif; font-size: .82rem; line-height: 1.5;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text);
}
/* Lien type texte (ex. « Mot de passe oublié ? ») */
.link-btn {
    background: transparent; color: var(--accent); border: none; padding: 2px;
    font-size: .85rem; text-align: center; width: auto; align-self: center;
}
.link-btn:hover { background: transparent; text-decoration: underline; }
@media (max-width: 560px) { .pb-options { grid-template-columns: 1fr; } }

/* Fiche de soumission / détail */
.form-sep { margin: 18px 0 10px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 1rem; }
textarea { resize: vertical; min-height: 60px; }
.risk-box { background: var(--color-neutral-background-soft); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin: 4px 0 8px; }
.risk-box .guide-list { margin-top: 10px; }
.detail-grid { display: grid; gap: 6px; margin-bottom: 8px; }
.detail-row { display: flex; gap: 10px; font-size: .9rem; }
.detail-k { color: var(--muted); min-width: 170px; }
.rich-view { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; font-size: .9rem; line-height: 1.5; white-space: normal; }
.rich-view strong, .rich-view b { color: var(--text); }
.rich-view ul, .rich-view ol { margin: 4px 0 4px 22px; }
.rich-view p { margin: 0 0 6px; }
.rich-view p:last-child { margin-bottom: 0; }
@media (max-width: 560px) { .detail-row { flex-direction: column; gap: 0; } .detail-k { min-width: 0; } }

/* Fil de discussion */
.thread { max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 4px 0; }
.msg-bubble { background: var(--color-neutral-background-soft); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 11px; max-width: 88%; align-self: flex-start; }
.msg-bubble.mine { background: var(--color-brand-background); align-self: flex-end; }
.msg-meta { font-size: .72rem; color: var(--muted); margin-bottom: 3px; }
.msg-body { font-size: .9rem; line-height: 1.45; white-space: normal; }
.thread-compose { display: flex; gap: 8px; margin-top: 10px; align-items: flex-end; }
.thread-compose textarea { flex: 1 1 auto; min-width: 0; min-height: 38px; }
.thread-compose button { flex: none; }
/* Sur écran étroit, on empile la zone de saisie et le bouton Envoyer pour
   éviter qu'ils ne se chevauchent dans la fiche détaillée. */
@media (max-width: 620px) {
    .thread-compose { flex-direction: column; align-items: stretch; }
    .thread-compose button { width: 100%; }
}

/* ===== Éditeur WYSIWYG (description) ===== */
.field-lab { font-size: .85rem; color: var(--muted); }
.wysiwyg { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.wysiwyg-tb { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 6px; background: var(--color-neutral-background-soft); border-bottom: 1px solid var(--border); }
.wysiwyg-tb button { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius); padding: 4px 9px; font-size: .82rem; line-height: 1.2; }
.wysiwyg-tb button:hover { background: var(--color-brand-background); color: var(--accent); border-color: transparent; }
.wysiwyg-sep { width: 1px; align-self: stretch; background: var(--border); margin: 2px 4px; }
.wysiwyg-area { min-height: 96px; max-height: 260px; overflow-y: auto; padding: 10px 12px; font-size: .9rem; line-height: 1.5; color: var(--text); outline: none; }
.wysiwyg-area:focus { box-shadow: inset 0 0 0 2px var(--color-brand-background); }
.wysiwyg-area:empty:before { content: attr(data-placeholder); color: var(--muted); }
.wysiwyg-area ul, .wysiwyg-area ol { margin: 4px 0 4px 22px; }
.wysiwyg-area p { margin: 0 0 6px; }

/* Usage IA */
.usage-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 18px; }
.usage-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.usage-val { font-family: Montserrat, sans-serif; font-weight: 700; font-size: 1.3rem; color: var(--accent); }
.usage-lab { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.view-head-actions { display: flex; align-items: center; gap: 10px; }
/* ── Jolis interrupteurs (toggles) + info-bulles — Nova Studio ─────────────── */
.bld-switch { display: inline-flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--text, #223); cursor: pointer; user-select: none; }
.bld-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.bld-switch-track { position: relative; flex: none; width: 38px; height: 22px; border-radius: 999px; background: var(--border, #d7d7e0); transition: background .18s ease; }
.bld-switch-thumb { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .18s ease; }
.bld-switch input:checked + .bld-switch-track { background: linear-gradient(120deg, var(--brand-primary, #5B28F5), var(--brand-accent, #a855f7)); }
.bld-switch input:checked + .bld-switch-track .bld-switch-thumb { transform: translateX(16px); }
.bld-switch input:focus-visible + .bld-switch-track { outline: 2px solid var(--brand-primary, #5B28F5); outline-offset: 2px; }
.bld-switch-txt { white-space: nowrap; }
.bld-switch-info { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--border, #c8c8d4); color: var(--muted, #889); font: italic 700 11px/1 Georgia, serif; cursor: help; }
.bld-switch-info:hover, .bld-switch-info:focus { color: var(--brand-primary, #5B28F5); border-color: var(--brand-primary, #5B28F5); outline: none; }
.bld-switch-info[data-tip]:hover::after, .bld-switch-info[data-tip]:focus::after {
    content: attr(data-tip);
    position: absolute; top: calc(100% + 8px); right: -4px; z-index: 60;
    width: 280px; max-width: 72vw; padding: 10px 12px;
    background: rgba(238, 239, 243, .82);
    color: #2a2d36; border: 1px solid rgba(0, 0, 0, .08); border-radius: 10px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .16);
    font-family: inherit; font-size: .8rem; font-weight: 400; font-style: normal; line-height: 1.45;
    text-align: left; white-space: normal; pointer-events: none;
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.bld-switch-info[data-tip]:hover::before, .bld-switch-info[data-tip]:focus::before {
    content: ''; position: absolute; top: calc(100% + 2px); right: 3px; z-index: 61;
    border: 6px solid transparent; border-bottom-color: rgba(238, 239, 243, .82);
}
.price-grid { display: grid; gap: 8px; }
.price-row { display: grid; grid-template-columns: 80px 1fr 1fr; gap: 8px; align-items: center; }
.price-row span { font-weight: 600; font-size: .9rem; }
@media (max-width: 560px) { .price-row { grid-template-columns: 1fr 1fr; } .price-row span { grid-column: 1 / -1; } }

/* Coût réel facturé (Admin API) */
.billed-panel { background: var(--color-brand-background); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; }
.billed-head { font-size: .9rem; margin-bottom: 4px; }
.billed-body { font-size: .95rem; }
.billed-body.err { color: var(--danger); font-size: .85rem; }
.billed-amount { font-family: Montserrat, sans-serif; font-weight: 700; font-size: 1.5rem; color: var(--accent); }
.usage-note { margin: -6px 0 18px; }

/* Alertes admin (consommation IA) */
.alerts-panel { background: var(--warn-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 16px; }
.alerts-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.alert-row { font-size: .85rem; color: var(--text); padding: 4px 0; border-top: 1px solid var(--border); }
.alert-row.unseen { font-weight: 600; }

/* ===================================================================== */
/*  Coque : barre latérale permanente + en-tête (suit la palette --brand) */
/* ===================================================================== */
#app:not(.hidden) { display: flex; flex-direction: column; height: 100vh; height: 100dvh; min-height: 0; }
.shell { flex: 1 1 auto; display: flex; min-height: 0; }
.shell-main { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; background: var(--bg, #eef1f8); }
#main { flex: 1 1 auto; min-height: 0; overflow: auto; }
body.in-runner #main { overflow: hidden; }
/* La coque à barre latérale occupe toute la largeur utile : on annule le
   plafond hérité de l'ancienne mise en page (sans quoi les pages internes et
   tableaux étaient centrés sur 1100 px et tronqués). */
.view { padding: 26px 28px 60px; max-width: none; margin: 0; }
#view-history, #view-aiusage { max-width: none; }
/* Fenêtre de l'artefact : panneau plus grand, collé en bas (aligné avec la barre
   latérale), petit espace en haut/à gauche, et coin supérieur gauche arrondi. */
.runner-view { padding: 0; margin: 6px 0 0 6px; height: calc(100% - 6px);
    border-top-left-radius: 16px; overflow: hidden; background: #fff;
    box-shadow: 0 2px 12px rgba(15, 20, 40, .07); }

/* Barre latérale */
.sidebar { width: 256px; flex: none; display: flex; flex-direction: column; background: var(--surface, #fff); border-right: 1px solid var(--border, #e4e7f0); }
.sb-logo { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px 16px; border-bottom: 1px solid var(--border, #e4e7f0); }
.sb-logo .brand-logo { max-width: 100%; max-height: 48px; width: auto; height: auto; object-fit: contain; display: block; }
.sb-logo .brand-name { font-weight: 700; font-size: 14px; }
.sb-scroll { flex: 1 1 auto; overflow: auto; padding: 12px 12px 0; display: flex; flex-direction: column; gap: 4px; }
.sb-main, .sb-link, .sb-store { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: none; background: transparent; cursor: pointer; padding: 11px 12px; border-radius: 10px; font-size: 14px; color: var(--text, #1b1f2a); font-family: inherit; }
.sb-main { font-weight: 700; font-size: 14.5px; }
.sb-main:hover, .sb-link:hover, .sb-store:hover { background: var(--surface-2, #eceff7); }
.sb-main.active { background: var(--nav-active, #2A4BFF); color: #fff; }
.sb-main.active .sb-ic { color: #fff; }
.sb-link.active { background: var(--surface-2, #eceff7); font-weight: 600; }
.sb-ic { width: 18px; text-align: center; flex: none; }
.sb-artifact { margin: 14px 2px 4px; }
.sb-art-h { font-size: 11px; font-weight: 800; letter-spacing: .6px; color: var(--text-dim, #6b7180); text-transform: uppercase; display: flex; align-items: center; gap: 6px; padding: 0 10px 4px; }
.sb-art-h .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok, #0a8f3c); }
.sb-art-name { font-size: 13px; font-weight: 700; padding: 2px 10px 8px; color: var(--text, #1b1f2a); }
.sb-art-menu { display: flex; flex-direction: column; gap: 2px; }
.sb-art-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: none; background: transparent; cursor: pointer; padding: 9px 12px; border-radius: 9px; font-size: 13.5px; color: #363d4e; font-family: inherit; }
.sb-art-item:hover { background: var(--surface-2, #eceff7); }
.sb-art-item.on { background: var(--surface-2, #e7ecff); color: var(--nav-active, #2A4BFF); font-weight: 600; }
.sb-art-lbl { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-art-item.child { padding-left: 30px; font-size: 13px; }
.sb-art-chev { flex: none; font-size: 10px; color: var(--text-dim, #6b7180); }
.sb-art-badge { flex: none; min-width: 18px; height: 18px; padding: 0 6px; border-radius: 9px; background: var(--nav-active, #2A4BFF); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
/* Pied de menu épinglé (au-dessus de l'AppStore). Actif seulement si un pied existe. */
.sb-art-footer { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--brand-border, var(--border, #e4e7f0)); }
.sb-scroll.has-appmenu { overflow: hidden; }
.sb-scroll.has-appmenu .sb-artifact { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.sb-scroll.has-appmenu .sb-art-menu { flex: 1 1 auto; min-height: 0; overflow: auto; }
.sb-scroll.has-appmenu .sb-art-footer { flex: 0 0 auto; }
.sb-bottom { border-top: 1px solid var(--border, #e4e7f0); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.sb-store { font-weight: 600; }
/* Lanceur « Agents IA » : bouton « IA » (dégradé animé + étoiles scintillantes),
   affiché en bas du menu une fois l'application installée depuis l'AppStore. */
.sb-agentsapp { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; text-align: center; border: none; cursor: pointer; padding: 12px 14px; border-radius: 12px; font-size: 14px; font-weight: 800; letter-spacing: .02em; font-family: inherit; color: #fff; box-shadow: 0 4px 16px -4px color-mix(in srgb, var(--brand-primary, #5B28F5) 60%, transparent); transition: transform .12s ease, box-shadow .12s ease, filter .12s ease; }
.sb-agentsapp:hover { filter: brightness(1.06); box-shadow: 0 7px 20px -4px color-mix(in srgb, var(--brand-accent, #6E3DFF) 70%, transparent); transform: translateY(-1px); }
.sb-agentsapp:active { transform: translateY(0); }

/* Habillage « IA » réutilisable : dégradé chatoyant multi-teintes (couleurs du thème
   + reflet violet-rosé) et petites étoiles scintillantes en deux couches décalées. */
.ai-shimmer { position: relative; overflow: hidden; color: #fff;
    background: linear-gradient(115deg,
        var(--brand-primary, #5B28F5) 0%,
        var(--brand-accent, #6E3DFF) 34%,
        color-mix(in srgb, var(--brand-accent, #6E3DFF) 55%, #ff6ad5) 62%,
        var(--brand-primary, #5B28F5) 100%);
    background-size: 220% 220%; animation: aiGradient 9s ease infinite; }
.ai-shimmer > * { position: relative; z-index: 1; }
.ai-shimmer::before, .ai-shimmer::after { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; background-repeat: no-repeat; }
.ai-shimmer::before {
    background-image:
        radial-gradient(1.6px 1.6px at 12% 28%, #fff 0, transparent 100%),
        radial-gradient(1.6px 1.6px at 67% 20%, #fff 0, transparent 100%),
        radial-gradient(1.1px 1.1px at 41% 68%, #fff 0, transparent 100%),
        radial-gradient(1.6px 1.6px at 88% 58%, #fff 0, transparent 100%),
        radial-gradient(1.1px 1.1px at 26% 86%, #fff 0, transparent 100%);
    animation: aiTwinkle 3s ease-in-out infinite; }
.ai-shimmer::after {
    background-image:
        radial-gradient(1.2px 1.2px at 54% 44%, #fff 0, transparent 100%),
        radial-gradient(1.6px 1.6px at 33% 14%, #fff 0, transparent 100%),
        radial-gradient(1.1px 1.1px at 79% 82%, #fff 0, transparent 100%),
        radial-gradient(1.6px 1.6px at 7% 58%, #fff 0, transparent 100%),
        radial-gradient(1.1px 1.1px at 95% 30%, #fff 0, transparent 100%);
    animation: aiTwinkle 3s ease-in-out infinite; animation-delay: 1.5s; }
@keyframes aiGradient { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
@keyframes aiTwinkle { 0%, 100% { opacity: .12; } 50% { opacity: .95; } }
@media (prefers-reduced-motion: reduce) { .ai-shimmer, .ai-shimmer::before, .ai-shimmer::after { animation: none; } }

/* En-tête (topbar) */
.topbar { height: 52px; flex: none; display: flex; align-items: center; gap: 6px; padding: 0 12px; background: var(--surface, #fff); border-bottom: 1px solid var(--border, #e4e7f0); }
.topbar-add { flex: none; border: none; background: transparent; color: var(--text-dim, #6b7180); font-size: 16px; cursor: pointer; padding: 6px 10px; border-radius: 8px; }
.topbar-add:hover { background: var(--surface-2, #eceff7); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn { padding: 8px 11px; }
#runner-reload, #runner-share { display: none; }
body.in-runner #runner-reload { display: inline-flex; }
body.in-runner #runner-share:not(.hidden) { display: inline-flex; }
.user-chip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 11px 5px 5px; border: 1px solid var(--border, #e4e7f0); border-radius: 999px; background: var(--surface, #fff); cursor: pointer; font-family: inherit; font-size: 13px; color: var(--text, #1b1f2a); max-width: 230px; }
.user-chip:hover { background: var(--surface-2, #eceff7); }
.user-chip #user-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
/* Avatar par défaut : filigrane Voilà très clair + initiales dans la couleur de marque. */
.user-chip .user-av { width: 28px; height: 28px; border-radius: 50%; flex: none; display: grid; place-items: center;
    font-weight: 800; font-size: 12px; color: var(--accent, #5B28F5);
    background: color-mix(in srgb, var(--accent, #5B28F5) 8%, #fff) url("avatar-voila-faint.png") center/cover no-repeat;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent, #5B28F5) 22%, transparent); }
.user-chip .user-av.user-av-img { color: transparent; background: #ECE7FB center/cover no-repeat; box-shadow: inset 0 0 0 1px rgba(91,40,245,.25); }
.user-chip .caret { color: var(--text-dim, #6b7180); }

/* Navigation mobile (barre du bas) + feuille du menu de l'app */
.mobile-nav { display: none; }
.app-scrim { display: none; }
@media (max-width: 760px) {
  .sidebar { position: fixed; left: 0; right: 0; bottom: calc(50px + env(safe-area-inset-bottom, 0px)); top: auto; width: auto; max-height: 62vh; border-right: none; border-top: 1px solid var(--border, #e4e7f0); border-radius: 16px 16px 0 0; box-shadow: 0 -10px 30px rgba(0,0,0,.22); transform: translateY(115%); transition: transform .22s ease; z-index: 300; }
  body.app-menu-open .sidebar { transform: translateY(0); }
  .sidebar .sb-logo, .sidebar .sb-main, .sidebar .sb-link, .sidebar .sb-bottom { display: none; }
  .sidebar .sb-scroll { padding: 14px 12px; }
  .sb-artifact { margin: 0; }
  /* Sur mobile l'artefact reste plein cadre (pas de marge ni de coin arrondi). */
  .runner-view { margin: 0; height: 100%; border-top-left-radius: 0; box-shadow: none; }
  /* Barre de navigation fixe, ancrée tout en bas comme une application native.
     Compacte (50px de contenu), fond OPAQUE qui remplit aussi la zone gestuelle
     iOS (padding-bottom = safe-area). Icônes centrées verticalement. */
  .mobile-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; height: calc(50px + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px); background: var(--surface, #fff); -webkit-backdrop-filter: saturate(1.3) blur(12px); backdrop-filter: saturate(1.3) blur(12px); border-top: 1px solid color-mix(in srgb, var(--border, #e4e7f0) 80%, transparent); align-items: stretch; justify-content: space-around; z-index: 320; box-shadow: 0 -4px 18px rgba(15,20,40,.07); }
  /* Contenu centré en hauteur ; libellé compact sous l'icône. */
  .mn-item { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: none; background: transparent; color: var(--brand-text-dim, #8a90a0); font-size: 9.5px; font-weight: 600; letter-spacing: .01em; font-family: inherit; cursor: pointer; padding: 0 2px; -webkit-tap-highlight-color: transparent; }
  /* Neutralise le fond violet du style bouton global (y compris :hover collant tactile). */
  .mn-item, .mn-item:hover, .mn-item:focus, .mn-item:focus-visible, .mn-item:active { background: transparent; outline: none; box-shadow: none; }
  .mn-item > span:last-child { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mn-item .mi { display: grid; place-items: center; width: 30px; height: 24px; transition: color .16s ease, transform .12s ease; }
  .mn-item .mi svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  /* Icône « ⋯ » : trois points pleins. */
  .mn-dots .mi svg { fill: currentColor; stroke: none; }
  /* Sélection : SEULE l'icône se colore (aucun fond), + libellé en couleur. */
  .mn-item.active { color: var(--brand-primary, #5B28F5); }
  .mn-item.active .mi { color: var(--brand-primary, #5B28F5); }
  .mn-item.active .mi svg { stroke-width: 2.3; }
  .mn-item:active .mi { transform: scale(.88); }
  /* Bouton « Appli » estompé quand aucune Nova n'est lancée. */
  .mn-item.mn-dim { opacity: .38; }
  /* Bouton central Voilà : pastille surélevée en dégradé (icône blanche pleine). */
  .mn-voila .mi-voila { width: 46px; height: 46px; margin-top: -20px; border-radius: 50%; color: #fff;
    background: linear-gradient(135deg, var(--brand-primary, #5B28F5), var(--brand-accent, #a855f7));
    box-shadow: 0 8px 20px -6px color-mix(in srgb, var(--brand-primary, #5B28F5) 70%, transparent), 0 2px 6px rgba(15,20,40,.18);
    border: 3px solid var(--surface, #fff); }
  .mn-voila .mi-voila svg { width: 23px; height: 23px; fill: currentColor; stroke: none; }
  .mn-voila { color: var(--brand-primary, #5B28F5); }
  .mn-voila.active .mi-voila { transform: scale(1.03); }
  body.app-menu-open .app-scrim { display: block; position: fixed; inset: 0 0 50px; background: rgba(15,20,40,.42); z-index: 290; }
  #main { padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px)); }
  .view { padding: 18px 14px 80px; }
  /* Barre du haut : dégagée de la barre d'état / encoche iOS (jamais de bouton
     à moins d'~1 cm du haut). Le fond de la barre remonte sous la barre d'état. */
  .topbar { padding: 0 10px; padding-top: env(safe-area-inset-top, 0px); height: auto; min-height: calc(52px + env(safe-area-inset-top, 0px)); box-sizing: border-box; }
  .topbar #nav-new { display: none; }
  .user-chip #user-name { display: none; }
  /* Réglages accessibles via la barre du bas : on masque la pastille du topbar
     (le menu déroulant reste fonctionnel, déclenché par « Réglages »). */
  .topbar .user-chip { display: none; }
}

/* ===== Mises à jour des applications (catalogue) ===== */
.store-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--danger, #E71616); color: #fff; font-size: 11px; font-weight: 800; line-height: 1; }
.store-badge.inline { vertical-align: middle; margin-left: 6px; }
.sb-store { position: relative; }
.sb-store .store-badge.dynamic { position: absolute; top: 6px; left: 26px; }
#mobile-nav [data-view="catalogue"] { position: relative; }
#mobile-nav .store-badge.dynamic { position: absolute; top: 4px; right: 22%; }
.cat-installed-wrap { margin: 6px 0 18px; }
.cat-inst-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cat-inst-actions { display: flex; align-items: center; gap: 14px; }
.check.tiny { font-size: .78rem; color: var(--text-dim, #5A5A66); }
.cat-installed { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.cat-inst-card { display: flex; align-items: center; gap: 12px; background: var(--surface, #fff); border: 1px solid var(--border, #e4e7f0); border-radius: 12px; padding: 10px 14px; }
.cat-inst-icon { width: 38px; height: 38px; border-radius: 9px; object-fit: cover; flex: none; background: var(--surface-2, #f0f0f4); }
.cat-inst-body { flex: 1 1 auto; min-width: 0; }
.cat-inst-title { font-weight: 600; }
.cat-inst-act { display: flex; align-items: center; gap: 12px; flex: none; }

/* ===== Bibliothèque : cartes au format AppStore ===== */
.lib-card { position: relative; cursor: pointer; }
.lib-card .cat-card-body { padding-right: 22px; }
.cat-card-icon { display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 1.45rem; overflow: hidden; }
.cat-card-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lib-foot { flex-wrap: wrap; }
.lib-ver { font-size: .72rem; font-weight: 700; color: var(--text-dim,#5A5A66); background: var(--surface-2,#f0f0f4); border-radius: 999px; padding: 2px 9px; }
.lib-foot .store-badge.inline { background: var(--accent, #2A4BFF); }
.lib-sharedby { margin-top: 4px; }
.card-menu-wrap { position: absolute; top: 8px; right: 8px; }
.card-menu-btn { border: none; background: transparent; font-size: 20px; line-height: 1; color: var(--text-dim,#5A5A66); cursor: pointer; padding: 2px 9px; border-radius: 8px; }
.card-menu-btn:hover { background: var(--surface-2,#f0f0f4); }
.card-menu { position: absolute; top: 32px; right: 0; min-width: 168px; background: var(--surface,#fff); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-l); padding: 4px; z-index: 30; display: none; flex-direction: column; }
.card-menu.open { display: flex; }
/* Menu « ⋯ » d'une ligne de tableau : panneau ancré au body, en position fixed. */
.card-menu.rmenu-pop { position: fixed; top: 0; left: 0; right: auto; z-index: 200; }
/* Fenêtre autonome (overlay créé par le code, indépendant de #modal-root). */
.sa-dialog-ov { position: fixed; inset: 0; z-index: 9000; display: grid; place-items: center; padding: 18px; background: var(--color-global-overlay-medium, rgba(20,20,30,.45)); }
.sa-dialog-box { position: relative; }
@media (max-width: 560px) { .sa-dialog-ov { place-items: end stretch; padding: 0; } .sa-dialog-box { border-radius: 16px 16px 0 0; } }
.card-menu button { text-align: left; border: none; background: transparent; padding: 8px 12px; border-radius: 7px; font-size: .85rem; cursor: pointer; color: var(--text); font-family: inherit; }
.card-menu button:hover { background: var(--surface-2,#f0f0f4); }
.card-menu button.danger { color: var(--danger,#E71616); }

/* ===== Accueil : canevas de tableau de bord (grille à accroche) ===== */
.home-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* Grille à 12 colonnes ; chaque élément est placé en grid-column/grid-row. */
.home-grid { display: grid; grid-template-columns: repeat(12, 1fr); grid-auto-rows: 84px; gap: 10px; position: relative; align-items: stretch; }
.home-grid.editing { min-height: 60vh; background-image: linear-gradient(var(--border,#e4e7f0) 1px, transparent 1px), linear-gradient(90deg, var(--border,#e4e7f0) 1px, transparent 1px); background-size: calc((100% + 10px) / 12) 94px; background-position: -1px -1px; border-radius: 12px; }
.home-el { position: relative; min-width: 0; min-height: 0; overflow: hidden; background: var(--surface, #fff); border: 1px solid var(--border, #e4e7f0); border-radius: 12px; display: flex; flex-direction: column; z-index: 2; }
.home-el .el-body { flex: 1 1 auto; min-height: 0; position: relative; overflow: hidden; }
.home-el .el-body iframe { width: 100%; height: 100%; border: 0; display: block; }
.ht-loading { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: var(--text-dim, #5A5A66); font-size: .8rem; padding: 10px; }
/* Conteneur / section / séparateur : derrière les widgets. */
.el-container { z-index: 1; border-style: dashed; }
.el-container-title { font-weight: 600; font-size: .8rem; color: var(--text-dim, #5A5A66); padding: 6px 10px; }
.el-section { background: transparent; border: none; z-index: 1; justify-content: center; }
.el-section-title { margin: 0; font-size: 1.05rem; font-weight: 700; color: var(--text, #27272b); padding: 0 4px; border-bottom: 2px solid var(--border, #e4e7f0); padding-bottom: 6px; }
.el-sep { background: transparent; border: none; z-index: 1; }
.el-sep .el-body { display: flex; align-items: center; justify-content: center; }
.el-sep.sep-h .el-body::before { content: ''; width: 100%; height: 0; border-top: 3px solid var(--sep-color, #d0d3dd); border-radius: 3px; }
.el-sep.sep-v .el-body::before { content: ''; height: 100%; width: 0; border-left: 3px solid var(--sep-color, #d0d3dd); border-radius: 3px; }
/* Widget d'application (titre + iframe) */
.el-wtitle { font-weight: 600; font-size: .82rem; padding: 7px 11px; border-bottom: 1px solid var(--border, #eceef5); flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Raccourci application */
.el-app .el-body.app-body { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 12px; text-align: center; }
.el-app.clickable { cursor: pointer; }
.ht-appicon { width: 52px; height: 52px; border-radius: 13px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 1.5rem; overflow: hidden; background: var(--brand-primary, var(--accent, #2A4BFF)); }
.ht-appicon img { width: 100%; height: 100%; object-fit: cover; }
.ht-appname { font-weight: 600; font-size: .88rem; }
/* Chrome d'édition */
.home-grid.editing .home-el { box-shadow: 0 0 0 1px var(--brand-primary, var(--accent, #2A4BFF)) inset; }
.home-el.dragging { opacity: .7; z-index: 50 !important; box-shadow: 0 6px 22px rgba(0,0,0,.18) !important; }
.el-editbar { position: absolute; top: 0; left: 0; right: 0; height: 22px; display: flex; align-items: center; gap: 2px; padding: 0 4px; background: color-mix(in srgb, var(--brand-primary, #2A4BFF) 90%, #000 0%); z-index: 6; }
.el-move { color: #fff; cursor: grab; font-size: .8rem; padding: 0 6px; flex: 1 1 auto; user-select: none; touch-action: none; }
.el-tool { border: none; background: rgba(255,255,255,.16); color: #fff; border-radius: 5px; width: 18px; height: 18px; line-height: 1; cursor: pointer; font-size: .72rem; padding: 0; }
.el-tool:hover { background: rgba(255,255,255,.3); }
.el-resize { position: absolute; right: 0; bottom: 0; width: 16px; height: 16px; cursor: nwse-resize; z-index: 6; touch-action: none; background: linear-gradient(135deg, transparent 50%, var(--brand-primary, #2A4BFF) 50%); border-bottom-right-radius: 11px; }
/* ----- Widgets intégrés ----- */
.bi { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 10px; text-align: center; height: 100%; box-sizing: border-box; }
.bi-time { font-size: clamp(1.3rem, 6vw, 2.2rem); font-weight: 700; color: var(--brand-primary, var(--accent, #2A4BFF)); line-height: 1.1; }
.bi-sub { font-size: .78rem; color: var(--text-dim, #5A5A66); }
.bi-daynum { font-size: clamp(2rem, 9vw, 3.4rem); font-weight: 800; line-height: 1; }
.bi-wicon { font-size: 2.2rem; }
.bi-ctrl { display: flex; gap: 6px; margin-top: 4px; }
.bi-btn { border: 1px solid var(--border, #e4e7f0); background: var(--surface, #fff); border-radius: 8px; width: 30px; height: 28px; cursor: pointer; font-size: .9rem; color: var(--text, #27272b); }
.bi-btn:hover { border-color: var(--brand-primary, var(--accent, #2A4BFF)); }
.bi-zlist, .bi-rss, .bi-favs, .bi-todo-list { align-self: stretch; overflow: auto; display: flex; flex-direction: column; gap: 4px; }
.bi-zrow { display: flex; justify-content: space-between; font-size: .82rem; padding: 2px 4px; }
.bi-zrow b { color: var(--brand-primary, var(--accent, #2A4BFF)); }
.bi-link { display: flex; flex-direction: column; align-items: center; gap: 8px; text-decoration: none; color: var(--text, #27272b); width: 100%; height: 100%; justify-content: center; }
.bi-link-ic { font-size: 1.8rem; }
.bi-link-label { font-weight: 600; font-size: .85rem; }
.bi-iframe { width: 100%; height: 100%; border: 0; }
.bi-img, .bi-qrimg { max-width: 100%; max-height: 100%; }
.bi-img { width: 100%; height: 100%; object-fit: cover; }
.bi-rss { text-align: left; padding: 6px 8px; }
.bi-rss a, .bi-favs a { color: var(--brand-primary, var(--accent, #2A4BFF)); text-decoration: none; font-size: .82rem; padding: 3px 0; border-bottom: 1px solid var(--border, #eceef5); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bi-rss a:hover, .bi-favs a:hover { text-decoration: underline; }
.bi-search { display: flex; gap: 6px; width: 100%; align-items: center; }
.bi-search input { flex: 1 1 auto; min-width: 0; padding: 7px 10px; border: 1px solid var(--border, #e4e7f0); border-radius: 8px; font: inherit; }
.bi-search button { border: none; background: var(--brand-primary, var(--accent, #2A4BFF)); color: #fff; border-radius: 8px; padding: 7px 11px; cursor: pointer; }
.bi-quote blockquote { margin: 0; font-style: italic; font-size: .92rem; }
.bi-quote cite { font-size: .78rem; color: var(--text-dim, #5A5A66); }
.bi-note-ta { width: 100%; height: 100%; border: 0; resize: none; padding: 10px; font: inherit; background: #fffbe6; color: #4a4424; box-sizing: border-box; }
.bi-text { align-items: stretch; justify-content: flex-start; text-align: left; overflow: auto; }
.bi-text h4 { margin: 0 0 4px; font-size: .95rem; }
.bi-textbody { font-size: .85rem; color: var(--text, #27272b); }
.bi-todo { align-items: stretch; padding: 8px; }
.bi-todo-add { display: flex; gap: 5px; margin-bottom: 6px; }
.bi-todo-add input { flex: 1 1 auto; min-width: 0; padding: 5px 8px; border: 1px solid var(--border, #e4e7f0); border-radius: 7px; font: inherit; }
.bi-todo-add button { border: none; background: var(--brand-primary, var(--accent, #2A4BFF)); color: #fff; border-radius: 7px; width: 28px; cursor: pointer; }
.bi-todo-row { display: flex; align-items: center; gap: 6px; font-size: .84rem; }
.bi-todo-row span { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; }
.bi-todo-row span.done { text-decoration: line-through; color: var(--text-dim, #9a9aa6); }
.bi-todo-del { border: none; background: transparent; color: var(--text-dim, #9a9aa6); cursor: pointer; }
.bi-cal-h { font-weight: 700; font-size: .85rem; text-transform: capitalize; margin-bottom: 4px; }
.bi-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; width: 100%; font-size: .72rem; }
.bi-cal-wd { color: var(--text-dim, #9a9aa6); font-weight: 600; }
.bi-cal-d { padding: 3px 0; border-radius: 6px; }
.bi-cal-d.on { background: var(--brand-primary, var(--accent, #2A4BFF)); color: #fff; font-weight: 700; }
.hp-group { grid-column: 1 / -1; font-weight: 700; font-size: .8rem; color: var(--text-dim, #5A5A66); margin: 6px 0 2px; }
/* Sélecteur de tuiles (modale) */
.home-pick-tabs { display: flex; gap: 6px; margin: 6px 0 12px; }
.hp-tab { border: 1px solid var(--border, #e4e7f0); background: var(--surface, #fff); border-radius: 999px; padding: 5px 14px; cursor: pointer; font-size: .85rem; font-family: inherit; color: var(--text, #27272b); }
.hp-tab.on { background: var(--brand-primary, var(--accent, #2A4BFF)); color: #fff; border-color: transparent; }
.hp-pane { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; max-height: 52vh; overflow: auto; }
.hp-item { text-align: left; border: 1px solid var(--border, #e4e7f0); background: var(--surface, #fff); border-radius: 12px; padding: 11px 13px; cursor: pointer; font-family: inherit; color: var(--text, #27272b); display: flex; flex-direction: column; gap: 3px; }
.hp-item:hover { border-color: var(--brand-primary, var(--accent, #2A4BFF)); }
.hp-item .hpi-name { font-weight: 600; font-size: .9rem; }
.hp-item .hpi-sub { font-size: .75rem; color: var(--text-dim, #5A5A66); }
.hp-item .hpi-tag { font-size: .68rem; color: var(--text-dim, #5A5A66); text-transform: uppercase; letter-spacing: .03em; }
.hp-empty { grid-column: 1 / -1; color: var(--text-dim, #5A5A66); padding: 10px; }
/* Étoile « favori » sur les cartes de la bibliothèque */
.lib-fav { position: absolute; top: 8px; left: 8px; border: none; background: transparent; cursor: pointer; font-size: 18px; line-height: 1; padding: 2px 6px; border-radius: 8px; color: var(--text-dim, #9a9aa6); z-index: 2; }
.lib-fav:hover { background: var(--surface-2, #f0f0f4); }
.lib-fav.on { color: #f5b301; }
@media (max-width: 640px) {
    /* Sur téléphone, le canevas s'empile : chaque élément prend toute la largeur,
       dans l'ordre de la disposition (les positions de grille passeraient mal). */
    .home-grid { grid-template-columns: 1fr; grid-auto-rows: auto; }
    .home-grid.editing { background-image: none; }
    .home-el { grid-column: 1 / -1 !important; grid-row: auto !important; min-height: 150px; }
    .el-section, .el-sep { min-height: 40px; }
}
/* Carte dont le menu « … » est ouvert : passe au premier plan (au-dessus des cartes suivantes). */
.cat-card.menu-open { z-index: 40; }

/* ===== Agent « Voilà » : bouton flottant + dock + plein écran ===== */
.voila-root { position: fixed; right: 20px; bottom: 20px; z-index: 1200; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.voila-fab { width: 56px; height: 56px; border-radius: 50%; background: var(--surface, #fff); border: 2px solid var(--brand-primary, var(--accent, #5B28F5)); box-shadow: var(--shadow-l, 0 8px 28px rgba(0,0,0,.18)); color: var(--brand-primary, var(--accent, #5B28F5)); display: grid; place-items: center; cursor: grab; transition: transform .12s, opacity .18s; overflow: hidden; padding: 0; touch-action: none; opacity: .68; }
.voila-fab:hover, .voila-fab:active { opacity: 1; cursor: grab; }
.voila-fab:active { cursor: grabbing; }
/* Empêche le glisser-déposer natif de l'image (qui affiche un curseur « sens interdit »). */
.voila-fab img, .voila-fab .voila-av { -webkit-user-drag: none; user-select: none; pointer-events: none; }
.voila-fab:hover { transform: scale(1.06); }
.voila-fab-ic { display: grid; place-items: center; width: 100%; height: 100%; }
.voila-fab-ic svg { width: 28px; height: 28px; display: block; }
.voila-fab-ic .voila-av { width: 100%; height: 100%; display: block; object-fit: cover; border-radius: 50%; }
.voila-av { object-fit: cover; border-radius: 50%; display: block; }
.voila-panel { width: 460px; height: 680px; max-height: min(680px, 86vh); background: var(--surface, #fff); border: 1px solid var(--border, #e2e2e9); border-radius: 14px; box-shadow: var(--shadow-l, 0 12px 40px rgba(0,0,0,.22)); display: flex; flex-direction: column; overflow: hidden; }
.voila-panel.full { position: fixed; inset: 0; width: auto; height: auto; max-height: none; border-radius: 0; z-index: 1201; }
.voila-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border, #eceef5); background: var(--color-neutral-background-soft, #f6f7fb); }
.voila-title { font-family: Montserrat, system-ui, sans-serif; font-weight: 700; font-size: .98rem; display: flex; align-items: center; gap: 8px; }
.voila-head-ic { color: var(--brand-primary, var(--accent, #5B28F5)); display: inline-grid; place-items: center; }
.voila-head-ic svg { width: 20px; height: 20px; }
.voila-head-ic .voila-av { width: 24px; height: 24px; }
.voila-head-actions { display: flex; gap: 4px; }
.voila-iconbtn { border: none; background: transparent; color: var(--text-dim, #5A5A66); width: 28px; height: 28px; border-radius: 7px; cursor: pointer; font-size: .95rem; line-height: 1; }
.voila-iconbtn:hover { background: var(--color-neutral-background-soft, #eceef5); color: var(--text, #27272b); }
.voila-msgs { flex: 1 1 auto; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--surface, #fff); }
.voila-panel.full .voila-msgs { padding: 18px max(18px, calc((100% - 760px) / 2)); }
.voila-msg { max-width: 86%; padding: 9px 12px; border-radius: 12px; font-size: .9rem; line-height: 1.45; white-space: normal; word-wrap: break-word; }
.voila-msg.user { align-self: flex-end; background: var(--brand-primary, var(--accent, #5B28F5)); color: var(--brand-primary-contrast, #fff); border-bottom-right-radius: 4px; }
.voila-msg.bot { align-self: flex-start; background: var(--color-neutral-background-soft, #f0f0f4); color: var(--text, #27272b); border-bottom-left-radius: 4px; }
.voila-msg.err { align-self: flex-start; background: var(--color-status-background-error, #ffedeb); color: var(--danger, #E71616); }
.voila-msg code { background: rgba(0,0,0,.07); padding: 1px 5px; border-radius: 5px; font-family: ui-monospace, Menlo, monospace; font-size: .85em; }
.voila-msg.user code { background: rgba(255,255,255,.22); }
.voila-typing { align-self: flex-start; color: var(--text-dim, #5A5A66); font-size: .82rem; padding: 4px 6px; }
.voila-typing span { display: inline-block; animation: voilablink 1.2s infinite; }
.voila-typing span:nth-child(2) { animation-delay: .2s; } .voila-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes voilablink { 0%, 60%, 100% { opacity: .3; } 30% { opacity: 1; } }
/* Trace d'activité en direct : ce que fait l'agent, étape par étape. */
.ac-activity { align-self: flex-start; max-width: 92%; }
.ac-steps { display: flex; flex-direction: column; gap: 3px; margin: 2px 0 4px; padding: 8px 10px;
    background: var(--surface-2, #f4f5fa); border: 1px solid var(--border, #eceef5); border-radius: 10px; }
.ac-step { font-size: .82rem; color: var(--text-dim, #5A5A66); line-height: 1.35; }
.ac-step.cur { color: var(--text, #27272b); font-weight: 600; }
.ac-step-det { color: var(--text-dim, #7a7a85); font-weight: 400; }
@media (prefers-reduced-motion: no-preference) { .ac-step.cur .ac-step-lab { animation: voilablink 1.6s infinite; } }
.ac-act-foot { display: flex; align-items: center; gap: 10px; }
.ac-stop { flex: 0 0 auto; }
.ac-act-details { align-self: flex-start; max-width: 92%; margin: -2px 0 4px; font-size: .8rem; }
.ac-act-details > summary { cursor: pointer; color: var(--text-dim, #7a7a85); padding: 2px 4px; user-select: none; }
.ac-act-details[open] > summary { margin-bottom: 4px; }
.ac-act-details .ac-steps { background: var(--surface-2, #f4f5fa); border: 1px solid var(--border, #eceef5); border-radius: 8px; padding: 8px 10px; }
.voila-form { display: flex; gap: 8px; align-items: flex-end; padding: 10px; border-top: 1px solid var(--border, #eceef5); background: var(--surface, #fff); }
.voila-input { flex: 1 1 auto; min-width: 0; resize: none; max-height: 120px; border: 1px solid var(--border, #e2e2e9); border-radius: 10px; padding: 9px 11px; font: inherit; font-size: .9rem; background: var(--surface, #fff); color: var(--text, #27272b); }
.voila-input:focus { outline: none; border-color: var(--brand-primary, var(--accent, #5B28F5)); }
/* Boutons d'action du chat : icône centrée, à plat (sans contour ni fond) */
.voila-iconbtn2 { flex: none; width: 42px; height: 42px; padding: 0; border: none; background: transparent; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; color: var(--text-dim, #8a8f9c); transition: color .12s ease, background .12s ease; }
.voila-iconbtn2:hover { background: var(--surface-2, #f1f3f9); color: var(--text, #27272b); }
.voila-iconbtn2 svg { display: block; }
/* Trombone : gris à plat */
.voila-attach { color: var(--text-dim, #8a8f9c); }
/* Éclair à deux niveaux : 0 = 2 éclairs gris clair ; 1 = 1 thème + 1 gris ; 2 = 2 thème */
.voila-boost { gap: 0; width: 48px; }
.voila-boost:hover { background: var(--surface-2, #f1f3f9); }
.voila-boost .blt { display: inline-flex; color: var(--border, #cfd3dd); line-height: 0; transition: color .12s ease; }
.voila-boost.lvl1 .blt1 { color: var(--brand-primary, #5B28F5); }
.voila-boost.lvl2 .blt1, .voila-boost.lvl2 .blt2 { color: var(--brand-primary, #5B28F5); }
/* Envoyer : fond transparent, sans contour, icône couleur du thème */
.voila-send { flex: none; border: none; background: transparent; color: var(--brand-primary, var(--accent, #5B28F5)); width: 42px; height: 42px; border-radius: 10px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.voila-send:hover { background: var(--surface-2, #f1f3f9); }
.voila-send svg { display: block; }
.voila-send:disabled { opacity: .4; cursor: default; background: transparent; }
.voila-intro { align-self: stretch; text-align: center; color: var(--text-dim, #5A5A66); font-size: .85rem; padding: 18px 10px; }
.voila-intro b { color: var(--text, #27272b); font-family: Montserrat, system-ui, sans-serif; }
.voila-intro-av { width: 64px; height: 64px; margin: 0 auto 8px; box-shadow: 0 4px 14px rgba(91,40,245,.22); }
.voila-note { align-self: center; color: var(--text-dim, #5A5A66); font-size: .76rem; padding: 1px 8px; opacity: .85; }
.voila-note b, .voila-note strong { color: var(--text, #27272b); font-weight: 600; }
/* Widget « Voilà » dans l'accueil : chat compact sans en-tête flottant */
.bi-voila { padding: 0; }
.voila-chat-compact { display: flex; flex-direction: column; height: 100%; }
.voila-chat-compact .voila-msgs { padding: 10px; gap: 8px; }
.voila-chat-compact .voila-form { padding: 8px; }
@media (max-width: 640px) {
    .voila-root { right: 12px; bottom: calc(70px + env(safe-area-inset-bottom, 0px)); }
    .voila-panel { width: calc(100vw - 24px); height: 70vh; }
}

/* ===== FAQ ===== */
.faq-list { display: grid; gap: 12px; max-width: 920px; }
.faq-card { background: var(--surface, #fff); border: 1px solid var(--border, #e4e7f0); border-radius: 12px; padding: 14px 16px; transition: box-shadow .3s; }
.faq-card.faq-hi { box-shadow: 0 0 0 2px var(--brand-primary, var(--accent, #2A4BFF)); }
.faq-q { font-family: Montserrat, system-ui, sans-serif; font-weight: 700; font-size: .98rem; margin-bottom: 6px; }
.faq-a { color: var(--text, #27272b); font-size: .92rem; line-height: 1.55; }
.faq-actions { margin-top: 10px; display: flex; gap: 8px; }
.faq-suggest-box { background: var(--color-neutral-background-soft, #f0f0f4); border: 1px solid var(--border, #e4e7f0); border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; max-width: 920px; }
.faq-suggest-h { font-size: .82rem; color: var(--text-dim, #5A5A66); margin-bottom: 8px; }
.faq-suggest-chip { border: 1px solid var(--border, #e4e7f0); background: var(--surface, #fff); border-radius: 999px; padding: 5px 12px; margin: 3px; cursor: pointer; font-size: .8rem; font-family: inherit; color: var(--text, #27272b); }
.faq-suggest-chip:hover { border-color: var(--brand-primary, var(--accent, #2A4BFF)); }
.voila-faqlink { color: var(--brand-primary, var(--accent, #2A4BFF)); text-decoration: underline; cursor: pointer; font-weight: 600; }

/* ===== Voilà : autocomplétion d'agents + indicateur ===== */
.voila-ac { display: flex; flex-direction: column; gap: 1px; padding: 6px; background: var(--surface, #fff); border-top: 1px solid var(--border, #eceef5); max-height: 180px; overflow: auto; }
.voila-ac.hidden { display: none; }
.voila-ac-item { text-align: left; border: none; background: transparent; padding: 6px 10px; border-radius: 7px; cursor: pointer; font-family: inherit; color: var(--text, #27272b); font-size: .85rem; }
.voila-ac-item:hover { background: var(--color-neutral-background-soft, #f0f0f4); }
.voila-ac-item b { color: var(--brand-primary, var(--accent, #2A4BFF)); }
.voila-ac-item span { color: var(--text-dim, #5A5A66); margin-left: 6px; }
.faq-q code { background: var(--color-neutral-background-soft, #f0f0f4); padding: 1px 7px; border-radius: 5px; font-size: .82em; font-family: ui-monospace, Menlo, monospace; }

/* =========================================================================
   SPLASH — écran de démarrage (image plein écran, 3–4 s).
   Masqué par défaut : n'est révélé (classe .splash-on, posée en JS) QUE sur
   la version PWA installée d'un appareil mobile. Jamais sur navigateur ni sur
   ordinateur. Le display:none par défaut évite tout clignotement ailleurs.
   ========================================================================= */
.splash {
    position: fixed; inset: 0; z-index: 9999;
    /* Plein écran RÉEL, y compris sous les barres système (dvh + repli vh). */
    width: 100vw; height: 100vh; height: 100dvh;
    display: none; align-items: center; justify-content: center;
    background: #E5DCFC; /* fond lavande, raccord avec l'image */
    transition: opacity .55s ease, visibility .55s ease;
    -webkit-tap-highlight-color: transparent;
}
.splash.splash-on { display: flex; }
.splash-hide { opacity: 0; visibility: hidden; pointer-events: none; }
.splash-img {
    width: 100%; height: 100%;
    /* « cover » : l'image remplit tout l'écran jusqu'en bas (léger recadrage assumé). */
    object-fit: cover; object-position: center;
    animation: sp-fade .5s ease both;
}
@keyframes sp-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .splash-img { animation: none; } }

/* =========================================================================
   PWA mobile — verrou « vraie app » : largeur fixe, pas de zoom, sélecteur
   d'artefacts ouverts dans la feuille du bouton « Artefact ».
   ========================================================================= */
html.pwa-mobile, html.pwa-mobile body {
    width: 100%; max-width: 100%; overflow-x: hidden;
    overscroll-behavior: none; touch-action: pan-y;
    text-size-adjust: 100%; -webkit-text-size-adjust: 100%;
}
html.pwa-mobile { -webkit-user-select: none; user-select: none; }
/* Les champs de saisie restent sélectionnables. */
html.pwa-mobile input, html.pwa-mobile textarea, html.pwa-mobile [contenteditable] { -webkit-user-select: text; user-select: text; }

/* Artefacts ouverts (sélecteur dans la feuille du bouton « Artefact »). */
.sb-running { margin: 4px 2px 8px; }
.sb-running-list { display: flex; flex-direction: column; gap: 4px; }
.sb-hint { margin-left: auto; font-size: 9.5px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--brand-text-dim, #9aa0ad); opacity: .85; }
.sb-run-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 1px solid var(--border, #e4e7f0); background: var(--surface, #fff); cursor: pointer; padding: 10px 12px; border-radius: 11px; font-family: inherit; font-size: 13.5px; color: var(--text, #1b1f2a); -webkit-tap-highlight-color: transparent; user-select: none; }
.sb-run-item.on { border-color: var(--brand-primary, #5B28F5); background: color-mix(in srgb, var(--brand-primary, #5B28F5) 10%, transparent); }
.sb-run-av { width: 30px; height: 30px; border-radius: 8px; flex: none; display: grid; place-items: center; font-weight: 800; font-size: 13px; color: var(--brand-primary-contrast, #fff); background: var(--brand-primary, #5B28F5); }
.sb-run-name { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.sb-run-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok, #0a8f3c); flex: none; }
.sb-run-item.closing { animation: sb-run-close .25s ease forwards; }
@keyframes sb-run-close { to { opacity: 0; transform: translateX(-12px); height: 0; padding-top: 0; padding-bottom: 0; margin: 0; } }
.sb-noart { margin: 6px 2px; padding: 16px 12px; text-align: center; color: var(--brand-text-dim, #6b7180); font-size: 13px; }

/* Le sélecteur « Artefacts ouverts » n'existe que dans la feuille mobile.
   Sur ordinateur, les artefacts ouverts sont déjà les pastilles du runner. */
.sb-running, .sb-noart { display: none; }
@media (max-width: 760px) {
  .sb-running:not(.hidden) { display: block; }
  .sb-noart:not(.hidden) { display: block; }
}

/* =========================================================================
   AppStore — fiche marketing : badge officiel, carrousel, avis, commentaires
   ========================================================================= */
/* Pastille « Officiel » sur les cartes du catalogue */
.cat-card { position: relative; }
.official-badge { position: absolute; top: 8px; right: 8px; z-index: 2;
    display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px;
    background: var(--brand-primary, #5B28F5); color: var(--brand-primary-contrast, #fff);
    font-size: 10.5px; font-weight: 800; letter-spacing: .3px; box-shadow: 0 2px 8px rgba(91,40,245,.35); }
.official-badge::before { content: '✓'; font-weight: 900; }
.official-badge.inline { position: static; box-shadow: none; }
.cat-card.is-official { box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--brand-primary, #5B28F5) 45%, transparent); }

/* ============ Refonte « Mes Applications » ============ */
/* Le conteneur #cards porte .cards (grille) : en mode bibliothèque on empile
   les SECTIONS verticalement ; chaque section a sa propre grille de cartes. */
#cards { display: block; }
.lib-toolbar { display: flex; align-items: center; gap: 12px; margin: 2px 0 20px; flex-wrap: wrap; }
.lib-search { position: relative; flex: 1 1 260px; max-width: 440px; }
.lib-search-ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); font-size: .85rem; opacity: .55; pointer-events: none; }
.lib-search input { width: 100%; padding: 10px 14px 10px 36px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); font: inherit; font-size: .92rem; color: var(--text); }
.lib-search input:focus { outline: none; border-color: var(--brand-primary, #5B28F5); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary,#5B28F5) 15%, transparent); }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); }
.seg-btn { border: none; background: transparent; padding: 8px 13px; cursor: pointer; font-size: 1rem; line-height: 1; color: var(--text-dim, #5A5A66); }
.seg-btn.on { background: var(--brand-primary, #5B28F5); color: #fff; }

.lib-section { margin-bottom: 28px; }
.lib-sec-head { display: flex; align-items: center; gap: 10px; margin: 0 0 13px; }
.lib-sec-head h3 { margin: 0; font-family: Montserrat, system-ui, sans-serif; font-size: 1.08rem; font-weight: 700; }
.lib-sec-count { font-size: .72rem; font-weight: 700; color: var(--text-dim,#5A5A66); background: var(--surface-2,#f0f0f4); border-radius: 999px; padding: 2px 9px; }
.lib-sec-head > button { margin-left: auto; }
.lib-updates .lib-sec-head h3 { color: var(--brand-primary, #5B28F5); }
.lib-updates .cat-card { border-color: color-mix(in srgb, var(--brand-primary,#5B28F5) 32%, var(--border)); background: color-mix(in srgb, var(--brand-primary,#5B28F5) 4%, var(--surface)); }

/* Cartes plus soignées (partagé AppStore + bibliothèque) */
.cat-card { border-radius: 18px; padding: 16px; box-shadow: 0 1px 2px rgba(16,24,40,.05); transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease; }
.cat-card:hover { box-shadow: 0 14px 30px -12px rgba(16,24,40,.24); transform: translateY(-3px); border-color: color-mix(in srgb, var(--brand-primary,#5B28F5) 32%, var(--border)); }
.cat-card-icon { width: 58px; height: 58px; border-radius: 15px; box-shadow: 0 5px 14px -5px color-mix(in srgb, var(--brand-primary,#5B28F5) 55%, transparent); }
.cat-card-body h4 { font-family: Montserrat, system-ui, sans-serif; font-weight: 700; font-size: 1rem; }

/* Bouton « Lancer » : révélé au survol (la carte entière reste cliquable) */
.lib-foot { justify-content: flex-start; gap: 6px; flex-wrap: wrap; }
.lib-launch { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; border: none; cursor: pointer; font: inherit; font-size: .78rem; font-weight: 700; padding: 6px 13px; border-radius: 999px; background: var(--color-brand-background,#F0EBFF); color: var(--accent,#5B28F5); opacity: 0; transform: translateY(3px); transition: opacity .15s, transform .15s, background .15s, color .15s; }
.cat-card:hover .lib-launch { opacity: 1; transform: none; }
.lib-launch:hover { background: var(--brand-primary,#5B28F5); color: #fff; }
.lib-play { font-size: .68rem; }
@media (hover: none) { .lib-launch { opacity: 1; transform: none; } }

/* Vue compacte (liste dense) */
.lib-compact .cat-grid { grid-template-columns: 1fr; gap: 8px; }
.lib-compact .cat-card { padding: 10px 14px; border-radius: 12px; }
.lib-compact .cat-card:hover { transform: none; }
.lib-compact .cat-card-icon { width: 42px; height: 42px; border-radius: 11px; font-size: 1.15rem; }
.lib-compact .cat-card-sub { display: none; }
.lib-compact .lib-launch { opacity: 1; transform: none; }

/* ============ Refonte AppStore (façon vitrine) ============ */
.store-section { margin: 30px 0; }
.store-sec-head { display: flex; align-items: baseline; gap: 10px; margin: 0 0 14px; }
.store-sec-head h3 { margin: 0; font-family: Montserrat, system-ui, sans-serif; font-size: 1.2rem; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.store-sec-head .store-sec-sub { color: var(--text-dim,#5A5A66); font-size: .85rem; }
.store-sec-head .store-more { margin-left: auto; border: none; background: transparent; color: var(--brand-primary,#5B28F5); font-weight: 700; font-size: .85rem; cursor: pointer; }
.hscroll { display: grid; grid-auto-flow: column; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.hscroll > * { scroll-snap-align: start; }

/* Hero carrousel des mises en avant */
.store-hero { grid-auto-columns: minmax(58%, 430px); }
.hero-card { position: relative; aspect-ratio: 16/6.2; min-height: 150px; border-radius: 20px; overflow: hidden; cursor: pointer; background: linear-gradient(135deg, var(--brand-primary,#5B28F5), var(--brand-accent,#8b5cf6)); box-shadow: 0 18px 36px -18px rgba(16,24,40,.42); }
.hero-card .hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-card .hero-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(12,8,34,.04) 25%, rgba(12,8,34,.74) 100%); }
.hero-body { position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 26px; color: #fff; }
.hero-eyebrow { font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; opacity: .92; display: inline-flex; align-items: center; gap: 5px; }
.hero-title { font-family: Montserrat, system-ui, sans-serif; font-weight: 800; font-size: 1.4rem; line-height: 1.1; margin: 4px 0 2px; }
.hero-sub { font-size: .95rem; opacity: .93; max-width: 46ch; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.hero-cta { margin-top: 13px; display: inline-block; background: #fff; color: var(--brand-primary,#5B28F5); font-weight: 800; font-size: .8rem; padding: 8px 18px; border-radius: 999px; }
.hero-icon { position: absolute; top: 18px; right: 18px; width: 52px; height: 52px; border-radius: 14px; background: rgba(255,255,255,.22); display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 1.35rem; overflow: hidden; }
.hero-icon img { width: 100%; height: 100%; object-fit: cover; }
/* Variante compacte de « À la une » : cartes réduites d'environ un tiers. */
.store-hero-sm { grid-auto-columns: minmax(38%, 288px); }
.store-hero-sm .hero-card { min-height: 100px; }
.store-hero-sm .hero-body { padding: 14px 16px; }
.store-hero-sm .hero-title { font-size: 1rem; margin: 3px 0 1px; }
.store-hero-sm .hero-sub { font-size: .78rem; -webkit-line-clamp: 1; }
.store-hero-sm .hero-eyebrow { font-size: .6rem; }
.store-hero-sm .hero-cta { margin-top: 8px; font-size: .7rem; padding: 6px 13px; }
.store-hero-sm .hero-icon { width: 38px; height: 38px; border-radius: 11px; font-size: 1rem; top: 12px; right: 12px; }

/* Page « Mes applications » (installées + mises à jour automatiques) */
.inst-autoall { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 14px 18px; border-radius: 16px; margin-bottom: 16px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--brand-primary,#5B28F5) 8%, var(--surface)), color-mix(in srgb, var(--brand-primary,#5B28F5) 3%, var(--surface)));
    border: 1px solid color-mix(in srgb, var(--brand-primary,#5B28F5) 18%, var(--border, #e4e7f0)); }
.inst-autoall-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.inst-autoall-act { display: flex; align-items: center; gap: 14px; flex: none; }
.inst-list { display: flex; flex-direction: column; gap: 10px; }
.inst-card { display: flex; align-items: center; gap: 14px; background: var(--surface, #fff); border: 1px solid var(--border, #e4e7f0); border-radius: 14px; padding: 12px 16px; }
.inst-card .cat-inst-icon { width: 46px; height: 46px; border-radius: 12px; flex: none; object-fit: cover; }
.inst-card-body { flex: 1 1 auto; min-width: 0; }
.inst-card-title { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.inst-card-act { display: flex; align-items: center; gap: 12px; flex: none; }
.inst-auto-cap { user-select: none; }

/* Encart « Officielles » */
.store-official { padding: 22px; border-radius: 24px; border: 1px solid color-mix(in srgb, var(--brand-primary,#5B28F5) 18%, var(--border)); background: linear-gradient(180deg, color-mix(in srgb, var(--brand-primary,#5B28F5) 9%, var(--surface)), color-mix(in srgb, var(--brand-primary,#5B28F5) 3%, var(--surface))); }
.store-official .store-sec-head .off-chip { font-size: .66rem; font-weight: 800; letter-spacing: .05em; padding: 3px 10px; border-radius: 999px; background: var(--brand-primary,#5B28F5); color: #fff; }
.off-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; grid-auto-rows: 1fr; gap: 14px; }
.off-big { grid-row: span 2; position: relative; border-radius: 18px; overflow: hidden; min-height: 190px; color: #fff; cursor: pointer; background: linear-gradient(135deg, #4c1fd6, #7c3aed); box-shadow: 0 16px 34px -16px rgba(76,31,214,.55); }
.off-big .hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.off-big .hero-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(12,8,34,.05) 30%, rgba(12,8,34,.72) 100%); }
.off-big .hero-body { padding: 20px 22px; }
.off-big .hero-title { font-size: 1.35rem; }
.off-mini { display: flex; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 15px; padding: 12px 14px; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.off-mini:hover { transform: translateY(-2px); box-shadow: 0 12px 26px -12px rgba(16,24,40,.22); }
.off-mini .cat-card-icon { width: 46px; height: 46px; border-radius: 12px; }
.off-mini h4 { margin: 0; font-family: Montserrat, system-ui, sans-serif; font-size: .92rem; }
.off-mini .off-mini-sub { font-size: .76rem; color: var(--text-dim,#5A5A66); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Rangées top-5 par catégorie */
.store-cat-row .hscroll { grid-auto-columns: minmax(240px, 260px); }
.store-cat-ic { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: color-mix(in srgb, var(--brand-primary,#5B28F5) 12%, transparent); color: var(--brand-primary,#5B28F5); font-size: .9rem; }

/* Spotlight « mieux notés » rotatif */
.store-spotlight { position: relative; border-radius: 22px; overflow: hidden; min-height: 170px; color: #fff; background: linear-gradient(120deg, #1e1b4b, #4c1fd6 60%, #7c3aed); padding: 22px 24px; cursor: pointer; }
.spot-cat { font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.spot-title { font-family: Montserrat, system-ui, sans-serif; font-size: 1.5rem; font-weight: 800; margin: 4px 0; }
.spot-sub { opacity: .9; max-width: 52ch; }
.spot-rate { margin-top: 10px; font-weight: 700; }
.spot-dots { position: absolute; right: 20px; bottom: 18px; display: flex; gap: 6px; }
.spot-dot { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.4); transition: background .2s, width .2s; }
.spot-dot.on { background: #fff; width: 18px; border-radius: 4px; }

/* Rangement assisté (Non classés) */
.nc-card { display: flex; flex-direction: column; gap: 8px; }
.nc-classify { width: 100%; }
.nc-sel { width: 100%; padding: 7px 10px; border: 1px solid color-mix(in srgb, var(--brand-primary,#5B28F5) 30%, var(--border)); border-radius: 10px; font: inherit; font-size: .82rem; color: var(--text); background: var(--surface); cursor: pointer; }
.nc-sel:focus { outline: none; border-color: var(--brand-primary,#5B28F5); }
/* Notes de version (fiche AppStore) */
.cd-releases-wrap { margin: 18px 0; }
.cd-releases { display: flex; flex-direction: column; gap: 10px; }
.rel-item { border: 1px solid var(--border, #e4e7f0); border-radius: 10px; padding: 10px 12px; }
.rel-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rel-ver { font-weight: 800; font-size: .95rem; }
.rel-current { font-size: .68rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--okbg, #e6f4e6); color: var(--ok, #008800); }
.rel-date { color: var(--text-dim, #6b7180); font-size: .8rem; }
.rel-notes { margin: 6px 0 0; padding-left: 18px; font-size: .9rem; }
.rel-notes li { margin: 2px 0; }

/* Bandeau officiel dans la fiche */
.cd-official { display: flex; align-items: center; gap: 10px; margin: 0 0 14px;
    padding: 11px 16px; border-radius: 12px; font-weight: 700; font-size: .92rem;
    color: var(--brand-primary-contrast, #fff);
    background: linear-gradient(100deg, var(--brand-primary, #5B28F5), var(--brand-accent, #6E3DFF)); }
.cd-official-ic { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
    background: rgba(255,255,255,.25); font-weight: 900; }

/* Carrousel de captures d'écran */
.cd-shots-wrap { position: relative; margin: 4px 0 18px; }
.cd-shots-track { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory;
    padding: 4px 2px 10px; scrollbar-width: thin; }
.cd-shots-track::-webkit-scrollbar { height: 6px; }
.cd-shots-track::-webkit-scrollbar-thumb { background: var(--border, #d9deea); border-radius: 6px; }
.cd-shot { height: 260px; width: auto; max-width: 88%; flex: none; scroll-snap-align: center;
    border-radius: 14px; border: 1px solid var(--border, #e4e7f0); object-fit: cover; cursor: zoom-in;
    box-shadow: 0 8px 24px rgba(15,20,40,.10); background: var(--surface-2, #f1f3f9); }
.cd-shots-nav { position: absolute; top: 50%; transform: translateY(-60%); z-index: 3;
    width: 38px; height: 38px; border-radius: 50%; border: none; cursor: pointer;
    background: rgba(20,16,40,.55); color: #fff; font-size: 22px; line-height: 1;
    display: grid; place-items: center; backdrop-filter: blur(4px); }
.cd-shots-nav.prev { left: 4px; } .cd-shots-nav.next { right: 4px; }
.cd-shots-nav:hover { background: rgba(20,16,40,.8); }
@media (max-width: 700px) { .cd-shot { height: 200px; max-width: 80%; } .cd-shots-nav { display: none; } }

/* Lightbox plein écran */
.cd-lightbox { position: fixed; inset: 0; z-index: 10000; background: rgba(8,6,18,.92);
    display: grid; place-items: center; padding: 24px; cursor: zoom-out; animation: sp-fade .2s ease both; }
.cd-lightbox img { max-width: 96vw; max-height: 92vh; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }

/* Publié par (prénom) */
.cd-publisher { margin: 6px 0 2px; color: var(--text-dim, #6b7180); font-size: .9rem; }

/* Bloc avis + commentaire */
.cd-reviews-block { margin: 16px 0 6px; padding: 16px; border-radius: 14px; background: var(--surface-2, #f5f6fb); }
.cd-rate-label { margin-bottom: 6px; }
.cd-stars { display: flex; gap: 4px; font-size: 26px; line-height: 1; margin-bottom: 10px; }
.cd-star { cursor: pointer; color: var(--border, #cfd5e4); transition: color .12s, transform .1s; }
.cd-star.on { color: #FFB300; }
.cd-star:hover { transform: scale(1.12); }
.cd-comment-input { width: 100%; box-sizing: border-box; border: 1px solid var(--border, #e4e7f0);
    border-radius: 10px; padding: 10px 12px; font-family: inherit; font-size: .92rem; resize: vertical;
    background: var(--surface, #fff); color: var(--text, #1b1f2a); }
.cd-rate-actions { margin-top: 10px; }
.cd-reviews-wrap { margin-top: 16px; }
.cd-reviews { display: flex; flex-direction: column; gap: 10px; }
.cd-review { padding: 12px 14px; border-radius: 12px; background: var(--surface, #fff); border: 1px solid var(--border, #e9ecf4); }
.cd-review-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.cd-review-who { font-weight: 700; }
.cd-review-stars { color: #FFB300; font-size: .85rem; letter-spacing: 1px; }
.cd-review-del { margin-left: auto; border: none; background: transparent; color: var(--text-dim, #9aa0ad);
    cursor: pointer; font-size: 14px; padding: 2px 6px; border-radius: 6px; }
.cd-review-del:hover { background: var(--danger, #E71616); color: #fff; }
.cd-review-body { color: var(--text, #2a2f3c); font-size: .92rem; white-space: pre-wrap; word-break: break-word; }

/* =========================================================================
   Bandeau supérieur — ajustements : « Aide » en gras + plus d'air avant la
   pastille utilisateur, et pastille utilisateur agrandie (plus aérée).
   ========================================================================= */
.topbar .nav-help { font-weight: 700; margin-right: 18px; }
.topbar .user-chip { padding: 7px 15px 7px 7px; font-size: 14px; gap: 10px; }
.topbar .user-chip .user-av { width: 32px; height: 32px; }

/* Diagnostic d'exécution : message clair à la place d'un écran blanc quand le
   bac à sable (runner_url) ne répond pas. */
.runner-diag { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center;
    padding: 24px; background: var(--surface, #fff); }
.runner-diag.hidden { display: none; }
.runner-diag-card { max-width: 520px; text-align: center; background: var(--surface-2, #f5f6fb);
    border: 1px solid var(--border, #e4e7f0); border-radius: 14px; padding: 22px 24px; }
.runner-diag-title { font-weight: 800; font-size: 1.05rem; color: var(--danger, #E71616); margin-bottom: 8px; }
.runner-diag-msg { color: var(--text, #2a2f3c); font-size: .92rem; line-height: 1.5; margin: 0 0 14px; }
.runner-view { position: relative; }

/* Voilà — joindre un fichier (déposé dans les fichiers perso, sans coût IA). */
.voila-attach-chip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 10px; padding: 0; font-size: 12.5px; color: var(--text, #1b1f2a); }
.voila-attach-chip.hidden { display: none; }
.voila-attach-chip .vac-item { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 6px 9px; background: var(--surface-2, #f1f3f9); border: 1px solid var(--border, #e4e7f0); border-radius: 9px; }
.voila-attach-chip .vac-ic { flex: none; }
.voila-attach-chip .vac-name { flex: 0 1 auto; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.voila-attach-chip .vac-x { flex: none; border: none; background: transparent; cursor: pointer; color: var(--text-dim, #6b7180); font-size: 13px; padding: 0 3px; border-radius: 5px; }
.voila-attach-chip .vac-x:hover { color: #fff; background: var(--danger, #E71616); }
/* Agents IA : avatars (banque de personnages) + base de connaissances */
.agent-av { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; overflow: hidden; flex: none; background: var(--surface-2, #eceff7); color: #fff; font-weight: 700; font-family: Montserrat, system-ui, sans-serif; }
.agent-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.agent-av-init { color: #fff; }
.agent-av-lg { width: 64px; height: 64px; font-size: 26px; }
.agent-full-row { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.agent-full-thumb { flex: none; width: 54px; height: 72px; border-radius: 10px; border: 1px solid var(--border, #e4e7f0); background: var(--surface-2, #f1f3f9) center/cover no-repeat; display: inline-flex; align-items: center; justify-content: center; color: var(--text-dim, #b7bcc9); font-size: 18px; overflow: hidden; }
.agent-full-thumb.has-img { border-color: color-mix(in srgb, var(--brand-primary, #5B28F5) 40%, var(--border, #e4e7f0)); }
/* Sélecteur visuel d'avatar : grande préview + tuiles défilables */
.agent-av-picker { display: flex; align-items: center; gap: 14px; margin-top: 4px; }
.agent-av-choices { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px; flex: 1 1 auto; scrollbar-width: thin; }
/* Dans la fenêtre de sélection : grille aérée, tuiles plus grandes, défilement vertical. */
#modal-avatar-pick .agent-av-choices { flex-wrap: wrap; overflow-x: hidden; overflow-y: auto; max-height: 58vh; gap: 12px; padding: 6px 2px; }
#modal-avatar-pick .agent-av-tile { width: 72px; height: 72px; border-radius: 18px; }
.agent-av-tile { position: relative; flex: none; width: 52px; height: 52px; border-radius: 14px; overflow: hidden; border: 2px solid var(--border, #e4e7f0); background: var(--surface-2, #f1f3f9); cursor: pointer; padding: 0; display: inline-flex; align-items: center; justify-content: center; color: var(--text-dim, #8a8f9c); transition: border-color .12s, transform .12s; }
.agent-av-tile:hover { transform: translateY(-1px); }
.agent-av-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.agent-av-tile.sel { border-color: var(--brand-primary, #5B28F5); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand-primary, #5B28F5) 30%, transparent); }
.agent-av-tile.up { border-style: dashed; font-size: 20px; flex-direction: column; gap: 0; }
.agent-av-tile .tile-init { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-family: Montserrat, system-ui, sans-serif; }
/* Interrupteurs (toggles) des capacités et des skills */
.cap-list { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.field .cap-row { display: flex; align-items: center; gap: 12px; margin-bottom: 0; padding: 9px 12px; background: var(--surface-2, #f6f7fb); border: 1px solid var(--border, #e6e8f0); border-radius: 12px; cursor: pointer; }
.field .cap-row:hover { border-color: color-mix(in srgb, var(--brand-primary, #5B28F5) 35%, var(--border, #e6e8f0)); }
.cap-ic { flex: none; font-size: 18px; width: 26px; text-align: center; }
.cap-txt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.cap-txt b { font-size: 13.5px; font-weight: 600; }
.cap-txt small { color: var(--text-dim, #8a8f9c); font-size: 11.5px; }
.switch { flex: none; position: relative; display: inline-block; width: 42px; height: 24px; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch .slider { position: absolute; inset: 0; background: var(--border, #cfd3e0); border-radius: 999px; transition: background .16s; }
.switch .slider::before { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .16s; }
.switch input:checked + .slider { background: var(--brand-primary, #5B28F5); }
.switch input:checked + .slider::before { transform: translateX(18px); }
.switch input:focus-visible + .slider { box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-primary, #5B28F5) 30%, transparent); }
/* Bandeau « accompagnée d'un agent » dans le chat Voilà */
.voila-companions { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 6px; padding: 7px 10px; margin: -4px -4px 8px; background: color-mix(in srgb, var(--brand-primary, #5B28F5) 8%, var(--surface, #fff)); border-bottom: 1px solid var(--border, #eceef5); font-size: 12px; color: var(--text-dim, #6b7180); }
.voila-companions .agent-av { border: 2px solid var(--surface, #fff); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.voila-companions .vc-plus { font-weight: 700; color: var(--brand-primary, #5B28F5); font-size: 14px; }
/* « Vos agents certifiés » : chat plein écran multi-agents */
#view-agentchat:not(.hidden) { display: flex; flex-direction: column; height: 100%; padding: 0; }
/* Cadre au format « fenêtre d'artefact » : collé en bas, coin supérieur gauche arrondi + ombre. */
.ac-shell { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; margin: 6px 0 0 6px; border: none; border-top-left-radius: 16px; overflow: hidden; background: var(--surface, #fff); box-shadow: 0 2px 12px rgba(15, 20, 40, .07); }
/* Barre du haut : titre centré (façon barre de titre d'artefact) + sélecteur d'agents en dessous. */
.ac-topbar { position: relative; flex: none; background: #fff; border-bottom: 1px solid var(--border, #eceef5); padding: 8px 14px 10px; }
.ac-title { display: block; font-family: Montserrat, system-ui, sans-serif; font-weight: 700; font-size: .98rem; color: var(--brand-primary, #5B28F5); text-align: center; margin-bottom: 8px; padding: 0 76px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-help { position: absolute; top: 8px; right: 14px; }
.ac-agentbar { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; }
/* Séparateur officiels / org : fine ligne verticale qui s'estompe aux extrémités,
   centrée en hauteur et légèrement agrandie. */
.ac-bar-sep { width: 2px; height: 38px; flex: 0 0 auto; align-self: center; border: 0; border-radius: 2px;
    background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--brand-primary, #5B28F5) 35%, var(--border, #d7dae6)), transparent); }
.ac-skills { margin-top: 2px; color: color-mix(in srgb, var(--brand-primary, #5B28F5) 72%, var(--text-dim, #6b7280)); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acht-title { background: linear-gradient(100deg, var(--brand-primary, #5B28F5), color-mix(in srgb, var(--brand-accent, #6E3DFF) 60%, #ff6ad5)); -webkit-background-clip: text; background-clip: text; color: transparent; font-size: 20px; }
.acht-body p { margin: 8px 0; }
.ac-bar-group { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.ac-bar-label { font-size: 10.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--text-dim, #8a8f9c); }
.ac-bar-plat .ac-bar-label { color: var(--brand-primary, #5B28F5); }
/* Pastilles d'agents. Par défaut (peu d'agents) : chips dépliés avec le nom.
   En mode « .multi » (plusieurs agents) : avatars RONDS qui se chevauchent légèrement,
   dépliés au survol de la rangée ; l'agent actif reste toujours déplié. */
.ac-bar-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ac-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px 3px 3px;
    border-radius: 999px; background: var(--surface, #fff); box-shadow: 0 0 0 1px var(--border, #e2e4ee);
    cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--text, #27272b);
    position: relative; z-index: 1; transition: gap .18s ease, padding .18s ease, margin-left .18s ease, box-shadow .15s ease, background .15s ease; }
.ac-chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }
/* Mode replié (multi) : cercle parfait (avatar seul), léger chevauchement. */
.ac-bar-chips.multi { gap: 0; }
.ac-bar-chips.multi .ac-chip { gap: 0; padding: 3px; margin-left: -7px; box-shadow: 0 0 0 2px var(--surface, #fff), 0 0 0 3px var(--border, #e2e4ee); }
.ac-bar-chips.multi .ac-chip:first-child { margin-left: 0; }
/* Une pastille dépliée (ex. Voilà sélectionné) laisse 5px avant la pastille repliée suivante. */
.ac-bar-chips.multi .ac-chip.on + .ac-chip { margin-left: 5px; }
.ac-bar-chips.multi .ac-chip .ac-chip-name { max-width: 0; opacity: 0; transition: max-width .2s ease, opacity .15s ease; }
/* Déploiement au survol de la rangée (ou agent actif) — uniquement en mode multi ; 5px entre chaque. */
.ac-bar-chips.multi:hover .ac-chip, .ac-bar-chips.multi .ac-chip.on { gap: 6px; padding: 3px 12px 3px 3px; margin-left: 5px; }
.ac-bar-chips.multi:hover .ac-chip:first-child, .ac-bar-chips.multi .ac-chip.on:first-child { margin-left: 0; }
.ac-bar-chips.multi:hover .ac-chip .ac-chip-name, .ac-bar-chips.multi .ac-chip.on .ac-chip-name { max-width: 160px; opacity: 1; }
.ac-chip:hover { z-index: 5; box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand-primary, #5B28F5) 55%, var(--border, #e2e4ee)); }
.ac-bar-chips.multi .ac-chip:hover { box-shadow: 0 0 0 2px var(--surface, #fff), 0 0 0 3px color-mix(in srgb, var(--brand-primary, #5B28F5) 55%, var(--border, #e2e4ee)); }
.ac-chip.on { z-index: 4; background: color-mix(in srgb, var(--brand-primary, #5B28F5) 10%, var(--surface, #fff)); box-shadow: 0 0 0 2px var(--brand-primary, #5B28F5); }
.ac-bar-chips.multi .ac-chip.on { box-shadow: 0 0 0 2px var(--surface, #fff), 0 0 0 4px var(--brand-primary, #5B28F5); }
.ac-bar-plat .ac-chip { box-shadow: 0 0 0 1px color-mix(in srgb, var(--brand-primary, #5B28F5) 32%, var(--border, #e2e4ee)); }
/* Un agent sélectionné : les pastilles regroupées non sélectionnées s'éclaircissent
   (elles redeviennent nettes au survol de la rangée). */
#ac-agentbar.ac-has-sel .ac-bar-chips.multi .ac-chip { opacity: .6; transition: opacity .15s ease; }
#ac-agentbar.ac-has-sel .ac-bar-chips.multi .ac-chip.on { opacity: 1; }
.ac-bar-chips.multi:hover .ac-chip { opacity: 1 !important; }
@media (prefers-reduced-motion: reduce) { .ac-chip, .ac-chip-name { transition: none; } }
/* Cartes d'agents (pages Plateforme et Organisation) : 3 colonnes horizontales,
   dégradant à 2 puis 1 sur les écrans plus étroits. */
/* Grilles d'agents (org + admin plateforme) : 4 cartes par ligne sur toute la largeur,
   dégradé responsive 4→3→2→1. Homogène entre la section « Vos agents », la section
   officielle Constellae et la page d'admin plateforme. */
/* #agents-list (conteneur des sections org) et #pa-agents-list (grille) portent la classe
   .faq-list (plafond 920 px) : on neutralise ce plafond pour qu'ils occupent toute la largeur. */
#agents-list { max-width: none; }
#pa-agents-list, .ag-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; max-width: none; }
@media (max-width: 1280px) { #pa-agents-list, .ag-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 980px)  { #pa-agents-list, .ag-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px)  { #pa-agents-list, .ag-grid { grid-template-columns: 1fr; } }
/* .ag-grid-plat porte déjà la classe .ag-grid : elle hérite du même dégradé 4→3→2→1. */
.agent-card { display: flex; flex-direction: column; height: 100%; }
/* Boutons d'action : sur une seule ligne quand ils tiennent, sinon on passe à la ligne
   proprement (jamais de libellé tronqué — ex. agents avec bouton « API » = 5 boutons). */
.agent-card .faq-actions { margin-top: auto; flex-wrap: wrap; gap: 6px; padding-top: 8px; }
.agent-card .faq-actions > button { flex: 1 1 auto; min-width: max-content; white-space: nowrap; padding-left: 8px; padding-right: 8px; }
.agent-card .agent-card-head { align-items: flex-start; }
/* Page « Agents IA » de l'org : sections distinctes org / plateforme. */
.ag-section { margin-bottom: 18px; }
.ag-section-h { font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--text-dim, #8a8f9c); margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.ag-section-plat { padding: 14px; border-radius: 14px; background: color-mix(in srgb, var(--brand-primary, #5B28F5) 5%, var(--surface, #fff)); border: 1px solid color-mix(in srgb, var(--brand-primary, #5B28F5) 15%, var(--border, #eceef5)); }
.ag-section-plat .ag-section-h { color: var(--brand-primary, #5B28F5); }
.ag-section-empty { color: var(--text-dim, #8a8f9c); font-size: .9rem; }
/* Pastilles « agent qui utilise la skill » dans la liste des skills. */
.skill-agents { display: inline-flex; flex-wrap: wrap; gap: 4px; margin: 0 8px; flex: 1 1 auto; justify-content: flex-end; }
.skill-agent-badge { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap;
    background: color-mix(in srgb, var(--brand-primary, #5B28F5) 12%, var(--surface, #fff));
    border: 1px solid color-mix(in srgb, var(--brand-primary, #5B28F5) 24%, var(--border, #e2e4ee)); color: var(--brand-primary, #5B28F5); }
.skill-agent-badge.none { background: var(--surface-2, #f4f5fa); border-color: var(--border, #e2e4ee); color: var(--text-dim, #8a8f9c); }
.skill-agent-badge.more { background: var(--surface-2, #f4f5fa); border-color: var(--border, #e2e4ee); color: var(--text-dim, #8a8f9c); }
/* Annuaire des agents dans la page d'aide du chat. */
.acht-dir { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border, #eceef5); }
.acht-dir-h { margin: 0 0 4px; font-size: 1rem; }
.acht-dir-sel { width: 100%; max-width: 360px; margin: 6px 0 10px; }
.acht-dir-detail { display: flex; flex-direction: column; gap: 10px; }
.acht-d-desc { margin: 0; font-style: italic; color: var(--text-dim, #5A5A66); }
.acht-d-sec { }
.acht-d-h { font-weight: 700; font-size: .82rem; text-transform: uppercase; letter-spacing: .03em; color: var(--text-dim, #8a8f9c); margin-bottom: 5px; }
.acht-tag { display: inline-block; margin: 0 5px 5px 0; padding: 3px 9px; border-radius: 999px; background: color-mix(in srgb, var(--brand-primary, #5B28F5) 10%, var(--surface, #fff)); border: 1px solid color-mix(in srgb, var(--brand-primary, #5B28F5) 22%, var(--border, #e2e4ee)); font-size: 12.5px; }
.acht-tag.off { background: var(--surface-2, #f4f5fa); border-color: var(--border, #e2e4ee); color: var(--text-dim, #8a8f9c); }
.acht-tag.slug { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.acht-web { font-size: 12.5px; margin-bottom: 4px; }
.acht-web code { background: var(--surface-2, #f4f5fa); padding: 1px 6px; border-radius: 6px; }
.ac-body { flex: 1 1 auto; min-height: 0; display: flex; }
/* Colonne de gauche : historique par agent + filigrane d'avatar en fond */
.ac-side { position: relative; flex: none; width: 236px; border-right: 1px solid var(--border, #eceef5); display: flex; flex-direction: column; background: var(--surface, #fcfdff); overflow: hidden; }
/* Image de l'avatar ENTIÈRE (telle qu'avant recadrage) en fond de la colonne historique,
   calée en bas. background-size: contain → image complète, jamais rognée ni zoomée. Bien
   visible ; fondu vers le haut pour préserver la lisibilité de la liste des conversations. */
.ac-side.has-bg::before { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 100%; background-image: var(--ac-rail-bg); background-size: contain; background-position: center bottom; background-repeat: no-repeat; opacity: .15; -webkit-mask-image: linear-gradient(transparent 0%, #000 30%); mask-image: linear-gradient(transparent 0%, #000 30%); pointer-events: none; z-index: 0; }
.ac-side > * { position: relative; z-index: 1; }
.ac-side-h { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 12px 12px 6px; font-size: 12px; font-weight: 600; color: var(--text-dim, #6b7180); }
.ac-history-list { flex: 1 1 auto; overflow-y: auto; padding: 4px 6px 10px; display: flex; flex-direction: column; gap: 2px; }
.ac-hist-row { display: flex; align-items: stretch; border-radius: 9px; }
.ac-hist-row:hover { background: color-mix(in srgb, var(--surface-2, #f1f3f9) 70%, transparent); }
.ac-hist-row.on { background: color-mix(in srgb, var(--brand-primary, #5B28F5) 12%, transparent); }
.ac-hist { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; text-align: left; border: none; background: transparent; cursor: pointer; padding: 8px 10px; border-radius: 9px; color: var(--text, #27272b); }
.ac-hist-t { font-size: 12.5px; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-hist-d { font-size: 10.5px; }
.ac-hist-del { flex: none; border: none; background: transparent; cursor: pointer; color: var(--text-dim, #b7bcc9); font-size: 12px; width: 30px; border-radius: 9px; opacity: 0; }
.ac-hist-row:hover .ac-hist-del { opacity: 1; }
.ac-hist-del:hover { color: var(--danger, #E71616); background: color-mix(in srgb, var(--danger, #E71616) 10%, transparent); }
.ac-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.ac-attach-chip { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 12px 0; }
.ac-attach-chip.hidden { display: none; }
.ac-att { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; background: var(--surface-2, #f1f3f9); border: 1px solid var(--border, #e4e7f0); border-radius: 8px; padding: 2px 4px 2px 8px; }
.ac-att button { border: none; background: transparent; cursor: pointer; color: var(--text-dim, #8a8f9c); font-size: 11px; }
/* Trombone : mêmes coins arrondis et même surbrillance douce (bleutée) que le bouton Envoyer. */
.ac-attach { flex: none; width: 54px; height: 54px; border: none; border-radius: 12px; background: transparent; color: var(--text-dim, #7a7f8c); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.ac-attach:hover { color: var(--brand-primary, #5B28F5); background: color-mix(in srgb, var(--brand-primary, #5B28F5) 12%, transparent); }
.ac-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border, #eceef5); }
.ac-head-txt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.ac-head-txt b { font-size: 15px; }
.ac-msgs { flex: 1 1 auto; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.ac-intro { text-align: center; margin: auto; font-size: 13px; }
.ac-form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border, #eceef5); }
.ac-form textarea { flex: 1 1 auto; resize: none; border: 1px solid var(--border, #dfe2ec); border-radius: 12px; padding: 10px 12px; font: inherit; font-size: 14px; max-height: 140px; background: var(--surface, #fff); color: var(--text, #27272b); }
.ac-send { flex: none; width: 54px; height: 54px; border: none; border-radius: 12px; background: transparent; color: var(--brand-primary, #5B28F5); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.ac-send:hover { background: color-mix(in srgb, var(--brand-primary, #5B28F5) 12%, transparent); }
.ac-send:disabled { color: var(--text-dim, #b7bcc9); cursor: default; }
/* Boutons de l'en-tête du chat (☰ agents/conversations, ＋ nouvelle) : mobile uniquement. */
.ac-head-btn { display: none; flex: none; width: 38px; height: 38px; align-items: center; justify-content: center;
    border: 1px solid var(--border, #e6e6ee); background: var(--surface, #fff); border-radius: 10px;
    font-size: 20px; line-height: 1; color: var(--text, #333); cursor: pointer; }
.ac-head-btn:hover { background: var(--bg-soft, #f4f4f8); }
/* Feuille du bas « Agents & conversations » (mobile). */
.ac-sheet-scrim { position: fixed; inset: 0; background: rgba(15, 20, 40, .42); z-index: 400; }
.ac-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 410; max-height: 82dvh; display: flex; flex-direction: column;
    background: var(--surface, #fff); border-radius: 20px 20px 0 0; box-shadow: 0 -18px 50px -12px rgba(15, 20, 40, .4);
    padding: 8px 14px calc(14px + env(safe-area-inset-bottom, 0px)); }
.ac-sheet-grip { width: 40px; height: 4px; border-radius: 999px; background: var(--border, #d7d7e0); margin: 4px auto 8px; }
.ac-sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.ac-sheet-head b { font-size: 16px; }
.ac-sheet-x { border: 0; background: transparent; font-size: 18px; cursor: pointer; color: var(--muted, #889); padding: 4px 8px; }
.ac-sheet-new { width: 100%; padding: 12px; border: 0; border-radius: 12px; font-size: 15px; font-weight: 600; cursor: pointer;
    background: linear-gradient(120deg, var(--brand-primary, #5B28F5), var(--brand-accent, #a855f7)); color: var(--brand-primary-contrast, #fff); margin-bottom: 4px; }
.ac-sheet-scroll { flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.ac-sheet-sec { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-dim, #889); padding: 12px 4px 6px; }
.ac-sheet-agents { display: flex; flex-direction: column; gap: 4px; }
.ac-sheet-agent { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 8px 10px;
    border: 1px solid transparent; border-radius: 12px; background: transparent; cursor: pointer; }
.ac-sheet-agent:hover { background: var(--bg-soft, #f4f4f8); }
.ac-sheet-agent.on { border-color: var(--brand-primary, #5B28F5); background: color-mix(in srgb, var(--brand-primary, #5B28F5) 8%, transparent); }
.ac-sheet-agent-tx { display: flex; flex-direction: column; min-width: 0; }
.ac-sheet-agent-tx b { font-size: 15px; }
.ac-sheet-agent-tx .muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-sheet-hist { display: flex; flex-direction: column; gap: 2px; padding-bottom: 8px; }
@media (max-width: 640px) { .ac-rail { width: 96px; } .ac-agent-meta { display: none; } .ac-agent { justify-content: center; } .ac-shell { height: calc(100vh - 70px); margin: 0; border-top-left-radius: 0; box-shadow: none; } }
.voila-companions .vc-name { font-weight: 600; color: var(--text, #27272b); }
.agent-card-head { display: flex; gap: 12px; align-items: flex-start; }
.agent-card-meta { min-width: 0; flex: 1 1 auto; }
.agent-card-name { font-weight: 600; }
.agent-card-badges { margin-top: 3px; }
.badge-plat { background: color-mix(in srgb, var(--brand-primary, #5B28F5) 14%, transparent); color: var(--brand-primary, #5B28F5); border: 1px solid color-mix(in srgb, var(--brand-primary, #5B28F5) 30%, transparent); }
.badge-off { background: var(--surface-2, #f1f3f9); color: var(--text-dim, #8a8f9c); border: 1px solid var(--border, #e4e7f0); }
.agent-card.agent-off { opacity: .62; }
/* Widget d'accueil « Vos agents certifiés » (lanceur) */
.agw { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.agw-h { font-weight: 600; font-size: 13px; margin-bottom: 8px; color: var(--text, #27272b); }
.agw-grid { flex: 1 1 auto; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; align-content: start; }
.agw-tile { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 8px 4px; border: 1px solid var(--border, #e6e8f0); border-radius: 12px; background: var(--surface, #fff); cursor: pointer; }
.agw-tile:hover { border-color: color-mix(in srgb, var(--brand-primary, #5B28F5) 40%, var(--border, #e6e8f0)); transform: translateY(-1px); }
.agw-name { font-size: 11.5px; font-weight: 600; color: var(--text, #27272b); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Section AppStore « Vos agents certifiés » */
.store-agents-card { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 18px 20px; border: none; border-radius: 16px; box-shadow: 0 8px 26px -10px color-mix(in srgb, var(--brand-primary, #5B28F5) 55%, transparent); }
.store-agents-avs { display: flex; }
.store-agents-avs .agent-av { margin-left: -8px; border: 2px solid rgba(255,255,255,.9); box-shadow: 0 1px 4px rgba(0,0,0,.22); }
.store-agents-avs .agent-av:first-child { margin-left: 0; }
.store-agents-txt { flex: 1 1 auto; min-width: 140px; display: flex; flex-direction: column; color: #fff; }
.store-agents-txt b { font-size: 15px; color: #fff; }
/* Sur la carte « IA » (dégradé vif), le texte atténué passe en blanc translucide. */
.store-agents-card.ai-shimmer .store-agents-txt .muted { color: rgba(255,255,255,.85); }
/* Boutons lisibles sur le dégradé : blanc plein, texte coloré. */
.store-agents-card.ai-shimmer .store-agents-install { background: #fff; color: var(--brand-primary, #5B28F5); box-shadow: 0 3px 10px -3px rgba(0,0,0,.3); }
.store-agents-card.ai-shimmer .ghost { color: #fff; border-color: rgba(255,255,255,.6); }
.store-agents-card.ai-shimmer .ghost:hover { background: rgba(255,255,255,.15); }
.store-agents-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.store-agents-install { border: none; cursor: pointer; padding: 10px 16px; border-radius: 11px; font-size: 13px; font-weight: 700; font-family: inherit; color: #fff; background: linear-gradient(135deg, var(--brand-primary, #5B28F5), var(--brand-accent, #6E3DFF)); box-shadow: 0 4px 14px -5px color-mix(in srgb, var(--brand-primary, #5B28F5) 60%, transparent); transition: filter .12s ease, transform .12s ease; }
.store-agents-install:hover { filter: brightness(1.06); transform: translateY(-1px); }
.store-agents-install:disabled { opacity: .5; cursor: not-allowed; filter: none; transform: none; box-shadow: none; }
.kb-list { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.kb-row { display: flex; align-items: center; gap: 8px; padding: 7px 10px; background: var(--surface-2, #f1f3f9); border: 1px solid var(--border, #e4e7f0); border-radius: 9px; }
.kb-row .kb-ic { flex: none; }
.kb-row .kb-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 13px; }
.kb-row .kb-size { flex: none; }
/* Panneau « Sources » unifié (fichiers + connecteurs + web) */
.src-filters { display: flex; gap: 12px; flex-wrap: wrap; margin: 4px 0 12px; }
.src-filter { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted, #6b7280); }
.src-filter select { padding: 4px 8px; border-radius: 8px; border: 1px solid var(--border, #e4e7f0); background: var(--surface, #fff); }
.src-list { display: flex; flex-direction: column; gap: 14px; max-height: 62vh; overflow-y: auto; overflow-x: hidden; }
.src-group { display: flex; flex-direction: column; gap: 7px; }
.src-group-h { display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 700; color: var(--text, #1b1f2a); padding-bottom: 2px; border-bottom: 1px solid var(--border, #e4e7f0); }
.src-group-h .src-group-hr { display: flex; align-items: center; gap: 8px; }
.src-group-h .src-group-n { font-size: 11px; font-weight: 700; color: var(--muted, #6b7280); background: var(--surface-2, #f1f3f9); border-radius: 999px; padding: 1px 8px; }
.src-group-hint { margin: 2px 0 0; }
.src-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: var(--surface-2, #f6f7fb); border: 1px solid var(--border, #e4e7f0); border-radius: 11px; }
.src-row .src-main { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; overflow: hidden; }
.src-row .src-ic { flex: none; }
.src-row .src-name { flex: 1 1 auto; font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.src-row .src-badge { flex: none; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted, #6b7280); background: var(--surface, #fff); border: 1px solid var(--border, #e4e7f0); border-radius: 6px; padding: 1px 6px; }
.src-row .src-status { flex: none; font-size: 11px; font-weight: 600; border-radius: 6px; padding: 1px 7px; }
.src-row .src-status.ok { color: #0a7d3a; background: color-mix(in srgb, #10b981 16%, transparent); }
.src-row .src-status.off { color: #9a3412; background: color-mix(in srgb, #f97316 16%, transparent); }
.src-row .src-status.write { color: #92400e; background: color-mix(in srgb, #f59e0b 18%, transparent); }
.src-row .src-conf { flex: none; width: 132px; padding: 5px 8px; border-radius: 8px; border: 1px solid var(--border, #e4e7f0); background: var(--surface, #fff); font-size: 12px; }
.src-row .src-conf:disabled { opacity: .55; }
.src-row .switch { flex: none; }
.avbank-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin-top: 8px; }
/* Banque de personnages : sections (Avatars Voilà / Personnages). */
.avbank-host { display: flex; flex-direction: column; gap: 18px; margin-top: 8px; }
.avbank-sec-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.avbank-sec-h b { font-size: .95rem; }
.avbank-sec-n { font-size: 11px; font-weight: 700; background: var(--surface-2, #eef0f6); color: var(--text-dim, #6b7180); border-radius: 999px; padding: 1px 8px; }
.avbank-sec-hint { flex: 1 1 100%; margin-top: 2px; }
.avbank-sec-voila { padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--brand-primary, #5B28F5) 6%, var(--surface, #fff)); border: 1px solid color-mix(in srgb, var(--brand-primary, #5B28F5) 20%, var(--border, #eceef5)); }
.avbank-sec-voila .avbank-sec-h b { color: var(--brand-primary, #5B28F5); }
.avbank-bulk { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.avbank-check { position: absolute; top: 5px; left: 5px; width: 18px; height: 18px; cursor: pointer; z-index: 3; accent-color: var(--brand-primary, #5B28F5); }
.avbank-cell { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px; background: var(--surface-2, #f1f3f9); border: 1px solid var(--border, #e4e7f0); border-radius: 10px; }
.avbank-cell img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; background: #fff; }
.avbank-name { font-size: 11.5px; text-align: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avbank-badge { position: absolute; top: 4px; right: 4px; font-size: 9px; background: var(--surface, #fff); border: 1px solid var(--border, #e4e7f0); border-radius: 6px; padding: 1px 5px; color: var(--text-dim, #8a8f9c); }
.avbank-more { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border: 1px solid var(--border, #e4e7f0); border-radius: 50%; background: var(--surface, #fff); color: var(--text, #2a2f3a); cursor: pointer; font-size: 15px; line-height: 1; display: flex; align-items: center; justify-content: center; }
.avbank-more:hover { background: var(--surface-2, #f1f3f9); }
.avbank-menu { position: absolute; top: 30px; right: 4px; z-index: 20; background: var(--surface, #fff); border: 1px solid var(--border, #e4e7f0); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.14); padding: 4px; display: flex; flex-direction: column; min-width: 132px; }
.avbank-menu.hidden { display: none; }
.avbank-menu button { text-align: left; border: none; background: none; padding: 7px 10px; border-radius: 6px; cursor: pointer; font-size: 13px; color: var(--text, #2a2f3a); }
.avbank-menu button:hover { background: var(--surface-2, #f1f3f9); }
.avbank-menu button.danger { color: var(--danger, #E71616); }
.avbank-rename { width: 100%; font-size: 11.5px; text-align: center; padding: 2px 4px; border: 1px solid var(--brand-primary, #5B28F5); border-radius: 6px; }
.avbank-resv { position: absolute; bottom: 30px; left: 4px; font-size: 9px; background: color-mix(in srgb, var(--brand-primary, #5B28F5) 12%, var(--surface, #fff)); border: 1px solid color-mix(in srgb, var(--brand-primary, #5B28F5) 30%, transparent); color: var(--brand-primary, #5B28F5); border-radius: 6px; padding: 1px 5px; }
.agent-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 14px; margin-top: 4px; }
.agent-tools .check { font-size: 13px; }
@media (max-width: 520px) { .agent-tools { grid-template-columns: 1fr; } }
/* Tiroir d'historique des conversations Voilà */
.voila-history { position: absolute; left: 0; right: 0; top: 52px; bottom: 0; z-index: 6; background: var(--surface, #fff); display: flex; flex-direction: column; }
.voila-history.hidden { display: none; }
.voila-history-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border, #eceef5); flex-wrap: wrap; }
.voila-history-tabs { display: inline-flex; gap: 4px; }
.vh-tab { border: 1px solid var(--border, #e2e2e9); background: var(--surface, #fff); color: var(--text-dim, #6b7180); border-radius: 8px; padding: 5px 10px; font-size: 12.5px; cursor: pointer; }
.vh-tab.on { background: var(--brand-primary, #5B28F5); border-color: var(--brand-primary, #5B28F5); color: #fff; }
.vh-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-dim, #6b7180); cursor: pointer; }
.voila-history-list { flex: 1 1 auto; overflow-y: auto; padding: 6px; }
.vh-row { display: flex; align-items: stretch; gap: 4px; padding: 2px; }
.vh-open { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; border: none; background: transparent; cursor: pointer; padding: 8px 10px; border-radius: 8px; color: var(--text, #27272b); }
.vh-open:hover { background: var(--surface-2, #f1f3f9); }
.vh-title { font-weight: 600; font-size: 13px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vh-date { font-size: 11px; color: var(--text-dim, #8a8f9c); }
.vh-act { flex: none; border: none; background: transparent; cursor: pointer; color: var(--text-dim, #8a8f9c); font-size: 14px; width: 32px; border-radius: 8px; }
.vh-act:hover { background: var(--surface-2, #f1f3f9); color: var(--text, #27272b); }
/* Voile de dépôt de fichiers (glisser-déposer) */
.voila-drop { position: absolute; inset: 0; z-index: 5; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--brand-primary, #5B28F5) 12%, transparent); border: 2px dashed var(--brand-primary, #5B28F5); border-radius: 14px; pointer-events: none; }
.voila-drop.hidden { display: none; }
.voila-drop > span { padding: 10px 16px; background: var(--surface, #fff); border: 1px solid var(--border, #e2e2e9); border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--brand-primary, #5B28F5); box-shadow: var(--shadow-l, 0 12px 40px rgba(0,0,0,.18)); }

/* Centre de notifications (cloche + panneau) */
.notif-wrap { position: relative; display: inline-flex; align-items: center; }
.notif-bell {
    position: relative; background: none; border: 0; padding: 6px; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; line-height: 0;
    color: var(--brand-muted, #6b6b76); border-radius: 8px;
}
.notif-bell:hover { color: var(--brand-text, #1c1c1f); background: rgba(120,120,130,.12); }
.notif-bell svg { display: block; }
#notif-btn .count { position: absolute; top: -2px; right: -2px; }
/* Ancré sous la cloche : bord DROIT du panneau aligné sur la cloche, ouvre vers la gauche. */
.notif-panel {
    position: absolute; right: 0; left: auto; top: calc(100% + 6px);
    width: min(380px, 94vw); max-height: 72vh; overflow-y: auto;
    background: var(--brand-surface, #fff); color: var(--brand-text, #1c1c1f);
    border: 1px solid var(--brand-border, #e2e2e9); border-radius: var(--brand-radius, 8px);
    box-shadow: 0 10px 40px rgba(0,0,0,.18); z-index: 1000; padding: 6px;
}
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px 6px; }
.notif-item {
    border: 1px solid var(--brand-border, #e2e2e9); border-radius: 8px;
    padding: 10px; margin: 6px 4px; background: var(--brand-bg, #fafafd);
}
.notif-item.pinned { border-color: var(--brand-primary, #4f46e5); }
.notif-item.is-warn { border-left: 4px solid var(--brand-warn, #e0a800); }
.notif-item .notif-title { font-weight: 600; font-size: .92rem; }
.notif-item .notif-body { color: var(--brand-muted, #6b6b76); font-size: .84rem; margin: 4px 0 8px; }
.notif-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.notif-actions .ghost { padding: 3px 8px; font-size: .8rem; }

/* ===== Constellation — orchestrateur no-code (builder glisser-déposer) ===== */
/* Constructeur de flux en PLEIN ÉCRAN (comme le studio du Nova Studio). */
#view-constellation.cst-full { display: flex; flex-direction: column; height: 100%; min-height: 0; padding: 0; }
#view-constellation.cst-full #cst-builder { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
#view-constellation.cst-full .cst-toolbar { padding: 12px 16px; margin: 0; flex: 0 0 auto; }
#view-constellation.cst-full .cst-workspace { flex: 1 1 auto; height: auto; min-height: 0; border-radius: 0; border-left: 0; border-right: 0; }
.cst-workspace { display: flex; gap: 0; height: calc(100dvh - 240px); min-height: 440px; border: 1px solid var(--brand-border, #dfe3ec); border-radius: 12px; overflow: hidden; background: var(--brand-card, #fff); }
.cst-palette { width: 190px; flex: 0 0 190px; border-right: 1px solid var(--brand-border, #dfe3ec); padding: 12px; overflow: auto; background: var(--brand-bg-soft, #f7f8fb); }
.cst-palette h4 { margin: 4px 0 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--brand-muted, #6b7280); }
.cst-pal-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; margin-bottom: 6px; border: 1px solid var(--brand-border, #dfe3ec); border-radius: 9px; background: #fff; cursor: pointer; font-size: 13px; user-select: none; }
.cst-pal-item:hover { border-color: var(--brand-primary, #6366f1); box-shadow: 0 1px 6px rgba(99, 102, 241, .12); }
.cst-pal-ic { width: 22px; text-align: center; font-size: 15px; }
.cst-canvas-wrap { position: relative; flex: 1; overflow: auto; background-color: var(--brand-bg-soft, #f7f8fb); background-image: radial-gradient(circle, rgba(120, 130, 160, .16) 1px, transparent 1px); background-size: 22px 22px; }
.cst-canvas { position: relative; width: 4000px; height: 2600px; }
.cst-links { position: absolute; top: 0; left: 0; width: 4000px; height: 2600px; pointer-events: none; overflow: visible; }
.cst-links path.cst-link { stroke: #8b93a7; stroke-width: 2.5; fill: none; pointer-events: stroke; cursor: pointer; }
.cst-links path.cst-link:hover { stroke: #ef4444; }
.cst-links path.cst-link.done { stroke: #22c55e; }
.cst-links path.cst-tmp { stroke: var(--brand-primary, #6366f1); stroke-width: 2.5; stroke-dasharray: 5 4; fill: none; }
.cst-node { position: absolute; width: 190px; background: #fff; border: 1px solid var(--brand-border, #dfe3ec); border-radius: 11px; box-shadow: 0 2px 10px rgba(20, 24, 40, .08); }
.cst-node.sel { border-color: var(--brand-primary, #6366f1); box-shadow: 0 0 0 3px rgba(99, 102, 241, .2); }
.cst-node.run-running { border-color: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, .25); }
.cst-node.run-done { border-color: #22c55e; }
.cst-node.run-error { border-color: #ef4444; }
.cst-node.run-waiting { border-color: #3b82f6; }
.cst-node-head { display: flex; align-items: center; gap: 7px; padding: 9px 10px; cursor: grab; border-bottom: 1px solid var(--brand-border, #eef0f5); font-weight: 600; font-size: 13px; touch-action: none; }
.cst-node-head:active { cursor: grabbing; }
.cst-node-ic { font-size: 15px; }
.cst-node-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cst-node-sub { padding: 6px 10px 10px; font-size: 11.5px; color: var(--brand-muted, #6b7280); word-break: break-word; min-height: 14px; }
.cst-node-del { margin-left: auto; border: none; background: none; color: #b6bcca; cursor: pointer; font-size: 15px; line-height: 1; padding: 0 2px; }
.cst-node-del:hover { color: #ef4444; }
.cst-port { position: absolute; top: 24px; width: 15px; height: 15px; border-radius: 50%; background: #fff; border: 2px solid #8b93a7; cursor: crosshair; touch-action: none; z-index: 2; }
.cst-port:hover { border-color: var(--brand-primary, #6366f1); background: #eef0ff; }
.cst-port.in { left: -8px; }
.cst-port.out { right: -8px; }
.cst-inspector { width: 300px; flex: 0 0 300px; border-left: 1px solid var(--brand-border, #dfe3ec); padding: 14px; overflow: auto; background: var(--brand-bg-soft, #f7f8fb); }
.cst-inspector h4 { margin: 0 0 4px; }
.cst-inspector label { display: block; font-size: 12px; font-weight: 600; margin: 12px 0 4px; }
.cst-inspector input, .cst-inspector select, .cst-inspector textarea { width: 100%; box-sizing: border-box; padding: 6px 8px; border: 1px solid var(--brand-border, #dfe3ec); border-radius: 7px; font: inherit; }
.cst-inspector textarea { min-height: 84px; resize: vertical; }
.cst-name-input { flex: 1; max-width: 340px; padding: 6px 10px; border: 1px solid var(--brand-border, #dfe3ec); border-radius: 8px; font: inherit; }
.cst-toolbar { display: flex; align-items: center; gap: 10px; }
.cst-scope { font-size: 12px; display: inline-flex; align-items: center; gap: 5px; }
.cst-scope input { width: auto; }
.cst-runbar { margin-top: 12px; padding: 12px 14px; border: 1px solid var(--brand-border, #dfe3ec); border-radius: 10px; background: var(--brand-card, #fff); }
.cst-run-steps { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.cst-run-ctrl { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.cst-run-chip { font-size: 12px; padding: 3px 9px; border-radius: 20px; border: 1px solid var(--brand-border, #dfe3ec); background: #fff; }
.cst-run-chip.done { background: #dcfce7; border-color: #86efac; }
.cst-run-chip.error { background: #fee2e2; border-color: #fca5a5; }
.cst-run-chip.running { background: #fef3c7; border-color: #fcd34d; }
.cst-run-chip.waiting { background: #dbeafe; border-color: #93c5fd; }
.cst-run-chip.skipped { background: #f3f4f6; color: #9ca3af; }
.cst-hint { color: var(--brand-muted, #6b7280); font-size: 12px; line-height: 1.5; margin: 4px 0 0; }
.cst-inspector label { font-size: 12.5px; margin: 14px 0 5px; color: var(--brand-text, #2a2f3a); }
.cst-inspector input, .cst-inspector select, .cst-inspector textarea { padding: 7px 9px; }
.cst-inspector .cst-recv { margin: 10px 0 4px; }
/* Rangées de petits boutons dans l'inspecteur : bien alignées et espacées. */
.cst-inspector .ghost.small, .cst-inspector button.small { border-radius: 8px; }
.cst-appr-opt:hover { background: var(--brand-surface, #f1f2f7); }

/* Constellation — nœud « condition » (deux sorties Vrai/Faux) */
.cst-node-cond { padding-bottom: 4px; }
.cst-cond-row { display: flex; justify-content: flex-end; font-size: 11px; padding: 2px 14px 2px 10px; font-weight: 600; }
.cst-cond-row.t { color: #16a34a; }
.cst-cond-row.f { color: #dc2626; }
.cst-port.p-true { top: auto; bottom: 30px; border-color: #22c55e; }
.cst-port.p-false { top: auto; bottom: 6px; border-color: #ef4444; }
.cst-cond-row.sw { color: var(--brand-text-dim, #5a5a6a); height: 22px; box-sizing: border-box; align-items: center; }
.cst-port.p-sw { border-color: var(--brand-primary, #6366f1); }
.cst-port.p-sw:hover { background: #eef0ff; }
.cst-port.p-true:hover { background: #dcfce7; }
.cst-port.p-false:hover { background: #fee2e2; }

/* Constellation — boutons « Insérer une donnée » + confort de reliage */
.cst-chips { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin: 6px 0 2px; }
.cst-chips-lbl { font-size: 11px; color: var(--brand-muted, #6b7280); margin-right: 2px; }
.cst-chip { font-size: 11.5px; padding: 3px 8px; border: 1px solid var(--brand-border, #dfe3ec); border-radius: 20px; background: #fff; cursor: pointer; width: auto; }
.cst-chip:hover { border-color: var(--brand-primary, #6366f1); background: #eef0ff; }
/* Ports plus lisibles (entrée/sortie) + zone de clic élargie */
.cst-port { width: 16px; height: 16px; }
.cst-port::after { content: ''; position: absolute; inset: -7px; border-radius: 50%; }
.cst-port.in { box-shadow: 0 0 0 2px rgba(139, 147, 167, .12); }
.cst-port.out.p-single { background: #eef0ff; border-color: var(--brand-primary, #6366f1); }
/* Nœud en cours de déplacement : rendu compositeur, sans transition (fluide) */
.cst-node { transition: box-shadow .12s ease; will-change: left, top; }
.cst-node.dragging { transition: none; box-shadow: 0 6px 18px rgba(20, 24, 40, .18); z-index: 5; }

/* Constellation — lisibilité des boutons « Insérer », bandeau, glisser depuis la palette */
.cst-inspector .cst-chip {
    color: #1f2937 !important; background: #fff !important; border: 1px solid var(--brand-border, #dfe3ec) !important;
    font-size: 11.5px; line-height: 1.2; padding: 4px 9px; border-radius: 20px; cursor: pointer;
    width: auto !important; display: inline-block; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.cst-inspector .cst-chip:hover { border-color: var(--brand-primary, #6366f1) !important; background: #eef0ff !important; color: #3730a3 !important; }
.cst-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0 2px; }
.cst-chips-lbl { font-size: 11px; color: var(--brand-muted, #6b7280); width: 100%; margin-bottom: 2px; }
.cst-recv { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; border-radius: 8px; padding: 7px 10px; font-size: 12px; margin: 8px 0; }
.cst-drag-ghost {
    position: fixed; z-index: 9999; pointer-events: none; background: var(--brand-primary, #6366f1); color: #fff;
    font-size: 12.5px; font-weight: 600; padding: 6px 12px; border-radius: 8px; box-shadow: 0 6px 18px rgba(20,24,40,.28);
    white-space: nowrap;
}
.cst-pal-item { touch-action: none; }

/* Boutons latéraux « doux » (Workflow, AppStore) : base gris clair + très léger dégradé thème */
.sb-soft {
    display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
    border: 1px solid var(--brand-border, #e2e5ee); cursor: pointer; padding: 11px 12px;
    border-radius: 10px; font-size: 14px; font-weight: 600; font-family: inherit;
    color: var(--text, #1b1f2a); margin-top: 8px;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--brand-primary, #6366f1) 6%, #f4f5f9), color-mix(in srgb, var(--brand-primary, #6366f1) 2%, #f7f8fb));
}
.sb-soft:hover {
    border-color: color-mix(in srgb, var(--brand-primary, #6366f1) 35%, #d7dae6);
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--brand-primary, #6366f1) 12%, #eef0f6), color-mix(in srgb, var(--brand-primary, #6366f1) 5%, #f2f4f9));
}
.sb-soft.active { border-color: color-mix(in srgb, var(--brand-primary, #6366f1) 45%, #cfd3e2); }
.sb-soft .sb-ic { opacity: .85; }
@media (prefers-color-scheme: dark) {
    .sb-soft { color: #e8eaf2; border-color: #2c3040;
        background: linear-gradient(135deg, color-mix(in srgb, var(--brand-primary, #6366f1) 16%, #1c2030), color-mix(in srgb, var(--brand-primary, #6366f1) 8%, #191c28)); }
    .sb-soft:hover { background: linear-gradient(135deg, color-mix(in srgb, var(--brand-primary, #6366f1) 24%, #222738), color-mix(in srgb, var(--brand-primary, #6366f1) 12%, #1d2130)); }
}

/* Constellation — interrupteur (toggle) : jolis switchs partout dans le module */
.cst-toggle { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 500; margin-top: 10px; cursor: pointer; line-height: 1.4; }
.cst-inspector .cst-toggle { margin-top: 12px; }
.cst-toggle input[type="checkbox"] {
    appearance: none; -webkit-appearance: none; -moz-appearance: none;
    position: relative; flex: 0 0 auto; width: 38px; height: 22px; margin: 0; padding: 0;
    border-radius: 999px; background: var(--brand-border, #cfd4e0); border: none;
    cursor: pointer; transition: background .18s ease; vertical-align: middle;
}
.cst-toggle input[type="checkbox"]::after {
    content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
    border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(20,20,50,.28);
    transition: transform .18s ease;
}
.cst-toggle input[type="checkbox"]:checked { background: var(--brand-primary, #6366f1); }
.cst-toggle input[type="checkbox"]:checked::after { transform: translateX(16px); }
.cst-toggle input[type="checkbox"]:focus-visible { outline: 2px solid var(--brand-primary, #6366f1); outline-offset: 2px; }
.cst-toggle > span { flex: 1; }

/* Constellation — pastilles d'état dans la liste des flux */
.cst-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cst-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600;
    padding: 3px 9px; border-radius: 999px; background: var(--brand-bg-soft, #eef0f6); color: var(--brand-muted, #55607a); border: 1px solid transparent; }
.cst-badge.published { background: color-mix(in srgb, #16a34a 14%, transparent); color: #15803d; }
.cst-badge.draft { background: color-mix(in srgb, #9ca3af 18%, transparent); color: #6b7280; }
.cst-badge.auto { background: color-mix(in srgb, #6366f1 14%, transparent); color: #4f46e5; }
.cst-badge.url { background: color-mix(in srgb, #0ea5e9 14%, transparent); color: #0369a1; }
.cst-badge.running { background: color-mix(in srgb, #f59e0b 18%, transparent); color: #b45309; }
.cst-badge.running .dot { width: 7px; height: 7px; border-radius: 50%; background: #f59e0b; animation: cstpulse 1.1s ease-in-out infinite; }
@keyframes cstpulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* Constellation — inspecteur : sections plus lisibles + aide par carte */
.cst-insp-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.cst-insp-head h4 { margin: 0; font-size: 14px; }
.cst-help-btn { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--brand-border, #cfd4e0);
    background: #fff; color: var(--brand-primary, #6366f1); font-weight: 700; font-size: 13px; cursor: pointer; line-height: 1; padding: 0; }
.cst-help-btn:hover { background: var(--brand-primary, #6366f1); color: #fff; border-color: var(--brand-primary, #6366f1); }
/* Aide détaillée par carte : modale centrée défilable. */
.cst-help-box { position: relative; max-width: 560px; width: 100%; max-height: 86vh; overflow: auto; }
.cst-help-box .cst-help-close { position: absolute; top: 12px; right: 14px; border: none; background: none; font-size: 18px; cursor: pointer; color: var(--brand-muted, #99a); }
.cst-help-title { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; }
.cst-help-title h3 { margin: 0; font-size: 18px; }
.cst-help-ic { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.cst-help-grp { font-size: 12px; color: var(--brand-muted, #6b7280); }
.cst-help-lead { font-size: 14.5px; line-height: 1.6; color: var(--brand-text, #2a2f3a); margin: 0 0 4px; }
.cst-help-sec { margin-top: 16px; }
.cst-help-sec h4 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--brand-muted, #8a8fa3); }
.cst-help-sec p, .cst-help-sec li { font-size: 14px; line-height: 1.6; color: var(--brand-text, #333a49); }
.cst-help-sec ul { margin: 0; padding-left: 18px; }
.cst-help-ex { background: var(--brand-bg-soft, #f6f7fb); border-left: 3px solid var(--brand-primary, #6366f1); border-radius: 0 8px 8px 0; padding: 10px 14px; }
.cst-help-dl { margin: 0; }
.cst-help-dl dt { font-weight: 650; font-size: 13.5px; color: var(--brand-text, #1f2430); margin-top: 10px; }
.cst-help-dl dd { margin: 2px 0 0; font-size: 13.5px; line-height: 1.55; color: var(--brand-muted, #55607a); }

/* Sections du workflow : code couleur clair & neutre pour identifier le type de carte.
   Démarrer = vert/teal · Actions = indigo (marque) · Contrôle = ambre. */
.cst-grp-demarrer { --g: #0d9488; --gsoft: #ecfdf9; }
.cst-grp-actions  { --g: #6366f1; --gsoft: #eef0ff; }
.cst-grp-controle { --g: #d97706; --gsoft: #fef6ec; }
.cst-node.cst-grp-demarrer, .cst-node.cst-grp-actions, .cst-node.cst-grp-controle { border-left: 3px solid var(--g); }
.cst-node .cst-node-ic { background: var(--gsoft); color: var(--g); border-radius: 7px; }
.cst-pal-item.cst-grp-demarrer, .cst-pal-item.cst-grp-actions, .cst-pal-item.cst-grp-controle { border-left: 3px solid var(--g); }
.cst-pal-item .cst-pal-ic { color: var(--g); }
#cst-palette h4.cst-grp-demarrer, #cst-palette h4.cst-grp-actions, #cst-palette h4.cst-grp-controle { color: var(--g); border-bottom: 1px solid var(--gsoft); padding-bottom: 3px; }
.cst-help-ic.cst-grp-demarrer, .cst-help-ic.cst-grp-actions, .cst-help-ic.cst-grp-controle { background: var(--gsoft); color: var(--g); }

/* Parcours découverte de bienvenue (1er login) — décoré, immersif. */
.welc-ov { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px;
    background: radial-gradient(120% 120% at 50% 0%, #1a1636 0%, #0d0b1c 60%, #08060f 100%); animation: welcFade .3s ease; overflow: hidden; }
.welc-ov.welc-closing { animation: welcFadeOut .26s ease forwards; }
@keyframes welcFade { from { opacity: 0 } to { opacity: 1 } }
@keyframes welcFadeOut { to { opacity: 0 } }
.welc-stars { position: absolute; inset: 0; pointer-events: none;
    background-image: radial-gradient(1.5px 1.5px at 20% 30%, #fff, transparent), radial-gradient(1.5px 1.5px at 70% 20%, #cbd5ff, transparent),
        radial-gradient(1px 1px at 40% 70%, #fff, transparent), radial-gradient(1.5px 1.5px at 85% 60%, #e9d5ff, transparent),
        radial-gradient(1px 1px at 55% 45%, #fff, transparent), radial-gradient(1px 1px at 12% 80%, #fff, transparent),
        radial-gradient(1.5px 1.5px at 90% 88%, #c7d2fe, transparent), radial-gradient(1px 1px at 30% 12%, #fff, transparent);
    background-repeat: no-repeat; opacity: .55; animation: welcTwinkle 4s ease-in-out infinite; }
@keyframes welcTwinkle { 0%,100% { opacity: .38 } 50% { opacity: .7 } }
.welc-card { position: relative; z-index: 1; width: 100%; max-width: 440px; text-align: center;
    background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); border-radius: 22px; padding: 34px 30px 26px;
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: 0 24px 70px rgba(0,0,0,.5); color: #f2f2fb; }
.welc-skip { position: absolute; top: 14px; right: 16px; border: none; background: none; color: rgba(255,255,255,.55); font-size: 13px; cursor: pointer; }
.welc-skip:hover { color: #fff; }
.welc-ic { width: 82px; height: 82px; margin: 4px auto 18px; border-radius: 22px; display: flex; align-items: center; justify-content: center;
    font-size: 40px; box-shadow: 0 12px 34px rgba(120,80,240,.45); }
.welc-title { margin: 0 0 6px; font-size: 1.5rem; font-weight: 700; color: #fff; }
.welc-title .welc-sub { font-size: .8rem; font-weight: 500; color: rgba(255,255,255,.6); }
.welc-text { margin: 0 auto; max-width: 34ch; color: rgba(255,255,255,.82); line-height: 1.6; font-size: 1rem; }
.welc-dots { display: flex; gap: 7px; justify-content: center; margin: 22px 0 20px; }
.welc-dot { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.25); transition: all .2s; }
.welc-dot.on { background: #fff; width: 22px; border-radius: 999px; }
.welc-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.welc-actions .primary { border: none; border-radius: 11px; padding: 11px 22px; font-weight: 650; font-size: 15px; cursor: pointer;
    background: linear-gradient(120deg,#6366f1,#a855f7); color: #fff; }
.welc-actions .primary:hover { filter: brightness(1.08); }
.welc-actions .ghost { border: 1px solid rgba(255,255,255,.2); background: none; color: rgba(255,255,255,.8); border-radius: 11px; padding: 11px 16px; font-size: 14px; cursor: pointer; }
.welc-actions .ghost:hover { background: rgba(255,255,255,.08); }

/* Cosmos — badge « Super Nova » (gros modules natifs à forte profondeur fonctionnelle) */
.store-supernova { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 700;
    letter-spacing: .02em; vertical-align: middle; margin-left: 8px; padding: 3px 9px; border-radius: 999px;
    color: #fff; background: linear-gradient(120deg, #6366f1, #a855f7); box-shadow: 0 2px 8px rgba(120,80,240,.28); }

/* Constellation — couche de clic des liens (au-dessus du canevas, transparente sauf le trait) */
.cst-hit { position: absolute; top: 0; left: 0; width: 4000px; height: 2600px; pointer-events: none; overflow: visible; z-index: 6; }
.cst-hit path.cst-hitline { stroke: transparent; stroke-width: 18; fill: none; pointer-events: stroke; cursor: pointer; }
.cst-links path.cst-link.hover { stroke: #ef4444; stroke-width: 3.5; }
.cst-node.dragging { z-index: 20; }

/* ===== Nova Studio (Super Nova) — couleurs de marque ================= */
:root { --bld: var(--brand-primary, #5B28F5); --bld-soft: color-mix(in srgb, var(--brand-primary, #5B28F5) 9%, transparent); --bld-grad: linear-gradient(120deg, var(--brand-primary, #5B28F5), var(--brand-accent, #a855f7)); }
@media (prefers-color-scheme: dark) { :root { --bld-soft: color-mix(in srgb, var(--brand-primary, #5B28F5) 22%, transparent); } }
.sb-builder .sb-ic { color: var(--bld); }
#view-builder { padding: 0; }
#view-builder:not(.hidden) { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.bld-shell { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }

/* Atterrissage « Mes Novas » — MÊME format que la Constellation (pleine largeur,
   même remplissage que .view : les cartes, la police et la largeur sont identiques). */
.bld-home { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 26px 28px 60px; }
.bld-templates { margin: 14px 0; }
.bld-templates .bld-tpl-h { font-size: .9rem; font-weight: 600; margin-bottom: 8px; }
.bld-templates .bld-tpl-row { display: flex; flex-wrap: wrap; gap: 12px; }
.bld-templates .bld-tpl-card { display: flex; flex-direction: column; gap: 6px; padding: 14px; border: 1px solid var(--border, #e6e6ee); border-radius: 12px; background: var(--card, #fff); min-width: 200px; }

/* Topbar commune */
.bld-topbar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border, #e6e6ee); flex: 0 0 auto; }
.bld-name { flex: 1; min-width: 0; padding: 8px 12px; border: 1px solid var(--border, #e6e6ee); border-radius: 9px; font-size: .95rem; background: var(--card, #fff); color: inherit; }
.bld-top-actions { display: flex; align-items: center; gap: 12px; }
.bld-boost { font-size: .82rem; color: var(--muted, #667); display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; cursor: pointer; }
.bld-primary { padding: 8px 16px; border: 0; border-radius: 9px; font-weight: 600; cursor: pointer; color: var(--brand-primary-contrast, #fff);
    background: var(--bld-grad); }
.bld-primary.small { padding: 5px 12px; font-size: .85rem; }
.bld-primary:hover { filter: brightness(1.05); }

/* Studio : chat + aperçu */
.bld-studio { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.bld-body { flex: 1; display: grid; grid-template-columns: minmax(340px, 42%) 1fr; min-height: 0; }
.bld-chat { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--border, #e6e6ee); }
/* Toggle Guidé | Libre */
.bld-modeseg { display: inline-flex; align-self: center; margin: 12px 0 4px; padding: 3px; gap: 3px; border: 1px solid var(--border, #e6e6ee); border-radius: 999px; background: var(--bg-soft, #f2f2f7); }
.bld-modeseg button { border: 0; background: transparent; padding: 6px 18px; border-radius: 999px; font-size: .85rem; font-weight: 600; cursor: pointer; color: var(--muted, #667); transition: background .15s, color .15s; }
.bld-modeseg button.on { background: var(--bld-grad); color: var(--brand-primary-contrast, #fff); }
.bld-msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.bld-about { align-self: stretch; font-size: .82rem; color: var(--text-dim, #667); background: var(--bg-soft, #f5f5fa); border: 1px dashed var(--border, #dfe2ec); border-radius: 10px; padding: 8px 12px; }
.bld-msg { max-width: 92%; padding: 10px 13px; border-radius: 12px; font-size: .92rem; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.bld-msg.bld-me { align-self: flex-end; background: var(--bld-grad); color: var(--brand-primary-contrast, #fff); border-bottom-right-radius: 4px; }
.bld-msg.bld-ai { align-self: flex-start; background: var(--bld-soft); border: 1px solid color-mix(in srgb, var(--brand-primary, #5B28F5) 18%, transparent); border-bottom-left-radius: 4px; }
.bld-thinking { opacity: .7; font-style: italic; }
/* Bulle « en construction » : statut animé + narration + code qui s'écrit en direct. */
.bld-building { display: flex; flex-direction: column; gap: 6px; }
.bld-build-status { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .86rem; color: var(--bld); }
.bld-build-narr { font-size: .9rem; line-height: 1.5; white-space: pre-wrap; opacity: .92; }
.bld-build-narr:empty { display: none; }
.bld-spin { width: 14px; height: 14px; flex: none; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--brand-primary, #5B28F5) 30%, transparent); border-top-color: var(--brand-primary, #5B28F5); animation: bld-spin .7s linear infinite; }
@keyframes bld-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .bld-spin { animation-duration: 2s; } }
.bld-assets { padding: 8px 14px; border-top: 1px solid var(--border, #e6e6ee); background: var(--bg-soft, #fafafd); }
/* Pièces jointes repliables : par défaut on ne voit que « 📎 Pièces jointes (N) » + les boutons d'ajout. */
.bld-assets-summary { cursor: pointer; font-size: .82rem; font-weight: 600; list-style: none; display: flex; align-items: center; gap: 6px; padding: 3px 0; }
.bld-assets-summary::-webkit-details-marker { display: none; }
.bld-assets-summary::before { content: '▸'; color: var(--muted, #889); transition: transform .15s ease; }
.bld-assets-details[open] .bld-assets-summary::before { transform: rotate(90deg); }
.bld-assets-count { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--bld-soft); color: var(--bld); font-size: 11px; font-weight: 700; }
.bld-assets-help { margin: 8px 0; line-height: 1.45; }
.bld-assets-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.bld-asset { display: inline-flex; align-items: center; gap: 6px; padding: 3px 6px 3px 3px; border: 1px solid var(--border, #e6e6ee); border-radius: 999px; background: var(--card, #fff); font-size: .78rem; }
.bld-asset img { width: 22px; height: 22px; border-radius: 5px; object-fit: cover; }
.bld-asset.bld-asset-doc { padding-left: 8px; }
.bld-asset .bld-doc-ic { font-size: 15px; line-height: 1; }
.bld-asset-star { border: 0; background: transparent; cursor: pointer; color: var(--muted, #b9b9c6); font-size: .95rem; line-height: 1; padding: 0 1px; }
.bld-asset-star.on { color: #f5a623; }
.bld-asset-cover { border: 0; background: transparent; cursor: pointer; font-size: .82rem; line-height: 1; padding: 0 1px; filter: grayscale(1); opacity: .45; }
.bld-asset-cover.on { filter: none; opacity: 1; }
.bld-asset-x { border: 0; background: transparent; cursor: pointer; color: var(--muted, #888); font-size: .72rem; }
.bld-asset-adds { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; }
.bld-asset-add { display: inline-block; font-size: .82rem; font-weight: 600; color: var(--bld); cursor: pointer; }
.bld-form { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--border, #e6e6ee); }
.bld-input { flex: 1; resize: none; padding: 10px 12px; border: 1px solid var(--border, #e6e6ee); border-radius: 10px; font-family: inherit; font-size: .92rem; background: var(--card, #fff); color: inherit; }
.bld-send { flex: 0 0 auto; width: 42px; border: 0; border-radius: 10px; cursor: pointer; color: var(--brand-primary-contrast, #fff); font-size: 1.1rem; background: var(--bld-grad); }
.bld-send:disabled { opacity: .5; cursor: default; }

/* Aperçu */
.bld-preview { display: flex; flex-direction: column; min-height: 0; background: var(--bg-soft, #f7f7fb); }
.bld-preview-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--border, #e6e6ee); }
.bld-prev-actions { display: flex; align-items: center; gap: 8px; }
.bld-iconbtn { border: 1px solid var(--border, #e6e6ee); background: var(--card, #fff); color: inherit; border-radius: 8px; padding: 5px 10px; font-size: .82rem; cursor: pointer; line-height: 1; }
.bld-iconbtn:hover { border-color: var(--bld); color: var(--bld); }
.bld-seg { display: inline-flex; border: 1px solid var(--border, #e6e6ee); border-radius: 8px; overflow: hidden; }
.bld-seg button { border: 0; background: var(--card, #fff); padding: 5px 12px; font-size: .82rem; cursor: pointer; color: inherit; }
.bld-seg button.active { background: var(--bld); color: var(--brand-primary-contrast, #fff); }
.bld-preview-host { flex: 1; min-height: 0; overflow: auto; display: flex; align-items: stretch; justify-content: center; padding: 14px; }
.bld-preview-host.bld-phone { padding: 20px; }
.bld-frame { width: 100%; height: 100%; border: 0; border-radius: 10px; background: #fff; box-shadow: 0 2px 12px rgba(20,20,40,.08); }
.bld-preview-host.bld-phone .bld-frame { width: 390px; max-width: 100%; height: 720px; max-height: 100%; align-self: center; }
.bld-preview-empty { margin: auto; text-align: center; color: var(--muted, #99a); font-size: 1.4rem; line-height: 1.8; }
.bld-code { flex: 1; min-height: 0; overflow: auto; margin: 0; padding: 16px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; line-height: 1.5; white-space: pre; background: #0e0e15; color: #d7d7e6; }

/* Atelier */
.bld-workshop { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.bld-ws-list { flex: 1; overflow-y: auto; padding: 16px; max-width: 900px; margin: 0 auto; width: 100%; display: flex; flex-direction: column; gap: 10px; }
.bld-ws-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--border, #e6e6ee); border-radius: 12px; background: var(--card, #fff); }
.bld-ws-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.bld-ws-main b { font-size: 1rem; }
.bld-ws-chip { display: inline-block; font-size: .72rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--bld-soft); color: var(--bld); }
.bld-ws-chip.muted { background: var(--bg-soft, #eee); color: var(--muted, #889); }
.bld-ws-actions { display: flex; gap: 8px; flex: 0 0 auto; }

@media (max-width: 820px) { .bld-body { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; } .bld-chat { border-right: 0; border-bottom: 1px solid var(--border, #e6e6ee); } }

/* Builder — bandeau de dérive de Convention */
.bld-conv-banner { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--bld-soft); border-bottom: 1px solid color-mix(in srgb, var(--brand-primary, #5B28F5) 30%, transparent); font-size: .86rem; }
.bld-conv-ic { flex: 0 0 auto; }
.bld-conv-text { flex: 1; min-width: 0; }
.bld-ws-chip.warn { background: var(--bld-soft); color: var(--bld); }

/* Builder — atelier : ligne + détail versions */
.bld-ws-row { display: flex; align-items: center; gap: 12px; width: 100%; }
.bld-ws-detail { width: 100%; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border, #e6e6ee); }
.bld-ws-card { flex-direction: column; align-items: stretch; }
.bld-ver-head { font-size: .82rem; font-weight: 600; margin-bottom: 6px; }
.bld-ver-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; flex-wrap: wrap; }
.bld-ver-n { font-weight: 600; font-size: .85rem; min-width: 90px; }

/* Rayon Halos (compléments) dans le Cosmos */
.halo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-top: 10px; }
.halo-card { border: 1px solid var(--border, #e6e6ee); border-radius: 14px; background: var(--card, #fff); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.halo-top { display: flex; align-items: center; gap: 10px; }
.halo-ic { width: 40px; height: 40px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 20px;
    background: color-mix(in srgb, #a855f7 15%, transparent); }
.halo-h { display: flex; flex-direction: column; }
.halo-h b { font-size: 1rem; line-height: 1.2; }
.halo-kind { font-size: .68rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--muted, #889); }
.halo-desc { margin: 0; font-size: .86rem; color: var(--muted, #667); flex: 1; }
.halo-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.halo-price { font-size: .78rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--bg-soft, #f2f2f7); color: var(--ink, #333); }
.halo-owned { font-size: .78rem; font-weight: 700; color: #0a7d33; margin-left: auto; }
.halo-foot .store-agents-install { margin-left: auto; }

/* Fiche Nova — section « Compléments » (Halos déclarés) */
.cd-halos-wrap { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border, #e6e6ee); }
.cd-halos-h { margin: 0 0 2px; font-size: 1rem; }
.cd-halos-sub { margin: 0 0 12px; }

/* Halos de contenu injecté — gabarits & packs d'icônes dans les modules natifs */
.cst-templates, .bld-templates { margin: 0 0 16px; }
.cst-tpl-h, .bld-tpl-h { font-size: .82rem; font-weight: 700; color: var(--muted, #778); margin: 0 0 8px; }
.cst-tpl-row, .bld-tpl-row { display: flex; flex-wrap: wrap; gap: 10px; }
.cst-tpl-card, .bld-tpl-card { display: flex; flex-direction: column; gap: 4px; min-width: 200px; flex: 0 1 240px;
    border: 1px dashed var(--border, #e6e6ee); border-radius: 12px; padding: 12px 14px; background: var(--card, #fff); }
.cst-tpl-card b, .bld-tpl-card b { font-size: .92rem; }
.bld-templates { margin-top: 24px; }
.bld-iconpacks { margin: 6px 0 10px; }
.bld-iconpack-h { font-size: .78rem; font-weight: 600; color: var(--muted, #889); margin: 6px 0 4px; }
.bld-iconpack-row { display: flex; flex-wrap: wrap; gap: 6px; }
.bld-iconpack-ic { width: 34px; height: 34px; padding: 5px; border: 1px solid var(--border, #e6e6ee); border-radius: 8px;
    background: var(--card, #fff); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.bld-iconpack-ic:hover { border-color: var(--bld, #d97706); }
.bld-iconpack-ic img { width: 100%; height: 100%; object-fit: contain; }

/* ===== Mobile — garde anti-débordement horizontal + Cosmos responsive ===== */
@media (max-width: 760px) {
    html, body { overflow-x: hidden; max-width: 100%; }
    #main, .view, .store-section, #cat-home, .cat-grid { min-width: 0; max-width: 100%; }
    /* Encart « Officielles » : une colonne au lieu de 3 (débordait). */
    .off-grid { grid-template-columns: 1fr; }
    .off-big { grid-row: auto; min-height: 150px; }
    .store-official { padding: 16px; border-radius: 18px; }
    /* Rangées à défilement horizontal : cartes qui tiennent dans l'écran, défilement
       interne borné (jamais de scroll de page). */
    .hscroll { max-width: 100%; scroll-padding-left: 14px; }
    .store-hero { grid-auto-columns: minmax(82%, 320px); }
    .store-hero-sm { grid-auto-columns: minmax(64%, 240px); }
    .store-cat-row .hscroll { grid-auto-columns: minmax(76%, 240px); }
    /* Sections natives « Super Nova » (Agents/Constellation/Builder/Halos) : cartes fluides. */
    .store-agents-card { flex-wrap: wrap; }
    .halo-grid { grid-template-columns: 1fr; }
}

/* Voilà plein écran (agentchat) : occuper la hauteur au-dessus de la barre du bas. */
@media (max-width: 760px) {
    #view-agentchat:not(.hidden) { display: flex; flex-direction: column; min-height: 0; }
    #view-agentchat .ac-shell { height: auto; flex: 1 1 auto; min-height: 0; }
}

/* ============================================================================
   Mobile 3/3 — adaptation module par module (téléphone, ≤ 760px)
   ============================================================================ */
@media (max-width: 760px) {
    /* --- Sécurité média : rien ne dépasse la largeur de l'écran --- */
    .view img, .view video, .view iframe, .view canvas, .view table { max-width: 100%; }
    .view pre { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .table-scroll { -webkit-overflow-scrolling: touch; }

    /* --- Constellation (builder no-code) : 3 volets → empilés --- */
    .cst-toolbar { flex-wrap: wrap; gap: 6px; }
    .cst-toolbar #cst-name { flex: 1 1 100%; order: -1; }
    .cst-workspace { flex-direction: column; height: auto; min-height: 0; }
    .cst-palette { width: auto; flex: 0 0 auto; border-right: 0; border-bottom: 1px solid var(--brand-border, #dfe3ec);
        display: flex; flex-wrap: nowrap; align-items: stretch; gap: 8px; overflow-x: auto; padding: 10px; white-space: nowrap; }
    .cst-palette h4 { display: none; }
    .cst-pal-item { margin-bottom: 0; flex: 0 0 auto; }
    .cst-canvas-wrap { min-height: 58vh; }
    /* Inspecteur d'un nœud : en feuille du bas (au-dessus de la barre de nav). */
    .cst-inspector:not(.hidden) { position: fixed; left: 0; right: 0; top: auto;
        bottom: calc(62px + env(safe-area-inset-bottom, 0px)); width: auto; flex: none;
        max-height: 62dvh; overflow: auto; border-left: 0; border-top: 1px solid var(--brand-border, #dfe3ec);
        border-radius: 18px 18px 0 0; box-shadow: 0 -16px 44px -12px rgba(15,20,40,.32); z-index: 260; }
    .cst-runbar { flex-wrap: wrap; }

    /* --- Nova Studio : en-tête compacte, aperçu confortable --- */
    .bld-topbar { flex-wrap: wrap; gap: 8px; }
    .bld-name { flex: 1 1 100%; order: -1; }
    .bld-preview-host.bld-phone .bld-frame { height: 620px; }

    /* --- Chat agents / Voilà : CHAT PLEIN ÉCRAN (façon Claude / ChatGPT). --- */
    /* La barre d'agents (haut) et l'historique (colonne) passent dans la feuille du bas,
       ouverte par le bouton « Appli » de la barre de navigation (ou ☰ dans l'en-tête). */
    #view-agentchat .ac-topbar { display: none; }
    #view-agentchat .ac-side { display: none; }
    #view-agentchat .ac-main { min-width: 0; }
    .ac-head-btn { display: inline-flex; }
    .ac-head { gap: 10px; padding: 10px 12px; }
    .ac-msgs { padding-left: 12px; padding-right: 12px; }

    /* --- Tableaux larges : défilement horizontal interne (jamais la page) --- */
    .utable, .ct-table { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }

    /* --- Modales : feuilles plein largeur jusqu'à 760px (cohérent avec la nav) --- */
    .modal-root { place-items: end stretch; padding: 0; }
    .modal, .modal-wide { width: 100%; max-width: 100%; max-height: 92dvh; border-radius: 18px 18px 0 0;
        padding: 20px 16px calc(18px + env(safe-area-inset-bottom, 0px)); }
    .field input, .field select, .field textarea, input[type="text"], input[type="email"],
    input[type="password"], input[type="number"], textarea, select { font-size: 16px; }  /* anti-zoom iOS */
}

/* ===== Coquille RÉDUITE des comptes « Lite » (invités) — H4 ===== */
/* Masque toute la navigation d'organisation ; l'invité ne voit que son accueil. */
body.lite-mode #sidebar,
body.lite-mode #mobile-nav,
body.lite-mode .topbar .notif-wrap,
body.lite-mode #nav-help,
body.lite-mode .menu-mobile-nav,
body.lite-mode #voila-root,
body.lite-mode #mg-perso [data-view="drives-mine"],
body.lite-mode #mg-perso [data-view="suites"],
body.lite-mode #mg-perso [data-view="faq"] { display: none !important; }
body.lite-mode #main { padding-bottom: 24px; }

/* ===== Mode AUTONOME (PWA dédiée d'une Nova/suite) ===== */
/* Aucune coquille Constellae : ni barre latérale, ni en-tête, ni nav — surface 100 %
   Nova/suite, pour un ressenti d'application à part entière. */
body.standalone-mode #sidebar,
body.standalone-mode .topbar,
body.standalone-mode #mobile-nav,
body.standalone-mode .menu-mobile-nav,
body.standalone-mode #nav-help,
body.standalone-mode #voila-root,
body.standalone-mode .menu-burger { display: none !important; }
body.standalone-mode #main { margin: 0; padding: 0; height: 100%; min-height: 0; }

/* Bouton flottant « Installer l'application » (mode autonome, en onglet navigateur). */
.pwa-install-fab {
    position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%);
    z-index: 9999; border: 0; cursor: pointer;
    background: var(--brand, #5B28F5); color: #fff;
    padding: 12px 22px; border-radius: 999px; font: 600 15px/1 inherit;
    box-shadow: 0 10px 28px rgba(20, 10, 60, .28);
    animation: fab-rise .35s ease;
}
.pwa-install-fab:hover { filter: brightness(1.07); }
.pwa-install-fab:active { transform: translateX(-50%) scale(.97); }
@keyframes fab-rise { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* Accueil invité */
#view-guest .guest-wrap { max-width: 1000px; margin: 0 auto; padding: 6px 2px 40px; }
#view-guest .guest-head h2 { margin: 0 0 4px; }
#view-guest .guest-join { margin: 18px 0; padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
#view-guest .guest-join label { display: block; font-weight: 600; margin-bottom: 8px; }
#view-guest .guest-join-row { display: flex; gap: 10px; flex-wrap: wrap; }
#view-guest .guest-join-row input { flex: 1 1 200px; min-width: 0; text-transform: uppercase; letter-spacing: .14em; font-weight: 700; text-align: center; }
#view-guest #guest-grid { margin-top: 10px; }
#view-guest .guest-upsell { margin-top: 30px; padding: 22px; border-radius: 16px; text-align: center; border: 1px solid var(--border); background: linear-gradient(120deg, color-mix(in srgb, var(--brand-primary,#5B28F5) 10%, transparent), transparent); }
#view-guest .guest-upsell h3 { margin: 0 0 8px; }
#view-guest .guest-upsell .primary { display: inline-block; margin-top: 12px; text-decoration: none; }

/* ===== Réglage « Accès invité (Lite) » — console super-admin ===== */
.guest-enroll-panel .ge-head { display: flex; gap: 12px; align-items: flex-start; }
.guest-enroll-panel .ge-ic { flex: none; width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--brand-primary,#5B28F5), var(--brand-accent,#a855f7)); }
.guest-enroll-panel .ge-head-txt h3 { margin: 0 0 2px; }
.guest-enroll-panel .ge-head-txt p { margin: 0; }
.guest-enroll-panel .ge-toggle-row { display: flex; align-items: center; gap: 12px; margin: 16px 0 4px; flex-wrap: wrap; }
.guest-enroll-panel .ge-state { font-size: .78rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; letter-spacing: .02em; }
.guest-enroll-panel .ge-state-off { color: var(--muted,#77808f); background: color-mix(in srgb, var(--muted,#77808f) 14%, transparent); }
.guest-enroll-panel .ge-state-on { color: #fff; background: linear-gradient(120deg, var(--brand-primary,#5B28F5), var(--brand-accent,#a855f7)); }
.guest-enroll-panel .ge-more { margin-top: 10px; border-top: 1px dashed var(--border,#e2e2e9); padding-top: 10px; }
.guest-enroll-panel .ge-more > summary { cursor: pointer; font-weight: 600; font-size: .9rem; color: var(--brand-primary,#5B28F5); list-style: none; }
.guest-enroll-panel .ge-more > summary::-webkit-details-marker { display: none; }
.guest-enroll-panel .ge-more > summary::before { content: "▸ "; }
.guest-enroll-panel .ge-more[open] > summary::before { content: "▾ "; }
.guest-enroll-panel .ge-more-body { margin-top: 8px; font-size: .88rem; line-height: 1.5; color: var(--text,#2a2a33); }
.guest-enroll-panel .ge-more-body ul { margin: 6px 0 6px 4px; padding-left: 18px; }
.guest-enroll-panel .ge-more-body li { margin: 4px 0; }

/* ===== Invitations (gestion) + boutons d'installation PWA ===== */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,18,40,.45); display: flex; align-items: center; justify-content: center; z-index: 500; padding: 20px; }
.modal-overlay.hidden { display: none; }
.inv-modal-box { background: var(--surface,#fff); border-radius: 18px; width: 100%; max-width: 520px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 16px 50px rgba(15,20,50,.25); }
.inv-modal-box .modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border,#e2e4ec); }
.inv-modal-box .modal-head h3 { margin: 0; }
.inv-modal-box .modal-x { border: 0; background: none; font-size: 1.1rem; cursor: pointer; color: var(--muted,#77808f); }
.inv-modal-box .modal-body { padding: 16px 18px; overflow: auto; }
.inv-create { display: flex; gap: 8px; margin: 10px 0; flex-wrap: wrap; }
.inv-create input { flex: 1 1 200px; min-width: 0; padding: 10px 12px; border: 1px solid var(--border,#e2e4ec); border-radius: 10px; font-size: 16px; }
.inv-list { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.inv-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--border,#e2e4ec); border-radius: 12px; flex-wrap: wrap; }
.inv-row-act { display: flex; gap: 6px; }
.inv-who { font-size: .9rem; }
.inv-badge { font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.inv-badge.inv-pending { color: #1d4ed8; background: rgba(29,78,216,.12); }
.inv-badge.inv-used { color: #15803d; background: rgba(21,128,61,.12); }
.inv-badge.inv-expired { color: #77808f; background: rgba(119,128,143,.15); }
.detail-actions { margin: 6px 0 10px; }
.inv-del.danger, .ghost.danger { color: #c0392b; }
