/* meals — a calm, phone-first kitchen. iOS restraint: few elements, one accent.
   Warm cookbook palette: cream paper, espresso ink, terracotta accent. */
:root {
  --bg: #f3ece0;
  --surface: #fffdf8;
  --surface-2: #ece2d1;
  --text: #2c2620;
  --text-2: #897c6a;
  --hair: rgba(74,52,28,.14);
  --accent: #c75f3e;
  --accent-soft: rgba(199,95,62,.13);
  --great: #4f9d5b;
  --ok: #dd9a2b;
  --weak: #c2452f;
  --shadow: 0 1px 2px rgba(60,40,20,.06), 0 8px 22px rgba(60,40,20,.08);
  --bar-shadow: 0 -1px 0 rgba(60,40,20,.07), 0 -10px 24px rgba(60,40,20,.06);
  --r: 18px;
  --r-sm: 12px;
  --bar-blur: saturate(180%) blur(20px);
  --maxw: 720px;
  --topbar-h: 52px;
  --tabbar-h: 66px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; border: none; background: none; }
input { font: inherit; }
a { color: inherit; text-decoration: none; }

/* ---------- Top bar ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  height: calc(var(--topbar-h) + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  display: grid; grid-template-columns: 44px 1fr auto; align-items: center;
  gap: 8px; padding-left: 8px; padding-right: 12px;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: var(--bar-blur); -webkit-backdrop-filter: var(--bar-blur);
  border-bottom: .5px solid var(--hair);
}
.topbar-title {
  grid-column: 2; font-size: 17px; font-weight: 600; margin: 0; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.back-btn { grid-column: 1; font-size: 30px; line-height: 1; color: var(--accent); padding: 0 4px; justify-self: start; }
.name-chip { grid-column: 3; }
.name-chip {
  display: inline-flex; align-items: center; gap: 5px; justify-self: end;
  background: var(--surface-2); border-radius: 999px; padding: 5px 11px 5px 8px;
  font-size: 14px; font-weight: 500; max-width: 130px;
}
.name-chip #chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-diet { font-size: 13px; }

/* ---------- Layout ---------- */
.view {
  max-width: var(--maxw); margin: 0 auto;
  padding: calc(var(--topbar-h) + env(safe-area-inset-top,0px) + 12px) 16px
           calc(var(--tabbar-h) + var(--safe-b) + 24px);
}
.large-title { font-size: 32px; font-weight: 700; letter-spacing: -.02em; margin: 4px 2px 14px; }
.section-title { font-size: 15px; font-weight: 600; color: var(--text-2); text-transform: none;
  margin: 22px 4px 8px; scroll-margin-top: calc(var(--topbar-h) + 64px); }

/* ---------- Tab bar ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: flex; justify-content: center; gap: 8px;
  background: var(--surface);
  border-top: 1px solid var(--hair);
  box-shadow: var(--bar-shadow);
}
.tab {
  flex: 1; max-width: 160px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 3px; color: #8a8b92; font-size: 11px; font-weight: 600;
  position: relative; padding-top: 9px;
}
.tab.active { color: var(--accent); }
.tab-ico { font-size: 23px; filter: grayscale(.35); opacity: .85; }
.tab.active .tab-ico { filter: none; opacity: 1; transform: translateY(-1px); }
.badge {
  position: absolute; top: 4px; left: 56%; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* ---------- Filter row ---------- */
