/* ==========================================================================
   INGREDIENTS — CSS (NETTOYÉ / SANS DOUBLONS)
   Objectifs principaux (liste ingrédients) :
   - Filtres à gauche
   - Bouton ➕ centré dans le cadre (centrage visuel)
   - Slider "Taille" à droite
   --------------------------------------------------------------------------
   IMPORTANT :
   - Tout ce qui concerne la LISTE est scopé sous .kl-ingredients.kl-ingredients-list
   - On évite les règles globales (select, #ingredients-table, .alpha-btn, etc.)
   ========================================================================== */

/* ==========================================================================
   1) BASE
   ========================================================================== */
.kl-ingredients{ color:#222; }

/* ==========================================================================
   2) BOUTONS (génériques)
   ========================================================================== */
.btn-action{
  display:flex;
  align-items:center;
  justify-content:center;
  width:46px;
  height:46px;
  border-radius:10px;
  border:1px solid #d0d7de;
  background:#fff;
  cursor:pointer;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
  position: relative;
}
.btn-action:hover{
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.btn-action .icon{
  font-size:22px;
  line-height:1;
  margin:0;
}

.btn-action.icon-only{ width:46px; height:46px; padding:0; }
.btn-action.icon-only .label{ display:none; }

/* Variantes */
.btn-save{ color:#1d7f37; }
.btn-save:hover{ border-color:#1d7f37; }

.btn-cancel{ color:#b32d2e; }
.btn-cancel:hover{ border-color:#b32d2e; }

.btn-saveas{ color:#2271b1; }
.btn-saveas:hover{ border-color:#2271b1; }

.btn-edit{ color:#2271b1; }
.btn-edit:hover{ border-color:#2271b1; }

/* Tooltip */
.btn-action::after{
  content: attr(data-tooltip);
  position:absolute;
  bottom:-38px;
  left:50%;
  transform: translateX(-50%);
  white-space:nowrap;
  background:#1d2327;
  color:#fff;
  font-size:12px;
  padding:6px 10px;
  border-radius:6px;
  opacity:0;
  pointer-events:none;
  transition: opacity .15s ease, transform .15s ease;
  z-index:1000;
}
.btn-action:hover::after{
  opacity:1;
  transform: translateX(-50%) translateY(4px);
}

/* "Save as" (si utilisé ailleurs) */
.saveas-icon{ position:relative; font-size:26px; line-height:1; }
.saveas-icon .arrow{
  position:absolute;
  right:-6px;
  bottom:-6px;
  font-size:14px;
  color:#b32d2e; /* rouge WP */
}

/* ==========================================================================
   3) HEADER INGREDIENT (fiche ingrédient)
   ========================================================================== */
.ing-header{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:10px;
  margin: 6px 0 14px;
  padding-right:18px;
}
.ing-title-wrap{ display:flex; align-items:baseline; gap:10px; }

.ing-title{
  margin:0;
  font-size:26px;
  line-height:1.2;
  white-space:nowrap;
}

.ing-etat-sep{ opacity:.6; }

/* Badge état (commun liste + fiche) */
.ing-etat{
  display:inline-block;
  padding:2px 8px;
  border-radius:999px;
  color:#fff;
  font-size:12px;
  line-height:18px;
  font-weight:600;
  white-space:nowrap;
}

/* Couleurs états */
.ing-etat-1{ background:#9aa0a6; } /* Encore */
.ing-etat-2{ background:#fbbc04; } /* Rédigé */
.ing-etat-3{ background:#1a73e8; } /* Validé */
.ing-etat-4{ background:#34a853; } /* Approuvé */

.ingredient-actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-shrink:0;
  margin-left:10px;
}

/* ==========================================================================
   LISTE INGREDIENTS — TOOLBAR (ROBUSTE)
   Objectif : [filtres] à gauche | [➕] centré | [slider] à droite
   ========================================================================== */

/* Le conteneur toolbar */
.ing-list-toolbar{
  display:grid;
  grid-template-columns: 1fr auto 1fr; /* gauche | centre | droite */
  align-items:center;
  column-gap:12px;

  width:100%;
  box-sizing:border-box;

  margin: 12px 0 10px;
  padding: 10px 12px;
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:12px;
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
}

/* Les 3 zones */
.ing-list-filters{ justify-self:start; min-width:0; }
.ing-list-create{  justify-self:center; }
.ing-list-actions{ justify-self:end;   min-width:0; }

/* Si jamais des contenus internes sont en flex */
.ing-list-filters,
.ing-list-actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

/* Sécurité : si l'écran est étroit, on empile proprement */
@media (max-width: 720px){
  .ing-list-toolbar{
    grid-template-columns: 1fr;
    row-gap:10px;
  }
  .ing-list-filters,
  .ing-list-create,
  .ing-list-actions{
    justify-self:stretch;
    width:100%;
  }
  .ing-list-create{ display:flex; justify-content:center; }
  .ing-list-actions{ justify-content:flex-end; }
}



/* ==========================================================================
   5) LISTE INGREDIENTS — TABLE
   ========================================================================== */
.kl-ingredients.kl-ingredients-list .ing-table-wrap{
  margin-top:8px;
  overflow-x:auto;
}

.kl-ingredients.kl-ingredients-list #ingredients-table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:12px;
  overflow:hidden;
}

.kl-ingredients.kl-ingredients-list #ingredients-table th,
.kl-ingredients.kl-ingredients-list #ingredients-table td{
  padding:8px 10px;
  border-bottom:1px solid #e5e7eb;
  text-align:center;
  vertical-align:middle;
}

.kl-ingredients.kl-ingredients-list #ingredients-table thead th{
  position: sticky;
  top: 0;
  z-index: 30;
  background:#0b6fa4;
  color:#fff;
}

/* Hover ligne */
.kl-ingredients.kl-ingredients-list #ingredients-table tbody tr:hover{
  background-color:#e3f1ff;
  cursor:pointer;
}

/* Icônes table */
.kl-ingredients.kl-ingredients-list .ing-edit-icon,
.kl-ingredients.kl-ingredients-list .ing-dup-icon{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:28px;
  height:28px;
  border-radius:6px;
  text-decoration:none;
}
.kl-ingredients.kl-ingredients-list .ing-edit-icon{
  color:#0b5f8a;
  font-size:15px;
}
.kl-ingredients.kl-ingredients-list .ing-dup-icon{ font-size:15px; }

.kl-ingredients.kl-ingredients-list .ing-dup-icon .dup-saveas{
  position:relative;
  font-size:16px;
  line-height:1;
  color:#2271b1;
}
.kl-ingredients.kl-ingredients-list .ing-dup-icon .dup-saveas .arrow{
  position:absolute;
  right:-8px;
  bottom:-8px;
  font-size:12px;
  color:#2271b1;
}

/* Déplacement / redimensionnement colonnes */
.kl-ingredients.kl-ingredients-list #ingredients-table thead th{
  position: relative;
  cursor: grab;
  user-select:none;
}
.kl-ingredients.kl-ingredients-list #ingredients-table th.kl-ing-dragging{ opacity:0.5; }

.kl-ingredients.kl-ingredients-list #ingredients-table thead th .kl-col-resizer{
  position:absolute;
  top:0;
  right:0;
  width:7px;
  height:100%;
  cursor: col-resize;
  user-select:none;
  touch-action:none;
}
.kl-ingredients.kl-ingredients-list #ingredients-table thead th:hover .kl-col-resizer{
  background: rgba(255,255,255,0.22);
}
body.kl-col-resize-active{
  cursor: col-resize !important;
  user-select:none !important;
}

/* Mode "seul le tableau défile" */
body.kl-ing-lock{ overflow:hidden; }
body.kl-ing-lock .ing-table-wrap{
  overflow-y:auto;
  overflow-x:auto;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
}

/* ==========================================================================
   6) LISTE INGREDIENTS — MODE DENSE piloté par variables
   ========================================================================== */
.kl-ingredients.kl-ingredients-list{
  --ing-body-font: 11px;
  --ing-row-h: 15px;
  --ing-badge-h: 15px;
  --ing-pad-x: 4px;
}

.kl-ingredients.kl-ingredients-list #ingredients-table{
  border-collapse: collapse !important;
}
.kl-ingredients.kl-ingredients-list #ingredients-table tbody td{
  font-size: var(--ing-body-font) !important;
  height: var(--ing-row-h) !important;
  line-height: 1 !important;
  padding: 0 var(--ing-pad-x) !important;
  vertical-align: middle !important;
}
.kl-ingredients.kl-ingredients-list #ingredients-table tbody td .ing-etat{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  height: var(--ing-badge-h) !important;
  line-height:1 !important;
  padding: 0 6px !important;
  font-size: calc(var(--ing-body-font) - 1px) !important;
  border-radius:999px !important;
}
.kl-ingredients.kl-ingredients-list #ingredients-table tbody td *{ margin:0 !important; }

/* ==========================================================================
   7) LISTE — INACTIFS (hachures + hover)
   ========================================================================== */
.kl-ingredients.kl-ingredients-list #ingredients-table tbody tr.ing-inactive td{
  position:relative;
  z-index:0;
  overflow:hidden;
  background-color:#eef1f4 !important;
  color:#6c757d;
}
.kl-ingredients.kl-ingredients-list #ingredients-table tbody tr.ing-inactive td::after{
  content:"";
  position:absolute;
  inset:0;
  z-index:-1;
  background-image: repeating-linear-gradient(
    -45deg,
    rgba(0,0,0,0.055),
    rgba(0,0,0,0.055) 4px,
    transparent 4px,
    transparent 8px
  );
  pointer-events:none;
}
.kl-ingredients.kl-ingredients-list #ingredients-table tbody tr.ing-inactive td::before{
  content:"";
  position:absolute;
  inset:0;
  z-index:-1;
  background: rgba(227, 241, 255, 0);
  pointer-events:none;
  transition: background 120ms ease;
}
.kl-ingredients.kl-ingredients-list #ingredients-table tbody tr.ing-inactive:hover{
  background-color:transparent !important;
}
.kl-ingredients.kl-ingredients-list #ingredients-table tbody tr.ing-inactive:hover td{
  background-color:#eef1f4 !important;
}
.kl-ingredients.kl-ingredients-list #ingredients-table tbody tr.ing-inactive:hover td::before{
  background: rgba(227, 241, 255, 0.75);
}
.kl-ingredients.kl-ingredients-list #ingredients-table tbody tr.ing-inactive .ing-etat{
  filter: grayscale(25%);
  opacity:0.9;
}

