/* Sawsan — style.css
   Shared tokens from direction.md §4. Every future tool inherits this block. */
:root {
  --surface: #edeae6; --surface-2: #e8e1d7; --card: #f5f3f0; --line: #cfc8bb;
  --ink: #4d251f; --ink-body: #6b3a33; --ink-soft: #85564e;
  --rose: #d3a8a2; --rose-ink: #4a221c;
  --primary: #696649; --primary-edge: #575537; --primary-hover: #767252; --primary-down: #5b5940; --on-primary: #f7f4f0;
  --alarm: #602e27; --on-alarm: #edeae6; --urgency: #a64f42; --have: #a4a288; --good: #4a5a2e; --good-fill: #c2cfa5;

  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Figtree", system-ui, sans-serif;
  /* No monospace: numbers and labels use Figtree with even-width digits. */
  --mono: "Figtree", system-ui, sans-serif;

  /* "Lifted": surfaces sit just above the page on soft, warm shadows. */
  --lift: #fbfaf8;
  --lift-edge: rgba(207, 200, 187, .6);
  --shadow-card: 0 1px 2px rgba(77, 37, 31, .05), 0 10px 28px -8px rgba(77, 37, 31, .16);
  --shadow-chip: 0 1px 2px rgba(77, 37, 31, .06), 0 4px 10px -2px rgba(77, 37, 31, .14);
  --shadow-chip-up: 0 2px 4px rgba(77, 37, 31, .07), 0 8px 16px -4px rgba(77, 37, 31, .2);
  --glow-rose: 0 6px 14px -4px rgba(211, 168, 162, .9);
  --glow-olive: 0 10px 22px -10px rgba(105, 102, 73, .9);

  /* Motion: soft overshoot. Things float in and settle; nothing snaps. */
  --float: cubic-bezier(.22, 1.25, .36, 1);
  --ease: cubic-bezier(.4, 0, .2, 1);

  --r-lg: 24px; --r: 18px; --r-sm: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--surface); color: var(--ink-body);
  font: 16px/1.55 var(--sans); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; min-height: 100vh;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.wrap { max-width: 560px; margin: 0 auto; padding: 0 16px 56px; }

/* ---------- drifting background: the "floaty" ---------- */
.blobs { position: fixed; inset: 0; overflow: hidden; z-index: -1; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(64px); opacity: .5; will-change: transform; }
.b1 { width: 70vmax; height: 70vmax; background: var(--rose); top: -32vmax; right: -28vmax; }
.b2 { width: 55vmax; height: 55vmax; background: var(--good-fill); bottom: -26vmax; left: -24vmax; }
.b3 { width: 40vmax; height: 40vmax; background: var(--surface-2); top: 38%; left: 25%; opacity: .8; }
@keyframes drift1 { to { transform: translate(-10vmax, 12vmax) scale(1.1); } }
@keyframes drift2 { to { transform: translate(12vmax, -8vmax) scale(.92); } }
@keyframes drift3 { to { transform: translate(-6vmax, -10vmax) scale(1.15); } }

/* ---------- header + intro ---------- */
.top { padding: 22px 0 4px; }
.logo { height: 46px; width: auto; display: block; animation: floatIn .9s var(--float) .1s both; }
.intro { padding: 22px 0 24px; }
.intro > * { animation: floatIn .8s var(--float) both; }
.intro > :nth-child(2) { animation-delay: .12s; }
.intro > :nth-child(3) { animation-delay: .22s; }
.eyebrow {
  font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-soft);
}
h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(36px, 10vw, 46px); line-height: 1.02; color: var(--ink); margin-top: 8px; }
h1 em { color: var(--ink-soft); }
.lede { margin-top: 12px; max-width: 40ch; }

/* ---------- blocks ---------- */
.block {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 20px 18px; margin-bottom: 16px; animation: floatIn .8s var(--float) .3s both;
}
#meals.block { animation-delay: .42s; }
.block-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
h2 { font-family: var(--serif); font-weight: 400; font-size: 28px; line-height: 1.1; color: var(--ink); margin-top: 4px; }

.field { margin-top: 18px; }
.label { display: block; font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.label small, label.f small { font-weight: 400; color: var(--ink-soft); }
label.f { display: block; font-size: 14px; font-weight: 600; color: var(--ink); margin-top: 16px; }
label.f input, label.f textarea { margin-top: 6px; }

input, select, textarea {
  width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 11px 12px; font-size: 16px; color: var(--ink);
  transition: border-color .2s var(--ease), box-shadow .45s var(--float);
}
textarea { resize: vertical; line-height: 1.45; }
input, select { min-height: 48px; }
select {
  appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1.5 1.5 6 6l4.5-4.5' fill='none' stroke='%2385564e' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.mini input, #staples .s-cost { min-height: 42px; }
input::placeholder, textarea::placeholder { color: var(--ink-soft); opacity: .75; }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(105, 102, 73, .18);
}
button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) 112px; gap: 10px; align-items: start; }

/* ---------- choice pills: squish on press, pop when chosen ---------- */
.opts { display: flex; gap: 8px; flex-wrap: wrap; }
.opt {
  min-width: 46px; height: 46px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  font-family: var(--mono); font-size: 15px; color: var(--ink-soft);
  transition: transform .5s var(--float), background .25s var(--ease), color .25s var(--ease), border-color .25s;
}
.opt:active { transform: scale(.9); transition-duration: .08s; }
.opt[aria-pressed="true"] { background: var(--rose); border-color: var(--rose); color: var(--rose-ink); animation: pop .55s var(--float); }
@keyframes pop { from { scale: .82; } to { scale: 1; } }

/* ---------- buttons ---------- */
.btn {
  min-height: 46px; padding: 11px 20px; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; color: var(--ink-body);
  font-weight: 500; font-size: 15px;
  transition: transform .5s var(--float), background .2s var(--ease), border-color .2s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(.95); transition-duration: .08s; }