.filterbar { display: flex; flex-direction: column; gap: 10px; margin-bottom: 6px; }
.search {
  display: flex; align-items: center; gap: 8px; background: var(--surface-2);
  border-radius: var(--r-sm); padding: 9px 12px; color: var(--text-2);
}
.search input { border: none; background: none; outline: none; flex: 1; color: var(--text); }
.search .sico { opacity: .6; }
.filter-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.seg {
  display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 2px; gap: 2px;
}
.seg button {
  border-radius: 8px; padding: 6px 13px; font-size: 14px; font-weight: 500; color: var(--text);
  white-space: nowrap;
}
.seg button.on { background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.12); font-weight: 600; }
.toggle-chip {
  border: 1px solid var(--hair); border-radius: 999px; padding: 6px 12px; font-size: 14px;
  font-weight: 500; color: var(--text-2); display: inline-flex; align-items: center; gap: 5px;
}
.toggle-chip.on { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.result-count { color: var(--text-2); font-size: 13px; margin: 2px 4px 10px; }

/* ---------- Recipe cards ---------- */
.cards { display: flex; flex-direction: column; gap: 12px; }
.card {
  background: var(--surface); border-radius: var(--r); padding: 15px 16px; box-shadow: var(--shadow);
  display: block; transition: transform .12s ease;
}
.card:active { transform: scale(.985); }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.card-title { font-size: 17px; font-weight: 650; letter-spacing: -.01em; margin: 0; }
.card-blurb { color: var(--text-2); font-size: 14px; margin: 5px 0 0; }
.card-meta { display: flex; align-items: center; gap: 12px; margin-top: 11px; flex-wrap: wrap; }
.meta-item { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--text-2); }
.dots { display: inline-flex; gap: 4px; align-items: center; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.dot.great { background: var(--great); }
.dot.ok { background: var(--ok); }
.dot.weak { background: var(--weak); }
.pill {
  font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-2);
}
.pill.best { background: var(--accent-soft); color: var(--accent); }
.pill.veg { background: rgba(79,157,91,.16); color: #3f8a4e; }
.pill.made { background: rgba(70,113,156,.13); color: #46719c; }
.save-btn { font-size: 22px; line-height: 1; color: var(--text-2); padding: 0 2px; }
.save-btn.on { color: #ff375f; }

/* ---------- Recipe detail ---------- */
.detail-title { font-size: 27px; font-weight: 700; letter-spacing: -.02em; margin: 2px 0 10px; }
.glance {
  background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow);
  padding: 16px 16px 6px; margin-bottom: 14px;
}
.glance .badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.glance-row { display: flex; gap: 10px; padding: 10px 0; border-top: .5px solid var(--hair); }
.glance-row:first-of-type { border-top: none; }
.glance-row .k { flex: 0 0 78px; color: var(--text-2); font-size: 13px; font-weight: 600; padding-top: 1px; }
.glance-row .v { flex: 1; font-size: 15px; }
.scoreline { display: flex; flex-wrap: wrap; gap: 14px; margin: 2px 0 0; }
.score { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.action-row { display: flex; gap: 10px; margin: 4px 0 18px; }
.cook-cta { margin: 4px 0 10px; }
.play-btn {
  width: 100%; min-height: 58px; border-radius: 16px; background: var(--accent); color: #fff;
  box-shadow: var(--shadow); display: flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 17px; font-weight: 700;
}
.play-btn:active { transform: scale(.99); }
.play-ico {
  width: 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,.22);
  display: inline-flex; align-items: center; justify-content: center; font-size: 13px; padding-left: 2px;
}
.made-note { color: var(--text-2); font-size: 13px; margin: 8px 4px 0; text-align: center; }
.secondary-actions .ghost-btn { flex: 1; justify-content: center; }
.ghost-btn.added { background: var(--accent-soft); color: var(--accent); }
.primary-btn {
  background: var(--accent); color: #fff; border-radius: var(--r-sm); padding: 13px 18px;
  font-size: 16px; font-weight: 600; flex: 1; text-align: center; transition: opacity .12s;
}
.primary-btn:active { opacity: .85; }
.primary-btn:disabled { opacity: .4; }
.primary-btn.added { background: var(--accent-soft); color: var(--accent); }
.ghost-btn {
  background: var(--surface-2); color: var(--text); border-radius: var(--r-sm); padding: 13px 16px;
  font-size: 16px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px;
}
.ghost-btn.on { color: #ff375f; }

.block { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow);
  padding: 6px 16px; margin-bottom: 14px; }
.block h3 { font-size: 13px; font-weight: 600; color: var(--text-2); text-transform: uppercase;
  letter-spacing: .04em; margin: 14px 0 6px; }
.block ul, .block ol { margin: 0 0 14px; padding-left: 20px; }
.block li { margin: 6px 0; }
.block p { margin: 4px 0 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.ing-chip {
  background: var(--surface-2); border-radius: 999px; padding: 7px 13px; font-size: 14px;
  font-weight: 500; display: inline-flex; align-items: center; gap: 6px;
}
.ing-chip .x { color: var(--text-2); font-size: 12px; }
.variant-note {
  background: var(--accent-soft); color: var(--accent); border-radius: var(--r-sm);
  padding: 10px 13px; font-size: 14px; font-weight: 500; margin: 4px 0 14px;
}
.why { color: var(--text-2); font-size: 14px; }

/* ---------- Ingredients ---------- */
.ing-list { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.ing-item {
  display: flex; align-items: center; gap: 12px; padding: 13px 16px;
  border-top: .5px solid var(--hair);
}
.ing-item:first-child { border-top: none; }
.ing-item .name { font-size: 16px; font-weight: 500; flex: 1; }
.ing-item .sub { color: var(--text-2); font-size: 13px; }
.ing-item .chev { color: var(--text-2); opacity: .5; font-size: 20px; }
.cat-desc { color: var(--text-2); font-size: 13px; margin: 2px 4px 8px; }

.ing-hero { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 2px 0 6px; }
.ing-hero h1 { font-size: 27px; font-weight: 700; letter-spacing: -.02em; margin: 0; }
.tag { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); }

/* ---------- Basket ---------- */
.basket-presets { display: flex; gap: 10px; margin-bottom: 16px; }
.preset-btn {
  flex: 1; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow);
  padding: 14px; text-align: left;
}
.preset-btn .pt { font-weight: 650; font-size: 15px; }
.preset-btn .ps { color: var(--text-2); font-size: 13px; margin-top: 2px; }
.basket-group-title { display: flex; justify-content: space-between; align-items: baseline; }
.check-list { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 14px; }
.check-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: .5px solid var(--hair); }
.check-item:first-child { border-top: none; }
.check-box {
  width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--hair);
  display: flex; align-items: center; justify-content: center; flex: 0 0 auto; color: #fff; font-size: 14px;
}
.check-item.done .check-box { background: var(--accent); border-color: var(--accent); }
.check-item.done .ci-label { color: var(--text-2); text-decoration: line-through; }
.ci-label { flex: 1; font-size: 16px; }
.ci-aisle { color: var(--text-2); font-size: 12px; }
.ci-remove { color: var(--text-2); opacity: .5; font-size: 18px; padding: 0 4px; }
.link-btn { color: var(--accent); font-weight: 600; font-size: 15px; }

