
/* ==========================================================================
   INGREDIENT LIBRARY — an A–Z ingredient encyclopedia inside My Kitchen.

   Uses the Kitchen's existing language exactly: white ground, navy type,
   stone / cream / sage / blush, rounded cards, soft shadows. My Kitchen itself
   is not redesigned; the CTA reuses the existing tile styling.

   PREFIX CHECKED: `il-` and `ilx-` both return zero. Scoped anyway.
   ========================================================================== */
#page-ingredient-library{
  --ilx-navy:#1F3054;
  --ilx-stone:#EFEAE3;
  --ilx-cream:#FBF7F1;
  --ilx-sage:#5F7350;
  --ilx-sage-l:#EBF0E9;
  --ilx-blush-d:#8C4C40;
  --ilx-blush-l:#F9F0ED;
  --ilx-amber-l:#FBF3E3;
  --ilx-line:#E7E0D6;
  background:#FEFDFB !important;
  font-family:'Nunito',system-ui,-apple-system,sans-serif;
}
#page-ingredient-library .ilx-wrap{ max-width:1180px; margin:0 auto; padding:0 clamp(18px,4vw,34px); }
#page-ingredient-library .ilx-wrap section, #page-ingredient-library .ilx-sec{ padding:0 !important; }
#page-ingredient-library .ilx-sec{ margin:0 0 clamp(36px,5vw,60px); min-width:0; }
#page-ingredient-library .ilx-body{ padding:clamp(20px,3vw,32px) 0 120px; min-width:0; }
#page-ingredient-library .ilx-backbar{
  max-width:1180px; margin:0 auto; padding:14px clamp(18px,4vw,34px) 0; display:flex; gap:10px; flex-wrap:wrap;
}
#page-ingredient-library .ilx-sr{
  position:absolute !important; width:1px !important; height:1px !important; padding:0 !important;
  margin:-1px !important; overflow:hidden !important; clip:rect(0 0 0 0) !important;
  white-space:nowrap !important; border:0 !important;
}
#page-ingredient-library .ilx-eb{
  font-size:.7rem; font-weight:800; letter-spacing:.24em; text-transform:uppercase; margin:0 0 10px;
  color:var(--ilx-blush-d) !important; -webkit-text-fill-color:var(--ilx-blush-d) !important;
}
#page-ingredient-library .ilx-h1{
  font-family:'Playfair Display',Georgia,serif !important;
  font-size:clamp(1.9rem,4.4vw,2.9rem) !important; font-weight:700 !important; line-height:1.12;
  margin:0 0 8px !important; color:var(--ilx-navy) !important; -webkit-text-fill-color:var(--ilx-navy) !important;
}
#page-ingredient-library .ilx-h2{
  font-family:'Playfair Display',Georgia,serif !important;
  font-size:clamp(1.25rem,2.5vw,1.65rem) !important; font-weight:700 !important;
  margin:0 0 6px !important; color:var(--ilx-navy) !important; -webkit-text-fill-color:var(--ilx-navy) !important;
}
#page-ingredient-library .ilx-h3{ font-size:.98rem !important; font-weight:800 !important; margin:0 !important;
  color:var(--ilx-navy) !important; -webkit-text-fill-color:var(--ilx-navy) !important; }
#page-ingredient-library .ilx-lead{
  margin:0; font-size:clamp(.95rem,1.4vw,1.03rem); line-height:1.7; max-width:62ch;
  color:#4A5670 !important; -webkit-text-fill-color:#4A5670 !important;
}
#page-ingredient-library .ilx-note{ margin:12px 0 0; font-size:.81rem; line-height:1.7;
  color:#5A6478 !important; -webkit-text-fill-color:#5A6478 !important; }
#page-ingredient-library .ilx-hrow{ display:flex; align-items:flex-end; justify-content:space-between;
  gap:16px; flex-wrap:wrap; margin:0 0 18px; }
#page-ingredient-library .ilx-head{ padding:clamp(14px,2.4vw,26px) 0 clamp(16px,2.4vw,24px); }

