:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #23362b;
  background: #f4f5ef;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
a { color: #176145; }
button, input, select, textarea { font: inherit; }
button, .button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 15px;
  border: 1px solid #176145;
  border-radius: 9px;
  background: #176145;
  color: #fff;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}
button:hover, .button:hover { background: #104b35; }
button.secondary, .button.secondary { border-color: #ccd7cc; background: #fff; color: #294235; }
button.danger { border-color: #a83c36; background: #fff; color: #a12c28; }
input, select, textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid #cbd4ca;
  border-radius: 8px;
  background: #fff;
  color: #23362b;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible {
  outline: 3px solid #9bcab0;
  outline-offset: 2px;
}
label { display: grid; gap: 6px; color: #334b3d; font-size: .88rem; font-weight: 650; }
.remember { display: flex; align-items: center; gap: 10px; }
.remember input { width: auto; min-height: auto; }
.product-illustration { margin: 0 0 12px; width: 148px; max-width: 100%; }
.product-art { display: block; width: 100%; height: auto; }
small, .muted { color: #6b7a70; }
.shell { min-height: 100vh; }
.topbar {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px max(22px, calc((100vw - 1200px) / 2));
  background: #164d38;
  color: #fff;
}
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid #ffffff70;
  border-radius: 13px;
  font-size: 1.2rem;
}
.brand strong { display: block; font-size: 1.05rem; }
.brand small { display: block; margin-top: 2px; color: #d4e7d9; }
.public-brand { color: #164d38; margin-bottom: 22px; }
.public-brand small { color: #526557; }
.newsletter-trap { display: none; }
.order-handle { touch-action: none; cursor: grab; margin-top: 10px; }
.order-handle:active { cursor: grabbing; }
.is-dragging { background: #e8f3eb; outline: 2px solid #176145; }
.order-fallback { margin-top: 8px; }
.account { display: flex; align-items: center; gap: 12px; color: #e2eee5; font-size: .9rem; }
.account form { margin: 0; }
.account button { min-height: 36px; padding: 6px 11px; border-color: #ffffff70; background: transparent; }
.layout { width: min(1200px, calc(100% - 36px)); margin: 28px auto 64px; }
.welcome { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 0 0 20px; }
h1 { margin: 0 0 5px; font-size: clamp(1.65rem, 4vw, 2rem); letter-spacing: -.03em; }
h2 { margin: 0 0 15px; font-size: 1.12rem; }
p { line-height: 1.55; }
.eyebrow { margin: 0 0 5px; color: #527360; font-size: .77rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.card {
  margin: 0 0 18px;
  padding: 21px;
  border: 1px solid #e0e6de;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 5px 20px #203c2d08;
}
.flash { padding: 13px 16px; border: 1px solid #bad7c4; border-radius: 10px; background: #eaf6ee; }
.flash.error { border-color: #e5b7b2; background: #fff0ed; color: #802e2a; }
.notice { padding: 13px 16px; border: 1px solid #ecdcae; border-radius: 10px; background: #fff8df; color: #624e1e; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 19px; }
.tabs a { padding: 9px 13px; border: 1px solid #d7dfd5; border-radius: 999px; background: #fff; color: #44574b; font-size: .9rem; text-decoration: none; }
.tabs a[aria-current="page"] { border-color: #176145; background: #e8f3eb; color: #145439; font-weight: 700; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 16px 0 20px; }
.stat { padding: 16px; border: 1px solid #e0e7de; border-radius: 12px; background: #fbfcf9; }
.stat strong { display: block; font-size: 1.4rem; }
.stat span { color: #65756a; font-size: .84rem; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid .wide { grid-column: 1 / -1; }
.form-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 15px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin: 0 0 14px; }
.toolbar label { min-width: 180px; flex: 1; }
.table-wrap { overflow-x: auto; border: 1px solid #e1e7df; border-radius: 10px; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: 11px 12px; border-bottom: 1px solid #e7ece5; text-align: left; vertical-align: top; font-size: .88rem; }
th { background: #f5f8f3; color: #526557; font-size: .78rem; letter-spacing: .02em; }
tr:last-child td { border-bottom: 0; }
.product-name { min-width: 190px; font-weight: 700; }
.product-name small { display: block; margin-top: 3px; font-weight: 400; }
.pill { display: inline-block; padding: 4px 8px; border-radius: 99px; background: #eef2ec; color: #4f6254; font-size: .76rem; white-space: nowrap; }
.pill.good { background: #e4f3e8; color: #1f6845; }
.pill.pending { background: #fff5d7; color: #735c1c; }
.thumb { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; background: #f1f3ef; }
.login { width: min(520px, calc(100% - 32px)); margin: 10vh auto; }
.login .brand { margin-bottom: 25px; color: #164d38; }
.login .brand small { color: #687a6e; }
.login form { display: grid; gap: 15px; }
.footnote { margin: 14px 0 0; font-size: .84rem; }
.empty { padding: 28px 12px; color: #6b7a70; text-align: center; }
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.inline-form input, .inline-form select { width: auto; min-width: 90px; }
.inline-form button { min-height: 36px; padding: 6px 10px; }
.footer { padding-top: 20px; color: #738078; font-size: .8rem; text-align: center; }
.mobile-catalogue-link, .catalogue-mobile-label { display: none; }
.list-add { display: grid; gap: 8px; margin-top: 12px; max-width: 260px; }
.list-add label { font-size: .8rem; }
.shopping-list-page { max-width: 760px; }
.shopping-list-page > .form-actions { margin-bottom: 18px; }
.list-items { list-style: none; margin: 0; padding: 0; }
.list-items li { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 14px 0; border-bottom: 1px solid #e0e7de; }
.list-items li > div { min-width: 0; overflow-wrap: anywhere; }
.list-items li > strong { flex-shrink: 0; }
.list-items small, .list-items span { display: block; margin-top: 4px; }
.list-total { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: 1.25rem; color: #145439; }
.list-editor { margin-top: 20px; }
.list-editor summary { cursor: pointer; font-weight: 700; }
.list-edit-row { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; padding: 16px 0; border-bottom: 1px solid #e0e7de; margin-bottom: 14px; }
.list-edit-row label { flex: 1 1 100%; overflow-wrap: anywhere; }
.list-edit-row input { max-width: 110px; }

@media (max-width: 720px) {
  body { min-width: 0; }
  .topbar { align-items: flex-start; padding: 13px 17px; }
  .account { flex-direction: column; align-items: flex-end; gap: 5px; font-size: .78rem; }
  .layout { width: min(100% - 24px, 1200px); margin-top: 20px; }
  .card { padding: 16px; }
  .welcome { align-items: flex-start; flex-direction: column; }
  .stats { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr; }
  .grid .wide { grid-column: auto; }
  .table-wrap { margin-right: -4px; }
  .public-brand .brand-mark { flex-shrink: 0; }
  .welcome > .button { width: 100%; min-height: 48px; }
  .mobile-catalogue-link { display: flex; }
  .catalogue { scroll-margin-top: 16px; }
  .catalogue h2 { font-size: 1.45rem; color: #164d38; }
  .catalogue .toolbar { padding: 14px; border-radius: 10px; background: #e8f3eb; }
  .catalogue .toolbar label { min-width: 0; flex-basis: 100%; }
  .catalogue .toolbar input, .catalogue .toolbar select { min-height: 48px; font-size: 1rem; }
  .catalogue .toolbar button { width: 100%; min-height: 48px; background: #176145; border-color: #176145; color: #fff; }
  .catalogue .toolbar > a { display: inline-flex; align-items: center; min-height: 44px; }
  .catalogue .table-wrap { overflow: visible; margin: 0; border: 0; border-radius: 0; }
  .catalogue table { display: block; background: transparent; }
  /* Keep column headers available to assistive technology in the card layout. */
  .catalogue thead { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .catalogue tbody { display: grid; gap: 16px; }
  .catalogue tbody tr { display: flex; flex-direction: column; min-width: 0; padding: 14px; border: 1px solid #cbd4ca; border-radius: 12px; background: #fff; }
  .catalogue td { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 0; border: 0; font-size: 1rem; overflow-wrap: anywhere; }
  .catalogue td:not(.product-name):not(.catalogue-price) { order: 2; }
  .catalogue td > span:last-child { min-width: 0; text-align: right; }
  .catalogue .catalogue-mobile-label { display: block; color: #334b3d; font-size: .88rem; font-weight: 600; }
  .catalogue td.product-name { display: block; min-width: 0; padding-top: 0; font-size: 1.15rem; }
  .catalogue .product-name p { margin-bottom: 8px; font-size: .95rem; font-weight: 400; }
  .catalogue .product-illustration { width: 180px; margin: 0 auto 14px; }
  .catalogue .thumb { width: 100%; height: 180px; object-fit: contain; }
  .catalogue td.catalogue-price { padding: 12px 0; border-top: 1px solid #e0e7de; border-bottom: 1px solid #e0e7de; color: #145439; font-size: 1.25rem; font-weight: 750; }
  .catalogue td.empty { display: block; text-align: center; }
  .catalogue .list-add { max-width: none; }
  .catalogue .list-add input, .catalogue .list-add button { min-height: 48px; font-size: 1rem; }
  .whatsapp-list { width: 100%; min-height: 48px; }
}
