/* Compras Fácil — estilos (mobile-first) */

:root {
  --bg: #f6f3ec;
  --surface: #ffffff;
  --ink: #17261d;
  --muted: #667569;
  --line: #ebe6d9;
  --brand: #16803c;
  --brand-d: #116530;
  --brand-l: #dcf5e3;
  --brand-xl: #f1faf4;
  --accent: #f59e0b;
  --danger: #d93636;
  --danger-l: #fdecec;
  --r-lg: 22px;
  --r-md: 16px;
  --sh-1: 0 1px 2px rgba(23, 38, 29, 0.06), 0 4px 14px rgba(23, 38, 29, 0.06);
  --sh-2: 0 10px 30px rgba(23, 38, 29, 0.18);
  --maxw: 480px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Color Emoji", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: #e6e1d3;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body.no-scroll { overflow: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:disabled { cursor: not-allowed; }
ul { padding: 0; list-style: none; }
:focus-visible { outline: 3px solid #2563eb; outline-offset: 2px; }
h1:focus, h2:focus, .sheet:focus { outline: none; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.app {
  max-width: var(--maxw);
  min-height: 100dvh;
  margin: 0 auto;
  position: relative;
  background: var(--bg);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04), 0 20px 60px rgba(0, 0, 0, 0.12);
}
.screen { animation: enter 0.25s ease backwards; }
@keyframes enter { from { opacity: 0; } }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: 999px;
  font-weight: 700; white-space: nowrap;
  transition: transform 0.12s, background 0.15s, box-shadow 0.15s;
}
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn--primary { background: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(22, 128, 60, 0.28); }
.btn--primary:disabled { background: #c9d3cc; box-shadow: none; }
.btn--light { background: #fff; color: var(--brand-d); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18); }
.btn--ghost { background: var(--surface); border: 1.5px solid var(--line); }
.btn--danger-ghost { background: var(--danger-l); color: var(--danger); }
.btn--lg { min-height: 56px; font-size: 1.05rem; padding: 0 26px; }
.btn--block { width: 100%; }
.btn--grow { flex: 1; }

.icon-btn {
  width: 44px; height: 44px; flex: none; border-radius: 14px;
  display: grid; place-items: center; background: var(--surface); box-shadow: var(--sh-1);
}
.icon-btn--flat { background: transparent; box-shadow: none; color: var(--muted); }

.tag {
  display: inline-block; vertical-align: middle; margin-left: 6px;
  padding: 2px 8px; border-radius: 999px;
  background: #fef3c7; color: #92400e; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.02em;
}
.count-chip {
  display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 9px;
  border-radius: 999px; background: var(--brand-l); color: var(--brand-d);
  font-size: 0.85rem; font-weight: 800; vertical-align: middle;
}

/* ---------- Início ---------- */
.home-hero {
  position: relative; overflow: hidden; color: #fff;
  padding: calc(20px + env(safe-area-inset-top)) 22px 32px;
  background: linear-gradient(160deg, #1b9c4b 0%, #116530 100%);
  border-radius: 0 0 32px 32px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.05rem; letter-spacing: -0.01em; }
.brand__logo {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.18); font-size: 1.25rem;
}
.home-hero__title { font-size: 1.9rem; line-height: 1.12; letter-spacing: -0.02em; margin: 26px 0 10px; max-width: 12em; }
.home-hero__title em { font-style: normal; color: #fde68a; }
.home-hero p { opacity: 0.92; max-width: 24em; margin-bottom: 22px; }
.hero-deco {
  position: absolute; right: 18px; bottom: 30px; width: 76px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px; font-size: 1.7rem; line-height: 1;
  transform: rotate(8deg); pointer-events: none;
}
.hero-deco i { font-style: normal; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.2)); }

.home-body { padding: 26px 16px 40px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 0 4px 12px; }
.section-head h2 { font-size: 1.15rem; letter-spacing: -0.01em; }

.list-cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.list-cards > li { min-width: 0; }
.list-card {
  width: 100%; display: flex; align-items: center; gap: 14px; padding: 14px;
  background: var(--surface); border-radius: var(--r-md); box-shadow: var(--sh-1);
  text-align: left; color: var(--muted); transition: transform 0.12s;
}
.list-card:active { transform: scale(0.98); }
.list-card__stack { display: flex; flex: none; padding-left: 12px; }
.list-card__stack span {
  width: 42px; height: 42px; margin-left: -12px; border-radius: 13px;
  display: grid; place-items: center; font-size: 1.35rem;
  background: var(--tile); border: 2px solid #fff;
}
.list-card__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.list-card__name { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--ink); font-weight: 700; }
.list-card__title { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-card__name .tag { flex: none; }
.list-card__meta { font-size: 0.85rem; }
.proto-note { margin: 28px 4px 0; text-align: center; font-size: 0.8rem; color: var(--muted); }

/* ---------- Criação de lista ---------- */
.create-head {
  position: sticky; top: 0; z-index: 20;
  padding: calc(10px + env(safe-area-inset-top)) 14px 8px;
  background: rgba(246, 243, 236, 0.94);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.topbar { display: flex; align-items: center; gap: 8px; }
.name-field { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 0 6px; color: var(--muted); border-bottom: 2px solid transparent; }
.name-field:focus-within { border-bottom-color: var(--brand); }
.name-field svg { width: 18px; height: 18px; flex: none; }
.name-field input {
  flex: 1; min-width: 0; padding: 8px 0; border: 0; outline: 0; background: transparent;
  font: inherit; font-size: 1.2rem; font-weight: 800; letter-spacing: -0.01em; color: var(--ink);
}
.name-field input::placeholder { color: #98a59c; font-weight: 700; }
.name-field input[aria-invalid="true"] { color: var(--danger, #b3261e); }
.name-warn { margin: 4px 6px 0; font-size: 0.85rem; font-weight: 700; color: var(--danger, #b3261e); }
.name-warn[hidden] { display: none; }

.search { position: relative; margin-top: 8px; }
.search input {
  width: 100%; height: 48px; padding: 0 44px; border-radius: 16px;
  border: 1.5px solid var(--line); background: #fff; font: inherit; font-size: 1rem; color: var(--ink);
  -webkit-appearance: none; appearance: none;
}
.search input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(22, 128, 60, 0.14); }
.search input::-webkit-search-cancel-button { display: none; }
.search__icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); display: grid; color: var(--muted); pointer-events: none; }
.search__clear {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: var(--muted);
}
.search__clear[hidden] { display: none; }

.chips {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  margin: 0 -14px; padding: 10px 14px 4px;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px;
  border-radius: 999px; background: #fff; border: 1.5px solid var(--line);
  font-size: 0.9rem; font-weight: 600; white-space: nowrap; transition: background 0.15s, color 0.15s;
}
.chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }

.catalog { padding: 6px 14px 140px; }
.catalog__count { margin: 10px 4px; font-size: 0.85rem; color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid > .empty { grid-column: 1 / -1; }

.product-card {
  display: flex; flex-direction: column; gap: 2px; padding: 10px; text-align: left;
  background: var(--surface); border: 2px solid transparent; border-radius: var(--r-md); box-shadow: var(--sh-1);
  transition: transform 0.12s, border-color 0.15s, background 0.15s;
  animation: pop 0.25s ease backwards;
}
.product-card:active { transform: scale(0.97); }
.product-card.is-selected { border-color: var(--brand); background: var(--brand-xl); }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } }
.product-card__img {
  position: relative; display: grid; place-items: center; aspect-ratio: 1 / 0.82; margin-bottom: 8px;
  border-radius: 12px; background: var(--tile); overflow: hidden;
}
.product-card__emoji { font-size: 3.1rem; line-height: 1; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.14)); }
.product-card__add {
  position: absolute; right: 8px; bottom: 8px; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; background: #fff; color: var(--brand); box-shadow: var(--sh-1);
}
.product-card__add svg { width: 18px; height: 18px; }
.product-card__badge {
  position: absolute; right: 8px; top: 8px; display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px 3px 6px; border-radius: 999px; background: var(--brand); color: #fff;
  font-size: 0.78rem; font-weight: 800;
}
.product-card__badge svg { width: 14px; height: 14px; stroke-width: 3; }
.product-card__name { font-size: 0.95rem; font-weight: 700; line-height: 1.2; }
.product-card__cat { font-size: 0.78rem; color: var(--muted); }

.empty { padding: 36px 20px; text-align: center; color: var(--muted); }
.empty__emoji { font-size: 2.6rem; }
.empty h3 { margin: 8px 0 4px; color: var(--ink); }

/* ---------- Carrinho: barra fixa ---------- */
.cartbar-wrap {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: center; pointer-events: none;
  padding: 0 12px calc(12px + env(safe-area-inset-bottom));
}
.cartbar {
  pointer-events: auto; width: 100%; max-width: calc(var(--maxw) - 24px);
  display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 12px;
  border-radius: 22px; background: #17261d; color: #fff; text-align: left; box-shadow: var(--sh-2);
}
.cartbar__icon {
  position: relative; flex: none; width: 44px; height: 44px; border-radius: 14px;
  display: grid; place-items: center; background: rgba(255, 255, 255, 0.12);
}
.cartbar__icon.bump { animation: bump 0.4s ease; }
@keyframes bump { 40% { transform: scale(1.18) rotate(-6deg); } }
.cartbar__count {
  position: absolute; top: -6px; right: -6px; min-width: 22px; height: 22px; padding: 0 5px;
  border-radius: 11px; display: grid; place-items: center;
  background: var(--accent); color: #17261d; font-size: 0.75rem; font-weight: 800;
}
.cartbar__body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cartbar__body small { opacity: 0.72; font-size: 0.8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cartbar__stack { display: flex; padding-left: 10px; }
.cartbar__stack span {
  width: 34px; height: 34px; margin-left: -10px; border-radius: 50%; border: 2px solid #17261d;
  display: grid; place-items: center; background: var(--tile); font-size: 1.1rem;
}
.cartbar__stack .more { background: #2d4036; color: #fff; font-size: 0.72rem; font-weight: 700; }
.cartbar__cta { flex: none; height: 44px; padding: 0 16px; border-radius: 14px; display: grid; place-items: center; background: var(--brand); font-weight: 800; }
.cartbar.is-empty .cartbar__cta { background: rgba(255, 255, 255, 0.12); color: rgba(255, 255, 255, 0.72); }

/* ---------- Folhas (bottom sheets) ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
.overlay.is-open { pointer-events: auto; }
.backdrop { position: absolute; inset: 0; background: rgba(15, 25, 19, 0.5); opacity: 0; transition: opacity 0.22s; }
.overlay.is-open .backdrop { opacity: 1; }
.sheet-wrap { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; pointer-events: none; }
.sheet {
  pointer-events: auto; width: 100%; max-width: var(--maxw); max-height: 88dvh;
  display: flex; flex-direction: column;
  background: var(--surface); border-radius: 28px 28px 0 0; box-shadow: var(--sh-2);
  padding-bottom: env(safe-area-inset-bottom);
  transform: translateY(105%); transition: transform 0.26s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.overlay.is-open .sheet { transform: none; }
.sheet__grab { width: 40px; height: 4px; margin: 10px auto 4px; border-radius: 2px; background: var(--line); flex: none; }
.sheet__head { display: flex; align-items: center; justify-content: space-between; padding: 4px 10px 4px 20px; flex: none; }
.sheet__head h2 { font-size: 1.25rem; letter-spacing: -0.01em; }
.sheet__foot { display: flex; gap: 10px; padding: 14px 18px 18px; flex: none; }

.cart-list { overflow-y: auto; padding: 4px 14px; }
.cart-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cart-row:last-child { border-bottom: 0; }
.qty-pill {
  flex: none; padding: 6px 12px; border-radius: 999px; white-space: nowrap;
  background: var(--brand-l); color: var(--brand-d); font-weight: 800; font-size: 0.92rem;
}
.qty-pill--btn { min-height: 38px; }

.qty-product { display: flex; align-items: center; gap: 14px; padding: 6px 10px 4px 18px; }
.qty-product__txt { flex: 1; min-width: 0; }
.qty-product h2 { font-size: 1.2rem; letter-spacing: -0.01em; }
.qty-product p { font-size: 0.88rem; color: var(--muted); }
.tile { flex: none; width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: var(--tile); font-size: 2.2rem; }
.qty-label { padding: 14px 20px 6px; font-size: 0.78rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.stepper { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 6px 18px; }
.stepper__btn { flex: none; width: 60px; height: 60px; border-radius: 20px; display: grid; place-items: center; background: var(--brand-l); color: var(--brand-d); transition: transform 0.12s; }
.stepper__btn:active { transform: scale(0.92); }
.stepper__btn svg { width: 26px; height: 26px; }
.stepper__field { flex: 1; max-width: 170px; display: flex; flex-direction: column; align-items: center; }
.stepper__field input {
  width: 100%; border: 0; outline: 0; background: transparent; text-align: center;
  font: inherit; font-size: 2.5rem; font-weight: 800; letter-spacing: -0.02em; color: var(--ink);
  -moz-appearance: textfield; appearance: textfield;
}
.stepper__field input::-webkit-inner-spin-button, .stepper__field input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.stepper__field:focus-within input { color: var(--brand-d); }
.stepper__unit { margin-top: -4px; font-size: 0.9rem; font-weight: 600; color: var(--muted); }
.quick { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 12px 18px 0; }
.quick button { min-width: 54px; height: 40px; padding: 0 14px; border-radius: 999px; background: #fff; border: 1.5px solid var(--line); font-weight: 700; }
.quick button.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* Marca do produto (opcional) */
.sheet__scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-bottom: 4px; }
.qty-label__opt { font-weight: 600; letter-spacing: 0; text-transform: none; }
.brands { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 18px 0; }
.brands button { min-height: 40px; max-width: 100%; padding: 0 14px; border-radius: 999px; background: #fff; border: 1.5px solid var(--line); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brands button.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }
.brand-other { display: block; padding: 10px 18px 0; }
.brand-other[hidden] { display: none; }
.brand-other input { width: 100%; height: 46px; padding: 0 14px; border-radius: 14px; border: 1.5px solid var(--line); background: #fff; font-size: 1rem; font-weight: 600; }
.brand-other input:focus { outline: none; border-color: var(--brand); }
.brand-tag { font-weight: 800; color: var(--brand-d); }
.shop-item__brand { align-self: flex-start; max-width: 100%; margin: 1px 0; padding: 2px 10px; border-radius: 999px; background: var(--line); font-size: 0.92rem; font-weight: 800; color: var(--ink); overflow-wrap: anywhere; }
.shop-item.is-done .shop-item__brand { color: var(--muted); text-decoration: line-through; }
.shop-item.is-checking .shop-item__brand { text-decoration: line-through; color: var(--muted); }

/* ---------- Visualização da lista ---------- */
.topbar--solid {
  position: sticky; top: 0; z-index: 20;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
  background: rgba(246, 243, 236, 0.94);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.topbar__title { flex: 1; min-width: 0; font-size: 1.3rem; font-weight: 800; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.view-body { padding: 8px 14px 130px; }
.view-summary { display: flex; align-items: center; justify-content: space-between; margin: 6px 4px 14px; font-size: 0.9rem; color: var(--muted); }
.item-list { overflow: hidden; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-1); }
.item-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.item-row:last-child { border-bottom: 0; }
.item-row__tile { flex: none; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--tile); font-size: 1.5rem; }
.item-row__main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.item-row__name { font-weight: 700; }
.item-row__cat { font-size: 0.8rem; color: var(--muted); }

.actionbar-wrap {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: center; pointer-events: none;
  padding: 0 12px calc(12px + env(safe-area-inset-bottom));
}
.actionbar {
  pointer-events: auto; width: 100%; max-width: calc(var(--maxw) - 24px); display: flex; gap: 10px; padding: 10px;
  border-radius: 26px; background: rgba(255, 255, 255, 0.94); box-shadow: var(--sh-2);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Arrastar e soltar no carrinho (etapa 2) ---------- */
.product-card { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body.is-dragging-item, body.is-dragging-item * { cursor: grabbing !important; -webkit-user-select: none; user-select: none; }
@media (hover: hover) { .product-card { cursor: grab; } }

.product-card.is-dragging { opacity: 0.45; border-style: dashed; border-color: var(--brand); transform: scale(0.97); }
.product-card.drag-cancelled { animation: cancel-pulse 0.35s ease; }
@keyframes cancel-pulse { 40% { box-shadow: 0 0 0 4px var(--danger-l); } }

.drag-ghost {
  position: fixed; left: 0; top: 0; z-index: 200; width: 92px; padding: 8px 6px 7px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: var(--surface); border-radius: var(--r-md); box-shadow: var(--sh-2);
  pointer-events: none; will-change: transform; touch-action: none;
}
.drag-ghost.is-landing { transition: transform 0.18s ease-in, opacity 0.18s ease-in; opacity: 0; }
.drag-ghost.is-returning { transition: transform 0.2s ease-out, opacity 0.2s ease-out; opacity: 0; }
.drag-ghost__tile {
  width: 62px; height: 62px; border-radius: 16px; background: var(--tile);
  display: grid; place-items: center; font-size: 2.2rem; line-height: 1;
  animation: ghost-pop 0.16s ease-out;
}
.drag-ghost__name { max-width: 100%; font-size: 0.72rem; font-weight: 700; text-align: center; line-height: 1.15; overflow-wrap: anywhere; }
@keyframes ghost-pop { from { transform: scale(0.7); } }

#cartbar .cartbar { transition: transform 0.15s, background 0.15s, box-shadow 0.15s; }
#cartbar.drag-active .cartbar { box-shadow: 0 0 0 3px var(--accent), var(--sh-2); animation: drop-ready 1s ease-in-out infinite; }
#cartbar.drag-active .cartbar__body small { font-size: 0; }
#cartbar.drag-active .cartbar__body small::after { content: 'Solte aqui para escolher a quantidade'; font-size: 0.8rem; }
#cartbar.drag-active.drag-over .cartbar { animation: none; transform: scale(1.03); background: var(--brand-d); box-shadow: 0 0 0 4px #fff, 0 0 0 7px var(--brand), var(--sh-2); }
#cartbar.drop-ok .cartbar { animation: drop-ok 0.5s ease; }
@keyframes drop-ready { 50% { box-shadow: 0 0 0 6px rgba(245, 158, 11, 0.35), var(--sh-2); } }
@keyframes drop-ok { 30% { transform: scale(1.05); box-shadow: 0 0 0 8px rgba(22, 128, 60, 0.4), var(--sh-2); } }

.drag-status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Modo supermercado (etapa 3) ---------- */
.btn--sm { min-height: 40px; padding: 0 14px; font-size: 0.9rem; }
.btn:disabled { opacity: 0.5; }
.btn--ghost:disabled { background: var(--surface); }
.btn--primary:disabled { opacity: 1; }
.btn small { display: block; font-size: 0.72rem; font-weight: 600; color: var(--muted); }
.btn__txt { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; line-height: 1.15; text-align: left; }
.btn__txt small { max-width: 11em; overflow: hidden; text-overflow: ellipsis; }
.btn--undo { padding: 0 14px; }

.sheet__text { padding: 6px 20px 0; color: var(--muted); }

.actionbar--stack { flex-direction: column; }
.actionbar__row { display: flex; gap: 10px; }
.view-body--shop { padding-bottom: 210px; }

.resume-note {
  display: flex; align-items: center; gap: 12px; margin: 6px 0 14px; padding: 12px 12px 12px 16px;
  border-radius: var(--r-md); background: var(--brand-l); color: var(--brand-d);
}
.resume-note { flex-wrap: wrap; }
.resume-note__txt { flex: 1 1 14em; min-width: 0; display: flex; flex-direction: column; font-size: 0.85rem; }
.resume-note__txt strong { font-size: 0.98rem; }

.list-cards--andamento { margin-bottom: 26px; }
.list-card--shop { border: 2px solid var(--brand-l); }
.list-card--shop .list-card__meta { color: var(--brand-d); font-weight: 700; }
.list-card__cta { flex: none; padding: 8px 14px; border-radius: 999px; background: var(--brand); color: #fff; font-weight: 800; font-size: 0.9rem; }
.mini-bar { display: block; height: 6px; margin-top: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.mini-bar span { display: block; height: 100%; background: var(--brand); border-radius: inherit; }

.shop-head { flex-direction: column; align-items: stretch; gap: 10px; padding-bottom: 12px; }
.shop-head__row { display: flex; align-items: center; gap: 10px; }
.shop-progress__nums { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.shop-progress__big { font-size: 1rem; font-weight: 700; color: var(--muted); }
.shop-progress__big b { font-size: 1.7rem; font-weight: 800; color: var(--ink); letter-spacing: -0.02em; }
.shop-progress__pct { font-size: 1.5rem; font-weight: 800; color: var(--brand-d); font-variant-numeric: tabular-nums; }
.shop-bar { height: 14px; margin-top: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.shop-bar span { display: block; height: 100%; background: var(--brand); border-radius: inherit; transition: width 0.35s ease; }
.shop-progress__left { margin-top: 6px; font-size: 0.9rem; color: var(--muted); }

.shop-body { padding: 8px 14px 170px; }
.shop-list { display: grid; gap: 10px; }
.shop-item {
  display: flex; align-items: center; gap: 14px; min-height: 88px; padding: 12px 12px 12px 14px;
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-1);
  transition: opacity 0.3s, transform 0.3s;
}
.shop-item__tile { flex: none; width: 58px; height: 58px; border-radius: 17px; display: grid; place-items: center; background: var(--tile); font-size: 2rem; }
.shop-item__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.shop-item__name { font-size: 1.1rem; font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; }
.shop-item__qty { font-size: 1.02rem; font-weight: 800; color: var(--brand-d); }
.shop-check {
  flex: none; width: 66px; height: 66px; border-radius: 50%; display: grid; place-items: center;
  border: 3px solid var(--brand); background: var(--brand-xl); color: var(--brand);
  transition: transform 0.12s, background 0.15s, color 0.15s;
}
.shop-check svg { width: 32px; height: 32px; stroke-width: 3; opacity: 0.4; }
.shop-check:active { transform: scale(0.9); }
.shop-item.is-checking { opacity: 0.6; transform: scale(0.98); }
.shop-item.is-checking .shop-check { background: var(--brand); color: #fff; animation: check-pop 0.32s ease; }
.shop-item.is-checking .shop-check svg, .shop-item.is-done .shop-check svg { opacity: 1; }
.shop-item.is-checking .shop-item__name { text-decoration: line-through; color: var(--muted); }
.shop-item.is-done { background: var(--brand-xl); box-shadow: none; min-height: 72px; }
.shop-item.is-done .shop-item__name { text-decoration: line-through; color: var(--muted); font-weight: 700; }
.shop-item.is-done .shop-item__qty { color: var(--muted); }
.shop-item.is-done .shop-item__tile { opacity: 0.65; }
.shop-item.is-done .shop-check { width: 54px; height: 54px; background: var(--brand); color: #fff; }
.shop-item.flash { animation: item-flash 0.7s ease; }
@keyframes check-pop { 50% { transform: scale(1.2); } }
@keyframes item-flash { 0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); } 100% { box-shadow: 0 0 0 14px rgba(245, 158, 11, 0); } }

.shop-done { margin-top: 18px; }
.shop-done__toggle {
  width: 100%; min-height: 52px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 8px; font-weight: 800; font-size: 1.02rem;
}
.shop-done__chev { display: grid; color: var(--muted); transition: transform 0.2s; }
.shop-done__chev.is-open { transform: rotate(90deg); }
.shop-list--done { margin-top: 4px; }

.shop-finish { padding: calc(40px + env(safe-area-inset-top)) 16px 170px; text-align: center; }
.finish-badge {
  width: 96px; height: 96px; margin: 0 auto 18px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand); color: #fff; box-shadow: 0 12px 30px rgba(22, 128, 60, 0.32); animation: check-pop 0.5s ease;
}
.finish-badge svg { width: 52px; height: 52px; stroke-width: 3; }
.shop-finish h1 { font-size: 1.7rem; letter-spacing: -0.02em; }
.shop-finish__msg { margin: 8px auto 22px; max-width: 24em; color: var(--muted); }
.shop-finish__list { text-align: left; }

.actionbar--finish .btn { min-height: 56px; padding: 0 14px; }
.actionbar--finish .btn--primary { font-size: 1.05rem; }

/* ---------- Conta (etapa 4A) ---------- */
.home-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.account-chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px 0 12px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.18); color: #fff; font-weight: 700; font-size: 0.92rem;
}
.account-chip svg { width: 18px; height: 18px; }
.account-chip--on { padding-left: 6px; }
.account-chip__av, .account-who__av {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: #fde68a; color: #7a4b00; font-weight: 800; font-size: 0.9rem;
}
.account-body { padding: 8px 14px 60px; }
.account-card { display: flex; flex-direction: column; gap: 14px; padding: 18px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--sh-1); }
.account-card h2 { font-size: 1.15rem; letter-spacing: -0.01em; }
.account-card p { color: var(--ink); }
.account-card .account-note { font-size: 0.88rem; color: var(--muted); }
.account-steps { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.account-who { display: flex; align-items: center; gap: 12px; }
.account-who__av { width: 48px; height: 48px; font-size: 1.25rem; }
.account-who__txt { display: flex; flex-direction: column; min-width: 0; }
.account-who__txt span { color: var(--muted); font-size: 0.9rem; overflow-wrap: anywhere; }
.account-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 999px; background: var(--bg); }
.account-tabs button { min-height: 44px; border-radius: 999px; font-weight: 700; color: var(--muted); }
.account-tabs button[aria-selected="true"] { background: var(--surface); color: var(--brand-d); box-shadow: var(--sh-1); }
.account-form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: 0.92rem; }
.field small { font-weight: 500; color: var(--muted); }
.field input {
  height: 52px; padding: 0 14px; border-radius: 14px; border: 1.5px solid var(--line); background: #fff;
  font: inherit; font-size: 1rem; font-weight: 500; color: var(--ink); -webkit-appearance: none; appearance: none;
}
.field input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(22, 128, 60, 0.14); }
.account-msg { font-size: 0.92rem; border-radius: 12px; }
.account-msg:empty { display: none; }
.account-msg--erro { padding: 10px 12px; background: var(--danger-l); color: var(--danger); font-weight: 600; }
.account-msg--ok { padding: 10px 12px; background: var(--brand-l); color: var(--brand-d); font-weight: 600; }

/* ---------- Listas na conta (etapa 4B, fatia 1) ---------- */
.cloud-box {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin: 0 0 14px; padding: 12px 12px 12px 16px;
  border-radius: var(--r-md); background: var(--surface); border: 1.5px solid var(--line);
}
.cloud-box__txt { flex: 1 1 14em; min-width: 0; display: flex; flex-direction: column; font-size: 0.85rem; color: var(--muted); }
.cloud-box__txt strong { font-size: 0.98rem; color: var(--ink); }
.cloud-box .account-msg { flex: 1 1 100%; }
.cloud-note { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 0 4px; font-size: 0.92rem; color: var(--muted); }
.cloud-note--erro { padding: 10px 12px; border-radius: 12px; background: var(--danger-l); color: var(--danger); font-weight: 600; }
.actionbar__row--wrap { flex-wrap: wrap; }
.sheet .account-msg { margin: 8px 20px 0; }

/* ---------- Convites e pessoas (etapa 4B, fatia 2) ---------- */
.tag--share { background: #fff0d6; color: #8a4b00; }
/* "Compartilhada com …" (lista minha) em azul; "Compartilhada por …" (lista de outra pessoa) em âmbar */
.list-card__share, .cloud-box__share {
  display: inline-flex; align-items: flex-start; gap: 5px; align-self: flex-start; margin-top: 4px; padding: 3px 10px 3px 8px;
  border-radius: 12px; font-size: 0.78rem; font-weight: 800; line-height: 1.25; overflow-wrap: anywhere;
}
.list-card__share svg, .cloud-box__share svg { flex: none; width: 14px; height: 14px; margin-top: 1px; }
.list-card__share--com { background: #e2edfc; color: #1b4f9c; }
.list-card__share--por { background: #fff0d6; color: #8a4b00; }
.list-card__cloud { flex: none; display: inline-grid; place-items: center; color: var(--brand); }
.list-card__cloud svg { width: 18px; height: 18px; }
.lists-section .cloud-note { margin-top: 12px; }
.section-head .btn { flex: none; }
.people-card { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; padding: 18px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--sh-1); }
.people-card h2 { font-size: 1.1rem; letter-spacing: -0.01em; }
.people-note { font-size: 0.88rem; color: var(--muted); }
.people, .invites { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.person { display: flex; align-items: center; gap: 12px; }
.person__av {
  flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%;
  background: var(--brand-l); color: var(--brand-d); font-weight: 800;
}
.person__txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.person__txt strong { overflow-wrap: anywhere; }
.person__txt span { font-size: 0.85rem; color: var(--muted); }
.invite { display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: var(--r-md); background: var(--bg); }
.invite__code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 1.15rem; font-weight: 800; letter-spacing: 0.04em; overflow-wrap: anywhere; }
.invite__meta { font-size: 0.85rem; color: var(--muted); }
.invite__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.sheet__foot--stack { flex-direction: column; }
.sheet__field { padding: 12px 20px 0; }
.sheet__foot--stack .btn { white-space: normal; padding: 12px 18px; line-height: 1.25; text-align: center; border-radius: 22px; }

/* Ilustrações dos produtos (SVG): ocupam 1,45em, então o tamanho segue o font-size de cada quadradinho. */
.fig { display: block; flex: none; width: 1.45em; height: 1.45em; }
/* Foto do produto: fundo branco da foto some sobre a cor do quadradinho (mix-blend-mode: multiply). */
.fig--foto { width: 1.8em; height: 1.8em; object-fit: contain; mix-blend-mode: multiply; pointer-events: none; -webkit-user-drag: none; }
.product-card__emoji:has(> .fig--foto) { filter: none; }
