/* =====================================================================
   Portail article SPIDER (MAJ V3) — d'après la maquette v0.3 de la DTDIA
   (Rizvan HAIDARALY). Thème clair / sombre (prefers-color-scheme ou
   data-theme sur <html>), responsive téléphone / tablette. Aucun prix.
   ===================================================================== */
:root {
  --noir: #141516; --encre: #22252A; --gris: #5B6068; --gris2: #6F747B; --trait: #E2E1DC; --fond: #F1F0EC; --carte: #fff;
  --champ: #EFEEEA; --survol: #E8E7E2; --doux: #FAFAF8; --ligne: #EEEDE8;
  --rouge: #D62A34; --jaune: #FFD60A; --orange: #B85F00; --orange-txt: #fff; --vert: #1E8E5A; --bleu: #2B5F8A;
  --cmd-fond: #E3ECF4; --cmd-txt: #1F4868; --rup-fond: #E4E3DE; --rup-txt: #4A4E55;
  --promo: #0F1D38; --promo-em: #D8C08A;
  --inverse-fond: #141516; --inverse-txt: #fff;
  --r: 14px; --ombre: 0 1px 2px rgba(20,21,22,.06), 0 6px 18px rgba(20,21,22,.05);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --noir: #F2F1ED; --encre: #E6E5E1; --gris: #AEB2B8; --gris2: #9A9EA5; --trait: #34373C; --fond: #121315; --carte: #1C1E21;
    --champ: #26292D; --survol: #2B2E33; --doux: #222428; --ligne: #2C2F33;
    --rouge: #F0525B; --jaune: #F5CF1C; --orange: #E08A2C; --orange-txt: #141516; --vert: #3DBE84; --bleu: #7FB2DE;
    --cmd-fond: #1E3347; --cmd-txt: #BFD8EE; --rup-fond: #33363B; --rup-txt: #C9CCD0;
    --promo: #16284A; --promo-em: #E2CD9C;
    --inverse-fond: #F2F1ED; --inverse-txt: #141516;
    --ombre: 0 1px 2px rgba(0,0,0,.4), 0 6px 18px rgba(0,0,0,.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --noir: #F2F1ED; --encre: #E6E5E1; --gris: #AEB2B8; --gris2: #9A9EA5; --trait: #34373C; --fond: #121315; --carte: #1C1E21;
  --champ: #26292D; --survol: #2B2E33; --doux: #222428; --ligne: #2C2F33;
  --rouge: #F0525B; --jaune: #F5CF1C; --orange: #E08A2C; --orange-txt: #141516; --vert: #3DBE84; --bleu: #7FB2DE;
  --cmd-fond: #1E3347; --cmd-txt: #BFD8EE; --rup-fond: #33363B; --rup-txt: #C9CCD0;
  --promo: #16284A; --promo-em: #E2CD9C;
  --inverse-fond: #F2F1ED; --inverse-txt: #141516;
  --ombre: 0 1px 2px rgba(0,0,0,.4), 0 6px 18px rgba(0,0,0,.35);
  color-scheme: dark;
}
* { box-sizing: border-box }
html { scroll-behavior: smooth }
body { margin: 0; background: var(--fond); color: var(--encre); font: 15px/1.45 "Segoe UI", system-ui, -apple-system, Arial, sans-serif }
button, input, select, textarea { font: inherit; color: inherit }
button { cursor: pointer }
a { color: inherit }
h1, h2, h3 { margin: 0; line-height: 1.2; text-wrap: balance }
.num { font-variant-numeric: tabular-nums }
:focus-visible { outline: 3px solid var(--bleu); outline-offset: 2px }
.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 }
.skip { position: absolute; left: -999px; top: 6px; background: var(--inverse-fond); color: var(--inverse-txt); padding: 8px 12px; border-radius: 8px; z-index: 100 }
.skip:focus { left: 8px }

