/* V5 · PANNEAUX DE DÉTAIL DES PAGES D'ORIGINE (PC) — au format de l'inspecteur du système : un panneau collé au bord droit,
   de la hauteur de la fenêtre, séparé du contenu par un filet (ni carte flottante, ni ombre), dont le contenu est rangé
   en groupes de lignes arrondis (libellé à gauche, valeur à droite). Même largeur que l'inspecteur du shell.
   Concernés : fiche d'une annonce (#annonce-modal.v4-inspecteur), détail d'un achat (.ac-insp), fiche d'un article et
   autres fenêtres .detail-sheet (groupes .dl-groupe). Présentation seulement. */

/* ---- inspecteur d'Annonces (une fenêtre .detail-modal présentée en panneau) */
/* le panneau, c'est le conteneur fixe (toute la hauteur sous la barre d'outils) ; la feuille posée dedans n'a plus ni fond ni ombre
   (sa hauteur maximale est fixée en ligne par la page : on ne s'appuie pas dessus) */
html.v5 .detail-modal.v4-inspecteur{
  top: var(--v5-barre-h); right: 0; bottom: 0; left: auto; width: var(--v5-inspecteur-l); padding: 0; align-items: flex-start; pointer-events: auto; overflow: auto;
  background: var(--v5-fond); box-shadow: inset var(--v5-trait-fort) 0 0 var(--v5-separateur);
}
html.v5 .detail-modal.v4-inspecteur > .detail-sheet{
  width: 100%; margin: 0; padding: 16px; border: 0; border-radius: 0; overflow: visible;
  background: none; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none;
}
html.v5 .detail-modal.v4-inspecteur .detail-close{ top: 10px; right: 10px; background: none; border-radius: var(--v5-r-ctrl); }
html.v5 .detail-modal.v4-inspecteur .detail-close:hover{ background: var(--v5-survol); }
/* la liste laisse la place au panneau quand il est ouvert */
html.v5.an-inspecteur-ouvert #view-vinted.active[data-panel="annonces"]{ padding-right: var(--v5-inspecteur-l); }   /* classe posée par js/annonces-v4.js */

/* ---- en-tête d'une fiche : vignette, nom, sous-ligne */
html.v5 .dl-tete{ display: flex; align-items: center; gap: 12px; padding-right: 28px; }
html.v5 .dl-tete .detail-photo{ width: 56px; height: 56px; margin: 0; border-radius: var(--v5-r-surface); background: var(--v5-rempli-2); object-fit: cover; }
html.v5 .detail-name{ font-size: var(--v5-t-15); font-weight: var(--v5-g-fort); line-height: var(--v5-i-15); letter-spacing: normal; color: var(--v5-texte); overflow-wrap: anywhere; }
html.v5 .detail-size{ font-size: var(--v5-t-12); line-height: 15px; color: var(--v5-texte-2); }

