/* Grocery Buddy — give the shopping list its own roomy place. */
[hidden] { display: none !important; }
.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;
}

.shopping header {
  padding-top: 13px;
  padding-bottom: 13px;
}
.shopping .brand { font-size: 25px; }
.shopping .brand-icon { width: 43px; height: 43px; border-radius: 14px; }
.shopping .brand small,
.shopping .theme-picker { display: none; }
.shopping .header-actions { width: auto; margin-left: auto; }
.shopping main { max-width: 1080px; padding-top: 19px; }
.shopping nav { margin-bottom: 24px; }
.shopping footer { padding-top: 28px; }

.list-screen { width: 100%; min-width: 0; }
.shopping-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 17px;
}
.shopping-heading h1 {
  margin: 0;
  font: 950 45px/1.12 var(--buddy-font);
  letter-spacing: -1.8px;
  color: var(--ink);
}
.shopping-heading p { margin: 7px 0 0; font-size: 14px; line-height: 1.5; }
.list-progress {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  padding: 8px 13px;
  border: 2px solid var(--ink);
  border-radius: 100px;
  background: var(--accent-2);
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
  box-shadow: 2px 2px 0 var(--ink);
}
.list-progress .ui-icon { width: 18px; height: 18px; }
.shopping-progress-track {
  height: 11px;
  margin: 0 0 23px;
  border: 2px solid var(--ink);
  border-radius: 100px;
  overflow: hidden;
  background: var(--surface);
}
.shopping-progress-track > span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
}
.list-entry {
  padding: 19px 21px 16px;
  margin: 0 0 24px;
  border: 2px solid var(--ink);
  border-radius: 21px 21px 21px 7px;
  background: var(--surface);
  box-shadow: 4px 4px 0 var(--ink);
}
.list-entry > label,
.list-entry > h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 11px;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: -.35px;
}
.list-entry > label .ui-icon,
.list-entry > h2 .ui-icon { width: 23px; height: 23px; }
.list-entry #quick-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 200px auto;
  align-items: end;
  column-gap: 12px;
  row-gap: 10px;
}
.list-entry #quick-name {
  grid-column: 1;
  grid-row: 1;
  min-height: 53px;
  min-width: 0;
  width: 100%;
  padding: 12px 14px;
  background: var(--paper);
  font-size: 17px;
}
.list-entry #quick-form > .primary {
  grid-column: 3;
  grid-row: 1;
  width: auto;
  min-width: 99px;
  min-height: 53px;
  margin: 0;
  padding: 11px 18px;
  border-radius: 13px;
  font-size: 15px;
}
.entry-type {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}
.entry-type select {
  width: 100%;
  min-height: 53px;
  padding: 10px 12px;
  margin: 4px 0 0;
  background: var(--accent-soft);
  color: var(--ink);
  font-size: 14px;
  font-weight: 750;
}
.entry-amount {
  grid-column: 1 / -1;
  grid-row: 2;
  color: var(--muted);
  font-size: 12px;
}
.entry-amount > summary {
  width: fit-content;
  min-height: 36px;
  padding: 7px 0;
  color: var(--muted);
}
.entry-amount:not([open]) > :not(summary) { display: none !important; }
.entry-amount .quick-options {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) minmax(110px, 1fr);
  max-width: 420px;
  gap: 12px;
  padding: 5px 0 6px;
}
.entry-amount label { margin: 0; font-size: 12px; font-weight: 750; }
.entry-amount label input,
.entry-amount label select { margin-top: 5px; min-height: 46px; width: 100%; }
.list-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 200px;
  gap: 12px;
  align-items: center;
  margin-bottom: 23px;
}
.list-controls input,
.list-controls select {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  background: var(--surface);
  font-size: 14px;
}
.list-controls label { margin: 0; }
.list-controls label input,
.list-controls label select { margin-top: 5px; }
.undo-remove {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px 9px 16px;
  margin: -7px 0 21px;
  border: 1.5px dashed var(--ink);
  border-radius: 13px;
  background: var(--accent-soft);
  font-size: 13px;
  font-weight: 750;
}
.undo-remove button {
  min-height: 38px;
  padding: 6px 12px;
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 2px 2px 0 var(--ink);
  font-size: 12px;
}
.list-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 17px;
}
.list-section-head h2 {
  margin: 0;
  font: 900 25px/1.15 var(--buddy-font);
  letter-spacing: -.7px;
}
.list-section-head p { margin: 5px 0 0; font-size: 12px; }
#finish-trip {
  flex-shrink: 0;
  min-height: 46px;
  padding: 10px 16px;
  background: var(--accent-2);
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}
#finish-trip:disabled { background: var(--surface); }
.shopping-list { width: 100%; min-width: 0; }
.list-screen #results { width: 100%; }
.type-group {
  margin: 0 0 23px;
  border: 2px solid var(--ink);
  border-radius: 19px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: 3px 4px 0 var(--ink);
}
.type-group h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 49px;
  margin: 0;
  padding: 10px 18px;
  background: var(--accent-soft);
  font: 850 15px/1.3 var(--buddy-font);
  letter-spacing: 0;
  text-transform: none;
}
.type-label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  color: var(--ink);
}
.type-label .section-icon { width: 26px; height: 26px; flex: none; }
.type-group h3 > span:last-child:not(.type-label) {
  display: inline-grid;
  place-items: center;
  min-width: 27px;
  min-height: 27px;
  padding: 2px 7px;
  border: 1.5px solid var(--ink);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  font-weight: 850;
}
.list-screen .grocery-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 94px;
  padding: 6px 15px;
  border-top: 1px solid color-mix(in srgb, var(--ink) 20%, transparent);
}
.list-screen .grocery-check {
  display: flex;
  align-items: center;
  gap: 15px;
  flex: 1;
  min-width: 0;
  min-height: 80px;
  padding: 7px 0;
  margin: 0;
}
.list-screen .grocery-check input {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  margin: 0;
  border-radius: 8px;
  cursor: pointer;
  accent-color: var(--ink);
}
.list-screen .item-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 43px;
  width: 43px;
  height: 44px;
  border-radius: 14px;
}
.list-screen .item-icon .ui-icon { width: 31px; height: 31px; }
.list-screen .item-text { gap: 5px; min-width: 0; }
.list-screen .item-text strong {
  font-size: 18px;
  font-weight: 850;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.list-screen .item-text small { color: var(--muted); font-size: 13px; font-weight: 650; line-height: 1.4; }
.row-actions { display: flex; align-items: center; flex: none; gap: 5px; }
.list-screen .row-actions button,
.list-screen .grocery-row > button {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  min-height: 46px;
  padding: 8px 10px;
  border: 0;
  border-radius: 11px;
  box-shadow: none;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.list-screen .row-actions button:hover,
.list-screen .grocery-row > button:hover { background: var(--accent-soft); color: var(--ink); }
.row-actions .ui-icon { width: 20px; height: 20px; }
.list-screen .is-checked { background: var(--accent-soft); }
.list-screen .cart-group h3 { background: var(--accent); }
.list-screen .cart-group .note { padding: 0 18px; font-size: 12px; line-height: 1.6; }
.list-screen .list-empty { padding: 39px 24px; }
.list-screen .list-empty p { font-size: 14px; }

.home-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 17px;
  margin: 24px 0;
}
.home-actions > button {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 10px;
  min-height: 150px;
  padding: 20px;
  border-radius: 22px 22px 22px 7px;
  background: var(--accent);
  text-align: left;
  font-size: 18px;
  font-weight: 900;
  box-shadow: 3px 4px 0 var(--ink);
}
.home-actions > button:nth-child(2) { background: var(--accent-2); border-radius: 22px 22px 7px 22px; }
.home-actions > button:nth-child(3) { background: var(--lavender); }
.home-actions > button > .ui-icon,
.home-actions > button > span:first-child:has(> .ui-icon) {
  width: 39px;
  height: 39px;
}
.home-actions strong { display: block; font-size: 18px; line-height: 1.3; }
.home-actions small { display: block; margin-top: 4px; font-size: 12px; font-weight: 650; line-height: 1.45; }
.home-list-card {
  padding: 24px;
  margin: 25px 0;
  border: 2px solid var(--ink);
  border-radius: 23px;
  background: var(--surface);
  box-shadow: 4px 4px 0 var(--ink);
}
.home-list-card h2 { margin: 0; font: 900 26px/1.2 var(--buddy-font); letter-spacing: -.7px; }
.home-list-card p { font-size: 14px; }
.home-list-card > header { display: flex; justify-content: space-between; gap: 15px; padding: 0; border: 0; background: transparent; }
.home-list-card > button { margin-top: 10px; background: var(--accent); }
.home-list-preview { display: flex; flex-wrap: wrap; gap: 9px; margin: 15px 0; }
.home-list-preview > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border: 1.5px solid var(--ink);
  border-radius: 11px;
  background: var(--paper);
  font-size: 13px;
  font-weight: 750;
}
.home-list-preview .ui-icon { width: 21px; height: 21px; }
nav button:nth-child(4) .nav-icon { background: var(--lavender); }