/* ---------- Empty states ---------- */
.empty { text-align: center; color: var(--text-2); padding: 60px 20px; }
.empty .e-emoji { font-size: 40px; }
.empty p { margin: 10px 0 0; }

/* ---------- Onboarding ---------- */
.onboarding {
  position: fixed; inset: 0; z-index: 100; background: var(--bg);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.onboarding-card { width: 100%; max-width: 380px; text-align: center; }
.onboarding-mark { font-size: 52px; }
.onboarding h1 { font-size: 34px; font-weight: 700; letter-spacing: -.02em; margin: 6px 0 2px; }
.onboarding-sub { color: var(--text-2); margin: 0 0 24px; }
.diet-choice { display: flex; gap: 12px; margin-bottom: 22px; }
.diet-btn {
  flex: 1; background: var(--surface); border: 2px solid transparent; border-radius: var(--r);
  box-shadow: var(--shadow); padding: 20px 10px; font-size: 16px; font-weight: 600;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.diet-btn .diet-emoji { font-size: 30px; }
.diet-btn.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.name-field { display: block; text-align: left; margin-bottom: 8px; }
.name-field span { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin: 0 4px 6px; }
.name-field input {
  width: 100%; background: var(--surface); border: 1px solid var(--hair); border-radius: var(--r-sm);
  padding: 13px 14px; outline: none; color: var(--text);
}
.name-field input:focus { border-color: var(--accent); }
.name-hint { color: var(--text-2); font-size: 12.5px; text-align: left; margin: 8px 4px 22px; line-height: 1.4; }
.onboarding .primary-btn { width: 100%; }

/* ---------- Sheet ---------- */
.sheet { position: fixed; inset: 0; z-index: 90; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.35); }
.sheet-card {
  position: relative; z-index: 2; width: 100%; max-width: var(--maxw);
  background: var(--bg); border-radius: 20px 20px 0 0; padding: 10px 20px calc(28px + var(--safe-b));
  box-shadow: 0 -10px 40px rgba(0,0,0,.25); animation: slideup .26s cubic-bezier(.2,.8,.2,1);
}
@keyframes slideup { from { transform: translateY(100%); } to { transform: translateY(0); } }
.sheet-grip { width: 38px; height: 5px; border-radius: 3px; background: var(--hair); margin: 4px auto 12px; }
.sheet h2 { font-size: 20px; font-weight: 700; margin: 0 4px 16px; }
.sheet .seg { width: 100%; margin: 12px 0 4px; }
.sheet .seg button { flex: 1; text-align: center; }
.sheet-actions { margin-top: 18px; }
.sheet-meta { color: var(--text-2); font-size: 12px; text-align: center; margin: 14px 0 0; }

/* ---------- Voice command ---------- */
.voice-fab {
  position: fixed; right: 16px; bottom: calc(var(--tabbar-h) + var(--safe-b) + 16px); z-index: 40;
  min-width: 74px; min-height: 56px; padding: 8px 14px; border-radius: 999px;
  background: var(--accent); color: #fff; box-shadow: 0 10px 28px rgba(60,40,20,.28);
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-weight: 700;
}
.voice-fab:active { transform: scale(.98); }
.voice-ico { font-size: 21px; }
.voice-label { font-size: 15px; }
.voice-card { padding-bottom: calc(24px + var(--safe-b)); }
.sheet-close {
  position: absolute; top: 12px; right: 16px; width: 34px; height: 34px; border-radius: 50%;
  background: var(--surface-2); color: var(--text-2); font-size: 22px; line-height: 1;
}
.voice-intro { color: var(--text-2); font-size: 14px; margin: -8px 4px 14px; }
.voice-suggestions { display: flex; gap: 8px; overflow-x: auto; padding: 0 2px 12px; scrollbar-width: none; }
.voice-suggestions::-webkit-scrollbar { display: none; }
.voice-suggestions button {
  flex: 0 0 auto; border-radius: 999px; background: var(--surface); border: 1px solid var(--hair);
  box-shadow: var(--shadow); padding: 8px 12px; font-size: 14px; font-weight: 600; color: var(--text);
}
.command-field { display: block; margin: 0 0 12px; }
.command-field span { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin: 0 4px 6px; }
.command-field textarea {
  width: 100%; resize: vertical; min-height: 92px; border: 1px solid var(--hair); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text); padding: 12px 13px; outline: none; font: inherit;
}
.command-field textarea:focus { border-color: var(--accent); }
.voice-actions { display: flex; gap: 10px; align-items: stretch; }
.voice-actions .ghost-btn, .voice-actions .primary-btn { flex: 1; justify-content: center; }
.voice-status { color: var(--text-2); font-size: 13px; min-height: 18px; margin: 10px 4px 0; }
.voice-plan-output { margin-top: 10px; }
.command-plan {
  background: var(--surface); border-radius: var(--r-sm); border: 1px solid var(--hair);
  padding: 13px; font-size: 14px;
}
.command-plan h3 { margin: 0 0 4px; font-size: 15px; }
.command-plan p { margin: 0 0 8px; color: var(--text-2); }
.command-plan ul { margin: 0 0 12px; padding-left: 18px; }
.command-plan li { margin: 4px 0; }

