/* v27.css — SPEC-v2.7 §2–§3 in the menus tab: the big emoji choice of the menu and meal editors
   (ui/emoji.js — "בלי" + the chosen one, the group tabs, a grid of four rows that scrolls
   sideways, "או כל אימוג׳י מהמקלדת של הטלפון:"), the dish editor's "🍽️ מנות שבתוך המנה" (chips +
   the chooser inside the editor: a search field and my dishes by menu) and the family's
   "כולל: …" line (ui/family.js). (The board's cell notes are in v27b.css.)
   Like v24.css … v26.css: built only from the app's shared variables (style.css), which
   theme-clean.css already points at its own tokens, so the fridge look (default, where a sheet
   stays a light paper object even in dark mode) and html[data-theme="clean"] (light and dark)
   both follow it; the clean rules below only swap a fridge object for its flat twin.
   Reused as they are: .emoji-btn (a round magnet per emoji), .sel-chip (the chips), .pk-list /
   .pk-li / .pk-dish / .cb (the picker's ✓ rows), .mini-btn, .btn.ghost, .input.
   Every font-size follows the text-size slider (var(--ts) / var(--ts2)); every tap target >= 44px;
   nothing is wider than a 360px phone (the grid scrolls inside itself). */

/* ---------------- the emoji choice ---------------- */
.emo { min-width: 0; max-width: 100%; }
/* "בלי" and the emoji chosen now (it may be in another group, or one typed on the keyboard) */
.emo-top { display: flex; align-items: center; gap: 12px; margin: 2px 0 10px; min-height: 50px; }
.emo-top .emoji-btn { flex: none; }
.emo-now {
  min-width: 0; display: inline-flex; align-items: center; gap: 8px;
  font: 700 calc(15px * var(--ts))/1.2 var(--font); color: var(--ink-soft);
}
.emo-now-e { font-size: calc(30px * var(--ts2)); line-height: 1; }

/* a tab per group: the whole row wraps (every group in sight), no sideways strip */
.emo-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.emo-tab {
  min-height: 44px; max-width: 100%; padding: 5px 13px; border-radius: 999px;
  background: var(--g-white); box-shadow: var(--sh-white); color: var(--ink);
  font: 700 calc(14.5px * var(--ts))/1.15 var(--font); text-align: center; overflow-wrap: anywhere;
}
.emo-tab.on { color: var(--member-ink); font-weight: 800; background: var(--g-member); box-shadow: var(--rim-on-color); }
.emo-tab:active { transform: translateY(1px) scale(0.98); }

/* the chosen group: four rows, as many columns as it needs, scrolled sideways inside (RTL: it
   starts on the right) — the editor stays short; the room around keeps the "on" ring in sight */
.emo-grid {
  display: grid; grid-auto-flow: column; grid-template-rows: repeat(4, auto);
  grid-auto-columns: calc(52px * var(--ts2));
  gap: 8px 4px; padding: 7px 6px 10px;
  max-width: 100%; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain;
  border-radius: 14px; box-shadow: inset 0 0 0 1.5px var(--rule);
  scrollbar-width: thin; scrollbar-color: var(--ink-mute) transparent;
}
.emo-grid .emoji-btn {
  width: calc(46px * var(--ts2)); height: calc(46px * var(--ts2));
  font-size: calc(24px * var(--ts2));
}

/* "או כל אימוג׳י מהמקלדת של הטלפון:" — one short field (16px at least: no zoom on an iPhone) */
.emo-free-l { margin-top: 14px; }
.emo-free {
  max-width: calc(9em * var(--ts2)); text-align: center;
  font-size: max(16px, calc(22px * var(--ts2)));
}

/* ---------------- the dish editor: "🍽️ מנות שבתוך המנה" ---------------- */
.parts-sec { margin-bottom: 4px; }
.parts-sec .field-label { margin-top: 20px; }
.part-chips { margin-bottom: 4px; }
.part-chip { max-width: 100%; text-align: start; }
.part-chip .pc-name { min-width: 0; overflow-wrap: anywhere; }
.parts-add { margin-top: 4px; }

/* the chooser (inside the editor, not a sheet of its own): a dashed box like the "+" buttons */
.parts-pick {
  margin: 6px 0 4px; padding: 2px 10px 8px;
  border-radius: 14px; border: 2px dashed var(--ink-mute);
  background: var(--paper);
}
.pp-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0 8px; }
.pp-title { min-width: 0; font: 800 calc(16px * var(--ts))/1.3 var(--font); color: var(--ink); }
.pp-q { margin-bottom: 4px; }
/* a menu's name over its dishes, in the menu's own colour (as its tab in the picker) */
.pp-menu {
  display: flex; align-items: center; gap: 6px;
  margin: 12px 0 2px; padding: 5px 10px; border-radius: 8px;
  background: linear-gradient(var(--na), var(--nb));
  font: 800 calc(14.5px * var(--ts))/1.25 var(--font); color: var(--ink); overflow-wrap: anywhere;
}
.pp-me { flex: none; font-size: calc(17px * var(--ts2)); line-height: 1; }
.pp-list .pk-empty { padding: 18px 8px; }