@media (max-width: 760px) {
  .shopping header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: calc(9px + env(safe-area-inset-top)) 17px 9px;
    gap: 10px;
    flex-wrap: nowrap;
  }
  .shopping .brand { flex: 0 1 auto; width: auto; min-width: 0; font-size: 23px; gap: 9px; letter-spacing: -.9px; }
  .shopping .brand > span { display: block; font-size: inherit; white-space: nowrap; }
  .shopping header .brand-icon { width: 40px; height: 40px; border-radius: 13px; flex-shrink: 0; }
  .shopping .header-actions { flex: 0 0 auto; width: auto; min-width: 0; margin-left: 0; justify-self: end; gap: 0; }
  .shopping header button { min-height: 42px; padding: 8px 10px; font-size: 10px; }
  .shopping main { padding: 18px 17px 0; }
  .shopping nav { margin: 0; }
  nav { gap: 7px; padding-left: 10px; padding-right: 10px; }
  nav button { min-width: 0; min-height: 65px; font-size: 9px; padding: 5px 2px; }
  nav button.active { padding: 3.5px .5px; }
  .nav-label { white-space: nowrap; line-height: 1.3; }
  .shopping-heading { align-items: flex-start; gap: 10px; margin-bottom: 15px; }
  .shopping-heading h1 { font-size: 35px; line-height: 1.1; letter-spacing: -1.4px; }
  .shopping-heading p { display: none; }
  .list-progress { margin-top: 4px; padding: 6px 9px; font-size: 10px; border-width: 1.5px; gap: 4px; }
  .list-progress .ui-icon { width: 15px; height: 15px; }
  .shopping-progress-track { display: none; }
  .list-entry { padding: 12px; border-radius: 19px 19px 19px 6px; margin-bottom: 19px; box-shadow: 3px 4px 0 var(--ink); }
  .list-entry > label,
  .list-entry > h2 { font-size: 16px; margin-bottom: 10px; }
  .list-entry #quick-form { grid-template-columns: minmax(0, 1fr) auto; column-gap: 9px; row-gap: 9px; }
  .list-entry #quick-name { grid-column: 1; grid-row: 1; min-height: 52px; font-size: 16px; padding: 10px 11px; }
  .list-entry #quick-form > .primary { grid-column: 2; grid-row: 1; min-width: 73px; min-height: 52px; padding: 10px 13px; font-size: 14px; }
  .entry-type { grid-column: 1; grid-row: 2; display: flex; align-items: center; min-width: 0; gap: 8px; color: var(--ink); font-size: 12px; }
  .entry-type select { margin: 0; flex: 1; min-width: 0; min-height: 44px; font-size: 14px; padding: 8px 10px; }
  .entry-amount { grid-column: 2; grid-row: 2; align-self: center; font-size: 10px; }
  .entry-amount > summary { min-height: 44px; padding: 13px 0 9px; white-space: nowrap; }
  .entry-amount[open] { grid-column: 1 / -1; grid-row: 3; }
  .entry-amount[open] > summary { min-height: 34px; padding: 5px 0 7px; }
  .entry-amount .quick-options { max-width: none; gap: 10px; padding-top: 3px; }
  .entry-amount .quick-options label:last-child { grid-column: auto; }
  .entry-amount label input,
  .entry-amount label select { font-size: 16px; }
  .list-controls { grid-template-columns: minmax(0, 1fr) 132px; gap: 9px; margin-bottom: 17px; }
  .list-controls input,
  .list-controls select { min-height: 46px; padding: 9px 10px; font-size: 13px; border-radius: 12px; }
  .list-controls input { font-size: 16px; }
  .list-section-head { gap: 10px; margin-bottom: 13px; }
  .list-section-head h2 { font-size: 23px; letter-spacing: -.7px; }
  .list-section-head p { font-size: 11px; }
  #finish-trip { min-height: 45px; padding: 9px 12px; font-size: 11px; border-radius: 12px; }
  .type-group { margin-bottom: 21px; border-radius: 17px; box-shadow: 2px 3px 0 var(--ink); }
  .type-group h3 { min-height: 47px; padding: 9px 12px; font-size: 14px; }
  .type-label { gap: 8px; }
  .type-label .section-icon { width: 25px; height: 25px; }
  .type-group h3 > span:last-child:not(.type-label) { min-width: 24px; min-height: 24px; font-size: 11px; }
  .list-screen .grocery-row { gap: 4px; min-height: 88px; padding: 5px 9px; }
  .list-screen .grocery-check { gap: 10px; min-height: 76px; padding: 7px 0; }
  .list-screen .grocery-check input { flex-basis: 28px; width: 28px; height: 28px; }
  .list-screen .item-icon { flex-basis: 33px; width: 33px; height: 37px; border-radius: 11px; }
  .list-screen .item-icon .ui-icon { width: 25px; height: 25px; }
  .list-screen .item-text { gap: 4px; }
  .list-screen .item-text strong { font-size: 17px; line-height: 1.27; }
  .list-screen .item-text small { font-size: 12px; line-height: 1.35; }
  .row-actions { gap: 0; }
  .list-screen .row-actions button,
  .list-screen .grocery-row > button { min-width: 40px; min-height: 46px; padding: 8px 7px; font-size: 11px; }
  .list-screen .row-actions button[data-grocery-remove] { min-width: 36px; }
  .row-actions .ui-icon { width: 19px; height: 19px; }
  .list-screen .cart-group .note { padding: 0 12px; font-size: 11px; }
  .list-screen .list-empty { padding: 31px 17px; }
  .list-screen .list-empty h3 { font-size: 23px; }
  .list-screen .list-empty p { font-size: 13px; }
  .shopping footer { padding-top: 23px; font-size: 9px; }
  .home-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 23px 0; }
  .home-actions > button { padding: 15px 11px; min-height: 140px; gap: 10px; border-radius: 17px 17px 17px 5px; font-size: 13px; }
  .home-actions > button:nth-child(2) { border-radius: 17px 17px 5px 17px; }
  .home-actions > button > .ui-icon,
  .home-actions > button > span:first-child:has(> .ui-icon) { width: 31px; height: 31px; }
  .home-actions strong { font-size: 13px; }
  .home-actions small { font-size: 10px; line-height: 1.4; }
  .home-list-card { padding: 20px 17px; margin: 22px 0; border-radius: 20px; box-shadow: 3px 4px 0 var(--ink); }
  .home-list-card h2 { font-size: 24px; }
  .home-list-card p { font-size: 13px; }
  .home-list-card > header { align-items: flex-start; }
  .home-list-card > header button { padding: 8px 10px; font-size: 11px; }
  .home-list-preview { gap: 7px; margin: 14px 0; }
  .home-list-preview > span { padding: 7px 10px; font-size: 12px; }
}

