@font-face { font-family: 'Bricolage Grotesque'; font-weight: 500 800; font-display: swap; src: url('fonts/bricolage.woff2') format('woff2'); }
@font-face { font-family: 'Figtree'; font-weight: 400 700; font-display: swap; src: url('fonts/figtree.woff2') format('woff2'); }

:root {
  --cream: #FFF6E5; --ink: #1A1A1A; --tomato: #FF5B3A; --mustard: #FFC53D; --mint: #47D7A4; --sky: #6EC3FF; --lilac: #B49CFF; --white: #FFFFFF;
  --line: 2.5px solid var(--ink);
  --head: 'Bricolage Grotesque', 'Arial Black', system-ui, sans-serif;
  --body: 'Figtree', system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--cream); color: var(--ink); font: 500 16px/1.45 var(--body); -webkit-font-smoothing: antialiased; }
body.noscroll { overflow: hidden; }
a { color: var(--ink); }
a:hover { color: var(--tomato); }
button, input, select, textarea { font: inherit; color: var(--ink); }
h1, h2, h3 { font-family: var(--head); margin: 0; letter-spacing: -0.03em; }
h1 { font-size: clamp(36px, 6vw, 60px); line-height: 1; font-weight: 800; }
h2 { font-size: 22px; font-weight: 800; }
h3 { font-size: 20px; font-weight: 800; line-height: 1.1; }
p { margin: 0 0 10px; }

