/* Version mobile de ZK (écrans de 880 px et moins), d'après la maquette Figma Make « ZK MP Mobile app ».
   Chargée après base.css ; sans effet sur grand écran. Coque : templates/_mobile_shell.html ; comportements :
   static/mobile.js. Les règles préfixées par `body` passent devant les <style> des pages ; `!important` ne sert
   que contre un style posé en attribut.

   ===== SYNCHRONISATION FIGMA MAKE → ZK (lu par Claude à chaque mise à jour, ne pas supprimer) =====
   Source     : figma.com/make/DiFV7PrVc4CN6JTYLUyl1M (src/App.tsx, src/index.css), lue le 12/10/2026.
   Empreinte  : App.tsx = Login, Header(logo + menu), Drawer(profil, recherche, 8 entrées, déconnexion),
                to-top, 5 écrans (Pilotage, Prix, Produits, Marketplaces, À faire) ; index.css = tokens
                green-800 #1d5e55, line #e3e8e6, header 76 px, drawer rayon 24 / poignée 42×4, cartes rayon 14,
                pastille active pleine, champ recherche 46 px, bouton remonter 45×52.
   Correspondances (maquette → ZK) :
     .app-header / .hamburger-button → #m-top / #m-more-open      .drawer → dialog#m-more
     .drawer-search                  → .nav-search de ZK (déplacé)  .logout-button → form POST /logout
     menu « 630 » / « 6 »            → to_correct / open_feedback  (+ due_tasks sur À faire, gardé)
     .page-title / .prices-title     → .page-header                 .dashboard-card → .card
     .filter-row / .segment-control  → .chip, .tab, .dash-tab, .market-tab (actif plein)
     .mobile-product-card            → table.m-cards (2 colonnes, intitulé au-dessus, action en pied)
     .product-kpis                   → .kpi-bubbles (tuiles)        .week-strip > button → .pl-day
     .pilotage-alert-icon            → .pl-alert-icon               .market-card → .ml-card
     .correction-sheet               → dialog.modal                 .to-top-button → .back-to-top
     .status                         → .badge, .pl-pill             .task-check → .task-check
   Couleurs : uniquement les variables de base.css (green-800 = --primary, green-900 = --primary-hover,
   green-100 = --primary-bg, green-50 = --m-primary-soft dérivé de --primary-bg, red = --danger, line = --border,
   muted = --text-muted, orange = --warning).
   Non repris (données de démonstration ou écrans hors coque) : écran de connexion, données fictives, courbe de
   chiffre d'affaires, score « Qualité », étiquette MyZenteka, « Actualiser les données », couleurs des logos
   marketplaces (ZK affiche les vrais logos).
   Gardé de ZK, absent de la maquette : bouton retour des sous-pages, Tuto, Donner un avis, Changer mon mot de
   passe, pastille À faire, réserve admin sur Prix et Paramètres, titre de page qui apparaît en défilant.
   ================================================================================================== */

/* Sur grand écran, la coque n'existe pas (le menu latéral de base.css fait tout). */
.m-top { display: none; }

