/* Easy Eats: calm food cards in the Favabeans look (see ../APP_DESIGN.md). Accent: fresh cyan-aqua
   (#9FE3F2 → #1E9CC8, deepened to #1479A0 for text and buttons). Light by default, dark when the
   system asks. No dark green or teal, no red alarms, no calories or "healthy" labels anywhere. */
:root {
  /* Favabeans base */
  --canvas: #F7F7F5;
  --surface: #FFFFFF;
  --surface-2: #F1F1EE;
  --surface-3: #E7E7E3;
  --ink: #1D1D1F;
  --ink-2: #57575F;
  --line: rgb(29 29 31 / .09);
  --line-2: rgb(29 29 31 / .17);
  --danger: #b3261e;
  --shadow-1: 0 1px 2px rgb(0 0 0 / .04), 0 8px 24px -14px rgb(0 0 0 / .12);
  --shadow-2: 0 2px 4px rgb(0 0 0 / .04), 0 24px 48px -22px rgb(0 0 0 / .22);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --r-card: 26px;
  --r-md: 18px;
  --r-sm: 12px;
  --gutter: clamp(16px, 4vw, 40px);
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  /* This app's accent: fresh cyan-aqua */
  --accent: #1479A0;
  --accent-ink: #FFFFFF;
  --accent-soft: #E3F6FB;
  --accent-text: #126E92;
  --focus: #1479A0;
  --aqua-1: #9FE3F2;
  --aqua-2: #1E9CC8;

  --badge-mix: 36%;
  --tint-mix: 16%;
  --scrim: rgb(14 30 38 / .32);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    --canvas: #0C0C0E;
    --surface: #161619;
    --surface-2: #202024;
    --surface-3: #2A2A2F;
    --ink: #F2F2F4;
    --ink-2: #ABABB5;
    --line: rgb(255 255 255 / .09);
    --line-2: rgb(255 255 255 / .17);
    --danger: #ffb4ab;
    --shadow-1: 0 1px 0 rgb(255 255 255 / .04) inset, 0 8px 24px -12px rgb(0 0 0 / .6);
    --shadow-2: 0 1px 0 rgb(255 255 255 / .05) inset, 0 28px 56px -22px rgb(0 0 0 / .8);

    --accent: #7FD6EE;
    --accent-ink: #062330;
    --accent-soft: #15252B;
    --accent-text: #9FE3F2;
    --focus: #9FE3F2;

    --badge-mix: 22%;
    --tint-mix: 7%;
    --scrim: rgb(0 0 0 / .55);
    color-scheme: dark;
  }
}
:root:where([data-theme="dark"]) {
  --canvas: #0C0C0E;
  --surface: #161619;
  --surface-2: #202024;
  --surface-3: #2A2A2F;
  --ink: #F2F2F4;
  --ink-2: #ABABB5;
  --line: rgb(255 255 255 / .09);
  --line-2: rgb(255 255 255 / .17);
  --danger: #ffb4ab;
  --shadow-1: 0 1px 0 rgb(255 255 255 / .04) inset, 0 8px 24px -12px rgb(0 0 0 / .6);
  --shadow-2: 0 1px 0 rgb(255 255 255 / .05) inset, 0 28px 56px -22px rgb(0 0 0 / .8);

  --accent: #7FD6EE;
  --accent-ink: #062330;
  --accent-soft: #15252B;
  --accent-text: #9FE3F2;
  --focus: #9FE3F2;

  --badge-mix: 22%;
  --tint-mix: 7%;
  --scrim: rgb(0 0 0 / .55);
  color-scheme: dark;
}