/* ---------- Cook mode ---------- */
body.cook-open { overflow: hidden; }
.cook-mode {
  position: fixed; inset: 0; z-index: 120; background: var(--bg); color: var(--text);
}
.cook-shell {
  min-height: 100%; max-width: var(--maxw); margin: 0 auto; padding: env(safe-area-inset-top,0px) 18px
    calc(22px + var(--safe-b));
  display: flex; flex-direction: column;
}
.cook-top {
  display: grid; grid-template-columns: 42px 1fr; gap: 10px; align-items: center; padding: 14px 0 12px;
}
.cook-close {
  width: 38px; height: 38px; border-radius: 50%; background: var(--surface-2); color: var(--text-2);
  font-size: 24px; line-height: 1;
}
.cook-kicker { color: var(--text-2); font-size: 13px; font-weight: 600; }
.cook-top h2 { margin: 1px 0 0; font-size: 19px; line-height: 1.2; }
.cook-body { flex: 1; display: flex; flex-direction: column; gap: 14px; }
.cook-progress { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.cook-progress span { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width .2s ease; }
.cook-step-card {
  flex: 1; min-height: 280px; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow);
  padding: 22px; display: flex; flex-direction: column; justify-content: center;
}
.cook-step-meta { color: var(--text-2); font-size: 14px; font-weight: 600; margin-bottom: 14px; }
.cook-step-card p { font-size: 26px; line-height: 1.28; letter-spacing: 0; margin: 0; }
.cook-timer-card {
  background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); padding: 14px;
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
}
.cook-timer-card h3 { margin: 0 0 4px; font-size: 14px; color: var(--text-2); }
.cook-timer-display { font-size: 24px; font-weight: 750; }
.cook-timer-display.done { color: var(--accent); }
.cook-timer-actions { display: flex; flex-wrap: wrap; gap: 7px; justify-content: flex-end; }
.cook-timer-actions button {
  border-radius: 999px; background: var(--surface-2); padding: 7px 10px; font-size: 13px; font-weight: 650;
}
.cook-nav { display: flex; gap: 10px; }
.cook-nav .ghost-btn, .cook-nav .primary-btn { flex: 1; justify-content: center; }
.cook-nav button:disabled { opacity: .35; }
.cook-review {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 24px 8px; gap: 12px;
}
.review-mark {
  width: 62px; height: 62px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-size: 34px; font-weight: 800;
}
.cook-review h3 { margin: 0; font-size: 26px; }
.cook-review p { margin: 0; color: var(--text-2); max-width: 360px; }
.review-actions { width: 100%; display: flex; flex-direction: column; gap: 10px; margin: 10px 0; }
.review-actions button {
  background: var(--surface); border-radius: var(--r-sm); box-shadow: var(--shadow); padding: 14px;
  font-size: 16px; font-weight: 650;
}
@media (max-width: 430px) {
  .cook-step-card p { font-size: 23px; }
  .cook-timer-card { align-items: flex-start; flex-direction: column; }
  .cook-timer-actions { justify-content: flex-start; }
}