@media (max-width: 880px) {
  :root {
    --m-top: 76px;
    --m-tabs: 0px;  /* la maquette n'a pas d'onglets en bas : tout passe par le menu */
    --m-top-h: calc(var(--m-top) + env(safe-area-inset-top, 0px));
    --m-tabs-h: calc(var(--m-tabs) + env(safe-area-inset-bottom, 0px));
    --m-gutter: 20px;
    --m-primary-soft: color-mix(in srgb, var(--primary-bg) 55%, var(--surface));  /* green-50 de la maquette */
  }
  @view-transition { navigation: auto; }

  html { scroll-padding-top: calc(var(--m-top-h) + 12px); -webkit-text-size-adjust: 100%; }
  /* `clip` et non `hidden` : `hidden` ferait du corps de page le conteneur de défilement, et plus rien ne resterait collé en haut. */
  html, body { overflow-x: clip; }
  body { padding: 0; }
  a, button, .chip, .tab, .dash-tab, .market-tab { -webkit-tap-highlight-color: transparent; }

  /* --- Coque --- */
  .app-shell { flex-direction: column; min-height: 100dvh; }
  .app-shell > * { min-width: 0; }
  .sidebar, .nav-edge { display: none !important; }
  main { flex: 1; }
  body .content { max-width: none; padding: 16px var(--m-gutter) calc(var(--m-tabs-h) + 42px); }
  /* Le rappel du type d'accès (lecture seule, correcteur, graphiste) : connu, il prend trop de place ici. */
  .content > .alert-info:first-child { display: none; }

  /* --- Coque (maquette : .app-header, .hamburger-button) --- */
  .m-top {
    position: sticky; top: 0; z-index: 70;
    display: flex; align-items: center; gap: 10px;
    height: var(--m-top-h); padding: env(safe-area-inset-top, 0px) 18px 0;
    background: rgba(255, 255, 255, .94); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
  }
  .m-top:has(#m-back) { padding-left: 8px; gap: 6px; }
  .m-fi { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
  .m-top-btn {
    flex: none; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
    border: 0; border-radius: 11px; background: none; color: var(--primary); cursor: pointer; font: inherit;
  }
  .m-top-btn:active { background: var(--primary-bg); }
  .m-top-brand { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; }
  .m-top-brand .zk-mark { width: 44px; height: 44px; box-shadow: none; }
  .m-menu-btn {
    position: relative; flex: none; width: 44px; height: 44px; display: grid; place-items: center;
    border: 0; border-radius: 11px; background: var(--m-primary-soft); color: var(--primary); cursor: pointer;
    transition: transform .18s ease, background .18s ease;
  }
  .m-menu-btn:active { background: var(--primary-bg); }
  .m-dot { position: absolute; top: 9px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 2px var(--surface); }
  .m-title {
    flex: 1; min-width: 0; font-size: 16px; font-weight: 700; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    opacity: 0; transform: translateY(4px); transition: opacity .18s ease, transform .18s ease;
  }
  html.m-scrolled .m-title { opacity: 1; transform: none; }

  /* --- Menu qui monte du bas (maquette : .drawer) --- */
  dialog.m-sheet {
    width: min(100vw, 520px); max-width: none; margin: auto auto 0; padding: 0; border: 0; border-radius: 24px 24px 0 0;
    background: var(--surface); color: var(--text); box-shadow: 0 -20px 50px rgba(20, 30, 28, .14);
    max-height: 94dvh; overflow-y: auto; scrollbar-width: none;
  }
  dialog.m-sheet::-webkit-scrollbar { display: none; }
  dialog.m-sheet[open] { animation: m-slide-up .25s ease-out; }
  dialog.m-sheet::backdrop { background: rgba(20, 30, 28, .55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
  .m-sheet-body { padding: 10px 20px max(24px, env(safe-area-inset-bottom, 0px)); }
  .m-sheet-body::before { content: ""; display: block; width: 42px; height: 4px; border-radius: 9px; background: var(--border-strong); margin: 0 auto 18px; }
  .m-profile { display: grid; grid-template-columns: 48px minmax(0, 1fr) 40px; align-items: center; gap: 12px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
  .m-avatar { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; background: var(--primary-bg); color: var(--primary); font-size: 17px; font-weight: 800; }
  .m-profile-text { min-width: 0; }
  .m-profile-text strong, .m-profile-text small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .m-profile-text strong { font-size: 14px; }
  .m-profile-text small { margin-top: 3px; color: var(--text-muted); font-size: 12px; }
  .m-icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 12px; background: none; color: var(--primary-hover); cursor: pointer; }
  .m-icon-btn:active { background: var(--m-primary-soft); }
  .m-menu { display: flex; flex-direction: column; padding: 16px 0; }
  .m-menu form { display: contents; }
  .m-menu-item {
    display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; align-items: center;
    width: 100%; min-height: 45px; padding: 9px 3px; border: 0; border-radius: 12px; background: none;
    font: inherit; color: var(--text-muted); text-align: left; text-decoration: none; cursor: pointer;
  }
  .m-menu-item > svg { color: var(--text-muted); }
  .m-menu-item > span { color: var(--text); font-size: 13px; font-weight: 600; }
  .m-menu-item:hover { text-decoration: none; }
  .m-menu-item:active { background: var(--surface-sunken); }
  .m-menu-item.active { background: var(--m-primary-soft); padding-left: 11px; padding-right: 11px; }
  .m-menu-item.active > span, .m-menu-item.active > svg { color: var(--primary); }
  .m-count {
    justify-self: end; min-width: 23px; height: 21px; padding: 0 6px; display: grid; place-items: center;
    border-radius: 7px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 800;
  }
  .m-menu-label {
    display: block; margin-top: 8px; padding: 16px 4px 6px; border-top: 1px solid var(--border);
    color: var(--text-faint); font-size: 10px; font-weight: 800; letter-spacing: 1.1px; text-transform: uppercase;
  }
  .m-logout {
    width: 100%; min-height: 50px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 13px;
    border: 0; border-radius: 12px; background: var(--danger-bg); color: var(--danger); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
  }
  /* Recherche (maquette : .drawer-search) : le vrai champ « Ouvrir un produit… » de ZK, déplacé ici par mobile.js. */
  .m-search-slot .nav-search { margin: 0 2px 10px; }
  .m-search-slot .nav-search input {
    height: 46px; padding: 0 12px 0 38px; font-size: 16px;
    border: 1px solid var(--border); border-radius: 11px; background: var(--surface-alt);
  }
  .m-search-slot .nav-search input:focus { outline: 0; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-bg); }
  .m-search-slot .nav-search > span { left: 12px; }
  .m-search-slot .autocomplete-list { position: static; width: auto; max-height: 50dvh; margin-top: 8px; box-shadow: none; }
  .m-search-slot .autocomplete-item { padding: 12px 10px; font-size: 14.5px; }
  @keyframes m-slide-up { from { transform: translateY(100%); } }
  @keyframes m-sheet-in { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }

  /* Dans la fenêtre de correction (cadre), pas de coque. */
  html.in-frame .m-top { display: none; }
  html.in-frame body .content { padding: 12px var(--m-gutter) 24px; }

  /* Pages prévues pour l'ordinateur (mobile.js) : un mot, et la page reste utilisable. */
  .m-note {
    display: flex; align-items: center; gap: 10px; margin: 0 0 12px; padding: 9px 12px; border-radius: 12px;
    background: var(--surface-sunken); color: var(--text-muted); font-size: 12.5px; line-height: 1.4;
  }
  .m-note button { flex: none; width: 30px; height: 30px; border: 0; border-radius: 50%; background: none; color: var(--text-faint); font-size: 18px; cursor: pointer; }

  /* --- Composants de base, à la taille du doigt --- */
  body .page-header, body .pl-head { flex-direction: column; align-items: stretch; gap: 10px; margin-bottom: 14px; }
  body .page-header h1, body .pl-head h1 { font-size: 26px; letter-spacing: -.02em; line-height: 1.15; }
  body .page-subtitle { font-size: 13.5px; margin-top: 2px; }
  .page-header > .btn, .page-header > a.btn, .page-header > form > .btn, .pl-head > .btn, .page-header > form { width: 100%; }
  body .page-header > *, body .pl-head > * { min-width: 0; max-width: 100%; }
  body .mp-back { display: none; }  /* le retour est dans la barre du haut */
  body .card { padding: 16px; border-radius: 14px; margin-bottom: 12px; }
  body .section-head { margin: 20px 0 10px; }
  h1, h2, h3 { overflow-wrap: anywhere; }

  .btn { min-height: 44px; padding: 10px 16px; font-size: 15px; border-radius: 12px; white-space: normal; text-align: center; }
  .btn-sm { min-height: 38px; padding: 7px 13px; font-size: 14px; border-radius: 10px; }
  .btn:active { transform: none; opacity: .85; }
  .icon-btn { width: 40px; height: 40px; border-radius: 10px; }
  .link-btn { font-size: 14px; min-height: 32px; }
  .chip { padding: 9px 14px; font-size: 13.5px; }
  .category-chips .chip { padding: 7px 12px; }
  .task-check { width: 24px; height: 24px; }

  input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search],
  select, textarea, .dp-trigger, .sr-input, .fix-row input, .fix-row textarea, .ct-value textarea, .feedback-dialog textarea, .fb-compose textarea,
  .pr-tools input[type=search] {
    font-size: 16px; padding: 11px 12px; border-radius: 10px; width: 100%; max-width: 100%;
  }
  input[type=file] { font-size: 14px; }
  select { padding-right: 32px; }
  .field-row { flex-direction: column; align-items: stretch; gap: 12px; }
  .field-row > .field, .field-row > .btn { width: 100% !important; min-width: 0 !important; flex: none !important; }
  .rate-input input, .kpi-edit input, .mg-cost input, .np-commission-edit input { width: 90px; padding: 8px 10px; font-size: 16px; }

  /* Onglets et rangées de pastilles : une ligne qui défile, bord à bord. */
  body .dash-tabs, body .tabs, body .market-tabs, body .tuto-cats, body .category-chips {
    display: flex; flex-wrap: nowrap; gap: 6px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none;
    margin: 0 calc(-1 * var(--m-gutter)) 14px; padding: 4px var(--m-gutter) 6px;
    background: none; border: 0; border-radius: 0; box-shadow: none; -webkit-overflow-scrolling: touch;
  }
  body .dash-tabs::-webkit-scrollbar, body .tabs::-webkit-scrollbar, body .market-tabs::-webkit-scrollbar, body .tuto-cats::-webkit-scrollbar,
  body .category-chips::-webkit-scrollbar { display: none; }
  body .category-chips { margin-top: 10px; margin-bottom: -4px; }
  body .dash-tab, body .tab, body .market-tab {
    flex: none; scroll-snap-align: start; padding: 9px 15px; font-size: 14px; min-height: 40px;
    background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-xs);
  }
  body .dash-tab.active, body .tab.active, body .market-tab.active { border-color: var(--primary); }
  body .tab[data-tab="lovable"] { display: none; }
  .mode-switch { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .mode-switch a, .mode-switch button { white-space: nowrap; min-height: 38px; }

  /* Tableaux : chaque ligne devient une carte, chaque cellule une ligne « intitulé · valeur »
     (intitulés posés par mobile.js, data-label). */
  body .table-wrap { background: none; border: 0; box-shadow: none; overflow: visible; }
  table.m-cards { display: block; width: 100%; border-collapse: collapse; margin-top: 0; }
  table.m-cards thead, table.m-cards colgroup { display: none; }
  table.m-cards tbody, table.m-cards tfoot { display: block; }
  table.m-cards tr {
    display: block; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-xs);
    padding: 12px 14px; margin-bottom: 10px;
  }
  table.m-cards tr:hover { background: var(--surface); }
  table.m-cards tr.is-current { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-ring); }
  table.m-cards tr.is-fixed, table.m-cards tr.is-fixed td { background: var(--success-bg); }
  table.m-cards td, table.m-cards th {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 4px 0; border: 0; background: none;
    font-size: 14px; text-align: left; white-space: normal !important; min-width: 0; width: auto !important;
  }
  table.m-cards td[data-label]::before {
    content: attr(data-label); flex: 0 0 100px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
    color: var(--text-faint); padding-top: 2px;
  }
  table.m-cards tr > td:first-child, table.m-cards tr > th:first-child { display: block; padding: 0 0 8px; font-size: 15px; }
  table.m-cards tr > th:first-child { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); padding-bottom: 4px; }
  table.m-cards td.m-empty { display: none; }
  table.m-cards td.pl-fix-col { display: block; padding: 10px 0 0; text-align: left; }
  table.m-cards td.pl-fix-col .btn { width: 100%; }
  table.m-cards td:last-child > .btn:only-child { width: 100%; }
  table.m-cards tr.ct-group { background: none; border: 0; box-shadow: none; padding: 8px 0 0; margin-bottom: 4px; }
  table.m-cards tr.ct-group td { padding: 0; }
  table.m-cards td .clamp-2 { max-width: none; }
  table.m-cards tfoot tr { border-color: var(--border-strong); }
  table.m-cards td .mg-margin span { display: inline; margin-left: 6px; }
  /* Les autres tableaux défilent dans leur carte, sans élargir la page. */
  .card > table:not(.m-cards), .card .table-wrap > table:not(.m-cards) { display: block; overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }

  /* Liste Produits : le produit, où il est en ligne, le stock, le prix normal, Corriger. */
  body[data-path="/products"] .page-header > a.btn { display: none; }
  body[data-path="/products"] table.m-cards td:nth-child(3), body[data-path="/products"] table.m-cards td:nth-child(5),
  body[data-path="/products"] table.m-cards td:nth-child(7), body[data-path="/products"] table.m-cards td:nth-child(8) { display: none; }
  body[data-path="/products"] form.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  body[data-path="/products"] form.field-row > .field:first-child, body[data-path="/products"] form.field-row > .field:nth-child(2),
  body[data-path="/products"] form.field-row > .btn, body[data-path="/products"] form.field-row > a.btn { grid-column: 1 / -1; }
  body[data-path="/products"] form.field-row > .btn[type=submit] { display: none; }  /* Entrée (ou « aller ») cherche */
  body .table-footer { flex-direction: column; align-items: stretch; gap: 10px; text-align: center; }
  body .table-footer .field-row { flex-direction: row; justify-content: center; }
  body .table-footer .field-row > .btn { width: auto !important; flex: 1 !important; }
  .pl-online-head, .pl-blocked, .pl-waiting { white-space: normal; }
  th.pl-product { min-width: 0; }

  /* Fiche produit */
  body .pq-bar {
    top: var(--m-top-h); z-index: 60; margin: -14px calc(-1 * var(--m-gutter)) 12px; padding: 8px var(--m-gutter);
    background: rgba(244, 246, 245, .94); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    display: grid; grid-template-columns: 1fr 1fr; gap: 6px 8px;
  }
  body .pq-bar:not(:has(.btn)) { display: none; }  /* hors de toute file : rien à y mettre, le retour est dans la barre du haut */
  body .pq-bar .pq-where { grid-column: 1 / -1; grid-row: 1; font-size: 12.5px; }
  body .pq-bar .pq-name { display: none; }
  body .pq-bar .pq-pos { white-space: normal; }
  body .pq-bar > .btn { width: 100%; }
  body .cw-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 8px; }
  body .cw-bar .cw-where { grid-column: 1 / -1; grid-row: 1; }
  body .cw-bar > .btn { width: 100%; }
  body .cw-head { align-items: flex-start; gap: 12px; padding: 14px; }
  body .cw-head .product-thumb { width: 56px !important; height: 56px !important; }
  body .cw-head h1 { font-size: 16px; }
  body .cw-pills { gap: 4px; }
  body .product-head { gap: 12px; }
  body .product-head .product-thumb { width: 64px !important; height: 64px !important; }
  body .product-head-main { min-width: 0; flex-basis: 100%; }
  body .product-head h1 { font-size: 17px; }
  body .product-ids { font-size: 12.5px; gap: 4px 10px; }
  body .pq-pills { gap: 5px; }
  body .pq-pill { padding: 3px 9px 3px 4px; font-size: 12px; }
  body .kpi-block { flex-basis: 100%; }
  body .kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  body .kpi { min-width: 0; padding: 8px 10px; }
  body .kpi-value { font-size: 15px; }
  body .kpi-value s { display: block; margin: 0; }
  /* Carte Ventes (product_sales.py) : les quatre périodes sur une ligne, les barres en pleine largeur. */
  body #sl-card .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; width: 100%; }
  body #sl-card .kpi { padding: 6px 8px; }
  body #sl-card .kpi-label { font-size: 10px; letter-spacing: .02em; }
  body #sl-card .sl-chart { min-width: 0; flex-basis: 100%; }
  body #sl-card .sl-month { font-size: 10px; }
  body #sl-card .sl-mlong { display: none; }
  body #sl-card .sl-mshort { display: inline; }
  body #sl-card .sl-details th, body #sl-card .sl-details td { padding: 6px 6px; font-size: 12.5px; }
  body .pv-item { width: calc((100% - 20px) / 3); height: auto; aspect-ratio: 1; }
  body .pc-keys { display: none; }
  body .pc-field.fix-row { padding: 12px 0; }
  body .fix-row { gap: 6px; }
  body .fix-row .fix-meta { padding-top: 0; }
  body .fix-target select, body .fix-target .fix-target-search { min-width: 0; max-width: 100%; width: 100%; font-size: 16px; padding: 10px; }
  body .pc-mp-actions .btn { flex: 1; }
  body .pc-done { left: var(--m-gutter); right: var(--m-gutter); bottom: calc(var(--m-tabs-h) + 12px); transform: none; justify-content: center; }
  body .pf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body .ph-stats { grid-template-columns: 1fr; }
  body .ct-table th { width: auto; }
  body .ct-actions { width: auto; white-space: normal; text-align: left; }
  body .ct-source { width: auto; }

  /* Pilotage */
  body .pl-grid { grid-template-columns: 1fr; gap: 12px; }
  body .pl-week {
    display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
    margin: 0 calc(-1 * var(--m-gutter)); padding: 2px var(--m-gutter) 8px; -webkit-overflow-scrolling: touch;
  }
  body .pl-week::-webkit-scrollbar { display: none; }
  body .pl-day { flex: 0 0 96px; min-height: 90px; scroll-snap-align: start; }
  body .pl-alerts { grid-template-columns: 32px minmax(0, 1fr); }
  body .pl-alert { row-gap: 4px; }
  body .pl-alert-icon { grid-row: span 3; align-self: start; }
  body .pl-alert-when, body .pl-alert-cta { grid-column: 2; justify-self: start; text-align: left; }
  body .pl-ops a { grid-template-columns: 48px minmax(0, 1fr); }
  body .pl-op-logos { display: none; }
  body .kpi-bubbles { grid-template-columns: 1fr 1fr; gap: 10px; }
  body .kpi-bubble { padding: 12px; gap: 10px; }
  body .kpi-bubble-value { width: 46px; height: 46px; font-size: 18px; }

  /* Marketplaces */
  body .ml-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: auto; gap: 10px; }
  body .ml-card-wrap.size-xl, body .ml-card-wrap.size-l { grid-column: span 1; grid-row: span 1; }
  body .size-xl .ml-card-revenue, body .size-l .ml-card-revenue { font-size: 22px; }
  body .size-xl .ml-card-name { font-size: 14px; }
  body .size-xl .ml-card { padding: 14px; }
  body .ml-card-head .ml-logo { width: 32px !important; height: 32px !important; }
  body .ml-period-bar { flex-direction: column; align-items: stretch; }
  body .ml-period-pick { justify-content: flex-start; }
  body .ml-periods a { padding: 7px 9px; font-size: 12.5px; }
  body .ml-hide button { opacity: 1; width: 28px; height: 28px; }
  body .st-tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  body .stat { padding: 12px 14px; }
  body .stat .stat-value { font-size: 20px; }
  body .mp-head-actions { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
  body .mp-head-actions .btn { width: 100%; }
  body .mp-head-actions .js-mp-export, body .mp-head-actions .js-server-fix, body .mp-head-actions a[href$="/catalogue"] { display: none; }
  body .mp-head-actions form { display: contents; }
  body .bs-steps { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 8px calc(-1 * var(--m-gutter)) 0; padding: 0 var(--m-gutter); }
  body .bs-steps li { white-space: nowrap; }
  body .card.mp-hero { gap: 12px 20px; padding: 14px 16px; }
  body .mp-ring-block { gap: 12px; }
  body .mp-ring { width: 92px; height: 92px; }
  body .mp-ring-text .mp-hero-value { font-size: 26px; }
  body .mp-hero-value { font-size: 30px; }
  body .mp-action { grid-template-columns: 48px 1fr; gap: 10px; padding: 12px 14px; }
  body .mp-action-stock, body .mp-arrow { display: none; }
  body .mp-count { height: 32px; font-size: 14px; }
  body .mp-attrs select.mp-cat { max-width: 100%; }
  body .mp-aplus, body .mp-buybox, body .mp-feed, body .mp-issues { padding: 14px 16px; }
  body .reco-card { grid-template-columns: 1fr; }
  body .reco-block + .reco-block { border-left: 0; border-top: 1px solid var(--border); }
  body .mp-issues-name { min-width: 0; flex-basis: 100%; }

  /* À faire, Avis, Tuto, Opérations, Prix */
  body .ag-add { padding: 12px; gap: 10px; }
  body .ag-add > * { width: 100% !important; min-width: 0 !important; flex: none !important; }
  body .ag-add .ag-pour > summary { max-width: none; }
  body .ag-grid { grid-template-columns: 1fr; }
  body .ag-day { height: 44px; }
  body .fb-item { grid-template-columns: 1fr; gap: 8px; }
  body .fb-buttons { justify-content: flex-start; }
  body .fb-buttons .btn { flex: 1; }
  body .fb-delete { opacity: 1; }
  body .fb-compose { max-width: none; }
  body .tuto-layout { grid-template-columns: 1fr; }
  body .tuto-news-list li { grid-template-columns: 1fr; gap: 2px; }
  body .px-op { grid-template-columns: 1fr auto; }
  body .px-op-status, body .px-op .platform-stack, body .px-op-go { display: none; }
  body .sticky-bar { bottom: calc(var(--m-tabs-h) + 10px); padding: 10px 12px; border-radius: 14px; }
  body .op-head { flex-direction: column; }
  body .op-actions .btn { flex: 1; }
  body .pr-head { grid-template-columns: 56px 1fr; gap: 10px; padding: 12px 14px; }
  body .pr-figures { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; }
  body .pr-go { grid-column: 1 / -1; width: 100%; }
  /* Avancement (liste Produits) : le parcours et le détail par marketplace ; les courbes restent à l'ordinateur. */
  body .pg-funnel { grid-template-columns: 1fr 1fr; margin-bottom: 0; }
  body .pg-main, body .pg-people, body .pg-head .muted-small { display: none; }
  body .pg-table-wrap { max-height: none; overflow: visible; }
  body .pg-table .pg-bar { width: 72px; }

  /* Fenêtres : elles montent du bas et prennent toute la largeur. */
  body dialog.modal:not(.fix-dialog):not(.lightbox):not(.m-sheet) {
    width: 100vw !important; max-width: none !important; margin: auto 0 0; max-height: 92dvh; overflow-y: auto;
    border: 0; border-radius: 22px 22px 0 0; padding: 14px var(--m-gutter) calc(18px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -12px 40px rgba(20, 30, 28, .22);
  }
  body dialog.modal:not(.fix-dialog):not(.lightbox):not(.m-sheet)[open] { animation: m-sheet-in .24s cubic-bezier(.2, .7, .3, 1); }
  body dialog.modal:not(.fix-dialog):not(.lightbox):not(.m-sheet)::before {
    content: ""; display: block; width: 36px; height: 4px; border-radius: 4px; background: var(--border-strong); margin: 0 auto 14px;
  }
  dialog.modal::backdrop { background: rgba(20, 30, 28, .45); }
  body .modal-actions { gap: 8px; }
  body .modal-actions .btn { flex: 1; }
  body .modal-actions .link-btn { flex-basis: 100%; margin: 0 0 4px; text-align: left; }
  body .pick-grid { max-height: 48dvh; grid-template-columns: 1fr; }
  body .detail-list { max-height: 60dvh; }
  /* La fenêtre de correction, si elle s'ouvre quand même (tablette) : plein écran. */
  body dialog.fix-dialog { width: 100vw; height: 100dvh; max-height: none; margin: 0; border: 0; border-radius: 0; }
  body .fix-dialog-head { padding: 8px 10px; gap: 8px; flex-wrap: wrap; }
  body .fix-dialog-who { flex-basis: 100%; }
  /* Sélecteur de dates : un mois sous l'autre, dans la largeur de l'écran. */
  body .dp-pop { left: 10px !important; right: 10px !important; width: auto !important; max-height: 80dvh; overflow-y: auto; }
  body .dp-months { flex-direction: column; gap: 14px; }
  body .dp-grid { grid-template-columns: repeat(7, 1fr); }
  body .dp-day { height: 40px; }

  /* Retour en haut (maquette : .to-top-button). */
  body .back-to-top { right: 18px; bottom: max(22px, env(safe-area-inset-bottom, 0px)); width: 45px; height: 52px; box-shadow: var(--shadow-md); }
  html.m-typing .back-to-top { display: none; }
  body .lb-img { max-width: calc(100vw - 16px); max-height: calc(100dvh - 120px); }
  body .lb-nav { position: absolute; bottom: 18px; width: 48px; height: 48px; margin: 0; }
  body .lb-nav:first-of-type { left: 24px; }
  body .lb-nav:last-of-type { right: 24px; }
  body .lb-stage { padding-bottom: 60px; }

  /* ===== Calque Figma Make : les composants réels de ZK, au style de la maquette ===== */
  /* Titres de page (maquette : .page-title, .prices-title) ; actions côte à côte sous le titre. */
  body .page-header h1, body .pl-head h1 { font-size: 26px; font-weight: 800; letter-spacing: -.8px; line-height: 1.1; }
  body .page-subtitle { font-size: 13px; line-height: 1.45; }
  body .page-header { flex-direction: row; flex-wrap: wrap; align-items: flex-end; gap: 12px 7px; }
  body .page-header > :first-child, body .page-header > form { flex: 1 1 100%; }
  body .page-header > .btn, body .page-header > a.btn { flex: 1 1 0; width: auto; }

  /* Cartes (maquette : .dashboard-card) et titres de section. */
  body .card { border-radius: 14px; box-shadow: var(--shadow-xs); padding: 16px; }
  body .section-head h2 { font-size: 16px; letter-spacing: -.3px; }

  /* Boutons (maquette : .primary-button, .import-button, .new-price-button). */
  .btn { border-radius: 12px; font-weight: 700; }
  .btn-sm { border-radius: 10px; }
  .btn-secondary { border-color: var(--border); }

  /* Pastilles et onglets (maquette : .filter-row, .price-channel-tabs, .segment-control) : l'actif est plein. */
  .chip { min-height: 40px; display: inline-flex; align-items: center; gap: 6px; border-color: var(--border); font-size: 13px; }
  .chip.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 700; }
  body .dash-tab, body .tab, body .market-tab { border-radius: 999px; font-size: 13px; box-shadow: none; }
  body .dash-tab.active, body .tab.active, body .market-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }

  /* Champs (maquette : .search-box, .price-search) : coins de 11 px, anneau vert au focus. */
  input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], select, textarea { border-radius: 11px; }
  input[type=text]:focus, input[type=email]:focus, input[type=password]:focus, input[type=number]:focus, input[type=search]:focus, select:focus, textarea:focus {
    outline: 0; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-bg);
  }

  /* Badges d'état (maquette : .status) : coins de 7 px plutôt qu'en pilule. */
  .badge, .pl-pill { border-radius: 7px; }

  /* Tableaux en cartes (maquette : .mobile-product-card) : données sur deux colonnes, intitulé au-dessus de la valeur,
     action en pied de carte. */
  table.m-cards tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px 9px; padding: 14px; }
  table.m-cards tr.ct-group { display: block; }
  table.m-cards tr > td:first-child, table.m-cards tr > th:first-child { grid-column: 1 / -1; padding: 0; }
  table.m-cards td[data-label] { flex-direction: column; align-items: flex-start; gap: 4px; padding: 0; font-size: 13.5px; }
  table.m-cards td[data-label]::before { flex: none; padding: 0; font-size: 10px; font-weight: 800; letter-spacing: .4px; }
  table.m-cards td:not([data-label]), table.m-cards td.pl-fix-col, table.m-cards td:has(> .btn, > a.btn, > form) { grid-column: 1 / -1; }
  table.m-cards tr > td:last-child:has(.btn) { padding-top: 11px; border-top: 1px solid var(--border); }

  /* Pilotage (maquette : HomePage). */
  body .pl-alert-icon { width: 34px; height: 34px; border-radius: 50%; }
  body .pl-day { flex: 0 0 92px; min-height: 80px; border-radius: 12px; }
  /* Chiffres clés (maquette : .product-kpis) : tuiles jointes, intitulé au-dessus du grand nombre. */
  body .kpi-bubbles { gap: 1px; overflow: hidden; border: 1px solid var(--border); border-radius: 13px; background: var(--border); }
  body .kpi-bubble {
    flex-direction: column-reverse; align-items: flex-start; justify-content: flex-end; gap: 7px; min-height: 104px; padding: 13px;
    border: 0; border-radius: 0; box-shadow: none; background: var(--surface-alt);
  }
  body .kpi-bubble:last-child:nth-child(odd) { grid-column: 1 / -1; }
  body .kpi-bubbles .kpi-bubble .kpi-bubble-value {
    width: auto; height: auto; border: 0; border-radius: 0; background: none; font-size: 30px; line-height: 1; letter-spacing: -.5px;
  }
  body .kpi-bubble-label { font-size: 11px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; }

  /* Marketplaces (maquette : .market-card). */
  body .ml-card { padding: 13px; border-radius: 14px; box-shadow: var(--shadow-xs); }
  body .ml-card-revenue { font-size: 21px; }

  /* À faire (maquette : .task-check), états vides (maquette : .empty-state). */
  body .task-check { width: 22px; height: 22px; border-radius: 7px; }
  body .empty-state { border-radius: 14px; }

  /* Fenêtres (maquette : .correction-sheet) : rayon 24 px, poignée 42 × 4 px, fond flouté. */
  body dialog.modal:not(.fix-dialog):not(.lightbox):not(.m-sheet) { border-radius: 24px 24px 0 0; padding-top: 10px; padding-left: 20px; padding-right: 20px; }
  body dialog.modal:not(.fix-dialog):not(.lightbox):not(.m-sheet)::before { width: 42px; border-radius: 9px; margin-bottom: 18px; }
  dialog.modal::backdrop { background: rgba(20, 30, 28, .55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
}

/* Au doigt (pas de survol) : ce qui n'apparaissait qu'au passage de la souris est toujours visible. */
@media (hover: none) {
  .fb-delete, .ml-hide button { opacity: 1; }
  tbody tr:hover { background: inherit; }
  .ml-card:hover { transform: none; }
}

@media (max-width: 880px) and (prefers-reduced-motion: reduce) {
  dialog.m-sheet[open], body dialog.modal[open] { animation: none; }
  .m-menu-btn { transition: none; }
  .m-title { transition: none; }
}

/* Petits écrans (maquette : ≤ 380 px) : marges latérales réduites. */
@media (max-width: 380px) {
  :root { --m-gutter: 15px; }
}