.btn-primary { background: var(--primary); border-color: var(--primary-edge); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:active { background: var(--primary-down); }
.btn-primary:disabled { opacity: .45; cursor: default; transform: none; }
.btn.done { border-color: var(--have); color: var(--ink); }
.btn-text {
  background: none; border: 0; padding: 10px 4px; min-height: 44px;
  color: var(--ink-soft); font-size: 14px; text-decoration: underline; text-underline-offset: 3px;
  transition: transform .5s var(--float);
}
.btn-text:active { transform: scale(.95); transition-duration: .08s; }
.x {
  width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent;
  color: var(--ink-soft); font-size: 20px; line-height: 1; transition: transform .5s var(--float), background .2s;
}
.x:hover { background: var(--surface-2); }
.x:active { transform: scale(.85); transition-duration: .08s; }

/* ---------- money line ---------- */
.allow { margin-top: 10px; font-family: var(--mono); font-size: 14px; color: var(--ink-soft); }
.allow b { color: var(--ink); font-weight: 500; font-size: 17px; }
.small { font-size: 13px; color: var(--ink-soft); margin-top: 8px; }

/* ---------- staples ---------- */
#staples { list-style: none; }
#staples li {
  display: grid; grid-template-columns: minmax(0, 1fr) 72px 112px 32px; gap: 6px; align-items: center;
  padding: 6px 0; border-bottom: 1px dashed var(--line);
}
#staples .s-name { color: var(--ink); }
#staples .s-cost { padding: 8px 10px; }
.add-row { display: flex; gap: 8px; margin-top: 10px; }

/* ---------- the lily: one petal per meal, full bloom at five ---------- */
.bloom { width: 64px; height: 52px; overflow: visible; flex: none; }
.bloom .sway { transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes sway { from { transform: rotate(-3deg); } to { transform: rotate(3deg); } }
.bloom .petal {
  fill: var(--card); stroke: var(--ink-soft); stroke-width: 1.2; stroke-opacity: .55;
  transform-box: fill-box; transform-origin: 50% 100%;
  transform: rotate(var(--a)) scale(.55);
  transition: transform 1.1s var(--float), fill .6s var(--ease), stroke-opacity .6s;
}
.bloom .petal.on { fill: var(--rose); stroke: var(--rose-ink); stroke-opacity: .35; transform: rotate(var(--a)) scale(1); }
.bloom .stamen { stroke: var(--primary); stroke-width: 1.2; fill: none; opacity: 0; transition: opacity .8s var(--ease) .4s; }
.bloom .stamen circle { fill: var(--primary); stroke: none; }
.bloom.full .stamen { opacity: 1; }
.count { text-align: right; }
.count b { display: block; font-family: var(--mono); font-weight: 500; font-size: 13px; color: var(--ink); }
.ready { font-size: 14px; color: var(--ink-soft); margin-top: 6px; }

/* ---------- meal cards ---------- */
#mealList { margin-top: 14px; }
.meal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); margin-top: 10px; overflow: hidden; }
.meal.enter, .pv.enter, #staples li.enter { animation: floatIn .7s var(--float) both; animation-delay: calc(var(--i, 0) * 70ms); }
.meal.leave, #staples li.leave { animation: floatOut .3s var(--ease) both; }
@keyframes floatIn { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes floatOut { to { opacity: 0; transform: translateY(-10px) scale(.95); } }

.meal-head {
  width: 100%; display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 14px 16px 4px; background: none; border: 0; text-align: left;
}
.meal-name { font-family: var(--serif); font-size: 24px; line-height: 1.12; color: var(--ink); }
.meal-cost { font-family: var(--mono); font-size: 15px; color: var(--ink); white-space: nowrap; }
.meal-cost small, .cur-s { font-size: 11px; color: var(--ink-soft); }
.meal-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 2px 16px 14px; }
.tag {
  font-family: var(--mono); font-size: 11px; letter-spacing: .04em; padding: 3px 10px;
  border-radius: 999px; border: 1px solid var(--line); color: var(--ink-body); background: var(--card);
}
.tag-l { font-family: var(--mono); font-size: 11px; color: var(--ink-soft); }
.pdots { display: inline-flex; gap: 3px; align-items: center; }
.pdots i { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--ink-soft); transition: background .3s; }
.pdots[data-level="low"] i:nth-child(1),
.pdots[data-level="med"] i:nth-child(-n+2),
.pdots[data-level="high"] i { background: var(--ink-soft); }