/* Food colours: two-tone pairs, light → deep. Each drawn picture has its own (js/icons.js). */
[data-color="honey"]      { --c1: #FFE68A; --c2: #E3B21C; }
[data-color="coral"]      { --c1: #FFC2B0; --c2: #EC6A4E; }
[data-color="sky"]        { --c1: #9CD8FF; --c2: #3398E6; }
[data-color="peach"]      { --c1: #FFCB8F; --c2: #F28A2E; }
[data-color="periwinkle"] { --c1: #B9C4FF; --c2: #5B6EF0; }
[data-color="rose"]       { --c1: #FFB3CF; --c2: #E5508C; }
[data-color="violet"]     { --c1: #C3AEFF; --c2: #8467F2; }
[data-color] {
  --c-text: color-mix(in srgb, var(--c2) 52%, var(--ink));
  --c-icon: color-mix(in srgb, var(--c2) 40%, var(--ink));
}
@media (prefers-color-scheme: dark) {
  :where(:root:not([data-theme="light"])) [data-color] { --c-text: color-mix(in srgb, var(--c1) 82%, var(--ink)); --c-icon: color-mix(in srgb, var(--c1) 72%, var(--ink)); }
}
:where(:root[data-theme="dark"]) [data-color] { --c-text: color-mix(in srgb, var(--c1) 82%, var(--ink)); --c-icon: color-mix(in srgb, var(--c1) 72%, var(--ink)); }
.grads { position: absolute; width: 0; height: 0; overflow: hidden; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; }
body {
  margin: 0; background: var(--canvas); color: var(--ink);
  font: 400 1.0625rem/1.5 var(--font);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: clip;
}
a { color: inherit; text-underline-offset: 3px; }
h1, h2, h3 { font-weight: 600; letter-spacing: -0.02em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Header: a thin frosted bar ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--canvas) 78%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(18px); backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--line);
}
.top-in { max-width: 1180px; margin: 0 auto; padding-inline: var(--gutter); min-height: 60px; display: flex; flex-wrap: wrap; align-items: center; gap: 0 14px; }
.brand { display: flex; align-items: center; gap: 10px; margin-inline-end: auto; min-width: 0; }
.brand img { width: 28px; height: 28px; border-radius: 7px; box-shadow: 0 1px 2px rgb(0 0 0 / .1); flex: none; }
.brand h1 { margin: 0; display: flex; align-items: center; font: 600 1.0625rem/1.2 var(--font); letter-spacing: -0.015em; white-space: nowrap; }
body .top .fbk-beta {
  margin-inline-start: 8px; padding: .32em .62em; border: 0; border-radius: 999px; box-shadow: none;
  font: 600 max(.66rem, 11px)/1.1 var(--font); letter-spacing: .05em;
  color: var(--accent-text); background: var(--accent-soft);
}
.fb-lang { display: flex; align-items: center; gap: 0; font-size: .875rem; color: var(--line-2); }
.fb-lang button { min-height: 44px; padding: 0 8px; border: 0; border-radius: 10px; background: none; box-shadow: none; color: var(--ink-2); font: 500 .875rem/1 var(--font); cursor: pointer; }
.fb-lang button:hover { color: var(--ink); }
.fb-lang button[lang="ar"] { font-family: 'IBM Plex Sans Arabic', system-ui, sans-serif; font-size: .95rem; }
.fb-lang button[aria-pressed="true"] { color: var(--ink); font-weight: 600; }
.fb-lang button:focus-visible { outline: 3px solid var(--focus); outline-offset: -2px; }
.home-link {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px;
  color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
  font: 500 .875rem/1 var(--font); text-decoration: none; white-space: nowrap;
  transition: box-shadow .2s;
}
.home-link:hover { box-shadow: inset 0 0 0 1px var(--line-2); }

main { max-width: 1180px; margin: 0 auto; padding: 26px var(--gutter) 40px; display: grid; gap: 20px; }

/* ---------- Buttons and fields ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border: 0; border-radius: 999px;
  background: var(--btn, var(--surface-2)); color: var(--ink);
  font: 500 .9375rem/1.2 var(--font); letter-spacing: -0.005em; cursor: pointer; text-align: center;
  transition: background-color .2s, box-shadow .2s, transform .2s var(--ease);
}
.btn:hover:not(:disabled) { background: color-mix(in srgb, var(--ink) 6%, var(--btn, var(--surface-2))); }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 18px -12px color-mix(in srgb, var(--accent) 90%, transparent); }
.btn.primary:hover:not(:disabled) { background: color-mix(in srgb, var(--ink) 12%, var(--accent)); }
.btn.danger { color: var(--danger); background: color-mix(in srgb, var(--danger) 9%, var(--surface)); }
.btn.danger:hover:not(:disabled) { background: color-mix(in srgb, var(--danger) 15%, var(--surface)); }
.btn.quiet { background: transparent; color: var(--ink-2); }
.btn.quiet:hover:not(:disabled) { background: var(--surface-2); color: var(--ink); }
.btn.add { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.btn.add:hover:not(:disabled) { background: color-mix(in srgb, var(--aqua-2) 18%, var(--surface)); }
.btn.add::before, .another::before, .pick::before, .share-btn::before, .copy-btn::before {
  content: ''; width: 17px; height: 17px; flex: none; background: currentColor;
  -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat;
}
.btn.add { --m: var(--i-plus); }
.another { --m: var(--i-next); }
:root[dir="rtl"] .another::before { transform: scaleX(-1); }
.pick { --m: var(--i-pick); }
.share-btn { --m: var(--i-share); }
.copy-btn { --m: var(--i-copy); }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.row.center { justify-content: center; }
.file-btn { position: relative; }
.file-btn:focus-within { outline: 3px solid var(--focus); outline-offset: 3px; }

input[type=text] {
  width: 100%; min-height: 48px; padding: 0 14px; border: 0; border-radius: var(--r-sm);
  background: var(--field, var(--surface)); color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-2);
  font: 400 1rem/1.2 var(--font); transition: box-shadow .2s;
}
input[type=text]::placeholder { color: color-mix(in srgb, var(--ink-2) 80%, transparent); }
input[type=text]:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--focus), 0 0 0 4px color-mix(in srgb, var(--focus) 18%, transparent); }
label > span, legend { display: block; margin-bottom: 6px; padding: 0; font-weight: 500; font-size: .8125rem; color: var(--ink-2); }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }

/* Switches: real checkboxes, drawn as iOS-style toggles */
label.check { display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; }
label.check > span { display: inline; margin: 0; font-weight: 400; font-size: .9375rem; color: var(--ink); }
label.check input, body .fava-prefs input[type=checkbox] {
  appearance: none; -webkit-appearance: none; flex: none; position: relative;
  width: 44px; height: 26px; margin: 0; border-radius: 999px; cursor: pointer;
  background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--line);
  transition: background-color .25s var(--ease);
}
label.check input::after, body .fava-prefs input[type=checkbox]::after {
  content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .18), 0 2px 6px -1px rgb(0 0 0 / .14);
  transition: transform .25s var(--ease);
}
label.check input:checked, body .fava-prefs input[type=checkbox]:checked { background: var(--accent); box-shadow: none; }
label.check input:checked::after, body .fava-prefs input[type=checkbox]:checked::after { transform: translateX(18px); }
:root[dir="rtl"] label.check input:checked::after, :root[dir="rtl"] body .fava-prefs input[type=checkbox]:checked::after { transform: translateX(-18px); }
@media (prefers-color-scheme: dark) {
  :where(:root:not([data-theme="light"])) label.check input::after, :where(:root:not([data-theme="light"])) body .fava-prefs input[type=checkbox]::after { background: #F2F2F4; }
  :where(:root:not([data-theme="light"])) label.check input:checked::after, :where(:root:not([data-theme="light"])) body .fava-prefs input[type=checkbox]:checked::after { background: #fff; }
}
:where(:root[data-theme="dark"]) label.check input::after, :where(:root[data-theme="dark"]) body .fava-prefs input[type=checkbox]::after { background: #F2F2F4; }
:where(:root[data-theme="dark"]) label.check input:checked::after, :where(:root[data-theme="dark"]) body .fava-prefs input[type=checkbox]:checked::after { background: #fff; }

/* ---------- Drawn icons (js/icons.js) ---------- */
svg.di { flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
svg.di .f { fill: color-mix(in srgb, var(--c2, var(--aqua-2)) 50%, transparent); }
svg.di .k { fill: currentColor; stroke: none; }
svg.di .w { fill: var(--surface); }
.badge {
  display: grid; place-items: center; flex: none; border-radius: 50%;
  color: var(--c-icon);
  background:
    radial-gradient(120% 120% at 30% 18%, rgb(255 255 255 / .55), transparent 55%),
    linear-gradient(150deg, color-mix(in srgb, var(--c1) var(--badge-mix), var(--surface)), color-mix(in srgb, var(--c2) calc(var(--badge-mix) * .9), var(--surface)));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c2) 18%, transparent), inset 0 -2px 4px color-mix(in srgb, var(--c2) 10%, transparent);
}
/* Dark: keep the pastel itself (mixing yellows into dark greys turns them olive) with a deep icon. */
@media (prefers-color-scheme: dark) {
  :where(:root:not([data-theme="light"])) .badge {
    color: color-mix(in srgb, var(--c2) 42%, #101012);
    background: radial-gradient(120% 120% at 30% 18%, rgb(255 255 255 / .3), transparent 55%), linear-gradient(150deg, color-mix(in srgb, var(--c1) 90%, var(--surface)), color-mix(in srgb, var(--c1) 62%, var(--c2)));
    box-shadow: inset 0 0 0 1px rgb(255 255 255 / .12);
  }
  :where(:root:not([data-theme="light"])) .badge svg.di .f { fill: color-mix(in srgb, var(--c2) 55%, transparent); }
  :where(:root:not([data-theme="light"])) .badge svg.di .w { fill: color-mix(in srgb, var(--c1) 40%, #fff); }
}
:where(:root[data-theme="dark"]) .badge {
  color: color-mix(in srgb, var(--c2) 42%, #101012);
  background: radial-gradient(120% 120% at 30% 18%, rgb(255 255 255 / .3), transparent 55%), linear-gradient(150deg, color-mix(in srgb, var(--c1) 90%, var(--surface)), color-mix(in srgb, var(--c1) 62%, var(--c2)));
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .12);
}
:where(:root[data-theme="dark"]) .badge svg.di .f { fill: color-mix(in srgb, var(--c2) 55%, transparent); }
:where(:root[data-theme="dark"]) .badge svg.di .w { fill: color-mix(in srgb, var(--c1) 40%, #fff); }

/* ---------- The core screen: "How much energy do you have?" ---------- */
.ask {
  position: relative; overflow: hidden;
  padding: clamp(22px, 3.4vw, 36px); border-radius: var(--r-card);
  background:
    radial-gradient(70% 120% at 0% 0%, color-mix(in srgb, var(--aqua-1) 34%, transparent), transparent 62%),
    radial-gradient(50% 90% at 100% 0%, color-mix(in srgb, var(--aqua-1) 16%, transparent), transparent 70%),
    var(--surface);
  box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line);
}
:root[dir="rtl"] .ask { background:
    radial-gradient(70% 120% at 100% 0%, color-mix(in srgb, var(--aqua-1) 34%, transparent), transparent 62%),
    radial-gradient(50% 90% at 0% 0%, color-mix(in srgb, var(--aqua-1) 16%, transparent), transparent 70%),
    var(--surface); }
@media (prefers-color-scheme: dark) {
  :where(:root:not([data-theme="light"])) .ask { background: radial-gradient(70% 120% at 0% 0%, color-mix(in srgb, var(--aqua-2) 16%, transparent), transparent 62%), var(--surface); }
  :root[dir="rtl"]:where(:not([data-theme="light"])) .ask { background: radial-gradient(70% 120% at 100% 0%, color-mix(in srgb, var(--aqua-2) 16%, transparent), transparent 62%), var(--surface); }
}
:where(:root[data-theme="dark"]) .ask { background: radial-gradient(70% 120% at 0% 0%, color-mix(in srgb, var(--aqua-2) 16%, transparent), transparent 62%), var(--surface); }
:root[dir="rtl"]:where([data-theme="dark"]) .ask { background: radial-gradient(70% 120% at 100% 0%, color-mix(in srgb, var(--aqua-2) 16%, transparent), transparent 62%), var(--surface); }
.ask-head { margin-bottom: clamp(18px, 2.6vw, 28px); }
.ask h2 { margin: 0; font-size: clamp(1.625rem, 3.4vw, 2.375rem); line-height: 1.12; letter-spacing: -0.03em; text-wrap: balance; }
.ask-sub { margin: 8px 0 0; color: var(--ink-2); font-size: clamp(1rem, 1.6vw, 1.125rem); }
.levels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.level {
  --btn: var(--surface);
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 2px; justify-items: start;
  min-height: 148px; padding: 20px 20px 18px; border: 0; border-radius: 22px;
  background: color-mix(in srgb, var(--surface) 72%, var(--surface-2)); color: inherit; text-align: start; font: inherit; cursor: pointer;
  box-shadow: 0 1px 2px rgb(0 0 0 / .04), 0 10px 22px -18px rgb(0 0 0 / .3), inset 0 0 0 1px var(--line);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), background-color .3s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
@media (prefers-color-scheme: dark) { :where(:root:not([data-theme="light"])) .level { background: var(--surface-2); } }
:where(:root[data-theme="dark"]) .level { background: var(--surface-2); }
@media (hover: hover) { .level:hover { box-shadow: 0 2px 4px rgb(0 0 0 / .05), 0 16px 30px -18px rgb(0 0 0 / .35), inset 0 0 0 1px var(--line-2); } }
.level:active { transform: scale(.98); transition-duration: .12s; }
.level[aria-pressed="true"] {
  background: var(--accent-soft);
  box-shadow: 0 10px 24px -16px color-mix(in srgb, var(--aqua-2) 70%, transparent), inset 0 0 0 2px var(--accent);
}
.level[aria-pressed="true"]::after {
  content: ''; position: absolute; top: 16px; inset-inline-end: 16px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent) var(--i-tick) center / 14px no-repeat;
}
@media (prefers-color-scheme: dark) { :where(:root:not([data-theme="light"])) .level[aria-pressed="true"]::after { background-image: var(--i-tick-dark); } }
:where(:root[data-theme="dark"]) .level[aria-pressed="true"]::after { background-image: var(--i-tick-dark); }
.batt { width: 52px; height: 32px; margin-bottom: 14px; overflow: visible; }
.batt .shell { fill: var(--surface); stroke: var(--ink-2); stroke-width: 1.6; }
.batt .nub { stroke: var(--ink-2); stroke-width: 2.6; stroke-linecap: round; }
.batt .cell { fill: url(#g-eats); }
.level[aria-pressed="true"] .batt .shell { stroke: var(--accent-text); }
.level[aria-pressed="true"] .batt .nub { stroke: var(--accent-text); }
.lv-name { font-weight: 600; font-size: 1.3125rem; line-height: 1.2; letter-spacing: -0.02em; }
.lv-hint { color: var(--ink-2); font-size: .9375rem; }
.level[aria-pressed="true"] .lv-hint { color: var(--accent-text); }

/* ---------- Results: up to three calm food cards ---------- */
.results { display: grid; gap: 16px; min-height: 120px; }
.results-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-inline: 4px; }
.results-head h2 { margin: 0; font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
:root[lang="ar"] .results-head h2 { text-transform: none; font-size: .9375rem; }
.range { color: var(--ink-2); font-size: .875rem; font-variant-numeric: tabular-nums; }
.start-hint {
  display: flex; align-items: center; gap: 12px; width: fit-content; max-width: 100%;
  margin: 0; padding: 10px 18px 10px 10px; border-radius: 22px;
  background: var(--accent-soft); color: var(--ink); font-size: .9375rem;
}
:root[dir="rtl"] .start-hint { padding: 10px 10px 10px 18px; }
.start-hint::before {
  content: ''; flex: none; width: 34px; height: 34px; border-radius: 50%;
  background: var(--surface) var(--i-up) center / 18px no-repeat; box-shadow: 0 1px 2px rgb(0 0 0 / .06);
}
@media (prefers-color-scheme: dark) { :where(:root:not([data-theme="light"])) .start-hint::before { background-image: var(--i-up-dark); } }
:where(:root[data-theme="dark"]) .start-hint::before { background-image: var(--i-up-dark); }

.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.cards.n1, .cards.n2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.food-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0;
  min-width: 0; padding: 22px 22px 14px; border-radius: var(--r-card);
  background: linear-gradient(180deg, color-mix(in srgb, var(--c1) var(--tint-mix), var(--surface)), var(--surface) 64%);
  box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line);
}
.fc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; width: 100%; margin-bottom: 16px; }
.fc-badge { width: 72px; height: 72px; }
.fc-badge svg { width: 36px; height: 36px; stroke-width: 1.75; }
.fc-name { margin: 0 0 10px; font-size: 1.375rem; line-height: 1.22; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 11px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-2); font-size: .8125rem; font-weight: 500;
}
.chip.eff { background: color-mix(in srgb, var(--c1) 26%, var(--surface)); color: var(--c-text); font-weight: 600; }
.chip.safe { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
@media (prefers-color-scheme: dark) { :where(:root:not([data-theme="light"])) .chip.eff { background: var(--surface-2); } }
:where(:root[data-theme="dark"]) .chip.eff { background: var(--surface-2); }
.chip svg:not(.bars) { width: 14px; height: 14px; fill: currentColor; }
.bars { width: 14px; height: 12px; flex: none; }
.bars rect { fill: color-mix(in srgb, currentColor 25%, transparent); }
.bars rect.on { fill: currentColor; }
.fc-note { margin: 12px 0 0; color: var(--ink-2); font-size: .9375rem; line-height: 1.4; overflow-wrap: anywhere; }
.fc-out { margin-top: auto; margin-inline-start: -12px; padding: 0 12px; font-size: .875rem; }
.food-card > .chips, .food-card > .fc-note { margin-bottom: 14px; }
.ex-tag {
  display: inline-flex; align-items: center; min-height: 22px; padding: 0 9px; border-radius: 999px;
  background: var(--surface-2); color: var(--ink-2); font-size: .75rem; font-weight: 600; letter-spacing: .02em;
  box-shadow: inset 0 0 0 1px var(--line);
}

/* "Just pick one for me": one card, a gentle reveal (no wheel, no sound) */
.picked-wrap { display: grid; justify-items: center; gap: 12px; }
.eyebrow { margin: 0; color: var(--accent-text); font-weight: 600; font-size: 1rem; letter-spacing: -0.01em; }
.cards.one { grid-template-columns: minmax(0, 1fr); width: min(100%, 460px); }
.food-card.is-picked { align-items: center; text-align: center; padding: 30px 26px 16px; box-shadow: var(--shadow-2), inset 0 0 0 1px var(--line); }
.is-picked .fc-top { justify-content: center; position: relative; margin-bottom: 18px; }
.is-picked .fc-top .ex-tag { position: absolute; top: 0; inset-inline-end: 0; }
.is-picked .fc-badge { position: relative; width: 104px; height: 104px; }
.is-picked .fc-badge svg { width: 52px; height: 52px; }
.is-picked .fc-badge::after { content: ''; position: absolute; inset: -9px; border-radius: 50%; box-shadow: 0 0 0 2px color-mix(in srgb, var(--c2) 30%, transparent); opacity: .7; }
.is-picked .fc-name { font-size: clamp(1.5rem, 2.6vw, 1.875rem); }
.is-picked .chips { justify-content: center; }
.is-picked .fc-out { margin-inline-start: 0; }

@keyframes ee-rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes ee-reveal { 0% { opacity: 0; transform: scale(.965); } 100% { opacity: 1; transform: none; } }
@keyframes ee-ring { 0% { opacity: 0; transform: scale(.8); } 60% { opacity: .9; } 100% { opacity: .7; transform: none; } }
@keyframes ee-fade { from { opacity: 0; } }
.enter .food-card { animation: ee-rise .5s var(--ease) both; animation-delay: calc(var(--i) * 70ms); }
.reveal .eyebrow { animation: ee-fade .5s var(--ease) both; }
.reveal .food-card { animation: ee-reveal .7s .12s var(--ease) both; }
.reveal .fc-badge::after { animation: ee-ring 1.1s .35s var(--ease) both; }

.results-acts { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.results-acts .btn { min-height: 52px; padding: 0 24px; font-size: 1rem; }
.results-acts .another { --btn: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2); }
.all-shown { margin: -4px 0 0; text-align: center; color: var(--ink-2); font-size: .875rem; }

/* Empty states teach, never scold */
.empty { padding: 22px 18px; border-radius: var(--r-md); background: var(--surface-2); color: var(--ink-2); text-align: center; font-size: .9375rem; }
.empty p { margin: 0 auto; max-width: 44ch; }
.empty.big { padding: 30px 22px; border-radius: var(--r-card); }
.empty h3 { margin: 10px 0 4px; color: var(--ink); font-size: 1.125rem; }
.empty .row { margin-top: 16px; }
.empty-ico {
  --c1: var(--aqua-1); --c2: var(--aqua-2);
  display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto; border-radius: 50%;
  background: var(--surface); color: var(--accent-text); box-shadow: 0 1px 2px rgb(0 0 0 / .06);
}
.empty-ico svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.empty-ico svg .f { fill: color-mix(in srgb, var(--aqua-2) 40%, transparent); }
.empty-ico svg .w { fill: var(--surface); }
#shopEmpty .empty-ico { margin-bottom: 10px; }

/* ---------- My foods + shopping list ---------- */
.lower { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.card { background: var(--surface); border-radius: var(--r-card); box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line); }
.foods, .shop { padding: clamp(18px, 2.6vw, 26px); }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.sec-head h2 { margin: 0; font-size: 1.375rem; line-height: 1.2; }
.sec-count { margin: 2px 0 0; color: var(--ink-2); font-size: .875rem; }
.sec-count:empty { display: none; }
.sec-foot { display: flex; justify-content: flex-start; margin-top: 10px; margin-inline-start: -8px; }

.note {
  display: flex; align-items: center; gap: 12px; margin: 0 0 12px; padding: 10px 10px 10px 10px; border-radius: 22px;
  background: var(--accent-soft); --btn: var(--surface);
}
.note p { flex: 1; margin: 0; font-size: .9375rem; line-height: 1.4; }
.note-ico { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--surface); color: var(--accent-text); }
.note-ico svg { width: 18px; height: 18px; fill: color-mix(in srgb, var(--aqua-2) 30%, transparent); stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.note .btn { flex: none; }

.food-list, .shop-list { list-style: none; margin: 0; padding: 0; }
.food-row, .shop-row { display: flex; align-items: center; gap: 8px; min-height: 64px; border-bottom: 1px solid var(--line); }
.food-row:last-child, .shop-row:last-child { border-bottom: 0; }
.fr-main {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 8px 8px; margin-inline-start: -8px;
  border: 0; border-radius: 16px; background: none; color: inherit; font: inherit; text-align: start; cursor: pointer;
  transition: background-color .2s;
}
.fr-main:hover { background: var(--surface-2); }
.fr-main:focus-visible { outline-offset: -2px; }
.fr-badge, .sr-badge { width: 44px; height: 44px; }
.fr-badge svg, .sr-badge svg { width: 23px; height: 23px; }
.fr-txt, .sr-txt { flex: 1; min-width: 0; display: grid; gap: 1px; }
.fr-name, .sr-name { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 1rem; line-height: 1.3; overflow-wrap: anywhere; }
.fr-heart { display: inline-grid; color: var(--accent); flex: none; }
.fr-heart svg { width: 15px; height: 15px; fill: currentColor; }
.fr-meta, .sr-where { color: var(--ink-2); font-size: .8125rem; line-height: 1.35; }
.fr-meta .ex-tag { min-height: 20px; margin-inline-start: 4px; font-size: .6875rem; }
.fr-pen { flex: none; width: 18px; height: 18px; background: var(--ink-2); opacity: .7; -webkit-mask: var(--i-pen) center / contain no-repeat; mask: var(--i-pen) center / contain no-repeat; }
.fr-out {
  flex: none; min-height: 44px; min-width: 56px; padding: 0 14px; border: 0; border-radius: 999px;
  background: transparent; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-2);
  font: 500 .8125rem/1 var(--font); cursor: pointer; transition: background-color .2s, color .2s, box-shadow .2s;
}
.fr-out:hover { color: var(--ink); background: var(--surface-2); }
.fr-out[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; box-shadow: inset 0 0 0 1.5px var(--accent); }
.food-row.is-out .fr-badge { opacity: .55; }
.food-row.is-out .fr-name { color: var(--ink-2); }

.shop-row { gap: 14px; padding: 6px 0; }
.btn.got { flex: none; --btn: var(--accent-soft); color: var(--accent-text); font-weight: 600; padding: 0 16px; }
.btn.got:hover { background: color-mix(in srgb, var(--aqua-2) 18%, var(--surface)) !important; }
.shop-acts { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }

/* ---------- Panels: settings, backup ---------- */
.panel { padding: 4px 22px; }
.panel summary { position: relative; display: flex; align-items: center; gap: 12px; min-height: 60px; font-weight: 600; font-size: 1.0625rem; letter-spacing: -0.01em; cursor: pointer; list-style: none; }
.panel summary::-webkit-details-marker { display: none; }
.panel summary::before { content: ''; flex: none; width: 32px; height: 32px; border-radius: 10px; background: var(--accent-soft); }
.panel summary > span:not(.pi) { flex: 1; }
.panel summary::after { content: ''; flex: none; width: 9px; height: 9px; margin-inline-end: 6px; border-right: 1.8px solid var(--ink-2); border-bottom: 1.8px solid var(--ink-2); transform: rotate(45deg) translate(-2px, -2px); transition: transform .25s var(--ease); }
.panel[open] summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.panel[open] { padding-bottom: 22px; }
.panel summary .pi {
  position: absolute; inset-inline-start: 7px; top: 50%; width: 18px; height: 18px; margin-top: -9px;
  background: var(--accent-text); -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat;
}
#settingsPanel { --m: var(--i-gear); }
#backupPanel { --m: var(--i-save); }
.help { margin: 0 0 16px; max-width: 64ch; color: var(--ink-2); font-size: .9375rem; }
.msg { min-height: 1.4em; margin: 6px 0 0; font-weight: 500; font-size: .9375rem; color: var(--accent-text); }
.msg:empty { min-height: 0; margin: 0; }
.panel .fava-prefs { margin-top: 4px; }
.fava-prefs legend { font-weight: 600 !important; font-size: 1rem; color: var(--ink); }
.fava-prefs label { gap: 12px !important; }
.fava-prefs label > span { display: inline; margin: 0; font-weight: 400; font-size: .9375rem; color: var(--ink); }
.panel [data-fava-install] { margin-top: 10px; }

/* ---------- Editor sheet ---------- */
.sheet {
  --btn: var(--surface-2); --field: var(--surface);
  border: 0; border-radius: var(--r-card); padding: 0; width: min(580px, calc(100vw - 32px)); max-height: calc(100dvh - 48px);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-2), 0 40px 90px -30px rgb(0 0 0 / .35);
  overscroll-behavior: contain;
}
.sheet-in { display: grid; gap: 18px; padding: 22px clamp(18px, 4vw, 28px) 24px; }
.sheet::backdrop { background: var(--scrim); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
@media (prefers-reduced-motion: no-preference) {
  :root:not([data-motion="reduce"]) .sheet[open] { animation: ee-in .28s var(--ease); }
}
@keyframes ee-in { from { opacity: 0; transform: translateY(8px) scale(.985); } }
@keyframes ee-up { from { transform: translateY(32px); opacity: .5; } }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.sheet h2 { margin: 0; font-size: 1.375rem; line-height: 1.2; overflow-wrap: anywhere; min-width: 0; }
.ed-top { display: flex; align-items: flex-end; gap: 14px; }
.ed-preview .badge { width: 56px; height: 56px; }
.ed-preview .badge svg { width: 29px; height: 29px; }
.ed-name { flex: 1; min-width: 0; }
.sheet-in > .msg { margin-top: -12px; }
.seg { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 2px; padding: 3px; border-radius: 14px; background: var(--surface-2); }
.seg-opt { position: relative; display: flex; min-width: 0; }
.seg-opt input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.seg-opt > span {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; margin: 0; padding: 0 12px; border-radius: 11px;
  color: var(--ink-2); font-size: .9375rem; font-weight: 500; line-height: 1.2; text-align: center; pointer-events: none;
  transition: background-color .2s, color .2s, box-shadow .2s;
}
.seg-opt input:checked + span { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgb(0 0 0 / .08), 0 3px 10px -3px rgb(0 0 0 / .1); }
@media (prefers-color-scheme: dark) { :where(:root:not([data-theme="light"])) .seg-opt input:checked + span { background: var(--surface-3); } }
:where(:root[data-theme="dark"]) .seg-opt input:checked + span { background: var(--surface-3); }
.seg-opt input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 1px; }
.seg-opt .bars { color: var(--accent-text); }
.icon-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 4px;
  padding: 8px; border-radius: var(--r-md); background: var(--surface-2);
}
.icon-opt {
  position: relative; display: grid; place-items: center; aspect-ratio: 1; min-height: 44px; border-radius: 50%;
  cursor: pointer; color: var(--ink-2); transition: background-color .2s, color .2s;
}
.icon-opt:hover { background: var(--surface); color: var(--ink); }
.icon-opt input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.icon-opt svg { width: 26px; height: 26px; pointer-events: none; }
.icon-opt svg .f { fill: color-mix(in srgb, var(--ink) 9%, transparent); }
.icon-opt svg .w { fill: var(--surface-2); }
.icon-opt:has(input:checked) {
  color: var(--c-icon);
  background: linear-gradient(150deg, color-mix(in srgb, var(--c1) 50%, var(--surface)), color-mix(in srgb, var(--c2) 32%, var(--surface)));
  box-shadow: inset 0 0 0 2px var(--c2);
}
.icon-opt:has(input:checked) svg .f { fill: color-mix(in srgb, var(--c2) 50%, transparent); }
.icon-opt:has(input:checked) svg .w { fill: var(--surface); }
.icon-opt:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.heart-check > span { display: inline-flex !important; align-items: center; gap: 8px; }
.heart-check > span::before { content: ''; width: 18px; height: 18px; flex: none; background: var(--accent); -webkit-mask: var(--i-heart) center / contain no-repeat; mask: var(--i-heart) center / contain no-repeat; }
.ed-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-top: 6px; }
.ed-acts .grow { flex: 1; }
.ed-acts .primary { padding: 0 28px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; z-index: 30; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  display: flex; align-items: center; gap: 14px; width: max-content; max-width: calc(100vw - 32px); min-height: 52px; padding: 6px 6px 6px 20px;
  border-radius: 999px; background: var(--ink); color: var(--canvas); font-weight: 500; box-shadow: var(--shadow-2);
}
:root[dir="rtl"] .toast { padding: 6px 20px 6px 6px; }
.toast:not(:has(.toast-btn:not([hidden]))) { padding-inline-end: 20px; }
.toast-btn { flex: none; min-height: 44px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--canvas); color: var(--ink); font: 600 .9375rem/1 var(--font); cursor: pointer; }
.toast-btn:hover { background: color-mix(in srgb, var(--accent) 14%, var(--canvas)); }
.toast-btn:focus-visible { outline-color: var(--accent); }
@media (prefers-reduced-motion: no-preference) {
  :root:not([data-motion="reduce"]) .toast:not([hidden]) { animation: ee-toast .3s var(--ease); }
}
@keyframes ee-toast { from { opacity: 0; transform: translate(-50%, 8px); } }

/* ---------- Footer, about, FAQ ---------- */
.foot { max-width: 1180px; margin: 0 auto; padding: 18px var(--gutter) 28px; color: var(--ink-2); font-size: .875rem; }
.foot p { margin: 0 0 6px; }
.fb-about { max-width: 1180px; margin: 12px auto 0; padding: 26px var(--gutter) 6px; color: var(--ink-2); font-size: .9375rem; }
.fb-about h2 { margin: 0 0 8px; font-size: 1.0625rem; color: var(--ink); }
.fb-about > p { margin: 0 0 14px; max-width: 70ch; line-height: 1.6; }
.fb-faq { display: grid; gap: 8px; }
.fb-faq h3 { margin: 8px 0 4px; font-size: .9375rem; color: var(--ink); }
.fb-faq details { border-radius: 16px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.fb-faq summary { cursor: pointer; padding: 12px 16px; font-weight: 500; color: var(--ink); list-style-position: inside; }
.fb-faq summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 16px; }
.fb-faq details p { margin: 0; padding: 0 16px 14px; max-width: 70ch; line-height: 1.6; }

/* Feedback box from /assets/feedback.js, fitted to this page */
body .fbk {
  width: min(760px, calc(100% - 2 * var(--gutter)));
  margin: 24px auto 72px; padding: 24px 26px;
  background: var(--surface); border: 0; border-radius: var(--r-card);
  box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line);
}
body .fbk-q { font-weight: 600; letter-spacing: -0.01em; }
body .fbk-q svg { stroke: var(--accent); }
body .fbk-hint { color: var(--accent-text); }
body .fbk-send { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
body .fbk textarea, body .fbk input[type=email] { background: var(--surface); border-color: var(--line-2); border-radius: var(--r-sm); }
body .fbk .fbk-beta { color: var(--accent-text); background: var(--accent-soft); border: 0; box-shadow: none; font-family: var(--font); font-weight: 600; letter-spacing: .05em; }
body .fbk-star:focus-visible, body .fbk button:focus-visible, body .fbk textarea:focus-visible, body .fbk input:focus-visible { outline-color: var(--focus); }
body .fbk .fbk-star { background: none; padding: 8px; border-radius: 8px; }
body .fbk .fbk-link { background: none; min-height: 44px; padding: 4px 0; border-radius: 0; }
body .fbk .fbk-send { min-height: 44px; padding: 0 22px; border-radius: 999px; }

/* ---------- Language (English / العربية) ---------- */
:root[lang="ar"] { --font: "Geist", "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif; }
:root[lang="ar"] body { line-height: 1.7; }
:root[lang="ar"] body *:not(svg):not(svg *) { letter-spacing: normal !important; }
:root[lang="ar"] h1, :root[lang="ar"] h2, :root[lang="ar"] h3, :root[lang="ar"] .lv-name, :root[lang="ar"] .fr-name { line-height: 1.45; }
.fb-suggest { --btn: var(--surface); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin: 0; padding: 12px 16px; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line); }
.fb-suggest p { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; }
.fb-suggest [lang="ar"] { font-family: 'IBM Plex Sans Arabic', system-ui, sans-serif; font-weight: 600; }
.fb-suggest [lang="en"] { font-family: 'Geist', system-ui, sans-serif; color: var(--ink-2); }
.fb-suggest-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.fb-suggest button { min-height: 44px; padding: 0 16px; border: 0; border-radius: 999px; cursor: pointer; font: 500 .9375rem var(--font); }
.fb-suggest .fb-ar { background: var(--accent); color: var(--accent-ink); font-family: 'IBM Plex Sans Arabic', system-ui, sans-serif; }
.fb-suggest .fb-en { background: var(--surface-2); color: var(--ink); }

/* ---------- Small UI pictures (masks, so they follow the text colour) ---------- */
:root {
  --i-plus: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.6' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E");
  --i-next: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 12a8 8 0 1 1-2.4-5.7'/%3E%3Cpath d='M20 4.5v4.4h-4.4'/%3E%3C/svg%3E");
  --i-pick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3.5c.6 3.9 2.1 5.4 6 6-3.9.6-5.4 2.1-6 6-.6-3.9-2.1-5.4-6-6 3.9-.6 5.4-2.1 6-6z'/%3E%3Cpath d='M18.5 15.5c.3 1.6.9 2.2 2.5 2.5-1.6.3-2.2.9-2.5 2.5-.3-1.6-.9-2.2-2.5-2.5 1.6-.3 2.2-.9 2.5-2.5z'/%3E%3C/svg%3E");
  --i-share: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3.5v11M7.8 7.7 12 3.5l4.2 4.2'/%3E%3Cpath d='M8 10.5H6.5a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2v-6a2 2 0 0 0-2-2H16'/%3E%3C/svg%3E");
  --i-copy: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='8.5' y='8.5' width='12' height='12' rx='2.5'/%3E%3Cpath d='M15.5 8.5V6a2.5 2.5 0 0 0-2.5-2.5H6A2.5 2.5 0 0 0 3.5 6v7A2.5 2.5 0 0 0 6 15.5h2.5'/%3E%3C/svg%3E");
  --i-pen: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15.5 4.5l4 4L9 19H5v-4z'/%3E%3C/svg%3E");
  --i-heart: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 20s-7.5-4.4-7.5-10A4.3 4.3 0 0 1 12 7.4 4.3 4.3 0 0 1 19.5 10c0 5.6-7.5 10-7.5 10z'/%3E%3C/svg%3E");
  --i-gear: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h9M17 7h3M4 17h3M11 17h9'/%3E%3Ccircle cx='15' cy='7' r='2.2'/%3E%3Ccircle cx='9' cy='17' r='2.2'/%3E%3C/svg%3E");
  --i-save: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4v10.5M7.8 10.6 12 14.8l4.2-4.2'/%3E%3Cpath d='M4.5 15.5v2.5a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2v-2.5'/%3E%3C/svg%3E");
  --i-tick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4 8-8.5'/%3E%3C/svg%3E");
  --i-tick-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23062330' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4 8-8.5'/%3E%3C/svg%3E");
  --i-up: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23126E92' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 19V5M6.5 10.5 12 5l5.5 5.5'/%3E%3C/svg%3E");
  --i-up-dark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239FE3F2' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 19V5M6.5 10.5 12 5l5.5 5.5'/%3E%3C/svg%3E");
}

/* ---------- Shared "easier to see" settings (Favabeans prefs.js) ---------- */
:root[data-text="large"] { font-size: 120%; }
:root[data-contrast="high"] { --ink-2: var(--ink); --line: rgb(29 29 31 / .45); --line-2: rgb(29 29 31 / .6); }
@media (prefers-color-scheme: dark) { :root[data-contrast="high"]:where(:not([data-theme="light"])) { --line: rgb(255 255 255 / .45); --line-2: rgb(255 255 255 / .6); } }
:root[data-contrast="high"]:where([data-theme="dark"]) { --line: rgb(255 255 255 / .45); --line-2: rgb(255 255 255 / .6); }
:root[data-contrast="high"] .btn, :root[data-contrast="high"] .file-btn { box-shadow: inset 0 0 0 1.5px var(--line-2); }
:root[data-contrast="high"] .level, :root[data-contrast="high"] .food-card { box-shadow: inset 0 0 0 1.5px var(--line-2); }
:root[data-contrast="high"] .level[aria-pressed="true"] { box-shadow: inset 0 0 0 3px var(--accent); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
:root[data-motion="reduce"] *, :root[data-motion="reduce"] *::before, :root[data-motion="reduce"] *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }

/* ---------- Tablets and phones ---------- */
@media (max-width: 900px) {
  .lower { grid-template-columns: minmax(0, 1fr); }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .cards.n1, .cards.n2 { grid-template-columns: minmax(0, 1fr); }
  /* On a narrow screen the three cards become calm rows: picture beside the words */
  .cards:not(.one) .food-card { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 16px; align-items: start; padding: 18px 18px 10px; }
  .cards:not(.one) .fc-top { grid-row: span 4; width: auto; margin: 0; flex-direction: column; align-items: center; gap: 8px; }
  .cards:not(.one) .fc-badge { width: 60px; height: 60px; }
  .cards:not(.one) .fc-badge svg { width: 31px; height: 31px; }
  .cards:not(.one) .fc-name { font-size: 1.1875rem; margin: 4px 0 8px; }
  .cards:not(.one) .fc-note { margin-top: 8px; }
  .cards:not(.one) .food-card > .chips, .cards:not(.one) .food-card > .fc-note { margin-bottom: 2px; }
  .cards:not(.one) .fc-out { justify-self: start; margin-top: 4px; }
}
@media (max-width: 600px) {
  .top-in { min-height: 56px; gap: 0 8px; }
  .brand { gap: 8px; }
  .brand h1 { font-size: 1rem; }
  .fb-lang button { padding: 0 6px; font-size: .8125rem; }
  .fb-lang button[lang="ar"] { font-size: .875rem; }
  .home-link { font-size: 0; width: 40px; min-width: 40px; padding: 0; justify-content: center; }
  .home-link::before { content: '←'; font-size: 1.05rem; line-height: 1; }
  :root[dir="rtl"] .home-link::before { content: '→'; }
  main { padding-top: 16px; gap: 16px; }

  .ask { padding: 20px 16px 16px; border-radius: 24px; }
  .ask-head { margin-bottom: 16px; padding-inline: 4px; }
  .ask h2 { font-size: 1.625rem; }
  /* The three energies become big rows, one per line */
  .levels { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .level { grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 16px; row-gap: 0; align-items: center; min-height: 80px; padding: 14px 52px 14px 16px; border-radius: 20px; }
  :root[dir="rtl"] .level { padding: 14px 16px 14px 52px; }
  .batt { grid-row: span 2; width: 46px; height: 28px; margin: 0; }
  .lv-name { font-size: 1.125rem; align-self: end; }
  .lv-hint { font-size: .875rem; align-self: start; }
  .level[aria-pressed="true"]::after { top: 50%; margin-top: -12px; }

  .food-card.is-picked { padding: 26px 18px 14px; }
  .is-picked .fc-badge { width: 88px; height: 88px; }
  .is-picked .fc-badge svg { width: 44px; height: 44px; }
  .results-acts { display: grid; grid-template-columns: minmax(0, 1fr); }
  .results-acts .pick { order: -1; }

  .foods, .shop { padding: 18px 16px; border-radius: 24px; }
  .sec-head h2 { font-size: 1.25rem; }
  .note { flex-wrap: wrap; }
  .note p { flex-basis: calc(100% - 48px); }
  .note .btn { margin-inline-start: 48px; }
  .panel { padding: 2px 16px; border-radius: 24px; }
  .panel[open] { padding-bottom: 16px; }

  /* The editor becomes a bottom sheet */
  .sheet { width: 100%; max-width: 100%; margin: auto 0 0; max-height: 92dvh; border-radius: 26px 26px 0 0; }
  .sheet-in { padding: 26px 16px max(20px, env(safe-area-inset-bottom)); gap: 16px; }
  .sheet::before { content: ''; position: absolute; top: 8px; left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 4px; background: var(--line-2); }
  :root:not([data-motion="reduce"]) .sheet[open] { animation-name: ee-up; }
  .seg-opt > span { padding: 4px 6px; font-size: .875rem; gap: 5px; }
}
@media (max-width: 380px) {
  .sec-head { flex-wrap: wrap; }
  .fr-pen { display: none; }
  .brand img { width: 24px; height: 24px; }
  .cards:not(.one) .food-card { column-gap: 12px; padding-inline: 14px; }
  .cards:not(.one) .fc-badge { width: 52px; height: 52px; }
  .cards:not(.one) .fc-badge svg { width: 27px; height: 27px; }
}