/* ---------- Ingredients: swipeable group pager ---------- */
.jump-bar {
  display: flex; gap: 8px; overflow-x: auto; padding: 4px 16px 12px; margin: 0 -16px;
  scrollbar-width: none; flex: 0 0 auto;
}
.jump-bar::-webkit-scrollbar { display: none; }
.jump-chip {
  white-space: nowrap; background: var(--surface); border: 1px solid var(--hair);
  border-radius: 999px; padding: 7px 14px; font-size: 14px; font-weight: 600; color: var(--text);
  box-shadow: var(--shadow); transition: background .12s, color .12s;
}
.jump-chip .jc-count { color: var(--text-2); font-weight: 500; margin-left: 4px; }
.jump-chip.on { background: var(--accent); color: #fff; border-color: transparent; box-shadow: none; }
.jump-chip.on .jc-count { color: rgba(255,255,255,.82); }

body.view-ingredients .view {
  height: 100dvh; padding-bottom: 0; overflow: hidden;
  display: flex; flex-direction: column;
}
.ing-head { flex: 0 0 auto; }
.ing-head .large-title { margin: 2px 2px 8px; }
.ing-pager {
  flex: 1 1 auto; display: flex; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none;
  margin: 0 -16px;
}
.ing-pager::-webkit-scrollbar { display: none; }
.ing-panel {
  flex: 0 0 100%; scroll-snap-align: start; overflow-y: auto; scrollbar-width: none;
  padding: 2px 16px calc(var(--tabbar-h) + var(--safe-b) + 16px);
  -webkit-overflow-scrolling: touch;
}
.ing-panel::-webkit-scrollbar { display: none; }
.panel-hint { text-align: center; color: var(--text-2); font-size: 12px; padding: 6px 0 2px; opacity: .7; }

/* ---------- Score shapes (nutrition / effort / taste) ---------- */
.sc { width: 14px; height: 14px; display: inline-block; vertical-align: -2px; flex: 0 0 auto; }
.sc.great { fill: var(--great); } .sc.ok { fill: var(--ok); } .sc.weak { fill: var(--weak); }
.scoreline .sc, .score .sc { width: 16px; height: 16px; vertical-align: -3px; }
.legend .sc { width: 14px; height: 14px; vertical-align: -3px; margin-right: 4px; }

/* ---------- Score legend ---------- */
.legend {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px;
  font-size: 12.5px; color: var(--text-2); margin: 0 4px 12px;
}
.legend .lg { display: inline-flex; align-items: center; gap: 5px; }
.legend .sep { opacity: .4; }

/* ---------- Basket head + recipes-in-cart ---------- */
.basket-head { display: flex; align-items: baseline; justify-content: space-between; margin: 0 4px 12px; }
.basket-head .bh-count { color: var(--text-2); font-size: 14px; }
.cart-recipe {
  background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow);
  padding: 12px 14px; display: flex; align-items: center; gap: 12px; margin-bottom: 10px;
}
.cart-recipe .cr-main { flex: 1; min-width: 0; }
.cart-recipe .cr-title { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-recipe .cr-sub { color: var(--text-2); font-size: 12.5px; margin-top: 1px; }
.cart-recipe .cr-remove { color: var(--text-2); opacity: .55; font-size: 20px; padding: 0 2px; }
.stepper { display: inline-flex; align-items: center; background: var(--surface-2); border-radius: 999px; }
.stepper button { width: 30px; height: 30px; font-size: 19px; color: var(--accent); font-weight: 600; line-height: 1; }
.stepper button:disabled { color: var(--text-2); opacity: .4; }
.stepper .sv { min-width: 30px; text-align: center; font-size: 14px; font-weight: 600; }
.ci-source { color: var(--text-2); font-size: 12px; margin-top: 1px; }
.ci-main { flex: 1; min-width: 0; }
.ci-qty { color: var(--accent); font-weight: 600; font-size: 14px; margin-left: 4px; }

[hidden] { display: none !important; }