@media (max-width: 380px) {
  .shopping header { padding-left: 13px; padding-right: 13px; gap: 7px; }
  .shopping .brand { font-size: 21px; gap: 8px; }
  .shopping header .brand-icon { width: 37px; height: 37px; }
  .shopping header button { padding: 8px; font-size: 9px; }
  .shopping main { padding-left: 13px; padding-right: 13px; }
  .shopping-heading h1 { font-size: 32px; }
  .shopping-heading p { font-size: 11px; }
  .list-progress { font-size: 9px; padding: 6px 8px; }
  .list-controls { grid-template-columns: minmax(0, 1fr) 123px; }
  .list-controls select { font-size: 12px; }
  .list-screen .grocery-row { padding-left: 8px; padding-right: 6px; }
  .list-screen .grocery-check { gap: 8px; }
  .list-screen .item-icon { flex-basis: 29px; width: 29px; height: 33px; }
  .list-screen .item-icon .ui-icon { width: 23px; height: 23px; }
  .list-screen .item-text strong { font-size: 16px; }
  .list-screen .item-text small { font-size: 11px; }
  .list-screen .row-actions button { min-width: 37px; padding-left: 5px; padding-right: 5px; }
  .list-screen .row-actions button[data-grocery-remove] { min-width: 33px; }
  .home-actions > button { padding: 13px 9px; font-size: 12px; }
  .home-actions strong { font-size: 12px; }
}

@media (prefers-reduced-motion: no-preference) {
  .shopping-progress-track > span { transition: width .2s ease; }
  .type-group { transition: background-color .2s ease; }
}

@media (max-width: 340px) {
  .shopping .brand { font-size: 19px; }
  .shopping header .brand-icon { width: 36px; height: 36px; }
  .shopping header button { padding: 7px; }
  .shopping-heading h1 { font-size: 29px; }
  .list-progress { font-size: 8px; padding-left: 6px; padding-right: 6px; }
  .list-screen .grocery-row { gap: 0; }
  .list-screen .grocery-check { gap: 7px; }
  .list-screen .item-icon { display: none; }
}
