/* style.css — app-level layout, animations, screen-specific styles */

* { box-sizing: border-box; }

html, body, #app {
  height: 100%;
  background: var(--bg-cream);
  overflow: hidden;
  overscroll-behavior: none;
}

/* PWA safe areas for iOS standalone */
:root {
  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ── Animations ─────────────────────────────────────────────────────── */
@keyframes bh-pop-in {
  from { opacity: 0; transform: translateY(8px) scale(.92); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}
@keyframes bh-fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes bh-fade-in {
  from { opacity: 0; } to { opacity: 1; }
}
@keyframes bh-slide-up {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
@keyframes bh-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(216,113,86,0.5), 0 0 0 0 rgba(216,113,86,0.3); }
  50%      { box-shadow: 0 0 0 8px rgba(216,113,86,0.18), 0 0 0 16px rgba(216,113,86,0.08); }
}
@keyframes bh-wave {
  0%, 100% { height: 30%; }
  50%      { height: 100%; }
}
@keyframes bh-spin {
  to { transform: rotate(360deg); }
}

/* ── Layout ─────────────────────────────────────────────────────────── */
.screen {
  position: absolute;
  inset: 0;
  background: var(--bg-cream);
  display: flex;
  flex-direction: column;
}

.tab-screen { display: none; }
.tab-screen.is-active { display: flex; }

/* ── Top bar ────────────────────────────────────────────────────────── */
.top-bar {
  padding: calc(var(--safe-top) + 16px) 20px 0;
  display: flex;
  align-items: center;
  gap: 12px;
}
.top-bar-meta {
  flex: 1;
}
.top-bar-meta .eyebrow {
  font-size: 11px; color: var(--ink-400); font-weight: 600;
  letter-spacing: 0.5px; text-transform: uppercase;
}
.top-bar-meta .title {
  font-size: 18px; font-weight: 700; line-height: 1; margin-top: 2px;
}
.profile-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 4px 4px 10px;
  background: rgba(0,0,0,0.04);
  border-radius: 9999px;
  color: var(--ink-700);
  font-size: 13px; font-weight: 600;
}

/* "Add to home screen" chip — sits before the profile chip in the top bar */
.install-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  background: var(--green-50);
  color: var(--green-700);
  border-radius: 9999px;
  font-size: 12px; font-weight: 700;
  box-shadow: inset 0 0 0 1px var(--green-100);
  transition: background .15s, transform .15s;
}
.install-chip:active {
  transform: scale(.96);
  background: var(--green-100);
}
.install-label {
  /* Narrow screens (small iPhones): icon-only */
  display: none;
}
@media (min-width: 380px) {
  .install-label { display: inline; }
}

/* iOS install instructions modal — borrows the sheet styling */
.install-help { padding: 0 24px; }
.install-help ol { margin: 4px 0 16px; padding-left: 22px; }
.install-help li {
  padding: 8px 0; font-size: 14px; line-height: 1.5;
  color: var(--ink-700);
}
.install-help strong { color: var(--ink-900); }
.install-help svg { margin: 0 2px; }

/* ── Avatar ─────────────────────────────────────────────────────────── */
.avatar {
  border-radius: 50%;
  display: grid; place-items: center;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  line-height: 1;
}
.avatar::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.25), transparent 60%);
  pointer-events: none;
}
.avatar > span {
  position: relative;
  line-height: 1;
}