/* ---------- Barre du haut ---------- */
.top { position: sticky; top: 0; z-index: 30; background: var(--carte); border-bottom: 1px solid var(--trait) }
.top-in { max-width: 1380px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 18px }
.logo { display: flex; align-items: center; flex: none; border-radius: 8px }
.logo img { height: 38px; display: block; background: #fff; border-radius: 6px }
.rech { flex: 1; position: relative; min-width: 0 }
.rech-sp { flex: 1 }
.rech input { width: 100%; border: 0; background: var(--champ); border-radius: 10px; padding: 12px 40px 12px 42px; font-size: 15.5px }
.rech input::placeholder { color: var(--gris2) }
.rech input::-webkit-search-cancel-button { display: none }
.rech svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; stroke: var(--encre) }
.rech .x { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: none; font-size: 20px; line-height: 1; color: var(--gris); padding: 4px 8px; display: none }
.rech.plein .x { display: block }
.qui { flex: none; display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--gris) }
.qui b { color: var(--encre); font-weight: 600 }
.qui a { text-decoration: none; font-weight: 600; border: 1px solid var(--trait); border-radius: 8px; padding: 6px 10px; color: var(--encre); white-space: nowrap }
.qui a:hover { background: var(--champ) }
.nav { max-width: 1380px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap }
.nav a { padding: 9px 12px; text-decoration: none; font-weight: 600; font-size: 14px; color: var(--gris); border-bottom: 3px solid transparent; white-space: nowrap }
.nav a:hover { color: var(--noir) }
.nav a.on { color: var(--noir); border-bottom-color: var(--rouge) }
.nav .tag, .panneau .tag { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; background: var(--champ); color: var(--gris); border-radius: 4px; padding: 1px 5px; margin-left: 5px; vertical-align: 1px }
.sync { margin-left: auto; font-size: 13px; color: var(--gris); display: flex; align-items: center; gap: 7px; padding: 6px 0; white-space: nowrap }
.sync i { width: 8px; height: 8px; border-radius: 50%; background: var(--vert); display: inline-block }
.sync i.vieux { background: var(--orange) }
.sync b { color: var(--encre) }

/* ---------- Mise en page ---------- */
.page { max-width: 1380px; margin: 0 auto; padding: 18px 20px 60px; min-height: 60vh }
.cat { display: grid; grid-template-columns: 238px minmax(0, 1fr); gap: 22px; align-items: start }
.rail { position: sticky; top: 118px; max-height: calc(100vh - 130px); overflow: auto; padding-right: 4px }
.rail h3 { font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--gris); margin: 16px 0 7px }
.rail h3:first-child { margin-top: 2px }
.uni { width: 100%; text-align: left; border: 0; background: none; padding: 6px 8px; border-radius: 8px; font-weight: 600; display: flex; justify-content: space-between; gap: 8px }
.uni:hover { background: var(--survol) }
.uni.on { background: var(--inverse-fond); color: var(--inverse-txt) }
.uni span { font-weight: 500; color: var(--gris2); font-size: 13px }
.uni.on span { color: inherit; opacity: .75 }
.uni.fam { font-weight: 500; padding-left: 20px; font-size: 14px }
.uni.fam.on { background: var(--carte); color: var(--noir); box-shadow: inset 3px 0 0 var(--rouge) }
.uni.fam.on span { color: var(--gris) }
.coche { display: flex; align-items: center; gap: 8px; padding: 4px 8px; font-size: 14px; cursor: pointer; border-radius: 8px }
.coche:hover { background: var(--survol) }
.coche input { accent-color: var(--rouge); width: 16px; height: 16px; margin: 0; flex: none }
.coche span { margin-left: auto; color: var(--gris2); font-size: 13px }
.raz { margin-top: 14px; border: 1px solid var(--trait); background: var(--carte); border-radius: 8px; padding: 7px 10px; width: 100%; font-weight: 600; font-size: 13.5px }
.btn.btn-filtres { display: none }
.plusliste { border: 0; background: none; padding: 4px 8px; font-size: 13px; font-weight: 700; color: var(--bleu); text-decoration: underline }