.meal-body { padding: 4px 16px 12px; border-top: 1px dashed var(--line); animation: floatIn .5s var(--float) both; }
.edit-stack { display: grid; gap: 12px; margin: 14px 0; }
.mini { display: flex; flex-direction: column; gap: 6px; }
.mini input { max-width: 140px; }
.mini > span { font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.mini input { padding: 9px 12px; }

.ing { list-style: none; }
.ing li { display: grid; grid-template-columns: 62px 1fr auto; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.ing .q { font-family: var(--mono); font-size: 12px; color: var(--ink-soft); }
.ing .n { color: var(--ink); display: block; }
.ing .a { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
.ing li.pantry .n { color: var(--ink-soft); }
.stock {
  font-family: var(--mono); font-size: 11px; padding: 6px 11px; border-radius: 999px;
  border: 1px dashed var(--line); background: transparent; color: var(--ink-soft);
  transition: transform .5s var(--float), border-color .2s;
}
.stock[aria-pressed="true"] { border: 1.5px solid var(--have); color: var(--ink); }
.stock:active { transform: scale(.9); transition-duration: .08s; }

.add-meals { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; align-items: center; }
.add-meals .btn-primary { flex: 1 1 100%; }
.foot { text-align: center; font-family: var(--serif); font-style: italic; font-size: 19px; line-height: 1.3; color: var(--ink-soft); padding: 20px 0; text-wrap: balance; }

/* ---------- bottom sheets ---------- */
dialog.sheet {
  margin: auto auto 0; width: 100%; max-width: 560px; max-height: 92vh;
  border: 0; border-radius: var(--r-lg) var(--r-lg) 0 0; padding: 0; overflow: hidden;
  background: var(--card); color: var(--ink-body); box-shadow: 0 -12px 40px rgba(77, 37, 31, .18);
}
dialog.sheet[open] { animation: sheetUp .6s var(--float); }
dialog.sheet.closing { animation: sheetDown .22s var(--ease) forwards; }
dialog.sheet::backdrop { background: rgba(77, 37, 31, .28); backdrop-filter: blur(3px); }
@keyframes sheetUp { from { transform: translateY(48px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes sheetDown { to { transform: translateY(36px); opacity: 0; } }
.sheet-inner { padding: 10px 18px 0; overflow: auto; max-height: 92vh; }
.grip { width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 0 auto 16px; }

.steps { list-style: none; margin-top: 12px; }
.steps > li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; margin-top: 16px; }
.steps .n {
  width: 28px; height: 28px; border-radius: 50%; background: var(--rose); color: var(--rose-ink);
  font-family: var(--mono); font-size: 13px; display: grid; place-items: center;
}
.steps label, .steps p { display: block; font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.steps .btn { margin-top: 8px; }
.prompt {
  white-space: pre-wrap; font-family: var(--sans); font-size: 13px; line-height: 1.5;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 12px; max-height: 170px; overflow: auto; color: var(--ink-body); overflow-wrap: anywhere;
}
.field-err { margin-top: 10px; font-size: 14px; color: var(--ink); border-left: 3px solid var(--ink); padding-left: 10px; }

#impPreview { margin-top: 20px; }
.pv { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin-top: 10px; transition: opacity .3s; }
.pv.off { opacity: .45; }
.pv-top { display: flex; gap: 10px; align-items: center; }
.pv-name { font-family: var(--serif); font-size: 21px; padding: 6px 10px; }
.inc { display: flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 12px; color: var(--ink-soft); white-space: nowrap; }
.inc input { width: 20px; height: 20px; accent-color: var(--primary); }
.pv-sum { font-family: var(--mono); font-size: 11px; color: var(--ink-soft); }
.pv-sum b { color: var(--ink); font-weight: 500; }
.notes { list-style: none; margin-top: 8px; }
.notes li { font-size: 13px; color: var(--ink-body); padding-left: 16px; position: relative; }
.notes li::before { content: "i"; position: absolute; left: 0; top: 2px; width: 11px; height: 11px; border: 1px solid var(--ink-soft); border-radius: 50%; font: 8px/10px var(--mono); text-align: center; color: var(--ink-soft); }

.sheet-actions {
  position: sticky; bottom: 0; display: flex; gap: 10px; justify-content: flex-end; align-items: center;
  padding: 12px 0 calc(14px + env(safe-area-inset-bottom)); margin-top: 18px;
  background: var(--card); border-top: 1px solid var(--line);
}

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 10;
  transform: translate(-50%, 24px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--surface); padding: 12px 20px; border-radius: 999px;
  font-size: 14px; max-width: calc(100% - 32px); text-align: center;
  transition: transform .55s var(--float), opacity .25s var(--ease);
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ---------- respect "reduce motion" ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .blob { animation: none; }
}

/* ---------- chips: dropdowns replaced by tappable options ---------- */
.chips { position: relative; display: flex; flex-wrap: wrap; gap: 6px; isolation: isolate; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; scroll-padding: 0 24px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 22px), transparent); mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 22px), transparent); padding-left: 2px; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip {
  position: relative; z-index: 1; flex: none; height: 38px; padding: 0 15px; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; color: var(--ink-soft); font-size: 14px; font-weight: 500;
  transition: color .3s var(--ease), border-color .3s var(--ease), transform .5s var(--float);
}
.chip:hover { color: var(--ink); }
.chip:active { transform: scale(.9); transition-duration: .08s; }
.chip[aria-checked="true"] { color: var(--rose-ink); border-color: transparent; }
.chip-ind {
  position: absolute; left: 0; top: 0; z-index: 0; border-radius: 999px; background: var(--rose); opacity: 0; pointer-events: none;
  transition: transform .55s var(--float), width .55s var(--float), height .55s var(--float), opacity .2s;
}

/* ---------- weeks stepper ---------- */
.stepper { display: grid; grid-template-columns: 32px 1fr 32px; align-items: center; height: 42px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); overflow: hidden; }
.stepper button { height: 100%; border: 0; background: none; color: var(--ink-soft); font-size: 18px; line-height: 1; transition: transform .45s var(--float), color .2s; }
.stepper button:active { transform: scale(.75); transition-duration: .08s; color: var(--ink); }
.stepper b { text-align: center; font-weight: 500; font-size: 14px; color: var(--ink); white-space: nowrap; }
.stepper b.bump.up { animation: rollUp .45s var(--float); }
.stepper b.bump.down { animation: rollDown .45s var(--float); }
@keyframes rollUp { from { transform: translateY(9px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes rollDown { from { transform: translateY(-9px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ================= Lifted look + smaller floating bubbles ================= */
.block { background: var(--lift); border-color: var(--lift-edge); box-shadow: var(--shadow-card); }
.meal, .pv { background: #fff; border-color: var(--lift-edge); box-shadow: var(--shadow-chip); }
dialog.sheet { background: var(--lift); }
.sheet-actions { background: var(--lift); }

.opts { gap: 8px; }
.opt {
  min-width: 38px; height: 38px; padding: 0 11px; font-size: 15px; font-weight: 500;
  background: #fff; border-color: transparent; color: var(--ink-soft); box-shadow: var(--shadow-chip);
  transition: transform .5s var(--float), box-shadow .35s var(--ease), background .25s var(--ease), color .25s var(--ease);
}
.opt:hover { box-shadow: var(--shadow-chip-up); transform: translateY(-1px); }
.opt[aria-pressed="true"] { background: var(--rose); border-color: transparent; color: var(--rose-ink); box-shadow: var(--glow-rose); }

.chip { height: 36px; padding: 0 14px; background: #fff; border-color: transparent; box-shadow: var(--shadow-chip); }
.chip:hover { box-shadow: var(--shadow-chip-up); }
.chip[aria-checked="true"] { background: transparent; box-shadow: none; }
.chip-ind { box-shadow: var(--glow-rose); }
.chips.scroll { padding-top: 4px; padding-bottom: 10px; margin-bottom: -6px; }

.btn { background: #fff; border-color: transparent; box-shadow: var(--shadow-chip); }
.btn:hover { background: #fff; box-shadow: var(--shadow-chip-up); }
.btn-primary { background: var(--primary); border-color: var(--primary-edge); box-shadow: var(--glow-olive); }
.btn-primary:hover { background: var(--primary-hover); box-shadow: var(--glow-olive); }
.btn-primary:disabled { box-shadow: none; }
.btn-text, .btn-text:hover { background: none; box-shadow: none; }
.stepper { background: #fff; border-color: transparent; box-shadow: var(--shadow-chip); }
.stock { background: #fff; }
.steps .n { box-shadow: var(--glow-rose); }
.toast { box-shadow: 0 12px 28px -10px rgba(77, 37, 31, .5); }
/* inputs: soft sunken wells instead of outlined boxes */
input, textarea { background: #f1ede8; border-color: transparent; box-shadow: inset 0 1px 3px rgba(77, 37, 31, .08); }
input:focus-visible, textarea:focus-visible { background: #fff; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(105, 102, 73, .16); }
.pv-name { background: transparent; box-shadow: none; }
.pv-name:focus-visible { background: #fff; }
/* currency row: fade only the right edge, so the first chip isn't cut */
.chips.scroll { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 26px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 26px), transparent); padding-left: 4px; margin-left: -4px; }
.chips.scroll { padding: 8px 10px 16px; margin: -8px -10px -10px; }

/* ================= header: logo + tagline + help ================= */
.top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.tagline {
  font-family: var(--serif); font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink);
  padding-left: 18px; animation: floatIn .9s var(--float) .25s both;
}
.tagline em { font-size: 19px; letter-spacing: 0; text-transform: none; color: var(--ink-soft); padding: 0 2px; }
.help {
  flex: none; width: 44px; height: 44px; margin-top: 6px; border-radius: 50%; border: 0;
  background: #fff; box-shadow: var(--shadow-chip); color: var(--rose-ink);
  font: 400 22px/1 "Pacifico", cursive; padding-top: 2px;
  transition: transform .5s var(--float), box-shadow .35s var(--ease);
}
.help:hover { box-shadow: var(--shadow-chip-up); }
.help:active { transform: scale(.88); transition-duration: .08s; }

/* ================= progress dots ================= */
.progress { display: flex; gap: 10px; justify-content: center; align-items: center; margin: 14px 0 4px; }
.dot {
  position: relative; width: 9px; height: 9px; padding: 0; border: 0; border-radius: 999px; background: var(--line);
  transition: width .55s var(--float), background .3s var(--ease), box-shadow .3s;
}
.dot::after { content: ""; position: absolute; inset: -12px -6px; }   /* bigger tap area */
.dot.done { background: var(--rose); }
.dot.on { width: 30px; background: var(--rose); box-shadow: var(--glow-rose); }
.dot.soon { opacity: .55; cursor: default; }
.small-dots { justify-content: flex-start; margin: 14px 0 18px; }

/* ================= panes slide in from the side you're going ================= */
.pane, .ipane { animation: floatIn .7s var(--float) both; }
.pane.in-r, .ipane.in-r { animation-name: slideInR; }
.pane.in-l, .ipane.in-l { animation-name: slideInL; }
.pane .block, .pane .intro > * { animation: none; }
@keyframes slideInR { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes slideInL { from { opacity: 0; transform: translateX(-40px); } to { opacity: 1; transform: none; } }
.intro { padding: 18px 0 20px; }
.ipane .label { font-size: 16px; margin-bottom: 10px; }
.ipane .btn { margin-top: 12px; }

/* ================= round arrow buttons ================= */
.stepnav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 0; }
.stepnote { font-family: var(--serif); font-style: italic; font-size: 17px; color: var(--ink-soft); text-align: center; }
.round {
  flex: none; width: 52px; height: 52px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: #fff; color: var(--ink); box-shadow: var(--shadow-chip);
  transition: transform .5s var(--float), box-shadow .35s var(--ease), opacity .3s;
}
.round:hover { box-shadow: var(--shadow-chip-up); }
.round:active { transform: scale(.88); transition-duration: .08s; }
.round-next { background: var(--rose); color: var(--rose-ink); box-shadow: var(--glow-rose); }
.round-next:active svg { transform: translateX(3px); }
.round svg { transition: transform .4s var(--float); }
.round:disabled { opacity: .35; box-shadow: none; cursor: default; transform: none; }
.sheet-actions .round { width: 46px; height: 46px; }
#importSheet .sheet-actions { justify-content: space-between; }

/* ================= how it works ================= */
.script { font-family: "Pacifico", cursive; font-weight: 400; font-size: 30px; line-height: 1.3; color: var(--ink); margin-top: 4px; }
.how { list-style: none; counter-reset: how; margin-top: 14px; }
.how li { counter-increment: how; position: relative; padding: 0 0 16px 44px; font-size: 15px; line-height: 1.55; }
.how li b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 2px; }
.how li::before {
  content: counter(how); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; background: var(--rose); color: var(--rose-ink); font-weight: 600; font-size: 14px; box-shadow: var(--glow-rose);
}
.how-note { font-family: var(--serif); font-style: italic; font-size: 18px; color: var(--ink-soft); }

/* tagline centred under the letters of the wordmark (the lily sits to the left), like the logo file */
.brand { display: inline-flex; flex-direction: column; align-items: stretch; gap: 2px; width: max-content; }
.logo { height: 58px; }
.tagline {
  margin: 0 2.2% 0 7.7%; padding: 0; text-align: center; white-space: nowrap;
  font-size: 13.5px; letter-spacing: .16em; line-height: 1.2;
}
.tagline em { font-size: 20px; padding: 0 1px; }
.home-link { display: block; border-radius: 12px; } .home-link:focus-visible { outline: 2px solid var(--primary); outline-offset: 4px; }

/* ================= step 3 · the week ================= */
.btn.wide { width: 100%; margin-top: 16px; }
.fridge { margin-top: 16px; border-radius: 18px; background: #fff; box-shadow: var(--shadow-chip); }
.fridge summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 14px 16px; font-weight: 600; color: var(--ink); border-radius: 18px;
}
.fridge summary::-webkit-details-marker { display: none; }
.fridge summary::after { content: ""; width: 9px; height: 9px; border-right: 2px solid var(--ink-soft); border-bottom: 2px solid var(--ink-soft); transform: rotate(45deg); transition: transform .45s var(--float); margin-left: auto; }
.fridge[open] summary::after { transform: rotate(-135deg); }
.fridge summary b { font-weight: 500; font-size: 13px; color: var(--ink-soft); }
.fridge .small { padding: 0 16px; margin-top: -4px; }
.fchips { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 16px 16px; }
.fchip {
  position: relative; height: 34px; padding: 0 13px; border-radius: 999px; border: 1.5px dashed var(--line);
  background: transparent; color: var(--ink-soft); font-size: 14px;
  transition: transform .5s var(--float), background .25s, color .25s, border-color .25s, box-shadow .3s;
}
.fchip:active { transform: scale(.9); transition-duration: .08s; }
.fchip.have { border: 1.5px solid var(--have); color: var(--ink); background: #fff; }
.fchip.soon { border: 1.5px solid var(--urgency); color: var(--ink); background: #fff; padding-right: 26px; }
.fchip .soon-dot { position: absolute; right: 10px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: var(--urgency); animation: pulse 1.6s ease-in-out 2; }
.fchip.popped { animation: pop .5s var(--float); }
@keyframes pulse { 50% { transform: scale(.6); opacity: .5; } }

/* budget bar */
.budget { position: relative; margin-top: 18px; padding: 16px 18px; border-radius: 18px; background: #fff; box-shadow: var(--shadow-chip); }
.b-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 14px; color: var(--ink-soft); }
.b-row b { font-size: 22px; font-weight: 600; color: var(--ink); }
.b-row small { font-size: 13px; font-weight: 500; color: var(--ink-soft); }
.b-track { margin-top: 10px; height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.b-track i { display: block; height: 100%; border-radius: 999px; background: var(--good-fill); transform-origin: left; animation: grow .9s var(--float) both; }
.b-msg { margin-top: 10px; font-weight: 600; font-size: 15px; }
.budget.under .b-msg { color: var(--good); }
.budget.over { background: var(--alarm); box-shadow: none; }
.budget.over .b-row, .budget.over .b-row small, .budget.over .b-row b, .budget.over .b-msg { color: var(--on-alarm); }
.budget.over .b-track { background: rgba(237, 234, 230, .25); }
.budget.over .b-track i { background: var(--on-alarm); animation: none; }
@keyframes grow { from { transform: scaleX(0); } }
.burst { position: absolute; left: 50%; top: 50%; pointer-events: none; }
.burst i { position: absolute; width: 9px; height: 9px; border-radius: 50% 50% 50% 0; background: var(--rose); animation: petal 1.1s var(--ease) var(--d) both; }
.burst i.g { background: var(--good-fill); }
@keyframes petal { from { transform: translate(0, 0) scale(.3) rotate(0); opacity: 1; } to { transform: translate(var(--x), var(--y)) scale(1) rotate(160deg); opacity: 0; } }

/* day strip */
.daystrip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-top: 16px; }
.dtile {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0; border-radius: 14px; border: 0;
  background: #fff; box-shadow: var(--shadow-chip); color: var(--ink-soft); font-size: 12px; font-weight: 500;
  transition: transform .5s var(--float), box-shadow .3s;
}
.dtile b { font-size: 17px; font-weight: 600; color: var(--ink); }
.dtile:active { transform: scale(.9); transition-duration: .08s; }
.dtile.today { background: var(--rose); color: var(--rose-ink); box-shadow: var(--glow-rose); }
.dtile.today b { color: var(--rose-ink); }
.plan-notes { margin-top: 12px; }
.plan-notes:empty { display: none; }

/* dinner cards */
#dinners { display: grid; gap: 10px; margin-top: 14px; }
.dinner {
  display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 12px 12px 12px 10px; border-radius: 18px; background: #fff; border: 1px solid var(--lift-edge); box-shadow: var(--shadow-chip);
  scroll-margin: 90px;
}
.dinner.enter { animation: floatIn .7s var(--float) both; animation-delay: calc(var(--i) * 60ms); }
.dinner.swapped .d-main { animation: slideInR .5s var(--float); }
.dinner.pinpop .pin { animation: pop .5s var(--float); }
.dinner.flash { animation: flash 1s var(--ease); }
@keyframes flash { 30% { box-shadow: 0 0 0 4px rgba(211, 168, 162, .55), var(--shadow-chip); } }
.d-date { display: flex; flex-direction: column; align-items: center; gap: 0; padding: 6px 0; border-radius: 12px; background: var(--surface); color: var(--ink-soft); font-size: 12px; }
.d-date b { font-weight: 600; color: var(--ink); font-size: 13px; }
.d-date span { font-size: 17px; font-weight: 600; color: var(--ink); }
.d-date.today { background: var(--rose); }
.d-date.today, .d-date.today b, .d-date.today span { color: var(--rose-ink); }
.d-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.d-name { font-family: var(--serif); font-size: 21px; line-height: 1.12; color: var(--ink); }
.d-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--ink-soft); }
.d-lunch { font-size: 12px; color: var(--ink-soft); font-style: italic; font-family: var(--serif); font-size: 15px; }
.d-acts { display: flex; flex-direction: column; gap: 6px; }
.mini-round {
  width: 36px; height: 36px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: var(--surface); color: var(--ink-soft); transition: transform .5s var(--float), background .25s, color .25s, box-shadow .3s;
}
.mini-round:hover { color: var(--ink); }
.mini-round:active { transform: scale(.85) rotate(-30deg); transition-duration: .08s; }
.mini-round:disabled { opacity: .3; }
.mini-round.pin[aria-pressed="true"] { background: var(--rose); color: var(--rose-ink); box-shadow: var(--glow-rose); }
.dinner.pinned { border-color: var(--rose); }

/* ================= step 4 · the shopping list ================= */
.trip { margin-top: 18px; }
.trip h3 { font-family: var(--serif); font-weight: 400; font-size: 24px; color: var(--ink); }
.trip > .small { margin-top: 2px; }
.aisle { margin-top: 14px; font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.shop { list-style: none; margin-top: 6px; border-radius: 16px; background: #fff; box-shadow: var(--shadow-chip); overflow: hidden; }
.shop li { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 14px; border-bottom: 1px dashed var(--line); transition: opacity .35s var(--ease); }
.shop li:last-child { border-bottom: 0; }
.tick {
  width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--line); background: #fff; display: grid; place-items: center;
  transition: transform .5s var(--float), background .25s, border-color .25s;
}
.tick::after { content: ""; width: 7px; height: 12px; border-right: 2px solid var(--rose-ink); border-bottom: 2px solid var(--rose-ink); transform: translateY(-1px) rotate(45deg) scale(0); transition: transform .45s var(--float); }
.tick:active { transform: scale(.82); transition-duration: .08s; }
.shop li.done .tick { background: var(--rose); border-color: var(--rose); box-shadow: var(--glow-rose); }
.shop li.done .tick::after { transform: translateY(-1px) rotate(45deg) scale(1); }
.shop li.done .li-name, .shop li.done .li-qty { text-decoration: line-through; text-decoration-color: var(--ink-soft); }
.shop li.done { opacity: .5; }
.li-main { display: flex; flex-direction: column; min-width: 0; }
.li-name { color: var(--ink); font-size: 16px; }
.li-for { font-size: 12px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-qty { font-size: 14px; font-weight: 500; color: var(--ink-soft); white-space: nowrap; }
#settle .add-row { margin-top: 12px; }

/* ---------- protein grams + calories side by side ---------- */
.pair { display: flex; gap: 12px; flex-wrap: wrap; }
.pair .mini input { max-width: 130px; }
.tag-l.kcal { color: var(--ink-body); }
.kcal-line { margin: 10px 2px 0; font-size: 14px; color: var(--ink-body); }
.kcal-line:empty { display: none; }
.kcal-line b { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------- fridge: how much you have ---------- */
.fchip small { font-size: 12px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.famounts { padding: 0 16px 16px; }
.famounts .small { padding: 0; margin: 0 0 10px; }
.famounts ul { list-style: none; display: grid; gap: 8px; margin: 0; padding: 0; }
.famounts li { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.fa-name { font-size: 15px; color: var(--ink); }
.fa-name .soon-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--urgency); vertical-align: middle; margin-left: 4px; }
.famounts .stepper { width: 150px; flex: none; }
.famounts .stepper b { font-variant-numeric: tabular-nums; }
.stepper button:disabled { opacity: .3; }

/* ---------- taking the list along ---------- */
#listActions { margin-top: 22px; }
.label.take { margin-bottom: 10px; }
.export { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 8px; }
.export .btn { width: 100%; }
.export .btn-primary { grid-column: 1 / -1; }
.print-title { display: none; }

/* Print or PDF: only the list, on white, with empty boxes to tick by hand */
@media print {
  body.printing-list * { visibility: hidden; }
  body.printing-list #list, body.printing-list #list * { visibility: visible; }
  body.printing-list { background: #fff !important; }
  body.printing-list .blobs, body.printing-list header.top, body.printing-list #progress, body.printing-list #settle, body.printing-list .foot, body.printing-list #listEmpty, body.printing-list #listActions, body.printing-list #list .block-head, body.printing-list .stepnav, body.printing-list .toast { display: none !important; }
  body.printing-list #list { position: static; width: 100%; margin: 0; box-shadow: none !important; background: #fff !important; padding: 0 !important; }
  body.printing-list .print-title { display: block; font-family: var(--serif); font-size: 26px; color: #4d251f; margin: 0 0 12px; }
  body.printing-list .shop li { break-inside: avoid; box-shadow: none !important; background: none !important; }
  body.printing-list .tick { box-shadow: none !important; border: 1.5px solid #85564e !important; background: #fff !important; }
  body.printing-list .shop li.done .li-name { text-decoration: none !important; }
  body.printing-list .trip { break-inside: auto; }
}
.pair .mini { flex: 1 1 130px; }

/* help sheet: translating the page */
.how-h { font-family: var(--serif); font-weight: 400; font-size: 26px; color: var(--ink); margin: 26px 0 6px; }
.how-p { font-size: 15px; }
.how-tr { margin: 8px 0 0 18px; display: grid; gap: 6px; font-size: 15px; }
.how-tr b { color: var(--ink); font-weight: 600; }
.how-p.small { margin: 8px 0 14px; font-size: 13px; color: var(--ink-soft); }

/* ================= header: language · lily tour · help ================= */
.top-acts { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex: none; }
.lang-btn, .tour-btn {
  flex: none; height: 44px; min-width: 44px; border-radius: 999px; border: 0; padding: 0 12px;
  background: #fff; box-shadow: var(--shadow-chip); color: var(--rose-ink); display: grid; place-items: center;
  font: 600 13px/1 var(--sans); letter-spacing: .06em;
  transition: transform .5s var(--float), box-shadow .35s var(--ease);
}
.tour-btn { padding: 0; width: 44px; }
.lang-btn:hover, .tour-btn:hover { box-shadow: var(--shadow-chip-up); }
.lang-btn:active, .tour-btn:active { transform: scale(.88); transition-duration: .08s; }
.top-acts .help { margin-top: 0; }
.tour-wrap { position: relative; display: inline-flex; }
.tour-btn svg { overflow: visible; }

/* the little speech bubble that points at the lily button */
.tour-hint {
  position: absolute; top: calc(100% + 12px); right: -54px; z-index: 30; width: max-content; max-width: 220px;
  display: flex; align-items: flex-start; gap: 6px; padding: 10px 10px 10px 14px; border-radius: 16px;
  background: var(--rose-ink); color: #fff; font-size: 14px; line-height: 1.35; box-shadow: 0 10px 24px -8px rgba(74, 34, 28, .55);
}
.tour-hint::before { content: ""; position: absolute; top: -6px; right: 70px; width: 14px; height: 14px; background: var(--rose-ink); transform: rotate(45deg); border-radius: 3px; }
.tour-hint.in { animation: hintIn .7s var(--float) both, hintBob 2.4s ease-in-out .8s 2; }
.tour-hint-x { flex: none; border: 0; background: rgba(255, 255, 255, .16); color: #fff; width: 22px; height: 22px; border-radius: 50%; font-size: 15px; line-height: 1; }
@keyframes hintIn { from { opacity: 0; transform: translateY(-8px) scale(.85); } to { opacity: 1; transform: none; } }
@keyframes hintBob { 0%, 100% { transform: none; } 50% { transform: translateY(4px); } }

/* ================= language sheet ================= */
.lang-list { display: grid; gap: 10px; margin: 16px 0 6px; }
.lang-opt {
  min-height: 56px; border-radius: 18px; border: 0; background: #fff; box-shadow: var(--shadow-chip); color: var(--ink);
  font-size: 18px; font-weight: 500; transition: transform .5s var(--float), box-shadow .3s, background .2s;
}
.lang-opt[lang="ar"] { font-family: "IBM Plex Sans Arabic", "Amiri", "Geeza Pro", sans-serif; font-size: 20px; }
.lang-opt[aria-pressed="true"] { background: var(--rose); color: var(--rose-ink); box-shadow: var(--glow-rose); }
.lang-opt:active { transform: scale(.96); transition-duration: .08s; }
.tour-cta { display: inline-flex; gap: 10px; margin: 2px 0 6px; }

/* ================= the lily's tour ================= */
.tour { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
.tour .tour-dialog { pointer-events: auto; }
.tour-block { position: fixed; background: transparent; pointer-events: auto; }
.tour-spot {
  position: fixed; border-radius: 18px; pointer-events: none; opacity: 0;
  box-shadow: 0 0 0 9999px rgba(61, 30, 25, .5), 0 0 0 3px var(--rose), 0 0 24px 6px rgba(211, 168, 162, .7);
  transition: left .45s var(--float), top .45s var(--float), width .45s var(--float), height .45s var(--float), opacity .3s;
}
.tour.on .tour-spot { opacity: 1; animation: spotPulse 2.2s ease-in-out infinite; }
.tour.dim-all .tour-spot { box-shadow: 0 0 0 9999px rgba(61, 30, 25, .5); animation: none; }
@keyframes spotPulse { 0%, 100% { box-shadow: 0 0 0 9999px rgba(61, 30, 25, .5), 0 0 0 3px var(--rose), 0 0 18px 4px rgba(211, 168, 162, .6); }
  50% { box-shadow: 0 0 0 9999px rgba(61, 30, 25, .5), 0 0 0 4px var(--rose), 0 0 30px 10px rgba(211, 168, 162, .85); } }
.tour-arrow { display: none; }

.tour-dialog {
  position: fixed; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); width: min(560px, calc(100% - 24px)); transform: translate(-50%, 30px);
  display: flex; align-items: flex-end; gap: 6px; opacity: 0; transition: opacity .3s, transform .6s var(--float);
}
.tour.on .tour-dialog { opacity: 1; transform: translate(-50%, 0); }
.tour-guide { flex: none; width: 86px; height: 104px; margin-bottom: -6px; filter: drop-shadow(0 8px 10px rgba(61, 30, 25, .35)); }
.tour-guide svg { width: 100%; height: 100%; overflow: visible; transform-origin: 50% 95%; }
.tour-guide .pt { transform-box: view-box; transform-origin: 20px 23px; transition: transform .6s var(--float); }
.tour-guide.talking svg { animation: lilySway 1s ease-in-out 2; }
.tour-guide.talking .pl { animation: petalL .5s ease-in-out 4 alternate; }
.tour-guide.talking .pr { animation: petalR .5s ease-in-out 4 alternate; }
.tour-guide.talking .pc { animation: petalC .5s ease-in-out 4 alternate; }
.tour-guide.happy svg { animation: lilyHop .55s var(--float) 2; }
.tour-guide.bloom .pl { transform: rotate(-16deg); } .tour-guide.bloom .pr { transform: rotate(16deg); } .tour-guide.bloom .pc { transform: scale(1.08); }
@keyframes lilySway { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-6deg); } 70% { transform: rotate(5deg); } }
@keyframes lilyHop { 0%, 100% { transform: none; } 40% { transform: translateY(-14px) scale(1.04, .96); } 70% { transform: translateY(0) scale(.97, 1.04); } }
@keyframes petalL { to { transform: rotate(-9deg); } }
@keyframes petalR { to { transform: rotate(9deg); } }
@keyframes petalC { to { transform: scaleY(1.06); } }

.tour-bubble {
  position: relative; flex: 1; min-width: 0; padding: 16px 18px 12px; border-radius: 22px 22px 22px 6px;
  background: var(--lift); color: var(--ink-body); box-shadow: 0 18px 40px -12px rgba(61, 30, 25, .55); border: 1px solid var(--lift-edge);
}
.tour-bubble::before { content: ""; position: absolute; left: -7px; bottom: 18px; width: 16px; height: 16px; background: var(--lift); border-left: 1px solid var(--lift-edge); border-bottom: 1px solid var(--lift-edge); transform: rotate(45deg); }
.tour-bubble.pop { animation: bubblePop .5s var(--float); }
@keyframes bubblePop { from { transform: scale(.94); opacity: .4; } to { transform: none; opacity: 1; } }
.tour-text { font-size: 16px; line-height: 1.5; color: var(--ink); }
.tour-text span { display: inline-block; animation: wordIn .45s var(--float) both; animation-delay: calc(var(--k) * 28ms); }
@keyframes wordIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.tour-try { margin-top: 8px; font-weight: 600; color: var(--rose-ink); animation: hintBob 1.6s ease-in-out infinite; }
.tour-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.tour-actions .btn { min-height: 44px; }
.tour-back { width: 44px; height: 44px; margin-inline-end: auto; }
.tour-skip { margin-inline-end: auto; }
.tour-back + .tour-skip { margin-inline-end: 0; }
.tour-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); }
.tour-never { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-soft); }
.tour-never input { -webkit-appearance: auto; appearance: auto; width: 18px; height: 18px; min-height: 0; margin: 0; padding: 0; border: 0; background: none; box-shadow: none; accent-color: var(--primary); }
.tour-count { font-size: 12px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.tour.final .tour-actions { justify-content: stretch; }
.tour.final .tour-actions .btn { flex: 1 1 160px; }
body.touring .toast { z-index: 70; }
@media (prefers-reduced-motion: reduce) {
  .tour-guide.talking svg, .tour-guide.talking .pt, .tour-guide.happy svg, .tour-text span, .tour-bubble.pop, .tour.on .tour-spot, .tour-hint.in, .tour-try { animation: none !important; }
}

/* ================= Arabic: right to left, Arabic fonts, no letter-spacing (it breaks the joined letters) ================= */
html[lang="ar"] { --sans: "IBM Plex Sans Arabic", "Figtree", "Geeza Pro", system-ui, sans-serif; --mono: var(--sans); --serif: "Amiri", "Instrument Serif", "Geeza Pro", serif; }
html[lang="ar"] body * { letter-spacing: 0 !important; }
html[lang="ar"] .eyebrow, html[lang="ar"] .mini > span, html[lang="ar"] .ing .a, html[lang="ar"] .tagline { text-transform: none; }
html[lang="ar"] .script { font-family: var(--serif); font-weight: 700; }
html[lang="ar"] h1, html[lang="ar"] h2, html[lang="ar"] .meal-name, html[lang="ar"] .d-name { line-height: 1.35; }
html[lang="ar"] .tagline { font-size: 15px; }
html[lang="ar"] .tagline em { font-style: normal; font-weight: 700; }
html[dir="rtl"] .brand { align-items: flex-start; }
html[dir="rtl"] .tagline { padding-left: 0; padding-right: 18px; }
html[dir="rtl"] .round svg, html[dir="rtl"] .tour-back svg { transform: scaleX(-1); }
html[dir="rtl"] .round-next:active svg { transform: scaleX(-1) translateX(3px); }
html[dir="rtl"] .count { text-align: left; }
html[dir="rtl"] .meal-head { text-align: right; }
html[dir="rtl"] .field-err { border-left: 0; padding-left: 0; border-right: 3px solid var(--ink); padding-right: 10px; }
html[dir="rtl"] .notes li { padding-left: 0; padding-right: 16px; }
html[dir="rtl"] .notes li::before { left: auto; right: 0; }
html[dir="rtl"] .how li { padding: 0 44px 16px 0; }
html[dir="rtl"] .how li::before { left: auto; right: 0; }
html[dir="rtl"] .how-tr { margin: 8px 18px 0 0; }
html[dir="rtl"] .fridge summary::after { margin-left: 0; margin-right: auto; }
html[dir="rtl"] .fchip.soon { padding-right: 14px; padding-left: 26px; }
html[dir="rtl"] .fchip .soon-dot { right: auto; left: 10px; }
html[dir="rtl"] .fa-name .soon-dot { margin-left: 0; margin-right: 4px; }
html[dir="rtl"] .b-track i { transform-origin: right; }
html[dir="rtl"] .chips.scroll { -webkit-mask-image: linear-gradient(270deg, #000 calc(100% - 26px), transparent); mask-image: linear-gradient(270deg, #000 calc(100% - 26px), transparent); }
html[dir="rtl"] .tour-hint { right: auto; left: -54px; padding: 10px 14px 10px 10px; }
html[dir="rtl"] .tour-hint::before { right: auto; left: 70px; }
html[dir="rtl"] .tour-bubble { border-radius: 22px 22px 6px 22px; }
html[dir="rtl"] .tour-bubble::before { left: auto; right: -7px; border-left: 0; border-right: 1px solid var(--lift-edge); }
html[dir="rtl"] .prompt { direction: rtl; text-align: right; }
html[dir="rtl"] .b1 { right: auto; left: -28vmax; } html[dir="rtl"] .b2 { left: auto; right: -24vmax; }

/* room to scroll the lit part up during the tour, and the dialog at the top when the lit part is low */
body.touring main { padding-bottom: 46vh; }
.tour.dlg-top .tour-dialog { bottom: auto; top: calc(12px + env(safe-area-inset-top)); align-items: flex-start; transform: translate(-50%, -30px); }
.tour.dlg-top.on .tour-dialog { transform: translate(-50%, 0); }
.tour.dlg-top .tour-guide { margin: 0; height: 90px; width: 74px; }
.tour.dlg-top .tour-bubble { border-radius: 6px 22px 22px 22px; }
.tour.dlg-top .tour-bubble::before { bottom: auto; top: 18px; }
html[dir="rtl"] .tour.dlg-top .tour-bubble { border-radius: 22px 6px 22px 22px; }