/* ==========================================================================
   8) UI — ONGLET / PANELS
   ========================================================================== */
.ing-tabs{ display:flex; flex-wrap:wrap; gap:6px; margin:10px 0 15px; }
.ing-tab{
  border:1px solid #cfcfcf;
  background:#f5f5f5;
  padding:6px 10px;
  border-radius:6px;
  cursor:pointer;
}
.ing-tab.is-active{ background:#0073aa; color:#fff; border-color:#0073aa; }
.ing-panel{ display:none; }
.ing-panel.is-active{ display:block; }

/* ==========================================================================
   9) GRILLES / CARTES (fiche)
   ========================================================================== */
.info-4grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
  align-items:stretch;
}
.tech-6grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:12px;
}

.info-card{
  border:2px solid #222;
  border-radius:14px;
  background:#fbfbfb;
  padding:0;
  overflow:hidden;
  min-height:160px;
  display:flex;
  flex-direction:column;
}
.info-card h4{
  margin:0;
  padding:10px 12px;
  font-size:16px;
  font-weight:700;
  background:#e9f3ff;
  border-bottom:1px solid #222;
}
.info-body{ padding:12px; color:#444; }

.inner-subcard{
  border:2px solid #222;
  border-radius:12px;
  padding:14px;
  background:#fff;
  flex:1;
  box-sizing:border-box;
}

/* ==========================================================================
   10) PARAM / TECH (fiche)
   ========================================================================== */
.param-block{
  border:2px solid #222;
  border-radius:14px;
  padding:14px 16px;
  background:#fff;
}
.param-line{
  display:grid;
  grid-template-columns: 260px 1fr;
  align-items:center;
  padding:8px 0;
}
.param-label{ font-weight:600; color:#222; }
.param-value{ color:#111; }
.param-value em{ color:#777; font-style:italic; margin-left:6px; }

.tech-line{ margin-bottom:12px; }
.tech-line:last-child{ margin-bottom:0; }
.tech-line strong{ display:block; margin-bottom:4px; font-weight:600; }

.tech-textbox{
  border:1px solid #ccc;
  border-radius:6px;
  padding:8px;
  min-height:60px;
  background:#fafafa;
  color:#555;
}
.tech-textbox.short{ min-height:34px; }

.tech-select{
  width:100%;
  border:1px solid #ccc;
  border-radius:6px;
  padding:8px;
  background:#f7f7f7;
  color:#555;
}

/* ==========================================================================
   11) NUTRITION (fiche) — version consolidée
   ========================================================================== */
.nutri-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:8px 12px;
  background:#fff;
  flex-wrap:wrap;
}
.nutri-filters{ display:flex; align-items:center; gap:8px; }

.nutri-pill{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:5px 10px;
  border:1px solid #cfd6df;
  border-radius:999px;
  background:#fff;
  font-size:12px;
  cursor:pointer;
  user-select:none;
  line-height:1;
}
.nutri-pill:hover{ background: rgba(20, 120, 255, 0.06); }
.nutri-pill input{ width:14px; height:14px; margin:0; }
.nutri-pill input:not(:checked) + span{ opacity:.45; }

.nutri-toggle-all{
  border:1px solid #cfd6df;
  background:#fff;
  border-radius:8px;
  padding:6px 10px;
  cursor:pointer;
  font-weight:600;
}
.nutri-toggle-all:hover{ background: rgba(20, 120, 255, 0.06); }

.nutri-card{ width:fit-content; max-width:100%; margin:0 auto; }
.nutri-body{ display:flex; justify-content:center; }

.nutri-wrap{
  background:#fff;
  border:2px solid #222;
  border-radius:14px;
  padding:12px;
  overflow:auto;
  width:fit-content;
  max-width:100%;
  margin:0 auto;
}

/* Hiérarchie + repli/dépli */
.nutri-name-inner{ display:flex; align-items:center; gap:6px; }
.nutri-toggle{ border:0; background:transparent; cursor:pointer; padding:0 4px; }
.nutri-toggle-spacer{ display:inline-block; width:18px; }
.nutri-hidden{ display:none; }
.nutri-indent[data-level="0"]{ width:0; }
.nutri-indent[data-level="1"]{ width:14px; }
.nutri-indent[data-level="2"]{ width:28px; }
.nutri-indent[data-level="3"]{ width:42px; }

.nutri-table{
  width:auto;
  max-width:1100px;
  margin:0 auto;
  border-collapse:collapse;
  table-layout:auto;
}
.nutri-table th{
  background:#e9f3ff;
  font-weight:700;
  text-align:center;
  padding:10px 12px;
  border-bottom:1px solid #222;
}
.nutri-table td{
  text-align:center;
  padding:10px 12px;
  border-bottom:1px solid #e6e6e6;
  vertical-align:middle;
}
.nutri-table tr:hover td{ background:#f7fbff; }

.nutri-manual{ color:#b000b5; font-weight:700; }
.nutri-manual-input{ color:#b000b5; font-weight:700; }
.nutri-auto-input{ color:inherit; font-weight:inherit; }

/* ==========================================================================
   12) ALLERGÈNES (fiche)
   ========================================================================== */
.alg-table{
  border:2px solid #444;
  border-radius:14px;
  background:#fff;
  width:fit-content;
  min-width:1100px;
  max-width:100%;
  margin:10px auto 0;
  overflow-x:auto;
  overflow-y:hidden;
}
.alg-row{
  display:grid;
  grid-template-columns: 120px 540px 540px;
  border-top:1px solid #bbb;
}
.alg-row:first-child{ border-top:0; }
.alg-name{
  padding:10px;
  font-weight:700;
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  border-right:1px solid #bbb;
  background:#f3f1ea;
}
.alg-col{
  padding:8px 10px 10px;
  border-right:1px solid #bbb;
  background:#fff;
}
.alg-col:last-child{ border-right:0; }
.alg-col-title{
  font-weight:700;
  text-align:center;
  padding:8px 0;
  margin:-8px -10px 10px;
  background:#f1f7fd;
  border-bottom:1px solid #bbb;
}
.alg-radios{
  display:flex;
  gap:12px;
  align-items:center;
  margin:4px 0 8px;
  flex-wrap:wrap;
  font-size:13px;
}
.alg-radios label{ cursor:default; white-space:nowrap; color:#111; }
.alg-radios input[type="radio"]{ width:16px; height:16px; margin-right:6px; accent-color:#005a8c; }

.alg-field{
  border:1px solid #bbb;
  background:#fff;
  height:26px;
  padding:4px 6px;
  margin:6px 0 8px;
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
}
.alg-field input[type="text"]{
  border:0;
  outline:none;
  width:100%;
  background:transparent;
  padding:0;
  margin:0;
  box-shadow:none;
}
.alg-subline{
  display:flex;
  align-items:center;
  gap:12px;
  min-height:32px;
}
.alg-subline span{ font-weight:700; }
.alg-text{ font-weight:400; }

@media (max-width:1100px){
  .alg-table{ width:100%; min-width:0; }
  .alg-row{
    grid-template-columns: 140px 1fr;
    grid-template-areas:
      "name vol"
      "name for";
  }
  .alg-name{ grid-area:name; }
  .alg-col--vol{
    grid-area:vol;
    border-right:0;
    border-bottom:1px solid #bbb;
  }
  .alg-col:not(.alg-col--vol){ grid-area:for; }
}

/* ==========================================================================
   13) HISTORIQUE (fiche)
   ========================================================================== */
.info-card.hist-card{
  border:none;
  background:transparent;
  padding:0;
  overflow:visible;
  min-height:0;
}
.info-card.hist-card .info-body{ padding:0; }

.hist-subcard{
  border:2px solid #222;
  border-radius:14px;
  background:#fff;
  overflow:hidden;
  padding:0;
}

.hist-table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  background:#fff;
}
.hist-table thead th{
  background:#e9f3ff;
  border-bottom:1px solid #222;
  padding:10px 12px;
  font-weight:700;
  font-size:14px;
}
.hist-table thead th:first-child{ border-top-left-radius:12px; }
.hist-table thead th:last-child{ border-top-right-radius:12px; }

.hist-table td{
  border-bottom:1px solid #e6e6e6;
  padding:10px 12px;
  vertical-align:top;
  font-size:13px;
  color:#333;
}
.hist-table tbody tr:nth-child(even) td{ background:#fafafa; }
.hist-table tbody tr:hover td{ background:#f7fbff; }

.hist-table th:nth-child(1), .hist-table td:nth-child(1),
.hist-table th:nth-child(2), .hist-table td:nth-child(2),
.hist-table th:nth-child(3), .hist-table td:nth-child(3),
.hist-table th:nth-child(4), .hist-table td:nth-child(4){
  text-align:center;
  vertical-align:middle;
}
.hist-table th:nth-child(5), .hist-table td:nth-child(5){
  text-align:left;
  vertical-align:top;
}

.hist-changes{ margin:0; padding-left:18px; }
.hist-changes li{ margin:2px 0; line-height:1.35; }
.hist-muted{ color:#777; font-style:italic; }

.hist-block{ margin:0; }
.hist-block + .hist-block{ margin-top:10px; }
.hist-block-title{ font-weight:700; margin:2px 0 6px; color:#222; }
.hist-subblock{
  margin:6px 0 0;
  padding:6px 8px;
  border:1px solid #e6e6e6;
  border-radius:10px;
  background:#fafafa;
}
.hist-subblock-title{ font-weight:700; margin:0 0 4px; }

/* ==========================================================================
   14) FICHIERS ATTACHÉS
   ========================================================================== */
.kl-files-box{
  border:1px solid #ddd;
  background:#fafafa;
  padding:10px;
  border-radius:4px;
}
.kl-files-empty{ color:#777; font-style:italic; }
.kl-files-list{ list-style:none; padding:0; margin:0; }

.kl-files-item{
  display:flex;
  align-items:center;
  gap:10px;
  padding:6px 0;
  border-bottom:1px solid #eee;
}
.kl-files-item:last-child{ border-bottom:none; }

.kl-files-item a{ text-decoration:none; }
.kl-files-item a:hover{ text-decoration:underline; }

.kl-file-del{
  margin-left:auto;
  background:#f5f5f5;
  border:1px solid #ccc;
  padding:2px 6px;
  font-size:12px;
  cursor:pointer;
}
.kl-file-del:hover{
  background:#ffecec;
  border-color:#cc0000;
  color:#a00000;
}

.kl-files-actions{ margin-top:8px; }
.kl-files-actions input[type="file"]{ font-size:13px; }
.kl-files-actions button{ margin-left:6px; }
.kl-files-status{ font-size:12px; color:#555; }

.kl-files-hint{
  display:flex;
  align-items:flex-start;
  gap:8px;
  margin:8px 0 12px 0;
  padding:8px 10px;
  background:#f4f8fc;
  border-left:4px solid #4a90e2;
  font-size:13px;
  color:#333;
  border-radius:3px;
}
.kl-files-hint-icon{ font-size:16px; line-height:1.2; }
.kl-files-hint-text{ line-height:1.4; }

/* ==========================================================================
   15) SWEETALERT (modifs)
   ========================================================================== */
.swal-change-row{ display:flex; align-items:center; gap:10px; padding:6px 0; border-bottom:1px solid #eee; }
.swal-change-row:last-child{ border-bottom:none; }

.swal-change-label{ min-width:180px; font-weight:600; text-align:left; }
.swal-change-values{
  display:flex;
  align-items:center;
  gap:6px;
  white-space:nowrap;
  font-family: monospace;
}
.swal-change-values .old{ color:#b00020; }
.swal-change-values .new{ color:#0a7d2c; font-weight:600; }
.swal-change-values .arrow{ color:#555; }

.swal-version{
  margin-bottom:12px;
  padding-bottom:8px;
  border-bottom:1px solid #ddd;
  font-weight:600;
}
.swal-changes{ text-align:left; font-size:14px; }

.ing-swal-popup{
  border-radius:14px !important;
  padding:18px 18px 14px !important;
  text-align:left !important;
  overflow:hidden !important;
}
.ing-swal-title{
  margin:0 0 12px !important;
  font-size:22px !important;
  font-weight:700 !important;
}
.ing-swal-popup .swal2-html-container{ margin:0 !important; }
.ing-swal-popup .swal2-input{
  margin:6px 0 12px !important;
  width:100% !important;
  max-width:100% !important;
  height:40px !important;
  border-radius:10px !important;
  box-sizing:border-box !important;
}
.ing-swal-popup label{ display:block; margin:8px 0 2px; font-weight:600; }
.ing-swal-confirm{
  background:#4f46e5;
  color:#fff;
  border:0;
  border-radius:10px;
  padding:10px 16px;
  font-weight:700;
}
.ing-swal-cancel{
  background:#6b7280;
  color:#fff;
  border:0;
  border-radius:10px;
  padding:10px 16px;
  font-weight:700;
  margin-left:10px;
}

/* ==========================================================================
   FIN
   ========================================================================== */
/* =========================================================
   TOOLBAR ingrédients — FIX débordement + 3 zones stables
   ========================================================= */

/* 1) La grille : colonnes shrinkables */
.ing-list-toolbar{
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: start;
  column-gap: 14px;

  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden; /* empêche le centrage "sur un écran plus large" */

  margin: 12px 0 10px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
}

/* 2) Positionnement explicite des 3 blocs (évite héritages chelous) */
.ing-list-filters{ grid-column: 1; min-width: 0; }
.ing-list-create{  grid-column: 2; justify-self: center; padding-top: 2px; }
.ing-list-actions{ grid-column: 3; justify-self: end; min-width: 0; width: auto !important; }

/* 3) IMPORTANT : le bloc filtres doit pouvoir WRAPPER */
#alphabet-filters{
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 100%;
}

#select-filters{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  max-width: 100%;
}

/* Empêche les champs de forcer une largeur min-content trop grande */
#search-input{ max-width: 220px; }
#select-filters select{ max-width: 220px; }

/* 4) Le slider à droite : reste compact */
.ing-density{
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
#ing-density-range{ width: 160px; }

/* 5) Responsive : seulement si vraiment étroit */
@media (max-width: 650px){
  .ing-list-toolbar{
    grid-template-columns: 1fr;
    row-gap: 10px;
  }
  .ing-list-filters,
  .ing-list-create,
  .ing-list-actions{
    grid-column: 1;
    justify-self: stretch;
    width: 100%;
  }
  .ing-list-create{ display:flex; justify-content:center; }
  .ing-list-actions{ display:flex; justify-content:flex-end; }
}


/* Taille des icônes d'action = hauteur de ligne (au lieu de 28px fixe) */
.kl-ingredients.kl-ingredients-list{
  --ing-icon: calc(var(--ing-row-h) - 2px);
}

/* Empêche un enfant de forcer la ligne à 28px */
.kl-ingredients.kl-ingredients-list .ing-edit-icon,
.kl-ingredients.kl-ingredients-list .ing-dup-icon{
  width: var(--ing-icon) !important;
  height: var(--ing-icon) !important;
  border-radius: 6px;
}

/* Ajuste la taille du pictogramme */
.kl-ingredients.kl-ingredients-list .ing-edit-icon{
  font-size: calc(var(--ing-body-font) + 2px) !important;
}
.kl-ingredients.kl-ingredients-list .ing-dup-icon,
.kl-ingredients.kl-ingredients-list .ing-dup-icon .dup-saveas{
  font-size: calc(var(--ing-body-font) + 3px) !important;
  line-height: 1 !important;
}

/* Bonus : force la hauteur de la ligne elle-même */
.kl-ingredients.kl-ingredients-list #ingredients-table tbody tr{
  height: var(--ing-row-h) !important;
}