#page-ingredient-library .ilx-b, #ilxSheet .ilx-b{
  display:inline-flex; align-items:center; justify-content:center; gap:9px;
  min-height:50px; padding:14px 22px; border-radius:999px; cursor:pointer; font:inherit;
  font-size:.88rem; font-weight:800;
  background:#fff !important; border:1px solid var(--ilx-line) !important;
  color:var(--ilx-navy) !important; -webkit-text-fill-color:var(--ilx-navy) !important;
  transition:transform .16s ease, box-shadow .16s ease, background .16s ease;
}
#page-ingredient-library .ilx-b:hover, #ilxSheet .ilx-b:hover{ background:var(--ilx-stone) !important; }
#page-ingredient-library .ilx-b.is-navy, #ilxSheet .ilx-b.is-navy{
  background:var(--ilx-navy) !important; border-color:var(--ilx-navy) !important;
  color:#fff !important; -webkit-text-fill-color:#fff !important;
}
#page-ingredient-library .ilx-b.is-sm, #ilxSheet .ilx-b.is-sm{ min-height:44px; padding:11px 16px; font-size:.81rem; }
#page-ingredient-library .ilx-b:focus-visible, #ilxSheet .ilx-b:focus-visible,
#page-ingredient-library .ilx-qa:focus-visible, #page-ingredient-library .ilx-cat:focus-visible,
#page-ingredient-library .ilx-card:focus-visible, #page-ingredient-library .ilx-az:focus-visible{
  outline:3px solid #CF9E3F; outline-offset:3px; }
#page-ingredient-library .ilx-acts{ display:flex; gap:10px; flex-wrap:wrap; }

#page-ingredient-library .ilx-i, #ilxSheet .ilx-i{
  box-sizing:border-box; width:100%; min-height:52px; padding:14px 18px; border-radius:999px;
  font:inherit; font-size:.95rem; min-width:0;
  background:#fff !important; border:1px solid var(--ilx-line) !important;
  color:var(--ilx-navy) !important; -webkit-text-fill-color:var(--ilx-navy) !important;
}
#page-ingredient-library .ilx-i:focus, #ilxSheet .ilx-i:focus{ outline:none; border-color:#C9B79A !important;
  box-shadow:0 0 0 3px rgba(201,183,154,.3); }

/* quick actions */
#page-ingredient-library .ilx-qas{ display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:12px; }
#page-ingredient-library .ilx-qa{
  border-radius:20px; padding:18px 16px; cursor:pointer; font:inherit; text-align:left; min-width:0;
  background:var(--ilx-cream) !important; border:1px solid #EFE6DA !important;
  font-size:.88rem; font-weight:800; min-height:64px;
  color:var(--ilx-navy) !important; -webkit-text-fill-color:var(--ilx-navy) !important;
  transition:transform .16s ease, box-shadow .16s ease;
}
#page-ingredient-library .ilx-qa:hover{ transform:translateY(-2px); box-shadow:0 12px 28px rgba(31,48,84,.09); }
#page-ingredient-library .ilx-qa[aria-pressed="true"]{
  background:var(--ilx-navy) !important; border-color:var(--ilx-navy) !important;
  color:#fff !important; -webkit-text-fill-color:#fff !important; }

/* A–Z */
#page-ingredient-library .ilx-azrow{ display:flex; gap:6px; flex-wrap:wrap; }
#page-ingredient-library .ilx-az{
  min-width:44px; min-height:44px; padding:10px; border-radius:12px; cursor:pointer; font:inherit;
  font-size:.82rem; font-weight:800;
  background:#fff !important; border:1px solid var(--ilx-line) !important;
  color:#4A5670 !important; -webkit-text-fill-color:#4A5670 !important;
}
#page-ingredient-library .ilx-az:hover{ background:var(--ilx-stone) !important; }
#page-ingredient-library .ilx-az[aria-pressed="true"]{
  background:var(--ilx-navy) !important; border-color:var(--ilx-navy) !important;
  color:#fff !important; -webkit-text-fill-color:#fff !important; }
#page-ingredient-library .ilx-az.is-off{ opacity:.38; cursor:default; }