/* ---------- layout ---------- */
.main { max-width: 1360px; margin: 0 auto; padding: 28px 24px 96px; }
.narrow { max-width: 760px; margin: 0 auto; }
.row { display: flex; align-items: center; }
.gap { gap: 10px; }
.wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.mb { margin-bottom: 16px; }
.mt { margin-top: 14px; }
.center { text-align: center; }
.center-row { justify-content: center; }
.muted { opacity: 0.65; }
.small { font-size: 14px; }
.w60 { width: 60px; }
.error { color: #C0261A; font-weight: 700; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 24px; }
.sub { margin-top: 8px; font-size: 17px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.sticky { position: sticky; top: 96px; }
@media (max-width: 960px) { .two-col { grid-template-columns: 1fr; } .sticky { position: static; } }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 20; background: var(--cream); border-bottom: var(--line); padding-top: env(safe-area-inset-top, 0px); }
.top-inner { max-width: 1360px; margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 800 22px/1 var(--head); letter-spacing: -0.02em; flex: none; }
.brand.big { font-size: 28px; }
.logo { width: 36px; height: 36px; border-radius: 50%; background: var(--tomato); border: var(--line); display: grid; place-items: center; font: 800 16px var(--head); flex: none; }
nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
nav::-webkit-scrollbar { display: none; }
.nav { display: flex; align-items: center; gap: 6px; padding: 8px 15px; border: 2.5px solid transparent; border-radius: 999px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.nav.on { background: var(--mustard); border-color: var(--ink); }
.nav:hover { color: var(--ink); background: var(--white); }
.nav.on:hover { background: var(--mustard); }
.badge { background: var(--tomato); border: 2px solid var(--ink); border-radius: 999px; min-width: 22px; padding: 0 6px; font: 800 12px/18px var(--body); text-align: center; }
.who-bar { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; text-decoration: none; flex: none; }
.avatars { display: flex; }
.avatar { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--ink); display: grid; place-items: center; font: 800 12px var(--head); }
.avatar + .avatar { margin-left: -8px; }
.offline { background: var(--mustard); border-top: var(--line); text-align: center; font-weight: 700; font-size: 14px; padding: 6px 12px; }
@media (max-width: 860px) {
  .top-inner { flex-wrap: wrap; gap: 10px; padding: 10px 16px; }
  .brand { order: 1; }
  .who-bar { order: 2; margin-left: auto; }
  nav { order: 3; flex-basis: 100%; margin: 0 -16px; padding: 0 16px; }
  .week-label { display: none; }
  .main { padding: 20px 16px 80px; }
}

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--white); border: var(--line); border-radius: 14px; padding: 11px 18px; font-weight: 700; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { color: var(--ink); background: #FFFDF7; }
.btn.primary { background: var(--tomato); font: 800 17px var(--head); box-shadow: 4px 4px 0 var(--ink); }
.btn.primary:hover { background: #FF6D4F; }
.btn.primary:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn.dark { background: var(--ink); color: var(--cream); }
.btn.danger { background: #FFD9D2; }
.btn.small { padding: 6px 12px; border-radius: 10px; font-size: 14px; border-width: 2px; }
.btn.full { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: default; box-shadow: none; }
.confirm { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.pill { background: var(--white); border: var(--line); border-radius: 999px; padding: 8px 16px; font-weight: 700; cursor: pointer; }
.pill.on { background: var(--mustard); }
.round { width: 40px; height: 40px; border-radius: 50%; border: var(--line); background: var(--white); font: 800 22px/1 var(--head); cursor: pointer; flex: none; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.chips.mb { margin-top: 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--white); border: 2px solid var(--ink); border-radius: 999px; padding: 5px 13px; font-weight: 700; font-size: 14px; text-decoration: none; cursor: default; }
button.chip, a.chip { cursor: pointer; }
.chip.small { font-size: 12px; padding: 2px 10px; }
.chip.yellow { background: var(--mustard); }
.chip.green { background: var(--mint); }
.chip.red { background: #FF8E7A; }
.chip-x { border: none; background: none; font-weight: 800; cursor: pointer; padding: 0 0 0 4px; }
.storechip { display: inline-block; border: 2px solid var(--ink); border-radius: 999px; padding: 4px 13px; font: 800 15px var(--head); white-space: nowrap; text-decoration: none; }
.storechip.small { font-size: 13px; padding: 2px 10px; }
.mini-x { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--ink); background: var(--cream); font: 800 13px/1 var(--body); cursor: pointer; display: grid; place-items: center; padding: 0; flex: none; }
input, select, textarea { background: var(--white); border: var(--line); border-radius: 12px; padding: 10px 13px; width: 100%; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--sky); outline-offset: 1px; }
textarea { resize: vertical; }
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--mint); }
.search { font-weight: 600; }
.search.grow { min-width: 220px; }

/* ---------- cards ---------- */
.card { background: var(--white); border: var(--line); border-radius: 20px; box-shadow: 5px 5px 0 var(--ink); }
.pad { padding: 20px; }
.tip { background: #E9FBF4; }
.empty { text-align: center; padding: 40px 16px; font-weight: 600; opacity: 0.8; }
.hero-yellow { background: var(--mustard); }
.hero-yellow.tight { padding: 14px 20px; }
.eyebrow { font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; }
.huge { font: 800 56px/1 var(--head); letter-spacing: -0.03em; margin: 6px 0; }

/* ---------- planner ---------- */
.week-nav { display: flex; align-items: center; gap: 12px; }
.planner { display: grid; gap: 10px; }
.pl-head, .pl-row { display: grid; grid-template-columns: 96px repeat(7, minmax(0, 1fr)); gap: 10px; }
.pl-day { padding: 4px; display: flex; flex-direction: column; }
.pl-day b { font: 800 22px/1 var(--head); }
.pl-day span { font-size: 13px; margin-top: 4px; }
.pl-day.today b { color: var(--tomato); }
.pl-meal { display: flex; align-items: center; font: 800 17px var(--head); }
.pl-cell { min-height: 128px; display: flex; flex-direction: column; gap: 6px; }
.pl-cell-label { display: none; }
.slot { flex: 1; display: flex; flex-direction: column; justify-content: space-between; gap: 6px; border: var(--line); border-radius: 12px; box-shadow: 3px 3px 0 var(--ink); padding: 8px 8px 7px 10px; cursor: pointer; min-height: 56px; }
.slot-name { font-weight: 700; font-size: 15px; line-height: 1.15; overflow-wrap: anywhere; }
.slot.split .slot-name { font-size: 13px; }
.slot-foot { display: flex; justify-content: space-between; align-items: center; gap: 4px; }
.who { background: var(--cream); border: 1.5px solid var(--ink); border-radius: 999px; padding: 0 8px; font-weight: 700; font-size: 11px; }
.slot.empty { background: transparent; border: 2.5px dashed var(--ink); box-shadow: none; font-weight: 700; font-size: 14px; opacity: 0.5; align-items: center; justify-content: center; }
.slot.empty:hover { opacity: 1; background: var(--white); }
.planner-mobile { display: none; }
@media (max-width: 900px) {
  .planner { display: none; }
  .planner-mobile { display: flex; flex-direction: column; gap: 14px; }
  .day-card { background: var(--white); border: var(--line); border-radius: 18px; box-shadow: 4px 4px 0 var(--ink); padding: 14px; }
  .day-card.today { background: #FFF1CC; }
  .day-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 15px; }
  .day-card-head b { font: 800 22px var(--head); }
  .day-meal { display: grid; grid-template-columns: 84px 1fr; gap: 8px; align-items: stretch; margin-top: 8px; }
  .day-meal-label { font: 800 15px var(--head); display: flex; align-items: center; }
  .day-meal-slots { display: flex; gap: 6px; }
  .day-meal .slot { min-height: 52px; }
}

/* ---------- modal ---------- */
.overlay { position: fixed; inset: 0; background: rgba(26, 26, 26, 0.45); z-index: 50; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--cream); border: var(--line); border-radius: 22px; box-shadow: 6px 6px 0 var(--ink); width: min(560px, 100%); max-height: 86vh; overflow: auto; padding: 20px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.x { width: 36px; height: 36px; border-radius: 50%; border: var(--line); background: var(--white); font: 800 18px/1 var(--body); cursor: pointer; flex: none; }
.pick-list { display: flex; flex-direction: column; gap: 8px; }
.pick { display: flex; align-items: center; gap: 12px; text-align: left; background: var(--white); border: var(--line); border-radius: 12px; padding: 11px 14px; cursor: pointer; font-weight: 700; }
.pick:hover { background: #FFF1CC; }
.pick small { font-weight: 600; opacity: 0.65; }
.dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--ink); flex: none; }

/* ---------- recipes ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 20px; }
.recipe-card { overflow: hidden; display: flex; flex-direction: column; }
.rc-top { padding: 16px; border-bottom: var(--line); min-height: 116px; display: flex; flex-direction: column; justify-content: space-between; gap: 12px; cursor: pointer; align-items: flex-start; }
.rc-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 12px; flex: 1; justify-content: space-between; }
.rc-meta { font-size: 14px; font-weight: 600; }
.ing-mini { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.ing-mini li { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; border-bottom: 1px dashed rgba(26, 26, 26, 0.25); }
.back { background: none; border: none; font-weight: 700; cursor: pointer; padding: 0; margin-bottom: 14px; }
.detail-hero { padding: 24px; margin-bottom: 24px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.detail-hero .chips { margin-top: 0; }
.src { font-weight: 700; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 24px; align-items: start; }
@media (max-width: 860px) { .detail-grid { grid-template-columns: 1fr; } }
.stepper { display: inline-flex; align-items: center; border: var(--line); border-radius: 999px; background: var(--cream); overflow: hidden; }
.stepper button { border: none; background: none; font: 800 18px var(--body); width: 36px; height: 34px; cursor: pointer; }
.stepper span { font-weight: 700; font-size: 14px; padding: 0 6px; }
.ing-list { list-style: none; margin: 0; padding: 0; }
.ing-list li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1.5px dashed rgba(26, 26, 26, 0.25); }
.ing-list a { text-decoration: none; font-weight: 600; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.steps li { display: flex; gap: 12px; }
.num { width: 30px; height: 30px; border-radius: 50%; background: var(--mustard); border: 2px solid var(--ink); display: grid; place-items: center; font: 800 14px var(--head); flex: none; }
.steps p { margin: 4px 0 0; }
.notes { margin-top: 18px; background: var(--cream); border-radius: 12px; padding: 12px 14px; }

/* ---------- forms ---------- */
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; margin-bottom: 14px; }
.form label small { font-weight: 500; opacity: 0.7; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.field-label { font-weight: 700; margin-bottom: 8px; }
label.check { flex-direction: row; align-items: center; gap: 8px; margin: 0; font-weight: 700; display: flex; }
label.inline { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; white-space: nowrap; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: var(--line); cursor: pointer; }
.swatch.on { box-shadow: 0 0 0 3px var(--cream), 0 0 0 6px var(--ink); }
.swatch-sm { width: 16px; height: 16px; border-radius: 5px; border: 2px solid var(--ink); flex: none; display: inline-block; }
.ing-rows { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.ing-row-main { display: flex; gap: 8px; align-items: center; }
.ing-row .picker { flex: 1; }
.qty { width: 84px; flex: none; }
.unit { width: 104px; flex: none; }
.hint { font-size: 13px; opacity: 0.65; margin: 4px 0 0 4px; }
@media (max-width: 560px) {
  .ing-row-main { flex-wrap: wrap; }
  .ing-row .picker { flex-basis: calc(100% - 34px); }
  .qty, .unit { flex: 1; }
}
.picker { position: relative; }
.newtag { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: var(--mint); border: 1.5px solid var(--ink); border-radius: 999px; font-size: 11px; font-weight: 800; padding: 0 7px; pointer-events: none; }
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; background: var(--white); border: var(--line); border-radius: 12px; box-shadow: 4px 4px 0 var(--ink); overflow: hidden; }
.suggest button { display: flex; justify-content: space-between; gap: 8px; width: 100%; text-align: left; border: none; background: none; padding: 9px 12px; cursor: pointer; font-weight: 600; }
.suggest button small { opacity: 0.6; }
.suggest button.on, .suggest button:hover { background: #FFF1CC; }

/* ---------- lists ---------- */
.add-row { display: flex; gap: 10px; padding: 12px; }
.add-row .picker { flex: 1; }
.aisle { margin-bottom: 22px; }
.aisle-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.aisle-head .muted { font-weight: 600; font-size: 14px; }
.aisle-mini { display: flex; align-items: center; gap: 8px; font-weight: 800; font-family: var(--head); margin-bottom: 8px; }
.list-card { overflow: hidden; }
.li { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1.5px solid rgba(26, 26, 26, 0.15); }
.li:last-child { border-bottom: none; }
.li-main { cursor: pointer; }
.li-name { font-weight: 700; text-decoration: none; display: block; }
.li-sub { font-size: 13px; opacity: 0.7; margin-top: 1px; }
.li .qty { font-weight: 600; opacity: 0.7; }
.li.done .li-name { text-decoration: line-through; }
.li.done { opacity: 0.5; }
.tick { width: 28px; height: 28px; border: var(--line); border-radius: 8px; background: var(--white); cursor: pointer; font-weight: 800; flex: none; padding: 0; }
.tick.on { background: var(--mint); }
.packs { display: inline-flex; align-items: center; border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; flex: none; }
.packs button { border: none; background: var(--cream); width: 28px; height: 28px; font-weight: 800; cursor: pointer; }
.packs span { min-width: 26px; text-align: center; font-weight: 800; font-size: 14px; }
.note-in { width: 120px; flex: none; padding: 6px 10px; border-width: 2px; }
.date-in { width: 150px; flex: none; padding: 6px 10px; border-width: 2px; }
@media (max-width: 640px) {
  .li { flex-wrap: wrap; }
  .li-main { flex-basis: calc(100% - 44px); }
  .note-in, .date-in { flex: 1; width: auto; }
  .li.wrap-sm .find-chips { flex-basis: 100%; }
}
.have { margin-top: 10px; }
.tot-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1.5px dashed rgba(26, 26, 26, 0.25); cursor: pointer; }
.rank { font: 800 18px var(--head); width: 22px; }
.soon { background: #FFF1CC; }
.find-chips { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- prices ---------- */
.table-wrap { overflow-x: auto; }
table.prices { border-collapse: collapse; width: 100%; font-size: 15px; }
.prices th, .prices td { padding: 10px 12px; text-align: right; border-bottom: 1.5px solid rgba(26, 26, 26, 0.15); white-space: nowrap; }
.prices th:first-child, .prices td:first-child, .prices th:nth-child(2), .prices td:nth-child(2) { text-align: left; }
.prices thead th { position: sticky; top: 0; background: var(--white); }
.prices tbody tr { cursor: pointer; }
.prices tbody tr:hover { background: #FFF8E8; }
.prices td.name { font-weight: 700; white-space: normal; min-width: 160px; }
.prices td.best { background: #D9F7EB; font-weight: 800; }
.old { color: #B25E00; }
.price-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1.5px solid rgba(26, 26, 26, 0.15); flex-wrap: wrap; }
.price-row:last-child { border-bottom: none; }
.price-row .storechip { min-width: 108px; text-align: center; }
.price-in { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; }
.price-in input { width: 110px; padding: 6px 10px; border-width: 2px; font-weight: 700; }
.fee { width: 80px; padding: 5px 8px; border-width: 2px; }
.store-row { display: flex; align-items: center; gap: 14px; padding: 14px 18px; margin-bottom: 12px; cursor: pointer; box-shadow: none; flex-wrap: wrap; }
.store-row.best { background: var(--mustard); box-shadow: 5px 5px 0 var(--ink); }
.store-row .big { font: 800 26px var(--head); }

/* ---------- login, toast, loading ---------- */
.login { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; padding: 24px; text-align: center; }
.login h1 { font-size: clamp(44px, 9vw, 84px); line-height: 0.95; letter-spacing: -0.045em; }
.stamp { display: inline-block; background: var(--mustard); border: 3px solid var(--ink); border-radius: 16px; padding: 0 14px 6px; transform: rotate(-2deg); box-shadow: 6px 6px 0 var(--ink); }
.login-card { width: min(380px, 100%); text-align: left; }
.login-card label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; margin-bottom: 14px; }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--cream); border-radius: 999px; padding: 12px 22px; font-weight: 700; z-index: 60; max-width: calc(100% - 32px); text-align: center; }
.loading { min-height: 100vh; display: grid; place-items: center; }
.spin { width: 56px; height: 56px; font-size: 24px; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }
@media (max-width: 640px) {
  .price-row { gap: 10px; }
  .price-row .grow { order: 3; flex-basis: 100%; }
  .price-row .btn.small { margin-left: auto; }
}
.steps-plain { margin: 0 0 12px; padding-left: 22px; }
.steps-plain li { margin-bottom: 6px; }
.book-hits { display: flex; flex-direction: column; max-height: 420px; overflow: auto; border-top: 1.5px solid rgba(26, 26, 26, 0.15); }
.book-hit { display: flex; align-items: center; gap: 10px; padding: 8px 2px; border-bottom: 1.5px solid rgba(26, 26, 26, 0.12); }
.book-hit a { text-decoration: none; font-weight: 600; }