.promo { display: flex; align-items: center; justify-content: space-between; gap: 20px; width: 100%; border: 0; padding: 18px 24px; background: var(--promo); color: #fff; border-radius: var(--r); margin-bottom: 16px; box-shadow: var(--ombre); text-align: left }
.promo-t { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0 }
.promo .et { background: #D62A34; color: #fff; font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; border-radius: 6px; padding: 3px 8px; margin-bottom: 4px }
.promo b { font-size: 26px; line-height: 1.15; font-family: Georgia, "Times New Roman", serif; font-weight: 600; letter-spacing: .01em }
.promo em { font-style: normal; color: var(--promo-em); font-size: 14.5px }
.promo u { margin-top: 6px; font-weight: 700; font-size: 14px; text-underline-offset: 3px }
.promo-i { display: flex; gap: 10px; flex: none }
.promo-i img, .promo-i .sansphoto { width: 96px; height: 96px; object-fit: contain; background: #fff; border-radius: 10px; padding: 6px }
.promo-i .sansphoto em { display: none }

.outils { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px }
.outils .nb { font-weight: 700; font-size: 16px }
.outils .sp { flex: 1 }
.outils select { border: 1px solid var(--trait); background: var(--carte); border-radius: 8px; padding: 7px 9px }
.seg { display: inline-flex; border: 1px solid var(--trait); border-radius: 8px; overflow: hidden; background: var(--carte) }
.seg button { border: 0; background: none; padding: 7px 11px; font-weight: 600; font-size: 13.5px; color: var(--gris) }
.seg button.on { background: var(--inverse-fond); color: var(--inverse-txt) }
.puces { display: flex; gap: 6px; flex-wrap: wrap; margin: -4px 0 12px }
.puce { background: var(--carte); border: 1px solid var(--trait); border-radius: 20px; padding: 3px 6px 3px 11px; font-size: 13px; display: inline-flex; align-items: center; gap: 4px }
.puce button { border: 0; background: none; font-size: 16px; line-height: 1; padding: 0 4px; color: var(--gris) }

/* ---------- Cartes ---------- */
.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 16px }
.carte { background: var(--carte); border: 1px solid var(--trait); border-radius: var(--r); padding: 12px; display: flex; flex-direction: column; position: relative; min-height: 340px; transition: box-shadow .15s, transform .15s }
.carte:hover { box-shadow: var(--ombre); transform: translateY(-1px) }
.gam { position: absolute; left: 10px; top: 10px; background: #D62A34; color: #fff; font-weight: 800; font-size: 11.5px; border-radius: 5px; padding: 2px 7px; z-index: 1; letter-spacing: .01em; max-width: calc(100% - 20px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.vis { height: 176px; display: flex; align-items: center; justify-content: center; border: 0; background: #fff; padding: 0; width: 100%; border-radius: 10px }
.vis img { height: 166px; width: 100%; object-fit: contain }
.sansphoto { width: 100%; height: 150px; border: 1.5px dashed var(--trait); border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--gris2); font-size: 12.5px; background: var(--doux) }
.sansphoto svg { width: 34px; height: 34px; stroke: var(--gris2) }
.sansphoto em { font-style: normal; text-align: center; padding: 0 8px }
.mini .sansphoto em, .assoc .sansphoto em { display: none }
.assoc .sansphoto { width: 48px; height: 48px; flex: none; border-radius: 7px; border-width: 1px }
.assoc .sansphoto svg { width: 20px; height: 20px }
.code { font-size: 12px; color: var(--gris); margin-top: 2px; font-variant-numeric: tabular-nums }
.code b { color: var(--encre) }
.ref { display: flex; align-items: baseline; gap: 9px; margin-top: 6px; min-width: 0 }
.ref b { font-size: 16.5px; font-weight: 800; letter-spacing: -.01em; overflow-wrap: anywhere }
.copier { border: 0; background: none; padding: 0; font-size: 11.5px; font-weight: 700; color: var(--gris); flex: none }
.copier:hover { color: var(--rouge); text-decoration: underline }
.des { border: 0; background: none; padding: 0; text-align: left; color: var(--encre); opacity: .88; font-size: 14px; line-height: 1.38; margin: 8px 0 10px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden }
.des:hover { color: var(--noir); opacity: 1; text-decoration: underline }
.bas { display: flex; align-items: center; gap: 8px; margin-top: auto; justify-content: flex-start; flex-wrap: wrap }
.stk { font-weight: 800; font-size: 13px; border-radius: 7px; padding: 5px 9px; white-space: nowrap; display: inline-block }
.stk.ok { background: #FFD60A; color: #141516 }
.stk.faible { background: var(--orange); color: var(--orange-txt) }
.stk.rup { background: var(--rup-fond); color: var(--rup-txt) }
.stk.cmd { background: var(--cmd-fond); color: var(--cmd-txt) }
.arr { font-size: 12.5px; font-weight: 600; color: var(--cmd-txt) }
.vide { background: var(--carte); border: 1px dashed var(--trait); border-radius: var(--r); padding: 40px 20px; text-align: center; color: var(--gris) }
.vide b { display: block; color: var(--encre); font-size: 17px; margin-bottom: 6px }
.suite { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; margin: 22px 0 6px; color: var(--gris); font-size: 14px }
.descr { color: var(--encre); opacity: .9; margin: 12px 0 4px; max-width: 640px; white-space: pre-line }

/* ---------- Liste ---------- */
.tbl { width: 100%; border-collapse: collapse; background: var(--carte); border: 1px solid var(--trait); border-radius: var(--r); overflow: hidden }
.tbl th { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--gris); text-align: left; padding: 9px 12px; background: var(--doux); border-bottom: 1px solid var(--trait); white-space: nowrap }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--ligne); vertical-align: middle }
.tbl tr:last-child td { border-bottom: 0 }
.tbl td.d, .tbl th.d { text-align: right }
.tbl .mini { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; background: #fff; border-radius: 6px }
.tbl .mini img { max-width: 44px; max-height: 44px }
.tbl .mini .sansphoto { width: 44px; height: 44px; border-radius: 7px; border-width: 1px }
.tbl .mini .sansphoto svg { width: 20px; height: 20px }
.lien { border: 0; background: none; padding: 0; text-align: left; font-weight: 600 }
.lien:hover { text-decoration: underline }
.defile { overflow-x: auto }

/* ---------- Fiche article ---------- */
.voile { position: fixed; inset: 0; background: rgba(10,11,12,.6); z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 28px 16px; overflow: auto }
.fiche { background: var(--carte); border-radius: 18px; max-width: 1040px; width: 100%; position: relative; box-shadow: 0 20px 60px rgba(0,0,0,.3) }
.fermer { position: absolute; right: 12px; top: 10px; border: 0; background: var(--champ); border-radius: 50%; width: 36px; height: 36px; font-size: 20px; line-height: 1; z-index: 2 }
.fiche-h { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 26px; padding: 26px 26px 18px }
.fiche-img { background: #fff; border: 1px solid var(--trait); border-radius: 14px; min-height: 320px; display: flex; align-items: center; justify-content: center; position: relative; padding: 18px }
.fiche-img img { max-height: 340px; max-width: 100%; object-fit: contain }
.fiche-img .sansphoto { height: 260px; background: #FAFAF8; border-color: #CFCEC8 }
.fil { font-size: 12.5px; color: var(--gris); margin-bottom: 8px }
.fiche h2 { font-size: 22px; margin: 8px 0 4px; padding-right: 30px }
.fiche .ref b { font-size: 19px }
.fiche .gam { position: static; display: inline-block }
.stock-t { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 14px }
.stock-t th { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--gris); text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--trait) }
.stock-t td { padding: 7px 8px; border-bottom: 1px solid var(--ligne) }
.stock-t td.d, .stock-t th.d { text-align: right }
.stock-t tr.ttl td { font-weight: 800 }
.note-s { font-size: 12.5px; color: var(--gris); margin-top: 8px; display: flex; gap: 6px; align-items: flex-start }
.note-s i { width: 8px; height: 8px; border-radius: 50%; background: var(--vert); flex: none; margin-top: 5px }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 16px }
.btn { border: 1.5px solid var(--noir); background: var(--carte); color: var(--noir); border-radius: 9px; padding: 9px 14px; font-weight: 700; display: inline-flex; gap: 7px; align-items: center; text-decoration: none }
.btn:hover { background: var(--champ) }
.btn.pr { background: var(--inverse-fond); color: var(--inverse-txt) }
.btn.pt { padding: 6px 10px; font-size: 13.5px }
.onglets { display: flex; gap: 2px; border-bottom: 1px solid var(--trait); padding: 0 26px }
.onglets button { border: 0; background: none; padding: 11px 13px; font-weight: 700; color: var(--gris); border-bottom: 3px solid transparent }
.onglets button.on { color: var(--noir); border-bottom-color: var(--rouge) }
.corps { padding: 18px 26px 26px }
.carac { width: 100%; border-collapse: collapse; max-width: 640px }
.carac td { padding: 7px 10px; border-bottom: 1px solid var(--ligne) }
.carac td:first-child { color: var(--gris); width: 46% }
.carac td:last-child { font-weight: 600 }
.doc { display: flex; gap: 14px; align-items: center; border: 1px solid var(--trait); border-radius: 12px; padding: 12px 14px; max-width: 640px; margin-bottom: 10px }
.doc .pdf { flex: none; width: 42px; height: 52px; border-radius: 5px; background: #D62A34; color: #fff; font-weight: 800; font-size: 12px; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 6px }
.doc.abs .pdf { background: var(--rup-fond); color: var(--rup-txt) }
.doc div { flex: 1; min-width: 0; overflow-wrap: anywhere }
.doc small { color: var(--gris); display: block }
.assoc { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px }
.assoc button { border: 1px solid var(--trait); background: var(--carte); border-radius: 12px; padding: 10px; display: flex; gap: 10px; align-items: center; text-align: left }
.assoc button:hover { box-shadow: var(--ombre) }
.assoc img { width: 48px; height: 48px; flex: none; object-fit: contain; background: #fff; border-radius: 6px }
.assoc b { display: block; font-size: 13.5px }
.assoc small { color: var(--gris); display: block; line-height: 1.3 }
.chargement { padding: 60px 20px; text-align: center; color: var(--gris) }

/* ---------- Pages de contenu ---------- */
.titre { margin: 6px 0 16px }
.titre h1 { font-size: 25px }
.titre p { margin: 6px 0 0; color: var(--gris); max-width: 860px }
.panneau { background: var(--carte); border: 1px solid var(--trait); border-radius: var(--r); padding: 18px 20px; margin-bottom: 16px }
.panneau h2 { font-size: 17.5px; margin-bottom: 10px }
.panneau p { margin: 6px 0; max-width: 900px }
.panneau ul { margin: 6px 0; padding-left: 20px; max-width: 900px }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px }
.kpi { background: var(--carte); border: 1px solid var(--trait); border-radius: var(--r); padding: 13px 15px }
.kpi small { display: block; color: var(--gris); font-size: 12.5px; font-weight: 600 }
.kpi b { font-size: 26px; font-weight: 800; letter-spacing: -.02em }
.kpi em { font-style: normal; color: var(--gris); font-size: 13px; margin-left: 6px }
.jauge { height: 6px; border-radius: 4px; background: var(--ligne); margin-top: 7px; overflow: hidden }
.jauge i { display: block; height: 100%; background: var(--noir); border-radius: 4px }
.et { display: inline-block; border-radius: 20px; padding: 1px 9px; font-size: 12px; font-weight: 700; white-space: nowrap }
.et.v { background: #DDF1E6; color: #17603F }
.et.o { background: #FCE9CF; color: #8A4B00 }
.et.g { background: var(--rup-fond); color: var(--rup-txt) }
.et.b { background: var(--cmd-fond); color: var(--cmd-txt) }
.et.r { background: #FBDDDF; color: #A1161F }
.src td:first-child { font-weight: 700 }
.listes { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px }
.listes a { text-decoration: none; border: 1px solid var(--trait); border-radius: 20px; padding: 5px 12px; font-size: 13.5px; font-weight: 600; background: var(--carte) }
.listes a.on { background: var(--inverse-fond); color: var(--inverse-txt); border-color: var(--inverse-fond) }
.listes a span { opacity: .7; font-weight: 500; margin-left: 4px }
.form { display: grid; gap: 12px; max-width: 720px }
.champ { display: block }
.champ span { display: block; font-size: 12.5px; font-weight: 700; color: var(--gris); margin-bottom: 4px; letter-spacing: .02em }
.champ input, .champ select { width: 100%; border: 1px solid var(--trait); border-radius: 8px; padding: 8px 10px; background: var(--carte) }
.flash { max-width: 1380px; margin: 12px auto 0; padding: 10px 14px; border-radius: 10px; font-weight: 600; border: 1px solid var(--trait); background: var(--carte) }
.flash-success { border-color: #8FD1AE; background: #E9F7EF; color: #14553A }
.flash-error { border-color: #EBA3A7; background: #FCEBEC; color: #8F1820 }
.flash-warning { border-color: #EFCB8A; background: #FFF6E5; color: #6E4100; font-weight: 500 }
.info { background: #FFF8D6; color: #4A3B00; border: 1px solid #F0DE8A; border-radius: 10px; padding: 9px 12px; font-size: 13.5px; margin-top: 12px }
code { font: 12.5px Consolas, "Cascadia Mono", monospace; background: var(--champ); border-radius: 4px; padding: 1px 5px }

.pied { max-width: 1380px; margin: 0 auto; padding: 0 20px 28px; color: var(--gris); font-size: 12px; display: flex; gap: 14px; justify-content: space-between; flex-wrap: wrap }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px); background: var(--inverse-fond); color: var(--inverse-txt); border-radius: 10px; padding: 10px 16px; font-weight: 600; opacity: 0; pointer-events: none; transition: .2s; z-index: 80; max-width: 90vw }
.toast.on { opacity: 1; transform: translateX(-50%) }

@media (max-width: 980px) {
  .cat { grid-template-columns: 1fr }
  .rail { position: static; max-height: none; display: none; background: var(--carte); border: 1px solid var(--trait); border-radius: var(--r); padding: 12px }
  .rail.ouvert { display: block }
  .btn.btn-filtres { display: inline-flex }
  .fiche-h { grid-template-columns: 1fr; padding: 18px 16px 12px }
  .onglets { padding: 0 12px; overflow-x: auto }
  .corps { padding: 14px 16px 20px }
  .sync { margin-left: 0; flex-basis: 100%; padding-bottom: 8px }
}
@media (max-width: 640px) {
  .top-in { flex-wrap: wrap; gap: 10px; padding: 8px 14px }
  .logo img { height: 30px }
  .rech { order: 3; flex-basis: 100% }
  .qui { margin-left: auto }
  .qui .nom { display: none }
  .page { padding: 12px 14px 50px }
  .nav { padding: 0 8px; flex-wrap: wrap }
  .nav a { padding: 8px 10px }
  .sync { flex-basis: 100%; margin-left: 0; padding: 2px 4px 8px; white-space: normal }
  .grille { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px }
  .carte { min-height: 300px; padding: 10px }
  .vis { height: 130px } .vis img { height: 124px } .sansphoto { height: 118px }
  .promo { padding: 14px 16px } .promo b { font-size: 21px } .promo-i img:nth-child(n+2), .promo-i .sansphoto:nth-child(n+2) { display: none } .promo-i img, .promo-i .sansphoto { width: 72px; height: 72px }
  .bas { flex-direction: column; align-items: flex-start; gap: 4px }
  .ref b { font-size: 15px }
  .voile { padding: 0 } .fiche { border-radius: 0; min-height: 100vh }
}
@media print {
  body { background: #fff; color: #000 }
  .top, .pied, .toast, .rail, .promo, .no-print { display: none !important }
  .page { padding: 0; max-width: none }
  body.imp-fiche .page { display: none }
  body.imp-fiche .voile { position: static; background: none; padding: 0; display: block }
  body.imp-fiche .fiche { box-shadow: none; max-width: none }
  body.imp-fiche .fermer, body.imp-fiche .actions, body.imp-fiche .onglets { display: none }
  body.imp-fiche .corps [hidden] { display: block !important; margin-bottom: 14px }
}

/* ---------- Pagination (25 à 500 articles par page, 27/11/2026) ---------- */
#liste:focus { outline: none }
.pg-mini { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--gris); white-space: nowrap }
.pg-mini b { color: var(--encre) }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px 18px; flex-wrap: wrap; margin: 22px 0 6px; color: var(--gris); font-size: 14px }
.pg-plage b { color: var(--encre); font-variant-numeric: tabular-nums }
.pg-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap }
.pg { min-width: 36px; height: 36px; padding: 0 10px; border: 1px solid var(--trait); background: var(--carte); border-radius: 8px; font-weight: 600; font-size: 14px; color: var(--encre); display: inline-flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; white-space: nowrap }
button.pg:hover:not(:disabled) { background: var(--champ) }
.pg:disabled { opacity: .4; cursor: default }
.pg.on { background: var(--inverse-fond); color: var(--inverse-txt); border-color: var(--inverse-fond) }
.pg-mini .pg { min-width: 30px; height: 30px; padding: 0 8px; font-size: 17px; line-height: 1 }
.pg-el { padding: 0 4px; color: var(--gris2) }
.pg-etat { display: none; font-weight: 600; color: var(--encre); padding: 0 8px }
.pg-pp { display: inline-flex; align-items: center; gap: 8px }
.pg-pp select { border: 1px solid var(--trait); background: var(--carte); border-radius: 8px; padding: 7px 9px }
@media (max-width: 640px) {
  .pager { justify-content: center; text-align: center }
  .pg-nav .pg-n, .pg-nav .pg.on, .pg-nav .pg-el { display: none }
  .pg-etat { display: inline }
}
@media print {
  .pager, .pg-mini { display: none !important }
}