/* ---- groupe de lignes d'une fiche */
html.v5 .dl-titre{ margin: 18px 12px 6px; font-size: var(--v5-t-13); font-weight: var(--v5-g-fort); color: var(--v5-texte); }
html.v5 .dl-groupe{ margin-top: 16px; padding: 0 12px; border: 0; border-radius: var(--v5-r-groupe); background: var(--v5-fond-groupe); overflow: hidden; }
html.v5 .dl-titre + .dl-groupe{ margin-top: 0; }
html.v5 :is(.dl-ligne, #detail-contacts-list .contact-item){ min-height: 36px; padding: 6px 0; border: 0; box-shadow: inset 0 calc(-1 * var(--v5-trait-fort)) 0 var(--v5-separateur); font-size: var(--v5-t-13); }
html.v5 .dl-groupe > :is(.dl-ligne, .contact-item):last-child{ box-shadow: none; }
html.v5 .dl-ligne > span:first-child, html.v5 .dl-ligne .lbl{ margin: 0; font-size: var(--v5-t-13); font-weight: var(--v5-g-normal); color: var(--v5-texte); }
html.v5 .dl-ligne > b{ font-weight: var(--v5-g-normal); color: var(--v5-texte-2); text-align: right; font-variant-numeric: tabular-nums; }
html.v5 .detail-actions{ display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 16px; }
html.v5 .detail-modal.v4-inspecteur .detail-actions :is(button.ghost, button.primary, a.primary, button.danger-ghost){ height: var(--v5-ctrl-h); padding: 0 12px; border-radius: var(--v5-r-ctrl); }

/* ---- inspecteur d'Achats (colonne de droite de la page) */
/* le panneau est fixé au bord droit de la fenêtre, sous la barre d'outils ; toute la page (bandeaux compris) lui laisse sa place */
html.v5 .ac-split{ gap: 0; align-items: stretch; }
html.v5 .ac-split.avec-insp{ grid-template-columns: minmax(0, 1fr); }
html.v5 #view-vinted.active[data-panel="achats"]:has(.ac-split.avec-insp){ padding-right: var(--v5-inspecteur-l); }   /* 31/10 : Achats seulement — le panneau reste dans la page quand on la quitte, et Nouvelle fiche, Messages, Annonces… gardaient 360 px de vide */
html.v5 .vt-achats-alerte{ white-space: normal; }
html.v5 .ac-insp{
  position: fixed; top: var(--v5-barre-h); right: 0; bottom: 0; z-index: 5; box-sizing: border-box; width: var(--v5-inspecteur-l); max-height: none; margin: 0; padding: 14px 16px 20px; overflow: auto;
  border: 0; border-radius: 0; background: var(--v5-fond); box-shadow: inset var(--v5-trait-fort) 0 0 var(--v5-separateur);
}
html.v5 .fi-tete{ height: var(--v5-ctrl-h); margin: 0 0 8px; font-size: var(--v5-t-11); font-weight: var(--v5-g-gras); color: var(--v5-texte-3); }
html.v5 .fi-fermer{ width: var(--v5-ctrl-h); height: var(--v5-ctrl-h); margin: 0 -4px 0 0; padding: 0; border: 0; border-radius: var(--v5-r-ctrl); background: none; color: var(--v5-texte-2); cursor: default; }
html.v5 .fi-fermer:hover{ background: var(--v5-survol); color: var(--v5-texte); }
html.v5 .fi-titre{ margin: 6px 0 4px; font-size: var(--v5-t-15); font-weight: var(--v5-g-fort); line-height: var(--v5-i-15); letter-spacing: normal; color: var(--v5-texte); }
html.v5 .ac-insp .fi-infos{ margin: 14px 0 0; padding: 0 12px; border: 0; border-radius: var(--v5-r-groupe); background: var(--v5-fond-groupe); }
html.v5 .ac-insp .fi-infos > div{ min-height: 32px; align-items: center; padding: 6px 0; font-size: var(--v5-t-13); box-shadow: inset 0 calc(-1 * var(--v5-trait-fort)) 0 var(--v5-separateur); }
html.v5 .ac-insp .fi-infos > div:last-child{ box-shadow: none; }
html.v5 .fi-infos dt{ color: var(--v5-texte); }
html.v5 .fi-infos dd{ color: var(--v5-texte-2); }
html.v5 .ac-insp .fi-section{ margin: 16px 0 0; padding: 0; border: 0; }
html.v5 .ac-insp .fi-section h4{ margin: 0 12px 6px; font-size: var(--v5-t-13); font-weight: var(--v5-g-fort); color: var(--v5-texte); }
html.v5 .fi-actions{ gap: 8px; margin: 16px 0 0; justify-content: flex-end; }
html.v5 .ac-insp .fi-actions button{ height: var(--v5-ctrl-h); padding: 0 12px; font-size: var(--v5-t-13); }

/* ================================================================== 11/10 — équilibre liste / détail d'Annonces et d'Achats
   La règle de gabarit commune (css/v5/shell.css, « padding: 20px » sur #view-vinted) passait devant la place laissée au panneau :
   la liste glissait SOUS l'inspecteur et ses colonnes de droite (compte, favoris, vues, prix, état, « … ») disparaissaient.
   Même place que plus haut, avec un sélecteur qui passe devant le gabarit, plus la marge de 20 px entre la liste et le panneau. */
html.v5.an-inspecteur-ouvert #view-vinted#view-vinted.active[data-panel="annonces"],
html.v5 #view-vinted#view-vinted.active[data-panel="achats"]:has(.ac-split.avec-insp){ padding-right: calc(var(--v5-inspecteur-l) + 20px); }

/* colonnes d'Annonces selon la place réellement disponible pour la LISTE (et non la largeur de la fenêtre) : tant qu'il y a
   600 px, toutes les colonnes restent, inspecteur ouvert ou non ; en dessous, compte et état cèdent (ils sont dans le panneau).
   Avant : sous 1 100 px de fenêtre, deux colonnes étaient masquées mais la grille en gardait sept — « … » flottait au milieu. */
html.v5 #annonces-list{ container-type: inline-size; }
/* 25/10 (audit, P3) : colonne Compte élargie (130 → 180 px), le nom du compte ne se coupe plus quand il y a la place */
html.v5 #annonces-list .an-ligne{ grid-template-columns: minmax(150px, 1fr) minmax(0, 180px) 52px 52px 80px 78px 28px; column-gap: 10px; }
html.v5 #annonces-list :is(.an-compte, .an-etat){ display: flex; }
html.v5 #annonces-list .an-entete > span{ display: block; }
@container (max-width: 720px){
  html.v5 #annonces-list .an-ligne{ grid-template-columns: minmax(0, 1fr) 52px 52px 80px 28px; }
  html.v5 #annonces-list :is(.an-compte, .an-etat),
  html.v5 #annonces-list .an-entete > span:is(:nth-child(2), :nth-child(6)){ display: none; }
}
/* liste très étroite (inspecteur ouvert dans une petite fenêtre) : le titre identifie l'annonce, il passe avant les métriques ; Favoris et Vues
   cèdent (ils sont aussi dans l'inspecteur), le prix et le menu « … » restent */
@container (max-width: 440px){
  html.v5 #annonces-list .an-ligne{ grid-template-columns: minmax(96px, 1fr) 64px 28px; column-gap: 6px; }
  html.v5 #annonces-list .an-titre span{ display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; white-space: normal; overflow-wrap: anywhere; line-height: 16px; }   /* deux lignes plutôt qu'un titre coupé après 8 lettres */
  html.v5 #annonces-list .an-ligne > :is(:nth-child(3), :nth-child(4)){ display: none; }
}

/* 11/10 — fenêtre étroite (≤ 1100 px) : l'inspecteur du shell passe PAR-DESSUS le contenu ; les pages bord à bord (Fiches, Liens,
   Production) lui laissent sa place, sinon la dernière colonne de la grille ou de la liste glisse dessous et la sélection devient invisible */
@media (max-width: 1100px){
  html.v5 .v5-corps:has(> .v5-inspecteur[data-ouvert]) #view-vinted#view-vinted.active:is([data-panel="fiches"], [data-panel="liens"], [data-panel="production"], [data-panel="annonces"]){ padding-right: var(--v5-inspecteur-l); }
  /* 31/10 : Annonces ajoutée (ses dernières colonnes passaient sous le panneau) ; le grand titre et la rangée d'onglets
     s'arrêtent aussi au bord du panneau (« Échecs » était coupé sur Fiches) */
  html.v5 .v5-corps:has(> .v5-inspecteur[data-ouvert]) .v5-page-titre:not(#_){ margin-right: var(--v5-inspecteur-l); }
  html.v5 .v5-corps:has(> .v5-inspecteur[data-ouvert]) .v5-page-vues:not(#_){ margin-right: calc(var(--v5-inspecteur-l) + var(--v5-vues-d, 24px)); }
}

/* 12/10 — liste d'Achats étroite (inspecteur ouvert dans une petite fenêtre) : même règle que pour Annonces — le titre de l'achat l'identifie, il passe avant le
   lien vers un article (« Peut-être : … »), qui reste lisible dans l'inspecteur (« Article relié ») et par la section « À confirmer » */
html.v5 .ac-liste{ container-type: inline-size; }
@container (max-width: 560px){
  html.v5 .ac-ligne{ grid-template-columns: 36px minmax(0, 1fr) 56px 28px; column-gap: 8px; }
  html.v5 .ac-ligne .ac-lien{ display: none; }
  html.v5 .ac-ligne .ac-txt b{ white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
}

/* 12/10 — chiffres de tête d'Achats : même présentation que les chiffres de Stats et d'Aujourd'hui (.j-kpi, stats.css) — tuiles de même hauteur dans un groupe arrondi,
   qui passent à 2 × 2 quand la place manque, au lieu d'un flux de texte où « 170 € » se coupait entre deux lignes */
html.v5 #achats-body .vt-stats-bar{ display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 1px; margin: 0 0 16px; padding: 0; border: 0; border-radius: var(--v5-r-groupe); background: var(--v5-separateur); overflow: hidden; }
html.v5 #achats-body .vt-stats-bar .vt-stat{ display: flex; flex-direction: column; gap: 2px; min-width: 0; margin: 0; padding: 10px 12px; border: 0; border-radius: 0; background: var(--v5-carte); }
html.v5 #achats-body .vt-stats-bar .num{ font-size: var(--v5-t-17); line-height: 22px; white-space: nowrap; }
html.v5 #achats-body .vt-stats-bar .lbl2{ font-size: var(--v5-t-12); line-height: 15px; }

/* ================================================================== 12/10 — squelette commun des inspecteurs
   Quel que soit l'objet (annonce, achat, fiche, ligne de Liens ou de Production), l'œil trouve toujours : 1) l'élément (vignette + nom),
   2) son état en pastille, 3) les informations utiles en groupe, 4) les actions en bas — l'action principale à droite, en violet.
   Une destination hors de BDRD (« Ouvrir sur Vinted ») n'est pas une action de traitement : c'est un lien, à gauche des actions. */
html.v5 .detail-size .an-etat{ vertical-align: 1px; }   /* la pastille d'état suit le prix sur la sous-ligne */
html.v5 .detail-modal.v4-inspecteur .detail-actions #annonce-modifier{ background: var(--v5-violet); color: var(--v5-sur-violet); }   /* modifier = l'action principale d'une annonce */
html.v5 .detail-modal.v4-inspecteur .detail-actions #annonce-modifier:hover:not(:disabled){ background: var(--v5-violet-survol); }
html.v5 .detail-modal.v4-inspecteur .detail-actions #annonce-modifier:active:not(:disabled){ background: var(--v5-violet-presse); }
html.v5 .detail-modal.v4-inspecteur .detail-actions a.primary{
  order: -1; margin-right: auto; display: inline-flex; align-items: center; gap: 4px; height: var(--v5-ctrl-h); padding: 0 6px 0 0; border: 0; border-radius: var(--v5-r-ctrl);
  background: none; box-shadow: none; color: var(--v5-violet-texte); font-size: var(--v5-t-13); font-weight: var(--v5-g-moyen); text-decoration: none;
}
html.v5 .detail-modal.v4-inspecteur .detail-actions a.primary:hover:not(:disabled){ background: none; text-decoration: underline; }
html.v5 .detail-modal.v4-inspecteur .detail-actions a.primary::after{
  content: ""; width: 12px; height: 12px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 16 17.5 6.5'/%3E%3Cpath d='M10 6.5h7.5V14'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 16 17.5 6.5'/%3E%3Cpath d='M10 6.5h7.5V14'/%3E%3C/svg%3E") center / contain no-repeat;
}
/* 12/10 — actions en bas du panneau, comme le pied de l'inspecteur du shell (Fiches, Liens, Production) : même place, même filet */
html.v5 #annonce-modal.v4-inspecteur > .detail-sheet{ display: flex; flex-direction: column; box-sizing: border-box; min-height: 100%; max-height: none; }
html.v5 #annonce-modal-body{ display: flex; flex-direction: column; flex: 1 0 auto; }
html.v5 #annonce-modal-body > .detail-actions{ position: sticky; bottom: -16px; margin: auto -16px -16px; padding: 10px 12px; background: var(--v5-fond); box-shadow: inset 0 var(--v5-trait-fort) 0 var(--v5-separateur); }
html.v5 #annonce-modal-body > .detail-actions #annonce-modifier{ order: 2; }   /* l'action principale à droite (macOS) */

/* 18/10 (audit) : un nom de compte trop long était coupé net (« atelier.seconde.mai ») : en « flex », les « … » ne s'appliquent pas
   au texte ; la cellule redevient un bloc, la pastille de couleur se place en ligne devant le nom */
@container (min-width: 721px){
  html.v5:not(.an-inspecteur-ouvert) #annonces-list .an-compte:not(#_){ display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  html.v5 #annonces-list .an-compte > i{ display: inline-block; margin-right: 6px; vertical-align: 1px; }
}
/* 25/10 : la colonne État (alignée à gauche) suivait le Prix (aligné à droite) à 10 px : « 22,00 € » touchait « ● En ligne » */
html.v5 #annonces-list .an-ligne > :nth-child(6){ padding-left: 14px; }

/* ================================================================== 30/10 : panneaux de détail façon Notion (gamme choisie le 25/10) —
   fiche, achat, contact : plus de groupes gris arrondis ; les lignes sont posées sur le panneau, séparées d'un trait fin, et le titre
   de groupe est souligné (comme Réglages). Les boutons et les valeurs ne changent pas. */
html.v5 :is(.dl-groupe, .ac-insp .fi-infos):not(#_){ padding: 0 2px; border-radius: 0; background: none; }
html.v5 .dl-titre:not(#_), html.v5 .ac-insp .fi-section h4:not(#_){ margin-left: 2px; margin-right: 2px; padding-bottom: 6px; box-shadow: inset 0 calc(-1 * var(--v5-trait-fort)) 0 var(--v5-separateur); }

/* 31/10 : chiffres d'Achats — quatre colonnes, ou deux fois deux quand la place manque (panneau ouvert) ; auto-fit faisait 3 + 1 */
html.v5 #achats-body{ container-type: inline-size; }
html.v5 #achats-body .vt-stats-bar:has(> :nth-child(4):last-child){ grid-template-columns: repeat(4, minmax(0, 1fr)); }
@container (max-width: 480px){ html.v5 #achats-body .vt-stats-bar:has(> :nth-child(4):last-child){ grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* 01/11 : panneaux propres à Annonces (#annonce-modal), Colis (#detail-modal) et Achats (.ac-insp), fixés au bord droit à toutes les largeurs.
   Colis ne laissait aucune place au sien (329 px de liste dessous à 1400 px : l'ancienne réservation de 404 px est dans @layer ancien et perd
   contre suivi.css) ; sur les trois pages, le grand titre et les onglets passaient sous le panneau (« Toutes 24 », « Achats 12 » cachés à 820 px). */
html.v5.v4-insp-detail-modal #view-list#view-list.active:not(#_){ padding-right: calc(var(--v5-inspecteur-l) + 20px); }
html.v5.an-inspecteur-ouvert #v5-contenu:has(#view-vinted.active[data-panel="annonces"]) > .v5-page-titre:not(#_),
html.v5.v4-insp-detail-modal #v5-contenu:has(#view-list.active) > .v5-page-titre:not(#_),
html.v5 #v5-contenu:has(#view-vinted.active[data-panel="achats"] .ac-split.avec-insp) > .v5-page-titre:not(#_){ margin-right: var(--v5-inspecteur-l); }
html.v5.an-inspecteur-ouvert #v5-contenu:has(#view-vinted.active[data-panel="annonces"]) > .v5-page-vues:not(#_),
html.v5.v4-insp-detail-modal #v5-contenu:has(#view-list.active) > .v5-page-vues:not(#_),
html.v5 #v5-contenu:has(#view-vinted.active[data-panel="achats"] .ac-split.avec-insp) > .v5-page-vues:not(#_){ margin-right: calc(var(--v5-inspecteur-l) + var(--v5-vues-d, 24px)); }

/* 01/11 : listes d'Annonces et d'Achats très étroites (≤ 300 px : panneau ouvert dans une fenêtre de 820 px, 168 px de liste) —
   Annonces débordait de 38 px sous le panneau (96 + 64 + 28 px de colonnes), le titre d'un achat tombait à 12 px. La vignette d'achat
   cède (elle est dans le panneau), le titre prend ce qui reste, le prix et le « … » gardent leur place. */
@container (max-width: 300px){
  html.v5 #annonces-list .an-ligne:not(#_){ grid-template-columns: minmax(0, 1fr) 56px 28px; column-gap: 4px; }
  html.v5 .ac-ligne:not(#_){ grid-template-columns: minmax(0, 1fr) 52px 28px; column-gap: 4px; }
  html.v5 .ac-ligne > :first-child:not(.ac-txt){ display: none; }
}

/* 01/11 : pied du panneau d'annonce — les boutons dépassaient de 4 px à gauche et à droite du contenu du panneau */
html.v5 #annonce-modal .detail-actions:not(#_){ padding-left: 16px; padding-right: 16px; }   /* sa marge de -16 px est compensée exactement */