/* categories */
#page-ingredient-library .ilx-cats{ display:flex; gap:9px; flex-wrap:wrap; }
#page-ingredient-library .ilx-cat{
  min-height:44px; padding:11px 16px; border-radius:999px; cursor:pointer; font:inherit;
  font-size:.82rem; font-weight:700;
  background:#fff !important; border:1px solid var(--ilx-line) !important;
  color:#4A5670 !important; -webkit-text-fill-color:#4A5670 !important;
}
#page-ingredient-library .ilx-cat:hover{ background:var(--ilx-stone) !important; }
#page-ingredient-library .ilx-cat[aria-pressed="true"]{
  background:var(--ilx-navy) !important; border-color:var(--ilx-navy) !important;
  color:#fff !important; -webkit-text-fill-color:#fff !important; }

/* ingredient cards */
#page-ingredient-library .ilx-grid{ display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:15px; }
#page-ingredient-library .ilx-card{
  background:#fff !important; border:1px solid var(--ilx-line) !important; border-radius:22px;
  padding:20px; box-shadow:0 3px 16px rgba(31,48,84,.05); cursor:pointer; font:inherit;
  display:flex; flex-direction:column; gap:7px; text-align:left; width:100%; min-width:0;
  transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
#page-ingredient-library .ilx-card:hover{ transform:translateY(-3px);
  box-shadow:0 16px 38px rgba(31,48,84,.11); border-color:#D9CDB8 !important; }
#page-ingredient-library .ilx-card-n{ font-size:1rem; font-weight:800;
  color:var(--ilx-navy) !important; -webkit-text-fill-color:var(--ilx-navy) !important; }
#page-ingredient-library .ilx-card-c{ font-size:.78rem; font-weight:800;
  color:#5A6478 !important; -webkit-text-fill-color:#5A6478 !important; }
#page-ingredient-library .ilx-card-d{ font-size:.85rem; line-height:1.6;
  color:#57647E !important; -webkit-text-fill-color:#57647E !important; }
#page-ingredient-library .ilx-pills{ display:flex; gap:6px; flex-wrap:wrap; margin-top:auto; padding-top:10px; }
#page-ingredient-library .ilx-pill{
  font-size:.69rem; font-weight:800; padding:3px 9px; border-radius:99px;
  background:var(--ilx-stone) !important; color:#5A5145 !important; -webkit-text-fill-color:#5A5145 !important;
}
#page-ingredient-library .ilx-pill.is-have{ background:var(--ilx-sage-l) !important;
  color:#3F5237 !important; -webkit-text-fill-color:#3F5237 !important; }
#page-ingredient-library .ilx-pill.is-freeze{ background:var(--ilx-amber-l) !important;
  color:#6B5427 !important; -webkit-text-fill-color:#6B5427 !important; }
#page-ingredient-library .ilx-empty{
  padding:40px 24px; text-align:center; border-radius:22px;
  border:1px dashed #E0D6C6 !important; background:var(--ilx-cream) !important;
}

/* swap finder */
#page-ingredient-library .ilx-swap{
  background:var(--ilx-sage-l) !important; border:1px solid #DCE5D8 !important;
  border-radius:26px; padding:clamp(20px,3vw,30px);
}
#page-ingredient-library .ilx-res{
  background:#fff !important; border:1px solid var(--ilx-line) !important; border-radius:18px;
  padding:16px 18px; margin:14px 0 0;
  font-size:.9rem; line-height:1.7;
  color:#3E4B65 !important; -webkit-text-fill-color:#3E4B65 !important;
}

/* sheet */
#ilxSheet{
  position:fixed; inset:0; z-index:9550; display:none; align-items:flex-end; justify-content:center;
  background:rgba(20,28,44,.48); font-family:'Nunito',system-ui,sans-serif;
}
#ilxSheet.is-open{ display:flex; }
#ilxSheet .ilx-box{
  width:100%; max-width:640px; max-height:calc(100dvh - 40px); overflow-y:auto;
  background:#fff !important; border-radius:28px 28px 0 0; padding:26px clamp(18px,4vw,30px) 34px;
  box-shadow:0 -14px 68px rgba(20,28,44,.3);
}
@media (min-width:720px){
  #ilxSheet{ align-items:center; padding:16px; }
  #ilxSheet .ilx-box{ border-radius:28px; padding-bottom:28px; }
}
#ilxSheet .ilx-box-h{ display:flex; align-items:flex-start; justify-content:space-between; gap:14px; margin:0 0 6px; }
#ilxSheet .ilx-box-t{
  font-family:'Playfair Display',Georgia,serif !important; font-size:1.32rem !important; font-weight:700 !important;
  margin:0 !important; color:#1F3054 !important; -webkit-text-fill-color:#1F3054 !important; }
