@font-face {
  font-family: 'Plex Arabic';
  src: url('./assets/fonts/plex-arabic-400.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Plex Arabic';
  src: url('./assets/fonts/plex-arabic-600.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: 'Plex Arabic';
  src: url('./assets/fonts/plex-arabic-700.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: 'Noto Sans Ethiopic';
  src: url('./assets/fonts/noto-sans-ethiopic.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+1200-139F, U+2D80-2DDF, U+AB00-AB2F;
}

:root {
  color-scheme: light;
  font-family: 'Plex Arabic', 'Noto Sans Ethiopic', 'Segoe UI', Tahoma, sans-serif;
  color: #172a21;
  background: #f6f7f3;
  font-weight: 400;
  line-height: 1.5;
  --ink: #172a21;
  --muted: #58665d;
  --green: #256144;
  --green-dark: #1b4b34;
  --sage: #eaf2e9;
  --line: #e3e9df;
  --white: #fff;
  --surface: #f7f8f4;
  --shadow: 0 2px 5px rgb(22 42 30 / 3%), 0 12px 30px rgb(22 42 30 / 3%);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
body:has(.shopping-dialog[open]) { overflow: hidden; }
a { color: inherit; }
button, input { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #358759; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
button, [type="checkbox"] { touch-action: manipulation; }
[hidden], .shopping-dialog:not([open]) { display: none !important; }
[data-admin-only] { display: none !important; }
body[data-role="admin"] .section-nav [data-admin-only] { display: flex !important; }
body[data-role="worker"] :is([data-household-only], .meals-nav, .meal-week, .meal-library, [data-edit-meal-date], #copy-today-meals) { display: none !important; }
body[data-role="worker"] .saved-list-link { padding-inline-end: 1.15rem; }

.account-panel { width: min(100%, 38rem); margin-inline: auto; padding: clamp(1rem, 4vw, 1.8rem); border: 1px solid var(--line); border-radius: 1rem; background: var(--white); box-shadow: var(--shadow); }
.login-panel { width: min(100%, 26rem); margin-block-start: 2rem; }
.account-panel form { display: grid; gap: .85rem; margin-block-start: 1rem; }
.account-panel h1 { font-size: clamp(1.45rem, 4vw, 2rem); }
.account-panel h2 { font-size: 1.2rem; }
.account-list { display: grid; gap: .45rem; list-style: none; padding: 0; }
.account-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .65rem; padding: .55rem .7rem; background: var(--surface); border-radius: .6rem; overflow-wrap: anywhere; }
.account-list button, .account-import, #account-retry { min-height: 2.6rem; padding: .35rem .7rem; }
.account-feedback, .account-import, #account-retry, .account-panel .editor-error { margin-block-start: .75rem; }
.account-sign-out { flex: 0 0 auto; font-size: .88rem; border: 0; padding: .4rem .55rem; color: var(--green-dark); background: var(--sage); border-radius: .5rem; }
.header-inner:has(.account-sign-out:not([hidden])) { flex-wrap: wrap; gap: .35rem; }
.account-language { display: inline-flex; align-items: center; gap: .4rem; font-size: .875rem; font-weight: 600; }
.account-language select { min-height: 2.5rem; max-width: 100%; padding-inline: .45rem; border: 1px solid var(--line); border-radius: .55rem; background: var(--white); color: var(--ink); font: inherit; }
.account-language :lang(am) { font-family: 'Noto Sans Ethiopic', sans-serif; }
html[dir="ltr"] .icon:has(use[href="#icon-chevron-left"], use[href="#icon-chevron-right"]) { transform: scaleX(-1); }
html[dir="ltr"] [data-page="lists"] .create-list-button { transform: translateX(1rem); }

.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon {
  display: block;
  flex: 0 0 auto;
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sr-only, .skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link:focus {
  position: fixed;
  z-index: 5;
  inset-block-start: .8rem;
  inset-inline-start: .8rem;
  padding: .55rem .85rem;
  border-radius: .6rem;
  background: var(--white);
}

.layout { width: min(100% - 3.5rem, 78rem); margin-inline: auto; }
.site-header { border-block-end: 1px solid var(--line); background: var(--white); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 4.7rem; }
.wordmark { display: inline-flex; gap: .65rem; align-items: center; text-decoration: none; font-size: 1.42rem; font-weight: 700; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 2.55rem;
  height: 2.55rem;
  border-radius: .85rem;
  background: var(--green);
  color: var(--white);
}
.brand-mark .icon { width: 1.45rem; height: 1.45rem; }
.section-nav { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; }
.section-nav a {
  display: flex;
  align-items: center;
  min-height: 2.65rem;
  padding-inline: .75rem;
  border-radius: .65rem;
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
}
.section-nav a:hover, .section-nav a[aria-current="page"] { background: var(--sage); color: var(--green-dark); }
.header-list {
  display: flex;
  align-items: center;
  gap: .55rem;
  min-height: 2.75rem;
  padding-inline: .8rem;
  border: 1px solid #dae7d9;
  border-radius: .8rem;
  background: #f5f9f3;
  color: var(--green-dark);
  font-weight: 600;
}
.header-list:hover { background: var(--sage); }
.list-badge {
  display: grid;
  min-width: 1.55rem;
  height: 1.55rem;
  padding-inline: .26rem;
  place-items: center;
  border-radius: 1rem;
  background: #e3eee1;
  color: #24563e;
  font-size: .875rem;
  font-weight: 700;
  line-height: 1;
}

.main-layout { padding-block: 1.7rem 1.9rem; }
.hero {
  display: flex;
  align-items: center;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 16.8rem;
  padding: 2rem clamp(1.5rem, 4.8vw, 4.4rem);
  border-radius: 1.55rem;
  background: #153a2b url('./assets/basket-hero.jpg') center 48% / cover no-repeat;
  color: #fffdf5;
}
.hero::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(270deg, rgb(8 32 22 / 84%), rgb(8 32 22 / 45%) 45%, transparent 80%);
  content: '';
}
.hero-copy { max-width: 57%; }
.hero h1 { font-size: clamp(2rem, 5.2vw, 4rem); font-weight: 700; line-height: 1.14; }
.home-cards, .saved-lists {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.home-cards { margin-block-start: 1.15rem; }
.home-card, .saved-list-link {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .9rem;
  min-height: 7rem;
  height: 100%;
  padding: 1.15rem;
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  background: var(--white);
  box-shadow: var(--shadow);
  text-decoration: none;
}
.home-card:hover, .saved-list-link:hover { border-color: #9dbda2; background: #fcfdfb; }
.home-card-icon {
  display: grid;
  width: 3.05rem;
  height: 3.05rem;
  place-items: center;
  border-radius: .83rem;
  background: var(--sage);
  color: var(--green);
}
.home-card-icon .icon { width: 1.5rem; height: 1.5rem; }
.home-card[href="#lists"] .home-card-icon { background: #f5eddb; color: #6a521e; }
.home-card[href="#meals"] .home-card-icon { background: #f4e8e0; color: #8b4e37; }
.home-card-copy, .saved-list-copy { display: grid; gap: .15rem; overflow-wrap: anywhere; }
.home-card-copy strong, .saved-list-copy strong { font-size: 1.19rem; line-height: 1.3; }
.home-card-copy span, .list-date { color: var(--muted); font-size: .9rem; }
.home-card > .icon, .saved-list-link > .icon { width: 1rem; height: 1rem; color: var(--green); }
.screen-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .85rem;
  margin-block-end: 1.15rem;
}
.screen-top h1 { font-size: clamp(1.6rem, 3vw, 2.55rem); line-height: 1.23; overflow-wrap: anywhere; }
.catalog-create-actions {
  display: flex;
  align-items: stretch;
  gap: .55rem;
  max-width: 100%;
  margin-inline-start: auto;
}
.list-picker { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.list-picker span { color: var(--muted); font-size: .9rem; font-weight: 600; white-space: nowrap; }
.list-picker select {
  width: 16.5rem;
  min-width: 0;
  min-height: 2.85rem;
  padding-inline: .55rem;
  border: 1px solid #cfdcd1;
  border-radius: .65rem;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  text-overflow: ellipsis;
}
.list-action { padding-inline: .9rem; white-space: nowrap; text-decoration: none; }
.saved-lists {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}
.saved-list-card { position: relative; }
.saved-list-link { height: 100%; padding-inline-end: 3.95rem; }
.saved-list-remaining {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: .32rem;
  padding: .12rem .48rem;
  border: 1px solid #f4b578;
  border-radius: 999px;
  background: #ffe3c4;
  color: #8b3605;
  font-size: .875rem;
  font-weight: 600;
  white-space: nowrap;
}
.saved-list-remaining b { font-weight: 700; font-variant-numeric: tabular-nums; }
.saved-list-delete {
  position: absolute;
  inset-inline-end: .65rem;
  top: 50%;
  width: 2.75rem;
  min-height: 2.75rem;
  padding: 0;
  transform: translateY(-50%);
}
.list-detail { width: min(100%, 53rem); margin-inline: auto; }
.list-detail .screen-top > div { min-width: 0; }
.list-detail .list-date { margin-block-start: .25rem; }
.saved-list-actions { display: flex; flex-wrap: wrap; gap: .55rem; }
.print-list-button {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  min-height: 2.85rem;
  padding-inline: .78rem;
  border: 1px solid #cadbca;
  border-radius: .72rem;
  background: var(--white);
  color: var(--green-dark);
  font-weight: 600;
  white-space: nowrap;
}
.print-list-button:hover { background: var(--sage); }
.print-list-button .icon { width: 1.1rem; height: 1.1rem; }
.list-delete-button { min-height: 2.85rem; padding-inline: .78rem; white-space: nowrap; }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: .32rem;
  min-height: 2.75rem;
  margin-block-end: .45rem;
  color: var(--green-dark);
  font-weight: 600;
  text-underline-offset: .2em;
}
.back-link .icon { width: 1rem; height: 1rem; }

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 21rem;
  align-items: start;
  gap: 1.6rem;
}
.catalog { min-width: 0; }
.workspace:not(.has-basket) { grid-template-columns: minmax(0, 1fr); }
.create-product { padding-inline: .8rem; white-space: nowrap; }
.create-product .icon { width: 1.1rem; height: 1.1rem; }
.search-box {
  position: relative;
  display: flex;
  align-items: center;
  gap: .55rem;
  width: min(100%, 27rem);
  min-width: 0;
  min-height: 2.9rem;
  padding-inline: .8rem .2rem;
  border: 1px solid var(--line);
  border-radius: .8rem;
  background: var(--white);
  color: var(--muted);
}
.search-box:focus-within { border-color: #70a583; box-shadow: 0 0 0 3px #e2eee3; }
.search-box input {
  width: 100%;
  min-width: 0;
  padding: .45rem 0;
  padding-inline-end: 2.2rem;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
}
.search-box input::placeholder { color: #637066; opacity: 1; }
.search-box input::-webkit-search-cancel-button { display: none; }
.search-clear { position: absolute; inset-inline-end: .15rem; }

.category-tile-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .8rem;
  margin-block-start: 1.05rem;
}
.category-tile {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: .92rem;
  background: var(--white);
  box-shadow: var(--shadow);
  text-decoration: none;
}
.category-tile:hover { border-color: #94b59a; box-shadow: 0 .32rem .9rem #28432a18; }
.category-tile-photos {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, .65fr);
  grid-template-rows: repeat(2, minmax(0, 1fr));
  aspect-ratio: 1.55;
  gap: .15rem;
  padding: .28rem .33rem;
}
.category-tile-photos img { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.category-tile-photos img:first-child, .category-tile-photos[data-photo-count="2"] img:last-child { grid-row: span 2; }
.category-tile-photos[data-photo-count="1"] { grid-template-columns: minmax(0, 1fr); }
.category-tile-photos[data-photo-count="0"] { display: grid; place-items: center; grid-template: 1fr / 1fr; color: var(--category-ink, var(--green)); }
.category-tile-photos > .icon { width: 2.8rem; height: 2.8rem; }
.category-tile-label {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: .32rem;
  min-height: 3.1rem;
  padding: .46rem .64rem;
  background: var(--category-bg, #e9f1e7);
  color: var(--ink);
  font-size: .98rem;
  line-height: 1.3;
}
.category-tile-label .icon { width: .85rem; height: .85rem; color: var(--category-ink, var(--green)); }
.catalog-back {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  min-height: 3.12rem;
  margin: 0 auto .95rem;
  padding: .42rem .8rem;
  border: 1px solid #bbd2bd;
  border-radius: .8rem;
  background: var(--white);
  color: var(--green-dark);
  font-weight: 700;
  box-shadow: var(--shadow);
}
.catalog-back:hover { background: var(--sage); }
.catalog-back-icons {
  display: inline-flex;
  align-items: center;
  gap: .22rem;
  padding: .34rem .43rem;
  border-radius: .5rem;
  background: var(--green);
  color: var(--white);
}
.catalog-back-icons .icon { width: 1.15rem; height: 1.15rem; }
#catalog-items > .category-section:first-child, #catalog-items > .no-results { margin-block-start: .88rem; }
.category-filter {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: .32rem;
  min-height: 2.5rem;
  padding: .32rem .64rem;
  border: 1px solid var(--line);
  border-radius: 2rem;
  background: var(--white);
  color: #405447;
  font-weight: 600;
  font-size: .875rem;
  line-height: 1.1;
  white-space: nowrap;
}
.category-filter .icon { width: 1.05rem; height: 1.05rem; }
.category-filter:hover { border-color: #aac7ad; color: var(--green-dark); }
.category-filter[aria-pressed="true"] { border-color: var(--green); background: var(--green); color: var(--white); }

.category-section + .category-section { margin-block-start: 1.68rem; }
.category-title { display: flex; align-items: center; gap: .58rem; margin-block-end: .72rem; }
.category-title h2 { min-width: 0; font-size: 1.25rem; line-height: 1.3; font-weight: 700; }
.category-title .category-icon {
  display: grid;
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border-radius: .62rem;
  background: var(--category-bg, #e6efe2);
  color: var(--category-ink, #326449);
}
.category-title .icon { width: 1.14rem; height: 1.14rem; }
.category-total { margin-inline-start: auto; font-size: .875rem; color: var(--muted); white-space: nowrap; }
.reorder-products {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: .3rem;
  min-height: 2.75rem;
  padding-inline: .56rem;
  border: 1px solid var(--line);
  border-radius: .65rem;
  background: var(--white);
  color: var(--green-dark);
  font-size: .875rem;
  font-weight: 600;
  white-space: nowrap;
}
.reorder-products:hover { background: var(--sage); border-color: #c6d9c7; }
.is-ordering .category-toolbar {
  position: sticky;
  inset-block-start: 0;
  z-index: 2;
  margin-block-end: .72rem;
  padding: .48rem .6rem;
  border: 1px solid #dbe7da;
  border-radius: .85rem;
  background: #f7faf4;
  box-shadow: var(--shadow);
}
.is-ordering .category-title { margin-block-end: .3rem; }
.category-order-actions { display: flex; flex: 0 0 auto; gap: .36rem; margin-inline-start: auto; }
.category-order-actions button { min-height: 2.75rem; padding-inline: .65rem; white-space: nowrap; }
.category-order-help { color: var(--muted); font-size: .875rem; }
[data-category="fruit"] { --category-bg: #f4eae4; --category-ink: #9c493d; }
[data-category="dairy"] { --category-bg: #e6edf3; --category-ink: #38627e; }
[data-category="meat"] { --category-bg: #f3e5e8; --category-ink: #8d4255; }
[data-category="pantry"], [data-category="pantry-spices"], [data-category="bakery"] { --category-bg: #f4ecdc; --category-ink: #845d30; }
[data-category="drinks"] { --category-bg: #e3eeec; --category-ink: #34675d; }
[data-category="home"], [data-category="personal"] { --category-bg: #ece8f4; --category-ink: #6a4e88; }
[data-category="cleaning"], [data-category="pharmacy"] { --category-bg: #e6edf3; --category-ink: #38627e; }

.product-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; }
.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  padding: .48rem;
  border: 1px solid #e5e9e1;
  border-radius: 1.04rem;
  background: var(--white);
  box-shadow: 0 2px 5px rgb(22 42 30 / 3%);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.product-card:hover { border-color: #b8d0b7; box-shadow: var(--shadow); }
.product-photo {
  display: grid;
  place-items: center;
  aspect-ratio: 1.38;
  overflow: hidden;
  border-radius: .72rem;
  background: #fff;
}
.product-photo img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  object-position: center;
}
.product-photo-add { position: relative; width: 100%; padding: 0; border: 0; }
.product-photo-add[aria-disabled="true"] { cursor: default; }
.product-photo-add[aria-disabled="true"]::before {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgb(127 198 138 / 24%);
  box-shadow: inset 0 0 0 2px #5c9b69;
  pointer-events: none;
  content: '';
}
.product-photo-check {
  position: absolute;
  inset-block-start: .35rem;
  inset-inline-start: .35rem;
  display: none;
  width: 1.75rem;
  height: 1.75rem;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: var(--white);
  pointer-events: none;
}
.product-photo-add[aria-disabled="true"] .product-photo-check { display: grid; }
.product-photo-check .icon { width: 1.05rem; height: 1.05rem; stroke-width: 2.4; }
.photo-placeholder {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  background: var(--surface);
  color: #87958b;
}
.product-photo .photo-placeholder .icon { width: 1.85rem; height: 1.85rem; }
.edit-product {
  position: absolute;
  inset-block-start: .65rem;
  inset-inline-end: .65rem;
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: .6rem;
  background: var(--white);
  color: var(--green-dark);
}
.edit-product:hover { background: var(--sage); }
.edit-product .icon { width: .95rem; height: .95rem; }
.product-info {
  display: flex;
  flex: 1;
  justify-content: space-between;
  align-items: center;
  gap: .37rem;
  min-height: 3.4rem;
  padding: .4rem .25rem 0;
}
.product-copy { min-width: 0; }
.product-name { font-size: 1rem; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.product-detail { display: block; margin-block-start: .13rem; color: var(--muted); font-size: .875rem; line-height: 1.25; overflow-wrap: anywhere; }
.add-button {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 2.45rem;
  height: 2.45rem;
  padding: 0;
  border: 1px solid transparent;
  border-radius: .69rem;
  background: var(--sage);
  color: var(--green);
}
.add-button .icon { width: 1.2rem; height: 1.2rem; stroke-width: 2.1; }
.add-button:hover { background: #dceadb; }
.add-button[data-action="show-item"] { background: var(--green); color: var(--white); }
.add-button[data-action="show-item"]:hover { background: var(--green-dark); }
.no-results {
  display: grid;
  gap: .5rem;
  justify-items: center;
  padding: 2.4rem .8rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--white);
  color: var(--muted);
  text-align: center;
}
.no-results p:first-child { color: var(--ink); font-weight: 700; }

.sidebar { position: sticky; top: 1rem; min-width: 0; }
.list-panel {
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 2rem);
  padding: 1.15rem;
  border: 1px solid var(--line);
  border-radius: 1.18rem;
  background: var(--white);
  box-shadow: var(--shadow);
}
.list-heading { display: flex; align-items: center; gap: .65rem; margin-block-end: .8rem; }
.list-heading h2 { min-width: 0; font-size: 1.29rem; font-weight: 700; overflow-wrap: anywhere; }
.list-heading-icon {
  display: grid;
  flex: 0 0 auto;
  width: 2.5rem;
  height: 2.5rem;
  place-items: center;
  border-radius: .8rem;
  background: var(--sage);
  color: var(--green);
}
.saved-list-panel { max-height: none; }
.saved-list-panel .shopping-item { padding: .5rem .68rem; }
.saved-list-panel .progress-wrap { margin-block-start: 0; }
.shopping-group + .shopping-group { margin-block-start: 1.02rem; }
.shopping-group-title {
  display: flex;
  align-items: center;
  gap: .46rem;
  margin-block-end: .35rem;
  padding: .48rem .66rem;
  border-radius: .58rem;
  background: var(--sage);
  color: var(--green-dark);
  font-size: 1.09rem;
  font-weight: 700;
}
.shopping-group-title .icon { width: 1.12rem; height: 1.12rem; }
.shopping-item.ready-shopping-item {
  grid-template-columns: minmax(0, 1.15fr) minmax(max-content, 1fr);
  column-gap: .75rem;
}
.ready-shopping-item .item-thumb { width: 4.35rem; height: 3.75rem; }
.ready-quantity {
  justify-self: start;
  padding: .22rem .55rem;
  border-radius: .45rem;
  background: var(--sage);
  color: var(--green-dark);
  font-size: .96rem;
  white-space: nowrap;
}
.purchased-items {
  margin-block-start: 1.35rem;
  padding-block-start: 1rem;
  border-block-start: 1px solid var(--line);
}
.purchased-items-title, .shopping-list-complete {
  display: flex;
  align-items: center;
  gap: .45rem;
  color: var(--green-dark);
  font-weight: 700;
}
.purchased-items-title { margin-block-end: .65rem; font-size: 1.25rem; }
.shopping-list-complete { padding: .65rem .3rem 0; }
.purchased-items .shopping-group-title { background: var(--surface); color: var(--muted); }
.week-picker {
  display: grid;
  grid-template-columns: 2.4rem minmax(0, 1fr) 2.4rem;
  align-items: center;
  gap: .12rem;
  min-height: 2.8rem;
  padding: .08rem .15rem;
  border: 1px solid var(--line);
  border-radius: .67rem;
  background: var(--surface);
}
.week-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  font-size: .875rem;
  font-weight: 600;
  text-align: center;
}
.week-label .icon { width: .95rem; height: .95rem; color: var(--green); }
.icon-button {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  padding: 0;
  border: 0;
  border-radius: .53rem;
  background: transparent;
  color: var(--muted);
}
.icon-button:hover { background: var(--sage); color: var(--green-dark); }
.icon-button .icon { width: 1rem; height: 1rem; }
.progress-wrap { margin-block: .88rem .7rem; }
.progress-label { display: flex; justify-content: space-between; color: var(--muted); font-size: .875rem; }
.progress-label strong { color: var(--green-dark); font-weight: 600; }
.progress-track {
  display: block;
  width: 100%;
  height: .38rem;
  overflow: hidden;
  margin-block-start: .38rem;
  border: 0;
  border-radius: 1rem;
  appearance: none;
  background: #edf1e9;
  color: #4b895e;
}
.progress-track::-webkit-progress-bar { background: #edf1e9; border-radius: 1rem; }
.progress-track::-webkit-progress-value { background: #4b895e; border-radius: 1rem; }
.progress-track::-moz-progress-bar { background: #4b895e; border-radius: 1rem; }

.sidebar-rows, .dialog-rows { min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.empty-list {
  display: grid;
  justify-items: center;
  gap: .22rem;
  padding: 1.18rem .4rem 1.25rem;
  color: var(--muted);
  text-align: center;
}
.empty-list .empty-icon {
  display: grid;
  width: 3.6rem;
  height: 3.6rem;
  margin-block-end: .34rem;
  place-items: center;
  border-radius: 50%;
  background: #eef4eb;
  color: #568062;
}
.empty-icon .icon { width: 1.8rem; height: 1.8rem; stroke-width: 1.45; }
.empty-list strong { color: var(--ink); font-size: 1rem; font-weight: 700; }
.empty-list p { max-width: 16rem; font-size: .875rem; }
.shopping-items { display: grid; gap: .36rem; margin: 0; padding: .12rem .15rem .3rem; list-style: none; }
.shopping-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 2.55rem;
  align-items: center;
  column-gap: .18rem;
  min-width: 0;
  padding: .28rem .26rem;
  border: 1px solid var(--line);
  border-radius: .68rem;
  background: var(--white);
}
.shopping-item:has(input:checked) { background: var(--surface); }
.shopping-label {
  display: flex;
  align-items: center;
  gap: .45rem;
  min-width: 0;
  min-height: 2.65rem;
  padding: .18rem .1rem;
  cursor: pointer;
}
.shopping-label:hover { color: var(--green); }
.basket-item-label { cursor: default; }
.basket-item-label:hover { color: inherit; }
.check-box {
  position: relative;
  flex: 0 0 auto;
  width: 1.35rem;
  height: 1.35rem;
  margin: 0;
  border: 1.5px solid #8fa697;
  border-radius: .36rem;
  appearance: none;
  background: var(--white);
  cursor: pointer;
}
.check-box:checked { border-color: var(--green); background: var(--green); }
.check-box:checked::after {
  position: absolute;
  inset: .16rem .42rem auto auto;
  width: .36rem;
  height: .65rem;
  border: solid var(--white);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  content: '';
}
.item-thumb {
  flex: 0 0 auto;
  width: 2.65rem;
  height: 2.25rem;
  object-fit: contain;
  border-radius: .4rem;
  background: #f7f6f1;
}
.item-thumb .icon { width: 1.1rem; height: 1.1rem; }
.item-copy { min-width: 0; }
.item-name { display: block; font-weight: 600; font-size: .96rem; line-height: 1.3; overflow-wrap: anywhere; }
.check-box:checked ~ .item-copy .item-name,
.check-box:checked ~ .item-copy .product-detail {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}
.remove-button { margin-inline-start: auto; }
.remove-button:hover { background: #f8eae7; color: #a03930; }
.quantity {
  display: flex;
  align-items: center;
  gap: .18rem;
  margin-inline-start: 1.9rem;
  color: var(--muted);
  font-size: .875rem;
}
.quantity .icon-button { width: 2.15rem; height: 2.05rem; }
.quantity .icon-button:disabled { opacity: .36; background: none; color: inherit; }
.quantity b { min-width: 2.7rem; color: var(--ink); text-align: center; font-weight: 600; }
.quantity .icon { width: .9rem; height: .9rem; }
.quantity-measured { grid-column: 1 / -1; flex-wrap: wrap; gap: .4rem; }
.quantity-stepper { display: flex; align-items: center; gap: .22rem; }
.quantity-measured .icon-button {
  width: 2.45rem;
  height: 2.75rem;
  background: var(--sage);
  color: var(--green);
}
.quantity-measured .icon-button:hover:not(:disabled) { background: #dceadb; }
.quantity-input, .quantity-unit {
  min-height: 2.75rem;
  border: 1px solid #cfdcd1;
  border-radius: .53rem;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
}
.quantity-input { width: 3rem; min-width: 0; padding-inline: .12rem; text-align: center; font-weight: 600; }
.quantity-unit { min-width: 4.7rem; max-width: 100%; padding-inline: .45rem; cursor: pointer; }
.product-quantity { margin-block-start: .35rem; padding: .38rem .15rem .15rem; border-block-start: 1px solid var(--line); }
.product-quantity .quantity { margin-inline-start: 0; }
.product-quantity .quantity-stepper {
  display: grid;
  flex: 1 1 8rem;
  grid-template-columns: minmax(0, 2.75rem) minmax(2.5rem, 1fr) minmax(0, 2.75rem);
}
.product-quantity .quantity-stepper > * { width: 100%; }
.product-quantity .quantity-unit { flex: 1 1 4.7rem; }

.primary-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 2.8rem;
  border: 0;
  border-radius: .72rem;
  background: var(--green);
  color: var(--white);
  font-weight: 600;
}
.primary-button:hover { background: var(--green-dark); }
.primary-button:disabled { background: #eaf1e8; color: #5e725f; }
.create-list-button {
  gap: .65rem;
  min-height: 3.55rem;
  padding: .4rem .8rem;
  border: 1px solid #ba7a21;
  border-radius: .85rem;
  background: #f7b84e;
  color: #332313;
  font-size: 1.08rem;
  font-weight: 700;
}
[data-page="lists"] .create-list-button {
  width: min(100%, 12rem);
  margin: 0 auto 1.15rem;
  transform: translateX(-1rem);
}
.create-list-button:hover { background: #efa932; }
.create-list-button:focus-visible { outline-color: #925412; }
.create-list-icon {
  display: grid;
  flex: 0 0 auto;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  border-radius: .55rem;
  background: #fff0cc;
  color: #6f3e08;
}
.create-list-icon .icon { width: 1.5rem; height: 1.5rem; }
.basket-save { flex: 0 0 auto; margin-block-start: .65rem; width: 100%; }
#sidebar-list .quantity, #dialog-list .quantity { margin-inline-start: .2rem; }

.mobile-list-bar { display: none; }
.shopping-dialog {
  position: fixed;
  inset: 0;
  width: min(100% - 2rem, 33rem);
  max-height: calc(100dvh - 2rem);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 1.23rem;
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 20px 80px rgb(16 40 25 / 22%);
}
.shopping-dialog::backdrop { background: rgb(18 35 26 / 55%); backdrop-filter: blur(3px); }
.dialog-inner { display: flex; flex-direction: column; max-height: calc(100dvh - 2rem - 2px); padding: 1.1rem; }
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-block-end: .8rem; }
.dialog-header .list-heading { margin: 0; }
.close-dialog { border: 1px solid var(--line); background: var(--surface); }
.dialog-rows .shopping-item { padding: .35rem .5rem; }
.dialog-rows .shopping-label { gap: .62rem; min-height: 3rem; }
.dialog-rows .check-box { width: 1.48rem; height: 1.48rem; }
.dialog-rows .check-box:checked::after { inset-inline-start: .49rem; }
.dialog-rows .item-name { font-size: 1.055rem; }
.dialog-rows .item-thumb { width: 3.3rem; height: 2.7rem; }
.dialog-rows .quantity .icon-button { min-width: 2.45rem; min-height: 2.4rem; }

.product-editor, .list-editor { max-width: 28rem; }
.list-editor .editor-error { margin-block-start: .42rem; }
.delete-list-message { overflow-wrap: anywhere; }
.editor-fields { display: grid; gap: .85rem; min-height: 0; overflow: auto; padding: .2rem; }
.editor-field { display: grid; gap: .32rem; min-width: 0; font-weight: 600; }
.editor-field small { margin-inline-start: .25rem; color: var(--muted); font-size: .875rem; font-weight: 400; }
.editor-field input, .editor-field select {
  width: 100%;
  min-height: 2.8rem;
  padding: .45rem .65rem;
  border: 1px solid #cfdcd1;
  border-radius: .65rem;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 400;
}
.editor-field select {
  appearance: none;
  padding-inline-end: 2rem;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23256144' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat left .65rem center;
}
.editor-field input[type="file"] { font-size: .9rem; }
.editor-field input::file-selector-button {
  margin-inline-end: .65rem;
  padding: .2rem .45rem;
  border: 0;
  border-radius: .4rem;
  background: var(--sage);
  color: var(--green-dark);
  font: inherit;
  cursor: pointer;
}
.editor-preview {
  display: grid;
  place-items: center;
  height: 7.2rem;
  padding: .35rem;
  border: 1px solid var(--line);
  border-radius: .65rem;
  background: var(--surface);
}
.editor-preview img { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.editor-error { color: #9c372a; font-size: .9rem; }
.editor-actions { display: flex; flex: 0 0 auto; gap: .55rem; margin-block-start: .9rem; }
.editor-actions button { min-height: 2.8rem; padding-inline: .76rem; }
.editor-save { flex: 1; }
.editor-delete, .editor-cancel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .36rem;
  border: 1px solid #efd7d2;
  border-radius: .72rem;
  background: #fff5f3;
  color: #933729;
  font-weight: 600;
}
.editor-delete .icon { width: 1rem; height: 1rem; }
.editor-delete:hover { background: #f8e6e1; }
.editor-confirm {
  flex: 0 0 auto;
  margin-block-start: .85rem;
  padding: .75rem;
  border: 1px solid #efd7d2;
  border-radius: .72rem;
  background: #fff8f6;
}
.editor-confirm .editor-actions { margin-block-start: .65rem; }
.editor-confirm button { flex: 1; }
.confirm-delete { border-color: #a13a2c; background: #a13a2c; color: var(--white); }
.confirm-delete:hover { background: #853023; }
.editor-cancel { border-color: var(--line); background: var(--white); color: var(--ink); }
.editor-cancel:hover { background: var(--surface); }
.editor-delete:disabled, .editor-cancel:disabled { opacity: .55; }

.order-photo {
  position: relative;
  width: 100%;
  padding: 0;
  border: 0;
  outline-offset: -3px;
  touch-action: none;
  user-select: none;
  cursor: grab;
}
.order-photo:active { cursor: grabbing; }
.order-grip {
  position: absolute;
  inset-block-start: .22rem;
  inset-inline-end: .22rem;
  display: grid;
  place-items: center;
  width: 1.8rem;
  height: 1.8rem;
  border: 1px solid #dbe7da;
  border-radius: .5rem;
  background: #f5f9f3;
  color: var(--green);
}
.order-grip .icon { width: 1.1rem; height: 1.1rem; }
.is-ordering .product-card { border-style: dashed; border-color: #c4d8c5; }
.is-ordering .product-card:has(.order-photo[aria-pressed="true"]),
.is-ordering .product-card.is-order-target {
  border-style: solid;
  outline: 2px solid #4b895e;
  outline-offset: 1px;
}
.product-card.is-order-dragging { opacity: .42; }
.product-card.order-drag-ghost {
  position: fixed;
  z-index: 12;
  top: 0;
  left: 0;
  margin: 0;
  border-color: #99b99e;
  box-shadow: 0 10px 24px rgb(22 42 30 / 21%);
  pointer-events: none;
}

.toast-region {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .85rem;
  max-width: 25rem;
  padding: .6rem .9rem;
  border-radius: .72rem;
  background: #203f31;
  color: #fff;
  font-size: .94rem;
}
.page-toast { position: fixed; z-index: 4; inset-inline-end: 1.5rem; inset-block-end: 1.35rem; }
.toast-region button {
  flex: 0 0 auto;
  min-height: 2rem;
  padding: .15rem .38rem;
  border: 0;
  border-radius: .4rem;
  background: #dbeadd;
  color: #204833;
  font-weight: 700;
}
.toast-region button:focus-visible { outline-color: #fff; }
.dialog-inner .toast-region { margin-block-start: .55rem; }
.toast-region[data-urgency="warning"] { background: #783626; }

@media (max-width: 1120px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 18.8rem; gap: 1.1rem; }
  .product-grid, .category-tile-grid { gap: .65rem; }
  .product-info { padding-inline: .08rem; }
}

@media (max-width: 965px) {
  .layout { width: calc(100% - 2.5rem); }
  .product-grid, .category-tile-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 790px) {
  .workspace { display: block; }
  .home-card { gap: .65rem; padding: .9rem; }
  .home-cards { gap: .65rem; }
  .sidebar, .header-list { display: none; }
  .header-inner { min-height: 3.8rem; }
  .wordmark { font-size: 1.27rem; }
  .brand-mark { width: 2.3rem; height: 2.3rem; }
  [data-shopping-page="products"].has-basket .main-layout { padding-block-end: 4.7rem; }
  .hero { min-height: 12.5rem; }
  .product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .mobile-list-bar {
    position: fixed;
    z-index: 3;
    display: block;
    inset: auto 0 0;
    padding: .65rem 1rem calc(.65rem + env(safe-area-inset-bottom, 0px));
    border-block-start: 1px solid var(--line);
    background: var(--white);
    box-shadow: 0 -3px 24px rgb(18 35 26 / 6%);
  }
  .mobile-list-bar button { width: min(100%, 27rem); min-height: 2.95rem; margin-inline: auto; }
  .mobile-list-bar .list-badge { background: #d8e9d9; margin-inline-start: .15rem; }
  .page-toast { inset-inline: 1rem auto; width: max-content; max-width: calc(100% - 2rem); }
  [data-shopping-page="products"].has-basket .page-toast { inset-block-end: calc(4.8rem + env(safe-area-inset-bottom, 0px)); }
}

@media (max-width: 560px) {
  .layout { width: calc(100% - 2rem); }
  .main-layout { padding-block-start: 1rem; }
  .header-inner { flex-wrap: wrap; }
  .wordmark { min-height: 3.8rem; }
  .section-nav { justify-content: space-between; width: 100%; margin-block-end: .4rem; }
  .section-nav a { padding-inline: .42rem; font-size: .92rem; }
  .home-cards { grid-template-columns: 1fr; margin-block-start: .75rem; }
  .home-card { min-height: 5.65rem; }
  .saved-list-link { gap: .6rem; padding-inline-start: .75rem; }
  .saved-list-link .home-card-icon { width: 2.55rem; height: 2.55rem; }
  .list-picker { display: grid; width: 100%; gap: .2rem; }
  .list-picker select { width: 100%; }
  .catalog-create-actions { gap: .42rem; }
  .catalog-create-actions .primary-button {
    min-width: 0;
    gap: .35rem;
    padding-inline: .5rem;
    font-size: .95rem;
    line-height: 1.25;
    white-space: normal;
  }
  .catalog-create-actions .create-list-icon { width: 1.75rem; height: 1.75rem; }
  .catalog-create-actions .create-list-icon .icon { width: 1.25rem; height: 1.25rem; }
  .saved-list-panel { padding: .75rem; }
  .shopping-item.ready-shopping-item {
    grid-template-columns: minmax(0, 1.55fr) minmax(max-content, 1fr);
    column-gap: .5rem;
  }
  .ready-shopping-item .item-thumb { width: 3.6rem; height: 3.15rem; }
  .hero { min-height: 11.2rem; padding: 1rem 1.05rem; border-radius: 1.17rem; background-position: left center; }
  .hero::before { background: linear-gradient(270deg, rgb(8 32 22 / 96%) 7%, rgb(8 32 22 / 87%) 38%, rgb(8 32 22 / 32%) 67%, transparent 87%); }
  .hero-copy { max-width: 72%; }
  .hero h1 { font-size: clamp(1.7rem, 8vw, 2.6rem); }
  .search-box { width: 100%; }
  .category-filter { min-height: 2.62rem; padding-inline: .68rem; }
  .category-title h2 { font-size: 1.17rem; }
  .category-title { column-gap: .38rem; }
  .reorder-products { padding-inline: .4rem; }
  .reorder-products .icon { width: .95rem; height: .95rem; }
  .category-order-actions button { padding-inline: .48rem; font-size: .875rem; }
  .product-grid, .category-tile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .62rem; }
  .category-tile-label { font-size: .94rem; }
  .product-photo { aspect-ratio: 1.25; }
  .add-button { width: 2.75rem; height: 2.75rem; }
  .edit-product { width: 2.75rem; height: 2.75rem; }
  .shopping-dialog {
    inset: auto 0 0;
    width: 100%;
    max-width: none;
    max-height: 93dvh;
    margin: 0;
    border-radius: 1.25rem 1.25rem 0 0;
  }
  .dialog-inner { max-height: calc(93dvh - 2px); padding: .92rem 1rem calc(.95rem + env(safe-area-inset-bottom, 0px)); }
  .dialog-inner .icon-button { min-width: 2.75rem; min-height: 2.75rem; }
  .dialog-inner .quantity-measured .icon-button { min-width: 2.75rem; min-height: 2.75rem; }
  .dialog-inner .week-picker { grid-template-columns: 2.75rem minmax(0, 1fr) 2.75rem; }
  .product-editor, .list-editor { max-width: none; }
}

@page shopping-list { size: A4; margin: 14mm; }

@media print {
  body[data-shopping-page="list"] { page: shopping-list; min-width: 0; background: #fff; color: #111; }
  body[data-shopping-page="list"] > :not(main):not(.icon-library),
  body[data-shopping-page="list"] main > :not(.list-detail),
  .list-detail [data-no-print] { display: none !important; }
  body[data-shopping-page="list"] .main-layout, .list-detail { width: 100%; margin: 0; padding: 0; }
  .list-detail .screen-top h1 { font-size: 21pt; }
  .list-detail .list-date { color: #333; font-size: 10pt; }
  .saved-list-panel { display: block; max-height: none; padding: 0; border: 0; box-shadow: none; }
  .purchased-items-title { break-after: avoid; color: #111; }
  .shopping-group-title, .purchased-items .shopping-group-title { break-after: avoid; padding-inline: .3rem; border-block-end: 1px solid #555; background: #fff; color: #111; font-size: 12pt; }
  .shopping-group-title .icon, .ready-shopping-item .item-thumb { display: none; }
  .shopping-group .shopping-items { display: block; padding: 0; }
  .saved-list-panel .ready-shopping-item { break-inside: avoid; padding: .12rem .3rem; border: 0; border-block-end: 1px solid #dadada; border-radius: 0; background: #fff; }
  .ready-shopping-item .shopping-label { min-height: 1.75rem; }
  .ready-shopping-item .check-box { border-color: #555; background: #fff; }
  .ready-shopping-item .check-box:checked::after { border-color: #111; }
  .ready-quantity { background: #fff; color: #111; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; scroll-behavior: auto !important; }
}
