/* Grocery Buddy — cheerful stickers, roomy lists, and a pocket-sized pal. */
:root {
  --ink: #293047;
  --paper: #fff9eb;
  --surface: #fffef8;
  --accent: #74e4b0;
  --accent-2: #ffdf59;
  --accent-soft: #d9f8e8;
  --pink: #ffb7b7;
  --lavender: #d7c6ff;
  --peach: #ffddbc;
  --muted: #626576;
  --line: var(--ink);
  --green: var(--ink);
  --buddy-dot: #e7dac3;
  --buddy-hero: #fff1ae;
  --buddy-pop: #ff976f;
  --shadow: 5px 6px 0 var(--ink);
  --shadow-small: 3px 3px 0 var(--ink);
  --buddy-font: ui-rounded, "Arial Rounded MT Bold", "SF Pro Rounded", "Trebuchet MS", system-ui, sans-serif;
}
:root[data-grocery-theme="berry"] {
  --ink: #443050;
  --paper: #fff2f7;
  --surface: #fffbf8;
  --accent: #f6a3d3;
  --accent-2: #f8db65;
  --accent-soft: #fde0f1;
  --pink: #ffb5be;
  --lavender: #c9b5fa;
  --peach: #ffd9a8;
  --muted: #735e78;
  --buddy-dot: #e9cedd;
  --buddy-hero: #f8d4ed;
  --buddy-pop: #e6a0ed;
}
:root[data-grocery-theme="ocean"] {
  --ink: #243d57;
  --paper: #eefaff;
  --surface: #fffef6;
  --accent: #69dbdf;
  --accent-2: #ffe266;
  --accent-soft: #d4f5f4;
  --pink: #ffbca8;
  --lavender: #bfcfff;
  --peach: #ffe0b2;
  --muted: #526e80;
  --buddy-dot: #c9e3eb;
  --buddy-hero: #c1edf8;
  --buddy-pop: #8bcbe9;
}
:root[data-grocery-theme="cosmic"] {
  --ink: #363059;
  --paper: #f5efff;
  --surface: #fffdf9;
  --accent: #b9a0fa;
  --accent-2: #ffe36e;
  --accent-soft: #e8ddff;
  --pink: #f7b5df;
  --lavender: #baabf1;
  --peach: #c6f5d6;
  --muted: #696080;
  --buddy-dot: #ddd0ef;
  --buddy-hero: #ded0ff;
  --buddy-pop: #a6e5cb;
}
body {
  background-color: var(--paper);
  background-image: radial-gradient(var(--buddy-dot) 1px, transparent 1px);
  background-size: 19px 19px;
  font-family: var(--buddy-font);
  color: var(--ink);
}
button, input, select, textarea { font-family: var(--buddy-font); }
button { border-width: 2px; border-radius: 14px; font-weight: 800; box-shadow: var(--shadow-small); }
button:hover { background: var(--accent-soft); }
button:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
button:disabled { opacity: .5; transform: none; }
.primary { background: var(--accent); color: var(--ink); }
.primary:hover { background: var(--accent-2); }
input, textarea, select { background: var(--surface); border: 2px solid var(--ink); border-radius: 13px; color: var(--ink); }
input:focus, textarea:focus, select:focus { background: var(--surface); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input:focus-visible, select:focus-visible, textarea:focus-visible,
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }
header {
  background: var(--surface);
  padding: 18px max(28px, calc((100vw - 1164px) / 2));
  border-bottom: 3px solid var(--ink);
}
.brand { font-size: 28px; font-weight: 950; letter-spacing: -1.1px; gap: 12px; }
.brand > span, header .brand > span { color: var(--ink); }
.brand small { font-size: 8px; letter-spacing: 1.7px; color: var(--muted); }
.brand-icon { width: 50px; height: 50px; border: 2px solid var(--ink); border-radius: 17px; background: var(--accent-2); box-shadow: 3px 3px 0 var(--ink); transform: rotate(-7deg); }
img.brand-icon { object-fit: contain; }
.header-actions { gap: 16px; }
.theme-picker { font-size: 11px; font-weight: 800; }
.theme-picker select { background: var(--accent-soft); padding: 9px 28px 9px 12px; font-weight: 750; max-width: 186px; box-shadow: 2px 2px 0 var(--ink); }
header button { padding: 10px 13px; background: var(--surface); }
main { padding: 0 38px; }
.install-banner {
  margin-top: 23px;
  padding: 13px 17px;
  border-radius: 18px;
  border-width: 2px;
  background: var(--accent-soft);
  box-shadow: 3px 3px 0 var(--ink);
}
.install-banner b { font-size: 13px; font-weight: 850; }
.install-banner p { margin-top: 2px; color: var(--ink); }
.install-banner .primary { background: var(--accent-2); }
.intro {
  margin: 26px 0 24px;
  padding: 30px 36px 28px;
  gap: 20px;
  border: 2px solid var(--ink);
  border-radius: 32px 30px 30px 9px;
  background: var(--buddy-hero);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.intro-copy { position: relative; z-index: 1; }
.buddy-greeting {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 1.35px;
  line-height: 1.4;
  color: var(--ink);
}
.buddy-greeting-icon { width: 25px; height: 25px; display: inline-grid; place-items: center; border: 1.5px solid var(--ink); border-radius: 9px; background: var(--surface); transform: rotate(-8deg); }
.buddy-greeting-icon .ui-icon { width: 16px; height: 16px; }
.buddy-spark { font-size: 23px; line-height: 1; margin-left: 3px; }
.intro .eyebrow { border-width: 2px; border-radius: 9px; background: var(--surface); box-shadow: 2px 2px 0 var(--ink); }
.intro h1 {
  max-width: 660px;
  margin: 16px 0 13px;
  font-family: var(--buddy-font);
  font-size: clamp(40px, 4.7vw, 58px);
  font-weight: 950;
  line-height: 1.06;
  letter-spacing: -2.3px;
  color: var(--ink);
  text-wrap: balance;
}
.buddy-word { position: relative; display: inline-block; isolation: isolate; white-space: nowrap; }
.buddy-word::before { content: ""; position: absolute; inset: 8% -7px -2%; border-radius: 12px 8px 13px 6px; background: var(--surface); transform: rotate(-2deg); z-index: -1; }
.intro p { font-size: 13px; color: var(--ink); line-height: 1.55; max-width: 430px; }
.buddy-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 17px; }
.buddy-chip { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border: 1.5px solid var(--ink); border-radius: 100px; background: var(--surface); color: var(--ink); font-size: 9px; font-weight: 850; line-height: 1.35; }
.buddy-chip:nth-child(2) { background: var(--accent); transform: rotate(2deg); }
.buddy-chip:nth-child(3) { background: var(--pink); transform: rotate(-2deg); }
.buddy-chip .ui-icon { width: 15px; height: 15px; }
.mascot-stage { flex: 0 0 280px; width: 280px; height: 252px; margin: 0 0 0 10px; }
.mascot-stage::before { inset: 29px 6px 2px 9px; border: 2px solid var(--ink); background: var(--buddy-pop); border-radius: 50% 50% 44% 56% / 50% 41% 59% 50%; transform: rotate(-10deg); box-shadow: 4px 4px 0 var(--ink); }
.mascot-stage::after { content: "✦"; position: absolute; right: 2px; bottom: 27px; font-size: 38px; color: var(--ink); transform: rotate(8deg); z-index: -1; }
.grocery-mascot { width: 246px; height: 230px; display: block; object-fit: contain; transform: rotate(2deg); filter: drop-shadow(0 6px 0 #00000012); }
.hero-sticker { top: 2px; right: -1px; padding: 7px 11px; background: var(--surface); border-radius: 11px 11px 11px 3px; font-size: 9px; box-shadow: 3px 3px 0 var(--ink); transform: rotate(8deg); }
.mascot-speech { position: absolute; left: -16px; bottom: 11px; padding: 7px 11px; border: 2px solid var(--ink); border-radius: 13px 13px 3px 13px; background: var(--surface); font-size: 10px; font-weight: 900; line-height: 1.3; box-shadow: 2px 2px 0 var(--ink); transform: rotate(-7deg); }
.stats { gap: 16px; margin: 0 0 25px; }
.stat { border: 2px solid var(--ink); padding: 17px 20px; gap: 14px; border-radius: 20px 20px 20px 7px; background: var(--accent); box-shadow: 3px 4px 0 var(--ink); }
.stat:nth-child(2) { background: var(--accent-2); border-radius: 20px 20px 7px 20px; }
.stat:nth-child(3) { background: var(--lavender); }
.stat-icon { width: 46px; height: 46px; background: var(--surface); border: 2px solid var(--ink); border-radius: 15px; transform: rotate(-7deg); }
.stat:nth-child(2) .stat-icon { transform: rotate(7deg); }
.stat b { font-family: var(--buddy-font); font-size: 31px; font-weight: 950; }
.stat span { font-size: 11px; font-weight: 750; color: var(--ink); }
nav { padding: 8px 0 18px; margin-bottom: 17px; background: var(--paper); border-radius: 16px; gap: 11px; }
nav button { font-size: 13px; padding: 10px 19px; border-radius: 16px; border: 2px solid var(--ink); background: var(--surface); gap: 10px; box-shadow: 2px 2px 0 var(--ink); color: var(--ink); }
nav button.active { background: var(--accent); border: 2px solid var(--ink); box-shadow: 3px 4px 0 var(--ink); }
.nav-icon { width: 29px; height: 29px; display: inline-grid; place-items: center; background: var(--accent-soft); border-radius: 9px; }
nav button:nth-child(2) .nav-icon { background: var(--accent-2); }
nav button:nth-child(3) .nav-icon { background: var(--pink); }
nav button.active .nav-icon { background: var(--surface); transform: rotate(-8deg); }
.nav-icon .ui-icon { width: 22px; height: 22px; }
#badge:not(:empty) { border-radius: 20px; background: var(--ink); color: var(--surface); font-size: 10px; padding: 1px 6px; }
.dashboard-layout { gap: 27px; grid-template-columns: minmax(0, 1fr) 286px; }
.quick-entry { padding: 23px; border: 2px solid var(--ink); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); margin: 0 0 30px; }
.quick-entry > label { font-size: 22px; font-weight: 900; letter-spacing: -.65px; }
.quick-entry > label .ui-icon { padding: 4px; width: 33px; height: 33px; background: var(--accent-2); border: 1.5px solid var(--ink); border-radius: 10px; transform: rotate(-7deg); }
.quick-entry input[name="name"] { background: var(--paper); }
.quick-entry form > .primary { font-size: 14px; background: var(--accent); min-width: 94px; border-radius: 13px; }
.quick-entry form > .primary:hover { background: var(--accent-2); }
.quick-entry details { color: var(--muted); font-size: 12px; }
summary { font-weight: 750; }
.quick-options label { font-size: 12px; }
.list-heading h2, .toolbar h2 { font: 900 27px/1.1 var(--buddy-font); letter-spacing: -1px; }
.list-heading p { font-size: 12px; }
.list-heading button { background: var(--accent-2); font-size: 11px; font-weight: 850; }
.aisle-group { background: var(--surface); border: 2px solid var(--ink); border-radius: 18px; box-shadow: 3px 4px 0 var(--ink); margin-bottom: 22px; }
.aisle-group h3 { padding: 11px 15px; font: 850 12px/1.3 var(--buddy-font); background: var(--accent-soft); letter-spacing: .1px; }
.aisle-group h3 > span:last-child:not(.aisle-label) { border: 1px solid var(--ink); border-radius: 8px; background: var(--surface); min-width: 22px; padding: 1px 5px; text-align: center; font-size: 10px; font-weight: 850; }
.section-icon { border-radius: 7px; }
.aisle-label { gap: 8px; }
.grocery-row { padding: 5px 8px; border-top: 1px solid color-mix(in srgb, var(--ink) 18%, transparent); gap: 3px; }
.grocery-check { min-height: 67px; gap: 12px; }
.grocery-check input { width: 24px; height: 24px; accent-color: var(--ink); }
.item-icon { width: 37px; height: 39px; border: 1.5px solid var(--ink); border-radius: 12px; background: var(--peach); transform: rotate(-4deg); }
.grocery-row:nth-child(3n) .item-icon { background: var(--lavender); transform: rotate(4deg); }
.grocery-row:nth-child(3n+1) .item-icon { background: var(--accent-soft); }
.item-icon .ui-icon { width: 25px; height: 25px; }
.item-text strong { font-size: 14px; font-weight: 800; }
.item-text small { font-size: 11px; font-weight: 600; }
.grocery-row > button { min-width: 42px; min-height: 44px; border: 0; box-shadow: none; color: var(--muted); }
.is-checked { background: var(--accent-soft); }
.is-checked .item-icon { background: var(--surface); opacity: .7; }
.cart-group h3 { background: var(--accent) !important; }
.buddy-highfive { display: flex; align-items: center; gap: 13px; margin: 0 0 20px; padding: 16px 18px; border: 2px solid var(--ink); border-radius: 18px 18px 18px 5px; background: var(--accent-2); box-shadow: 3px 3px 0 var(--ink); font-size: 13px; font-weight: 800; }
.buddy-highfive .ui-icon { width: 32px; height: 32px; }
.buddy-highfive p { margin: 0; color: var(--ink); }
.kitchen-links { padding: 25px 22px; background: var(--pink); border: 2px solid var(--ink); border-radius: 24px 24px 8px 24px; box-shadow: var(--shadow); }
.kitchen-links .eyebrow { font-size: 8px; padding: 5px 8px; border-radius: 8px; transform: rotate(-3deg); background: var(--surface); box-shadow: 2px 2px 0 var(--ink); }
.kitchen-links h3 { font-family: var(--buddy-font); font-weight: 950; font-size: 29px; letter-spacing: -1.1px; }
.kitchen-links > button { border-radius: 14px; box-shadow: 2px 3px 0 var(--ink); background: var(--surface); }
.kitchen-links > button:hover { background: var(--accent-2); }
.phone-note { margin-top: 25px; border-top: 2px dashed var(--ink); }
.phone-note b { font-weight: 900; }
.phone-note small { color: var(--ink); opacity: .8; }
.list-empty, .empty { border: 2px dashed var(--ink); background: var(--surface); border-radius: 23px; }
.list-empty > span { width: 64px; height: 64px; border-width: 2px; border-radius: 21px; background: var(--accent-2); box-shadow: 4px 4px 0 var(--ink); }
.list-empty h3 { font-family: var(--buddy-font); font-size: 25px; font-weight: 900; letter-spacing: -.8px; }
.toolbar h2 { font-size: 29px; }
.toolbar input, .toolbar select { background: var(--surface); }
.toolbar .primary { font-size: 12px; }
.card { border: 2px solid var(--ink); border-radius: 23px; background: var(--surface); box-shadow: 4px 5px 0 var(--ink); }
.art { height: 170px; background: var(--accent); border-bottom: 2px solid var(--ink); background-image: radial-gradient(#ffffff70 1.5px, transparent 1.5px); background-size: 17px 17px; }
.card:nth-child(3n+2) .art { background-color: var(--pink); background-image: radial-gradient(#ffffff70 1.5px, transparent 1.5px); background-size: 17px 17px; }
.card:nth-child(3n) .art { background-color: var(--lavender); background-image: radial-gradient(#ffffff70 1.5px, transparent 1.5px); background-size: 17px 17px; }
.art > span { transform: rotate(-8deg); filter: drop-shadow(4px 5px 0 #00000015); }
.heart { border-radius: 14px; box-shadow: 3px 3px 0 var(--ink); }
.card h3 { font: 900 25px/1.1 var(--buddy-font); letter-spacing: -.8px; }
.meta { font-size: 9px; font-weight: 850; }
.match { font-size: 11px; color: var(--ink); }
.bar { height: 9px; border: 1.5px solid var(--ink); border-radius: 10px; background: var(--paper); }
.bar span { background: var(--accent); border-right: 1.5px solid var(--ink); }
.card-body > button { background: var(--accent-soft); font-size: 12px; border-radius: 13px; }
.row { border: 2px solid var(--ink); border-radius: 16px; padding: 16px; background: var(--surface); box-shadow: 2px 3px 0 var(--ink); margin-bottom: 13px; }
.row:first-child { border-radius: 16px; }
.row strong { font-weight: 850; }
.row button { font-size: 11px; background: var(--accent-soft); }
.row button[data-remove] { background: transparent; }
dialog { border: 2px solid var(--ink); border-radius: 28px 28px 9px 28px; padding: 27px; background: var(--paper); box-shadow: 7px 8px 0 var(--ink); }
dialog::backdrop { background: #25283c99; backdrop-filter: blur(5px); }
.modal-head h2 { font: 950 30px/1.1 var(--buddy-font); letter-spacing: -1px; }
.modal-head button { background: var(--accent-2); border-radius: 12px; }
dialog h3 { font-family: var(--buddy-font); font-weight: 900; letter-spacing: -.6px; }
dialog label { font-weight: 850; }
dialog label input, dialog label select, dialog label textarea { background: var(--surface); }
dialog .note { line-height: 1.6; }
.have { color: #23634c; }
.need { color: #934323; }
#install-status { border: 1.5px dashed var(--ink); border-radius: 13px; background: var(--accent-soft); color: var(--ink); }
footer { font-size: 10px; font-weight: 650; color: var(--muted); }
#toast { border: 2px solid var(--ink); border-radius: 15px; background: var(--accent-2); color: var(--ink); box-shadow: 3px 4px 0 var(--ink); font-size: 12px; font-weight: 800; }

@media (max-width: 980px) {
  header { padding: 17px 28px; }
  .intro { padding: 28px; }
  .mascot-stage { flex-basis: 239px; width: 239px; height: 235px; }
  .grocery-mascot { width: 218px; height: 214px; }
  .dashboard-layout { grid-template-columns: minmax(0, 1fr) 245px; gap: 22px; }
  .kitchen-links { padding: 22px 18px; }
  .kitchen-links h3 { font-size: 27px; }
  .stat { padding: 16px; gap: 10px; }
  .stat-icon { width: 40px; height: 42px; }
}
@media (max-width: 760px) {
  body { padding-bottom: calc(102px + env(safe-area-inset-bottom)); }
  header { padding: calc(12px + env(safe-area-inset-top)) 19px 12px; gap: 12px; }
  .brand { font-size: 26px; gap: 11px; }
  .brand small { font-size: 7.5px; letter-spacing: 1.35px; margin-top: 6px; }
  header .brand-icon { width: 46px; height: 46px; border-radius: 15px; }
  .header-actions { gap: 12px; }
  .theme-picker { font-size: 10px; gap: 7px; }
  .theme-picker select { font-size: 14px; min-height: 44px; max-width: 178px; border-radius: 12px; padding: 8px 23px 8px 10px; }
  header button { min-height: 44px; padding: 8px 11px; font-size: 10px; border-radius: 12px; }
  main { padding: 0 18px; }
  .install-banner { margin-top: 18px; border-radius: 16px; padding: 10px 12px; gap: 10px; }
  .install-banner b { font-size: 11px; line-height: 1.4; display: block; }
  .install-banner .primary { min-height: 44px; font-size: 11px; padding: 8px 12px; }
  .intro { margin: 21px 0 21px; padding: 22px 17px 19px; gap: 3px; border-radius: 26px 26px 26px 7px; box-shadow: 4px 5px 0 var(--ink); align-items: center; overflow: hidden; }
  .intro-copy { flex: 1 1 57%; min-width: 0; }
  .buddy-greeting { font-size: 6.5px; letter-spacing: .6px; gap: 4px; max-width: 205px; }
  .buddy-greeting > span:nth-child(2) { max-width: 135px; }
  .buddy-greeting-icon { width: 20px; height: 20px; border-radius: 7px; flex: none; }
  .buddy-greeting-icon .ui-icon { width: 13px; height: 13px; }
  .buddy-spark { font-size: 17px; margin-left: 0; }
  .intro h1 { margin: 13px 0 12px; font-size: clamp(29px, 7.6vw, 43px); line-height: 1.07; letter-spacing: -1.5px; max-width: 100%; }
  .buddy-word::before { inset: 9% -4px -1%; border-radius: 8px 5px 10px 5px; }
  .intro p { font-size: 10px; line-height: 1.5; max-width: 240px; }
  .buddy-chips { gap: 5px; margin-top: 13px; width: calc(100% + 8px); }
  .buddy-chip { font-size: 7px; padding: 4px 7px; gap: 3px; border-width: 1.2px; }
  .buddy-chip .ui-icon { width: 12px; height: 12px; }
  .mascot-stage { flex: 0 0 40%; width: 40%; max-width: 190px; height: 184px; margin: 0 -7px 0 0; }
  .mascot-stage::before { inset: 22px 0 6px 4px; box-shadow: 3px 3px 0 var(--ink); }
  .mascot-stage::after { right: -1px; bottom: 19px; font-size: 26px; }
  .grocery-mascot { width: 100%; height: 174px; min-width: 0; max-width: 179px; transform: rotate(3deg); }
  .hero-sticker { top: 0; right: -3px; font-size: 6.4px; padding: 5px 6px; border-width: 1.5px; border-radius: 8px 8px 8px 2px; box-shadow: 2px 2px 0 var(--ink); }
  .mascot-speech { left: -8px; bottom: 4px; max-width: 125px; font-size: 8px; padding: 6px 8px; border-width: 1.5px; border-radius: 10px 10px 3px 10px; }
  .stats { gap: 9px; margin-bottom: 25px; }
  .stat { padding: 12px 9px; gap: 8px; border-radius: 16px 16px 16px 5px; box-shadow: 2px 3px 0 var(--ink); }
  .stat:nth-child(2) { border-radius: 16px 16px 5px 16px; }
  .stat-icon { width: 31px; height: 34px; border-radius: 11px; border-width: 1.5px; }
  .stat-icon .ui-icon { width: 21px; height: 21px; }
  .stat b { font-size: 25px; line-height: 1; }
  .stat span { font-size: 8px; line-height: 1.3; font-weight: 750; }
  nav { position: fixed; top: auto; bottom: 0; left: 0; right: 0; border-top: 3px solid var(--ink); border-radius: 23px 23px 0 0; padding: 9px 12px calc(11px + env(safe-area-inset-bottom)); gap: 9px; margin: 0; background: var(--surface); box-shadow: 0 -4px 0 #2930470c; z-index: 6; }
  nav button { min-height: 65px; border: 0; padding: 5px 4px; gap: 3px; flex: 1 1 0; font-size: 9px; border-radius: 14px; background: transparent; color: var(--ink); box-shadow: none; }
  nav button.active { border: 1.5px solid var(--ink); padding: 3.5px 2.5px; background: var(--accent); box-shadow: 2px 3px 0 var(--ink); }
  .nav-icon { width: 31px; height: 31px; border-radius: 10px; }
  .nav-icon .ui-icon { width: 23px; height: 23px; }
  #badge:not(:empty) { top: 4px; right: calc(50% - 30px); min-width: 17px; font-size: 8px; padding: 0 4px; }
  .dashboard-layout { grid-template-columns: minmax(0, 1fr); gap: 27px; }
  .quick-entry { padding: 18px 17px; border-radius: 20px; margin: 0 0 27px; box-shadow: 4px 4px 0 var(--ink); }
  .quick-entry > label { font-size: 20px; letter-spacing: -.7px; margin-bottom: 14px; }
  .quick-entry > label .ui-icon { width: 30px; height: 30px; }
  .quick-entry input[name="name"] { font-size: 16px; min-height: 50px; padding: 10px 11px; }
  .quick-entry form > .primary { min-width: 78px; font-size: 13px; padding: 10px 13px; min-height: 50px; }
  .quick-entry details { font-size: 11px; }
  .quick-options input, .quick-options select { font-size: 16px; }
  .list-heading { margin-bottom: 17px; gap: 10px; }
  .list-heading h2 { font: 900 25px/1.1 var(--buddy-font); letter-spacing: -.9px; }
  .list-heading p { font-size: 10px; }
  .list-heading button { font-size: 10px; padding: 9px 11px; border-radius: 12px; min-height: 44px; }
  .aisle-group { border-radius: 17px; margin-bottom: 20px; }
  .aisle-group h3 { padding: 10px 11px; font-size: 11px; }
  .grocery-row { padding: 4px 5px; gap: 0; }
  .grocery-check { min-height: 68px; padding: 8px 5px; gap: 9px; }
  .grocery-check input { width: 23px; height: 23px; }
  .item-icon { width: 31px; height: 35px; border-radius: 10px; border-width: 1.3px; }
  .item-icon .ui-icon { width: 23px; height: 23px; }
  .item-text strong { font-size: 13px; }
  .item-text small { font-size: 10px; }
  .grocery-row > button { min-width: 35px; padding: 8px 6px; font-size: 10px; }
  .grocery-row > button[data-grocery-remove] { min-width: 31px; }
  .buddy-highfive { font-size: 12px; padding: 14px; gap: 10px; }
  .kitchen-links { padding: 25px 22px; border-radius: 23px 23px 7px 23px; box-shadow: 4px 5px 0 var(--ink); }
  .kitchen-links h3 { font-size: 30px; max-width: 300px; }
  .kitchen-links > button { font-size: 13px; min-height: 49px; }
  .toolbar { margin-top: 3px; }
  .toolbar h2 { font: 900 28px/1.1 var(--buddy-font); letter-spacing: -.9px; }
  .toolbar input, .toolbar select { font-size: 16px; }
  .card { border-radius: 21px; box-shadow: 3px 4px 0 var(--ink); }
  .art { height: 154px; }
  .card-body { padding: 20px; }
  .card h3 { font-size: 25px; }
  .row { padding: 14px; }
  .row strong { font-size: 13px; }
  .row small { font-size: 11px; }
  .row button { min-height: 44px; }
  .list-empty, .empty { padding: 35px 20px; }
  dialog { max-width: calc(100vw - 26px); max-height: 88dvh; padding: 25px 20px; border-radius: 24px 24px 8px 24px; box-shadow: 4px 5px 0 var(--ink); }
  .modal-head h2 { font-size: 28px; }
  dialog label input, dialog label select, dialog label textarea { font-size: 16px; }
  #toast { bottom: calc(105px + env(safe-area-inset-bottom)); font-size: 11px; max-width: calc(100vw - 32px); }
  footer { padding-top: 35px; font-size: 9px; }
}
@media (max-width: 380px) {
  header { padding-left: 15px; padding-right: 15px; }
  main { padding-left: 14px; padding-right: 14px; }
  .brand { font-size: 25px; }
  .theme-picker select { max-width: 167px; font-size: 13px; }
  .intro { padding-left: 14px; padding-right: 13px; }
  .intro h1 { font-size: 29px; letter-spacing: -1.3px; }
  .buddy-greeting { font-size: 6px; letter-spacing: .4px; }
  .buddy-greeting > span:nth-child(2) { max-width: 105px; }
  .buddy-spark { display: none; }
  .mascot-stage { flex-basis: 38%; height: 166px; }
  .grocery-mascot { height: 157px; }
  .hero-sticker { font-size: 5.9px; right: -6px; }
  .mascot-speech { font-size: 7px; left: -2px; bottom: 0; }
  .buddy-chips { gap: 4px; }
  .buddy-chip { padding: 4px 6px; font-size: 6.5px; }
  .stat { gap: 6px; padding: 12px 7px; }
  .stat-icon { width: 26px; height: 30px; border-radius: 9px; }
  .stat-icon .ui-icon { width: 18px; height: 18px; }
  .stat b { font-size: 23px; }
  .stat span { font-size: 7.2px; }
  .list-heading h2 { font-size: 23px; }
  .list-heading button { padding: 8px; font-size: 9px; }
  .item-icon { width: 28px; height: 32px; }
  .grocery-check { gap: 8px; }
  .grocery-row > button { min-width: 31px; padding: 7px 5px; }
}
@media (prefers-reduced-motion: no-preference) {
  .theme-picker select, .card, .aisle-group, .stat, .intro { transition: background-color .2s ease; }
  .grocery-row { transition: background-color .15s ease; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