#ilxSheet .ilx-box-x{
  flex:none; width:44px; height:44px; min-height:44px; border-radius:50%; cursor:pointer; font:inherit; font-size:1.05rem;
  background:#EFEAE3 !important; border:1px solid #E7E0D6 !important;
  color:#1F3054 !important; -webkit-text-fill-color:#1F3054 !important; }
#ilxSheet .ilx-box-b{ font-size:.92rem; line-height:1.72;
  color:#3E4B65 !important; -webkit-text-fill-color:#3E4B65 !important; }
#ilxSheet .ilx-box-b > p{ margin:0 0 13px; color:#3E4B65 !important; -webkit-text-fill-color:#3E4B65 !important; }
#ilxSheet .ilx-box-b ul{ margin:0 0 13px; padding-left:20px; }
#ilxSheet .ilx-box-b li{ margin:0 0 6px; }
#ilxSheet .ilx-k{
  font-size:.66rem; font-weight:800; letter-spacing:.18em; text-transform:uppercase; margin:17px 0 5px;
  color:#8C4C40 !important; -webkit-text-fill-color:#8C4C40 !important; }
#ilxSheet .ilx-box-f{ display:flex; gap:10px; justify-content:flex-end; flex-wrap:wrap; margin:20px 0 0; }
#ilxSheet .ilx-facts{ display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin:12px 0 0; }
#ilxSheet .ilx-fact{
  background:#FBF7F1 !important; border:1px solid #EFE6DA !important; border-radius:14px; padding:12px 14px;
}
#ilxSheet .ilx-fact b{ display:block; font-size:.66rem; font-weight:800; letter-spacing:.14em;
  text-transform:uppercase; margin:0 0 3px;
  color:#5A6478 !important; -webkit-text-fill-color:#5A6478 !important; }
#ilxSheet .ilx-fact span{ font-size:.85rem; font-weight:700;
  color:#1F3054 !important; -webkit-text-fill-color:#1F3054 !important; }
#ilxSheet .ilx-have{
  background:#EBF0E9 !important; border-radius:14px; padding:13px 15px; margin:12px 0 0;
  font-size:.87rem; font-weight:700;
  color:#3F5237 !important; -webkit-text-fill-color:#3F5237 !important; }
#ilxSheet .ilx-chips{ display:flex; gap:7px; flex-wrap:wrap; }
#ilxSheet .ilx-chip{
  font-size:.79rem; font-weight:700; padding:8px 13px; border-radius:99px;
  background:#EFEAE3 !important; border:1px solid #E7E0D6 !important;
  color:#5A5145 !important; -webkit-text-fill-color:#5A5145 !important; }

#ilxToast{
  position:fixed; left:50%; bottom:26px; transform:translate(-50%,14px); z-index:9750;
  background:#1F3054 !important; color:#fff !important; -webkit-text-fill-color:#fff !important;
  padding:14px 24px; border-radius:999px; font-family:'Nunito',system-ui,sans-serif;
  font-size:.87rem; font-weight:700; opacity:0; pointer-events:none;
  transition:opacity .2s, transform .2s; max-width:calc(100vw - 32px); text-align:center;
}
#ilxToast.on{ opacity:1; transform:translate(-50%,0); }

@media (max-width:1020px){
  #page-ingredient-library .ilx-qas{ grid-template-columns:repeat(3,minmax(0,1fr)); }
  #page-ingredient-library .ilx-grid{ grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media (max-width:620px){
  #page-ingredient-library .ilx-qas{ grid-template-columns:repeat(2,minmax(0,1fr)); }
  #page-ingredient-library .ilx-grid{ grid-template-columns:repeat(2,minmax(0,1fr)); gap:11px; }
  #page-ingredient-library .ilx-card{ padding:16px; }
  #ilxSheet .ilx-facts{ grid-template-columns:1fr; }
  #page-ingredient-library .ilx-acts .ilx-b{ flex:1 1 auto; }
}

