/* DISP — feuille de style commune (mobile d'abord, sans dépendance).
 * Les boutiques publiques surchargent les variables --brand-* via le thème
 * du commerçant (Phase 4). */

:root {
    --brand: #0f766e;
    --brand-strong: #115e59;
    --brand-soft: #ccfbf1;
    --accent: #f59e0b;
    --bg: #f6f7f9;
    --surface: #ffffff;
    --text: #111827;
    --muted: #6b7280;
    --border: #e5e7eb;
    --danger: #b91c1c;
    --danger-soft: #fee2e2;
    --success: #15803d;
    --success-soft: #dcfce7;
    --warning: #b45309;
    --warning-soft: #fef3c7;
    --radius: 12px;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.06), 0 1px 3px rgb(0 0 0 / 0.08);
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color-scheme: light;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    /* Un mot très long (lien WhatsApp, URL…) passe à la ligne au lieu d'élargir la page. */
    overflow-wrap: break-word;
}

/* Filet de sécurité : rien ne doit élargir la page sur mobile (sinon la barre
   d'onglets fixe s'étire et ses derniers onglets sortent de l'écran).
   « clip » ne crée pas de zone de défilement : les éléments sticky restent collés. */
.page-app { overflow-x: clip; }

a { color: var(--brand); }
a:hover { color: var(--brand-strong); }
img, svg { max-width: 100%; height: auto; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .75rem; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* --- Mise en page ---------------------------------------------------------- */
.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 1rem; }
.container-narrow { max-width: 480px; }
.page { padding: 1.25rem 0 3rem; }
.stack > * + * { margin-top: 1rem; }
.grid { display: grid; gap: 1rem; }
.cluster { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.spread { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; }

@media (min-width: 640px) {
    .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    h1 { font-size: 1.75rem; }
}
@media (min-width: 960px) {
    .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* --- En-tête --------------------------------------------------------------- */
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.topbar .container { display: flex; align-items: center; gap: 1rem; min-height: 56px; flex-wrap: wrap; }
.brand { font-weight: 800; letter-spacing: -.02em; text-decoration: none; color: var(--text); font-size: 1.15rem; }
.brand span { color: var(--brand); }
.brand-tag { font-size: .75rem; font-weight: 600; color: var(--muted); margin-left: .35rem; text-transform: uppercase; letter-spacing: .05em; }
.nav { display: flex; gap: .25rem; flex-wrap: wrap; margin-left: auto; }
.nav a { text-decoration: none; color: var(--muted); padding: .4rem .65rem; border-radius: 8px; font-size: .95rem; }
.nav a:hover, .nav a.is-active { background: var(--brand-soft); color: var(--brand-strong); }
.nav { align-items: center; }
.nav-group { position: relative; }
.nav-group > summary { list-style: none; cursor: pointer; color: var(--muted); padding: .4rem .65rem; border-radius: 8px; font-size: .95rem; white-space: nowrap; user-select: none; }
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary::after { content: ""; display: inline-block; width: .4em; height: .4em; margin-left: .45em; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-.2em) rotate(45deg); transition: transform .15s; }
.nav-group[open] > summary::after { transform: translateY(0) rotate(-135deg); }
.nav-group > summary:hover, .nav-group > summary.is-active, .nav-group[open] > summary { background: var(--brand-soft); color: var(--brand-strong); }
.nav-group > summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.nav-menu { position: absolute; top: calc(100% + .35rem); left: 0; z-index: 20; min-width: 240px; padding: .4rem; display: flex; flex-direction: column; gap: .1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 10px 30px rgb(0 0 0 / .12); }
.nav-menu a, .nav-soon { display: block; padding: .45rem .65rem; white-space: nowrap; }
.nav-menu a { color: var(--text); }
.nav-soon { color: var(--muted); font-size: .95rem; cursor: default; }
.nav-heading { padding: .6rem .65rem .2rem; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.nav-heading:first-child { padding-top: .25rem; }
.nav-heading ~ a, .nav-heading ~ .nav-soon { padding-left: 1rem; }
.nav > .nav-group:nth-last-child(-n+3) .nav-menu { left: auto; right: 0; }

.banner { padding: .6rem 0; font-size: .9rem; }
.banner-danger { background: var(--danger); color: #fff; }
.banner-warning { background: var(--warning-soft); color: var(--warning); }
.banner .container { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; justify-content: space-between; }

/* --- Cartes ---------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem; }
.card > :last-child { margin-bottom: 0; }
.card-title { font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: .35rem; font-weight: 600; }
.stat { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }
.card-highlight { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }

/* --- Boutons --------------------------------------------------------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    min-height: 44px; padding: .55rem 1rem; border-radius: 10px; border: 1px solid transparent;
    font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
    background: var(--brand); color: #fff;
}
.btn:hover { background: var(--brand-strong); color: #fff; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg); color: var(--text); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #991b1b; }
.btn-small { min-height: 34px; padding: .3rem .7rem; font-size: .875rem; }
.btn-block { width: 100%; }
.btn-link { background: none; border: none; color: var(--brand); padding: 0; min-height: 0; font-weight: 600; cursor: pointer; font: inherit; }

/* --- Formulaires ----------------------------------------------------------- */
.field { margin-bottom: 1rem; }
.field label, .field legend { display: block; font-weight: 600; margin-bottom: .3rem; }
.field .help { font-size: .85rem; color: var(--muted); margin-top: .25rem; }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=search], input[type=date], input[type=url], select, textarea {
    width: 100%; min-height: 44px; padding: .55rem .75rem; font: inherit; color: var(--text);
    border: 1px solid #d1d5db; border-radius: 10px; background: #fff;
}
textarea { min-height: 44px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
.choice { display: flex; gap: .5rem; align-items: flex-start; padding: .55rem .75rem; border: 1px solid var(--border); border-radius: 10px; margin-bottom: .5rem; background: #fff; }
.choice input { margin-top: .3rem; }
.choice-inline { display: inline-flex; gap: .4rem; align-items: center; margin-right: 1rem; }
.form-errors, .field-error { color: var(--danger); font-size: .9rem; margin: .25rem 0 0; padding-left: 1rem; }
fieldset { border: 0; padding: 0; margin: 0 0 1rem; }
.input-suffix { display: flex; align-items: stretch; }
.input-suffix input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-suffix span { display: flex; align-items: center; padding: 0 .75rem; border: 1px solid #d1d5db; border-left: 0; border-radius: 0 10px 10px 0; background: var(--bg); color: var(--muted); font-size: .9rem; white-space: nowrap; }

/* --- Messages -------------------------------------------------------------- */
.flash { padding: .75rem 1rem; border-radius: 10px; margin-bottom: 1rem; }
.flash-success { background: var(--success-soft); color: var(--success); }
.flash-error { background: var(--danger-soft); color: var(--danger); }
.flash-info { background: var(--brand-soft); color: var(--brand-strong); }

/* --- Badges ---------------------------------------------------------------- */
.badge { display: inline-block; padding: .1rem .55rem; border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--bg); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.badge-success { background: var(--success-soft); color: var(--success); border-color: transparent; }
.badge-warning { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge-brand { background: var(--brand-soft); color: var(--brand-strong); border-color: transparent; }

/* --- Tableaux (défilement horizontal sur mobile) --------------------------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; }

/* Colonnes réservées au bureau / au mobile. */
.show-mobile { display: none; }

/* --- Historique des ventes : filtres + pagination -------------------------- */
.sales-filter { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; }
.sales-filter-dates { display: flex; gap: .75rem; flex: 1 1 320px; }
.sales-filter-dates .filter-field { flex: 1 1 0; }
.filter-field { display: flex; flex-direction: column; gap: .25rem; flex: 1 1 180px; min-width: 0; }
.filter-field > span { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.filter-field-narrow { flex: 0 0 96px; }
.filter-field input[type=date] { cursor: pointer; background: var(--bg); color: var(--text); }
.filter-field input[type=date]:hover { border-color: var(--brand); }
.filter-field input[type=date]::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .65; }
.filter-field input[type=date]::-webkit-calendar-picker-indicator:hover { opacity: 1; }
.sales-filter-last { display: flex; gap: .75rem; align-items: flex-end; }
.sales-filter-actions { display: flex; gap: .5rem; }
.back-link { display: inline-flex; align-items: center; gap: .3rem; margin-bottom: .5rem; font-weight: 600; text-decoration: none; font-size: .9rem; }
.back-link.show-mobile { display: none; }
.sales-filter-actions .btn { min-height: 44px; }
.sales-count { margin-bottom: .5rem; }
.sales-table td { vertical-align: middle; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-top: 1rem; }
.btn.is-disabled { opacity: .45; pointer-events: none; }

/* --- Stock : filtres + ajustement ------------------------------------------ */
.stock-filter { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.stock-filter .stock-filter-search { flex: 1 1 12rem; width: auto; }
.stock-filter-location { width: auto; }
.stock-filter-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.stock-filter-low { margin-right: 0; }
.stock-filter-perpage { display: inline-flex; align-items: center; gap: .4rem; font-size: .875rem; color: var(--muted); }
.stock-filter-perpage select { width: auto; }
.stock-table td { vertical-align: middle; }
.row-link { cursor: pointer; }
/* Champs fichier : bouton natif aux couleurs de l'application (toutes pages). */
input[type=file] { max-width: 100%; font: inherit; font-size: .875rem; color: var(--muted); }
input[type=file]::file-selector-button {
    margin-right: .6rem; padding: .45rem .9rem; border: 1px solid var(--border); border-radius: 10px;
    background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; transition: background .15s, border-color .15s;
}
input[type=file]::file-selector-button:hover { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-strong); }

/* Sélecteur de photo (catalogue) : zone cliquable avec nom du fichier choisi. */
.ai-photo-intro { margin-bottom: .6rem; }
.ai-photo-row { display: flex; gap: .5rem; align-items: stretch; flex-wrap: wrap; }
.file-picker {
    position: relative; flex: 1 1 16rem; min-width: 0; display: flex; align-items: center; gap: .55rem; min-height: 44px;
    padding: .4rem .8rem; border: 1.5px dashed #cbd5e1; border-radius: 10px; background: var(--bg); color: var(--muted);
    cursor: pointer; transition: border-color .15s, background .15s, color .15s;
}
.file-picker:hover, .file-picker:focus-within { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-strong); }
.file-picker.has-file { border-style: solid; border-color: var(--brand); color: var(--text); background: var(--surface); }
.file-picker .icon { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.file-picker-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; font-weight: 600; }
/* Le vrai champ couvre la zone (reste accessible au clavier et valide « required »). */
.file-picker input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.ai-photo-row .btn { min-height: 44px; }

/* Catalogue : filtres et tableau. */
.catalog-filter { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.catalog-filter .catalog-search { flex: 1 1 12rem; width: auto; }
.catalog-filter select { width: auto; }
.catalog-table td { vertical-align: middle; }
.catalog-list-head { margin-bottom: .25rem; }

/* Approvisionnement. */
.purchase-table td { vertical-align: middle; }
.purchase-table .num { text-align: right; }
.per-page-form { margin: 0; }

/* Statistiques. */
.stats-filter { margin-bottom: 1rem; }
.stats-filter .sales-filter-dates { align-items: flex-end; }
.stats-filter .sales-filter-dates .btn { min-height: 44px; }
.stats-shortcuts { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .6rem; }
.stats-shortcuts .badge { text-decoration: none; }
.stats-tables .num, .stats-tables th.num, .card table .num { text-align: right; }

/* Boutique en ligne (apparence). */
.shop-tabs .badge { text-decoration: none; padding: .25rem .7rem; font-size: .82rem; }
.shop-media-current { margin-bottom: .35rem; gap: .6rem; }
.shop-media-current img { max-height: 48px; max-width: 160px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg); }
.storefront-form .file-picker { min-height: 40px; }
/* Boutique en ligne (pages, livraison, paiements, domaine). */
.shop-row { padding: .5rem 0; border-bottom: 1px solid var(--border); }
.shop-row:last-child { border-bottom: 0; }
.shop-row > span:first-child { min-width: 0; }
.shop-row a strong { overflow-wrap: anywhere; }
details.shop-row summary { cursor: pointer; }
.zone-delay { white-space: nowrap; }
.shop-add-pages { display: flex; flex-wrap: wrap; gap: .5rem; }
.shop-settings ol { padding-left: 1.2rem; margin-bottom: .75rem; }
.shop-settings ol li + li { margin-top: .25rem; }
.shop-settings input.mono { font-size: .85rem; }
input[type=color] { width: 100%; height: 40px; padding: 3px; border: 1px solid #d1d5db; border-radius: 10px; background: #fff; cursor: pointer; }
input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
input[type=color]::-webkit-color-swatch { border: 0; border-radius: 7px; }
.shop-save { margin-top: 1rem; }

/* Nouveau bon de commande. */
.po-form-head { display: grid; gap: 0 1rem; }
@media (min-width: 640px) { .po-form-head { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.po-toolbar { display: flex; gap: .5rem; align-items: center; margin-bottom: .4rem; }
.po-toolbar .po-search { flex: 1 1 auto; width: auto; min-width: 0; }
.po-toolbar select { width: auto; }
.po-table td { vertical-align: middle; }
.po-table .num { text-align: right; }
.po-table .po-qty { width: 6rem; }
.po-table .po-cost { width: 8rem; }
.po-table tr.is-suggested .po-qty { border-color: var(--brand); background: var(--brand-soft); font-weight: 700; }
.po-note { margin-top: 1rem; }
.po-actions { display: flex; justify-content: flex-end; gap: .5rem; }
.pagination button:disabled { opacity: .45; cursor: not-allowed; }
/* Fiche d'un bon de commande. */
.po-show-head { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .75rem; }
.po-show-head h1 { margin: 0; }
.po-summary { margin-bottom: 1rem; }
.po-meta { display: grid; gap: .6rem 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0 0 .85rem; }
@media (min-width: 760px) { .po-meta { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.po-meta dt { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.po-meta dd { margin: .1rem 0 0; overflow-wrap: anywhere; }
.po-progress .spread { margin-bottom: .3rem; }
.po-show-note { margin: .6rem 0 0; padding: .45rem .6rem; border-left: 3px solid var(--border); background: var(--bg); border-radius: 6px; }
.po-lines-title { margin: 0; white-space: nowrap; }
.po-show-table tr.is-done td { color: var(--muted); }
.po-show-table input[readonly] { background: var(--bg); color: var(--muted); }
.po-total { padding: .6rem 0; margin: .25rem 0 .75rem; border-top: 2px solid var(--text); font-size: 1.05rem; }
.po-show-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }

/* Fournisseurs. */
.supplier-form-pair { display: grid; gap: 0 .75rem; }
@media (min-width: 640px) { .supplier-form-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.supplier-item { border-bottom: 1px solid var(--border); }
.supplier-item:last-child { border-bottom: 0; }
.supplier-item .supplier-row { border-bottom: 0; }
.supplier-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.supplier-item.is-inactive .supplier-name { color: var(--muted); }
.supplier-item.is-inactive .category-info strong { color: var(--warning); }
.supplier-edit { padding: .5rem .6rem .6rem; margin-bottom: .6rem; border-radius: 10px; background: var(--bg); }
.supplier-edit .field { margin-bottom: .45rem; }

/* Catégories du catalogue. */
.categories-layout { align-items: start; }
.category-list { list-style: none; margin: 0; padding: 0; }
/* Une ligne par catégorie : nom | Renommer | Désactiver | Supprimer. */
.category-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: .4rem; align-items: center; padding: .5rem 0; border-bottom: 1px solid var(--border); }
.category-row:last-child { border-bottom: 0; }
.category-row > form { margin: 0; }
.category-name { min-width: 0; }
.category-name input { width: 100%; }
.category-info { display: block; font-size: .72rem; color: var(--muted); margin-top: .15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.category-row.is-inactive .category-name input { color: var(--muted); background: var(--bg); }
.category-row.is-inactive .category-info strong { color: var(--warning); }
.icon-btn { gap: .35rem; white-space: nowrap; }
.icon-btn .icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.icon-btn-danger { color: var(--danger); }
.icon-btn-danger:hover { background: var(--danger-soft); color: var(--danger); }
.text-danger { color: var(--danger) !important; }
/* Formulaire client. */
.customer-form-title { margin-bottom: .75rem; }
.customer-form { max-width: 760px; }
.customer-form-section { margin: 0 0 .5rem; }
.customer-form-section + .customer-form-section { padding-top: .85rem; border-top: 1px solid var(--border); }
.customer-form-section legend { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: .6rem; padding: 0; }
.customer-form-grid { display: grid; gap: 0 1rem; }
@media (min-width: 640px) { .customer-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.customer-form .required { color: var(--danger); }
.customer-form-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: .5rem; }
.debt-form { display: grid; grid-template-columns: 9rem auto minmax(0, 1fr) auto; gap: .5rem; align-items: center; }
.debt-form select { width: auto; }
.row-link:hover td { background: var(--bg); }
.orders-table td { vertical-align: middle; }
.orders-status { margin-bottom: .75rem; }
.orders-filter { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.orders-filter .orders-search { flex: 1 1 14rem; width: auto; }
.orders-filter-row { display: flex; gap: .5rem; align-items: center; }
.orders-count { margin-bottom: .5rem; }
/* Annulation de commande : motif en zone de texte qui s'agrandit. */
.cancel-form { display: grid; grid-template-columns: 1fr auto; gap: .35rem .6rem; align-items: start; margin-top: 1rem; padding-top: .85rem; border-top: 1px dashed var(--border); }
.cancel-form-label { grid-column: 1 / -1; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.cancel-form textarea { min-height: 44px; max-height: 160px; resize: none; overflow-y: auto; field-sizing: content; line-height: 1.4; transition: border-color .15s, box-shadow .15s; }
.cancel-form textarea:focus { border-color: var(--danger); outline: none; box-shadow: 0 0 0 3px var(--danger-soft); }
.cancel-form .btn { min-height: 44px; }
.orders-client { color: var(--text); text-decoration: none; font-weight: 600; }
.orders-client:hover { color: var(--brand); text-decoration: underline; }
.movements-toolbar { display: flex; flex-wrap: wrap; gap: .5rem .75rem; align-items: center; margin-bottom: .5rem; }
.movements-count { margin-right: auto; }
.movements-toolbar select { width: auto; min-height: 34px; padding: .2rem .5rem; }
.movements-table td { vertical-align: middle; }
.count-table td { vertical-align: middle; }
.count-table .count-input { width: 6rem; }
.movement-details { display: none; }
.movement-details dl { display: grid; grid-template-columns: auto 1fr; gap: .2rem .75rem; margin: 0; }
.movement-details dt { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); align-self: center; }
.movement-details dd { margin: 0; }
.stock-adjust-mode, .stock-adjust-type { width: auto; min-width: 0; }
.stock-adjust .stock-adjust-qty { width: 5.5rem; }

/* --- Barres de progression ------------------------------------------------- */
.meter { height: 8px; background: var(--border); border-radius: 999px; overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--brand); border-radius: 999px; }
.meter.is-warning > span { background: var(--accent); }
.meter.is-full > span { background: var(--danger); }

/* --- Listes de contrôle ---------------------------------------------------- */
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; gap: .6rem; align-items: center; padding: .45rem 0; border-bottom: 1px dashed var(--border); }
.checklist li:last-child { border-bottom: 0; }
.checklist .dot { width: 22px; height: 22px; flex: 0 0 22px; border-radius: 50%; border: 2px solid var(--border); display: inline-flex; align-items: center; justify-content: center; font-size: .75rem; }
.checklist .is-done .dot { background: var(--success); border-color: var(--success); color: #fff; }

/* --- Pages d'authentification --------------------------------------------- */
.auth { min-height: 100vh; display: flex; align-items: center; padding: 2rem 0; }
.auth .card { padding: 1.5rem; }

/* --- Site vitrine ---------------------------------------------------------- */
.hero { padding: 2.5rem 0 1.5rem; text-align: center; }
.hero h1 { font-size: 1.9rem; letter-spacing: -.03em; }
.hero p { color: var(--muted); font-size: 1.05rem; max-width: 640px; margin: 0 auto 1.25rem; }
@media (min-width: 640px) { .hero h1 { font-size: 2.6rem; } }
.price { font-size: 1.7rem; font-weight: 800; letter-spacing: -.02em; }
.price small { font-size: .9rem; font-weight: 500; color: var(--muted); }
.plan-features { list-style: none; padding: 0; margin: 1rem 0; font-size: .95rem; }
.plan-features li { padding: .3rem 0; border-bottom: 1px dashed var(--border); }
.plan-features li:last-child { border-bottom: 0; }

/* --- Pied de page ---------------------------------------------------------- */
.footer { padding: 2rem 0; color: var(--muted); font-size: .85rem; text-align: center; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem 1.2rem; margin-top: .6rem; }
.footer-links a { color: var(--muted); }

/* --- Pages légales (www) --------------------------------------------------- */
.legal .container { max-width: 760px; line-height: 1.65; }
.legal h2 { font-size: 1.15rem; margin: 2rem 0 .6rem; }
.legal ul, .legal ol { padding-left: 1.3rem; display: grid; gap: .35rem; }

/* --- Boutique (pages d'état) ----------------------------------------------- */
.shop-state { min-height: 100vh; display: flex; align-items: center; text-align: center; background: var(--surface); }
.shop-state .logo-placeholder { width: 72px; height: 72px; border-radius: 18px; background: var(--brand); color: #fff; font-size: 2rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 1rem; }

/* --- Formulaire des formules (admin) --------------------------------------- */
.feature-row { display: grid; gap: .5rem; padding: .75rem 0; border-bottom: 1px solid var(--border); }
@media (min-width: 760px) { .feature-row { grid-template-columns: 1.4fr .8fr 1fr 2fr; align-items: center; } }
.feature-row .field { margin: 0; }
.qr svg { width: 220px; height: 220px; }

/* --- Menu principal sur mobile : bouton hamburger + rideau animé ----------- */
.nav-toggle { display: none; }
@media (max-width: 760px) {
    .topbar .nav { width: 100%; margin-left: 0; padding-bottom: .4rem; }
    .topbar .nav a { white-space: nowrap; }

    .topbar-menu .container { flex-wrap: wrap; row-gap: 0; }
    .nav-toggle {
        display: inline-flex; align-items: center; gap: .5rem; margin-left: auto;
        padding: .45rem .8rem .45rem .65rem; border: 1px solid var(--border); border-radius: 999px;
        background: var(--surface); color: var(--text); font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer;
        transition: background .25s, border-color .25s, color .25s;
    }
    .nav-toggle:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
    .nav-toggle-bars { position: relative; width: 18px; height: 12px; }
    .nav-toggle-bars span { position: absolute; left: 0; width: 100%; height: 2px; border-radius: 2px; background: currentColor; transition: transform .35s cubic-bezier(.68, -.4, .27, 1.4), opacity .2s, top .35s; }
    .nav-toggle-bars span:nth-child(1) { top: 0; }
    .nav-toggle-bars span:nth-child(2) { top: 5px; }
    .nav-toggle-bars span:nth-child(3) { top: 10px; }
    .is-menu-open .nav-toggle { background: var(--brand); border-color: var(--brand); color: #fff; }
    .is-menu-open .nav-toggle-bars span:nth-child(1) { top: 5px; transform: rotate(45deg); }
    .is-menu-open .nav-toggle-bars span:nth-child(2) { opacity: 0; transform: scaleX(0); }
    .is-menu-open .nav-toggle-bars span:nth-child(3) { top: 5px; transform: rotate(-45deg); }

    /* Rideau : hauteur animée puis entrées en cascade. */
    .topbar-menu .nav {
        display: flex; flex-direction: column; flex-wrap: nowrap; flex-basis: 100%; gap: .1rem;
        max-height: 0; overflow: hidden; padding: 0; visibility: hidden;
        transition: max-height .4s cubic-bezier(.22, 1, .36, 1), padding .4s, visibility 0s .4s;
    }
    .topbar-menu.is-menu-open .nav {
        max-height: calc(100dvh - 60px); overflow-y: auto; overscroll-behavior: contain;
        padding: .5rem 0 1rem; visibility: visible;
        transition: max-height .55s cubic-bezier(.22, 1, .36, 1), padding .4s, visibility 0s;
    }
    .topbar-menu .nav > a, .topbar-menu .nav > .nav-group {
        opacity: 0; transform: translateX(-14px);
        transition: opacity .3s ease, transform .4s cubic-bezier(.22, 1, .36, 1);
    }
    .topbar-menu.is-menu-open .nav > a, .topbar-menu.is-menu-open .nav > .nav-group { opacity: 1; transform: none; }
    .topbar-menu.is-menu-open .nav > :nth-child(2) { transition-delay: .05s; }
    .topbar-menu.is-menu-open .nav > :nth-child(3) { transition-delay: .1s; }
    .topbar-menu.is-menu-open .nav > :nth-child(4) { transition-delay: .15s; }
    .topbar-menu.is-menu-open .nav > :nth-child(5) { transition-delay: .2s; }
    .topbar-menu.is-menu-open .nav > :nth-child(6) { transition-delay: .25s; }
    .topbar-menu.is-menu-open .nav > :nth-child(7) { transition-delay: .3s; }
    .topbar-menu.is-menu-open .nav > :nth-child(n+8) { transition-delay: .35s; }

    /* Entrées pleine largeur, barre d'accent sur l'élément actif. */
    .topbar-menu .nav > a, .topbar-menu .nav-group > summary {
        display: flex; align-items: center; gap: .4rem; padding: .8rem .9rem; border-radius: 10px;
        font-size: 1rem; color: var(--text); border-left: 3px solid transparent;
    }
    .topbar-menu .nav-group > summary::after { margin-left: auto; }
    .topbar-menu .nav > a.is-active, .topbar-menu .nav-group > summary.is-active { border-left-color: var(--brand); background: var(--brand-soft); color: var(--brand-strong); font-weight: 600; }
    .topbar-menu .nav-group[open] > summary { background: transparent; color: var(--brand-strong); }
    .topbar-menu .nav-group[open] > summary.is-active { background: var(--brand-soft); }
    .topbar-menu .nav-menu, .topbar-menu .nav > .nav-group:nth-last-child(-n+3) .nav-menu {
        position: static; min-width: 0; margin: .15rem 0 .4rem 1.1rem; padding: .2rem 0 .2rem .4rem;
        border: 0; border-left: 2px solid var(--brand-soft); border-radius: 0; box-shadow: none; background: transparent;
        animation: nav-sub-in .3s cubic-bezier(.22, 1, .36, 1);
    }
    .topbar-menu .nav-menu a, .topbar-menu .nav-soon { padding: .6rem .75rem; }
    .topbar-menu .nav > a[href$="/logout"] { margin-top: .5rem; border-top: 1px solid var(--border); border-radius: 0; color: var(--danger); }
}
@keyframes nav-sub-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
    .topbar-menu .nav, .topbar-menu .nav > *, .nav-toggle-bars span, .nav-menu { transition: none !important; animation: none !important; }
}

/* --- Caisse ---------------------------------------------------------------- */
.pos { display: grid; gap: 1rem; }
@media (min-width: 960px) { .pos { grid-template-columns: minmax(0, 1.4fr) minmax(320px, 1fr); align-items: start; } }
.pos-search { font-size: 1.1rem; }
.pos-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .5rem; margin-top: .75rem; max-height: 60vh; overflow-y: auto; }
.pos-item { display: flex; flex-direction: column; gap: .25rem; text-align: left; padding: .5rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); cursor: pointer; min-height: 120px; font: inherit; }
.pos-item:hover { border-color: var(--brand); }
.pos-item:disabled { opacity: .5; cursor: not-allowed; }
.pos-item img, .pos-item-ph { width: 100%; height: 70px; object-fit: cover; border-radius: 6px; background: var(--bg); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; }
.pos-item-label { font-weight: 600; font-size: .9rem; line-height: 1.2; }
.pos-item-meta { font-size: .8rem; color: var(--muted); }
.pos-item-meta .out { color: var(--danger); }
.pos-ticket { position: sticky; top: 64px; }
/* Ligne du panier : nom | prix | − qté + | ✕ sur une seule ligne. */
.pos-line { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: .5rem; padding: .45rem 0; border-bottom: 1px dashed var(--border); align-items: center; }
.pos-line-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.3; }
.pos-line-label br { display: none; }
.pos-line-label .small { margin-left: .35rem; }
.pos-line:has(.pos-line-edit) .pos-line-label .small { display: none; }
.pos-qty { order: 2; display: flex; gap: .3rem; align-items: center; }
.pos-qty strong { min-width: 1.2rem; text-align: center; }
.pos-line-edit { order: 1; display: flex; gap: .5rem; }
.pos-line-edit label { display: flex; align-items: center; gap: .35rem; color: var(--muted); }
.pos-line-edit input { min-height: 34px; width: 6rem; padding: .2rem .4rem; }
.pos-remove { order: 3; display: flex; align-items: center; justify-content: center; width: 28px; height: 34px; color: var(--danger); }
.pos-remove-text { display: none; }
.pos-payment { display: flex; gap: .4rem; margin-bottom: .4rem; align-items: center; }
.pos-payment select { width: auto; min-width: 8rem; }
.pos-payment input { min-height: 40px; }
.pos-totals .spread { padding: .2rem 0; }
.pos-totals .grand { font-size: 1.4rem; font-weight: 800; }
.pos-totals .is-due { color: var(--danger); font-weight: 700; }
.pos-remove-icon { font-size: 1rem; }
/* Téléphone avec indicatif pays. */
.phone-field { display: flex; align-items: stretch; min-width: 0; }
.pos-ticket .phone-field { grid-column: 1 / -1; }
.phone-field .phone-dial { flex: 0 0 auto; width: auto; max-width: 7.5rem; border-top-right-radius: 0; border-bottom-right-radius: 0; border-right: 0; background: var(--bg); padding-right: .3rem; }
.phone-field input { flex: 1 1 auto; min-width: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.pos-submit { margin-top: 1rem; min-height: 52px; font-size: 1.1rem; }

/* --- Tickets et graphiques ------------------------------------------------- */
.bars { display: flex; align-items: flex-end; gap: 3px; height: 160px; padding-top: .5rem; overflow-x: auto; }
.bars .bar { flex: 1 0 14px; background: var(--brand); border-radius: 4px 4px 0 0; min-height: 2px; position: relative; }
.bars .bar:hover { background: var(--brand-strong); }
/* Part des ventes en ligne livrées, en bas de chaque barre. */
.bars .bar { overflow: hidden; }
.bar-online { position: absolute; left: 0; right: 0; bottom: 0; background: #f59e0b; }
.bars-legend { display: flex; flex-wrap: wrap; gap: .3rem 1rem; margin: .5rem 0 0; font-size: .74rem; color: var(--muted); }
.bars-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.bars-legend i { width: .7rem; height: .7rem; border-radius: 3px; }
.bars-legend .is-counter { background: var(--brand); }
.bars-legend .is-online { background: #f59e0b; }

/* Statistiques : canal, répartition, annulations */
.stats-channels { margin-bottom: .75rem; }
.comments-tabs { margin: .25rem 0 1rem; }
/* Référencement Google : propositions présentées comme des résultats de recherche. */
.seo-head h1 { margin: 0; }
.seo-head form { margin: 0; }
.seo-intro { margin: .25rem 0 .9rem; }
.seo-proposal { margin-bottom: .9rem; }
.seo-results { display: grid; gap: .5rem; }
@media (min-width: 960px) { .seo-results { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.seo-result { padding: .6rem .75rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); min-width: 0; }
.seo-result-name { font-size: .66rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin-bottom: .15rem; }
.seo-result-title { color: #1a0dab; font-size: 1rem; line-height: 1.3; overflow-wrap: anywhere; }
.seo-result-desc { margin-top: .15rem; color: #4d5156; font-size: .84rem; line-height: 1.45; overflow-wrap: anywhere; }
.seo-result-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; margin-top: .4rem; }
.seo-count { display: inline-block; padding: .05rem .4rem; border-radius: 999px; font-size: .66rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.seo-count.is-ok { background: var(--success-soft); color: var(--success); }
.seo-count.is-over { background: var(--warning-soft); color: var(--warning); }
.seo-old { min-width: 0; font-size: .72rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Décision toujours à portée de main en bas de l'écran. */
.seo-decision { position: sticky; bottom: 0; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem .75rem; margin: .75rem -1.1rem -1.1rem; padding: .6rem 1.1rem; border-top: 1px solid var(--border); border-radius: 0 0 12px 12px; background: rgb(255 255 255 / .96); backdrop-filter: blur(6px); }
.seo-decision p { margin: 0; flex: 1 1 14rem; }
.seo-decision-actions { display: flex; gap: .4rem; }
.seo-decision-actions form { margin: 0; }
.seo-history-row { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .4rem 0; font-size: .85rem; }
.seo-history-row + .seo-history-row { border-top: 1px solid var(--border); }
.seo-history-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 760px) {
    .page-app .seo-head { flex-wrap: nowrap; }
    .page-app .seo-head h1 { font-size: 1.1rem; }
    .page-app .seo-head .btn { min-height: 32px; padding: .2rem .6rem; font-size: .74rem; border-radius: 8px; white-space: nowrap; }
    .page-app .seo-intro { font-size: .72rem; line-height: 1.4; margin-bottom: .6rem; }
    .page-app .seo-proposal { padding: .6rem .65rem; margin-bottom: .6rem; }
    .page-app .seo-proposal .card-title { font-size: .6rem; }
    .page-app .seo-results { gap: .4rem; }
    .page-app .seo-result { padding: .45rem .55rem; border-radius: 8px; }
    .page-app .seo-result-name { font-size: .58rem; }
    .page-app .seo-result-title { font-size: .86rem; }
    .page-app .seo-result-desc { font-size: .74rem; line-height: 1.4; }
    .page-app .seo-count { font-size: .6rem; }
    .page-app .seo-decision { bottom: calc(64px + env(safe-area-inset-bottom)); margin: .6rem -.65rem -.6rem; padding: .5rem .65rem; }
    .page-app .seo-decision p { font-size: .66rem; flex-basis: 100%; }
    .page-app .seo-decision-actions { width: 100%; }
    .page-app .seo-decision-actions form { flex: 1; }
    .page-app .seo-decision-actions form:last-child { flex: 2; }
    .page-app .seo-decision-actions .btn { width: 100%; min-height: 38px; font-size: .82rem; border-radius: 8px; }
    .page-app .seo-history { padding: .6rem .7rem; }
    .page-app .seo-history-row { font-size: .74rem; }
    .page-app .seo-history-row .badge { font-size: .6rem; }
}

/* Coach des vendeurs : bilan d'équipe puis une carte par vendeur. */
.coach-head h1 { margin: 0; }
.coach-head form { margin: 0; }
.coach-intro { margin: .25rem 0 .9rem; }
.coach-summary { margin-bottom: .9rem; }
.coach-summary p { margin: 0; }
.coach-sellers { align-items: start; }
.coach-toolbar { display: flex; align-items: center; gap: .9rem; margin-bottom: .45rem; }
.coach-toolbar .small:first-child { margin-right: auto; }
/* Carte vendeur repliable : l'en-tête (nom, objectif principal, chevron) reste visible. */
.coach-seller-head { display: flex; align-items: center; gap: .55rem; cursor: pointer; list-style: none; }
.coach-seller-head::-webkit-details-marker, .coach-history-item summary::-webkit-details-marker { display: none; }
.coach-seller[open] .coach-seller-head { margin-bottom: .45rem; }
.coach-seller-head h3 { margin: 0; font-size: 1.05rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coach-seller-goal { flex: none; font-size: .78rem; font-weight: 700; color: var(--brand-strong); white-space: nowrap; }
.coach-seller[open] .coach-seller-goal { display: none; }
.coach-chevron { flex: none; width: .55rem; height: .55rem; margin: 0 .2rem; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg) translateY(-2px); transition: transform .15s ease; }
details[open] > summary .coach-chevron { transform: rotate(-135deg) translateX(-2px); }
.coach-history { margin-top: 1rem; }
.coach-history-item { border-bottom: 1px solid var(--border); }
.coach-history-item:last-of-type { border-bottom: 0; }
.coach-history-item summary { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .5rem 0; cursor: pointer; list-style: none; font-size: .88rem; font-weight: 600; }
.coach-history-item p { margin: 0 0 .4rem; font-size: .84rem; color: var(--muted); }
.coach-history-item .coach-goal { font-size: .8rem; }
.coach-history-item[open] { padding-bottom: .5rem; }
.coach-history .pagination { margin-top: .6rem; }
.coach-avatar { display: inline-grid; place-items: center; flex: none; width: 2.1rem; height: 2.1rem; border-radius: 50%; background: var(--brand-soft); color: var(--brand-strong); font-size: .78rem; font-weight: 800; }
.coach-message { margin: 0 0 .6rem; font-size: .9rem; line-height: 1.45; }
.coach-block, .coach-goals { margin-top: .5rem; padding: .5rem .65rem; border-radius: 10px; background: var(--bg); }
.coach-block h4, .coach-goals h4 { margin: 0 0 .25rem; font-size: .66rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.coach-block ul { margin: 0; padding: 0; list-style: none; font-size: .85rem; }
.coach-block li { position: relative; padding-left: 1.1rem; line-height: 1.4; }
.coach-block li + li { margin-top: .2rem; }
.coach-block li::before { position: absolute; left: 0; font-weight: 800; }
.coach-block.is-good li::before { content: "✓"; color: var(--success); }
.coach-block.is-work li::before { content: "→"; color: var(--warning); }
.coach-goals { background: var(--brand-soft); }
.coach-goals h4 { color: var(--brand-strong); }
.coach-goal { display: flex; justify-content: space-between; align-items: baseline; gap: .6rem; padding: .25rem 0; font-size: .85rem; }
.coach-goal + .coach-goal { border-top: 1px dashed rgb(0 0 0 / .08); }
.coach-goal strong { white-space: nowrap; color: var(--brand-strong); }
.coach-history summary { cursor: pointer; }
@media (max-width: 760px) {
    .page-app .coach-head { flex-wrap: nowrap; }
    .page-app .coach-head h1 { font-size: 1.15rem; }
    .page-app .coach-head .btn { min-height: 32px; padding: .2rem .65rem; font-size: .76rem; border-radius: 8px; white-space: nowrap; }
    .page-app .coach-intro { font-size: .72rem; line-height: 1.4; margin-bottom: .6rem; }
    .page-app .coach-summary { padding: .6rem .7rem; margin-bottom: .6rem; }
    .page-app .coach-summary p { font-size: .84rem; line-height: 1.4; }
    .page-app .coach-sellers { gap: .55rem; }
    .page-app .coach-seller { padding: .65rem .7rem; }
    .page-app .coach-seller-head h3 { font-size: .95rem; }
    .page-app .coach-avatar { width: 1.85rem; height: 1.85rem; font-size: .7rem; }
    .page-app .coach-message { font-size: .8rem; margin-bottom: .45rem; }
    .page-app .coach-block, .page-app .coach-goals { margin-top: .4rem; padding: .4rem .55rem; border-radius: 8px; }
    .page-app .coach-block h4, .page-app .coach-goals h4 { font-size: .58rem; }
    .page-app .coach-block ul, .page-app .coach-goal { font-size: .76rem; }
    .page-app .coach-toolbar .small { font-size: .74rem; }
    .page-app .coach-seller-goal { font-size: .72rem; }
    .page-app .coach-history { padding: .6rem .7rem; margin-top: .6rem; }
    .page-app .coach-history-item summary { font-size: .8rem; padding: .45rem 0; }
    .page-app .coach-history-item p { font-size: .76rem; }
    .page-app .coach-history .btn-small { min-height: 30px; font-size: .74rem; }
}
/* Commentaires : une carte par commentaire, réponse lisible même avec un long lien. */
.comment-card { margin-bottom: .75rem; }
.comment-card.is-escalated { border-left: 3px solid var(--danger); }
.comment-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; }
.comment-author { min-width: 0; line-height: 1.35; }
.comment-author .small { white-space: nowrap; }
.comment-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .25rem; flex: none; max-width: 50%; }
.comment-text { margin: .45rem 0; overflow-wrap: anywhere; }
.comment-reply { margin: 0; padding: .45rem .65rem; border-left: 3px solid var(--brand); border-radius: 0 8px 8px 0; background: var(--bg); color: var(--muted); font-size: .85rem; overflow-wrap: anywhere; white-space: pre-line; }
.comment-reply::before { content: "↳ "; color: var(--brand); font-weight: 700; }
.comment-form textarea { width: 100%; min-height: 64px; resize: vertical; }
.comment-actions { display: flex; align-items: center; gap: .9rem; margin-top: .45rem; }
.comment-actions form { margin: 0; }
.comment-actions .btn { margin-left: auto; }
@media (max-width: 760px) {
    .page-app .comment-card { margin-bottom: .55rem; padding: .65rem .7rem; }
    .page-app .comment-head { font-size: .86rem; }
    .page-app .comment-author .small { font-size: .7rem; }
    .page-app .comment-badges .badge { font-size: .6rem; padding: .05rem .4rem; }
    .page-app .comment-text { margin: .35rem 0; font-size: .86rem; line-height: 1.4; }
    .page-app .comment-reply { font-size: .76rem; padding: .35rem .55rem; }
    .page-app .comment-form textarea { min-height: 52px; padding: .35rem .55rem; font-size: 14px; border-radius: 8px; }
    .page-app .comment-actions .btn-link { font-size: .76rem; }
    .page-app .comment-actions .btn { min-height: 32px; padding: .2rem .8rem; font-size: .78rem; border-radius: 8px; }
}

/* Onglets qui tiennent sur une seule ligne (statistiques, commentaires) :
   libellé complet sur ordinateur, libellé court sur mobile, sans défilement caché. */
.tabs-fit .tab-short { display: none; }
@media (max-width: 640px) {
    .tasks-tabs.tabs-fit { overflow: visible; gap: .2rem; padding: .2rem; }
    .tabs-fit .tasks-tab { flex: 1 1 0; min-width: 0; padding: .45rem .15rem; font-size: .74rem; overflow: hidden; text-overflow: ellipsis; }
    .tabs-fit .tab-short { display: inline; }
    /* Libellé complet gardé pour les lecteurs d'écran. */
    .tabs-fit .tab-long { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .comments-tabs { margin-bottom: .75rem; }
}
.stats-split { margin-top: .75rem; padding: .8rem .95rem; }
.stats-split-bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--bg); }
.stats-split-bar span { display: block; height: 100%; }
.stats-split .is-counter { background: var(--brand); }
.stats-split .is-shop { background: #f59e0b; }
.stats-split .is-wa { background: #25d366; }
.stats-split .is-phone { background: #6366f1; }
.stats-split-legend { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; margin: .65rem 0 0; padding: 0; }
.stats-split-legend li { display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .35rem; font-size: .8rem; color: var(--muted); min-width: 0; }
.stats-split-legend strong { color: var(--text); white-space: nowrap; }
.stats-split-legend small { flex-basis: 100%; padding-left: 1.05rem; font-size: .7rem; }
.stats-split-legend .dot { width: .65rem; height: .65rem; flex: none; border-radius: 50%; }
.stats-cancel-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.stats-cancel-kpis div { display: flex; flex-direction: column; padding: .6rem .7rem; background: var(--bg); border-radius: 12px; min-width: 0; }
.stats-cancel-kpis strong { font-size: 1.15rem; font-weight: 800; overflow-wrap: anywhere; }
.stats-cancel-kpis span { font-size: .7rem; color: var(--muted); }
.stats-cancel-kpis .is-bad strong { color: var(--danger); }
.stats-cancel-reasons { list-style: none; margin: .75rem 0 0; padding: 0; }
.stats-cancel-reasons li { display: flex; justify-content: space-between; gap: .75rem; padding: .4rem 0; font-size: .84rem; }
.stats-cancel-reasons li + li { border-top: 1px solid var(--border); }
.stats-cancel-reasons span { min-width: 0; overflow-wrap: anywhere; }
.stats-cancel-note { margin: .6rem 0 0; }
.dash-split { overflow-wrap: anywhere; }
.dash-stat-unit { font-size: .45em; font-weight: 600; color: var(--muted); }
@media (max-width: 640px) {
    .stats-split { padding: .65rem .7rem; }
    .stats-split-legend { grid-template-columns: minmax(0, 1fr); gap: .3rem; }
    .stats-split-legend small { flex-basis: auto; padding-left: 0; }
    .stats-cancel-kpis { gap: .4rem; }
    .stats-cancel-kpis div { padding: .5rem .55rem; }
    .stats-cancel-kpis strong { font-size: .95rem; }
    .stats-cancel-kpis span { font-size: .62rem; }
}
.bars-labels { display: flex; gap: 3px; font-size: .65rem; color: var(--muted); overflow: hidden; }
.bars-labels span { flex: 1 0 14px; text-align: center; white-space: nowrap; overflow: hidden; }
.delta-up { color: var(--success); font-weight: 700; }
.delta-down { color: var(--danger); font-weight: 700; }
.thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; background: var(--bg); }
/* Déclinaisons d'un produit : en-tête (numéro + supprimer) puis champs en grille. */
.variant-row { padding: .75rem 0; border-bottom: 1px solid var(--border); }
.variant-row:last-child { border-bottom: 0; }
.variant-row-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .45rem; }
.variant-row-title { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.variant-row > div:not(.variant-row-head) { display: grid; gap: .5rem .75rem; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; }
@media (min-width: 760px) { .variant-row > div:not(.variant-row-head) { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.variant-row .field { margin: 0; }
.variant-row .field:first-of-type { grid-column: 1 / -1; }
@media (min-width: 760px) { .variant-row .field:first-of-type { grid-column: span 2; } }
.variant-row.is-retired { opacity: .6; }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }
/* Formulaire produit. */
.product-form-pair { display: grid; gap: 0 .75rem; }
@media (min-width: 640px) { .product-form-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.product-form-checks { display: flex; flex-wrap: wrap; gap: 0 1.25rem; }
.field-label { display: block; font-weight: 600; margin-bottom: .3rem; }
.product-form-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1rem; }
.product-photos { display: flex; flex-wrap: wrap; gap: .6rem; }
.product-photo { text-align: center; }
.product-photo img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; display: block; }

/* --- Conversations WhatsApp ------------------------------------------------- */
.wa-thread { display: flex; flex-direction: column; gap: .45rem; max-height: 65vh; overflow-y: auto; padding: .25rem; }
.wa-msg { max-width: 80%; padding: .45rem .65rem .35rem; border-radius: 12px; background: var(--bg); border: 1px solid var(--border); }
.wa-in { align-self: flex-start; border-top-left-radius: 4px; }
.wa-out { align-self: flex-end; background: #dcfce7; border-color: #bbf7d0; border-top-right-radius: 4px; }
.wa-human { background: #e0f2fe; border-color: #bae6fd; }
.wa-meta { font-size: .68rem; font-weight: 700; color: var(--muted); margin-bottom: .1rem; }
.wa-text { white-space: normal; overflow-wrap: anywhere; line-height: 1.45; }
.wa-image { display: block; max-width: min(240px, 100%); margin-bottom: .3rem; border-radius: 8px; }
.wa-foot { display: flex; justify-content: flex-end; align-items: center; gap: .3rem; margin-top: .15rem; font-size: .66rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.wa-tick { font-weight: 800; letter-spacing: -.12em; }
.wa-tick.is-read { color: #34b7f1; }
.wa-tick.is-failed { color: var(--danger); letter-spacing: 0; }
.wa-empty { text-align: center; margin: 2rem 0; }

/* --- Salle des agents : réunions ------------------------------------------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.meeting-room { max-width: 820px; }
.meeting-back { margin-bottom: .75rem; }
.meeting-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1.25rem; padding: 1rem 1.15rem; background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--brand); border-radius: var(--radius); box-shadow: var(--shadow); }
.meeting-head-main { min-width: 0; }
.meeting-head h1 { margin: 0 0 .3rem; }
.meeting-head-meta { display: flex; flex-wrap: wrap; gap: .1rem .5rem; margin: 0; font-size: .84rem; color: var(--muted); }
.meeting-head-meta span + span::before { content: "·"; margin-right: .5rem; }
.meeting-head:has(.meeting-status.is-live) { border-top-color: var(--danger); }
.meeting-status { display: inline-flex; align-items: center; gap: .4rem; padding: .25rem .7rem; border-radius: 999px; background: var(--border); color: var(--muted); font-size: .8rem; font-weight: 700; white-space: nowrap; }
.meeting-status.is-live { background: var(--danger-soft); color: var(--danger); }
.meeting-status.is-live::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: currentColor; animation: meeting-pulse 1.4s ease-in-out infinite; }
.meeting-thread { display: flex; flex-direction: column; gap: 1rem; }
.meeting-notice { align-self: center; max-width: 90%; text-align: center; font-size: .82rem; color: var(--muted); background: var(--surface); border: 1px dashed var(--border); border-radius: 999px; padding: .3rem .9rem; }
/* Commerçant sur mobile : l'avis d'ouverture (convocation, présents, président) est masqué. */
@media (max-width: 640px) { .page-app .meeting-notice.is-opening { display: none; } }
.meeting-msg { display: flex; gap: .65rem; align-items: flex-start; animation: meeting-in .35s cubic-bezier(.22, 1, .36, 1); }
.meeting-avatar { flex: 0 0 auto; width: 2.4rem; height: 2.4rem; border-radius: 50%; display: grid; place-items: center; font-size: .72rem; font-weight: 800; letter-spacing: .02em; color: #fff; background: var(--brand); box-shadow: var(--shadow); }
.meeting-msg[data-agent="agent.whatsapp_seller"] .meeting-avatar { background: #15803d; }
.meeting-msg[data-agent="agent.sponsoring"] .meeting-avatar { background: #7c3aed; }
.meeting-msg[data-agent="agent.community_manager"] .meeting-avatar { background: #db2777; }
.meeting-msg[data-agent="agent.graphic_designer"] .meeting-avatar { background: #ea580c; }
.meeting-msg[data-agent="agent.customer_reminder"] .meeting-avatar { background: #0369a1; }
.meeting-msg[data-agent="agent.pricing"] .meeting-avatar { background: #b45309; }
.meeting-msg[data-agent="agent.sales_coach"] .meeting-avatar { background: #4d7c0f; }
.meeting-msg[data-agent="agent.seo"] .meeting-avatar { background: #475569; }
.meeting-bubble { flex: 1 1 auto; min-width: 0; max-width: 640px; background: var(--surface); border: 1px solid var(--border); border-radius: 4px 16px 16px 16px; padding: .75rem .95rem; box-shadow: var(--shadow); }
.meeting-bubble p { margin: .35rem 0 0; line-height: 1.55; overflow-wrap: anywhere; }
.meeting-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .5rem; font-size: .85rem; }
.meeting-meta strong { font-size: .9rem; }
.meeting-meta .muted { font-size: .75rem; font-variant-numeric: tabular-nums; }
.meeting-proposal { margin-top: .65rem !important; padding: .55rem .7rem; border-left: 3px solid var(--accent); background: var(--warning-soft); border-radius: 0 10px 10px 0; font-size: .92rem; font-weight: 600; line-height: 1.45; }
.meeting-proposal span { display: block; margin-bottom: .1rem; font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--warning); }
.meeting-msg.is-closing .meeting-bubble { border-color: var(--brand); background: var(--brand-soft); }
.meeting-msg.is-human { flex-direction: row-reverse; }
.meeting-msg.is-human .meeting-bubble { background: var(--brand); color: #fff; border-color: var(--brand); border-radius: 14px 4px 14px 14px; }
.meeting-msg.is-human .meeting-meta .muted { color: rgb(255 255 255 / .75); }
.meeting-msg.is-human .meeting-avatar { background: var(--text); }
.meeting-msg.is-admin .meeting-bubble { background: #1e293b; border-color: #1e293b; }
.meeting-msg.is-admin .meeting-avatar { background: var(--accent); font-size: .6rem; }
.meeting-typing { color: var(--muted); font-style: italic; font-size: .92rem; margin-top: .25rem; }
.meeting-typing .dots { display: inline-flex; gap: 3px; margin-left: .35rem; vertical-align: middle; }
.meeting-typing .dots i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: meeting-dot 1.2s infinite ease-in-out; }
.meeting-typing .dots i:nth-child(2) { animation-delay: .15s; }
.meeting-typing .dots i:nth-child(3) { animation-delay: .3s; }
.meeting-plan { margin-top: .5rem; padding: 1.1rem 1.15rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--brand); box-shadow: 0 0 0 3px var(--brand-soft), var(--shadow); animation: meeting-in .4s ease; }
.meeting-plan h2 { margin: 0 0 .75rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--brand-strong); }
.meeting-action { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .75rem; align-items: start; padding: .7rem 0; border-top: 1px solid var(--border); }
.meeting-action:first-of-type { border-top: 0; padding-top: 0; }
.meeting-action-num { display: grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--brand); color: #fff; font-size: .78rem; font-weight: 800; }
.meeting-action-head { display: flex; flex-wrap: wrap; gap: .3rem .6rem; align-items: center; justify-content: space-between; }
.meeting-action-head strong { line-height: 1.35; }
.meeting-action-agent { margin-top: .1rem; font-size: .78rem; font-weight: 600; color: var(--muted); }
.meeting-action-detail { margin: .3rem 0 0; font-size: .88rem; line-height: 1.5; }

/* Après la réunion : accès aux actions à valider */
.meeting-after { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-top: 1rem; padding: .85rem 1rem; border-radius: var(--radius); background: var(--brand); color: #fff; text-decoration: none; box-shadow: var(--shadow); }
.meeting-after[hidden] { display: none; }
.meeting-after:hover { background: var(--brand-strong); color: #fff; }
.meeting-after:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.meeting-after > span:first-child { display: flex; flex-direction: column; min-width: 0; }
.meeting-after-sub { font-size: .8rem; opacity: .85; }
.meeting-after-arrow { font-size: 1.6rem; line-height: 1; }
.meeting-closed { margin: 1rem 0 0; padding: .7rem .9rem; border: 1px dashed var(--border); border-radius: 12px; text-align: center; font-size: .84rem; color: var(--muted); }

/* Zone de saisie, collée en bas de l'écran */
.meeting-compose { position: sticky; bottom: 0; z-index: 5; display: flex; gap: .5rem; align-items: flex-end; margin-top: 1rem; padding: .6rem; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 -4px 18px rgb(0 0 0 / .06), var(--shadow); }
.meeting-compose:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.meeting-compose textarea, .page-app .meeting-compose textarea { flex: 1; min-width: 0; min-height: 44px; max-height: 160px; padding: .6rem .7rem; border: 0; background: transparent; box-shadow: none; outline: none; resize: none; field-sizing: content; font: inherit; font-size: 16px; line-height: 1.4; }
.meeting-send { flex: none; display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; border-radius: 12px; }
.meeting-send svg { width: 18px; height: 18px; fill: currentColor; }
.meeting-hero .btn { margin-right: .5rem; }
@keyframes meeting-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes meeting-dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@keyframes meeting-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) {
    .meeting-msg, .meeting-plan, .meeting-typing .dots i, .meeting-status.is-live::before { animation: none; }
}
@media (max-width: 640px) {
    .meeting-back { margin-bottom: .5rem; }
    .meeting-head { gap: .6rem; margin-bottom: .9rem; padding: .75rem .85rem; }
    .page-app .meeting-head h1 { font-size: 1.15rem; margin-bottom: .2rem; }
    .meeting-head-meta { font-size: .74rem; }
    .meeting-status { padding: .2rem .55rem; font-size: .7rem; }
    .meeting-thread { gap: .75rem; }
    .meeting-msg { gap: .5rem; }
    .meeting-avatar { width: 2rem; height: 2rem; font-size: .62rem; }
    .meeting-bubble { padding: .6rem .7rem; border-radius: 4px 14px 14px 14px; }
    .meeting-bubble p { font-size: .88rem; line-height: 1.5; }
    .meeting-meta strong { font-size: .84rem; }
    .meeting-proposal { padding: .45rem .6rem; font-size: .85rem; }
    .meeting-proposal span { font-size: .6rem; }
    .meeting-notice { font-size: .74rem; }
    .meeting-plan { padding: .85rem .85rem; }
    .meeting-action { gap: .55rem; padding: .6rem 0; }
    .meeting-action-num { width: 1.4rem; height: 1.4rem; font-size: .7rem; }
    .meeting-action-head strong { font-size: .9rem; }
    .meeting-action-detail { font-size: .82rem; }
    .meeting-after { padding: .7rem .85rem; }
    .meeting-after strong { font-size: .92rem; }
    .meeting-after-sub { font-size: .74rem; }
    /* Au-dessus de la barre d'onglets du bas. */
    .page-app .meeting-compose { bottom: calc(66px + env(safe-area-inset-bottom)); padding: .4rem; border-radius: 14px; gap: .35rem; }
    .page-app .meeting-compose textarea { min-height: 40px; padding: .5rem .55rem; }
    .meeting-send { min-height: 40px; width: 40px; padding: 0; justify-content: center; }
    .meeting-send span { display: none; }
}

/* --- Espace commerçant : composants de page --------------------------------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: 1rem; }
.page-head h1 { margin: 0; }
.page-head > .btn { flex-shrink: 0; white-space: nowrap; }
.page-sub { margin: .1rem 0 0; color: var(--muted); font-size: .875rem; }
.section { margin-top: 1rem; }
.kpi { text-decoration: none; color: inherit; display: block; }
.kpi:hover { color: inherit; border-color: var(--brand); }
.flash-compact { font-size: .925rem; }
.summary { display: grid; gap: .75rem 1.25rem; margin: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 960px) { .summary { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.summary dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.summary dd { margin: .15rem 0 0; display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; font-weight: 600; }
.summary-host { font-weight: 400; word-break: break-all; font-size: .8rem; }
.quota { margin-bottom: .8rem; }
.fold { margin-top: .5rem; }
.fold > summary { cursor: pointer; color: var(--muted); font-size: .875rem; font-weight: 600; padding: .35rem 0; }
.fold-card > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: .5rem; cursor: pointer; }
.fold-card > summary::-webkit-details-marker { display: none; }
.fold-card > summary h2 { margin: 0; }
.fold-card > summary::after { content: ""; width: .5em; height: .5em; margin-left: auto; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .2s; flex: 0 0 auto; }
.fold-card[open] > summary { margin-bottom: .6rem; }
.fold-card[open] > summary::after { transform: rotate(-135deg); }
.topbar-tenant { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }

/* Barre d'onglets : mobile seulement. */
.tabbar { display: none; }

@media (max-width: 640px) {
    /* En-tête plus compact ; le menu complet s'ouvre depuis la barre d'onglets. */
    .topbar-menu .container { min-height: 50px; gap: .5rem; }
    .topbar-tenant { max-width: 52vw; font-size: .72rem; }
    .topbar-menu:has(.tabbar) .nav-toggle { display: none; }

    /* Menu complet : panneau qui glisse depuis le bas, au-dessus de la barre d'onglets. */
    html.nav-locked { overflow: hidden; }
    .topbar-menu:has(.tabbar)::after {
        content: ""; position: fixed; inset: 0; z-index: 25; background: rgb(15 23 42 / .45);
        opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility 0s .3s;
    }
    .topbar-menu:has(.tabbar).is-menu-open::after { opacity: 1; visibility: visible; transition: opacity .3s ease, visibility 0s; }
    .topbar-menu:has(.tabbar) .nav,
    .topbar-menu:has(.tabbar).is-menu-open .nav {
        position: fixed; left: 0; right: 0; bottom: calc(64px + env(safe-area-inset-bottom)); z-index: 28;
        display: flex; flex-direction: column; gap: 0; width: auto; margin: 0;
        max-height: min(78dvh, calc(100dvh - 64px - 3rem)); overflow-y: auto; overscroll-behavior: contain;
        padding: 1.6rem .85rem .85rem; background: var(--surface);
        border-radius: 22px 22px 0 0; box-shadow: 0 -12px 40px rgb(0 0 0 / .18);
        transform: translateY(calc(100% + 80px)); visibility: hidden;
        transition: transform .4s cubic-bezier(.22, 1, .36, 1), visibility 0s .4s;
    }
    .topbar-menu:has(.tabbar).is-menu-open .nav { transform: none; visibility: visible; transition: transform .45s cubic-bezier(.22, 1, .36, 1), visibility 0s; }
    /* Poignée du panneau. */
    .topbar-menu:has(.tabbar) .nav::before { content: ""; position: absolute; top: .6rem; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 999px; background: var(--border); }
    .topbar-menu:has(.tabbar) .nav > a, .topbar-menu:has(.tabbar) .nav > .nav-group { opacity: 1; transform: none; transition: none; }

    /* Lignes : texte à gauche, chevron à droite, séparateurs fins. */
    .topbar-menu:has(.tabbar) .nav > a,
    .topbar-menu:has(.tabbar) .nav-group > summary {
        justify-content: flex-start; text-align: left; gap: .5rem; min-height: 50px; padding: .7rem .8rem;
        border: 0; border-radius: 12px; font-size: .98rem; font-weight: 600; color: var(--text);
    }
    .topbar-menu:has(.tabbar) .nav > a + a,
    .topbar-menu:has(.tabbar) .nav > a + .nav-group,
    .topbar-menu:has(.tabbar) .nav > .nav-group + a,
    .topbar-menu:has(.tabbar) .nav > .nav-group + .nav-group { border-top: 1px solid var(--border); border-radius: 0; }
    .topbar-menu:has(.tabbar) .nav-group > summary::after { margin-left: auto; color: var(--muted); }
    .topbar-menu:has(.tabbar) .nav > a.is-active,
    .topbar-menu:has(.tabbar) .nav-group > summary.is-active { color: var(--brand-strong); background: transparent; }
    .topbar-menu:has(.tabbar) .nav > a.is-active::before,
    .topbar-menu:has(.tabbar) .nav-group > summary.is-active::before { content: ""; width: .45rem; height: .45rem; flex: none; border-radius: 50%; background: var(--brand); }
    .topbar-menu:has(.tabbar) .nav-group[open] > summary { color: var(--brand-strong); background: var(--brand-soft); border-radius: 12px; }
    .topbar-menu:has(.tabbar) .nav-group[open] { padding-bottom: .4rem; }

    /* Sous-menu : tuiles sur deux colonnes, intertitres pleine largeur. */
    .topbar-menu:has(.tabbar) .nav-menu,
    .topbar-menu:has(.tabbar) .nav > .nav-group:nth-last-child(-n+3) .nav-menu {
        display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem;
        margin: .45rem 0 0; padding: 0; border: 0;
    }
    .topbar-menu:has(.tabbar) .nav-heading { grid-column: 1 / -1; padding: .45rem .2rem .05rem; font-size: .64rem; }
    .topbar-menu:has(.tabbar) .nav-menu a,
    .topbar-menu:has(.tabbar) .nav-soon {
        display: flex; align-items: center; justify-content: space-between; gap: .3rem; min-height: 46px; padding: .55rem .7rem !important;
        border: 1px solid var(--border); border-radius: 12px; background: var(--bg);
        font-size: .86rem; font-weight: 600; white-space: normal; line-height: 1.25;
    }
    .topbar-menu:has(.tabbar) .nav-menu a:hover { border-color: var(--brand); }
    .topbar-menu:has(.tabbar) .nav-menu a.is-active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-strong); }
    .topbar-menu:has(.tabbar) .nav-soon { opacity: .65; }
    .topbar-menu:has(.tabbar) .nav-menu .badge, .topbar-menu:has(.tabbar) .nav-soon .badge { font-size: .62rem; padding: .05rem .4rem; }

    /* Déconnexion : bouton discret en bas du panneau. */
    .topbar-menu:has(.tabbar) .nav > a[href$="/logout"] {
        justify-content: center; margin-top: .75rem; min-height: 44px; border: 1px solid var(--danger-soft) !important;
        border-radius: 12px !important; background: var(--danger-soft); color: var(--danger); font-size: .9rem;
    }

    .tabbar {
        display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
        padding: .3rem .25rem calc(.3rem + env(safe-area-inset-bottom));
        background: rgb(255 255 255 / .96); backdrop-filter: blur(8px);
        border-top: 1px solid var(--border); box-shadow: 0 -4px 16px rgb(0 0 0 / .06);
    }
    .tabbar a, .tabbar button {
        position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem;
        min-height: 52px; padding: .2rem 0; border: 0; border-radius: 12px; background: none;
        color: var(--muted); font: inherit; font-size: .68rem; font-weight: 600; text-decoration: none; cursor: pointer;
    }
    .tabbar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
    .tabbar .is-active, .is-menu-open .tabbar button { color: var(--brand-strong); }
    .tabbar .is-active::before { content: ""; position: absolute; top: -.3rem; width: 26px; height: 3px; border-radius: 0 0 3px 3px; background: var(--brand); }
    .tabbar-badge { position: absolute; top: .2rem; left: calc(50% + 4px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--danger); color: #fff; font-size: .62rem; line-height: 17px; text-align: center; font-weight: 700; }

    /* Contenu : marges et espacements réduits, typographie resserrée. */
    .page-app { padding: .75rem 0 calc(84px + env(safe-area-inset-bottom)); font-size: .94rem; line-height: 1.45; }
    .page-app .container { padding: 0 .75rem; }
    .page-app h1 { font-size: 1.3rem; letter-spacing: -.01em; margin-bottom: .5rem; }
    .page-app h2 { font-size: 1.02rem; margin-bottom: .5rem; }
    .page-app p { margin-bottom: .65rem; }
    .page-app .page-head { margin-bottom: .65rem; }
    .page-app .page-head .btn-small { min-height: 34px; padding: .25rem .6rem; font-size: .8rem; }
    .page-app .section { margin-top: .65rem; }
    .page-app .grid { gap: .6rem; }
    .page-app .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .page-app .card { padding: .8rem .85rem; border-radius: 12px; }
    .page-app .card-title { font-size: .68rem; margin-bottom: .2rem; }
    .page-app .stat { font-size: 1.25rem; line-height: 1.2; }
    .page-app .kpi .small { font-size: .74rem; line-height: 1.3; display: block; margin-top: .15rem; }
    .page-app .flash { padding: .55rem .75rem; margin-bottom: .65rem; font-size: .88rem; border-radius: 10px; }
    .page-app .spread { gap: .5rem; }
    .page-app .field { margin-bottom: .75rem; }
    .page-app .field label { font-size: .9rem; margin-bottom: .2rem; }
    .page-app input[type=text], .page-app input[type=email], .page-app input[type=password], .page-app input[type=tel],
    .page-app input[type=number], .page-app input[type=search], .page-app select, .page-app textarea { min-height: 42px; padding: .45rem .65rem; font-size: 16px; }
    .page-app .btn { min-height: 42px; padding: .45rem .85rem; }
    .page-app .btn-small { min-height: 34px; }
    .page-app table { font-size: .875rem; }
    .page-app th, .page-app td { padding: .45rem .35rem; }
    .page-app .table-wrap { margin: 0 -.85rem; padding: 0 .85rem; }
    .page-app .checklist li { padding: .35rem 0; gap: .5rem; }
    .page-app .plan-features { margin: .25rem 0; font-size: .9rem; }
    .page-app .summary { gap: .6rem .9rem; }
    .page-app .quota { margin-bottom: .6rem; }
    /* Les marges inline des gabarits existants sont ramenées au rythme mobile. */
    .page-app [style*="margin-top:1rem"] { margin-top: .65rem !important; }
    .page-app [style*="margin-bottom:1rem"] { margin-bottom: .65rem !important; }
    .page-app input[type=date] { min-height: 42px; padding: .45rem .55rem; font-size: 16px; }
    .page-app .hide-mobile { display: none; }
    .page-app .show-mobile { display: initial; }
    .page-app th.show-mobile, .page-app td.show-mobile { display: table-cell; }

    /* Ventes : filtres en grille compacte, une vente = une ligne. */
    /* Stock : boutons d'action sur une ligne, filtres et lignes compacts. */
    .page-app .stock-head { margin-bottom: .6rem; }
    .page-app .stock-actions { flex-wrap: nowrap; gap: .3rem; width: 100%; }
    .page-app .stock-actions .btn { flex: 1 1 auto; min-height: 30px; padding: .2rem .4rem; font-size: .72rem; border-radius: 8px; white-space: nowrap; }
    .page-app .stock-filter { padding: .6rem; gap: .4rem; }
    .page-app .stock-filter input.stock-filter-search, .page-app .stock-filter select.stock-filter-location { flex: 1 1 100%; min-height: 34px; padding: .25rem .5rem; font-size: 14px; border-radius: 8px; }
    .page-app .stock-filter-row { flex: 1 1 100%; flex-wrap: nowrap; gap: .4rem; font-size: .8rem; }
    .page-app .stock-filter-low { flex: 1 1 auto; gap: .3rem; white-space: nowrap; }
    .page-app .stock-filter-perpage { font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; gap: .25rem; white-space: nowrap; }
    .page-app .stock-filter-perpage select { min-height: 30px; padding: .15rem .3rem; font-size: 13px; border-radius: 8px; width: 3.6rem; }
    .page-app .stock-filter .btn { min-height: 30px; padding: .2rem .55rem; font-size: .76rem; border-radius: 8px; }
    .page-app .stock-table { font-size: .8rem; }
    .page-app .stock-table th { font-size: .62rem; }
    .page-app .stock-table th, .page-app .stock-table td { white-space: nowrap; padding: .4rem .25rem; }
    .page-app .stock-article { max-width: 26vw; overflow: hidden; text-overflow: ellipsis; }
    .page-app .stock-article .badge { font-size: .6rem; padding: 0 .35rem; }
    .page-app .stock-table .stock-qty { text-align: center; }
    .page-app .stock-adjust form { flex-wrap: nowrap; gap: .2rem; }
    .page-app .stock-adjust select, .page-app .stock-adjust input { min-height: 28px; padding: .1rem .25rem; font-size: 12px; border-radius: 6px; }
    .page-app .stock-adjust-mode { width: 2.8rem; }
    .page-app .stock-adjust .stock-adjust-qty { width: 2.6rem; }
    .page-app .stock-adjust-type { width: 4.2rem; }
    .page-app .stock-adjust .btn { min-height: 28px; padding: .1rem .4rem; font-size: .72rem; border-radius: 6px; }
    /* Mouvements : une ligne par mouvement, détails sous « Voir + ». */
    .page-app .movements-toolbar { gap: .4rem; }
    .page-app .movements-count { flex: 1 1 100%; }
    .page-app .movements-toolbar .stock-filter-perpage { flex: 1 1 auto; }
    .page-app .movements-toolbar select { min-height: 30px; padding: .15rem .3rem; font-size: 13px; border-radius: 8px; }
    .page-app .movements-toolbar .movements-location { flex: 1 1 auto; width: 0; min-width: 0; }
    .page-app .movements-table { font-size: .8rem; }
    .page-app .movements-table th { font-size: .62rem; }
    .page-app .movements-table th, .page-app .movements-table td { white-space: nowrap; padding: .4rem .3rem; }
    .page-app .movements-table td.show-mobile { text-align: right; width: 1%; }
    .page-app .movements-table .btn-small { min-height: 28px; padding: .1rem .5rem; font-size: .74rem; border-radius: 6px; }
    .page-app .movement-details:not([hidden]) { display: table-row; }
    .page-app .movement-details td { white-space: normal; background: var(--bg); font-size: .8rem; }
    /* Inventaire : un article par ligne. */
    .page-app .count-table { font-size: .82rem; }
    .page-app .count-table th { font-size: .62rem; }
    .page-app .count-table th, .page-app .count-table td { white-space: nowrap; padding: .35rem .3rem; }
    .page-app .count-article { max-width: 52vw; overflow: hidden; text-overflow: ellipsis; }
    .page-app .count-theory { text-align: center; }
    .page-app .count-table .count-input { width: 4.2rem; min-height: 32px; padding: .15rem .4rem; font-size: 14px; border-radius: 8px; }
    /* Clients : segments sur une ligne (défilement horizontal si besoin), lignes compactes. */
    .page-app .customers-head { margin-bottom: .45rem; }
    .page-app .customers-head .btn-small, .page-app .customers-head .badge { font-size: .72rem; }
    .page-app .customers-head .btn-small { min-height: 30px; padding: .2rem .6rem; border-radius: 8px; }
    .page-app .chips-row { flex-wrap: nowrap; gap: .25rem; overflow-x: auto; scrollbar-width: none; margin-bottom: .5rem !important; padding-bottom: .1rem; }
    .page-app .chips-row::-webkit-scrollbar { display: none; }
    .page-app .chips-row .badge { flex: 0 0 auto; font-size: .66rem; padding: .1rem .42rem; }
    .page-app .customers-table { font-size: .82rem; }
    .page-app .customers-table th { font-size: .62rem; }
    .page-app .customers-table th, .page-app .customers-table td { padding: .4rem .3rem; vertical-align: middle; }
    .page-app .customers-table td:last-child, .page-app .customers-table th:last-child { text-align: right; }
    .page-app .customers-name { max-width: 55vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .page-app .customers-name .small { font-size: .7rem; }
    .page-app .customers-table .badge { font-size: .62rem; padding: .05rem .35rem; }
    /* Statistiques : filtre de dates compact, indicateurs et tableaux resserrés. */
    .page-app .stats-head { flex-wrap: nowrap; margin-bottom: .45rem; }
    .page-app .stats-head h1 { margin: 0; font-size: 1.15rem; }
    .page-app .stats-exports { flex-wrap: nowrap; gap: .25rem; }
    .page-app .stats-exports .btn { min-height: 28px; padding: .15rem .45rem; font-size: .68rem; border-radius: 7px; }
    .page-app .stats-note { font-size: .7rem; margin-bottom: .4rem; }
    .page-app .stats-filter { padding: .55rem; margin-bottom: .6rem; }
    .page-app .stats-filter .sales-filter-dates { display: flex; flex-wrap: nowrap; gap: .35rem; align-items: center; }
    .page-app .stats-filter .filter-field { flex: 1 1 0; min-width: 0; flex-direction: row; align-items: center; gap: .25rem; }
    .page-app .stats-filter .filter-field > span { font-size: .6rem; }
    .page-app .stats-filter input[type=date] { flex: 1 1 0; width: 0; min-width: 0; min-height: 32px; padding: .15rem .3rem; font-size: 13px; border-radius: 8px; }
    .page-app .stats-filter .btn { min-height: 32px; padding: .15rem .55rem; font-size: .74rem; border-radius: 8px; }
    .page-app .stats-shortcuts { flex-wrap: nowrap; margin-top: .4rem; }
    .page-app .stats-shortcuts .badge { font-size: .64rem; padding: .1rem .4rem; }
    .page-app .stats-kpis { gap: .4rem; }
    .page-app .stats-kpis .card { padding: .5rem .6rem; }
    .page-app .stats-kpis .card-title { font-size: .58rem; }
    .page-app .stats-kpis .stat { font-size: 1rem; }
    .page-app .stats-kpis .small { font-size: .68rem; }
    .page-app .stats-extra { font-size: .7rem; margin: .4rem 0 0; }
    .page-app .bars { height: 120px; gap: 2px; }
    .page-app .bars .bar { flex-basis: 8px; }
    .page-app .bars-labels { font-size: .56rem; gap: 2px; }
    .page-app .bars-labels span { flex-basis: 8px; }
    .page-app .stats-tables { gap: .5rem; margin-top: .6rem !important; }
    .page-app .stats-tables table, .page-app .stats-tables + .card table { font-size: .78rem; }
    .page-app .stats-tables td, .page-app .stats-tables th { padding: .35rem .25rem; }
    .page-app .stats-label { max-width: 45vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    /* Boutique en ligne : onglets sur une ligne, formulaire resserré. */
    .page-app .shop-head { flex-wrap: nowrap; margin-bottom: .45rem; }
    .page-app .shop-head h1 { margin: 0; font-size: 1.1rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .page-app .shop-head-actions { flex: 0 0 auto; flex-wrap: nowrap; gap: .3rem; }
    .page-app .shop-head-actions .badge { font-size: .62rem; }
    .page-app .shop-head-actions .btn { min-height: 30px; padding: .2rem .5rem; font-size: .72rem; border-radius: 8px; white-space: nowrap; }
    .page-app .shop-tabs { margin-bottom: .5rem !important; }
    .page-app .shop-tabs .badge { flex: 1 0 auto; text-align: center; font-size: .68rem; padding: .2rem .4rem; }
    .page-app .shop-publish { padding: .55rem .65rem; margin-bottom: .6rem !important; }
    /* Message sur toute la largeur, puis les actions sur une ligne en dessous. */
    .page-app .shop-publish .spread { flex-direction: column; align-items: stretch; gap: .45rem; }
    .page-app .shop-publish strong { font-size: .82rem; line-height: 1.3; }
    .page-app .shop-publish .spread > div:first-child .small { font-size: .7rem; }
    .page-app .shop-publish .cluster { flex-wrap: nowrap; align-items: center; gap: .35rem; }
    .page-app .shop-publish .cluster > form:has(.btn) { flex: 1 1 auto; }
    .page-app .shop-publish .cluster > form .btn { width: 100%; }
    .page-app .shop-publish .btn-small { min-height: 32px; padding: .2rem .55rem; font-size: .74rem; border-radius: 8px; white-space: nowrap; }
    .page-app .shop-publish .btn-link { font-size: .74rem; white-space: nowrap; color: var(--danger); }
    .page-app .storefront-form .grid { gap: .55rem; }
    .page-app .storefront-form .card { padding: .6rem .65rem; }
    .page-app .storefront-form .card-title { font-size: .6rem; margin-bottom: .3rem; }
    .page-app .storefront-form .field { margin-bottom: .45rem; }
    .page-app .storefront-form .field > label { font-size: .74rem; margin-bottom: .1rem; }
    .page-app .storefront-form input:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=color]),
    .page-app .storefront-form select, .page-app .storefront-form textarea { min-height: 32px; padding: .2rem .5rem; font-size: 14px; border-radius: 8px; }
    .page-app .storefront-form details summary { font-size: .74rem; margin-bottom: .35rem; }
    .page-app .storefront-form .file-picker { min-height: 34px; padding: .25rem .55rem; }
    .page-app .storefront-form .file-picker-name { font-size: .76rem; }
    .page-app .storefront-form .small { font-size: .7rem; }
    .page-app .storefront-form .choice { padding: .35rem .5rem; margin-bottom: .3rem; font-size: .8rem; }
    .page-app .shop-colors { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem !important; }
    .page-app .shop-colors label { font-size: .64rem !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .page-app input[type=color] { height: 32px; border-radius: 8px; }
    .page-app .storefront-form .grid-2 .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; }
    .page-app .shop-save { flex-direction: column; align-items: stretch; gap: .3rem; margin-top: .6rem; }
    .page-app .shop-save .btn { width: 100%; min-height: 40px; }
    .page-app .shop-save .small { text-align: center; font-size: .7rem; }
    /* Pages, Livraison, Paiements, Domaine : même rythme que l'onglet Apparence. */
    .page-app h1:has(+ .shop-tabs) { margin: 0 0 .45rem; font-size: 1.1rem; }
    .page-app .shop-tabs { gap: .2rem; }
    .page-app .shop-tabs .badge { padding: .2rem .3rem; }
    .page-app .shop-settings.grid, .page-app .grid.shop-settings { gap: .55rem; }
    .page-app .shop-settings.card, .page-app .shop-settings .card { padding: .6rem .65rem; }
    .page-app .shop-settings .card-title { font-size: .6rem; margin-bottom: .3rem; }
    .page-app .shop-settings p { font-size: .82rem; margin-bottom: .45rem; }
    .page-app .shop-settings .small { font-size: .7rem; }
    .page-app .shop-settings .field { margin-bottom: .45rem; }
    .page-app .shop-settings .field > label { font-size: .74rem; margin-bottom: .1rem; }
    .page-app .shop-settings input:not([type=checkbox]):not([type=radio]),
    .page-app .shop-settings select, .page-app .shop-settings textarea { min-height: 32px; padding: .2rem .5rem; font-size: 14px; border-radius: 8px; }
    .page-app .shop-settings .grid { gap: .4rem; }
    .page-app .shop-settings .grid-2 .grid-2, .page-app .shop-settings form > .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .page-app .shop-settings .btn { min-height: 34px; padding: .25rem .7rem; font-size: .8rem; border-radius: 8px; }
    .page-app .shop-settings form > .btn { width: 100%; }
    .page-app .shop-settings .badge { font-size: .62rem; padding: .05rem .4rem; }
    .page-app .shop-settings .cluster { gap: .6rem; }
    .page-app .shop-settings .btn-link { font-size: .74rem; }
    .page-app .shop-row { padding: .4rem 0; }
    .page-app .shop-row.spread { flex-wrap: nowrap; }
    .page-app .shop-row strong { font-size: .84rem; }
    .page-app .shop-row a { text-decoration: none; }
    .page-app .shop-row .mono { font-size: .68rem; }
    .page-app .shop-row summary { flex-wrap: nowrap; align-items: flex-start; font-size: .82rem; line-height: 1.35; }
    .page-app .shop-row summary .zone-communes { display: block; margin-top: .1rem; }
    .page-app .shop-add-pages { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .35rem; }
    .page-app .shop-add-pages .btn { display: block; min-height: 32px; line-height: 30px; padding: 0 .4rem; font-size: .74rem; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .page-app .shop-settings .choice { padding: .35rem .5rem; margin-bottom: .3rem; font-size: .8rem; line-height: 1.3; }
    .page-app .shop-settings ol { font-size: .74rem; padding-left: 1rem; margin-bottom: .5rem; }
    .page-app .shop-settings input.mono { font-size: 12px; }
    .page-app .shop-tabs + .flash { font-size: .76rem; padding: .4rem .6rem; margin-bottom: .5rem; }
    /* Nouveau bon de commande : une ligne par article, champs étroits. */
    .page-app .po-form { padding: .6rem; }
    .page-app .po-form-head { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 .4rem; }
    .page-app .po-form .field { margin-bottom: .4rem; }
    .page-app .po-form .field label { font-size: .74rem; margin-bottom: .1rem; }
    .page-app .po-form select, .page-app .po-form input[type=text], .page-app .po-form input[type=search] { min-height: 32px; padding: .2rem .45rem; font-size: 14px; border-radius: 8px; }
    .page-app .po-help { font-size: .7rem; margin-bottom: .4rem; }
    .page-app .po-toolbar { gap: .35rem; }
    .page-app .po-toolbar select { width: 3.6rem; padding: .15rem .3rem; font-size: 13px; }
    .page-app .po-table { font-size: .8rem; }
    .page-app .po-table th { font-size: .6rem; white-space: nowrap; }
    .page-app .po-table th, .page-app .po-table td { padding: .3rem .25rem; }
    .page-app .po-article { max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .page-app .po-table input { min-height: 30px; padding: .1rem .35rem; font-size: 14px; border-radius: 7px; text-align: right; }
    .page-app .po-table .po-qty { width: 3.6rem; }
    .page-app .po-table .po-cost { width: 5.2rem; }
    .page-app .po-note { margin-top: .6rem; }
    .page-app .po-actions { display: grid; grid-template-columns: 1fr 2fr; }
    .page-app .po-actions .btn { min-height: 40px; font-size: .85rem; }
    /* Fiche d'un bon de commande. */
    .page-app .po-show-head { gap: .4rem; margin-bottom: .5rem; }
    .page-app .po-show-head h1 { font-size: 1.1rem; }
    .page-app .po-summary { padding: .6rem; margin-bottom: .6rem; }
    .page-app .po-meta { gap: .4rem .6rem; margin-bottom: .55rem; }
    .page-app .po-meta dt { font-size: .6rem; }
    .page-app .po-meta dd { font-size: .82rem; }
    .page-app .po-progress .small { font-size: .72rem; }
    .page-app .po-lines { padding: .6rem; }
    .page-app .po-lines .po-toolbar { flex-wrap: wrap; }
    .page-app .po-lines-title { font-size: .62rem; flex: 1 1 100%; }
    .page-app .po-lines .po-search { min-height: 32px; padding: .2rem .45rem; font-size: 14px; border-radius: 8px; }
    .page-app .po-show-table .po-article { max-width: 40vw; }
    .page-app .po-total { font-size: .9rem; padding: .45rem 0; margin-bottom: .5rem; }
    .page-app .po-lines .btn-block { min-height: 40px; font-size: .88rem; }
    .page-app .po-show-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: .4rem; margin-top: .6rem; }
    .page-app .po-show-actions .btn { width: 100%; min-height: 40px; font-size: .82rem; }
    /* Fournisseurs : formulaire compact, une ligne + icônes par fournisseur. */
    .page-app .suppliers-title { font-size: 1.15rem; margin-bottom: .5rem; }
    .page-app .supplier-form { padding: .6rem; }
    .page-app .supplier-form .field, .page-app .supplier-edit .field { margin-bottom: .4rem; }
    .page-app .supplier-form .field label { font-size: .74rem; margin-bottom: .1rem; }
    .page-app .supplier-form input, .page-app .supplier-form textarea,
    .page-app .supplier-edit input, .page-app .supplier-edit textarea { min-height: 32px; padding: .2rem .5rem; font-size: 14px; border-radius: 8px; }
    .page-app .supplier-form textarea, .page-app .supplier-edit textarea { min-height: 48px; }
    .page-app .supplier-form-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 .4rem; }
    .page-app .supplier-form .btn { width: 100%; min-height: 38px; }
    .page-app .supplier-name { font-size: .85rem; }
    .page-app .supplier-edit { padding: .45rem; }
    .page-app .supplier-edit .btn { width: 100%; min-height: 34px; }
    /* Approvisionnement : tableaux d'une ligne par article / bon de commande. */
    .page-app .purchase-head { flex-wrap: nowrap; gap: .4rem; margin-bottom: .5rem; }
    .page-app .purchase-head h1 { margin: 0; font-size: clamp(.92rem, 4.4vw, 1.1rem); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .page-app .purchase-actions { flex: 0 0 auto; flex-wrap: nowrap; gap: .25rem; }
    .page-app .purchase-actions .btn { min-height: 28px; padding: .15rem .45rem; font-size: clamp(.6rem, 2.9vw, .7rem); border-radius: 7px; white-space: nowrap; }
    .page-app .purchase-table { font-size: .8rem; }
    .page-app .purchase-table th { font-size: .58rem; white-space: nowrap; }
    .page-app .purchase-table th, .page-app .purchase-table td { padding: .4rem .25rem; }
    .page-app .purchase-article { max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .page-app .purchase-supplier { max-width: 30vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .page-app .purchase-status .badge { font-size: .56rem; padding: .05rem .3rem; }
    .page-app .history-head .card-title { font-size: .64rem; }
    /* Formulaire produit : cartes et champs resserrés, actions pleine largeur. */
    .page-app .product-form-title { font-size: 1.15rem; margin-bottom: .5rem; }
    .page-app .product-form .card { padding: .55rem .6rem; }
    .page-app .product-form .card-title { font-size: .6rem; margin-bottom: .3rem; }
    .page-app .product-form .field { margin-bottom: .4rem; }
    .page-app .product-form .field label, .page-app .product-form .field-label { font-size: .74rem; margin-bottom: .1rem; line-height: 1.3; }
    .page-app .product-form .help { font-size: .64rem; margin-top: .1rem; line-height: 1.3; }
    .page-app .product-form input:not([type=checkbox]):not([type=file]), .page-app .product-form select, .page-app .product-form textarea { min-height: 32px; padding: .2rem .5rem; font-size: 14px; border-radius: 8px; }
    .page-app .product-form textarea { min-height: 52px; }
    .page-app .product-form-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 .4rem; }
    .page-app .product-form-grid { gap: .5rem; }
    .page-app .product-form-checks .field { margin-bottom: .35rem; }
    .page-app .product-form-checks .choice-inline { font-size: .85rem; margin-right: 0; }
    .page-app .product-seo summary { font-size: .78rem; }
    .page-app .variants-head .btn-small { min-height: 30px; padding: .2rem .6rem; font-size: .76rem; border-radius: 8px; }
    .page-app .variant-row { padding: .55rem 0; }
    .page-app .variant-row-head { margin-bottom: .3rem; }
    .page-app .variant-row-title { font-size: .66rem; }
    .page-app .variant-row > div:not(.variant-row-head) { gap: .35rem .5rem; }
    .page-app .variant-row .field label { font-size: .7rem; }
    .page-app .variant-row .choice-inline { font-size: .8rem; }
    .page-app .product-form-actions { display: grid; grid-template-columns: 1fr 2fr; margin-top: .75rem; }
    .page-app .product-form-actions .btn { min-height: 42px; }
    .page-app .product-photo img { width: 72px; height: 72px; }
    /* Catalogue : actions sur une ligne, filtres compacts, tableau resserré. */
    .page-app .catalog-head { margin-bottom: .5rem; }
    .page-app .catalog-actions { flex-wrap: nowrap; gap: .25rem; width: 100%; }
    .page-app .catalog-actions .badge { flex: 0 0 auto; font-size: .62rem; padding: .1rem .35rem; }
    .page-app .catalog-actions .btn { flex: 1 1 auto; min-height: 30px; padding: .2rem .35rem; font-size: .7rem; border-radius: 8px; white-space: nowrap; }
    .page-app .ai-photo-form { padding: .65rem; }
    .page-app .ai-photo-intro { font-size: .76rem; margin-bottom: .45rem; }
    .page-app .ai-photo-row { flex-wrap: nowrap; gap: .35rem; }
    .page-app .file-picker { flex: 1 1 auto; min-height: 38px; padding: .3rem .6rem; gap: .4rem; }
    .page-app .file-picker-name { font-size: .78rem; }
    .page-app .ai-photo-row .btn { min-height: 38px; padding: .2rem .6rem; font-size: .74rem; border-radius: 8px; white-space: nowrap; }
    .page-app .catalog-filter { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: .35rem; padding: .55rem; }
    .page-app .catalog-filter .catalog-search { grid-column: 1 / -1; width: 100%; }
    .page-app .catalog-filter input, .page-app .catalog-filter select { min-height: 34px; padding: .2rem .45rem; font-size: 13px; border-radius: 8px; width: 100%; min-width: 0; }
    .page-app .catalog-filter .btn { min-height: 34px; padding: .2rem .6rem; font-size: .74rem; border-radius: 8px; }
    .page-app .catalog-table { font-size: .8rem; }
    .page-app .catalog-table th { font-size: .6rem; }
    .page-app .catalog-table th, .page-app .catalog-table td { padding: .4rem .25rem; }
    .page-app .catalog-thumb { width: 40px; }
    .page-app .catalog-thumb .thumb { width: 36px; height: 36px; }
    .page-app .catalog-product { max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.3; }
    .page-app .catalog-sub { font-size: .68rem; }
    .page-app .catalog-price { display: inline; color: var(--text); font-weight: 600; }
    .page-app .catalog-stock { text-align: center; }
    .page-app .catalog-status { white-space: nowrap; text-align: right; }
    .page-app .catalog-status .badge { font-size: .58rem; padding: .05rem .3rem; }
    /* Catégories : boutons en icônes, ligne compacte. */
    .page-app .category-new .btn { width: 100%; min-height: 40px; }
    .page-app .category-row { gap: .3rem; padding: .4rem 0; }
    .page-app .category-name input { min-height: 34px; padding: .25rem .5rem; font-size: 14px; border-radius: 8px; }
    .page-app .category-info { font-size: .66rem; }
    .page-app .icon-btn { width: 34px; min-height: 34px; padding: 0; border-radius: 8px; }
    .page-app .icon-btn .icon { width: 17px; height: 17px; }
    .page-app .icon-btn-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    /* Formulaire client : une colonne compacte, boutons pleine largeur. */
    .page-app .customer-form-title { font-size: 1.15rem; margin-bottom: .5rem; }
    .page-app .customer-form { padding: .75rem; }
    .page-app .customer-form .field { margin-bottom: .55rem; }
    .page-app .customer-form .field label { font-size: .8rem; margin-bottom: .15rem; }
    .page-app .customer-form .help { font-size: .7rem; margin-top: .15rem; }
    .page-app .customer-form input, .page-app .customer-form select, .page-app .customer-form textarea { min-height: 38px; padding: .35rem .6rem; font-size: 15px; border-radius: 9px; }
    .page-app .customer-form .phone-dial { padding: .35rem .2rem .35rem .45rem; max-width: 6.4rem; border-radius: 9px 0 0 9px; }
    .page-app .customer-form .phone-field input { border-radius: 0 9px 9px 0; }
    .page-app .customer-form textarea { min-height: 70px; }
    .page-app .customer-form-section legend { font-size: .64rem; margin-bottom: .4rem; }
    .page-app .customer-form-section + .customer-form-section { padding-top: .6rem; }
    .page-app .customer-form-actions { display: grid; grid-template-columns: 1fr 2fr; }
    .page-app .customer-form-actions .btn { min-height: 40px; }
    /* Fiche client. */
    .page-app .customer-head { flex-wrap: nowrap; margin-bottom: .2rem; }
    .page-app .customer-head h1 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1.15rem; margin: 0; }
    .page-app .customer-head .cluster { flex-wrap: nowrap; gap: .3rem; }
    .page-app .customer-head .btn-small { min-height: 30px; padding: .2rem .55rem; font-size: .74rem; border-radius: 8px; }
    .page-app .customer-contact { font-size: .76rem; margin-bottom: .5rem; overflow-wrap: anywhere; }
    .page-app .debt-form { grid-template-columns: 1fr 1fr; gap: .4rem; }
    .page-app .debt-form .debt-note { grid-column: 1 / 2; }
    .page-app .debt-form input, .page-app .debt-form select { min-height: 34px; padding: .25rem .5rem; font-size: 14px; border-radius: 8px; }
    .page-app .debt-form .btn { min-height: 34px; font-size: .78rem; border-radius: 8px; }
    .page-app .history-head { flex-wrap: nowrap; margin-bottom: .3rem; }
    .page-app .history-head .card-title { margin: 0; }
    .page-app .history-head select { min-height: 28px; padding: .1rem .3rem; font-size: 13px; border-radius: 7px; width: 3.6rem; }
    .page-app .customer-sales-table { font-size: .82rem; }
    .page-app .customer-sales-table th { font-size: .62rem; }
    .page-app .customer-sales-table th, .page-app .customer-sales-table td { padding: .4rem .3rem; vertical-align: middle; }
    .page-app .customer-sales-table td:last-child, .page-app .customer-sales-table th:last-child { text-align: right; }
    .page-app .customer-sales-table .badge { font-size: .62rem; padding: .05rem .35rem; }
    .page-app .customer-sale-date { color: var(--text); text-decoration: none; }
    .page-app .debt-payments { padding-left: 1rem; margin: 0; font-size: .8rem; }
    .page-app .debt-payments li + li { margin-top: .25rem; }
    /* Commandes : statuts, recherche et lignes compacts. */
    .page-app .orders-head { margin-bottom: .45rem; }
    .page-app .orders-head .btn-small { min-height: 30px; padding: .2rem .6rem; font-size: .76rem; border-radius: 8px; }
    .page-app .orders-status { gap: .3rem; margin-bottom: .5rem; }
    .page-app .orders-status .badge { font-size: .68rem; padding: .1rem .45rem; text-decoration: none; }
    .page-app .orders-filter { padding: .55rem; gap: .4rem; }
    .page-app .orders-filter input.orders-search { flex: 1 1 100%; min-height: 34px; padding: .25rem .55rem; font-size: 14px; border-radius: 8px; }
    .page-app .orders-filter-row { flex: 1 1 100%; justify-content: space-between; }
    .page-app .orders-filter-row select { min-height: 30px; padding: .15rem .3rem; font-size: 13px; border-radius: 8px; width: 3.6rem; }
    .page-app .orders-filter .btn { min-height: 30px; padding: .2rem .6rem; font-size: .76rem; border-radius: 8px; }
    .page-app .orders-count { font-size: .76rem; margin-bottom: .3rem; }
    .page-app .orders-table { font-size: .78rem; line-height: 1.3; }
    .page-app .orders-table th { font-size: .6rem; }
    .page-app .orders-table th, .page-app .orders-table td { padding: .4rem .25rem; }
    .page-app .orders-date { font-size: .74rem; }
    .page-app .orders-client-cell { max-width: 30vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .page-app .orders-client-cell .small { font-size: .68rem; }
    .page-app .orders-table .badge { font-size: .6rem; padding: .05rem .35rem; }
    .page-app .orders-chevron { color: var(--muted); font-size: 1rem; font-weight: 700; }
    .page-app .cancel-form { grid-template-columns: 1fr; margin-top: .75rem; padding-top: .65rem; }
    .page-app .cancel-form textarea { min-height: 38px; padding: .4rem .6rem; font-size: 15px; border-radius: 10px; }
    .page-app .cancel-form .btn { width: 100%; min-height: 40px; }
    .page-app .sales-head { margin-bottom: .75rem; }
    /* Détail d'une vente : Total / Encaissé / Reste dû sur une ligne. */
    .page-app .sale-totals { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem; }
    .page-app .sale-totals .card { padding: .55rem .5rem; }
    .page-app .sale-totals .card-title { font-size: .6rem; letter-spacing: .03em; white-space: nowrap; }
    .page-app .sale-totals .stat { font-size: .95rem; white-space: nowrap; letter-spacing: -.01em; }
    .page-app .sale-totals .small { font-size: .66rem; line-height: 1.2; display: block; }
    .page-app .count-totals { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .page-app .count-totals .stat { font-size: .85rem; }
    .page-app .history-table { font-size: .82rem; }
    .page-app .history-table th { font-size: .62rem; }
    .page-app .history-table th, .page-app .history-table td { white-space: nowrap; padding: .4rem .3rem; vertical-align: middle; }
    .page-app .history-table .btn-small { min-height: 28px; padding: .1rem .5rem; font-size: .74rem; border-radius: 6px; }
    .page-app a.back-link.show-mobile { display: inline-flex; margin-bottom: .35rem; font-size: .85rem; }
    .page-app .sales-filter { display: flex; flex-direction: column; align-items: stretch; gap: .4rem; padding: .65rem; }
    .page-app .sales-filter > * { min-width: 0; }
    .page-app .sales-filter-dates { flex: none; gap: .4rem; }
    /* Libellé et champ sur la même ligne, champs compacts qui ne débordent pas. */
    .page-app .sales-filter .filter-field { flex: 1 1 0; min-width: 0; flex-direction: row; align-items: center; gap: .35rem; }
    .page-app .sales-filter .filter-field > span { flex: 0 0 4.4rem; font-size: .62rem; letter-spacing: .03em; }
    .page-app .sales-filter-dates .filter-field > span { flex: 0 0 auto; }
    .page-app .sales-filter .filter-field > input, .page-app .sales-filter .filter-field > select {
        flex: 1 1 0; width: 0; min-width: 0; min-height: 34px; padding: .25rem .45rem; font-size: 14px; border-radius: 8px;
    }
    .page-app .sales-filter input[type=date] { padding: .25rem .3rem; font-size: 13px; }
    .page-app .sales-filter input[type=date]::-webkit-calendar-picker-indicator { margin-left: 0; padding: 0; width: 14px; }
    .page-app .sales-filter-last { align-items: center; gap: .35rem; }
    .page-app .sales-filter-last .filter-field-narrow { flex: 1 1 0; }
    .page-app .sales-filter-last .filter-field-narrow > select { flex: 0 0 4rem; width: 4rem; }
    .page-app .sales-filter-actions { flex: 0 0 auto; gap: .35rem; }
    .page-app .sales-filter-actions .btn { min-height: 34px; padding: .2rem .6rem; font-size: .8rem; border-radius: 8px; }
    .page-app .sales-table { table-layout: auto; }
    .page-app .sales-table td, .page-app .sales-table th { white-space: nowrap; }
    .page-app .sales-table .sales-client { max-width: 34vw; overflow: hidden; text-overflow: ellipsis; }
    .page-app .sales-table td.show-mobile { text-align: right; width: 1%; }
    .page-app .sales-table .btn-small { min-height: 30px; padding: .2rem .55rem; font-size: .78rem; }
    .page-app .pagination .btn-small { font-size: .8rem; }
    .page-app .meeting-compose { bottom: calc(64px + env(safe-area-inset-bottom)); }
    .page-app .pos-ticket { top: 56px; }

    /* Caisse : page resserrée pour le téléphone. */
    .page-app .pos { gap: .6rem; }
    .page-app .pos .card { padding: .65rem .7rem; }
    .page-app .pos .card-title { font-size: .64rem; margin-bottom: .25rem; }
    .page-app .pos-search { min-height: 38px; padding: .3rem .6rem; font-size: 15px; }
    .page-app .pos-results { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: .4rem; margin-top: .5rem; }
    .page-app .pos-item { min-height: 0; padding: .35rem; gap: .15rem; border-radius: 8px; }
    .page-app .pos-item img, .page-app .pos-item-ph { height: 48px; font-size: 1.1rem; }
    .page-app .pos-item-label { font-size: .78rem; }
    .page-app .pos-item-meta { font-size: .7rem; }

    /* Panier : nom, prix, quantité et retrait sur une seule ligne. */
    .page-app .pos-line { grid-template-columns: minmax(0, 1fr) auto auto auto; gap: .3rem; padding: .35rem 0; font-size: .82rem; }
    .page-app .pos-line-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.25; }
    .page-app .pos-line-label br { display: none; }
    .page-app .pos-line-label .small { font-size: .7rem; margin-left: .3rem; }
    /* Le prix modifiable remplace le rappel « prix × quantité ». */
    .page-app .pos-line:has(.pos-line-edit) .pos-line-label .small { display: none; }
    .page-app .pos-line-edit { grid-column: auto; order: 1; gap: 0; font-size: 0; }
    .page-app .pos-line-edit label { display: flex; align-items: center; }
    .page-app .pos-line-edit input { width: 4.6rem; min-height: 30px; padding: .1rem .35rem; font-size: 13px; border-radius: 7px; }
    .page-app .pos-qty { order: 2; gap: .2rem; }
    .page-app .pos-qty .btn-small { min-height: 30px; min-width: 30px; padding: 0 .45rem; border-radius: 7px; }
    .page-app .pos-qty strong { min-width: 1.1rem; text-align: center; font-size: .85rem; }
    .page-app .pos-remove { order: 3; display: flex; align-items: center; justify-content: center; width: 26px; height: 30px; color: var(--danger); }
    .page-app .pos-remove-text { display: none; }
    .page-app .pos-remove-icon { display: inline; font-size: .9rem; }

    /* Totaux, paiement, client. */
    .page-app .pos-totals { font-size: .85rem; }
    .page-app .pos-totals .spread { padding: .1rem 0; flex-wrap: nowrap; }
    .page-app .pos-totals .grand { font-size: 1.1rem; }
    .page-app #pos-discount { width: 6.5rem !important; min-height: 32px; padding: .15rem .45rem; font-size: 14px; }
    .page-app .pos .cluster { gap: .3rem; }
    .page-app .pos .cluster .btn-small { min-height: 30px; padding: .15rem .5rem; font-size: .74rem; border-radius: 8px; }
    .page-app .pos-payment { gap: .3rem; }
    .page-app .pos-payment select, .page-app .pos-payment input { min-height: 34px; padding: .2rem .45rem; font-size: 14px; }
    .page-app .pos-payment select { min-width: 6.5rem; }
    .page-app .pos-ticket input[type=search], .page-app .pos-ticket input[type=tel], .page-app .pos-ticket input[type=text] { min-height: 36px; padding: .3rem .55rem; font-size: 14px; }
    .page-app .pos-ticket .grid { gap: .4rem; }
    .page-app .pos-ticket .phone-dial { min-height: 36px; padding: .3rem .2rem .3rem .4rem; font-size: 14px; max-width: 6.2rem; }
    .page-app .pos-ticket p.small { margin-bottom: .3rem; }
    .page-app .pos-submit { margin-top: .75rem; min-height: 46px; font-size: 1rem; }
}
@media (max-width: 360px) {
    .page-app .grid-4 { grid-template-columns: 1fr; }
    .tabbar a span, .tabbar button span { font-size: .62rem; }
}

/* Publications : formulaire de création (assistant IA, textes par réseau, visuel, planification). */
.composer { max-width: 720px; }
.composer-card { margin-bottom: 1rem; }
.composer-heading { font-size: 1rem; text-transform: none; letter-spacing: 0; color: var(--text); margin-bottom: .6rem; }
.composer textarea, .composer input:not([type=checkbox]):not([type=file]), .composer select { width: 100%; }
.composer-chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.composer-chip { position: relative; cursor: pointer; }
.composer-chip input { position: absolute; opacity: 0; pointer-events: none; }
.composer-chip span { display: inline-block; padding: .45rem 1rem; border: 1px solid var(--border); border-radius: 10px; font-weight: 600; background: var(--surface); }
.composer-chip input:checked + span { background: var(--brand-soft); border-color: transparent; color: var(--brand-strong); }
.composer-chip input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.composer-dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; margin-right: .4rem; }
.composer-row { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.composer-upload { position: relative; overflow: hidden; }
.composer-upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.composer-preview { margin-bottom: .75rem; }
.composer-preview [hidden] { display: none; }
.composer-preview img { max-width: 220px; max-height: 260px; border-radius: 10px; object-fit: cover; display: block; }
.composer-preview video { max-width: 220px; max-height: 260px; border-radius: 10px; display: block; background: #000; }
.composer [hidden] { display: none !important; }
.post-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; flex: none; }

/* Fenêtre « Mes visuels » (nouvelle publication) : feuille plein écran sur mobile, fenêtre centrée au-delà. */
.media-picker { width: min(640px, calc(100vw - 2rem)); max-height: min(86vh, 760px); padding: 0; border: 0; border-radius: 16px; background: var(--surface); color: inherit; box-shadow: 0 20px 60px rgb(0 0 0 / .25); overflow: hidden; }
.media-picker[open] { display: flex; flex-direction: column; }
.media-picker::backdrop { background: rgb(15 23 42 / .55); }
.media-picker-head { display: flex; align-items: center; gap: .5rem; padding: .85rem 1rem; border-bottom: 1px solid var(--border); }
.media-picker-head h2 { flex: 1; margin: 0; font-size: 1.05rem; }
.media-picker-close, .media-picker-back { width: 2.25rem; height: 2.25rem; flex: none; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); color: inherit; font-size: 1rem; line-height: 1; cursor: pointer; }
.media-picker-close:hover, .media-picker-back:hover { background: var(--bg); }
.media-picker-list, .media-picker-preview { flex: 1; min-height: 0; overflow-y: auto; padding: 1rem; }
.media-picker-tabs { margin-bottom: .85rem; }
.media-picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .75rem; }
.media-picker-item { display: flex; flex-direction: column; gap: .2rem; padding: 0; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; font: inherit; min-width: 0; }
.media-picker-thumb { position: relative; display: block; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: #0b1220; border: 2px solid transparent; }
.media-picker-item:hover .media-picker-thumb, .media-picker-item:focus-visible .media-picker-thumb { border-color: var(--border); }
.media-picker-item.is-selected .media-picker-thumb { border-color: var(--brand); box-shadow: 0 0 0 2px rgb(15 118 110 / .2); }
.media-picker-thumb img, .media-picker-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.media-picker-play { position: absolute; top: .4rem; right: .4rem; width: 1.75rem; height: 1.75rem; border-radius: 50%; background: rgb(0 0 0 / .55); color: #fff; font-size: .75rem; display: grid; place-items: center; }
.media-picker-name { font-weight: 600; font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-picker-meta { font-size: .75rem; color: var(--muted); }
.media-picker-empty { grid-column: 1 / -1; margin: 1.5rem 0; text-align: center; }
.media-picker-preview { display: flex; flex-direction: column; gap: .75rem; }
.media-picker-stage { display: grid; place-items: center; background: #0b1220; border-radius: 12px; overflow: hidden; min-height: 200px; }
.media-picker-stage img, .media-picker-stage video { display: block; max-width: 100%; max-height: 55vh; object-fit: contain; }
.media-picker-caption { display: flex; flex-direction: column; gap: .15rem; margin: 0; overflow-wrap: anywhere; }
.media-picker-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-top: auto; }
@media (max-width: 640px) {
    .media-picker { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
    .media-picker-grid { grid-template-columns: repeat(2, 1fr); gap: .6rem; }
    .media-picker-stage img, .media-picker-stage video { max-height: 60dvh; }
}

/* Publications : filtres, liste, autopilote. */
.filter-chips { display: flex; gap: .45rem; overflow-x: auto; padding-bottom: .35rem; margin-bottom: .35rem; scrollbar-width: thin; }
.filter-chip { flex: none; padding: .4rem .9rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font-weight: 600; font-size: .9rem; text-decoration: none; white-space: nowrap; }
.filter-chip:hover { background: var(--bg); color: var(--text); }
.filter-chip.is-active { background: var(--brand-soft); color: var(--brand-strong); border-color: transparent; }
/* minmax(0, 1fr) : la colonne ne s'élargit pas pour un titre sur une ligne (sinon la carte dépasse l'écran). */
.post-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: .6rem; }
.post-item { padding: .75rem; min-width: 0; overflow: hidden; }
.post-item-text { flex: 1; min-width: 0; }
.post-item-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.post-item-excerpt { margin: .2rem 0 .35rem; color: var(--muted); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-item-actions { margin-top: .6rem; gap: .4rem; }
.badge.network-facebook { background: #e7f0ff; color: #1659c7; border-color: transparent; }
.badge.network-instagram { background: #fde7ef; color: #b0164e; border-color: transparent; }
.badge.network-tiktok { background: #ececec; color: #111; border-color: transparent; }
.badge.network-linkedin { background: #e8f1fb; color: #0a66c2; border-color: transparent; }
a.badge.network-link { text-decoration: none; cursor: pointer; }
a.badge.network-link:hover, a.badge.network-link:focus-visible { filter: brightness(.94); text-decoration: underline; }
.post-network-stats { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; margin: .5rem 0 0; padding-top: .5rem; border-top: 1px solid var(--border, #e5e7eb); }
.autopilot details > summary { list-style: none; cursor: pointer; text-align: center; }
.autopilot details > summary::-webkit-details-marker { display: none; }
.autopilot fieldset { border: 0; padding: 0; margin: 0 0 1rem; }
.switch { position: relative; width: 52px; height: 30px; min-height: 0; padding: 0; border-radius: 999px; border: 2px solid var(--muted); background: var(--bg); cursor: pointer; flex: none; }
.switch span { position: absolute; top: 4px; left: 4px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); transition: left .15s ease; }
.switch.is-on { background: var(--brand); border-color: var(--brand); }
.switch.is-on span { left: 26px; background: #fff; }
@media (prefers-reduced-motion: reduce) { .switch span { transition: none; } }
.post-item-body { display: flex; gap: .75rem; align-items: flex-start; color: inherit; text-decoration: none; border-radius: 8px; }
.post-item-body:hover { color: inherit; }
.post-item-body:hover .post-item-title { text-decoration: underline; }
.post-item-body:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.post-detail { max-width: 720px; }
.post-detail-image { display: block; width: 100%; max-width: 420px; max-height: 70vh; object-fit: contain; border-radius: 12px; background: var(--bg); margin-bottom: 1rem; }
.post-detail-text { white-space: pre-line; overflow-wrap: anywhere; margin: .6rem 0; }
.post-detail-facts { display: grid; grid-template-columns: auto 1fr; gap: .35rem 1rem; margin: 0; font-size: .9rem; }
.post-detail-facts dt { color: var(--muted); }
.post-detail-facts dd { margin: 0; }
@media (max-width: 640px) {
    .filter-chips { gap: .3rem; margin-bottom: .2rem; }
    .filter-chip { padding: .2rem .6rem; font-size: .78rem; border-radius: 8px; }

    /* Cartes de publication : vignette plus petite, deux lignes de titre, actions en grille. */
    .post-item { padding: .65rem; }
    .post-item-body { gap: .6rem; }
    .post-thumb { width: 56px; height: 56px; }
    .post-item-text > .spread:first-child { gap: .4rem; }
    .post-item-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; font-size: .9rem; line-height: 1.3; }
    .post-item-text .badge { font-size: .68rem; flex: none; }
    .post-item-excerpt { font-size: .78rem; margin: .15rem 0 .3rem; }
    /* Action principale sur toute la largeur, les autres se partagent la ligne suivante. */
    .post-item-actions { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .55rem; }
    .post-item-actions > * { flex: 1 1 0; display: flex; min-width: 0; }
    .post-item-actions > .post-action-publier { flex-basis: 100%; order: -1; }
    .post-item-actions .btn { width: 100%; min-width: 0; min-height: 36px; padding: .3rem .5rem; font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
.posts-panel { margin-bottom: 1rem; }
.posts-panel-more { margin-top: .75rem; }
.autopilot-status { margin: .4rem 0; }
@media (max-width: 640px) {
    /* Publications : en-tête et panneaux compacts. */
    .posts-head { gap: .4rem; margin-bottom: .5rem; }
    .posts-head h1 { font-size: 1.25rem; margin: 0; }
    .posts-head .cluster { gap: .35rem; }
    .posts-head .badge { font-size: .7rem; }
    .posts-head .btn-small { min-height: 28px; padding: .15rem .55rem; font-size: .75rem; }
    .posts-panel { padding: .6rem .7rem; margin-bottom: .5rem; }
    .posts-panel .card-title { margin-bottom: .3rem; }
    .posts-panel .btn-block { min-height: 36px; padding: .3rem .7rem; font-size: .9rem; }
    .posts-panel-more { margin-top: .4rem; }
    .posts-panel-more summary { font-size: .8rem; }
    .autopilot-status { margin: .25rem 0 .4rem; font-size: .8rem; line-height: 1.35; }
    .autopilot .switch { width: 42px; height: 24px; }
    .autopilot .switch span { top: 3px; left: 3px; width: 14px; height: 14px; }
    .autopilot .switch.is-on span { left: 21px; }
}

/* Publications : recherche par période (barre arrondie, icône calendrier). */
.date-filter { display: flex; align-items: center; gap: .4rem; margin: .3rem 0 1rem; padding: .3rem .3rem .3rem .65rem; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); max-width: 560px; }
.date-filter.is-set { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.date-filter-icon { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--brand); stroke-width: 1.8; stroke-linecap: round; }
.date-filter-field { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 0; padding: .15rem .45rem; border-radius: 10px; background: var(--bg); cursor: pointer; }
.date-filter-field:focus-within { background: var(--brand-soft); }
.date-filter-field span { font-size: .62rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); line-height: 1.2; }
.page-app .date-filter-field input[type=date], .date-filter-field input[type=date] { width: 100%; min-width: 0; min-height: 0; padding: 0; border: 0; background: transparent; font-size: .85rem; font-weight: 600; color: var(--text); box-shadow: none; outline: none; }
.date-filter-sep { color: var(--muted); font-size: .85rem; flex: none; }
.date-filter-go { flex: none; min-height: 38px; padding: .3rem .85rem; border: 0; border-radius: 10px; background: var(--brand); color: #fff; font-weight: 700; font-size: .85rem; cursor: pointer; }
.date-filter-go:hover { background: var(--brand-strong); }
.date-filter-go:focus-visible, .date-filter-clear:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.date-filter-clear { flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: var(--muted); text-decoration: none; font-size: .85rem; }
.date-filter-clear:hover { background: var(--danger-soft); color: var(--danger); }
@media (max-width: 640px) {
    .date-filter { gap: .25rem; padding: .25rem .25rem .25rem .45rem; margin-bottom: .75rem; border-radius: 12px; }
    .date-filter-icon { width: 17px; height: 17px; }
    .date-filter-field { padding: .1rem .35rem; }
    .date-filter-field span { font-size: .56rem; }
    .page-app .date-filter-field input[type=date], .date-filter-field input[type=date] { font-size: .76rem; }
    .date-filter-sep { font-size: .75rem; }
    .date-filter-go { min-height: 32px; padding: .2rem .55rem; font-size: .76rem; }
    .date-filter-clear { width: 24px; height: 24px; font-size: .75rem; }
}

/* Nouvelle publication / modification : version compacte sur mobile. */
@media (max-width: 640px) {
    .composer-head { margin-bottom: .5rem; gap: .3rem; }
    .composer-head h1 { font-size: 1.2rem; margin: 0; }
    .composer-head .btn-link { font-size: .85rem; }
    .page-app .composer-card { padding: .65rem .7rem; margin-bottom: .55rem; }
    .composer-heading { font-size: .9rem; margin-bottom: .4rem; }
    .composer .field { margin-bottom: .55rem; }
    .composer .field label, .composer .field legend { font-size: .82rem; margin-bottom: .2rem; }
    .composer .small, .composer .help { font-size: .75rem; line-height: 1.35; }
    .composer p.small { margin: .2rem 0 .45rem; }
    .page-app .composer input:not([type=checkbox]):not([type=file]), .page-app .composer select, .page-app .composer textarea { min-height: 36px; padding: .3rem .55rem; font-size: .88rem; }
    .page-app .composer textarea { line-height: 1.4; }
    .composer-chips { gap: .35rem; }
    .composer-chip span { padding: .25rem .65rem; font-size: .8rem; border-radius: 8px; }
    .composer-dot { width: .5rem; height: .5rem; }
    .composer .btn { min-height: 36px; padding: .3rem .7rem; font-size: .85rem; }
    .composer-row { gap: .45rem; }
    .composer-preview img, .composer-preview video { max-width: 160px; max-height: 190px; }
    .composer .choice-inline { font-size: .75rem; margin-right: 0; align-items: flex-start; }
}

/* Nouvelle publication : champ « Date de publication » (même style que la recherche par période). */
.date-picker { display: flex; align-items: center; gap: .6rem; margin-bottom: .75rem; padding: .5rem .7rem; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease; }
.date-picker:hover { border-color: var(--muted); }
.date-picker:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.date-picker.is-set { border-color: var(--brand); background: linear-gradient(0deg, var(--brand-soft), var(--brand-soft)) left / 4px 100% no-repeat, var(--surface); }
.date-picker-icon { width: 36px; height: 36px; flex: none; padding: 7px; border-radius: 10px; background: var(--brand-soft); fill: none; stroke: var(--brand-strong); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.date-picker-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.date-picker-label { font-size: .68rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); line-height: 1.3; }
.date-picker-label small { font-weight: 500; text-transform: none; letter-spacing: 0; }
.page-app .composer .date-picker input[type=datetime-local], .composer .date-picker input[type=datetime-local] { width: 100%; min-height: 0; padding: .1rem 0 0; border: 0; background: transparent; box-shadow: none; outline: none; font-size: 1rem; font-weight: 600; color: var(--text); cursor: pointer; }
@media (prefers-reduced-motion: reduce) { .date-picker { transition: none; } }
@media (max-width: 640px) {
    .date-picker { gap: .5rem; padding: .4rem .55rem; margin-bottom: .55rem; border-radius: 12px; }
    .date-picker-icon { width: 30px; height: 30px; padding: 6px; border-radius: 8px; }
    .date-picker-label { font-size: .6rem; }
    .page-app .composer .date-picker input[type=datetime-local], .composer .date-picker input[type=datetime-local] { font-size: .9rem; }
}

/* Comptes connectés : lignes de compte, boutons de connexion par réseau. */
.social-note { margin-bottom: .75rem; }
.social-mark { display: inline-grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 10px; color: #fff; font-weight: 800; font-size: .8rem; letter-spacing: -.02em; }
.social-mark-facebook { background: #1877f2; font-size: 1.1rem; font-family: Georgia, serif; }
.social-mark-instagram { background: linear-gradient(45deg, #f58529, #dd2a7b 55%, #8134af); }
.social-mark-tiktok { background: #111; }
.social-mark-linkedin { background: #0a66c2; }
.social-account { display: flex; align-items: center; gap: .65rem; padding: .6rem 0; border-bottom: 1px solid var(--border); }
.social-account:last-child { border-bottom: 0; padding-bottom: 0; }
.social-account-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.social-account-line { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.social-account-name { font-size: .88rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.social-account-note { font-size: .75rem; color: var(--muted); line-height: 1.3; margin-top: .15rem; }
.social-disconnect { flex: none; min-height: 0; padding: .3rem .6rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--danger); font-size: .78rem; font-weight: 600; cursor: pointer; }
.social-disconnect:hover { background: var(--danger-soft); border-color: transparent; }
.social-connect { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.social-connect form { display: contents; }
.social-connect-btn { display: flex; flex-direction: column; align-items: center; gap: .3rem; min-height: 0; padding: .7rem .4rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); font-weight: 700; font-size: .88rem; cursor: pointer; }
.social-connect-btn small { font-size: .7rem; font-weight: 600; color: var(--brand); }
.social-connect-btn:hover { border-color: var(--brand); background: var(--brand-soft); }
.social-connect-btn.is-connected small { color: var(--muted); }
.social-connect-btn:disabled { opacity: .45; cursor: not-allowed; }
.social-connect-btn:focus-visible, .social-disconnect:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.social-hint { margin: .6rem 0 0; }
@media (max-width: 640px) {
    .social-note { font-size: .75rem; padding: .45rem .6rem; margin-bottom: .5rem; }
    .social-mark { width: 30px; height: 30px; border-radius: 8px; font-size: .72rem; }
    .social-mark-facebook { font-size: 1rem; }
    .social-account { gap: .5rem; padding: .45rem 0; }
    .social-account-line strong { font-size: .9rem; }
    .social-account-line .badge { font-size: .66rem; padding: .05rem .4rem; }
    .social-account-name { font-size: .78rem; }
    .social-account-note { font-size: .7rem; }
    .social-disconnect { padding: .2rem .45rem; font-size: .7rem; }
    .social-connect { gap: .35rem; }
    .social-connect-btn { padding: .5rem .25rem; gap: .2rem; font-size: .78rem; border-radius: 10px; }
    .social-connect-btn small { font-size: .64rem; }
    .social-hint { font-size: .72rem; margin-top: .45rem; }
}

/* --- Sponsoring ------------------------------------------------------------ */
.sponso > * + * { margin-top: 1.25rem; }
.sponso > .sponso-plan + .sponso-plan { margin-top: .75rem; }
.sponso > .sponso-count { margin: .6rem 0 0; }
.sponso > .sponso-count + * { margin-top: .6rem; }
.sponso .card { padding: 1.1rem 1.25rem; }
.sponso > .pagination { margin-top: 1rem; }
.sponso-head { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; align-items: center; justify-content: space-between; }
.sponso-head h1 { margin: 0; }
.sponso-head-actions { flex: none; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.sponso-head-actions .btn { white-space: nowrap; }
.sponso .flash { margin-bottom: 0; }

/* Filtre par période + nombre par page */

/* Plans du conseiller : une carte repliable par plan */
.sponso-plan { border-top: 3px solid var(--brand); }
.sponso-plan:not([open]) { border-top-color: var(--border); }
.sponso-plan-head { display: flex; flex-wrap: wrap; gap: .4rem .75rem; align-items: center; justify-content: space-between; cursor: pointer; list-style: none; }
.sponso-plan-head::-webkit-details-marker { display: none; }
.sponso-plan-head:focus-visible { outline: 2px solid var(--brand); outline-offset: 4px; border-radius: 6px; }
.sponso-plan-title { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.sponso-plan-title .card-title { margin: 0; }
.sponso-plan-date { font-weight: 700; font-size: .95rem; color: var(--text); }
.sponso-plan-date::before { content: "\25B8"; display: inline-block; margin-right: .4rem; color: var(--brand); transition: transform .15s ease; }
.sponso-plan[open] .sponso-plan-date::before { transform: rotate(90deg); }
.sponso-plan-badges { display: flex; flex-wrap: wrap; gap: .3rem; }
.sponso-plan-body { margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--border); }
.sponso-plan-summary { margin: 0 0 .5rem; }
.sponso-plan-empty p { margin: 0; }
.sponso-rec { border: 1px solid var(--border); border-radius: 10px; margin-top: .6rem; background: var(--surface); }
.sponso-rec[open] { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.sponso-rec > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: .15rem .6rem; padding: .7rem .85rem; cursor: pointer; list-style: none; }
.sponso-rec > summary::-webkit-details-marker { display: none; }
.sponso-rec > summary::before { content: "\25B8"; color: var(--brand); transition: transform .15s ease; }
.sponso-rec[open] > summary::before { transform: rotate(90deg); }
.sponso-rec > summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 10px; }
.sponso-rec-product { font-weight: 700; }
.sponso-rec-budget { font-size: .875rem; color: var(--brand-strong); font-weight: 600; }
.sponso-rec-body { padding: .65rem .85rem .85rem; border-top: 1px dashed var(--border); }
.sponso-rec-body > p { margin-bottom: .5rem; }
.sponso-steps { margin: 0 0 .75rem; padding-left: 1.25rem; font-size: .9rem; }
.sponso-steps li + li { margin-top: .4rem; }
.sponso-quote { margin: .35rem 0 0; padding: .5rem .75rem; background: var(--bg); border-left: 3px solid var(--brand); border-radius: 0 8px 8px 0; overflow-wrap: anywhere; }
.sponso-quote-pre { white-space: pre-wrap; }
.sponso-subtitle { margin: 1rem 0 .4rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.sponso-actions { list-style: none; margin: 0; padding: 0; }
.sponso-actions li { padding: .5rem 0; border-top: 1px solid var(--border); }
.sponso-action-line { display: flex; flex-wrap: wrap; gap: .3rem .6rem; align-items: center; justify-content: space-between; margin-bottom: .1rem; }

/* Tableau des publicités */
.sponso-section > .small { margin-bottom: .5rem; }
.sponso-table { font-size: .875rem; }
.sponso-table th { white-space: nowrap; }
.sponso-table th.num, .sponso-table td.num { text-align: right; white-space: nowrap; }
.sponso-cell-name { min-width: 180px; }
.sponso-cell-meta { margin-top: .2rem; font-size: .8rem; }
.sponso-cell-edit { text-align: right; }
.sponso-edit summary, .sponso-add summary { cursor: pointer; color: var(--brand); font-weight: 600; font-size: .875rem; white-space: nowrap; }
.sponso-edit[open] { text-align: left; }
.sponso-form { display: grid; gap: .5rem; margin-top: .5rem; }
.sponso-form label { display: grid; gap: .15rem; font-size: .78rem; font-weight: 600; color: var(--muted); }
.sponso-form input, .sponso-form select { width: 100%; min-width: 0; }
.sponso-edit .sponso-form { min-width: 220px; }
.sponso-add { margin-top: .75rem; }
@media (min-width: 640px) {
    .sponso-add .sponso-form { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; }
    .sponso-add .sponso-form .btn { justify-self: start; }
}
@media (min-width: 960px) { .sponso-add .sponso-form { grid-template-columns: 1.2fr 1.2fr 1fr .8fr auto; } }

/* Bas de page : origine des ventes et liens suivis */
.sponso-bottom { display: grid; gap: 1.5rem; }
@media (min-width: 760px) { .sponso-bottom { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.sponso-sources { list-style: none; margin: 0; padding: 0; font-size: .875rem; }
.sponso-sources li { display: flex; justify-content: space-between; gap: .75rem; padding: .35rem 0; border-top: 1px solid var(--border); }
.sponso-sources li:first-child { border-top: 0; }
.sponso-sources-value { font-weight: 600; white-space: nowrap; }
.sponso-link-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: .5rem; margin-bottom: .75rem; }
.sponso-link { padding: .5rem 0; border-top: 1px solid var(--border); font-size: .875rem; }
.sponso-link-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .2rem .75rem; margin-bottom: .3rem; }
.sponso-link-url { width: 100%; font-size: .8rem !important; color: var(--muted); background: var(--bg); }

@media (max-width: 640px) {
    .page-app .sponso > * + * { margin-top: 1rem; }
    .page-app .sponso .card { padding: .85rem .9rem; }
    .page-app .sponso .sponso-kpi { padding: .55rem .45rem; border-radius: 10px; }
    .page-app .sponso-kpi .card-title { font-size: .56rem; letter-spacing: .02em; margin-bottom: .15rem; }
    .page-app .sponso-kpi .stat { font-size: .92rem; }
    .sponso-kpi-note { font-size: .6rem; }
    .sponso-head { gap: .5rem; }
    .sponso-head > div { flex-basis: 100%; }
    .sponso-intro { font-size: .78rem; line-height: 1.4; }
    .sponso-head-actions { width: 100%; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: .45rem; }
    .sponso-head-actions .btn { width: 100%; padding-left: .4rem; padding-right: .4rem; font-size: .84rem; }
    .page-app .sponso > .sponso-plan + .sponso-plan { margin-top: .55rem; }
    .sponso > .sponso-count { font-size: .75rem; }
    .sponso-plan-date { font-size: .88rem; }
    .sponso-plan-badges .badge { font-size: .68rem; }
    .sponso .pagination .btn-small { padding: .25rem .55rem; }
    .sponso-rec > summary { padding: .55rem .65rem; }
    .sponso-rec-budget { flex-basis: 100%; padding-left: 1rem; font-size: .8rem; }
    .sponso-rec-body { padding: .55rem .65rem .7rem; }
    .sponso-steps { padding-left: 1.05rem; font-size: .84rem; }
    .sponso-quote { padding: .4rem .55rem; font-size: .84rem; }
    .sponso-rec-body .btn { width: 100%; }

    /* Tableau → une carte par publicité */
    .page-app .sponso-section .table-wrap { margin: 0; padding: 0; overflow: visible; }
    .sponso-table thead { display: none; }
    .sponso-table, .sponso-table tbody { display: block; }
    .sponso-table tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .45rem .5rem; padding: .7rem 0; border-top: 1px solid var(--border); }
    .sponso-table tr:first-child { border-top: 0; padding-top: .25rem; }
    .page-app .sponso-table td { display: block; padding: 0; border: 0; }
    .sponso-table td.sponso-cell-name, .sponso-table td.sponso-cell-edit, .sponso-empty td { grid-column: 1 / -1; min-width: 0; }
    .sponso-table td.num { text-align: left; white-space: normal; font-weight: 600; overflow-wrap: normal; }
    .sponso-table td[data-label]::before { content: attr(data-label); display: block; font-size: .64rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
    .sponso-cell-edit { text-align: left; }
    .sponso-edit .sponso-form { min-width: 0; }
    .sponso-form .btn { width: 100%; }

    .sponso-link-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .sponso-link-form .btn { grid-column: 1 / -1; }
    .sponso-link-head { font-size: .82rem; }
}
@media (prefers-reduced-motion: reduce) { .sponso-rec > summary::before { transition: none; } }

/* --- Listes filtrées : période (Du → Au) + nombre par page ------------------ */
.list-toolbar { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; }
.list-toolbar .date-filter { margin: 0; flex: 1 1 360px; }
.list-perpage { display: flex; align-items: center; gap: .4rem; font-size: .8rem; font-weight: 600; color: var(--muted); }
.list-perpage select { width: auto; min-height: 38px; padding: .3rem 1.6rem .3rem .6rem; }
@media (max-width: 640px) {
    .list-toolbar { gap: .45rem; }
    /* Filtre compact : sans icône ni flèche, deux champs qui se partagent la largeur. */
    .list-toolbar .date-filter { flex-basis: 100%; min-width: 0; max-width: 100%; gap: .25rem; padding: .25rem; border-radius: 12px; }
    .list-toolbar .date-filter-icon, .list-toolbar .date-filter-sep { display: none; }
    .list-toolbar .date-filter-field { flex: 1 1 0; min-width: 0; padding: .15rem .4rem; border-radius: 8px; }
    .list-toolbar .date-filter-field span { font-size: .55rem; }
    .page-app .list-toolbar .date-filter-field input[type=date], .list-toolbar .date-filter-field input[type=date] { width: 100%; min-width: 0; font-size: .74rem; }
    .list-toolbar .date-filter-field input[type=date]::-webkit-calendar-picker-indicator { margin: 0; padding: 0; width: 13px; height: 13px; }
    .list-toolbar .date-filter-go { min-height: 34px; padding: .2rem .55rem; font-size: .74rem; border-radius: 8px; }
    .list-toolbar .date-filter-clear { width: 22px; height: 22px; font-size: .7rem; }
    .list-perpage { margin-left: auto; font-size: .75rem; }
    .page-app .list-perpage select { min-height: 34px; padding: .2rem 1.4rem .2rem .5rem; font-size: 16px; }
}

/* --- Rapports marketing ---------------------------------------------------- */
.mkt > * + * { margin-top: 1.25rem; }
.mkt-head { display: flex; flex-wrap: wrap; gap: .6rem 1.25rem; align-items: center; justify-content: space-between; }
.mkt-head h1 { margin: 0 0 .2rem; }
.mkt-frequency { margin: 0; }
.mkt-head-action { flex: none; }
.mkt-head-action .btn { white-space: nowrap; }
.mkt-grid { display: grid; gap: 1.25rem; }
@media (min-width: 960px) { .mkt-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.mkt .card { padding: 1.1rem 1.25rem; }
.mkt-section-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .35rem; }
.mkt-section-head .card-title { margin: 0; }
.mkt-empty { margin: .5rem 0 0; }
.mkt-date { display: block; font-size: .78rem; color: var(--muted); }
.mkt .pagination { margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--border); }

.mkt-reports, .mkt-campaigns { list-style: none; margin: 0; padding: 0; }
.mkt-reports li + li, .mkt-campaigns li + li { border-top: 1px solid var(--border); }
.mkt-report { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "title arrow" "date arrow"; gap: .15rem .75rem; align-items: center; padding: .7rem .5rem; margin: 0 -.5rem; border-radius: 10px; color: inherit; text-decoration: none; }
.mkt-report:hover { background: var(--bg); color: inherit; }
.mkt-report:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.mkt-report-title { grid-area: title; font-weight: 600; line-height: 1.35; }
.mkt-report .mkt-date { grid-area: date; }
.mkt-report-arrow { grid-area: arrow; font-size: 1.4rem; line-height: 1; color: var(--brand); }

.mkt-campaign { padding: .75rem 0; }
.mkt-campaign-head { display: flex; flex-wrap: wrap; gap: .3rem .6rem; align-items: center; justify-content: space-between; }
.mkt-campaign p { margin: .25rem 0; }
.mkt-campaign-actions { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .5rem; }
.mkt-campaign-result { margin-top: .4rem !important; }

@media (max-width: 640px) {
    .page-app .mkt > * + * { margin-top: .85rem; }
    .page-app .mkt-grid { gap: .85rem; }
    .page-app .mkt .card { padding: .8rem .85rem; }
    .mkt-head { gap: .5rem; }
    .mkt-head > div { flex-basis: 100%; }
    .mkt-frequency { font-size: .78rem; }
    .mkt-head-action, .mkt-head-action .btn { width: 100%; }
    .mkt-report { padding: .6rem .4rem; margin: 0 -.4rem; }
    .mkt-report-title { font-size: .9rem; }
    .mkt-date { font-size: .72rem; }
    .mkt-campaign-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mkt-campaign-actions .btn { width: 100%; }
}

/* --- Rapport marketing (détail) -------------------------------------------- */
.mkt-report-page { max-width: 920px; }
.mkt-report-page > * + * { margin-top: 1rem; }
.mkt-report-page .card { padding: 1.1rem 1.25rem; }
.mkt-back { display: inline-flex; align-items: center; gap: .25rem; font-weight: 600; font-size: .9rem; text-decoration: none; }
.mkt-back:hover { text-decoration: underline; }
.mkt-report-hero { border-top: 3px solid var(--brand); }
.mkt-report-hero .card-title { margin-bottom: .25rem; }
.mkt-report-hero h1 { margin: 0 0 .6rem; font-size: 1.45rem; line-height: 1.25; overflow-wrap: anywhere; }
.mkt-report-meta { display: flex; flex-wrap: wrap; gap: .35rem .75rem; align-items: center; }
.mkt-report-meta .mkt-date { display: inline; }
.mkt-report-summary { margin: .85rem 0 0; padding: .7rem .85rem; background: var(--bg); border-left: 3px solid var(--brand); border-radius: 0 10px 10px 0; line-height: 1.5; }

.mkt-report-grid { display: grid; gap: 1rem; }
@media (min-width: 760px) { .mkt-report-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.mkt-block .card-title { display: flex; align-items: center; gap: .45rem; margin-bottom: .6rem; }
.mkt-dot { width: .55rem; height: .55rem; border-radius: 50%; background: var(--muted); flex: none; }
.mkt-block-good { border-left: 3px solid var(--success); }
.mkt-block-good .mkt-dot { background: var(--success); }
.mkt-block-warn { border-left: 3px solid var(--accent); }
.mkt-block-warn .mkt-dot { background: var(--accent); }
.mkt-points { margin: 0; padding-left: 1.1rem; }
.mkt-points li + li { margin-top: .4rem; }
.mkt-points li::marker { color: var(--muted); }
.mkt-none { margin: 0; }

.mkt-recos { list-style: none; margin: 0; padding: 0; counter-reset: reco; }
.mkt-reco { position: relative; padding: .7rem 0 .7rem 2.1rem; counter-increment: reco; }
.mkt-reco + .mkt-reco { border-top: 1px solid var(--border); }
.mkt-reco::before { content: counter(reco); position: absolute; left: 0; top: .7rem; display: grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--brand-soft); color: var(--brand-strong); font-size: .78rem; font-weight: 800; }
.mkt-reco-head { display: flex; flex-wrap: wrap; gap: .3rem .6rem; align-items: center; }
.mkt-reco p { margin: .25rem 0 0; color: var(--text); }

.mkt-timeline { list-style: none; margin: 0; padding: 0; }
.mkt-timeline li { display: grid; grid-template-columns: minmax(90px, 140px) minmax(0, 1fr); gap: .75rem; padding: .55rem 0; }
.mkt-timeline li + li { border-top: 1px dashed var(--border); }
.mkt-timeline-when { font-weight: 700; color: var(--brand-strong); font-size: .9rem; }

.mkt-instructions { list-style: none; margin: 0; padding: 0; }
.mkt-instructions li { display: flex; flex-wrap: wrap; gap: .3rem .6rem; align-items: baseline; padding: .5rem 0; }
.mkt-instructions li + li { border-top: 1px solid var(--border); }
.mkt-report-page .mkt-campaign .btn { margin-top: .5rem; }

@media (max-width: 640px) {
    .page-app .mkt-report-page > * + * { margin-top: .75rem; }
    .page-app .mkt-report-page .card { padding: .8rem .85rem; }
    .page-app .mkt-report-hero h1 { font-size: 1.12rem; margin-bottom: .5rem; }
    .mkt-back { font-size: .84rem; }
    .mkt-report-meta .badge { font-size: .7rem; }
    .mkt-report-summary { font-size: .88rem; padding: .55rem .7rem; margin-top: .65rem; }
    .page-app .mkt-report-grid { gap: .75rem; }
    .mkt-points { font-size: .88rem; }
    .mkt-reco { padding-left: 1.85rem; }
    .mkt-reco::before { width: 1.35rem; height: 1.35rem; font-size: .7rem; }
    .mkt-reco-head strong { font-size: .92rem; }
    .mkt-reco-head .badge { font-size: .66rem; }
    .mkt-timeline li { grid-template-columns: minmax(0, 1fr); gap: .1rem; }
    .mkt-timeline-when { font-size: .8rem; }
    .mkt-report-page .mkt-campaign .btn { width: 100%; }
}

/* --- Connaissances des agents (commerçant et admin) ------------------------ */
.kb > * + * { margin-top: 1.25rem; }
.kb-head { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; align-items: flex-start; justify-content: space-between; }
.kb-head-text { flex: 1 1 460px; min-width: 0; }
.kb-head h1 { margin: 0 0 .35rem; }
.kb-intro { margin: 0; max-width: 75ch; line-height: 1.5; }
.kb-quota { flex: none; display: grid; grid-template-columns: auto auto; gap: .15rem .75rem; align-items: baseline; min-width: 170px; padding: .65rem .85rem; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); }
.kb-quota-label { font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.kb-quota-value { justify-self: end; font-size: 1.15rem; font-weight: 800; }
.kb-quota .meter { grid-column: 1 / -1; height: 6px; margin-top: .3rem; }

.kb-tools { display: grid; gap: 1.25rem; margin-bottom: 1.25rem; }
@media (min-width: 900px) { .kb-tools { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.kb-card { padding: 1.1rem 1.25rem; }
.kb-card .card-title { margin-bottom: .75rem; }
.kb-card .field { margin-bottom: .85rem; }
.kb-card .field label { font-weight: 600; font-size: .9rem; }
.kb-card input:not([type=checkbox]):not([type=file]), .kb-card select { width: 100%; }
.kb-submit { width: 100%; }
@media (min-width: 640px) { .kb-submit { width: auto; } }

/* Zone de choix du fichier */
.kb-drop { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .35rem .85rem; align-items: center; padding: .9rem 1rem; margin-bottom: .9rem; border: 2px dashed var(--border); border-radius: 12px; background: var(--bg); cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.kb-drop:hover, .kb-drop:focus-within { border-color: var(--brand); background: var(--brand-soft); }
.kb-drop-icon { width: 40px; height: 40px; padding: 8px; border-radius: 10px; background: var(--surface); fill: none; stroke: var(--brand); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.kb-drop-text { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.kb-drop-text strong { color: var(--brand-strong); }
.kb-drop-help { font-size: .78rem; color: var(--muted); line-height: 1.35; }
.kb-drop-input { grid-column: 1 / -1; width: 100%; font-size: .82rem; }

/* Agents concernés : puces cochables */
.kb-agents { border: 0; padding: 0; margin: 0 0 1rem; min-width: 0; }
.kb-agents legend { padding: 0; margin-bottom: .45rem; font-weight: 600; font-size: .9rem; }
.kb-agents legend .muted { font-weight: 400; font-size: .8rem; }
.kb-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.kb-chip { position: relative; display: inline-flex; cursor: pointer; }
.kb-chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.kb-chip span { display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .75rem; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: .84rem; font-weight: 600; color: var(--muted); transition: background .15s ease, border-color .15s ease, color .15s ease; }
.kb-chip span::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; border: 1.5px solid currentColor; }
.kb-chip:hover span { border-color: var(--brand); }
.kb-chip input:checked + span { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-strong); }
.kb-chip input:checked + span::before { background: var(--brand); border-color: var(--brand); }
.kb-chip input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }

/* Essai de recherche */
.kb-search-intro { margin: -.4rem 0 .75rem; }
.kb-search-fields { display: grid; gap: 0 .75rem; }
@media (min-width: 640px) { .kb-search-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); } }
.kb-results { margin-top: 1rem; border-top: 1px solid var(--border); }
.kb-result { border-bottom: 1px solid var(--border); }
.kb-result > summary { display: flex; flex-wrap: wrap; gap: .3rem .6rem; align-items: center; justify-content: space-between; padding: .6rem 0; cursor: pointer; font-size: .9rem; }
.kb-result-title { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.kb-result-meta { display: flex; flex-wrap: wrap; gap: .3rem; }
.kb-result-text { margin: 0 0 .75rem; padding: .6rem .75rem; background: var(--bg); border-left: 3px solid var(--brand); border-radius: 0 8px 8px 0; font-size: .84rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 320px; overflow-y: auto; }
.kb-empty { margin: .75rem 0 0; }

/* Liste des documents */
.kb-section h2 { margin-bottom: .75rem; }
.kb-docs { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.kb-doc { padding: 1rem 1.15rem; }
.kb-doc-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .85rem; align-items: start; }
.kb-doc-type { display: grid; place-items: center; width: 44px; height: 52px; border-radius: 8px; background: var(--brand-soft); color: var(--brand-strong); font-size: .66rem; font-weight: 800; letter-spacing: .03em; }
.kb-doc-title { display: flex; flex-wrap: wrap; gap: .3rem .6rem; align-items: center; justify-content: space-between; }
.kb-doc-title strong { overflow-wrap: anywhere; }
.kb-doc-meta { display: flex; flex-wrap: wrap; gap: .1rem .5rem; margin: .25rem 0 .4rem; font-size: .78rem; color: var(--muted); }
.kb-doc-meta span + span::before { content: "·"; margin-right: .5rem; }
.kb-doc-meta span:first-child { overflow-wrap: anywhere; }
.kb-doc-agents { display: flex; flex-wrap: wrap; gap: .3rem; }
.kb-doc-agents .badge { font-size: .7rem; }
.kb-doc-error { margin: .65rem 0 0; }
.kb-doc-edit { margin-top: .75rem; padding-top: .6rem; border-top: 1px solid var(--border); }
.kb-doc-edit > summary { cursor: pointer; color: var(--brand); font-weight: 600; font-size: .88rem; }
.kb-doc-edit form { margin-top: .75rem; }
.kb-doc-edit .field label { font-weight: 600; font-size: .85rem; }
.kb-doc-edit input[name=title] { width: 100%; }
.kb-doc-actions { display: flex; flex-wrap: wrap; gap: .45rem; }
@media (prefers-reduced-motion: reduce) { .kb-drop, .kb-chip span { transition: none; } }

@media (max-width: 640px) {
    .page-app .kb > * + * { margin-top: .85rem; }
    .kb-head { gap: .6rem; }
    .kb-head-text { flex-basis: 100%; }
    .kb-intro { font-size: .78rem; line-height: 1.45; }
    .kb-quota { width: 100%; min-width: 0; padding: .5rem .7rem; }
    .kb-quota-value { font-size: 1rem; }
    .page-app .kb-tools { gap: .85rem; margin-bottom: .85rem; }
    .page-app .kb-card { padding: .8rem .85rem; }
    .kb-drop { padding: .7rem .75rem; gap: .3rem .65rem; }
    .kb-drop-icon { width: 34px; height: 34px; padding: 7px; }
    .kb-drop-help { font-size: .72rem; }
    .kb-chip span { padding: .3rem .6rem; font-size: .78rem; }
    .kb-agents legend { font-size: .85rem; }
    .kb-result > summary { font-size: .84rem; }
    .kb-result-text { font-size: .8rem; max-height: 260px; }
    .page-app .kb-doc { padding: .75rem .8rem; }
    .kb-doc-head { gap: .6rem; }
    .kb-doc-type { width: 36px; height: 44px; font-size: .6rem; }
    .kb-doc-title strong { font-size: .92rem; }
    .kb-doc-meta { font-size: .72rem; }
    .kb-doc-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .kb-doc-actions .btn { width: 100%; padding-left: .3rem; padding-right: .3rem; font-size: .78rem; }
}

/* --- Salle des agents : accueil des réunions -------------------------------- */
.meet > * + * { margin-top: 1.25rem; }
.meet-head { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; align-items: flex-start; justify-content: space-between; }
.meet-head-text { flex: 1 1 460px; min-width: 0; }
.meet-head h1 { margin: 0 0 .35rem; }
.meet-intro { margin: 0; max-width: 75ch; line-height: 1.5; }
.meet-tasks { flex: none; white-space: nowrap; }
.meet-card { padding: 1.1rem 1.25rem; }
.meet-card .card-title { margin-bottom: .5rem; }

.meet-top { display: grid; gap: 1.25rem; }
@media (min-width: 860px) { .meet-top { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: stretch; } }
.meet-hero { border-top: 3px solid var(--brand); }
.meet-hero.is-live { border-top-color: var(--danger); }
.meet-hero-line { margin: 0 0 .85rem; font-size: 1rem; }
.meet-convene { display: flex; flex-wrap: wrap; gap: .5rem .85rem; align-items: center; }
.meet-hero-btn { min-height: 44px; padding-inline: 1.2rem; }
.meet-hero-btn[disabled] { opacity: .45; cursor: not-allowed; }
.meet-left { font-size: .82rem; color: var(--muted); }
.meet-left.is-empty { color: var(--danger); font-weight: 600; }
.meet-participants { margin-top: 1rem; padding-top: .85rem; border-top: 1px solid var(--border); }
.meet-participants p { margin: 0; }
.meet-participants-label { display: block; margin-bottom: .4rem; font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.meet-chips { display: flex; flex-wrap: wrap; gap: .35rem; }

.meet-settings { display: flex; flex-direction: column; align-items: flex-start; }
.meet-toggle { display: flex; align-items: center; gap: .55rem; padding: .55rem .7rem; margin-bottom: .85rem; width: 100%; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); cursor: pointer; font-weight: 600; font-size: .92rem; }
.meet-toggle input { width: 18px; height: 18px; accent-color: var(--brand); flex: none; }
.meet-toggle:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-strong); }
/* Heure de la réunion : même esprit que le champ « Date de publication ». */
.meet-time { display: flex; align-items: center; gap: .65rem; width: 100%; margin-bottom: .85rem; padding: .55rem .75rem; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease; }
.meet-time:hover { border-color: var(--muted); }
.meet-time:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.meet-time.is-set { border-color: var(--brand); background: linear-gradient(0deg, var(--brand-soft), var(--brand-soft)) left / 4px 100% no-repeat, var(--surface); }
.meet-time-icon { width: 36px; height: 36px; flex: none; padding: 7px; border-radius: 10px; background: var(--brand-soft); fill: none; stroke: var(--brand-strong); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.meet-time-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.meet-time-label { font-size: .68rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); line-height: 1.3; }
.meet-time input[type=time], .page-app .meet-time input[type=time] { width: 100%; min-height: 0; padding: .1rem 0 0; border: 0; background: transparent; box-shadow: none; outline: none; font-size: 1.1rem; font-weight: 700; color: var(--text); cursor: pointer; }
.meet-time-help { font-size: .72rem; color: var(--muted); line-height: 1.3; }
@media (prefers-reduced-motion: reduce) { .meet-time { transition: none; } }

.meet-history-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .75rem; }
.meet-history-head .card-title { margin: 0; }
.meet-history .list-toolbar { margin-bottom: .85rem; }
.meet-history .pagination { margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--border); }

/* Liste des réunions (commerçant et admin) */
.meet-list { list-style: none; margin: 0; padding: 0; }
.meet-list li + li { border-top: 1px solid var(--border); }
.meet-row { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr) auto auto; gap: .35rem 1rem; align-items: center; padding: .7rem .5rem; margin: 0 -.5rem; border-radius: 10px; color: inherit; text-decoration: none; }
.meet-row:hover { background: var(--bg); color: inherit; }
.meet-row:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.meet-row.is-live { background: var(--danger-soft); }
.meet-row-date { display: flex; flex-direction: column; line-height: 1.25; }
.meet-row-day { font-weight: 700; font-size: .9rem; }
.meet-row-time { font-size: .78rem; color: var(--muted); }
.meet-row-main { display: flex; flex-direction: column; min-width: 0; }
.meet-row-title { font-weight: 600; overflow-wrap: anywhere; }
.meet-row-merchant { font-size: .8rem; color: var(--muted); }
.meet-row-open { font-size: .85rem; font-weight: 700; color: var(--brand); white-space: nowrap; }
.meet-empty { margin: .25rem 0 0; }

@media (max-width: 640px) {
    .page-app .meet > * + * { margin-top: .85rem; }
    .meet-head { gap: .6rem; }
    .meet-head-text { flex-basis: 100%; }
    .meet-intro { font-size: .78rem; line-height: 1.45; }
    .meet-tasks { width: 100%; justify-content: center; }
    .page-app .meet-top { gap: .85rem; }
    .page-app .meet-card { padding: .8rem .85rem; }
    .meet-hero-line { font-size: .92rem; margin-bottom: .65rem; }
    .meet-convene { flex-direction: column; align-items: stretch; gap: .35rem; }
    .meet-hero-btn { width: 100%; }
    .meet-left { text-align: center; font-size: .75rem; }
    .meet-participants { margin-top: .75rem; padding-top: .65rem; }
    .meet-chips .badge { font-size: .7rem; }
    .meet-toggle { font-size: .86rem; padding: .5rem .6rem; }
    .meet-settings .btn { width: 100%; }
    .meet-time { gap: .55rem; padding: .45rem .6rem; }
    .meet-time-icon { width: 30px; height: 30px; padding: 6px; border-radius: 8px; }
    .meet-time-label { font-size: .6rem; }
    .meet-time input[type=time], .page-app .meet-time input[type=time] { font-size: 1rem; }
    .meet-time-help { font-size: .66rem; }

    /* Une réunion par ligne compacte : date à gauche, intitulé, puis statut et lien en dessous. */
    .meet-row { grid-template-columns: 4.6rem minmax(0, 1fr); grid-template-areas: "date main" "date foot"; gap: .25rem .7rem; padding: .6rem .4rem; margin: 0 -.4rem; }
    .meet-row-date { grid-area: date; align-self: start; }
    .meet-row-day { font-size: .8rem; }
    .meet-row-time { font-size: .72rem; }
    .meet-row-main { grid-area: main; }
    .meet-row-title { font-size: .88rem; }
    .meet-row-status { grid-column: 2; grid-row: 2; justify-self: start; }
    .meet-row-status .badge, .meet-row-status .meeting-status { font-size: .68rem; }
    .meet-row-open { grid-column: 2; grid-row: 2; justify-self: end; font-size: .78rem; }
}

/* --- Actions des agents à valider ------------------------------------------ */
.tasks { max-width: 920px; }
.tasks > * + * { margin-top: 1rem; }
.tasks-head h1 { margin: 0; }
.tasks > .list-toolbar { margin-top: .75rem; }
.tasks > .tasks-count { margin: .5rem 0 0; }
.tasks > .tasks-count + * { margin-top: .6rem; }
.tasks > .pagination { margin-top: 1rem; }
.tasks-intro { margin: 0; max-width: 72ch; line-height: 1.5; }

.tasks-tabs { display: flex; gap: .3rem; padding: .25rem; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); overflow-x: auto; scrollbar-width: none; }
.tasks-tabs::-webkit-scrollbar { display: none; }
.tasks-tab { flex: 1 0 auto; padding: .45rem .85rem; border-radius: 9px; text-align: center; white-space: nowrap; font-size: .86rem; font-weight: 600; color: var(--muted); text-decoration: none; }
.tasks-tab:hover { background: var(--bg); color: var(--text); }
.tasks-tab.is-active { background: var(--brand); color: #fff; }
.tasks-tab:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
button.tasks-tab { border: 0; background: none; font-family: inherit; cursor: pointer; }
button.tasks-tab.is-active { background: var(--brand); }

.tasks-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .85rem; }
.task { padding: 1rem 1.15rem; }
.task.is-pending { border-left: 3px solid var(--accent); }
.task-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .2rem .75rem; align-items: start; }
.task-avatar { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--brand); color: #fff; font-size: .72rem; font-weight: 800; letter-spacing: .02em; }
.task-head-main { min-width: 0; }
.task-title { display: block; line-height: 1.35; overflow-wrap: anywhere; }
.task-meta { display: flex; flex-wrap: wrap; gap: .1rem .45rem; margin: .2rem 0 0; font-size: .78rem; color: var(--muted); }
.task-meta span + span::before { content: "·"; margin-right: .45rem; }
.task-badges { display: flex; flex-direction: column; align-items: flex-end; gap: .3rem; }
.task-text { margin: .85rem 0 0; padding: .6rem .8rem; background: var(--bg); border-left: 3px solid var(--brand); border-radius: 0 10px 10px 0; line-height: 1.5; }
.task-text-label { display: block; margin-bottom: .15rem; font-size: .64rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }

/* Proposition lue dans la réunion */
.task-source { margin-top: .75rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.task-source[open] { border-color: var(--brand); }
.task-source > summary { display: flex; align-items: center; gap: .45rem; padding: .6rem .8rem; cursor: pointer; list-style: none; font-size: .88rem; font-weight: 700; color: var(--brand-strong); }
.task-source > summary::-webkit-details-marker { display: none; }
.task-source > summary::before { content: "\25B8"; color: var(--brand); transition: transform .15s ease; }
.task-source[open] > summary::before { transform: rotate(90deg); }
.task-source > summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 12px; }
.task-source-body { display: grid; gap: .65rem; padding: 0 .8rem .8rem; }
.task-proposal { padding: .6rem .75rem; background: var(--warning-soft); border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0; font-weight: 600; line-height: 1.45; }
.task-proposal .task-text-label { color: var(--warning); }
.task-speech p { margin: 0; font-size: .9rem; line-height: 1.55; white-space: pre-line; }
.task-source-link { justify-self: start; font-size: .84rem; font-weight: 600; text-decoration: none; }
.task-source-link:hover { text-decoration: underline; }
.task-decided { margin: .85rem 0 0; padding-top: .7rem; border-top: 1px solid var(--border); font-size: .84rem; font-weight: 700; }
.task-decided.is-ok { color: var(--success); }
.task-decided.is-no { color: var(--muted); }
.task-actions .task-cancel:hover { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
@media (prefers-reduced-motion: reduce) { .task-source > summary::before { transition: none; } }
.task-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: .5rem .85rem; margin: .85rem 0 0; }
.task-fields div { min-width: 0; }
.task-fields dt { font-size: .66rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.task-fields dd { margin: .1rem 0 0; font-size: .9rem; font-weight: 600; overflow-wrap: anywhere; }
/* Texte copiable (appui long ou bouton « Copier »). */
.copyable-text { white-space: pre-line; overflow-wrap: anywhere; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; border-radius: 8px; transition: background-color .5s ease; cursor: copy; }
.copyable-text.is-pressing { background: var(--brand-soft); }
.copyable-bar { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-top: .4rem; }
.copyable-hint { font-size: .7rem; font-weight: 500; color: var(--muted); }
.copyable-btn { display: inline-flex; align-items: center; gap: .3rem; min-height: 30px; padding: .2rem .65rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--brand-strong); font-size: .78rem; font-weight: 700; cursor: pointer; }
.copyable-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.copyable-btn:hover { background: var(--brand-soft); }
.copy-toast { position: fixed; left: 50%; bottom: calc(5rem + env(safe-area-inset-bottom)); z-index: 100; transform: translateX(-50%); padding: .55rem 1rem; border-radius: 999px; background: #111827; color: #fff; font-size: .85rem; font-weight: 600; box-shadow: 0 8px 24px rgb(0 0 0 / .25); animation: copy-toast-in .2s ease-out; transition: opacity .35s ease; }
.copy-toast.is-leaving { opacity: 0; }
@keyframes copy-toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }
@media (prefers-reduced-motion: reduce) { .copy-toast { animation: none; } .copyable-text { transition: none; } }

/* Barre d'icônes de l'éditeur de publication. */
.emoji-bar { display: grid; grid-template-columns: repeat(auto-fill, minmax(36px, 1fr)); gap: .25rem; margin-top: .35rem; }
.emoji-btn { display: grid; place-items: center; height: 36px; padding: 0; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font-size: 1.1rem; line-height: 1; cursor: pointer; }
.emoji-btn:hover { background: var(--brand-soft); }
.emoji-btn-para { font-size: .95rem; font-weight: 700; color: var(--brand-strong); }

/* Textes longs (texte de la publication, image…) : sous les champs courts, sur toute la largeur. */
.task-fields .is-long { grid-column: 1 / -1; }
.task-fields .is-long dd { font-weight: 500; line-height: 1.45; white-space: pre-line; }
.task-raw { margin-top: .75rem; }
.task-raw > summary { cursor: pointer; font-size: .82rem; font-weight: 600; color: var(--brand); }
.task-raw pre { margin: .5rem 0 0; padding: .65rem .75rem; max-height: 260px; overflow: auto; background: #0f172a; color: #e2e8f0; border-radius: 10px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .76rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.task-error { margin: .75rem 0 0; }
.task-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; padding-top: .85rem; border-top: 1px solid var(--border); }
.task-actions .btn { min-width: 120px; }
.tasks-empty { text-align: center; padding: 1.5rem 1rem; }

@media (max-width: 640px) {
    .page-app .tasks > * + * { margin-top: .75rem; }
    .tasks-intro { font-size: .78rem; line-height: 1.45; }
    .tasks-tab { padding: .38rem .65rem; font-size: .78rem; }
    .tasks-list { gap: .65rem; }
    .page-app .task { padding: .8rem .85rem; }
    .task-head { grid-template-columns: auto minmax(0, 1fr); gap: .15rem .6rem; }
    .task-avatar { width: 2.1rem; height: 2.1rem; font-size: .66rem; }
    .task-title { font-size: .92rem; }
    .task-meta { font-size: .72rem; }
    .task-badges { grid-column: 2; flex-direction: row; flex-wrap: wrap; align-items: center; margin-top: .3rem; }
    .task-badges .badge { font-size: .68rem; }
    .task-text { margin-top: .65rem; padding: .5rem .65rem; font-size: .88rem; }
    .task-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: .65rem; }
    .task-fields dd { font-size: .84rem; }
    .task-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: .45rem; margin-top: .75rem; padding-top: .65rem; }
    .task-actions .btn { width: 100%; min-width: 0; }
    .task-source > summary { padding: .5rem .65rem; font-size: .82rem; }
    .task-source-body { padding: 0 .65rem .65rem; gap: .55rem; }
    .task-proposal { padding: .5rem .6rem; font-size: .86rem; }
    .task-speech p { font-size: .84rem; }
    .task-source-link { font-size: .78rem; }
}

/* --- Conversations WhatsApp : boîte de réception --------------------------- */
.inbox { max-width: 860px; }
.inbox > * + * { margin-top: 1rem; }
.inbox-head { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; justify-content: space-between; }
.inbox-head h1 { margin: 0; }
.inbox-alert { display: flex; align-items: center; gap: .6rem; padding: .7rem .9rem; border-radius: 12px; background: var(--danger-soft); color: var(--danger); font-weight: 600; font-size: .9rem; text-decoration: none; }
.inbox-alert:hover { color: var(--danger); filter: brightness(.97); }
.inbox-alert-dot { width: .6rem; height: .6rem; flex: none; border-radius: 50%; background: var(--danger); animation: meeting-pulse 1.4s ease-in-out infinite; }
.inbox-alert-go { margin-left: auto; white-space: nowrap; }
.inbox-tabs .tab-short { display: none; }
.inbox-tab-count { display: inline-grid; place-items: center; min-width: 1.15rem; height: 1.15rem; margin-left: .25rem; padding: 0 .3rem; border-radius: 999px; background: var(--danger); color: #fff; font-size: .66rem; font-weight: 800; }

.inbox-list { list-style: none; margin: 0; padding: .35rem; }
.inbox-list li + li { border-top: 1px solid var(--border); }
.inbox-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .8rem; align-items: center; padding: .7rem .65rem; border-radius: 12px; color: inherit; text-decoration: none; }
.inbox-row:hover { background: var(--bg); color: inherit; }
.inbox-row:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.inbox-row.is-human { box-shadow: inset 3px 0 0 var(--danger); }
.inbox-avatar { display: grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 50%; color: #fff; font-weight: 800; font-size: 1.05rem; }
.inbox-avatar-0 { background: #0f766e; }
.inbox-avatar-1 { background: #7c3aed; }
.inbox-avatar-2 { background: #db2777; }
.inbox-avatar-3 { background: #ea580c; }
.inbox-avatar-4 { background: #0369a1; }
.inbox-avatar-5 { background: #4d7c0f; }
.inbox-body { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.inbox-line { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.inbox-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .98rem; }
.inbox-time { flex: none; font-size: .74rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.inbox-preview { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .86rem; color: var(--muted); }
.inbox-unread { flex: none; display: grid; place-items: center; min-width: 1.35rem; height: 1.35rem; padding: 0 .35rem; border-radius: 999px; background: #25d366; color: #fff; font-size: .7rem; font-weight: 800; }
.inbox-row.is-unread .inbox-name { font-weight: 800; }
.inbox-row.is-unread .inbox-preview { color: var(--text); font-weight: 600; }
.inbox-row.is-unread .inbox-time { color: #128c4b; font-weight: 700; }
.inbox-tags { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .15rem; }
.inbox-tags .badge { font-size: .66rem; }
.inbox-empty { display: grid; justify-items: center; gap: .5rem; padding: 2rem 1rem; text-align: center; color: var(--muted); }
.inbox-empty svg { width: 40px; height: 40px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.inbox-empty p { margin: 0; }
@media (prefers-reduced-motion: reduce) { .inbox-alert-dot { animation: none; } }

@media (max-width: 640px) {
    .page-app .inbox > * + * { margin-top: .75rem; }
    .page-app .inbox-head h1 { font-size: 1.2rem; }
    .inbox-alert { padding: .55rem .7rem; font-size: .8rem; }
    /* Onglets : libellés courts, quatre colonnes égales, sans défilement. */
    .inbox-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .15rem; padding: .2rem; overflow: visible; border-radius: 10px; }
    .inbox-tabs .tasks-tab { display: inline-flex; align-items: center; justify-content: center; gap: .15rem; min-width: 0; padding: .4rem .2rem; font-size: .74rem; border-radius: 8px; }
    .inbox-tabs .tab-long { display: none; }
    .inbox-tabs .tab-short { display: inline; overflow: hidden; text-overflow: ellipsis; }
    .inbox-tabs .inbox-tab-count { min-width: 1rem; height: 1rem; margin-left: .1rem; font-size: .6rem; }
    .page-app .inbox-list { padding: .2rem; }
    .inbox-row { gap: .65rem; padding: .6rem .5rem; }
    .inbox-avatar { width: 2.4rem; height: 2.4rem; font-size: .95rem; }
    .inbox-name { font-size: .92rem; }
    .inbox-preview { font-size: .8rem; }
    .inbox-time { font-size: .7rem; }
}

/* --- Conversation WhatsApp (côté boutique) --------------------------------- */
.chat { max-width: 760px; margin-inline: auto; }
.chat > * + * { margin-top: .75rem; }
.chat-window { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); box-shadow: 0 8px 28px rgb(0 0 0 / .07); }
.chat-head { display: flex; align-items: center; gap: .7rem; padding: .75rem .9rem; border-bottom: 1px solid var(--border); }
.chat-avatar { flex: none; }
.chat-head-main { flex: 1; min-width: 0; }
.chat-head h1 { margin: 0; font-size: 1.15rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-head-meta { display: flex; flex-wrap: wrap; gap: .1rem .6rem; margin: .1rem 0 0; font-size: .8rem; }
.chat-head-meta a { text-decoration: none; font-weight: 600; }
.chat-head-meta a:hover { text-decoration: underline; }
.chat-mode { flex: none; }
.chat-mode .btn { white-space: nowrap; }

.chat-status { display: flex; flex-wrap: wrap; gap: .35rem; padding: .55rem .9rem; background: var(--bg); border-bottom: 1px solid var(--border); }
.chat-pill { display: inline-flex; align-items: center; gap: .35rem; padding: .18rem .6rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: .72rem; font-weight: 700; color: var(--muted); }
.chat-pill::before { content: ""; width: .45rem; height: .45rem; border-radius: 50%; background: currentColor; }
.chat-pill.is-bot { color: var(--brand-strong); border-color: var(--brand-soft); background: var(--brand-soft); }
.chat-pill.is-human { color: #0369a1; border-color: #bae6fd; background: #e0f2fe; }
.chat-pill.is-open { color: var(--success); border-color: var(--success-soft); background: var(--success-soft); }
.chat-pill.is-closed { color: var(--warning); border-color: var(--warning-soft); background: var(--warning-soft); }
.chat-notice { margin: 0; padding: .5rem .9rem; background: #e0f2fe; color: #075985; font-size: .8rem; border-bottom: 1px solid #bae6fd; }
.chat-notice.is-danger { background: var(--danger-soft); color: var(--danger); border-bottom-color: transparent; }

.chat-screen { min-height: 320px; max-height: 60vh; overflow-y: auto; padding: .9rem; background: #efeae2 radial-gradient(rgb(0 0 0 / .035) 1px, transparent 1px) 0 0 / 14px 14px; }
.chat-screen .wa-thread { max-height: none; overflow: visible; padding: 0; }
/* Vu de la boutique : client à gauche (blanc), réponses à droite (vert ; bleu pour vos messages). */
.wa-as-shop .wa-msg { max-width: 80%; border: 0; box-shadow: 0 1px 1px rgb(0 0 0 / .08); }
.wa-as-shop .wa-in { background: #fff; border-radius: 4px 10px 10px 10px; }
.wa-as-shop .wa-out { background: #d9fdd3; border-radius: 10px 4px 10px 10px; }
.wa-as-shop .wa-human { background: #dbeafe; }
.wa-as-shop .wa-in .wa-meta { color: #128c4b; }
.wa-as-shop .wa-agent .wa-meta { color: var(--brand-strong); }
.wa-as-shop .wa-human .wa-meta { color: #1d4ed8; }
.wa-as-shop .wa-text { font-size: .92rem; }
.wa-as-client .wa-foot { justify-content: flex-end; }

.chat-compose { padding: .6rem .7rem; border-top: 1px solid var(--border); background: var(--surface); }
.chat-compose-row { display: flex; align-items: flex-end; gap: .45rem; }
.chat-compose textarea, .page-app .chat-compose textarea { flex: 1; min-width: 0; min-height: 44px; max-height: 160px; padding: .6rem .9rem; border: 1px solid var(--border); border-radius: 22px; background: var(--bg); resize: none; field-sizing: content; font: inherit; font-size: 16px; line-height: 1.4; }
.chat-compose textarea:focus { border-color: #25d366; outline: none; box-shadow: 0 0 0 3px #d9fdd3; }
.chat-takeover { display: flex; align-items: center; gap: .45rem; margin: .45rem .3rem 0; font-size: .76rem; color: var(--muted); cursor: pointer; }
.chat-takeover input { width: 16px; height: 16px; accent-color: var(--brand); flex: none; }
.chat-locked { margin: 0; padding: .8rem .9rem; border-top: 1px solid var(--border); background: var(--warning-soft); color: var(--warning); font-size: .82rem; font-weight: 600; text-align: center; }

@media (max-width: 640px) {
    .page-app .chat > * + * { margin-top: .5rem; }
    .chat-window { border-radius: 14px; }
    .chat-head { gap: .55rem; padding: .6rem .7rem; }
    .chat-avatar { width: 2.3rem; height: 2.3rem; font-size: .9rem; }
    .page-app .chat-head h1 { font-size: 1rem; }
    .chat-head-meta { font-size: .72rem; }
    .chat-mode .btn { min-height: 32px; padding: .2rem .55rem; font-size: .74rem; }
    .chat-status { padding: .45rem .7rem; gap: .3rem; }
    .chat-pill { font-size: .64rem; padding: .15rem .5rem; }
    .chat-notice { padding: .45rem .7rem; font-size: .74rem; }
    .chat-screen { min-height: 260px; max-height: 52vh; padding: .65rem; }
    .wa-as-shop .wa-msg { max-width: 88%; }
    .wa-as-shop .wa-text { font-size: .86rem; }
    .chat-compose { padding: .45rem .5rem; }
    .page-app .chat-compose textarea { min-height: 40px; padding: .5rem .75rem; }
    .chat-compose .sim-send { width: 40px; height: 40px; }
    .chat-takeover { font-size: .7rem; }
    .chat-locked { font-size: .76rem; padding: .65rem .7rem; }
}

/* --- Simulateur WhatsApp (écran de discussion vu par le client) ------------ */
.sim { max-width: 640px; margin-inline: auto; }
.sim > * + * { margin-top: 1rem; }
.sim-head h1 { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 0 0 .3rem; }
.sim-head h1 .badge { font-size: .68rem; }
.sim-intro { margin: 0; line-height: 1.5; }
.sim-connect { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; }
.sim-connect p { margin: 0; }

.sim-phone { overflow: hidden; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); box-shadow: 0 8px 28px rgb(0 0 0 / .08); }
.sim-bar { display: flex; align-items: center; gap: .65rem; padding: .65rem .85rem; background: #075e54; color: #fff; }
.sim-bar-avatar { display: grid; place-items: center; width: 2.3rem; height: 2.3rem; flex: none; border-radius: 50%; background: rgb(255 255 255 / .2); font-weight: 800; }
.sim-bar-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.sim-bar-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sim-bar-text span { font-size: .74rem; opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sim-bar-open { flex: none; padding: .3rem .6rem; border-radius: 999px; background: rgb(255 255 255 / .15); color: #fff; font-size: .78rem; font-weight: 700; text-decoration: none; }
.sim-bar-open:hover { background: rgb(255 255 255 / .28); color: #fff; }

.sim-screen { min-height: 300px; max-height: 58vh; overflow-y: auto; padding: .85rem; background: #efeae2 radial-gradient(rgb(0 0 0 / .035) 1px, transparent 1px) 0 0 / 14px 14px; }
.sim-screen .wa-thread { max-height: none; overflow: visible; padding: 0; }
.sim-hint { margin: 2.5rem auto 0; max-width: 300px; padding: .6rem .85rem; border-radius: 10px; background: #fff8c5; color: #5c4b00; text-align: center; font-size: .84rem; box-shadow: var(--shadow); }

/* Vu du client : ses messages à droite (vert), ceux de la boutique à gauche (blanc). */
.wa-as-client .wa-msg { max-width: 82%; border: 0; box-shadow: 0 1px 1px rgb(0 0 0 / .08); }
.wa-as-client .wa-in { align-self: flex-end; background: #d9fdd3; border-radius: 10px 4px 10px 10px; }
.wa-as-client .wa-out { align-self: flex-start; background: #fff; border-radius: 4px 10px 10px 10px; }
.wa-as-client .wa-human { background: #fff; box-shadow: inset 3px 0 0 #0ea5e9, 0 1px 1px rgb(0 0 0 / .08); }
.wa-as-client .wa-meta { font-size: .66rem; }
.wa-as-client .wa-text { font-size: .9rem; line-height: 1.45; }

.sim-suggest { display: flex; gap: .4rem; padding: .55rem .65rem 0; overflow-x: auto; scrollbar-width: none; background: var(--surface); }
.sim-suggest::-webkit-scrollbar { display: none; }
.sim-chip { flex: none; padding: .3rem .7rem; border: 1px solid var(--border); border-radius: 999px; background: var(--bg); color: var(--text); font: inherit; font-size: .78rem; font-weight: 600; cursor: pointer; }
.sim-chip:hover { border-color: #25d366; background: #e7fbe9; }
.sim-chip:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.sim-compose { display: flex; align-items: flex-end; gap: .45rem; padding: .55rem .65rem; background: var(--surface); }
.sim-compose textarea, .page-app .sim-compose textarea { flex: 1; min-width: 0; min-height: 44px; max-height: 140px; padding: .6rem .9rem; border: 1px solid var(--border); border-radius: 22px; background: var(--bg); resize: none; field-sizing: content; font: inherit; font-size: 16px; line-height: 1.4; }
.sim-compose textarea:focus { border-color: #25d366; outline: none; box-shadow: 0 0 0 3px #d9fdd3; }
.sim-send { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border: 0; border-radius: 50%; background: #25d366; color: #fff; cursor: pointer; }
.sim-send:hover { background: #1ebe5a; }
.sim-send:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.sim-send svg { width: 20px; height: 20px; fill: currentColor; }

.sim-client { border-top: 1px solid var(--border); background: var(--surface); }
.sim-client > summary { padding: .6rem .85rem; cursor: pointer; font-size: .8rem; color: var(--muted); }
.sim-client > summary strong { color: var(--text); }
.sim-client[open] > summary { border-bottom: 1px dashed var(--border); }
.sim-client-fields { display: grid; gap: 0 .75rem; padding: .7rem .85rem 0; }
@media (min-width: 520px) { .sim-client-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.sim-client-fields input { width: 100%; }
.sim-client > p { margin: 0; padding: 0 .85rem .75rem; }

@media (max-width: 640px) {
    .page-app .sim > * + * { margin-top: .75rem; }
    .page-app .sim-head h1 { font-size: 1.2rem; }
    .sim-intro { font-size: .76rem; line-height: 1.4; }
    .sim-phone { border-radius: 14px; }
    .sim-bar { padding: .55rem .7rem; }
    .sim-bar-avatar { width: 2rem; height: 2rem; font-size: .85rem; }
    .sim-screen { min-height: 260px; max-height: 52vh; padding: .65rem; }
    .wa-as-client .wa-msg { max-width: 88%; }
    .wa-as-client .wa-text { font-size: .86rem; }
    .sim-compose { padding: .45rem .5rem; gap: .35rem; }
    .page-app .sim-compose textarea { min-height: 40px; padding: .5rem .75rem; }
    .sim-send { width: 40px; height: 40px; }
}

/* --- Équipe ---------------------------------------------------------------- */
.team { max-width: 860px; }
.team > * + * { margin-top: 1.1rem; }
.team-head { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center; justify-content: space-between; }
.team-head h1 { margin: 0; }
.team-seats { display: grid; gap: .3rem; min-width: 180px; padding: .5rem .8rem; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); }
.team-seats-value { font-size: .82rem; font-weight: 700; }
.team-seats.is-full .team-seats-value { color: var(--warning); }
.team-seats .meter { height: 6px; }
.team-seats-up { font-size: .76rem; font-weight: 700; text-decoration: none; }
.team-card { padding: 1rem 1.15rem; }
.team-card .card-title { margin-bottom: .5rem; }

.team-list { list-style: none; margin: 0; padding: 0; }
.team-member { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "avatar id status" "avatar controls controls"; gap: .35rem .8rem; align-items: center; padding: .85rem 0; }
.team-member + .team-member { border-top: 1px solid var(--border); }
.team-member.is-inactive { opacity: .6; }
.team-avatar { grid-area: avatar; align-self: start; display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%; background: var(--brand); color: #fff; font-size: .82rem; font-weight: 800; }
.team-avatar.is-owner { background: var(--brand-strong); box-shadow: 0 0 0 3px var(--brand-soft); }
.team-avatar.is-invited { background: var(--warning-soft); color: var(--warning); font-size: 1rem; }
.team-identity { grid-area: id; display: flex; flex-direction: column; min-width: 0; }
.team-identity strong { overflow-wrap: anywhere; }
.team-email { font-size: .8rem; color: var(--muted); overflow-wrap: anywhere; }
.team-email-main { font-weight: 700; }
.team-status { grid-area: status; justify-self: end; }
.team-controls { grid-area: controls; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem; }
.team-role { display: flex; align-items: center; gap: .4rem; }
.team-role select { width: auto; min-width: 9rem; min-height: 36px; padding: .3rem 1.8rem .3rem .65rem; }
.team-link { padding: 0; border: 0; background: none; font: inherit; font-size: .84rem; font-weight: 700; color: var(--brand); cursor: pointer; }
.team-link:hover { text-decoration: underline; }
.team-link.is-danger { color: var(--danger); }
.team-link:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

.team-invite-form { display: grid; gap: .85rem; }
.team-invite-form .field { margin: 0; }
.team-invite-form input[type=email] { width: 100%; }
.team-invite-form .btn { justify-self: start; min-width: 220px; }
/* Choix du rôle : cartes à cocher avec leur description. */
.team-role-choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .5rem; margin: 0; padding: 0; border: 0; min-width: 0; }
.team-role-choice legend { padding: 0; margin-bottom: .35rem; font-weight: 600; font-size: .9rem; }
.team-role-card { position: relative; display: flex; gap: .6rem; align-items: flex-start; padding: .65rem .75rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.team-role-card input { width: 18px; height: 18px; margin: .1rem 0 0; flex: none; accent-color: var(--brand); }
.team-role-card span { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.team-role-card strong { font-size: .92rem; }
.team-role-card small { font-size: .76rem; color: var(--muted); line-height: 1.35; }
.team-role-card:hover { border-color: var(--brand); }
.team-role-card:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand); }
.team-role-card:has(input:checked) strong { color: var(--brand-strong); }
.team-role-card:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .team-role-card { transition: none; } }

@media (max-width: 640px) {
    .page-app .team > * + * { margin-top: .7rem; }
    /* En-tête : quota en barre fine sous le titre. */
    .team-head { gap: .45rem; }
    .page-app .team-head h1 { font-size: 1.2rem; }
    .team-seats { flex: 1 1 100%; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .3rem .6rem; min-width: 0; padding: .45rem .65rem; border-radius: 10px; box-shadow: none; }
    .team-seats-value { font-size: .72rem; white-space: nowrap; }
    .team-seats .meter { height: 5px; }
    .team-seats-up { font-size: .7rem; white-space: nowrap; }

    .page-app .team-card { padding: .75rem .8rem; }
    .team-card .card-title { margin-bottom: .2rem; }
    .team-member { gap: .25rem .6rem; padding: .65rem 0; }
    .team-avatar { width: 2.1rem; height: 2.1rem; font-size: .7rem; }
    .team-avatar.is-owner { box-shadow: 0 0 0 2px var(--brand-soft); }
    .team-identity strong { font-size: .9rem; }
    .team-email { font-size: .72rem; }
    .team-status { font-size: .62rem; padding: .05rem .45rem; }
    .team-controls { gap: .4rem; margin-top: .15rem; }
    .team-controls > .badge { font-size: .68rem; }
    /* Rôle + Modifier + Désactiver sur une seule ligne. */
    .team-role { flex: 1 1 auto; min-width: 0; gap: .3rem; }
    .page-app .team-role select { flex: 1; min-width: 0; min-height: 34px; padding: .2rem 1.5rem .2rem .5rem; font-size: 16px; border-radius: 8px; }
    .page-app .team-role .btn { min-height: 34px; padding: .2rem .6rem; font-size: .76rem; border-radius: 8px; }
    .team-link { min-height: 34px; padding: 0 .55rem; border: 1px solid var(--border); border-radius: 8px; font-size: .74rem; }
    .team-link.is-danger { border-color: var(--danger-soft); background: var(--danger-soft); }

    .team-invite-form { gap: .7rem; }
    .team-role-choice { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; }
    .team-role-choice legend { font-size: .85rem; }
    .team-role-card { flex-direction: column; gap: .3rem; padding: .55rem .6rem; }
    .team-role-card input { width: 16px; height: 16px; position: absolute; top: .55rem; right: .55rem; margin: 0; }
    .team-role-card strong { font-size: .86rem; padding-right: 1.2rem; }
    .team-role-card small { font-size: .7rem; }
    .team-invite-form .btn { width: 100%; min-width: 0; }
}

/* --- Abonnement ------------------------------------------------------------ */
.bill { max-width: 920px; }
.bill > * + * { margin-top: 1.1rem; }
.bill h1 { margin: 0; }
.bill-section { padding: 1rem 1.15rem; }
.bill-section .card-title { margin-bottom: .6rem; }

/* Résumé */
.bill-summary { display: grid; gap: 1rem; padding: 1.1rem 1.2rem; border-top: 3px solid var(--brand); }
.bill-summary.is-danger { border-top-color: var(--danger); }
@media (min-width: 760px) { .bill-summary { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: center; } .bill-summary > .bill-pay, .bill-summary > .bill-note, .bill-summary > .bill-alert { grid-column: 1 / -1; } }
.bill-plan { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.bill-plan .card-title { margin: 0; }
.bill-plan-name { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem; }
.bill-plan-name strong { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; margin-right: .2rem; }
.bill-price { font-size: 1rem; font-weight: 700; color: var(--brand-strong); }
.bill-price small { font-weight: 500; color: var(--muted); }
.bill-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; margin: 0; }
.bill-facts div { padding: .6rem .75rem; background: var(--bg); border-radius: 12px; }
.bill-facts dt { font-size: .66rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.bill-facts dd { margin: .15rem 0 0; font-size: 1.1rem; font-weight: 800; }
.bill-facts dd.is-due { color: var(--danger); }
.bill-alert { margin: 0; padding: .55rem .75rem; border-radius: 10px; background: var(--danger-soft); color: var(--danger); font-size: .84rem; font-weight: 600; }
.bill-note { margin: 0; font-size: .82rem; color: var(--muted); }
.bill-wave { min-height: 48px; font-size: 1rem; background: #1dc8f2; border-color: #1dc8f2; color: #04293a; }
.bill-wave:hover { background: #12b3db; border-color: #12b3db; color: #04293a; }

.bill-pending { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem .8rem; padding: .65rem .85rem; border-radius: 12px; background: #e0f2fe; color: #075985; font-size: .86rem; font-weight: 600; }
.bill-link { padding: 0; border: 0; background: none; font: inherit; font-size: .84rem; font-weight: 700; color: var(--brand); cursor: pointer; text-align: left; }
.bill-link:hover { text-decoration: underline; }
.bill-pending .bill-link { color: #075985; }

/* Formules */
.bill-rules { margin: 0 0 .9rem; padding: 0; list-style: none; display: grid; gap: .3rem; font-size: .8rem; color: var(--muted); }
.bill-rules strong { color: var(--text); }
.bill-plans { display: grid; gap: .65rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.bill-plan-card { display: flex; flex-direction: column; gap: .3rem; padding: .85rem .9rem; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.bill-plan-card.is-current { border-color: var(--brand); background: var(--brand-soft); }
.bill-plan-card.is-up { border-color: #bbf7d0; }
.bill-plan-card-head { display: flex; align-items: center; justify-content: space-between; gap: .4rem; }
.bill-plan-card-head strong { font-size: 1.05rem; }
.bill-plan-card-price { font-size: 1.15rem; font-weight: 800; }
.bill-plan-card p { margin: 0; flex: 1; font-size: .8rem; color: var(--muted); }
.bill-plan-card .btn { margin-top: .35rem; width: 100%; }
.bill-cycle { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .9rem; padding-top: .8rem; border-top: 1px dashed var(--border); }

/* Historique de facturation : un paiement par ligne, avec sa facture. */
.bill-history > * + * { margin-top: .75rem; }
.bill-history-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.bill-history-head .card-title { margin: 0; }
.bill-tabs { box-shadow: none; }
.bill-paid { margin: 0; padding: .55rem .75rem; border-radius: 10px; background: var(--success-soft); color: var(--success); font-size: .84rem; }
.bill-paid strong { font-size: .98rem; }
.bill-list { list-style: none; margin: 0; padding: 0; }
.bill-row { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(150px, auto); gap: .2rem .9rem; align-items: center; padding: .65rem 0; border-top: 1px solid var(--border); }
.bill-month { padding: .85rem 0 .25rem; font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--brand-strong); }
.bill-month:first-child { padding-top: 0; }
.bill-month + .bill-row { border-top: 0; }
.bill-status { font-weight: 700; }
.bill-status.is-ok { color: var(--success); }
.bill-status.is-ko { color: var(--danger); }
.bill-status.is-wait { color: var(--warning); }
.bill-invoice { display: flex; align-items: center; justify-content: flex-end; gap: .45rem; font-size: .74rem; color: var(--muted); }
.bill-noinvoice { font-style: italic; }
.bill-list-main { display: flex; flex-direction: column; min-width: 0; }
.bill-list-main strong { font-size: .88rem; overflow-wrap: anywhere; }
.bill-list-main span { font-size: .74rem; color: var(--muted); }
.bill-list-amount { font-weight: 700; font-size: .9rem; white-space: nowrap; }
.bill-pdf { padding: .2rem .55rem; border: 1px solid var(--border); border-radius: 8px; font-size: .74rem; font-weight: 700; text-decoration: none; }
.bill-pdf:hover { border-color: var(--brand); }
.bill-empty { margin: 0; font-size: .84rem; color: var(--muted); }

/* Résiliation, à part et discrète */
.bill-cancel { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; padding: .85rem 1rem; border: 1px dashed var(--border); border-radius: 14px; }
.bill-cancel > div { display: flex; flex-direction: column; min-width: 0; }
.bill-cancel span { font-size: .8rem; color: var(--muted); }
.bill-cancel-btn:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-soft); }

@media (max-width: 640px) {
    .page-app .bill > * + * { margin-top: .75rem; }
    .page-app .bill h1 { font-size: 1.2rem; }
    .page-app .bill-summary { gap: .7rem; padding: .85rem .85rem; }
    .bill-plan-name strong { font-size: 1.25rem; }
    .bill-plan-name .badge { font-size: .64rem; }
    .bill-price { font-size: .9rem; }
    .bill-facts { gap: .45rem; }
    .bill-facts div { padding: .5rem .6rem; border-radius: 10px; }
    .bill-facts dt { font-size: .58rem; }
    .bill-facts dd { font-size: .98rem; }
    .bill-wave { min-height: 44px; font-size: .95rem; }
    .page-app .bill-section { padding: .8rem .85rem; }
    .bill-rules { font-size: .74rem; margin-bottom: .7rem; }
    .bill-plans { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .5rem; }
    .bill-plan-card { padding: .7rem .7rem; border-radius: 12px; }
    .bill-plan-card-head strong { font-size: .95rem; }
    .bill-plan-card-head .badge { font-size: .6rem; padding: .05rem .4rem; }
    .bill-plan-card-price { font-size: 1rem; }
    .bill-plan-card p { font-size: .72rem; }
    .bill-plan-card .btn { min-height: 36px; font-size: .78rem; padding: .2rem .4rem; }
    .bill-cycle { font-size: .78rem; }
    .bill-cycle .bill-link { font-size: .78rem; }
    /* Ligne : intitulé + montant, puis date/statut + facture en dessous. */
    .bill-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "main amount" "main invoice"; gap: .15rem .6rem; padding: .55rem 0; }
    .bill-row .bill-list-main { grid-area: main; }
    .bill-row .bill-list-amount { grid-area: amount; justify-self: end; font-size: .84rem; }
    .bill-row .bill-invoice { grid-area: invoice; font-size: .66rem; gap: .35rem; }
    .bill-list-main strong { font-size: .84rem; }
    .bill-list-main span { font-size: .7rem; }
    .bill-pdf { padding: .12rem .45rem; font-size: .68rem; }
    .bill-month { font-size: .62rem; padding-top: .7rem; }
    .bill-paid { font-size: .76rem; padding: .45rem .6rem; }
    .bill-paid strong { font-size: .88rem; }
    .bill-tabs .tasks-tab { padding: .35rem .5rem; font-size: .76rem; }
    .bill-cancel { padding: .7rem .8rem; }
    .bill-cancel form, .bill-cancel .btn { width: 100%; }
}
.bill-link.is-danger { color: var(--danger); }

/* --- Aide et support : liste des demandes ---------------------------------- */
.help { max-width: 860px; }
.help > * + * { margin-top: 1rem; }
.help-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; }
.help-head h1 { margin: 0; }
.help-ways { display: grid; gap: .6rem; }
@media (min-width: 640px) { .help-ways { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.help-way { display: flex; align-items: center; gap: .7rem; padding: .7rem .85rem; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.help-way > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.help-way strong { font-size: .88rem; }
.help-way small { font-size: .76rem; color: var(--muted); line-height: 1.35; }
.help-way-icon { display: grid; place-items: center; width: 2.3rem; height: 2.3rem; flex: none; border-radius: 10px; background: var(--brand-soft); }
.help-way-icon svg { width: 20px; height: 20px; fill: none; stroke: var(--brand-strong); stroke-width: 1.8; stroke-linejoin: round; }
.help-way.is-wa .help-way-icon { background: #dcfce7; }
.help-way.is-wa .help-way-icon svg { stroke: #128c4b; }

.help-card { padding: 1rem 1.1rem; }
.help-list-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem; margin-bottom: .35rem; }
.help-list-head .card-title { display: flex; align-items: center; gap: .4rem; margin: 0; }
.help-unread { font-size: .74rem; font-weight: 700; color: #1d4ed8; }
.help-list { list-style: none; margin: 0; padding: 0; }
.help-list li + li { border-top: 1px solid var(--border); }
.help-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .65rem; align-items: center; padding: .75rem .5rem; margin: 0 -.5rem; border-radius: 12px; color: inherit; text-decoration: none; }
.help-row:hover { background: var(--bg); color: inherit; }
.help-row:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.help-row-dot { width: .55rem; height: .55rem; border-radius: 50%; background: transparent; }
.help-row.is-unread .help-row-dot { background: #2563eb; box-shadow: 0 0 0 3px #dbeafe; }
.help-row-main { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.help-row-line { display: flex; align-items: flex-start; justify-content: space-between; gap: .6rem; }
.help-row-line strong { min-width: 0; font-size: .95rem; line-height: 1.35; overflow-wrap: anywhere; }
.help-row-line .badge { flex: none; }
.help-row.is-unread .help-row-line strong { font-weight: 800; }
.help-row-meta { display: flex; flex-wrap: wrap; gap: .1rem .45rem; font-size: .74rem; color: var(--muted); }
.help-row-meta > span + span::before { content: "·"; margin-right: .45rem; }
.help-row-meta .mono { font-size: .72rem; }
.help-row-wa { color: #128c4b; font-weight: 700; }
.help-row-go { font-size: 1.4rem; line-height: 1; color: var(--brand); }
.help-empty { display: grid; justify-items: center; gap: .6rem; padding: 1.5rem 1rem; text-align: center; color: var(--muted); }
.help-empty p { margin: 0; }

@media (max-width: 640px) {
    .page-app .help > * + * { margin-top: .75rem; }
    .page-app .help-head h1 { font-size: 1.2rem; }
    .help-ways { gap: .45rem; }
    .help-way { padding: .55rem .65rem; gap: .55rem; }
    .help-way-icon { width: 2rem; height: 2rem; }
    .help-way-icon svg { width: 17px; height: 17px; }
    .help-way strong { font-size: .82rem; }
    .help-way small { font-size: .7rem; }
    .page-app .help-card { padding: .8rem .85rem; }
    .help-row { gap: .5rem; padding: .65rem .4rem; margin: 0 -.4rem; }
    .help-row-line strong { font-size: .88rem; }
    .help-row-line .badge { font-size: .62rem; }
    .help-row-meta { font-size: .68rem; }
}

/* --- Commande en ligne : modification et livraison ratée ------------------- */
.oedit { max-width: 760px; }
.oedit > * + * { margin-top: .9rem; }
.oedit-head h1 { margin: 0 0 .2rem; }
.oedit-head p { margin: 0; }
.oedit-flash { margin: 0; }
.oedit-form { display: grid; gap: .9rem; }
.oedit-card, .oedit-search { padding: 1rem 1.1rem; }
.oedit-label { display: block; margin-bottom: .35rem; font-weight: 700; font-size: .88rem; }
.oedit-search-row { display: flex; gap: .45rem; }
.oedit-search-row input { flex: 1; min-width: 0; }
.oedit-lines { list-style: none; margin: 0; padding: 0; }
.oedit-lines li { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .6rem 0; }
.oedit-lines li + li { border-top: 1px solid var(--border); }
.oedit-line-main { display: flex; flex-direction: column; min-width: 0; }
.oedit-line-main strong { font-size: .9rem; overflow-wrap: anywhere; }
.oedit-line-main span { font-size: .74rem; color: var(--muted); }
.oedit-qty-group { display: flex; align-items: center; gap: .35rem; flex: none; }
.oedit-qty input, .page-app .oedit-qty input { width: 4.2rem; min-height: 38px; padding: .25rem .4rem; text-align: center; font-size: 16px; font-weight: 700; }
.oedit-remove { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--danger); cursor: pointer; }
.oedit-remove:hover { border-color: var(--danger); background: var(--danger-soft); }
.oedit-help { margin: .55rem 0 0; font-size: .74rem; color: var(--muted); }
.oedit-card .field { margin-bottom: .7rem; }
.oedit-card .field:last-child { margin-bottom: 0; }
.oedit-card select, .oedit-card .field input { width: 100%; }
.oedit-actions { display: flex; justify-content: flex-end; gap: .5rem; }
.order-fold { margin-top: .85rem; padding-top: .7rem; border-top: 1px solid var(--border); }
.order-fold > summary { cursor: pointer; font-weight: 700; font-size: .88rem; color: var(--warning); }
.order-fold-form { display: grid; gap: .6rem; margin-top: .6rem; }
.order-fold-form .btn { justify-self: start; }
.order-reasons { display: flex; flex-wrap: wrap; gap: .35rem; }
.order-reason { position: relative; cursor: pointer; }
.order-reason input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.order-reason span { display: inline-block; padding: .3rem .7rem; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: .8rem; font-weight: 600; }
.order-reason input:checked + span { border-color: var(--accent); background: var(--warning-soft); color: var(--warning); }
.order-reason input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.order-reschedule { display: grid; gap: .35rem; margin-top: .85rem; }
.order-reschedule label { font-weight: 700; font-size: .86rem; }
.order-reschedule label .muted { font-weight: 400; font-size: .78rem; }
.order-reschedule-row { display: flex; flex-wrap: wrap; gap: .45rem; }
.order-reschedule-row input { width: auto; }
.order-return { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .85rem; padding-top: .7rem; border-top: 1px solid var(--border); }
@media (max-width: 640px) {
    .page-app .oedit > * + * { margin-top: .65rem; }
    .page-app .oedit-head h1 { font-size: 1.15rem; }
    .page-app .oedit-card, .page-app .oedit-search { padding: .8rem .85rem; }
    .oedit-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
    .oedit-actions .btn { width: 100%; }
    .order-fold-form .btn, .order-reschedule-row .btn, .order-return .btn { width: 100%; }
    .order-reschedule-row input { flex: 1; }
}

/* --- Fiche commande ----------------------------------------------------------- */
.oshow-head h1 { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.oshow-meta { margin: .2rem 0 .75rem; }
.oshow-table tfoot td { border-bottom: 0; }
.oshow-total td { border-top: 1px solid var(--border); font-size: 1.05rem; }
.oshow-payment { margin: .5rem 0 0; padding: .45rem .6rem; border-radius: 10px; background: var(--bg); }
.oshow-customer-id { margin-bottom: .4rem; line-height: 1.5; }
.oshow-customer-id a { text-decoration: none; font-weight: 600; }
.oshow-address { display: flex; gap: .35rem; padding: .45rem .6rem; border-radius: 10px; background: var(--bg); }
.oshow-contact { margin-top: .5rem; }
.oshow-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .45rem; }
.oshow-steps form, .oshow-steps .btn { width: 100%; }
@media (max-width: 760px) {
    .page-app .oshow-head { flex-wrap: nowrap; align-items: center; }
    .page-app .oshow-head h1 { font-size: 1.1rem; gap: .3rem; min-width: 0; }
    .page-app .oshow-head h1 .badge { font-size: .62rem; padding: .05rem .4rem; }
    .page-app .oshow-head .btn-small { flex: none; min-height: 30px; padding: .2rem .55rem; font-size: .74rem; border-radius: 8px; white-space: nowrap; }
    .page-app .oshow-meta { font-size: .72rem; margin-bottom: .5rem; }
    .page-app .oshow { gap: .55rem; }
    .page-app .oshow .card, .page-app .oshow-next { padding: .65rem .7rem; }
    .page-app .oshow .card-title, .page-app .oshow-next .card-title { font-size: .62rem; margin-bottom: .3rem; }
    .page-app .oshow-items .spread .btn-small { min-height: 28px; padding: .1rem .55rem; font-size: .74rem; border-radius: 7px; }
    .page-app .oshow-table { font-size: .8rem; }
    .page-app .oshow-table td { padding: .35rem .25rem; vertical-align: top; }
    .page-app .oshow-table td:last-child { text-align: right; }
    .page-app .oshow-table td.nowrap:not(:last-child) { color: var(--muted); font-size: .74rem; }
    .page-app .oshow-total td { font-size: .9rem; padding-top: .45rem; }
    .page-app .oshow-payment { font-size: .74rem; padding: .35rem .5rem; }
    .page-app .oshow-customer-id { font-size: .86rem; margin-bottom: .35rem; }
    .page-app .oshow-address { font-size: .8rem; padding: .35rem .5rem; margin-bottom: .4rem; }
    .page-app .oshow-customer p.small { font-size: .74rem; margin-bottom: .35rem; }
    .page-app .oshow-contact { flex-wrap: nowrap; gap: .5rem; margin-top: .4rem; }
    .page-app .oshow-contact .btn { flex: 1 1 auto; min-height: 34px; padding: .2rem .5rem; font-size: .76rem; border-radius: 8px; white-space: nowrap; }
    .page-app .oshow-contact .btn-link { flex: none; font-size: .74rem; white-space: nowrap; }
    .page-app .oshow-next { margin-top: .55rem !important; }
    .page-app .oshow-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .35rem; }
    .page-app .oshow-steps .btn { min-height: 36px; font-size: .8rem; border-radius: 8px; }
    .page-app .order-ship { gap: .4rem; margin-top: .65rem; padding-top: .6rem; }
    .page-app .order-ship-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 .45rem; }
    .page-app .order-ship-grid .field:first-child, .page-app .order-ship-grid .order-ship-name { grid-column: 1 / -1; }
    .page-app .order-ship-grid .field { margin-bottom: .4rem; }
    .page-app .order-ship-grid label { font-size: .74rem; margin-bottom: .1rem; }
    .page-app .order-ship-grid select, .page-app .order-ship-grid input { min-height: 36px; padding: .3rem .5rem; font-size: 14px; border-radius: 8px; }
    .page-app .order-ship .btn, .page-app .oshow-next .cancel-form .btn { min-height: 38px; font-size: .82rem; border-radius: 8px; }
    .page-app .oshow-next .cancel-form-label { font-size: .62rem; }
    .page-app .oshow-next .cancel-form textarea { min-height: 36px; font-size: 14px; border-radius: 8px; }
    .page-app .order-fold > summary, .page-app .order-reschedule label { font-size: .8rem; }
    .page-app .order-reason span { font-size: .72rem; padding: .25rem .55rem; }
}

/* --- Nouvelle commande saisie par l'équipe --------------------------------- */
/* Même présentation que la caisse (.pos, .pos-item, .pos-line) ; ajouts ci-dessous. */
.onew-head h1 { margin: 0; }
.onew-intro { margin: .2rem 0 .75rem; }
.onew-add { display: contents; }
.onew-add .pos-item { width: 100%; height: 100%; transition: border-color .15s ease, background .15s ease; }
.pos-item.is-added { border-color: var(--brand); background: var(--brand-soft); }
.onew-offline { color: var(--warning); font-size: .72rem; }
.onew-cart .pos-qty form { display: contents; }
.onew-cart .pos-remove { margin: 0; }
.onew-cart .pos-remove button { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; color: var(--danger); }
.onew-cart .spread form { margin: 0; }
.onew-cart .pos-totals { margin-top: .75rem; }
.onew-form { margin-top: .5rem; }
.onew-form .card-title { margin-top: 1rem; }
.onew-form .field { margin-bottom: .6rem; }
.onew-form input, .onew-form select { width: 100%; }
.onew-grid { display: grid; gap: 0 .6rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.onew-pay { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .4rem; margin: 0 0 .6rem; padding: 0; border: 0; min-width: 0; }
@media (max-width: 760px) {
    .page-app .onew-head { flex-wrap: nowrap; margin-bottom: .2rem; }
    .page-app .onew-head h1 { font-size: 1.15rem; }
    .page-app .onew-head .btn-small { min-height: 30px; padding: .2rem .55rem; font-size: .74rem; border-radius: 8px; white-space: nowrap; }
    .page-app .onew-intro { font-size: .72rem; margin-bottom: .5rem; }
    .page-app .onew-cart .pos-remove { width: 26px; height: 30px; }
    .page-app .onew-form .card-title { margin-top: .75rem; }
    .page-app .onew-form .field { margin-bottom: .4rem; }
    .page-app .onew-form .field > label { font-size: .74rem; margin-bottom: .1rem; }
    .page-app .onew-form input:not([type=radio]), .page-app .onew-form select { min-height: 36px; padding: .3rem .55rem; font-size: 14px; }
    .page-app .onew-form p.small { font-size: .7rem; margin-bottom: .3rem; }
    .page-app .onew-pay .team-role-card { padding: .4rem .55rem; }
    .page-app .onew-pay .team-role-card strong { font-size: .8rem; }
    .page-app .onew-pay .team-role-card small { font-size: .68rem; }
}

/* --- Livraisons : remise au livreur, tournée, remise de caisse ------------- */
.order-ship { display: grid; gap: .6rem; margin-top: .85rem; padding-top: .75rem; border-top: 1px solid var(--border); }
.order-ship-grid { display: grid; gap: 0 .75rem; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.order-ship-grid .field { margin-bottom: .55rem; }
.order-ship-grid label { font-weight: 600; font-size: .84rem; }
.order-ship-grid label .muted { font-weight: 400; font-size: .76rem; }
.order-ship-grid select, .order-ship-grid input { width: 100%; }
.order-ship .btn { justify-self: start; }
.order-courier { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: .4rem; margin: .5rem 0 .75rem; }
.order-courier div { padding: .45rem .6rem; background: var(--bg); border-radius: 10px; }
.order-courier dt { font-size: .6rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.order-courier dd { margin: .1rem 0 0; font-size: .84rem; font-weight: 700; }

.dlv { max-width: 760px; }
.dlv > * + * { margin-top: .9rem; }
.dlv-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; }
.dlv-head h1 { margin: 0; }
.dlv-intro { margin: 0; }
.dlv-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.dlv-kpis div { display: flex; flex-direction: column; padding: .6rem .75rem; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; min-width: 0; }
.dlv-kpis span { font-size: .62rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.dlv-kpis strong { font-size: 1.1rem; font-weight: 800; overflow-wrap: anywhere; }
.dlv-empty { text-align: center; color: var(--muted); }
.dlv-empty p { margin: 0; }
.dlv-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .65rem; }
.dlv-item { padding: .85rem .95rem; border-left: 4px solid var(--brand); }
.dlv-item.is-delivery_failed { border-left-color: var(--accent); }
.dlv-item.is-delivered { border-left-color: var(--success); opacity: .8; }
.dlv-item-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.dlv-number { font-weight: 800; text-decoration: none; }
.dlv-customer, .dlv-address, .dlv-meta { margin: .35rem 0 0; font-size: .86rem; overflow-wrap: anywhere; }
.dlv-customer a { font-weight: 700; text-decoration: none; }
.dlv-address a { margin-left: .3rem; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.dlv-meta { font-size: .76rem; color: var(--muted); }
.dlv-done { margin: .55rem 0 0; font-size: .84rem; font-weight: 700; color: var(--success); }
.dlv-deliver { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .7rem; }
.dlv-deliver .btn { flex: 1; min-height: 46px; font-size: 1rem; }
.dlv-collect { display: flex; align-items: center; gap: .35rem; padding: .25rem .5rem; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); }
.dlv-collect span { font-size: .68rem; font-weight: 700; text-transform: uppercase; color: var(--muted); }
.dlv-collect input, .page-app .dlv-collect input { width: 6.5rem; min-height: 36px; padding: .2rem .4rem; border: 0; background: transparent; box-shadow: none; font-size: 16px; font-weight: 800; text-align: right; }
.dlv-collect small { font-size: .72rem; color: var(--muted); }
.dlv-paid { font-size: .8rem; font-weight: 700; color: var(--success); }
.dlv-fail { margin-top: .55rem; }
.dlv-fail > summary { cursor: pointer; font-size: .82rem; font-weight: 700; color: var(--warning); }
.dlv-fail form { display: grid; gap: .55rem; margin-top: .55rem; }
.dlv-fail .btn { justify-self: start; }
.dlv-open { margin-top: .6rem; }

.dlv-settle { padding: .95rem 1.05rem; }
.dlv-settle-head { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.dlv-settle-total { font-size: 1.2rem; font-weight: 800; }
.dlv-settle-orders { list-style: none; margin: .6rem 0 0; padding: 0; }
.dlv-settle-orders li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .2rem .75rem; align-items: center; padding: .45rem 0; font-size: .84rem; }
.dlv-settle-orders li + li { border-top: 1px solid var(--border); }
.dlv-settle-orders li > span { font-size: .74rem; color: var(--muted); min-width: 0; overflow-wrap: anywhere; }
.dlv-settle-orders a { font-weight: 700; text-decoration: none; }
.dlv-settle-form { display: grid; gap: .55rem; margin-top: .8rem; padding-top: .75rem; border-top: 1px dashed var(--border); }
.dlv-settle-form .field { margin: 0; }
.dlv-settle-form label { font-weight: 600; font-size: .84rem; }
.dlv-settle-form label .muted { font-weight: 400; font-size: .74rem; }
.dlv-settle-form > .field > input { width: 100%; }
.dlv-settle-form .btn { justify-self: start; }
.dlv-history-amount { display: flex; flex-direction: column; align-items: flex-end; gap: .15rem; font-weight: 700; white-space: nowrap; }
@media (max-width: 640px) {
    .page-app .dlv > * + * { margin-top: .65rem; }
    .page-app .dlv-head h1 { font-size: 1.2rem; }
    .dlv-head .btn { width: 100%; }
    .dlv-kpis { gap: .35rem; }
    .dlv-kpis div { padding: .45rem .5rem; }
    .dlv-kpis span { font-size: .55rem; }
    .dlv-kpis strong { font-size: .9rem; }
    .page-app .dlv-item { padding: .7rem .75rem; }
    .dlv-customer, .dlv-address { font-size: .8rem; }
    .dlv-deliver { gap: .4rem; }
    .dlv-collect { flex: 1 1 100%; justify-content: space-between; }
    .dlv-collect input, .page-app .dlv-collect input { flex: 1; width: auto; }
    .dlv-fail .btn, .dlv-settle-form .btn, .order-ship .btn { width: 100%; }
    .dlv-settle-orders li { grid-template-columns: auto minmax(0, 1fr); }
    .dlv-settle-orders li > strong, .dlv-history-amount { grid-column: 2; justify-self: end; }
}

/* --- Page d'un agent IA ---------------------------------------------------- */
.agt { max-width: 980px; }
.agt > * + * { margin-top: 1rem; }
.agt-head { padding: 1rem 1.15rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); animation: none; align-items: center; }
.agt-avatar { width: 3rem; height: 3rem; font-size: .85rem; }
.agt-head-main { min-width: 0; flex: 1; }
.agt-title { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .3rem .6rem; }
.agt-title h1 { margin: 0; font-size: 1.35rem; }
.agt-badges { display: flex; flex-wrap: wrap; gap: .3rem; }
.agt-role { margin: .25rem 0 0; font-size: .86rem; color: var(--muted); line-height: 1.45; }
.agt-links { display: flex; gap: .4rem; overflow-x: auto; scrollbar-width: none; padding-bottom: .1rem; }
.agt-links::-webkit-scrollbar { display: none; }
.agt-chip { flex: none; display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .75rem; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: .8rem; font-weight: 700; color: var(--brand-strong); text-decoration: none; white-space: nowrap; }
.agt-chip:hover { border-color: var(--brand); }
.agt-chip.is-info { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.agt-dot { width: .5rem; height: .5rem; border-radius: 50%; background: #25d366; }
.agt-flash { margin: 0; }
.agt-grid { display: grid; gap: 1rem; }
@media (min-width: 900px) { .agt-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; } }
.agt-card { padding: 1rem 1.15rem; }
.agt-card .card-title { margin-bottom: .7rem; }
.agt-fieldset { display: grid; gap: .9rem; margin: 0; padding: 0; border: 0; min-width: 0; }
.agt-fieldset .field { margin: 0; }
.agt-fieldset .field label { font-weight: 700; font-size: .86rem; }
.agt-fieldset select, .agt-fieldset textarea { width: 100%; }
.agt-fieldset textarea { min-height: 96px; resize: vertical; field-sizing: content; max-height: 260px; line-height: 1.5; }
.agt-help { margin: .35rem 0 0; font-size: .76rem; color: var(--muted); line-height: 1.45; }
/* Interrupteur (case à cocher stylée) */
.agt-toggle { position: relative; display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .7rem .8rem; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); cursor: pointer; }
.agt-toggle:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.agt-toggle-text { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.agt-toggle-text strong { font-size: .9rem; }
.agt-toggle-text span { font-size: .76rem; color: var(--muted); line-height: 1.35; }
.agt-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.agt-switch { position: relative; flex: none; width: 44px; height: 26px; border-radius: 999px; background: #cbd5e1; transition: background .2s ease; }
.agt-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .25); transition: transform .2s ease; }
.agt-toggle input:checked ~ .agt-switch { background: var(--brand); }
.agt-toggle input:checked ~ .agt-switch::after { transform: translateX(18px); }
.agt-toggle input:focus-visible ~ .agt-switch { outline: 2px solid var(--brand); outline-offset: 2px; }
.agt-fieldset:disabled .agt-toggle { cursor: not-allowed; opacity: .7; }
.agt-save { display: flex; justify-content: flex-end; }
.agt-save .btn { min-width: 160px; }
/* Activité */
.agt-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.agt-stats div { display: flex; flex-direction: column; padding: .6rem .7rem; background: var(--bg); border-radius: 12px; min-width: 0; }
.agt-stats strong { font-size: 1.2rem; font-weight: 800; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.agt-stats span { font-size: .7rem; color: var(--muted); }
.agt-stats .is-bad strong { color: var(--danger); }
.agt-sub { margin-top: 1.1rem !important; }
.agt-actions { list-style: none; margin: 0; padding: 0; }
.agt-actions li { display: flex; align-items: center; gap: .5rem; padding: .45rem 0; font-size: .8rem; }
.agt-actions li + li { border-top: 1px solid var(--border); }
.agt-actions code { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .76rem; }
.agt-actions time { margin-left: auto; flex: none; font-size: .72rem; color: var(--muted); }
.agt-action-dot { width: .5rem; height: .5rem; flex: none; border-radius: 50%; }
.agt-action-dot.is-ok { background: var(--success); }
.agt-action-dot.is-ko { background: var(--danger); }
@media (prefers-reduced-motion: reduce) { .agt-switch, .agt-switch::after { transition: none; } }
@media (max-width: 640px) {
    .page-app .agt > * + * { margin-top: .7rem; }
    .agt-head { padding: .8rem .85rem; gap: .65rem; }
    .agt-avatar { width: 2.5rem; height: 2.5rem; font-size: .72rem; }
    .page-app .agt-title h1 { font-size: 1.12rem; }
    .agt-badges .badge { font-size: .62rem; }
    .agt-role { font-size: .76rem; }
    .agt-chip { padding: .3rem .65rem; font-size: .74rem; }
    .page-app .agt-card { padding: .8rem .85rem; }
    .agt-fieldset { gap: .75rem; }
    .agt-toggle { padding: .6rem .65rem; }
    .agt-toggle-text strong { font-size: .84rem; }
    .agt-toggle-text span { font-size: .7rem; }
    .agt-save .btn { width: 100%; min-width: 0; }
    .agt-stats { gap: .4rem; }
    .agt-stats div { padding: .5rem .55rem; }
    .agt-stats strong { font-size: 1rem; }
    .agt-stats span { font-size: .62rem; }
}

/* --- Tableau de bord (accueil) --------------------------------------------- */
.dash-head h1 { display: flex; align-items: center; gap: .35rem; }
.dash-wave { font-size: .9em; }
.dash-shop-short { display: none; }
.dash-trial { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .3rem .75rem; }
.dash-trial a { font-weight: 700; white-space: nowrap; text-decoration: none; }
.dash-kpis .kpi { position: relative; overflow: hidden; transition: border-color .15s ease, transform .15s ease; }
.dash-kpis a.kpi:hover { transform: translateY(-1px); }
.dash-kpis .kpi.card-highlight { border-color: var(--border); box-shadow: var(--shadow); }
.dash-kpis .kpi.card-highlight::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--accent); }
.dash-kpis .kpi.card-highlight .stat { color: var(--warning); }
.dash-summary .summary dd { font-weight: 600; }
.dash-summary .summary-host { overflow-wrap: anywhere; word-break: normal; }
.dash-quotas .quota .spread { margin-bottom: .3rem; }
.dash-quotas .quota .mono { font-size: .78rem; }
.dash-wallet { display: grid; gap: .45rem; margin-top: .9rem; padding: .65rem .75rem; border-radius: 12px; background: var(--bg); font-size: .8rem; color: var(--muted); }
.dash-wallet-line { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.dash-wallet-line strong { color: var(--text); font-size: .9rem; }
@media (prefers-reduced-motion: reduce) { .dash-kpis .kpi { transition: none; } .dash-kpis a.kpi:hover { transform: none; } }

@media (max-width: 640px) {
    /* En-tête compact : salutation + petit bouton « Boutique ». */
    .page-app .dash-head { align-items: center; margin-bottom: .55rem; }
    .page-app .dash-head h1 { font-size: 1.25rem; margin-bottom: .1rem; }
    .dash-head .page-sub { font-size: .76rem; }
    .dash-shop-long { display: none; }
    .dash-shop-short { display: inline; }
    .page-app .dash-shop { min-height: 32px; padding: .2rem .65rem; font-size: .76rem; border-radius: 999px; }
    .page-app .dash-trial { padding: .5rem .7rem; font-size: .78rem; border-radius: 10px; }

    /* Indicateurs : 2 colonnes compactes. */
    .page-app .dash-kpis { gap: .5rem; }
    .page-app .dash-kpis .kpi { padding: .65rem .7rem; min-height: 0; }
    .page-app .dash-kpis .card-title { font-size: .6rem; }
    .page-app .dash-kpis .stat { font-size: 1.15rem; }
    .page-app .dash-kpis .kpi .small { font-size: .66rem; }

    /* Résumé : une ligne « libellé / valeur » par information. */
    .page-app .dash-summary { padding: .3rem .85rem; }
    .page-app .dash-summary .summary { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .dash-summary .summary > div { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .55rem 0; }
    .dash-summary .summary > div + div { border-top: 1px solid var(--border); }
    .dash-summary .summary dt { flex: none; font-size: .62rem; }
    .dash-summary .summary dd { margin: 0; justify-content: flex-end; text-align: right; font-size: .82rem; gap: .25rem; }
    .dash-summary .summary dd .badge { font-size: .6rem; }
    .dash-summary .summary-host { font-size: .72rem; }

    /* Consommation */
    .page-app .dash-quotas h2 { font-size: .95rem; }
    .dash-quotas .quota .spread { font-size: .78rem; }
    .dash-quotas .meter { height: 6px; }
    .dash-wallet { font-size: .72rem; padding: .55rem .65rem; }
    .dash-wallet-line strong { font-size: .82rem; }
    .dash-wallet .btn { min-height: 30px; padding: .15rem .6rem; font-size: .74rem; }
}

/* --- Mon compte ------------------------------------------------------------ */
.acct { max-width: 760px; }
.acct > * + * { margin-top: 1rem; }
.acct-head { display: flex; align-items: center; gap: .9rem; padding: 1rem 1.15rem; background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--brand); border-radius: var(--radius); box-shadow: var(--shadow); }
.acct-avatar { display: grid; place-items: center; width: 3.2rem; height: 3.2rem; flex: none; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 800; font-size: 1.1rem; }
.acct-head-main { min-width: 0; }
.acct-head h1 { margin: 0; font-size: 1.3rem; overflow-wrap: anywhere; }
.acct-head p { margin: .15rem 0 0; font-size: .8rem; color: var(--muted); overflow-wrap: anywhere; }
.acct-title h1 { margin: 0 0 .2rem; }
.acct-title p { margin: 0; }
.acct-card { padding: 1rem 1.15rem; }
.acct-card .card-title { margin-bottom: .7rem; }
.acct-form { display: grid; gap: .8rem; }
.acct-form .field { margin: 0; }
.acct-form .field label { font-weight: 600; font-size: .86rem; }
.acct-form .field label .muted { font-weight: 400; font-size: .78rem; }
.acct-form input { width: 100%; }
.acct-form .btn { justify-self: start; }
.acct-grid { display: grid; gap: .8rem; }
@media (min-width: 640px) { .acct-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.acct-help { margin: .3rem 0 0; font-size: .76rem; color: var(--muted); line-height: 1.45; }
.acct-head { background: linear-gradient(135deg, var(--brand-soft), var(--surface) 60%); }
.acct-head-last { font-size: .72rem !important; }
.acct-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.acct-actions { display: flex; justify-content: flex-end; }
.acct-actions .btn { min-width: 150px; }
/* En-tête de carte : pastille d'icône + titre */
.acct-card-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .85rem; }
.acct-card-head h2 { margin: 0; font-size: .95rem; }
.acct-icon, .acct-row-icon { display: grid; place-items: center; width: 2.1rem; height: 2.1rem; flex: none; border-radius: 10px; background: var(--brand-soft); }
.acct-icon svg, .acct-row-icon svg { width: 18px; height: 18px; fill: none; stroke: var(--brand-strong); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.acct-row-icon { background: var(--bg); }
.acct-row-icon svg { stroke: var(--muted); }
.acct-row-icon.is-on { background: var(--success-soft); }
.acct-row-icon.is-on svg { stroke: var(--success); }
/* Lignes de réglage (style « Paramètres ») */
.acct-rows { list-style: none; margin: 0 -.25rem; padding: 0; }
.acct-rows > li + li { border-top: 1px solid var(--border); }
.acct-row > summary, .acct-row.is-static { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .75rem; align-items: center; padding: .75rem .25rem; list-style: none; }
.acct-row > summary { cursor: pointer; border-radius: 10px; }
.acct-row > summary::-webkit-details-marker { display: none; }
.acct-row > summary:hover { background: var(--bg); }
.acct-row > summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.acct-row-main { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.acct-row-main strong { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; font-size: .9rem; }
.acct-row-main strong .badge { font-size: .62rem; }
.acct-row-main > span { font-size: .8rem; color: var(--muted); overflow-wrap: anywhere; }
.acct-on { color: var(--success) !important; font-weight: 700; }
.acct-row-btn { flex: none; padding: .3rem .75rem; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: .78rem; font-weight: 700; color: var(--brand-strong); text-decoration: none; white-space: nowrap; }
.acct-row-btn.is-danger { color: var(--danger); }
.acct-row-btn.is-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.acct-row-btn.is-primary:hover { background: var(--brand-strong); color: #fff; }
.acct-row[open] > summary .acct-row-btn { background: var(--bg); color: var(--muted); }
.acct-row[open] > summary .acct-row-btn::before { content: "✕ "; }
.acct-row-form { margin: 0 .25rem .9rem; padding: .85rem; border-radius: 12px; background: var(--bg); }
.acct-row-form input { background: var(--surface); }
/* Ancienne présentation (page d'activation 2FA) */
.acct-fold { margin-top: .4rem; }
.acct-fold > summary { cursor: pointer; font-size: .86rem; font-weight: 700; color: var(--brand); }
.acct-fold[open] > summary { margin-bottom: .7rem; }
.acct-steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 1.1rem; }
.acct-steps > li { position: relative; display: grid; gap: .45rem; padding-left: 2.3rem; counter-increment: step; }
.acct-steps > li::before { content: counter(step); position: absolute; left: 0; top: -.05rem; display: grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--brand); color: #fff; font-size: .8rem; font-weight: 800; }
.acct-steps > li > span { font-size: .82rem; color: var(--muted); }
.acct-qr { justify-self: start; padding: .5rem; background: #fff; border: 1px solid var(--border); border-radius: 12px; }
.acct-qr svg { display: block; width: 200px; height: 200px; }
.acct-secret { display: inline-block; padding: .35rem .6rem; border-radius: 8px; background: var(--bg); font-size: .85rem; letter-spacing: .08em; overflow-wrap: anywhere; }
.acct-code-form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.acct-code-form input { width: 10rem; }
.acct-warn { margin-top: 1rem; padding: .6rem .75rem; border-radius: 10px; background: var(--warning-soft); color: var(--warning); font-weight: 600; }

/* Écrans d'authentification : code 2FA, mot de passe oublié */
.twofa-card, .pwd-card { text-align: center; }
.twofa-card form, .pwd-card form { text-align: left; }
.twofa-icon { display: inline-grid; place-items: center; width: 3.2rem; height: 3.2rem; margin-bottom: .6rem; border-radius: 50%; background: var(--brand-soft); }
.twofa-icon svg { width: 26px; height: 26px; fill: none; stroke: var(--brand-strong); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.twofa-icon.is-ok { background: var(--success-soft); }
.twofa-icon.is-ok svg { stroke: var(--success); }
.twofa-icon.is-ko { background: var(--danger-soft); }
.twofa-icon.is-ko svg { stroke: var(--danger); }
.twofa-code { font-size: 1.5rem !important; font-weight: 800; letter-spacing: .4em; text-align: center; font-variant-numeric: tabular-nums; }
.twofa-cancel, .pwd-back, .login-forgot { margin: 1rem 0 0; text-align: center; }
@media (max-width: 640px) {
    .page-app .acct > * + * { margin-top: .75rem; }
    .acct-card-head { margin-bottom: .65rem; }
    .acct-card-head h2 { font-size: .88rem; }
    .acct-icon, .acct-row-icon { width: 1.9rem; height: 1.9rem; border-radius: 9px; }
    .acct-icon svg, .acct-row-icon svg { width: 16px; height: 16px; }
    .acct-grid-2 { gap: .55rem; }
    .acct-row > summary, .acct-row.is-static { gap: .6rem; padding: .65rem .2rem; }
    .acct-row-main strong { font-size: .84rem; }
    .acct-row-main > span { font-size: .72rem; }
    .acct-row-btn { padding: .25rem .6rem; font-size: .72rem; }
    .acct-row-form { padding: .7rem; margin: 0 0 .75rem; }
    .acct-actions .btn { width: 100%; min-width: 0; }
    .acct-head { gap: .7rem; padding: .8rem .85rem; }
    .acct-avatar { width: 2.7rem; height: 2.7rem; font-size: .95rem; }
    .page-app .acct-head h1 { font-size: 1.1rem; }
    .acct-head p { font-size: .72rem; }
    .page-app .acct-card { padding: .8rem .85rem; }
    .acct-form .btn { justify-self: stretch; }
    .acct-steps > li { padding-left: 2rem; }
    .acct-qr svg { width: 170px; height: 170px; }
    .acct-code-form input { flex: 1; width: auto; }
}

/* --- Aide et support : nouvelle demande ------------------------------------ */
.tnew { max-width: 720px; }
.tnew > * + * { margin-top: .9rem; }
.tnew-head h1 { margin: 0 0 .25rem; }
.tnew-head p { margin: 0; }
.tnew-form { display: grid; gap: 1rem; padding: 1.1rem 1.2rem; }
.tnew-form .field { margin: 0; }
.tnew-form .field > label, .tnew-label, .tnew-prio legend { display: block; margin-bottom: .35rem; font-weight: 700; font-size: .88rem; }
.tnew-label .muted { font-weight: 400; font-size: .78rem; }
.tnew-form input:not([type=radio]):not([type=file]), .tnew-form select, .tnew-form textarea { width: 100%; }
.tnew-form textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
.tnew-prio { margin: 0; padding: 0; border: 0; min-width: 0; }
.tnew-prio-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .45rem; }
.tnew-prio-card { position: relative; display: flex; align-items: center; gap: .5rem; padding: .6rem .65rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.tnew-prio-card input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tnew-prio-dot { width: .7rem; height: .7rem; flex: none; border-radius: 50%; background: var(--muted); }
.tnew-prio-card.is-low .tnew-prio-dot { background: #94a3b8; }
.tnew-prio-card.is-normal .tnew-prio-dot { background: var(--brand); }
.tnew-prio-card.is-high .tnew-prio-dot { background: var(--accent); }
.tnew-prio-card.is-urgent .tnew-prio-dot { background: var(--danger); }
.tnew-prio-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.tnew-prio-text strong { font-size: .86rem; }
.tnew-prio-text small { font-size: .7rem; color: var(--muted); }
.tnew-prio-card:hover { border-color: var(--muted); }
.tnew-prio-card:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand); }
.tnew-prio-card.is-urgent:has(input:checked) { border-color: var(--danger); background: var(--danger-soft); box-shadow: 0 0 0 1px var(--danger); }
.tnew-prio-card.is-high:has(input:checked) { border-color: var(--accent); background: var(--warning-soft); box-shadow: 0 0 0 1px var(--accent); }
.tnew-prio-card:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.tnew-help { margin: .4rem 0 0; font-size: .74rem; color: var(--muted); }
.tnew-drop { margin-bottom: 0; }
.tnew-submit { justify-self: start; min-width: 220px; min-height: 46px; }
@media (prefers-reduced-motion: reduce) { .tnew-prio-card { transition: none; } }
@media (max-width: 640px) {
    .page-app .tnew > * + * { margin-top: .65rem; }
    .page-app .tnew-head h1 { font-size: 1.2rem; }
    .tnew-head p { font-size: .76rem; }
    .page-app .tnew-form { gap: .8rem; padding: .85rem .85rem; }
    .tnew-form .field > label, .tnew-label, .tnew-prio legend { font-size: .82rem; }
    .tnew-prio-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; }
    .tnew-prio-card { padding: .5rem .55rem; }
    .tnew-prio-text strong { font-size: .8rem; }
    .tnew-prio-text small { font-size: .66rem; }
    .tnew-form textarea { min-height: 100px; }
    .tnew-submit { width: 100%; min-width: 0; }
}

/* --- Aide et support : une demande ----------------------------------------- */
.ticket { max-width: 820px; }
.ticket > * + * { margin-top: 1rem; }
.ticket-head { padding: 1rem 1.15rem; background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--brand); border-radius: var(--radius); box-shadow: var(--shadow); }
.ticket-head-line { display: flex; align-items: flex-start; justify-content: space-between; gap: .6rem; }
.ticket-head h1 { margin: 0; font-size: 1.3rem; line-height: 1.3; overflow-wrap: anywhere; }
.ticket-head-line .badge { flex: none; margin-top: .2rem; }
.ticket-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; margin: .85rem 0 0; }
.ticket-facts div { min-width: 0; padding: .45rem .6rem; background: var(--bg); border-radius: 10px; }
.ticket-facts dt { font-size: .6rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.ticket-facts dd { margin: .1rem 0 0; font-size: .82rem; font-weight: 700; overflow-wrap: anywhere; }
.ticket-prio.is-high { color: var(--warning); }
.ticket-prio.is-urgent { color: var(--danger); }

/* Fil (commerçant et SAV) */
.tthread { display: flex; flex-direction: column; gap: .8rem; }
.tthread-event { align-self: center; max-width: 90%; margin: 0; padding: .25rem .8rem; border: 1px dashed var(--border); border-radius: 999px; font-size: .74rem; color: var(--muted); text-align: center; }
.tmsg { display: flex; gap: .6rem; align-items: flex-start; max-width: 88%; }
.tmsg.is-mine { flex-direction: row-reverse; align-self: flex-end; }
.tmsg-avatar { flex: none; display: grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: 50%; background: var(--muted); color: #fff; font-size: .7rem; font-weight: 800; }
.tmsg.is-support .tmsg-avatar { background: var(--brand); }
.tmsg.is-mine .tmsg-avatar { background: var(--text); }
.tmsg-bubble { min-width: 0; padding: .65rem .85rem; background: var(--surface); border: 1px solid var(--border); border-radius: 4px 16px 16px 16px; box-shadow: var(--shadow); }
.tmsg.is-mine .tmsg-bubble { background: var(--brand-soft); border-color: #99f6e4; border-radius: 16px 4px 16px 16px; }
.tmsg.is-internal .tmsg-bubble { background: #fef9c3; border-color: #fde68a; }
.tmsg-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .45rem; font-size: .8rem; }
.tmsg-meta time { margin-left: auto; font-size: .7rem; color: var(--muted); white-space: nowrap; }
.tmsg-meta .badge { font-size: .62rem; }
.tmsg-wa { background: #dcfce7; color: #128c4b; border-color: transparent; }
.tmsg-body { margin-top: .35rem; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; font-size: .92rem; }
.tmsg-files { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .55rem; }
.tmsg-file { display: inline-flex; align-items: center; gap: .3rem; max-width: 100%; padding: .25rem .6rem; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: .74rem; font-weight: 600; text-decoration: none; }
.tmsg-file:hover { border-color: var(--brand); }
.tmsg-file svg { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.tmsg-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Confirmation et note */
.ticket-confirm { padding: 1rem 1.15rem; border-color: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.ticket-confirm h2 { margin: 0 0 .25rem; font-size: 1rem; }
.ticket-stars { margin: .5rem 0 .75rem; padding: 0; border: 0; }
.ticket-stars legend { padding: 0; margin-bottom: .2rem; font-size: .84rem; font-weight: 600; }
.ticket-stars-row { display: inline-flex; flex-direction: row-reverse; gap: .15rem; }
.ticket-stars-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ticket-stars-row label { font-size: 1.9rem; line-height: 1; color: var(--border); cursor: pointer; transition: color .12s ease, transform .12s ease; }
.ticket-stars-row input:checked ~ label, .ticket-stars-row label:hover, .ticket-stars-row label:hover ~ label { color: #f59e0b; }
.ticket-stars-row label:hover { transform: scale(1.1); }
.ticket-stars-row input:focus-visible + label { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.ticket-rated { margin: 0; padding: .6rem .85rem; border-radius: 12px; background: var(--success-soft); color: var(--success); font-weight: 700; font-size: .86rem; }
.ticket-rated span { color: #f59e0b; letter-spacing: .1em; }

/* Réponse */
.ticket-compose { display: grid; gap: .5rem; padding: .85rem .95rem; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); }
.ticket-compose:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.ticket-compose.is-waiting { border-color: var(--accent); box-shadow: 0 0 0 3px var(--warning-soft); }
.ticket-compose-label { font-size: .84rem; font-weight: 700; }
.ticket-compose.is-waiting .ticket-compose-label { color: var(--warning); }
.ticket-compose textarea, .page-app .ticket-compose textarea { width: 100%; min-height: 84px; max-height: 260px; padding: .6rem .75rem; border-radius: 12px; resize: vertical; field-sizing: content; font: inherit; font-size: 16px; line-height: 1.45; }
.ticket-compose-bar { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.ticket-attach { position: relative; display: inline-flex; align-items: center; gap: .35rem; min-width: 0; padding: .35rem .7rem; border: 1px dashed var(--border); border-radius: 999px; font-size: .8rem; font-weight: 600; color: var(--muted); cursor: pointer; }
.ticket-attach:hover, .ticket-attach:focus-within { border-color: var(--brand); color: var(--brand-strong); }
.ticket-attach svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.ticket-attach span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ticket-attach input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.ticket-compose-bar .btn { flex: none; min-width: 110px; }
.ticket-closed { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; padding: .8rem .95rem; border: 1px dashed var(--border); border-radius: 14px; font-size: .86rem; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .ticket-stars-row label { transition: none; } .ticket-stars-row label:hover { transform: none; } }

@media (max-width: 640px) {
    .page-app .ticket > * + * { margin-top: .75rem; }
    .ticket-head { padding: .8rem .85rem; }
    .page-app .ticket-head h1 { font-size: 1.08rem; }
    .ticket-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .35rem; margin-top: .65rem; }
    .ticket-facts div { padding: .35rem .5rem; }
    .ticket-facts dt { font-size: .56rem; }
    .ticket-facts dd { font-size: .76rem; }
    .tthread { gap: .6rem; }
    .tmsg { max-width: 94%; gap: .45rem; }
    .tmsg-avatar { width: 1.8rem; height: 1.8rem; font-size: .6rem; }
    .tmsg-bubble { padding: .55rem .65rem; }
    .tmsg-meta { font-size: .74rem; }
    .tmsg-body { font-size: .86rem; }
    .ticket-compose { padding: .7rem .75rem; border-radius: 14px; }
    .page-app .ticket-compose textarea { min-height: 72px; }
    .ticket-attach { font-size: .74rem; padding: .3rem .6rem; }
    .ticket-compose-bar .btn { min-width: 0; }
    .ticket-closed .btn { width: 100%; }
}

/* --- Choix de la boutique -------------------------------------------------- */
.shops { min-height: 100dvh; display: grid; place-items: center; padding: 2rem 1rem; background: radial-gradient(circle at 20% 0, var(--brand-soft), transparent 55%), radial-gradient(circle at 100% 100%, #e0f2fe, transparent 50%), var(--bg); }
.shops-box { width: 100%; max-width: 440px; }
.shops-brand { display: block; margin: 0 0 1.1rem; text-align: center; font-size: 1.6rem; }
.shops-card { padding: 1.5rem 1.4rem 1.1rem; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: 0 18px 50px rgb(15 23 42 / .1); }
.shops-head { margin-bottom: 1.1rem; text-align: center; }
.shops-hello { margin: 0 0 .2rem; font-size: .9rem; font-weight: 600; color: var(--brand-strong); }
.shops-head h1 { margin: 0; font-size: 1.45rem; }
.shops-sub { margin: .3rem 0 0; font-size: .86rem; color: var(--muted); }
.shops-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.shops-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .8rem; align-items: center; width: 100%; padding: .75rem .85rem; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); font: inherit; color: inherit; text-align: left; cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.shops-item:hover { border-color: var(--brand); box-shadow: 0 6px 18px rgb(15 118 110 / .12); transform: translateY(-1px); }
.shops-item:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.shops-avatar { width: 2.8rem; height: 2.8rem; border-radius: 12px; font-size: 1.1rem; }
.shops-item-main { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.shops-item-main strong { font-size: 1rem; line-height: 1.3; overflow-wrap: anywhere; }
.shops-item-meta { display: flex; flex-wrap: wrap; gap: .3rem; }
.shops-item-meta .badge { font-size: .68rem; }
.shops-item-go { font-size: 1.6rem; line-height: 1; color: var(--brand); transition: transform .15s ease; }
.shops-item:hover .shops-item-go { transform: translateX(3px); }
.shops-empty { padding: 1rem; border: 1px dashed var(--border); border-radius: 14px; text-align: center; color: var(--muted); }
.shops-empty p { margin: 0; }
.shops-empty p + p { margin-top: .3rem; }
.shops-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem .75rem; margin-top: 1.2rem; padding-top: .9rem; border-top: 1px solid var(--border); }
.shops-user { min-width: 0; font-size: .76rem; color: var(--muted); overflow-wrap: anywhere; }
.shops-user strong { color: var(--text); font-weight: 600; }
.shops-logout { flex: none; padding: .3rem .7rem; border: 1px solid var(--border); border-radius: 999px; font-size: .8rem; font-weight: 700; color: var(--danger); text-decoration: none; }
.shops-logout:hover { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }
@media (prefers-reduced-motion: reduce) { .shops-item, .shops-item-go { transition: none; } .shops-item:hover { transform: none; } }
@media (max-width: 480px) {
    .shops { place-items: start center; padding: 2.5rem .85rem 1.5rem; }
    .shops-card { padding: 1.2rem 1rem 1rem; border-radius: 18px; }
    .shops-head h1 { font-size: 1.25rem; }
    .shops-item { gap: .65rem; padding: .65rem .7rem; }
    .shops-avatar { width: 2.4rem; height: 2.4rem; font-size: 1rem; }
    .shops-item-main strong { font-size: .92rem; }
    .shops-foot { flex-direction: column; align-items: stretch; text-align: center; }
    .shops-logout { text-align: center; }
}

/* --- Consommation des agents IA -------------------------------------------- */
.usage { max-width: 920px; }
.usage > * + * { margin-top: 1rem; }
.usage-head h1 { margin: 0 0 .3rem; }
.usage-head p { margin: 0; line-height: 1.5; }
.usage-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; }
.usage-kpi { display: flex; flex-direction: column; gap: .15rem; padding: .75rem .85rem; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); min-width: 0; }
.usage-kpi span { font-size: .64rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.usage-kpi strong { font-size: 1.3rem; font-weight: 800; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.usage-kpi.is-bad strong { color: var(--danger); }
.usage-card { padding: 1rem 1.15rem; }
.usage-card .card-title { margin-bottom: .5rem; }

.usage-agents, .usage-calls { list-style: none; margin: 0; padding: 0; }
.usage-agents li { display: grid; gap: .3rem; padding: .65rem 0; }
.usage-agents li + li, .usage-calls li + li { border-top: 1px solid var(--border); }
.usage-agent-line { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; }
.usage-agent-line strong { min-width: 0; font-size: .92rem; overflow-wrap: anywhere; }
.usage-agent-calls { flex: none; font-size: .78rem; font-weight: 700; color: var(--brand-strong); }
.usage-bar { display: block; height: 6px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.usage-bar span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand), #14b8a6); }
.usage-agent-meta { display: flex; flex-wrap: wrap; gap: .15rem .9rem; font-size: .74rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.usage-err { color: var(--danger); font-weight: 700; }

.usage-calls-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .4rem; }
.usage-calls-head .card-title { display: flex; align-items: center; gap: .4rem; margin: 0; }
.usage-card .pagination { margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--border); }
.usage-calls li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .65rem; align-items: center; padding: .55rem 0; }
.usage-call-dot { width: .55rem; height: .55rem; border-radius: 50%; }
.usage-call-dot.is-ok { background: var(--success); }
.usage-call-dot.is-ko { background: var(--danger); }
.usage-call-main { display: flex; flex-direction: column; min-width: 0; }
.usage-call-main strong { font-size: .86rem; overflow-wrap: anywhere; }
.usage-call-main > span { display: flex; flex-wrap: wrap; align-items: center; gap: .1rem .35rem; font-size: .72rem; color: var(--muted); }
.usage-call-main code { font-size: .7rem; padding: .05rem .3rem; border-radius: 4px; background: var(--bg); }
.usage-call-side { display: flex; flex-direction: column; align-items: flex-end; gap: .15rem; }
.usage-call-tokens { font-size: .7rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

@media (max-width: 640px) {
    .page-app .usage > * + * { margin-top: .75rem; }
    .page-app .usage-head h1 { font-size: 1.15rem; }
    .usage-head p { font-size: .74rem; }
    .usage-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem; }
    .usage-kpi { padding: .55rem .65rem; box-shadow: none; }
    .usage-kpi span { font-size: .58rem; }
    .usage-kpi strong { font-size: 1.05rem; }
    .page-app .usage-card { padding: .8rem .85rem; }
    .usage-agents li { padding: .55rem 0; gap: .25rem; }
    .usage-agent-line strong { font-size: .84rem; }
    .usage-agent-calls { font-size: .72rem; }
    .usage-agent-meta { font-size: .68rem; }
    .usage-calls li { gap: .5rem; padding: .5rem 0; }
    .usage-call-main strong { font-size: .8rem; }
    .usage-call-main > span { font-size: .66rem; }
    .usage-call-main code { font-size: .64rem; }
    .usage-call-side .badge { font-size: .6rem; }
    .usage-call-tokens { font-size: .64rem; }
}

/* --- Paiement simulé (passerelle Wave de développement) -------------------- */
.paysim { min-height: 100dvh; display: flex; flex-direction: column; background: linear-gradient(180deg, #e0f7fd 0, var(--bg) 320px); }
.paysim-banner { display: flex; align-items: center; justify-content: center; gap: .5rem; padding: .55rem 1rem; background: var(--warning-soft); color: var(--warning); font-size: .82rem; font-weight: 600; text-align: center; }
.paysim-banner-dot { width: .5rem; height: .5rem; flex: none; border-radius: 50%; background: var(--accent); }
.paysim-main { flex: 1; display: grid; place-items: center; padding: 1.5rem 1rem 2.5rem; }
.paysim-card { width: 100%; max-width: 400px; overflow: hidden; border-radius: 22px; background: var(--surface); box-shadow: 0 18px 50px rgb(4 41 58 / .14); }
.paysim-head { display: flex; align-items: center; gap: .7rem; padding: 1rem 1.2rem; background: #1dc8f2; color: #04293a; }
.paysim-logo { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 12px; background: #fff; }
.paysim-logo svg { width: 26px; height: 26px; fill: none; stroke: #1dc8f2; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.paysim-brand { display: flex; flex-direction: column; line-height: 1.15; }
.paysim-brand strong { font-size: 1.2rem; font-weight: 800; }
.paysim-brand span { font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; opacity: .75; }
.paysim-body { padding: 1.4rem 1.3rem 1.3rem; text-align: center; }
.paysim-body .flash { text-align: left; }
.paysim-to { margin: 0; font-size: .85rem; color: var(--muted); }
.paysim-to strong { color: var(--text); }
.paysim-amount { margin: .35rem 0 .15rem; font-size: 2.3rem; font-weight: 800; letter-spacing: -.02em; }
.paysim-purpose { display: inline-block; margin: 0; padding: .2rem .7rem; border-radius: 999px; background: var(--bg); font-size: .82rem; font-weight: 600; color: var(--muted); }
.paysim-ref { display: flex; flex-direction: column; align-items: center; gap: .15rem; margin: 1rem 0 0; }
.paysim-ref span { font-size: .64rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.paysim-ref code { max-width: 100%; padding: .2rem .5rem; border-radius: 6px; background: var(--bg); font-size: .7rem; color: var(--muted); overflow-wrap: anywhere; }
.paysim-actions { display: grid; gap: .55rem; margin-top: 1.3rem; }
.paysim-pay { min-height: 50px; border-radius: 14px; background: #1dc8f2; border-color: #1dc8f2; color: #04293a; font-size: 1rem; font-weight: 800; }
.paysim-pay:hover { background: #12b3db; border-color: #12b3db; color: #04293a; }
.paysim-fail { min-height: 46px; border-radius: 14px; }
.paysim-fail:hover { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }
.paysim-note { margin: .9rem 0 0; font-size: .72rem; color: var(--muted); }
.paysim-result { display: flex; flex-direction: column; align-items: center; gap: .35rem; }
.paysim-result-icon { display: grid; place-items: center; width: 4rem; height: 4rem; margin-bottom: .3rem; border-radius: 50%; font-size: 1.9rem; font-weight: 800; color: #fff; animation: paysim-pop .4s cubic-bezier(.22, 1, .36, 1); }
.paysim-result.is-ok .paysim-result-icon { background: var(--success); box-shadow: 0 0 0 8px var(--success-soft); }
.paysim-result.is-ko .paysim-result-icon { background: var(--danger); box-shadow: 0 0 0 8px var(--danger-soft); }
.paysim-result h1 { margin: 0; font-size: 1.35rem; }
.paysim-result p { margin: 0; color: var(--muted); }
.paysim-result p strong { color: var(--text); }
.paysim-back { margin-top: 1.3rem; min-height: 48px; border-radius: 14px; }
@keyframes paysim-pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .paysim-result-icon { animation: none; } }
@media (max-width: 480px) {
    .paysim-banner { font-size: .74rem; padding: .5rem .75rem; }
    .paysim-main { place-items: start center; padding: 1.25rem .85rem 2rem; }
    .paysim-card { border-radius: 18px; }
    .paysim-head { padding: .85rem 1rem; }
    .paysim-body { padding: 1.15rem 1rem 1.1rem; }
    .paysim-amount { font-size: 2rem; }
}

/* --- Portefeuille ---------------------------------------------------------- */
.wal { max-width: 920px; }
.wal > * + * { margin-top: 1.1rem; }
.wal h1 { margin: 0; }
.wal-card { padding: 1rem 1.15rem; }
.wal-card .card-title { margin-bottom: .65rem; }
.wal-top { display: grid; gap: 1.1rem; }
@media (min-width: 820px) { .wal-top { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); align-items: stretch; } }

/* Solde */
.wal-balance { display: flex; flex-direction: column; gap: .25rem; padding: 1.15rem 1.25rem; border-radius: var(--radius); color: #fff; background: linear-gradient(135deg, var(--brand-strong), var(--brand) 60%, #14b8a6); box-shadow: 0 10px 28px rgb(15 118 110 / .28); }
.wal-balance.is-low { background: linear-gradient(135deg, #991b1b, var(--danger) 60%, #ef4444); box-shadow: 0 10px 28px rgb(185 28 28 / .25); }
.wal-balance-label { font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; opacity: .85; }
.wal-balance .wal-balance-value { font-size: 2.1rem; line-height: 1.1; color: #fff; }
.wal-balance-alert { align-self: flex-start; padding: .15rem .55rem; border-radius: 999px; background: rgb(255 255 255 / .2); font-size: .74rem; font-weight: 700; }
.wal-balance p { margin: .45rem 0 0; font-size: .8rem; line-height: 1.45; opacity: .9; }

/* Recharge */
.wal-presets { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: .45rem; margin-bottom: .85rem; }
.wal-preset { position: relative; cursor: pointer; }
.wal-preset input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.wal-preset span { display: flex; align-items: center; justify-content: center; min-height: 46px; padding: .4rem; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); font-weight: 800; font-size: .95rem; transition: border-color .15s ease, background .15s ease; }
.wal-preset:hover span { border-color: var(--brand); }
.wal-preset input:checked + span { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-strong); box-shadow: 0 0 0 1px var(--brand); }
.wal-preset input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.wal-custom label { font-weight: 600; font-size: .88rem; }
.wal-custom label .muted { font-weight: 400; font-size: .78rem; }
.wal-input { display: flex; align-items: center; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); overflow: hidden; }
.wal-input:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.wal-input input, .page-app .wal-input input { flex: 1; min-width: 0; border: 0; box-shadow: none; outline: none; background: transparent; }
.wal-input span { padding: 0 .85rem; font-size: .8rem; font-weight: 700; color: var(--muted); }

/* Tarifs */
.wal-rates { list-style: none; margin: 0; padding: 0; }
.wal-rates li { display: flex; align-items: baseline; justify-content: space-between; gap: .3rem .75rem; flex-wrap: wrap; padding: .5rem 0; font-size: .88rem; }
.wal-rates li + li { border-top: 1px dashed var(--border); }
.wal-rates strong { white-space: nowrap; }
.wal-rates small { font-weight: 500; color: var(--muted); }
/* Précision sous un tarif (tarif réduit, exemples de messages), sur toute la largeur. */
.wal-rate-note { flex-basis: 100%; font-style: normal; font-size: .76rem; color: var(--muted); line-height: 1.4; }
.wal-rate-upsell { padding: .35rem .55rem; border-radius: 8px; background: var(--brand-soft); color: var(--brand-strong); }
.wal-rate-upsell a { font-weight: 700; white-space: nowrap; }
.wal-rate-free { color: var(--success); }
.wal-subtitle { margin: 1rem 0 .1rem; padding-top: .75rem; border-top: 1px solid var(--border); font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.wal-rates + .wal-help { margin: .6rem 0 0; }

/* Packs */
.wal-help { margin: 0 0 .75rem; font-size: .8rem; color: var(--muted); line-height: 1.45; }
.wal-mypacks { list-style: none; margin: 0 0 .85rem; padding: 0; }
.wal-mypacks li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: .3rem .75rem; align-items: center; padding: .6rem 0; }
.wal-mypacks li + li { border-top: 1px solid var(--border); }
.wal-mypack-main { display: flex; flex-direction: column; min-width: 0; }
.wal-mypack-main span { font-size: .76rem; color: var(--muted); }
.wal-packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .6rem; }
.wal-pack { display: flex; flex-direction: column; gap: .45rem; padding: .7rem .8rem; border: 1px solid var(--border); border-radius: 12px; background: var(--bg); }
/* Nom du pack à gauche, prix à droite, sur la même ligne. */
.wal-pack-head { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.wal-pack-head strong { min-width: 0; font-size: .9rem; overflow-wrap: anywhere; }
.wal-pack-price { flex: none; font-size: .88rem; font-weight: 800; white-space: nowrap; }
.wal-pack-price small { font-size: .72rem; font-weight: 500; color: var(--muted); }
.wal-pack-buy { display: flex; gap: .4rem; }
.wal-pack-buy input, .page-app .wal-pack-buy input { width: 3.6rem; min-height: 34px; padding: .2rem .3rem; font-size: 16px; text-align: center; border-radius: 8px; }
.wal-pack-buy .btn, .page-app .wal-pack-buy .btn { flex: 1; min-height: 34px; padding: .2rem .6rem; font-size: .8rem; border-radius: 8px; }

/* Récapitulatif et historique */
.wal-summary, .wal-tx { list-style: none; margin: 0; padding: 0; }
.wal-summary li { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .55rem 0; }
.wal-summary li + li, .wal-tx li + li { border-top: 1px solid var(--border); }
.wal-summary-main, .wal-tx-main { display: flex; flex-direction: column; min-width: 0; }
.wal-summary-main strong, .wal-tx-main strong { font-size: .88rem; overflow-wrap: anywhere; }
.wal-summary-main span, .wal-tx-main span { font-size: .74rem; color: var(--muted); }
.wal-amount { font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.wal-amount.is-in { color: var(--success); }
.wal-amount.is-out { color: var(--danger); }
.wal-history-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .4rem; }
.wal-history-head .card-title { display: flex; align-items: center; gap: .4rem; margin: 0; }
.wal-history-filters { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; }
.wal-history-head select { width: auto; min-height: 36px; padding: .25rem 1.8rem .25rem .6rem; font-size: .84rem; }
.wal-card .pagination { margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--border); }
.wal-tx li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .7rem; align-items: center; padding: .6rem 0; }
.wal-tx-icon { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; font-weight: 800; }
.wal-tx-icon.is-in { background: var(--success-soft); color: var(--success); }
.wal-tx-icon.is-out { background: var(--danger-soft); color: var(--danger); }
.wal-tx-side { display: flex; flex-direction: column; align-items: flex-end; }
.wal-tx-balance { font-size: .7rem; color: var(--muted); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .wal-preset span { transition: none; } }

@media (max-width: 640px) {
    .page-app .wal > * + * { margin-top: .75rem; }
    .page-app .wal h1 { font-size: 1.2rem; }
    .page-app .wal-top { gap: .75rem; }
    .wal-balance { padding: .9rem .95rem; }
    .wal-balance .wal-balance-value, .page-app .wal-balance .stat { font-size: 1.7rem; }
    .wal-balance p { font-size: .72rem; }
    .page-app .wal-card { padding: .8rem .85rem; }
    .wal-presets { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; }
    .wal-preset span { min-height: 42px; font-size: .88rem; }
    .wal-rates li { font-size: .8rem; padding: .45rem 0; gap: .15rem .6rem; }
    .wal-rates strong { font-size: .8rem; }
    .wal-rate-note { font-size: .7rem; }
    .wal-rate-upsell { padding: .3rem .45rem; }
    .wal-subtitle { font-size: .66rem; margin-top: .75rem; padding-top: .6rem; }
    .wal-help { font-size: .74rem; }
    .wal-mypacks li { grid-template-columns: minmax(0, 1fr) auto; }
    .wal-mypacks form { grid-column: 1 / -1; }
    .wal-packs { grid-template-columns: minmax(0, 1fr); gap: .45rem; }
    .wal-pack { gap: .4rem; padding: .55rem .65rem; border-radius: 10px; }
    .wal-pack-head strong { font-size: .82rem; }
    .wal-pack-price { font-size: .8rem; }
    .wal-pack-price small { font-size: .66rem; }
    .wal-pack-buy input, .page-app .wal-pack-buy input { width: 3.2rem; min-height: 32px; }
    .wal-pack-buy .btn, .page-app .wal-pack-buy .btn { min-height: 32px; font-size: .76rem; }
    .wal-summary-main strong, .wal-tx-main strong { font-size: .82rem; }
    .wal-summary-main span, .wal-tx-main span { font-size: .68rem; }
    .wal-amount { font-size: .84rem; }
    .wal-tx li { gap: .55rem; padding: .5rem 0; }
    .wal-tx-icon { width: 1.75rem; height: 1.75rem; font-size: .85rem; }
    .wal-tx-balance { font-size: .64rem; }
    .wal-history-filters { width: 100%; justify-content: space-between; }
    .page-app .wal-history-filters > select { flex: 1; min-width: 0; min-height: 34px; font-size: 16px; }
}

/* ------------------------------------------------------------------ */
/* Relance client                                                       */
/* ------------------------------------------------------------------ */
.rem-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.rem-head h1 { margin: 0; }
.rem-intro { margin: .35rem 0 1rem; line-height: 1.45; }
.rem-card { margin-bottom: 1rem; }
.rem-anchor { scroll-margin-top: 4.5rem; }
.rem-card-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .35rem; }
.rem-card-head .card-title { margin: 0; }
.rem-list { list-style: none; margin: 0; padding: 0; }
.rem-list > li + li { border-top: 1px solid var(--border); }
.rem-template { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .45rem 0; }
.rem-template-name { display: flex; flex-direction: column; min-width: 0; }
.rem-template-name .mono { font-size: .82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rem-template-name small { font-size: .72rem; color: var(--muted); }
.rem-template .badge { flex: none; }

.rem-kinds { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.rem-kind { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .6rem .7rem; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); }
.rem-kind-main { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.rem-kind-main strong { font-size: .9rem; }
.rem-kind-main small { font-size: .72rem; color: var(--muted); }
.rem-kind-count { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; font-size: .8rem; font-weight: 600; }
.rem-kind form { flex: none; }

.rem-task { padding: .75rem 0; }
.rem-task + .rem-task { border-top: 1px solid var(--border); }
.rem-task-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; }
.rem-task-title { min-width: 0; font-size: .95rem; line-height: 1.3; }
.rem-task-head .badge { flex: none; }
.rem-task-meta { margin: .2rem 0 0; font-size: .76rem; color: var(--muted); }
.rem-preview { margin: .5rem 0 0; padding: .55rem .75rem; border-left: 3px solid var(--brand); border-radius: 0 8px 8px 0; background: var(--bg); font-size: .84rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.rem-recipients { margin-top: .45rem; font-size: .8rem; }
.rem-recipients summary { cursor: pointer; font-weight: 600; color: var(--brand-strong); }
.rem-recipients ul { list-style: none; margin: .35rem 0 0; padding: 0; max-height: 12rem; overflow-y: auto; }
.rem-recipients li { display: flex; justify-content: space-between; gap: .5rem; padding: .25rem 0; border-bottom: 1px dashed var(--border); }
.rem-recipients li .mono { color: var(--muted); font-size: .76rem; }
.rem-task-actions { display: flex; gap: .4rem; margin-top: .55rem; }
.rem-task-actions form { flex: 1 1 0; display: flex; }
.rem-task-actions .btn { width: 100%; }

.rem-log { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .15rem .6rem; padding: .5rem 0; }
.rem-log-main { display: flex; flex-direction: column; min-width: 0; }
.rem-log-main strong { font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rem-log-main small { font-size: .74rem; color: var(--muted); }
.rem-log-side { display: flex; flex-direction: column; align-items: flex-end; gap: .15rem; }
.rem-log-side time { font-size: .72rem; color: var(--muted); white-space: nowrap; }
.rem-log-error { grid-column: 1 / -1; font-size: .72rem; color: var(--danger); overflow-wrap: anywhere; }
.rem-card .pagination { margin-top: .75rem; }

@media (max-width: 640px) {
    .rem-head h1 { font-size: 1.25rem; }
    .rem-head .badge { font-size: .7rem; }
    .rem-intro { font-size: .74rem; margin-bottom: .6rem; }
    .page-app .rem-card { padding: .75rem; margin-bottom: .75rem; }
    .rem-kinds { grid-template-columns: minmax(0, 1fr); gap: .4rem; }
    .rem-kind { padding: .5rem .6rem; }
    .rem-task { padding: .6rem 0; }
    .rem-task-title { font-size: .86rem; }
    .rem-preview { font-size: .78rem; padding: .45rem .6rem; }
    .rem-task-actions .btn { min-height: 38px; }
}

/* ------------------------------------------------------------------ */
/* Visuels (infographiste)                                              */
/* ------------------------------------------------------------------ */
.vis-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.vis-head h1 { margin: 0; }
.vis-intro { margin: .35rem 0 1rem; line-height: 1.45; }
.vis-create { margin-bottom: 1rem; }
.vis-create form { display: flex; flex-direction: column; gap: .75rem; }
.vis-create .field { margin: 0; }

/* Zone « photo de la galerie » : grande cible tactile, aperçu une fois choisie. */
.vis-drop { position: relative; display: flex; align-items: center; gap: .75rem; padding: .85rem; border: 2px dashed var(--brand); border-radius: var(--radius); background: var(--brand-soft); cursor: pointer; }
.vis-drop:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
.vis-drop input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.vis-drop-icon { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; background: var(--surface); }
.vis-drop-icon svg { width: 26px; height: 26px; fill: none; stroke: var(--brand); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.vis-drop-text { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.vis-drop-text strong { color: var(--brand-strong); font-size: .95rem; }
.vis-drop-text span { font-size: .78rem; color: var(--muted); line-height: 1.35; }
.vis-drop-preview, .vis-drop-change { display: none; }
.vis-drop.has-photo { border-style: solid; background: var(--surface); }
.vis-drop.has-photo .vis-drop-icon { display: none; }
.vis-drop.has-photo .vis-drop-preview { display: block; flex: none; width: 64px; height: 64px; object-fit: cover; border-radius: 10px; }
.vis-drop.has-photo .vis-drop-change { display: inline; margin-left: auto; flex: none; font-size: .8rem; font-weight: 700; color: var(--brand); }

.vis-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }

/* Style du texte : deux cartes radio côte à côte. */
.vis-style { margin: 0; padding: 0; border: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.vis-style legend { padding: 0; margin-bottom: .35rem; font-weight: 600; font-size: .9rem; }
.vis-style-option { position: relative; display: block; cursor: pointer; }
.vis-style-option input { position: absolute; opacity: 0; }
.vis-style-option > span { display: flex; flex-direction: column; gap: .1rem; height: 100%; padding: .6rem .7rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.vis-style-option strong { font-size: .88rem; }
.vis-style-option small { font-size: .74rem; color: var(--muted); }
.vis-style-option input:checked + span { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand); }
.vis-style-option input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.vis-price { margin: 0; }
/* Choix affiche / vidéo et filtre de la galerie. */
.vis-tabs { margin-bottom: .85rem; box-shadow: none; }
.vis-tabs .tasks-tab { flex: 1; justify-content: center; text-align: center; }
.vis-filter { margin: .25rem 0 .85rem; box-shadow: none; width: max-content; max-width: 100%; }
/* Plusieurs photos choisies (vidéo) : vignettes. */
.vis-drop-thumbs { display: none; }
.vis-drop.has-photo .vis-drop-thumbs { display: flex; flex-wrap: wrap; gap: .3rem; max-width: 60%; }
.vis-drop-thumbs img { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; }
.vis-duration { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.vis-drop-text .vis-drop-status { color: var(--brand-strong); font-weight: 700; }
.vis-drop-status:empty { display: none; }
/* Fond sonore et voix off des vidéos. */
.vis-music, .vis-voice { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.vis-music-file, .vis-music-preview, .vis-voice-note { grid-column: 1 / -1; margin: 0; }
.vis-music-file { display: none; }
.vis-music:has(input[value=perso]:checked) .vis-music-file { display: flex; flex-direction: column; gap: .3rem; }
.vis-music-preview { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.vis-voice[disabled] .vis-style-option { opacity: .55; cursor: not-allowed; }
.vis-item-video { position: relative; }
.vis-item video { width: 100%; aspect-ratio: 9/16; object-fit: cover; border-radius: 10px; background: #000; box-shadow: var(--shadow); pointer-events: none; }
.vis-item:hover video { outline: 2px solid var(--brand); outline-offset: 2px; }
.vis-item-play { position: absolute; top: .45rem; right: .45rem; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: rgb(0 0 0 / .55); color: #fff; font-size: .7rem; }
.vis-video-player { display: block; width: 100%; max-width: 360px; aspect-ratio: 9/16; border-radius: 12px; background: #000; }
div.vis-video-player { display: grid; place-items: center; padding: 1rem; text-align: center; color: var(--muted); background: var(--bg); }

/* Galerie */
.vis-library { scroll-margin-top: 4.5rem; }
.vis-library-head { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.vis-library .pagination { margin-top: 1rem; }
.vis-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; }
.vis-item { display: flex; flex-direction: column; gap: .2rem; min-width: 0; color: inherit; text-decoration: none; }
.vis-item:hover { color: inherit; }
.vis-item img, .vis-item-pending { width: 100%; object-fit: cover; border-radius: 10px; background: var(--bg); box-shadow: var(--shadow); }
.vis-item-pending { display: grid; place-items: center; font-size: .78rem; color: var(--muted); }
.vis-item:hover img { outline: 2px solid var(--brand); outline-offset: 2px; }
.vis-item-title { margin-top: .2rem; font-size: .82rem; font-weight: 600; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; }
.vis-item-meta { font-size: .72rem; color: var(--muted); }

/* Création en deux temps : concepts proposés, puis validation avant génération. */
.draft-steps { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; list-style: none; padding: 0; margin: 0 0 1rem; font-size: .85rem; color: var(--muted); }
.draft-steps li { display: flex; align-items: center; gap: .4rem; }
.draft-steps li span { display: grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 1.5px solid var(--border); font-weight: 700; font-size: .78rem; background: var(--surface); }
.draft-steps li.is-done span { background: var(--brand-soft); border-color: transparent; color: var(--brand-strong); }
.draft-steps li.is-current { color: var(--text); font-weight: 600; }
.draft-steps li.is-current span { background: var(--brand); border-color: var(--brand); color: #fff; }
.draft-note { margin: .25rem 0 1rem; }
.draft-post { margin: 0 0 .75rem; line-height: 1.5; }
.draft-concepts { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; align-items: start; }
.draft-concept { display: flex; flex-direction: column; gap: .65rem; }
.draft-concept .field { margin: 0; }
.draft-mock { position: relative; display: flex; align-items: flex-end; width: 100%; max-height: 360px; border-radius: 10px; overflow: hidden; background: linear-gradient(160deg, var(--mock-a) 0%, color-mix(in srgb, var(--mock-a) 55%, #000) 100%); color: #fff; }
.draft-mock-text { display: flex; flex-direction: column; align-items: flex-start; gap: .3rem; width: 100%; padding: .9rem; background: linear-gradient(transparent, rgb(0 0 0 / .45)); }
.draft-mock-text strong { font-size: 1.15rem; line-height: 1.2; overflow-wrap: anywhere; }
.draft-mock-text small { font-size: .82rem; opacity: .92; }
.draft-mock-price { font-style: normal; font-size: .78rem; font-weight: 700; padding: .1rem .5rem; border-radius: 6px; background: rgb(255 255 255 / .9); color: #111; }
.draft-mock-cta { margin-top: .2rem; padding: .3rem .75rem; border-radius: 999px; background: var(--mock-b); color: #111; font-size: .8rem; font-weight: 700; }
.draft-mock-play { position: absolute; top: .6rem; right: .6rem; display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: rgb(0 0 0 / .45); font-size: .8rem; }
.draft-slides { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .4rem; }
.draft-slide { display: grid; grid-template-columns: 1.5rem 1fr; gap: .25rem .4rem; align-items: center; }
.draft-slide input:last-child { grid-column: 2; font-size: .85rem; }
.draft-slide-n { font-size: .75rem; font-weight: 700; color: var(--muted); text-align: center; }
.draft-prompt summary { cursor: pointer; color: var(--brand); font-weight: 600; }
.draft-prompt textarea { margin-top: .4rem; width: 100%; }
.draft-more { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem; margin-top: 1rem; }
.draft-confirm { align-items: start; }
.draft-confirm-preview .draft-mock { max-width: 420px; max-height: 520px; }
.draft-recap { display: grid; grid-template-columns: auto 1fr; gap: .4rem .9rem; margin: .5rem 0 1rem; font-size: .92rem; }
.draft-recap dt { color: var(--muted); }
.draft-recap dd { margin: 0; overflow-wrap: anywhere; }
.draft-recap-slides { margin: 0; padding-left: 1.1rem; }
.draft-cost { padding: .7rem .85rem; margin-bottom: .75rem; border-radius: 10px; background: var(--brand-soft); color: var(--brand-strong); font-size: .9rem; }
.draft-cost.is-overage { background: #fef3c7; color: #92400e; }
.draft-pending { margin-bottom: 1rem; }
.draft-pending ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: .5rem; }
.draft-pending li { display: flex; flex-direction: column; gap: .1rem; min-width: 0; padding: .55rem .7rem; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); }
.draft-pending li a { font-weight: 600; text-decoration: none; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

@media (max-width: 640px) {
    .vis-head h1 { font-size: 1.25rem; }
    .vis-head .badge { font-size: .7rem; }
    .vis-intro { font-size: .76rem; margin-bottom: .6rem; }
    .page-app .vis-create { padding: .75rem; margin-bottom: .75rem; }
    .vis-create form { gap: .6rem; }
    .vis-drop { padding: .65rem; gap: .6rem; }
    .vis-drop-icon { width: 42px; height: 42px; }
    .vis-drop-text strong { font-size: .86rem; }
    .vis-drop-text span { font-size: .72rem; }
    .vis-fields { grid-template-columns: minmax(0, 1fr); gap: .6rem; }
    .vis-style-option > span { padding: .5rem .55rem; }
    .vis-style-option strong { font-size: .8rem; }
    .vis-style-option small { font-size: .68rem; }
    .vis-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
}

/* --- DISP Social (MVP) : accueil simplifié et page publique ----------------- */
.social-steps { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; gap: .6rem; }
.social-step { display: flex; align-items: center; gap: .85rem; padding: .85rem; border: 1px solid var(--border); border-radius: 14px; }
.social-step.is-next { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.social-step.is-done { opacity: .7; }
.social-step-num { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; background: var(--border); }
.social-step.is-next .social-step-num { background: var(--brand); color: #fff; }
.social-step.is-done .social-step-num { background: var(--success); color: #fff; }
.social-step-body { flex: 1; min-width: 0; }
.social-step-body p { margin: .15rem 0 0; }
.social-upcoming { display: flex; gap: .75rem; align-items: center; padding: .6rem 0; border-bottom: 1px dashed var(--border); color: inherit; text-decoration: none; }
.social-upcoming:hover { color: var(--brand); }
.social-upcoming-date { flex: 0 0 3.2rem; text-align: center; font-size: .75rem; color: var(--muted); line-height: 1.2; }
.social-upcoming-date b { display: block; font-size: .95rem; color: var(--text, inherit); }
.social-upcoming-text { min-width: 0; font-size: .9rem; }
.social-benefits { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); margin: 0; padding: 0; list-style: none; }
.social-benefits li { padding: 1rem; border: 1px solid var(--border); border-radius: 14px; }
.social-benefits strong { display: block; margin-bottom: .25rem; }
@media (max-width: 640px) {
    .social-step { flex-wrap: wrap; }
    .social-step .btn { width: 100%; }
}

/* --- Accueil DISP Social (MVP) : héros, avantages illustrés, étapes ------- */
.landing-hero { padding: 2.5rem 0 1rem; background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%); }
.landing-hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 2rem; align-items: center; }
.landing-hero h1 { font-size: 2.4rem; line-height: 1.12; letter-spacing: -.03em; margin: .6rem 0 .8rem; }
.landing-lead { color: var(--muted); font-size: 1.08rem; line-height: 1.55; margin: 0 0 1.25rem; }
.landing-cta { gap: .6rem; }
.landing-proof { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; padding: 0; margin: 1rem 0 0; color: var(--muted); font-size: .9rem; }
.landing-hero-img { width: 100%; height: auto; max-width: 480px; justify-self: center; }
.landing-section { padding-top: 1.5rem; }
.landing-title { text-align: center; font-size: 1.6rem; letter-spacing: -.02em; margin: 0 0 .5rem; }
.landing-subtitle { text-align: center; max-width: 620px; margin: 0 auto 1.5rem; }
.landing-who { margin-top: 1rem; }
.landing-who-card { display: flex; gap: 1rem; align-items: center; }
.landing-who-card img { width: 140px; height: auto; flex: 0 0 140px; }
.landing-who-card h3 { margin: 0 0 .3rem; }
.landing-benefits { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.landing-benefit { display: flex; flex-direction: column; gap: .35rem; transition: transform .15s, box-shadow .15s; }
.landing-benefit:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgb(15 23 42 / .08); }
.landing-benefit img { width: 100%; height: auto; border-radius: 12px; margin-bottom: .4rem; }
.landing-benefit h3 { margin: 0; font-size: 1.08rem; }
.landing-benefit p { margin: 0; }
.landing-steps { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.landing-steps li { display: flex; flex-direction: column; gap: .3rem; padding: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.landing-step-num { width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; background: var(--brand); color: #fff; margin-bottom: .2rem; }
.landing-final { padding-top: .5rem; padding-bottom: 2.5rem; }
.landing-final-card { text-align: center; padding: 2rem 1.25rem; background: linear-gradient(135deg, var(--brand-soft), #fef3c7); border: 0; }
.landing-final-card h2 { margin: 0 0 .4rem; }
@media (max-width: 900px) {
    .landing-hero-grid { grid-template-columns: 1fr; text-align: center; }
    .landing-cta, .landing-proof { justify-content: center; }
    .landing-hero h1 { font-size: 1.85rem; }
    .landing-hero-img { max-width: 360px; }
    .landing-benefits { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .landing-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .landing-benefits, .landing-steps { grid-template-columns: 1fr; }
    .landing-who-card { flex-direction: column; text-align: center; }
    .landing-who-card img { width: 160px; flex-basis: auto; }
}

/* Mon activité (profil de marque) : cartes de choix, champs aérés, bouton d'enregistrement accessible. */
.brand-profile { max-width: 640px; }
.bp-head { margin-bottom: .6rem; }
.bp-head h1 { margin: 0 0 .25rem; }
.bp-head .page-sub { margin: 0; }
.bp-card { margin-bottom: .6rem; padding: .8rem .85rem .2rem; }
.bp-card-title { display: flex; align-items: center; gap: .45rem; margin: 0 0 .55rem; font-size: 1rem; }
.bp-label, .brand-profile .field > label { display: block; margin-bottom: .25rem; font-size: .88rem; font-weight: 700; color: var(--text); }
.brand-profile .field { margin-bottom: .6rem; }
.brand-profile .field textarea, .brand-profile .field input[type=text] { width: 100%; padding: .5rem .7rem; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); font: inherit; line-height: 1.4; transition: border-color .15s, box-shadow .15s, background .15s; }
.brand-profile .field textarea:focus, .brand-profile .field input[type=text]:focus { outline: none; border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.brand-profile .field textarea::placeholder, .brand-profile .field input::placeholder { color: #9ca3af; }
.brand-profile .field .help { margin-top: .2rem; font-size: .78rem; }
.brand-profile .field textarea { min-height: 0; }
.brand-profile .has-error textarea, .brand-profile .has-error input { border-color: var(--danger); }
.bp-choices { border: 0; padding: 0; margin: 0 0 .6rem; display: grid; gap: .4rem; min-width: 0; }
.bp-choice { position: relative; display: flex; align-items: center; gap: .65rem; padding: .5rem .75rem; border: 1.5px solid var(--border); border-radius: 12px; background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; }
.bp-choice:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); }
.bp-choice-input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.bp-choice-icon { flex: none; width: 2.1rem; height: 2.1rem; display: grid; place-items: center; border-radius: 10px; background: var(--bg); font-size: 1.25rem; }
.bp-choice-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.bp-choice-title { font-weight: 700; font-size: .92rem; }
.bp-choice-text { font-size: .8rem; color: var(--muted); }
.bp-choice-check { flex: none; width: 1.3rem; height: 1.3rem; border: 2px solid var(--border); border-radius: 50%; transition: border-color .15s, background .15s; }
.bp-choice:has(.bp-choice-input:checked) { border-color: var(--brand); background: color-mix(in srgb, var(--brand-soft) 45%, var(--surface)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 12%, transparent); }
.bp-choice:has(.bp-choice-input:checked) .bp-choice-icon { background: var(--surface); }
.bp-choice:has(.bp-choice-input:checked) .bp-choice-check { border-color: var(--brand); background: var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 80% no-repeat; }
.bp-choice:has(.bp-choice-input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.bp-actions { position: sticky; bottom: .75rem; z-index: 5; padding-top: .25rem; }
.bp-actions .btn { min-height: 44px; font-size: 1rem; box-shadow: 0 6px 18px color-mix(in srgb, var(--brand) 30%, transparent); }
@media (max-width: 640px) {
    .bp-card { padding: .7rem .75rem .15rem; }
    .bp-choice { padding: .45rem .65rem; gap: .55rem; }
    .bp-choice-icon { width: 1.9rem; height: 1.9rem; font-size: 1rem; }
    .bp-actions { bottom: calc(64px + env(safe-area-inset-bottom) + .5rem); }
}

/* ==== Catalogue par album (entreprise ou personne, DISP Social) ==== */
@keyframes album-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.catalog-hero { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .9rem 1.25rem; margin-bottom: 1rem; }
.catalog-hero h1 { margin: 0 0 .35rem; }
.album-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; flex: 1 1 100%; }
.album-actions .btn { width: 100%; min-height: 46px; justify-content: center; gap: .45rem; font-size: .95rem; }
.album-actions .icon, .album-search .icon { width: 19px; height: 19px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.album-panel { padding: 1rem; }
.album-search { position: relative; display: flex; align-items: center; gap: .5rem; margin-bottom: 1rem; }
.album-search .icon { position: absolute; left: .8rem; color: var(--muted); pointer-events: none; }
.album-search input[type=search] { flex: 1; min-width: 0; min-height: 46px; padding-left: 2.5rem; padding-right: 2.4rem; border-radius: 999px; background: var(--bg); }
.album-search input[type=search]:focus { background: var(--surface); }
.album-search input[type=search]::-webkit-search-cancel-button { display: none; }
.album-search-clear { position: absolute; right: .55rem; display: grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--border); color: var(--text); font-size: 1.1rem; line-height: 1; text-decoration: none; }
.album-search-clear[hidden] { display: none; }
.album-search:has(button:not([hidden])) .album-search-clear { right: 7.6rem; }
.album-search-clear:hover { background: var(--brand-soft); color: var(--brand-strong); }
.album-panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; margin-bottom: .75rem; }
.album-panel-head .card-title { margin: 0; }

.album-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
.album-card { min-width: 0; display: flex; flex-direction: column; gap: .45rem; color: inherit; text-decoration: none; animation: album-in .25s ease both; }
.album-card[hidden] { display: none; }
.album-card:focus-visible { outline: none; }
.album-card:focus-visible .album-cover { box-shadow: 0 0 0 3px var(--brand); }
.album-cover { position: relative; display: grid; gap: 2px; aspect-ratio: 1; overflow: hidden; border-radius: 14px; background: var(--bg); border: 1px solid var(--border); transition: transform .2s ease, box-shadow .2s ease; }
.album-cover img { width: 100%; height: 100%; object-fit: cover; display: block; min-height: 0; transition: transform .35s ease; }
.album-card:hover .album-cover { box-shadow: 0 8px 22px rgb(15 23 42 / .14); transform: translateY(-2px); }
.album-card:hover .album-cover img { transform: scale(1.04); }
.album-card:active .album-cover { transform: scale(.98); }
.album-cover-0 { place-items: center; }
.album-cover-2 { grid-template-columns: 1fr 1fr; }
.album-cover-3 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.album-cover-3 img:first-child { grid-row: span 2; }
.album-cover-4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.album-cover-empty, .album-item-empty svg { width: 40%; height: 40%; fill: none; stroke: var(--muted); stroke-width: 1.5; }
.album-cover-video { position: absolute; right: .45rem; bottom: .45rem; display: grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: rgb(0 0 0 / .6); }
.album-cover-video svg { width: 13px; height: 13px; fill: #fff; margin-left: 2px; }
.album-meta { display: flex; flex-direction: column; gap: .05rem; padding: 0 .15rem; min-width: 0; }
.album-name { font-size: 1rem; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.album-empty { margin: .5rem 0 0; text-align: center; }
.album-empty[hidden] { display: none; }
.album-blank { display: flex; flex-direction: column; align-items: center; gap: .5rem; padding: 1.5rem .5rem; text-align: center; color: var(--muted); }
.album-blank svg { width: 46px; height: 46px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.album-blank p { margin: 0; max-width: 32ch; font-size: .9rem; }

/* Fenêtre modale générique (création d’album…) */
.app-modal { width: min(440px, calc(100vw - 2rem)); padding: 0; border: 0; border-radius: 18px; background: var(--surface); color: inherit; box-shadow: 0 24px 60px rgb(0 0 0 / .28); }
.app-modal[open] { animation: album-in .2s ease; }
.app-modal::backdrop { background: rgb(15 23 42 / .55); backdrop-filter: blur(2px); }
.app-modal form { display: flex; flex-direction: column; gap: .8rem; padding: 1.25rem; }
.app-modal h2 { margin: 0; font-size: 1.2rem; }
.app-modal p { margin: 0; }
.app-modal .field { display: flex; flex-direction: column; gap: .3rem; }
.app-modal input[type=text] { min-height: 46px; }
.app-modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-top: .25rem; }
.app-modal-actions .btn { min-height: 44px; justify-content: center; }
@media (max-width: 640px) {
    /* Feuille du bas sur téléphone. */
    .app-modal { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: 20px 20px 0 0; }
    .app-modal form { padding: 1.25rem 1rem calc(1rem + env(safe-area-inset-bottom)); }
}

/* Détail d’un album */
.album-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.album-item { position: relative; display: flex; flex-direction: column; color: inherit; text-decoration: none; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--surface); transition: box-shadow .2s, transform .2s; animation: album-in .25s ease both; }
.album-item:hover { box-shadow: 0 8px 22px rgb(15 23 42 / .12); transform: translateY(-2px); }
.album-item > img, .album-item-empty { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: grid; place-items: center; background: var(--bg); }
.album-item-body { display: flex; flex-direction: column; gap: .2rem; padding: .6rem .7rem .75rem; }
.album-item-desc { opacity: .8; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.album-item-status { position: absolute; top: .5rem; left: .5rem; }
.album-item-play { position: absolute; top: .5rem; right: .5rem; display: inline-flex; align-items: center; gap: .2rem; padding: .15rem .45rem .15rem .3rem; border-radius: 999px; background: rgb(0 0 0 / .6); color: #fff; font-size: .72rem; font-weight: 600; }
.album-item-play svg { width: 14px; height: 14px; fill: #fff; }
.album-new { display: flex; gap: .5rem; margin-top: 1rem; flex-wrap: wrap; }
.album-new input[type=text] { flex: 1 1 12rem; width: auto; }

@media (min-width: 720px) {
    .album-actions { flex: 0 0 auto; grid-template-columns: auto auto; }
    .album-actions .btn { padding-inline: 1.1rem; }
    .album-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.1rem; }
    .album-panel { padding: 1.25rem; }
}
@media (min-width: 1100px) {
    .album-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .album-items { grid-template-columns: repeat(2, 1fr); gap: .6rem; }
    .album-item-body { padding: .45rem .5rem .55rem; }
    .album-item-desc { display: none; }
}

/* ==== Ajout de photos et vidéos (galerie) ==== */
.media-form-grid { display: grid; gap: 1rem; }
.media-form-grid .card-title { margin-bottom: .75rem; }
.media-form-actions { position: sticky; bottom: .5rem; z-index: 5; display: grid; grid-template-columns: 1fr 2fr; gap: .6rem; padding: .6rem; margin-top: 1rem; border-radius: 16px; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(8px); box-shadow: 0 6px 24px rgb(15 23 42 / .12); }
.media-form-actions .btn { min-height: 48px; justify-content: center; font-size: 1rem; }
@media (max-width: 640px) {
    /* Au-dessus de la barre d'onglets du bas. */
    .media-form-actions { bottom: calc(64px + env(safe-area-inset-bottom) + .5rem); }
}
@media (min-width: 900px) {
    .media-form { max-width: 1040px; }
    .media-form-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; }
    .media-form.is-edit { max-width: 640px; }
    .media-form.is-edit .media-form-grid { grid-template-columns: 1fr; }
    .media-form-media { position: sticky; top: 1rem; }
    .media-form-actions { position: static; display: flex; justify-content: flex-end; padding: 0; background: none; box-shadow: none; backdrop-filter: none; }
    .media-form-actions .btn { min-width: 9rem; }
}

.media-upload { display: flex; flex-direction: column; gap: .7rem; }
.media-drop { position: relative; display: flex; align-items: center; gap: .9rem; min-height: 92px; padding: 1rem; border: 2px dashed #cbd5e1; border-radius: 16px; background: var(--bg); color: var(--muted); cursor: pointer; transition: border-color .15s, background .15s, color .15s, transform .15s; }
.media-drop:hover, .media-drop:focus-within, .media-drop.is-dragging { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-strong); }
.media-drop.is-dragging { transform: scale(1.01); }
.media-drop.has-file { min-height: 64px; border-style: solid; border-color: var(--border); background: var(--surface); }
.media-drop-icon { display: grid; place-items: center; width: 52px; height: 52px; flex: none; border-radius: 14px; background: var(--surface); color: var(--brand); box-shadow: var(--shadow); }
.media-drop.has-file .media-drop-icon { width: 40px; height: 40px; }
.media-drop-icon svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.media-drop-text { display: flex; flex-direction: column; gap: .1rem; min-width: 0; font-size: .85rem; }
.media-drop-text strong { color: var(--text); font-size: 1rem; }
.media-drop input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.media-previews { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.media-previews[hidden] { display: none; }
.media-preview { position: relative; margin: 0; aspect-ratio: 1; overflow: hidden; border-radius: 12px; background: #0b1220; animation: album-in .2s ease both; }
.media-preview img, .media-preview video { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-preview-badge { position: absolute; left: .35rem; bottom: .35rem; padding: .1rem .4rem; border-radius: 999px; background: rgb(0 0 0 / .62); color: #fff; font-size: .7rem; font-weight: 600; }
.media-preview-remove { position: absolute; top: .3rem; right: .3rem; display: grid; place-items: center; width: 1.75rem; height: 1.75rem; padding: 0; border: 0; border-radius: 50%; background: rgb(0 0 0 / .62); color: #fff; font-size: 1.1rem; line-height: 1; cursor: pointer; }
.media-preview-remove:hover { background: #dc2626; }
.media-summary { margin: 0; font-size: .8rem; color: var(--muted); }
.media-summary.is-error { color: #b91c1c; font-weight: 600; }
.media-progress { display: flex; align-items: center; gap: .6rem; }
.media-progress[hidden] { display: none; }
.media-progress-track { flex: 1; height: 8px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.media-progress-bar { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), #14b8a6); transition: width .2s ease; }
.media-progress-label { font-size: .8rem; font-weight: 600; color: var(--brand-strong); white-space: nowrap; }
.media-add-form { display: flex; flex-direction: column; gap: .7rem; margin-top: 1rem; }
.media-add-form > .btn { align-self: flex-end; min-height: 44px; }
@media (min-width: 560px) {
    .media-previews { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.product-video video { width: 120px; height: 170px; object-fit: cover; border-radius: 8px; background: #000; display: block; }

/* --- Inscription DISP Social (www, mobile d'abord) ------------------------- */
.page-register { background: linear-gradient(180deg, var(--brand-soft) 0, var(--bg) 220px) no-repeat, var(--bg); }
.page-register .topbar .container { flex-wrap: nowrap; }
.page-register .nav { flex-wrap: nowrap; }
.page-register .nav .btn { display: none; }
@media (max-width: 479px) { .page-register .nav a:first-child { display: none; } }

.reg { max-width: 560px; margin: 0 auto; padding: 1.25rem 1rem 2.5rem; }
.reg-head { margin-bottom: 1rem; }
.reg-head h1 { font-size: 1.45rem; margin-bottom: .3rem; letter-spacing: -.01em; }
.reg-head p { color: var(--muted); margin: 0; font-size: .95rem; }

.reg-form > .form-errors { margin: 0 0 .75rem; padding: .6rem .8rem .6rem 1.8rem; background: var(--danger-soft); border-radius: 10px; }
.reg-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); padding: 1rem; margin-bottom: .85rem; }
.reg-card-title { display: flex; align-items: center; gap: .5rem; font-size: 1.02rem; margin: 0 0 .85rem; }
.reg-step { display: grid; place-items: center; width: 1.6rem; height: 1.6rem; flex: none; border-radius: 50%; background: var(--brand); color: #fff; font-size: .8rem; font-weight: 700; }
.reg-card .field { margin-bottom: .85rem; }
.reg-card .field:last-child { margin-bottom: 0; }
.reg-card .field > label { font-size: .9rem; }
.reg-card input, .reg-card select { min-height: 48px; font-size: 16px; } /* 16px : pas de zoom automatique sur iPhone. */
.reg .has-error input, .reg .has-error select { border-color: var(--danger); }
.reg .field-error { padding-left: 0; list-style: none; font-size: .85rem; }

.reg-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 .65rem; }
.reg-pair .field { margin-bottom: .85rem; }
@media (max-width: 339px) { .reg-pair { grid-template-columns: 1fr; } }

/* Choix en cartes (type d'activité, formule) : le bouton radio natif reste pour le clavier. */
.reg-options { border: 0; padding: 0; margin: 0 0 .85rem; display: grid; gap: .5rem; min-width: 0; }
.reg-option { position: relative; display: flex; align-items: center; gap: .7rem; padding: .7rem .8rem; border: 1.5px solid var(--border); border-radius: 12px; background: #fff; cursor: pointer; transition: border-color .15s, background .15s; }
.reg-option:hover { border-color: #b6c2cf; }
.reg-option-input { position: absolute; opacity: 0; pointer-events: none; }
.reg-option:has(.reg-option-input:checked) { border-color: var(--brand); background: #f0fdfa; }
.reg-option:has(.reg-option-input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.reg-option-icon { display: grid; place-items: center; width: 2.3rem; height: 2.3rem; flex: none; border-radius: 10px; background: var(--bg); font-size: 1.15rem; }
.reg-option-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.reg-option-title { font-weight: 650; font-size: .95rem; line-height: 1.3; }
.reg-option-text { color: var(--muted); font-size: .8rem; line-height: 1.35; }
.reg-option-check { width: 1.3rem; height: 1.3rem; flex: none; border-radius: 50%; border: 1.5px solid #cbd5e1; background: #fff; }
.reg-option:has(.reg-option-input:checked) .reg-option-check { border-color: var(--brand); background: var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.2l2.6 2.6L12 5.4' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 80% no-repeat; }

/* Indicatif + numéro. */
.reg-phone { display: flex; min-width: 0; }
.reg-phone > input { flex: 1 1 auto; min-width: 0; border-radius: 0 10px 10px 0; }
.reg-dial { position: relative; display: flex; align-items: center; gap: .35rem; flex: none; padding: 0 .7rem 0 .85rem; border: 1px solid #d1d5db; border-right: 0; border-radius: 10px 0 0 10px; background: var(--bg); font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text); }
.reg-dial::after { content: ""; width: .4em; height: .4em; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-.15em) rotate(45deg); }
.reg-dial:focus-within { outline: 2px solid var(--brand-soft); border-color: var(--brand); z-index: 1; }
.reg-card .reg-dial-select { position: absolute; inset: 0; width: 100%; min-height: 0; height: 100%; padding: 0; opacity: 0; cursor: pointer; font-size: 16px; }
.reg .has-error .reg-dial { border-color: var(--danger); }

/* Mot de passe : afficher/masquer, jauge et règles mises à jour pendant la saisie. */
.reg-password { position: relative; }
.reg-password input { padding-right: 5.2rem; }
.reg-password-toggle { position: absolute; top: 50%; right: .35rem; transform: translateY(-50%); min-height: 36px; padding: 0 .65rem; border: 0; border-radius: 8px; background: none; color: var(--brand); font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; }
.reg-password-toggle:hover { background: var(--brand-soft); }
.pwd-meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: .5rem; }
.pwd-meter span { height: 4px; border-radius: 2px; background: var(--border); transition: background .2s; }
.pwd-meter[data-level="1"] span:nth-child(-n+1) { background: var(--danger); }
.pwd-meter[data-level="2"] span:nth-child(-n+2) { background: var(--accent); }
.pwd-meter[data-level="3"] span:nth-child(-n+3) { background: #65a30d; }
.pwd-meter[data-level="4"] span { background: var(--success); }
.pwd-rules { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; gap: .2rem; font-size: .82rem; color: var(--muted); }
.pwd-rules li { display: flex; align-items: center; gap: .45rem; }
.pwd-rules li::before { content: ""; width: .95rem; height: .95rem; flex: none; border-radius: 50%; border: 1.5px solid #cbd5e1; box-sizing: border-box; }
.pwd-rules li[data-state="ok"] { color: var(--success); }
.pwd-rules li[data-state="ok"]::before { border: 0; background: var(--success) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.2l2.6 2.6L12 5.4' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 85% no-repeat; }
.pwd-rules li[data-state="ko"] { color: var(--danger); }
.pwd-rules li[data-state="ko"]::before { border: 0; background: var(--danger) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M5 5l6 6M11 5l-6 6' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E") center / 80% no-repeat; }
.pwd-rules li[data-state="pending"]::before { border-color: var(--brand) transparent var(--brand) var(--brand); animation: pwd-spin .8s linear infinite; }
@keyframes pwd-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .pwd-rules li[data-state="pending"]::before { animation: none; } }

/* Formules : bascule mensuel / annuel, prix affiché selon le choix (sans JavaScript). */
.reg-cycle { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin: 0 0 .75rem; border: 0; border-radius: 12px; background: var(--bg); min-width: 0; }
.reg-cycle-option { position: relative; display: flex; align-items: center; justify-content: center; min-height: 42px; padding: .3rem .5rem; border-radius: 9px; font-weight: 600; font-size: .9rem; color: var(--muted); text-align: center; cursor: pointer; line-height: 1.2; }
.reg-cycle-option > span { display: flex; flex-direction: column; align-items: center; }
.reg-cycle-option small { display: block; font-size: .72rem; font-weight: 600; color: var(--success); }
.reg-cycle-input { position: absolute; opacity: 0; pointer-events: none; }
.reg-cycle-option:has(.reg-cycle-input:checked) { background: #fff; color: var(--text); box-shadow: var(--shadow); }
.reg-cycle-option:has(.reg-cycle-input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 1px; }
.reg-plans { margin-bottom: .6rem; }
.reg-plan-price { display: flex; flex-direction: column; align-items: flex-end; text-align: right; font-weight: 750; font-size: .95rem; white-space: nowrap; }
.reg-plan-price small { font-weight: 500; font-size: .75rem; color: var(--muted); margin-left: .2rem; }
.reg-price-yearly { display: none; }
.reg-form:has(.reg-cycle-input[value="yearly"]:checked) .reg-price-yearly { display: inline; }
.reg-form:has(.reg-cycle-input[value="yearly"]:checked) .reg-price-monthly { display: none; }
.reg-note { margin: 0; font-size: .8rem; color: var(--muted); line-height: 1.45; }

.reg-submit { padding-top: .15rem; }
.reg-terms { margin-bottom: .8rem; }
.reg-terms-label { display: flex; align-items: flex-start; gap: .65rem; padding: .75rem .85rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); font-size: .9rem; line-height: 1.4; cursor: pointer; }
.reg-terms-label input { width: 1.2rem; height: 1.2rem; margin: .05rem 0 0; flex: none; accent-color: var(--brand); cursor: pointer; }
.reg-terms-label:has(input:checked) { border-color: var(--brand); background: #f0fdfa; }
.reg-terms.has-error .reg-terms-label { border-color: var(--danger); }
.reg-btn { min-height: 52px; font-size: 1.05rem; border-radius: 12px; }
.reg-login { text-align: center; margin: 1rem 0 0; font-size: .9rem; color: var(--muted); }

@media (min-width: 640px) {
    .reg { padding-top: 2rem; }
    .reg-head h1 { font-size: 1.8rem; }
    .reg-card { padding: 1.3rem 1.4rem; }
    .reg-options:not(.reg-plans) { grid-template-columns: 1fr 1fr; }
    .reg-options:not(.reg-plans) .reg-option { align-items: flex-start; }
}

/* --- Site public : en-tête sur une ligne ----------------------------------- */
.topbar-www { backdrop-filter: saturate(1.4) blur(8px); background: rgb(255 255 255 / .9); }
.topbar-www .container { flex-wrap: nowrap; gap: .75rem; }
.topbar-www .nav { flex-wrap: nowrap; align-items: center; gap: .15rem; min-width: 0; }
.topbar-www .nav a { white-space: nowrap; }
.topbar-www .nav a.btn { color: #fff; margin-left: .35rem; padding: .35rem .85rem; transition: background .15s, transform .15s, box-shadow .15s; }
.topbar-www .nav a.btn:hover { background: var(--brand-strong); color: #fff; transform: translateY(-1px); box-shadow: 0 6px 16px rgb(15 118 110 / .25); }
@media (max-width: 520px) {
    .topbar-www .container { padding: 0 .75rem; }
    .topbar-www .nav a:not(.btn):first-child { display: none; } /* « DISP Social » : c'est déjà l'accueil. */
    .topbar-www .nav a { font-size: .875rem; padding: .4rem .5rem; }
    .topbar-www .nav a.btn { margin-left: .1rem; padding: .3rem .7rem; }
}

/* --- Accueil : défilement doux, animations --------------------------------- */
html { scroll-behavior: smooth; }
#formules-social, .landing-section { scroll-margin-top: 64px; } /* sous l'en-tête collant */

@keyframes landing-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes landing-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes landing-pop { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }

.landing-hero-text > * { animation: landing-rise .7s cubic-bezier(.2, .7, .2, 1) both; }
.landing-hero-text > :nth-child(1) { animation-delay: .05s; }
.landing-hero-text > :nth-child(2) { animation-delay: .15s; }
.landing-hero-text > :nth-child(3) { animation-delay: .25s; }
.landing-hero-text > :nth-child(4) { animation-delay: .35s; }
.landing-hero-text > :nth-child(5) { animation-delay: .45s; }
.landing-hero-visual { justify-self: center; width: 100%; max-width: 480px; }
.landing-hero-img { display: block; margin: 0 auto; animation: landing-float 6s 1.4s ease-in-out infinite; }
.landing-cta .btn { transition: transform .15s, box-shadow .15s, background .15s; }
.landing-cta .btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgb(15 23 42 / .12); }
.landing-cta .btn:active { transform: translateY(0); }

/* Apparition au défilement : seulement si le script l'a activée (sinon tout reste visible). */
/* Variantes : data-reveal (monte), ="left" / ="right" (glisse depuis le côté), ="zoom" (grossit). */
.landing-page { overflow-x: clip; } /* les glissements latéraux n'élargissent pas la page */
.reveal-on [data-reveal] {
    opacity: 0; transform: translateY(44px) scale(.98);
    transition: opacity .8s cubic-bezier(.16, 1, .3, 1), transform .9s cubic-bezier(.16, 1, .3, 1);
    transition-delay: var(--reveal-delay, 0ms);
}
.reveal-on [data-reveal="left"] { transform: translateX(-56px) rotate(-1.5deg); }
.reveal-on [data-reveal="right"] { transform: translateX(56px) rotate(1.5deg); }
.reveal-on [data-reveal="zoom"] { transform: scale(.86); }
.reveal-on [data-reveal].is-visible { opacity: 1; transform: none; }

/* Dans une carte qui apparaît : l'image arrive juste après, avec un petit rebond. */
.reveal-on .landing-who-card[data-reveal] img,
.reveal-on .landing-benefit[data-reveal] img { opacity: 0; transform: scale(.8) translateY(10px); transition: opacity .6s ease, transform .75s cubic-bezier(.34, 1.56, .64, 1); transition-delay: calc(var(--reveal-delay, 0ms) + 220ms); }
.reveal-on .landing-who-card[data-reveal].is-visible img,
.reveal-on .landing-benefit[data-reveal].is-visible img { opacity: 1; transform: none; }
/* Étapes : le numéro s'allume après la carte. */
.reveal-on .landing-steps li[data-reveal] .landing-step-num { transform: scale(0); transition: transform .55s cubic-bezier(.34, 1.56, .64, 1); transition-delay: calc(var(--reveal-delay, 0ms) + 250ms); }
.reveal-on .landing-steps li[data-reveal].is-visible .landing-step-num { transform: none; }

/* Survol (ordinateur), après l'apparition. */
.reveal-on .landing-benefit[data-reveal].is-visible:hover { transform: translateY(-4px); transition-delay: 0ms; }
.landing-benefit:hover img, .reveal-on .landing-benefit[data-reveal].is-visible:hover img { transform: scale(1.04); transition-delay: 0ms; }
.landing-benefit img { transition: transform .35s ease; }
.landing-steps li { transition: transform .2s, box-shadow .2s, border-color .2s; }
.landing-steps li:hover, .reveal-on .landing-steps li[data-reveal].is-visible:hover { transform: translateY(-3px); border-color: var(--brand); box-shadow: 0 10px 24px rgb(15 23 42 / .08); transition-delay: 0ms; }
:where(#formules-social) .card { transition: transform .2s, box-shadow .2s; } /* :where : ne masque pas la transition d'apparition */
#formules-social .card:hover { transform: translateY(-4px); box-shadow: 0 14px 32px rgb(15 23 42 / .1); transition-delay: 0ms; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .landing-hero-text > *, .landing-hero-img { animation: none; }
    .landing-benefit:hover img { transform: none; }
    .landing-benefit:hover img, .landing-steps li:hover, #formules-social .card:hover, .landing-cta .btn:hover, .topbar-www .nav a.btn:hover { transform: none; }
}

/* « Pour qui ? » : boutiques, entreprises, personnes (3 cartes). */
.landing-who-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: 1rem; }
.landing-who-3 .landing-who-card { flex-direction: column; align-items: center; text-align: center; padding: 1.25rem 1.1rem; }
.landing-who-3 .landing-who-card img { width: 170px; flex-basis: auto; }
@media (max-width: 900px) { .landing-who-3 { grid-template-columns: 1fr; max-width: 520px; margin-inline: auto; } }