/* ── Search bar ─────────────────────────────────────────────────────── */
.search-wrap {
  padding: 14px 20px 8px;
}
.search-bar {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border-radius: 18px;
  padding: 12px 12px 12px 16px;
  box-shadow: var(--sh-card);
  border: 1px solid var(--line-soft);
}
.search-bar input {
  flex: 1; border: 0; outline: none;
  font-family: inherit; font-size: 16px;
  background: transparent; color: var(--ink-900);
  min-width: 0;
}
.search-clear {
  width: 26px; height: 26px; border-radius: 9999px;
  background: rgba(0,0,0,0.06);
  display: grid; place-items: center;
  color: var(--ink-500);
}
.mic-btn {
  width: 38px; height: 38px; border-radius: 9999px;
  display: grid; place-items: center;
  background: var(--green-500); color: #fff;
  box-shadow: 0 2px 6px rgba(79,149,104,0.4);
  transition: background .2s, box-shadow .2s;
}
.mic-btn.listening {
  background: var(--terra-500);
  box-shadow: 0 0 0 6px rgba(216,113,86,0.18), 0 0 0 12px rgba(216,113,86,0.10);
  animation: bh-pulse 1.2s ease-in-out infinite;
}
.listening-strip {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 4px 0;
  color: var(--terra-600);
  font-size: 13px; font-weight: 600;
}
.wave {
  display: flex; gap: 3px; align-items: flex-end; height: 14px;
}
.wave span {
  width: 3px; background: var(--terra-500); border-radius: 2px;
  animation: bh-wave 1.1s ease-in-out infinite;
  height: 60%;
}

/* ── Quantity pill ──────────────────────────────────────────────────── */
.qty-pill {
  display: inline-flex; align-items: center;
  background: linear-gradient(180deg, #5BAA77, #4F9568);
  color: #fff;
  border-radius: 9999px;
  box-shadow: 0 2px 0 rgba(45,80,55,0.25), 0 4px 12px rgba(45,80,55,0.20);
  user-select: none;
  font-variant-numeric: tabular-nums;
  transition: all .22s cubic-bezier(.2,.7,.3,1);
}
.qty-pill.ghost {
  background: rgba(79,149,104,0.10);
  color: var(--green-700);
  box-shadow: inset 0 0 0 1px rgba(79,149,104,0.18);
}
.qty-pill .qty-dec, .qty-pill .qty-num {
  width: 0; opacity: 0; overflow: hidden;
  transition: width .25s cubic-bezier(.4,1.4,.5,1), opacity .15s, margin .25s;
}
.qty-pill.has-qty .qty-dec, .qty-pill.has-qty .qty-num {
  opacity: 1;
}
.qty-pill button {
  display: grid; place-items: center;
  color: inherit; font-weight: 700;
}
.qty-pill.size-sm { height: 28px; padding: 0 6px; }
.qty-pill.size-sm button { width: 22px; height: 22px; font-size: 14px; }
.qty-pill.size-sm .qty-num { font-size: 14px; }
.qty-pill.size-sm.has-qty .qty-dec { width: 22px; }
.qty-pill.size-sm.has-qty .qty-num { width: 22px; margin: 0 4px; text-align: center; }

.qty-pill.size-md { height: 36px; padding: 0 8px; }
.qty-pill.size-md button { width: 28px; height: 28px; font-size: 16px; }
.qty-pill.size-md .qty-num { font-size: 16px; }
.qty-pill.size-md.has-qty .qty-dec { width: 28px; }
.qty-pill.size-md.has-qty .qty-num { width: 28px; margin: 0 6px; text-align: center; }

.qty-pill button.qty-inc { font-size: 1.2em; }

/* ── Fav star ───────────────────────────────────────────────────────── */
.fav-star {
  border-radius: 9999px;
  display: grid; place-items: center;
  background: rgba(0,0,0,0.04);
  color: var(--ink-400);
  transition: all .2s, transform .25s cubic-bezier(.4,1.6,.5,1);
}
.fav-star.on {
  background: rgba(230,169,74,0.16);
  color: #D89220;
  transform: scale(1.05);
}

/* ── Badge ──────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 9999px;
  font-size: 13px; font-weight: 600;
  white-space: nowrap;
}
.badge.green { background: var(--green-50); color: var(--green-700); box-shadow: inset 0 0 0 1px var(--green-100); }
.badge.cream { background: var(--surface-sunk); color: var(--ink-700); box-shadow: inset 0 0 0 1px var(--line); }
.badge.sm { padding: 2px 8px; font-size: 11px; }

/* ── Tab bar ────────────────────────────────────────────────────────── */
.tab-bar {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid var(--line-soft);
  padding-bottom: calc(var(--safe-bottom) + 16px);
  padding-top: 8px;
  display: flex;
  z-index: 20;
}
.tab-btn {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 4px;
  color: var(--ink-500);
  transition: color .2s;
  position: relative;
}
.tab-btn.is-active { color: var(--green-600); }
.tab-btn.is-active .tab-label { font-weight: 700; }
.tab-label { font-size: 10.5px; font-weight: 500; letter-spacing: 0.1px; }
.tab-icon-wrap { position: relative; }
.tab-badge {
  position: absolute; top: -4px; right: -8px;
  background: var(--terra-500); color: #fff;
  font-size: 10px; font-weight: 800;
  min-width: 16px; height: 16px; padding: 0 5px;
  border-radius: 9999px;
  display: grid; place-items: center;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.9);
}

