:root {
  --bg: #f6f7f4; --card: #fff; --text: #1d2420; --muted: #6b746f; --line: #e4e8e3;
  --brand: #1f7a5a; --brand-ink: #fff; --brand-soft: #e3f2ec; --warn: #b4580b; --warn-soft: #fdf0e3;
  --danger: #c0392b; --radius: 14px; --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.05);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); line-height: 1.5; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
h1 { font-size: 1.6rem; font-weight: 700; }
h2 { font-size: 1.1rem; font-weight: 600; }
h3 { font-size: 1rem; font-weight: 600; }
.muted { color: var(--muted); margin: .2rem 0 0; }
.hint { color: var(--muted); font-size: .85rem; margin: .25rem 0 .75rem; }
.note { color: var(--muted); font-size: .85rem; background: #fff8e6; border: 1px solid #f3e3b5; border-radius: 10px; padding: .55rem .8rem; margin: 1rem 0; }

/* Top bar + tabs */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 1rem; padding: .7rem 1.25rem; background: rgba(255,255,255,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; color: var(--text); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.logo { margin-right: .2rem; }
.tabs { display: flex; gap: .25rem; margin: 0 auto; background: #eef1ec; padding: .25rem; border-radius: 999px; }
.tab { display: flex; align-items: center; gap: .4rem; padding: .45rem 1rem; border-radius: 999px; color: var(--muted); font-weight: 500; font-size: .95rem; }
.tab:hover { text-decoration: none; color: var(--text); }
.tab.active { background: #fff; color: var(--brand); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.account { display: flex; align-items: center; gap: .8rem; font-size: .9rem; white-space: nowrap; }
.account .email { color: var(--muted); max-width: 180px; overflow: hidden; text-overflow: ellipsis; }

.container { max-width: 1120px; margin: 0 auto; padding: 1.5rem 1.25rem 6rem; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }

/* Cards & layout */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; }
.card h2 { margin-bottom: .8rem; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .8rem; }
.card-head h2 { margin: 0; }
.grid-2 { display: grid; grid-template-columns: 1.3fr 1fr; gap: 1.25rem; align-items: start; }
.grid-2 > .card:last-child { position: sticky; top: 76px; }

/* Buttons & inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; border: 1px solid transparent; border-radius: 10px; padding: .6rem 1rem; font: inherit; font-weight: 600; cursor: pointer; background: #eef1ec; color: var(--text); transition: background .15s, transform .05s; }
.btn:hover { text-decoration: none; filter: brightness(.97); }
.btn:active { transform: translateY(1px); }
.btn:disabled { cursor: default; opacity: .8; }
.btn.primary { background: var(--brand); color: var(--brand-ink); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--text); }
.btn.danger { background: #fdecea; color: var(--danger); }
.btn.saved { background: var(--brand-soft); color: var(--brand); }
.btn.small { padding: .4rem .75rem; font-size: .85rem; }
.btn.block { width: 100%; }
input[type=text], input[type=email], input[type=password], input[type=search] { width: 100%; font: inherit; padding: .65rem .8rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--text); }
input:focus { outline: 2px solid var(--brand); outline-offset: 0; border-color: transparent; }
.add-form { display: flex; gap: .5rem; margin-bottom: 1.25rem; }
.add-form input { flex: 1; }

/* Picker */
.picker-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem; }
.picker-head input { max-width: 180px; padding: .4rem .7rem; font-size: .9rem; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; max-height: 460px; overflow-y: auto; padding: 2px; }
.chip { border: 1px solid var(--line); background: #fff; color: var(--text); border-radius: 999px; padding: .35rem .75rem; font: inherit; font-size: .88rem; cursor: pointer; transition: all .12s; }
.chip:hover { border-color: var(--brand); }
.chip.on { background: var(--brand); color: #fff; border-color: var(--brand); }

/* Pantry list */
.pantry-list { max-height: 60vh; overflow-y: auto; }
.group { margin-bottom: .75rem; }
.group h4 { font-size: .75rem; color: var(--muted); letter-spacing: .06em; margin-bottom: .25rem; }
.items { list-style: none; margin: 0; padding: 0; }
.items li { display: flex; justify-content: space-between; align-items: center; padding: .45rem .6rem; border-radius: 8px; }
.items li:hover { background: #f3f5f2; }
.remove { border: 0; background: transparent; color: var(--muted); font-size: 1.25rem; line-height: 1; width: 32px; height: 32px; border-radius: 8px; cursor: pointer; }
.remove:hover { background: #fdecea; color: var(--danger); }

/* Recipes */
.filters { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.pill { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: .4rem .9rem; font: inherit; font-size: .9rem; cursor: pointer; }
.pill.active { background: var(--text); color: #fff; border-color: var(--text); }
.recipe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.group-title { grid-column: 1 / -1; margin-top: .75rem; font-size: 1rem; color: var(--muted); }
.recipe { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.thumb { position: relative; aspect-ratio: 16 / 10; background: #e9ece7; overflow: hidden; }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.badge { position: absolute; top: .6rem; left: .6rem; padding: .2rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.badge.ok { background: var(--brand); color: #fff; }
.badge.warn { background: #fff; color: var(--warn); }
.recipe-body { padding: .9rem 1rem 1rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.recipe-body h3 a { color: var(--text); }
.meta { color: var(--muted); font-size: .82rem; margin: 0; }
.missing { margin: .2rem 0 0; font-size: .88rem; color: var(--warn); background: var(--warn-soft); padding: .4rem .6rem; border-radius: 8px; }
.have-all { margin: .2rem 0 0; font-size: .88rem; color: var(--brand); background: var(--brand-soft); padding: .4rem .6rem; border-radius: 8px; }
.have { margin: 0; font-size: .82rem; color: var(--muted); }
.actions { display: flex; gap: .5rem; margin-top: auto; padding-top: .5rem; }
.loading, .empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 3rem 1rem; }
.empty.small { padding: 1.5rem .5rem; }
.empty-ico { font-size: 2.2rem; margin-bottom: .5rem; }
.empty .btn { margin-top: .75rem; }
.empty h2 { margin-bottom: 1rem; }

/* Auth */
body.bare { background: linear-gradient(160deg, #e3f2ec 0%, #f6f7f4 55%); min-height: 100vh; }
.auth-main { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.auth-card { width: 100%; max-width: 400px; background: #fff; border-radius: 18px; box-shadow: var(--shadow); padding: 2rem; border: 1px solid var(--line); }
.auth-logo { font-size: 2.4rem; }
.auth-card h1 { margin-top: .4rem; }
.auth-card form { margin-top: 1.5rem; display: grid; gap: .9rem; }
.auth-card label { display: grid; gap: .35rem; font-size: .9rem; font-weight: 500; }
.auth-card .hint { margin: -.5rem 0 0; }
.error { color: var(--danger); background: #fdecea; padding: .5rem .7rem; border-radius: 8px; margin: 0; font-size: .9rem; }
.switch { text-align: center; color: var(--muted); margin: 1.25rem 0 0; font-size: .9rem; }

.toast { position: fixed; left: 50%; bottom: 84px; transform: translate(-50%, 20px); background: var(--text); color: #fff; padding: .6rem 1rem; border-radius: 10px; opacity: 0; pointer-events: none; transition: all .2s; z-index: 30; font-size: .9rem; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Mobile: tabs become a bottom bar */
@media (max-width: 800px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-2 > .card:last-child { position: static; order: -1; }
  .account .email { display: none; }
  .topbar { justify-content: space-between; backdrop-filter: none; -webkit-backdrop-filter: none; background: #fff; }
  .tabs { position: fixed; bottom: 0; left: 0; right: 0; margin: 0; border-radius: 0; background: #fff; border-top: 1px solid var(--line); padding: .35rem .5rem calc(.35rem + env(safe-area-inset-bottom)); justify-content: space-around; z-index: 20; }
  .tab { flex-direction: column; gap: 0; font-size: .75rem; padding: .3rem .8rem; border-radius: 10px; }
  .tab .ico { font-size: 1.2rem; }
  .tab.active { box-shadow: none; background: var(--brand-soft); }
  .chips { max-height: none; }
  .pantry-list { max-height: none; }
  h1 { font-size: 1.35rem; }
  .container { padding: 1rem 1rem 6rem; }
  .picker-head input { max-width: 140px; }
}
.toast { bottom: max(84px, calc(84px + env(safe-area-inset-bottom))); }
@media (min-width: 801px) { .toast { bottom: 24px; } }

/* Recipe filters */
.filter-panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: .9rem 1rem; display: grid; gap: .7rem; margin-bottom: .75rem; }
.filter-row { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.filter-label { flex: 0 0 64px; font-size: .8rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.seg { display: inline-flex; background: #eef1ec; padding: 3px; border-radius: 10px; gap: 2px; flex-wrap: nowrap; }
.seg button { border: 0; background: transparent; font: inherit; font-size: .88rem; padding: .4rem .8rem; border-radius: 8px; cursor: pointer; color: var(--muted); white-space: nowrap; min-height: 34px; }
.seg button.active { background: #fff; color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.scroll-chips { display: flex; gap: .4rem; overflow-x: auto; padding: 2px; scrollbar-width: thin; min-width: 0; flex: 1; -webkit-overflow-scrolling: touch; }
.scroll-chips .chip { white-space: nowrap; flex: 0 0 auto; }
.toggles { flex-wrap: wrap; gap: 1.1rem; padding-left: calc(64px + .75rem); }
.switch-label { display: inline-flex; align-items: center; gap: .5rem; font-size: .9rem; cursor: pointer; user-select: none; }
.switch-label input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-ui { width: 36px; height: 20px; border-radius: 999px; background: #cfd6d0; position: relative; transition: background .15s; flex: 0 0 auto; }
.switch-ui::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch-label input:checked + .switch-ui { background: var(--brand); }
.switch-label input:checked + .switch-ui::after { transform: translateX(16px); }
.switch-label input:focus-visible + .switch-ui { outline: 2px solid var(--brand); outline-offset: 2px; }
.switch-label input:disabled + .switch-ui { opacity: .45; }
.link-btn { border: 0; background: none; color: var(--brand); font: inherit; font-size: .9rem; cursor: pointer; margin-left: auto; }
.result-count { font-size: .85rem; margin: 0 0 .5rem; }
@media (max-width: 800px) {
  .filter-row { flex-direction: column; align-items: stretch; gap: .35rem; }
  .filter-label { flex: none; }
  .seg { display: flex; }
  .seg button { flex: 1; padding: .45rem .3rem; }
  .toggles { padding-left: 0; flex-direction: row; align-items: center; }
}

/* Cook time, nutrition, attribution */
.facts { display: flex; gap: .75rem; flex-wrap: wrap; font-size: .82rem; color: var(--text); }
.nutri-label { margin: .1rem 0 -.2rem; font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.nutri { display: grid; grid-template-columns: repeat(4, 1fr); gap: .3rem; font-size: .75rem; color: var(--muted); }
.nutri span { background: #f3f5f2; border-radius: 8px; padding: .3rem .2rem; text-align: center; line-height: 1.2; }
.nutri b { display: block; color: var(--text); font-size: .9rem; }
.credit { margin: .25rem 0 0; font-size: .75rem; color: var(--muted); }
.notice { background: var(--warn-soft); color: var(--warn); border-radius: 10px; padding: .55rem .8rem; font-size: .88rem; margin: 0 0 .75rem; }
.attribution { text-align: center; color: var(--muted); font-size: .85rem; margin-top: 2rem; }

/* Shopping list */
.shop-card { max-width: 720px; }
.shop-list { list-style: none; margin: 0; padding: 0; }
.shop-list li { display: flex; align-items: center; gap: .5rem; padding: .35rem .25rem; border-bottom: 1px solid var(--line); }
.shop-list li:last-child { border-bottom: 0; }
.shop-list li.empty { display: block; border: 0; }
.check { display: flex; align-items: center; gap: .65rem; flex: 1; cursor: pointer; min-height: 40px; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check .box { width: 22px; height: 22px; border: 2px solid #c7cfc8; border-radius: 6px; flex: 0 0 auto; display: grid; place-items: center; }
.check input:checked + .box { background: var(--brand); border-color: var(--brand); }
.check input:checked + .box::after { content: "✓"; color: #fff; font-size: .8rem; font-weight: 700; }
.check input:focus-visible + .box { outline: 2px solid var(--brand); outline-offset: 2px; }
.check .label small { display: block; color: var(--muted); font-size: .75rem; }
.shop-list li.checked .label { color: var(--muted); text-decoration: line-through; }
.shop-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .9rem; }

/* Account */
.export-btns, .row-btns { display: flex; gap: .5rem; flex-wrap: wrap; margin: .75rem 0 .25rem; }
.danger-zone h2 { color: var(--danger); }
.danger-zone form { display: grid; gap: .5rem; margin-top: .5rem; }
.danger-zone label { display: grid; gap: .35rem; font-size: .9rem; }
.account-grid > .card:last-child { position: static; }
.account .email { color: var(--muted); }

/* Import + imported steps */
.import-card { margin-bottom: 1rem; }
.import-card .add-form { margin-bottom: .25rem; }
input[type=url] { width: 100%; font: inherit; padding: .65rem .8rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--text); }
.steps { font-size: .85rem; }
.steps summary { cursor: pointer; color: var(--brand); font-weight: 600; }
.steps ul { padding-left: 1.1rem; margin: .4rem 0; }
.steps-text { white-space: pre-line; color: var(--text); }
.actions { flex-wrap: wrap; }
@media (max-width: 800px) {
  .tab { padding: .3rem .4rem; }
}
[hidden] { display: none !important; }
@media (max-width: 800px) { .account-grid > .card:last-child { order: 0; } }
.danger-zone label { display: block; }
.danger-zone label input { margin-top: .35rem; }

/* Expiry */
.exp { display: inline-block; font-size: .72rem; font-weight: 600; padding: .12rem .5rem; border-radius: 999px; background: #eef1ec; color: var(--muted); white-space: nowrap; }
.exp.amber { background: #fdf0d5; color: #9a5b00; }
.exp.red { background: #fde3e0; color: var(--danger); }
.exp.none { background: transparent; color: #a3aba5; font-weight: 500; }
.pantry-item { gap: .4rem; }
.item-main { flex: 1; display: flex; justify-content: space-between; align-items: center; gap: .5rem; border: 0; background: none; font: inherit; color: inherit; text-align: left; padding: .1rem 0; cursor: pointer; min-height: 32px; }
.item-main:hover .exp.none { color: var(--brand); }
.editor-row { display: block !important; padding: .25rem .6rem .7rem !important; }
.exp-editor { display: grid; gap: .5rem; background: #f6f8f5; border-radius: 10px; padding: .6rem; }
.exp-editor input[type=date] { font: inherit; padding: .45rem .6rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; max-width: 200px; }
.chip.small { font-size: .8rem; padding: .25rem .6rem; }
.expired-group h4 { color: var(--danger); }
.expired-group li { background: #fff6f5; }
.small-seg { margin-bottom: .25rem; }
.small-seg button { font-size: .82rem; padding: .3rem .7rem; min-height: 30px; }

/* Cook tonight */
.tonight-banner { background: #fdf0d5; border: 1px solid #f3dca8; color: #6b4300; border-radius: var(--radius); padding: .8rem 1rem; margin-bottom: .9rem; }
.tonight-banner.urgent { background: #fde9e6; border-color: #f5c6bf; color: #8a2b20; }
.soon-chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }
.soon-chips .exp { font-size: .78rem; }
.tonight-filter { margin-bottom: .75rem; }
.fact.uses { color: #8a4b00; }
.row-btns.center { justify-content: center; }
.account .link.active { font-weight: 600; }
@media (max-width: 800px) {
  .seg { overflow-x: auto; }
  .seg button { flex: 1 0 auto; }
  .acct-label { display: none; }
  .account .link { font-size: 1.2rem; }
}
.fallback-note { grid-column: 1 / -1; margin: 0; }

/* Name search */
.name-search { display: flex; gap: .5rem; margin-bottom: .75rem; }
.name-search input { flex: 1; font: inherit; padding: .65rem .8rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; min-width: 0; }
.search-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .5rem; font-weight: 600; }
.search-head .link-btn { margin-left: 0; }

/* Barcode scanner sheet */
body.sheet-open { overflow: hidden; }
.sheet-backdrop { position: fixed; inset: 0; background: rgba(20, 28, 24, .45); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.sheet { background: #fff; border-radius: 18px; width: 100%; max-width: 460px; max-height: 92vh; overflow-y: auto; padding: 1rem 1.1rem 1.1rem; box-shadow: 0 20px 60px rgba(0,0,0,.25); display: grid; gap: .6rem; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; }
.camera { position: relative; background: #111; border-radius: 12px; overflow: hidden; aspect-ratio: 4 / 3; }
.camera video { width: 100%; height: 100%; object-fit: cover; display: block; }
.aim { position: absolute; left: 12%; right: 12%; top: 35%; bottom: 35%; border: 2px solid rgba(255,255,255,.85); border-radius: 10px; box-shadow: 0 0 0 999px rgba(0,0,0,.25); }
#scan-view { display: grid; gap: .6rem; }
.manual-code { margin: 0; }
.upload-btn { justify-self: start; cursor: pointer; }
.confirm { display: grid; gap: .75rem; }
.confirm label { display: grid; gap: .3rem; font-size: .9rem; font-weight: 500; }
.confirm input[type=date] { font: inherit; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 10px; max-width: 220px; }
.product { display: flex; gap: .8rem; align-items: center; }
.product img { width: 72px; height: 72px; object-fit: contain; border-radius: 10px; background: #f3f5f2; flex: 0 0 auto; }
.muted.small { font-size: .8rem; }
.item-label { display: inline-flex; align-items: center; gap: .45rem; min-width: 0; }
.thumb-sm { width: 26px; height: 26px; object-fit: contain; border-radius: 6px; background: #f3f5f2; flex: 0 0 auto; }
.item-label .brand { color: var(--muted); font-size: .75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 110px; }
@media (max-width: 800px) {
  .sheet-backdrop { align-items: flex-end; padding: 0; }
  .sheet { border-radius: 18px 18px 0 0; max-height: 94vh; padding-bottom: calc(1.1rem + env(safe-area-inset-bottom)); }
}
.notice { background: #eef6ff; border: 1px solid #cfe2fb; color: #1d3b5c; border-radius: 10px; padding: .7rem .85rem; margin: 0; font-size: .9rem; }
.confirm label .hint { display: inline; margin: 0; font-weight: 400; }

/* Voice add */
.head-btns { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; }
#voice-mic-area { display: grid; justify-items: center; gap: .3rem; text-align: center; }
#voice-mic-area .hint { margin: 0; }
.mic { width: 72px; height: 72px; border-radius: 50%; border: 0; font-size: 1.9rem; cursor: pointer; background: #e8f3ec; color: var(--text); transition: background .15s, transform .15s; }
.mic:hover { transform: scale(1.04); }
.mic.on { background: #d6453d; color: #fff; animation: mic-pulse 1.4s ease-out infinite; }
@keyframes mic-pulse { 0% { box-shadow: 0 0 0 0 rgba(214,69,61,.45); } 100% { box-shadow: 0 0 0 18px rgba(214,69,61,0); } }
.voice-label { font-size: .9rem; font-weight: 500; }
.voice-label .hint { display: inline; margin: 0; font-weight: 400; }
#voice-text { width: 100%; font: inherit; padding: .6rem .75rem; border: 1px solid var(--line); border-radius: 10px; resize: vertical; min-height: 4.5rem; }
.interim { color: var(--muted); font-style: italic; font-size: .9rem; margin: -.3rem 0 0; min-height: 1.1em; }
#voice-parse { justify-self: start; }
.review-title { font-size: 1rem; margin: .2rem 0 .4rem; }
.review-title .muted { font-weight: 400; font-size: .85rem; }
.review-list { list-style: none; margin: 0 0 .6rem; padding: 0; display: grid; gap: 0; }
.review-item { border: 1px solid var(--line); border-radius: 12px; padding: .25rem .25rem .25rem .6rem; background: #fff; }
.review-main { display: flex; align-items: center; gap: .4rem; }
.review-item.splitting { border-color: var(--brand); }
.review-item.in-pantry { background: #f6f7f4; }
.review-item.in-pantry .review-name { color: var(--muted); text-decoration: line-through; }
.review-name { flex: 1 1 auto; min-width: 0; border: 0 !important; padding: .35rem 0 !important; font: inherit; font-weight: 500; background: transparent !important; }
.review-name:focus { outline: none; box-shadow: inset 0 -2px 0 var(--brand); }
.review-exp { flex: 0 0 auto; font-size: .78rem; color: var(--muted); white-space: nowrap; }
.review-exp.dup { color: #9a6b00; }
#voice-add:disabled { opacity: .55; cursor: default; }
@media (max-width: 520px) {
  .add-head { flex-wrap: wrap; gap: .6rem; }
  .add-head .head-btns { width: 100%; flex-wrap: nowrap; }
  .add-head .head-btns .btn { flex: 1 1 0; justify-content: center; }
}

.split-btn { flex: 0 0 auto; border: 0; background: transparent; color: var(--muted); font-size: 1rem; width: 32px; height: 32px; border-radius: 8px; cursor: pointer; }
.split-btn:hover, .split-btn:focus-visible { background: #eef3ef; color: var(--text); }
.join-row { display: flex; justify-content: center; height: 1.35rem; align-items: center; }
.join-btn { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: .72rem; padding: 0 .6rem; border-radius: 999px; cursor: pointer; opacity: .75; line-height: 1.35rem; }
.join-btn:hover, .join-btn:focus-visible { opacity: 1; background: #eef3ef; color: var(--text); }
.split-panel { display: grid; gap: .45rem; padding: .5rem .35rem .45rem 0; border-top: 1px dashed var(--line); margin-top: .25rem; }
.split-label { font-size: .78rem; color: var(--muted); }
.split-words { display: flex; flex-wrap: wrap; align-items: center; row-gap: .3rem; font-weight: 500; }
.split-word { padding: .2rem .1rem; }
.split-gap { width: 22px; height: 30px; border: 0; background: transparent; cursor: pointer; position: relative; border-radius: 6px; }
.split-gap::after { content: ""; position: absolute; left: 50%; top: 6px; bottom: 6px; width: 2px; margin-left: -1px; background: #cfd6d0; border-radius: 2px; }
.split-gap:hover { background: #eef3ef; }
.split-gap.cut::after { background: #d6453d; width: 3px; top: 2px; bottom: 2px; }
.split-gap.cut { background: #fde9e7; }

/* Collapsible picker and pantry list */
.chips.collapsible { max-height: none; overflow: hidden; padding: 2px; margin: -2px; transition: max-height .32s cubic-bezier(.2, .7, .2, 1); }
.chips.collapsible.collapsed { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 1.6rem), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 1.6rem), transparent); }
@media (prefers-reduced-motion: reduce) { .chips.collapsible { transition: none; } .pantry-list.reveal { animation: none !important; } }
.more-toggle { display: flex; align-items: center; justify-content: center; gap: .35rem; width: 100%; margin-top: .55rem;
  padding: .55rem .75rem; min-height: 44px; border: 1px dashed var(--line); border-radius: 10px; background: transparent;
  color: var(--brand); font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.more-toggle:hover, .more-toggle:focus-visible { background: #f2f7f3; border-style: solid; }
.more-toggle .chev { transition: transform .25s ease; }
.more-toggle.open .chev { transform: rotate(180deg); }
.more-hint { margin: .35rem 0 0; font-size: .8rem; color: var(--muted); text-align: center; }
.urgent-group h4 { color: #b4541a; }
.pantry-list.reveal { animation: list-reveal .28s ease-out; }
@keyframes list-reveal { from { opacity: .35; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