/* ---------------- §5 "עורך מנה מקופל": a folding part = one title row ---------------- */
/* (the dish editor's meals / nutrition / who loves it / reminder, the menu and meal editors' emoji):
   a light row like .switch-row — icon + name, the grey summary under it while closed, ▾ / ▴ */
.ed-folds { margin-top: 22px; }
.fold + .fold { margin-top: 8px; }
.emo-fold { margin-top: 18px; }
.fold-h { margin: 0; font: inherit; }
.fold-btn {
  width: 100%; min-height: 50px;
  display: flex; align-items: center; gap: 10px;
  padding: 7px 12px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.75); border: 2px solid var(--rule);
  text-align: start; color: var(--ink);
}
.fold-btn:active { transform: translateY(1px); }
.fold-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.fold-t { font: 800 calc(16.5px * var(--ts))/1.3 var(--font); overflow-wrap: anywhere; }
.fold-t .muted { font-weight: 500; font-size: calc(14px * var(--ts)); color: var(--ink-soft); }
.fold-emo { font-size: calc(22px * var(--ts2)); line-height: 1; vertical-align: -0.1em; }
/* short and grey, one line (…) */
.fold-sum {
  min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  font: 600 calc(14px * var(--ts))/1.3 var(--font); color: var(--ink-soft);
}
.fold-arr { flex: none; font-size: calc(15px * var(--ts2)); line-height: 1; color: var(--ink-soft); }
.fold.open .fold-btn { border-color: var(--ink-mute); }
.fold-body { padding: 2px 2px 10px; }
.fold-body > .field-help:first-child { margin-top: 10px; }
.emo-fold .fold-body { padding-top: 10px; }

/* ---------------- "של המשפחה": "כולל: …" under a dish's ingredients ---------------- */
.fd-parts { font: 600 calc(14.5px * var(--ts))/1.45 var(--font); color: var(--ink); margin: -2px 0 8px; overflow-wrap: anywhere; }
.fd-name + .fd-parts, .fd-src + .fd-parts { margin-top: 6px; }

/* ---------------- the clean look ("לבן ולימון") ---------------- */
html[data-theme="clean"] .emo-now { font-family: var(--c-sans); font-weight: 500; color: var(--c-ink2); }
/* "on" = ink, as its .opt-btn / .meal-chip (app.js puts the board's --member-ink on <body> inline,
   which would win over the clean look's own) */
html[data-theme="clean"] .emo-tab {
  background: var(--c-fill); box-shadow: none; color: var(--c-ink);
  font: 500 calc(14.5px * var(--ts))/1.15 var(--c-sans);
}
html[data-theme="clean"] .emo-tab.on { background: var(--c-ink); color: var(--c-bg); font-weight: 600; box-shadow: none; }
html[data-theme="clean"] .emo-tab:active { transform: none; background: var(--c-fill2); }
html[data-theme="clean"] .emo-tab.on:active { background: var(--c-ink); }
html[data-theme="clean"] .emo-grid { box-shadow: inset 0 0 0 1px var(--c-line); scrollbar-color: var(--c-ink4) transparent; }
html[data-theme="clean"] .parts-pick { border: 1px solid var(--c-line); border-radius: 16px; background: var(--c-surface); }
html[data-theme="clean"] .pp-title { font: 700 calc(15.5px * var(--ts))/1.3 var(--c-sans); }
html[data-theme="clean"] .pp-menu {
  margin-top: 14px; padding: 2px 0; border-radius: 0; background: transparent;
  font: 600 calc(13.5px * var(--ts))/1.25 var(--c-sans); color: var(--c-ink2);
}
html[data-theme="clean"] .fd-parts { font-family: var(--c-sans); font-weight: 500; color: var(--c-ink); }
/* §5: a grey card row, as its .switch-row */
html[data-theme="clean"] .fold-btn { background: var(--c-fill); border: 0; border-radius: 14px; }
html[data-theme="clean"] .fold-btn:active { transform: none; background: var(--c-fill2); }
html[data-theme="clean"] .fold.open .fold-btn { box-shadow: inset 0 0 0 1px var(--c-line); }
html[data-theme="clean"] .fold-t { font: 600 calc(16px * var(--ts))/1.3 var(--c-sans); color: var(--c-ink); }
html[data-theme="clean"] .fold-t .muted { font-family: var(--c-sans); color: var(--c-ink2); }
html[data-theme="clean"] .fold-sum { font: 500 calc(13.5px * var(--ts))/1.3 var(--c-sans); color: var(--c-ink2); }
html[data-theme="clean"] .fold-arr { color: var(--c-ink2); }