/* ── Profile picker ─────────────────────────────────────────────────── */
.picker {
  position: absolute; inset: 0;
  background: radial-gradient(120% 80% at 50% 0%, #FEFAF1 0%, var(--bg-cream) 55%, var(--bg-cream-deep) 100%);
  display: flex; flex-direction: column;
  padding-top: calc(var(--safe-top) + 90px);
  padding-bottom: 40px;
}
.picker .header { text-align: center; margin-bottom: 36px; padding: 0 20px; }
.picker .family-meta {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 14px 6px 8px;
  background: rgba(79,149,104,0.10);
  border-radius: 9999px;
  font-size: 12px; font-weight: 600;
  color: var(--green-700);
  margin-bottom: 14px;
}
.picker h1 {
  margin: 0; font-family: var(--font-display);
  font-size: 38px; font-weight: 600;
  color: var(--ink-900); letter-spacing: -1.2px;
  line-height: 1.05;
}
.picker h1 em {
  font-style: italic; color: var(--green-600); font-weight: 600;
}
.picker .subtitle {
  margin: 8px 0 0; color: var(--ink-500);
  font-size: 14px; font-weight: 500;
}
.picker-grid {
  display: flex; justify-content: center;
  gap: 24px; flex-wrap: wrap;
  padding: 0 24px;
}
.picker-card {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 8px 4px;
  animation: bh-pop-in .55s cubic-bezier(.2,1.2,.4,1) both;
}
.picker-avatar-wrap {
  position: relative;
  transition: transform .25s cubic-bezier(.2,.7,.3,1);
}
.picker-card:hover .picker-avatar-wrap,
.picker-card:active .picker-avatar-wrap {
  transform: translateY(-4px) scale(1.04);
}
.picker-avatar {
  width: 96px; height: 96px;
  font-size: 48px;
}
.picker-name {
  font-size: 17px; font-weight: 600;
  color: var(--ink-700);
  transition: color .2s;
}
.picker-card:hover .picker-name { color: var(--ink-900); }
.parent-pip {
  position: absolute; bottom: -2px; right: -4px;
  background: #fff;
  border: 2px solid var(--bg-cream);
  border-radius: 9999px;
  padding: 2px 8px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.3px;
  color: var(--green-700);
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.picker-footer {
  margin-top: auto;
  display: flex; justify-content: center; gap: 10px;
  color: var(--ink-400); font-size: 12px;
  align-items: center;
}
@media (min-width: 600px) {
  .picker { padding-top: calc(var(--safe-top) + 120px); }
  .picker .header { margin-bottom: 60px; }
  .picker h1 { font-size: 60px; }
  .picker .subtitle { font-size: 17px; }
  .picker-grid { gap: 48px; }
  .picker-avatar { width: 140px; height: 140px; font-size: 70px; }
  .picker-name { font-size: 22px; }
}

/* ── Search screen ──────────────────────────────────────────────────── */
.scroll-area {
  flex: 1; overflow: auto;
  padding-bottom: 100px;
}
.section-head {
  padding: 10px 20px 8px;
  display: flex; align-items: center; gap: 8px;
}
.section-head h3 {
  margin: 0; font-size: 16px; font-weight: 700; color: var(--ink-900);
}
.section-head .dot {
  width: 8px; height: 8px; border-radius: 9999px;
}
.section-head .see-all {
  font-size: 12px; color: var(--ink-500); font-weight: 600;
}

.fav-row {
  display: flex; gap: 10px;
  padding: 0 20px 4px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
}
.fav-card {
  flex: 0 0 92px;
  background: var(--surface); border-radius: 16px; padding: 8px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  box-shadow: var(--sh-card);
  border: 1px solid var(--line-soft);
  position: relative;
  scroll-snap-align: start;
}
.fav-card .art {
  width: 64px; height: 64px; border-radius: 12px;
  background: var(--surface-sunk);
  display: grid; place-items: center; overflow: hidden;
}
.fav-card .art img { width: 100%; height: 100%; object-fit: contain; }
.fav-card .name {
  font-size: 11px; font-weight: 600; line-height: 1.15;
  text-align: center; height: 2.3em; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  color: var(--ink-700);
}
.fav-card .plus-chip {
  position: absolute; top: 4px; right: 4px;
  width: 22px; height: 22px; border-radius: 9999px;
  background: var(--green-500);
  color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: 14px;
  box-shadow: 0 2px 6px rgba(79,149,104,0.4);
}
.fav-card .plus-chip.has-qty { font-size: 11px; }

.discover-row {
  margin-top: 12px;
}
.discover-row .row-head {
  padding: 6px 20px 8px;
  display: flex; align-items: center; gap: 8px;
}
.discover-row h3 {
  margin: 0; font-size: 15px; font-weight: 700;
}
.discover-row .scroll {
  display: flex; gap: 10px;
  padding: 0 20px;
  overflow-x: auto;
}
.mini-card {
  flex: 0 0 124px;
  background: var(--surface); border-radius: 16px; padding: 10px;
  box-shadow: var(--sh-card);
  border: 1px solid var(--line-soft);
  display: flex; flex-direction: column; gap: 6px;
  position: relative;
}
.mini-card .art-wrap { position: relative; }
.mini-card .art {
  width: 100%; aspect-ratio: 1 / 1; border-radius: 14px;
  background: var(--surface-sunk);
  display: grid; place-items: center; overflow: hidden;
}
.mini-card .art img { width: 100%; height: 100%; object-fit: contain; }
.mini-card .name {
  font-size: 12.5px; font-weight: 600; line-height: 1.2; min-height: 2.4em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.mini-card .row {
  display: flex; align-items: center; justify-content: space-between;
}
.mini-card .price {
  font-size: 14px; font-weight: 800; font-family: var(--font-display);
}

/* ── Results grid ───────────────────────────────────────────────────── */
.results-head {
  padding: 14px 20px 6px;
  display: flex; align-items: baseline; gap: 8px;
}
.results-head h3 { margin: 0; font-size: 17px; font-weight: 700; }
.results-head .for { font-size: 13px; color: var(--ink-500); }
.results-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px; padding: 8px 20px;
}
@media (min-width: 600px) {
  .results-grid { grid-template-columns: repeat(3, 1fr); }
}
.product-card {
  background: var(--surface); border-radius: 20px;
  padding: 12px; display: flex; flex-direction: column; gap: 10px;
  box-shadow: var(--sh-card);
  border: 1px solid var(--line-soft);
  position: relative;
  animation: bh-fade-up .4s cubic-bezier(.2,.7,.3,1) both;
}
.product-card .art-wrap { position: relative; }
.product-card .art {
  width: 100%; aspect-ratio: 1 / 1; border-radius: 14px;
  background: var(--surface-sunk);
  display: grid; place-items: center; overflow: hidden;
}
.product-card .art img { width: 100%; height: 100%; object-fit: contain; }
.product-card .star-overlay {
  position: absolute; top: 6px; right: 6px;
  background: rgba(255,255,255,0.92);
  border-radius: 9999px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
  backdrop-filter: blur(6px);
}
.product-card .cat-pill {
  position: absolute; bottom: 6px; left: 8px;
  background: rgba(255,255,255,0.92);
  padding: 3px 8px; border-radius: 9999px;
  font-size: 10px; font-weight: 700; color: var(--ink-700);
  text-transform: capitalize;
}
.product-card .name {
  font-size: 14px; font-weight: 600; color: var(--ink-900); line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.5em;
}
.product-card .pack { font-size: 11px; color: var(--ink-400); margin-top: 2px; }
.product-card .row {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: auto;
}
.product-card .price {
  font-size: 18px; font-weight: 800; color: var(--ink-900); font-family: var(--font-display);
}

.empty-results, .empty-state {
  text-align: center; padding: 40px;
  color: var(--ink-400);
  grid-column: 1 / -1;
}
.empty-state .emoji { font-size: 48px; margin-bottom: 12px; opacity: 0.6; }
.empty-state .title { font-size: 16px; font-weight: 700; color: var(--ink-700); }
.empty-state .sub { font-size: 13px; margin-top: 4px; color: var(--ink-500); }

/* ── List screen ────────────────────────────────────────────────────── */
.list-header {
  padding: calc(var(--safe-top) + 16px) 20px 0;
  display: flex; align-items: flex-start; gap: 10px;
}
.list-header .titlewrap { flex: 1; }
.list-header h1 {
  margin: 0; font-family: var(--font-display);
  font-size: 32px; font-weight: 600; letter-spacing: -0.8px;
  color: var(--ink-900);
  display: inline-flex; align-items: center; gap: 8px;
}
.sync-strip {
  display: flex; align-items: center; gap: 6px; margin-top: 4px;
}
.sync-strip .pulse {
  width: 6px; height: 6px; border-radius: 9999px;
  background: var(--green-500);
  box-shadow: 0 0 0 3px rgba(79,149,104,0.18);
}
.sync-strip .text { font-size: 12px; color: var(--ink-500); font-weight: 500; }
.sync-strip .dot { font-size: 12px; color: var(--ink-300); }

.contributors {
  padding: 14px 20px 6px;
  display: flex; align-items: center; gap: 8px;
}
.contributors .stack { display: flex; }
.contributors .stack .avatar {
  border: 2px solid var(--bg-cream);
}
.contributors .stack > div + div { margin-left: -8px; }
.contributors .label { font-size: 12px; color: var(--ink-500); font-weight: 600; }

.send-banner {
  margin: 6px 20px 14px;
  background: linear-gradient(135deg, #4F9568, #3F7C56);
  color: #fff; border-radius: 18px;
  padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: 0 12px 24px rgba(63,124,86,0.32), 0 2px 0 rgba(0,0,0,0.04);
  text-align: left; width: calc(100% - 40px);
}
.send-banner .icon-pad {
  width: 44px; height: 44px; border-radius: 12px;
  background: rgba(255,255,255,0.16);
  display: grid; place-items: center;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.2);
}
.send-banner .text { flex: 1; }
.send-banner .text .title { font-size: 15px; font-weight: 700; line-height: 1.2; }
.send-banner .text .sub { font-size: 12px; opacity: 0.85; margin-top: 2px; }

.list-body {
  flex: 1; overflow: auto;
  padding: 0 16px 110px;
}
.section-card {
  background: var(--surface); border-radius: 22px;
  box-shadow: var(--sh-card);
  border: 1px solid var(--line-soft);
  overflow: hidden;
}
.list-section { margin-bottom: 8px; }
.list-section .sect-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 4px 8px;
}
.list-section .sect-head .name { font-weight: 700; color: var(--ink-900); font-size: 15px; }
.list-section .sect-head .count { font-size: 12px; color: var(--ink-400); font-weight: 500; }

.list-row {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
}
.list-row:last-child { border-bottom: none; }
.list-row .thumb {
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--surface-sunk);
  display: grid; place-items: center; overflow: hidden;
  flex-shrink: 0;
}
.list-row .thumb img { width: 100%; height: 100%; object-fit: contain; }
.list-row .info { flex: 1; min-width: 0; }
.list-row .name {
  font-size: 14px; font-weight: 600; color: var(--ink-900);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.list-row .meta {
  display: flex; align-items: center; gap: 6px; margin-top: 2px;
  font-size: 12px;
}
.list-row .meta .pack { color: var(--ink-500); }
.list-row .meta .total { color: var(--ink-700); font-weight: 600; }
.list-row .meta .sep { color: var(--ink-300); }
.list-row .ro-qty {
  font-size: 13px; font-weight: 700; color: var(--ink-500);
  padding: 4px 10px; border-radius: 9999px;
  background: var(--surface-sunk);
}

.clear-btn {
  margin: 20px auto 0;
  display: flex; align-items: center; gap: 8px;
  color: var(--danger); font-size: 13px; font-weight: 600;
  padding: 8px 14px; border-radius: 9999px;
  background: rgba(199,81,57,0.08);
}

/* ── Favourites screen ──────────────────────────────────────────────── */
.fav-screen-head {
  padding: calc(var(--safe-top) + 16px) 20px 0;
  display: flex; align-items: flex-start; gap: 10px;
}
.fav-screen-head h1 {
  margin: 0; font-family: var(--font-display);
  font-size: 32px; font-weight: 600; letter-spacing: -0.8px;
}
.fav-screen-head .sub { font-size: 13px; color: var(--ink-500); margin-top: 4px; }

.scope-toggle {
  padding: 14px 20px 6px;
}
.scope-toggle .group {
  display: inline-flex; background: var(--surface-sunk);
  border-radius: 9999px; padding: 3px; gap: 2px;
  border: 1px solid var(--line-soft);
}
.scope-toggle button {
  padding: 6px 14px; font-size: 12.5px; font-weight: 700;
  border-radius: 9999px;
  background: transparent;
  color: var(--ink-500);
  transition: all .2s;
}
.scope-toggle button.on {
  background: var(--surface); color: var(--ink-900);
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.fav-group { padding: 8px 16px 4px; }
.fav-group .owner-head {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 4px 10px;
  font-weight: 700; font-size: 15px;
}
.fav-group .owner-head .count { font-size: 12px; color: var(--ink-400); font-weight: 500; }

/* ── Modal sheet (Send-to-Woolies) ───────────────────────────────────── */
.sheet-back {
  position: absolute; inset: 0;
  background: rgba(20,15,5,0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: flex-end; justify-content: center;
  z-index: 100;
  animation: bh-fade-in .2s both;
}
.sheet {
  background: var(--bg-cream);
  width: 100%; max-width: 600px;
  border-top-left-radius: 28px; border-top-right-radius: 28px;
  box-shadow: var(--sh-modal);
  max-height: 92%;
  display: flex; flex-direction: column;
  animation: bh-slide-up .35s cubic-bezier(.2,.9,.3,1) both;
  padding-bottom: calc(var(--safe-bottom) + 18px);
  overflow: hidden;
}
.sheet .handle {
  display: flex; justify-content: center; padding: 10px 0 4px;
}
.sheet .handle span {
  width: 44px; height: 5px; background: var(--line-strong); border-radius: 9999px;
}
.sheet h2 {
  margin: 0; font-family: var(--font-display);
  font-size: 22px; font-weight: 600; letter-spacing: -0.4px;
}
.sheet .head-pad { padding: 12px 24px 0; }
.sheet .head-pad .row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.sheet .head-pad p { margin: 0 0 14px; font-size: 14px; color: var(--ink-500); line-height: 1.4; }
.sheet .icon-square {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(135deg, #4F9568, #3F7C56);
  display: grid; place-items: center;
  box-shadow: 0 6px 14px rgba(63,124,86,0.32);
  color: #fff;
}
.sheet .body {
  flex: 1; overflow: auto; padding: 0 16px;
}
.sheet .item-card {
  background: var(--surface); border-radius: 18px;
  border: 1px solid var(--line-soft); overflow: hidden;
}
.sheet .item-card .row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
}
.sheet .item-card .row:last-child { border-bottom: none; }
.sheet .item-card .thumb {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--surface-sunk);
  display: grid; place-items: center; overflow: hidden; flex-shrink: 0;
}
.sheet .item-card .thumb img { width: 100%; height: 100%; object-fit: contain; }
.sheet .item-card .name { flex: 1; font-size: 13px; font-weight: 600; }
.sheet .total-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 6px 8px;
}
.sheet .total-row .count { font-size: 13px; color: var(--ink-500); }
.sheet .total-row .total { font-size: 18px; font-weight: 800; font-family: var(--font-display); }
.sheet .actions { padding: 8px 16px 0; display: flex; flex-direction: column; gap: 10px; }
.sheet .actions .primary {
  background: linear-gradient(135deg, #4F9568, #3F7C56);
  color: #fff; border-radius: 16px;
  padding: 16px; font-weight: 700; font-size: 16px;
  box-shadow: 0 8px 20px rgba(63,124,86,0.35), 0 2px 0 rgba(0,0,0,0.04);
  display: flex; justify-content: center; align-items: center; gap: 8px;
}
.sheet .actions .cancel { padding: 12px; font-weight: 600; font-size: 14px; color: var(--ink-500); }
.sheet .disclaimer {
  display: flex; gap: 8px; padding: 4px 4px 0; color: var(--ink-400);
}
.sheet .disclaimer span { font-size: 11px; line-height: 1.4; }

.progress {
  height: 8px; background: var(--surface-sunk); border-radius: 9999px;
  overflow: hidden; position: relative; margin-top: 4px;
}
.progress .fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: linear-gradient(90deg, #5BAA77, #4F9568);
  transition: width .3s;
  border-radius: 9999px;
  box-shadow: 0 0 12px rgba(79,149,104,0.6);
}
.progress-stats {
  display: flex; justify-content: space-between; margin-top: 6px;
  font-size: 12px; color: var(--ink-500); font-weight: 600;
}

.status-dot {
  width: 22px; height: 22px; border-radius: 9999px;
  display: grid; place-items: center; flex-shrink: 0;
}
.status-dot.added { background: var(--green-500); color: #fff; animation: bh-pop-in .3s cubic-bezier(.2,1.6,.4,1) both; }
.status-dot.failed { background: var(--danger); color: #fff; }
.status-dot.pending {
  border: 2px solid var(--line-strong);
  border-top-color: var(--green-500);
  animation: bh-spin 0.9s linear infinite;
}

.done-panel {
  padding: 8px 24px 0; text-align: center;
  flex: 1; display: flex; flex-direction: column;
}
.done-panel .big-check {
  width: 84px; height: 84px; border-radius: 9999px; margin: 20px auto 18px;
  background: linear-gradient(135deg, #5BAA77, #3F7C56);
  display: grid; place-items: center; color: #fff;
  box-shadow: 0 16px 32px rgba(63,124,86,0.4), inset 0 -3px 0 rgba(0,0,0,0.08);
  animation: bh-pop-in .5s cubic-bezier(.2,1.4,.4,1) both;
}
.done-panel h2 { font-size: 26px; }
.done-panel p { margin: 8px 0 0; font-size: 14px; color: var(--ink-500); }
.done-panel .actions { padding: 16px 0 0; display: flex; flex-direction: column; gap: 10px; }
.done-panel .open-woolies {
  background: var(--ink-900); color: #fff;
  border-radius: 16px; padding: 15px;
  font-weight: 700; font-size: 15px;
  display: flex; justify-content: center; align-items: center; gap: 8px;
}
.done-panel .neutral {
  background: var(--surface); color: var(--ink-900);
  border-radius: 16px; padding: 14px;
  font-weight: 600; font-size: 14px;
  border: 1px solid var(--line);
}
.done-panel .keep { padding: 8px; font-weight: 600; font-size: 13px; color: var(--ink-500); }

/* ── Toast ──────────────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: calc(var(--safe-bottom) + 90px); left: 50%;
  transform: translateX(-50%);
  background: var(--ink-900); color: #fff;
  padding: 10px 16px; border-radius: 9999px;
  font-size: 13px; font-weight: 600;
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
  z-index: 150;
  animation: bh-fade-up .25s both;
}

/* ── Hidden ─────────────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Fly ghost (for fly-to-list animation) ─────────────────────────── */
.fly-ghost {
  position: fixed;
  border-radius: 14px;
  pointer-events: none;
  z-index: 200;
  background: var(--surface-sunk);
  box-shadow: 0 12px 28px rgba(0,0,0,0.25);
  transition: transform .55s cubic-bezier(.5,.05,.6,1), opacity .55s, border-radius .55s;
}

/* ── Cookie setup banner (parent) ────────────────────────────────────── */
.setup-banner {
  margin: 6px 20px 14px;
  background: var(--honey);
  color: #4a3110;
  border-radius: 18px;
  padding: 12px 14px;
  display: flex; gap: 10px; align-items: center;
  width: calc(100% - 40px);
  text-align: left;
  font-size: 13px; font-weight: 600;
}
.setup-banner .icon-pad {
  width: 36px; height: 36px; border-radius: 10px;
  background: rgba(255,255,255,0.4);
  display: grid; place-items: center;
}

/* ── Setup modal ────────────────────────────────────────────────────── */
.setup-modal-body { padding: 0 24px; }
.setup-modal-body ol { margin: 6px 0; padding-left: 20px; }
.setup-modal-body li { padding: 6px 0; font-size: 14px; line-height: 1.4; color: var(--ink-700); }
.setup-status {
  padding: 10px 12px; border-radius: 12px; margin: 8px 0;
  background: var(--surface-sunk); font-size: 13px; color: var(--ink-700);
  border: 1px solid var(--line);
}
.setup-status.ok { background: var(--green-50); color: var(--green-700); border-color: var(--green-100); }
.setup-status.warn { background: #FBEED0; color: #8C6418; border-color: #F0DCA0; }

.setup-field {
  margin: 12px 0;
}
.setup-field label {
  display: block;
  font-size: 12px; font-weight: 700;
  color: var(--ink-500);
  margin-bottom: 6px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.setup-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-family: inherit;
  font-size: 15px;
  color: var(--ink-900);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  box-sizing: border-box;
}
.setup-input:focus {
  border-color: var(--green-500);
  box-shadow: 0 0 0 3px rgba(79,149,104,0.15);
}

/* MFA code entry — large monospace boxes feel like the OTP screens */
.mfa-input {
  width: 100%;
  padding: 16px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 12px;
  text-align: center;
  color: var(--ink-900);
  outline: none;
  font-variant-numeric: tabular-nums;
  transition: border-color .15s, box-shadow .15s;
  box-sizing: border-box;
}
.mfa-input:focus {
  border-color: var(--green-500);
  box-shadow: 0 0 0 3px rgba(79,149,104,0.15);
}
.mfa-input::placeholder {
  color: var(--ink-300);
  letter-spacing: 8px;
}
