/* v24.css — SPEC-v2.4 §2 ("צבי"): the "🛒 N" missing-ingredients badge on a cell's note (week),
   day (month) and meal row (the day sheet), + the "חסר לארוחה הזו:" popover it opens.
   Like v21.css / v23.css: built only from the app's own shared variables (style.css), so the
   fridge look (default) and the clean theme (html[data-theme="clean"], theme-clean.css) both
   follow it automatically — --g-round-white / --sh-round / --ink-soft / --rule / --marker-green
   are already redefined per theme, so this file needs no [data-theme="clean"] rules of its own.
   Every font-size follows the text-size slider (var(--ts) / var(--ts2)).
   SPEC: "בצבע עדין שלא צועק" — a small neutral chip (the same look as the sheet's ✕ / the zoom
   bar's chips), not a red alert. */

/* ---------------- the corner badge ---------------- */
/* .note, .mday and .ds-note are all position:relative already (style.css), so the badge just
   sits inside that box — top/left INSET (never a negative offset), because .mgrid and
   .wb-scroll both clip overflow, and a badge protruding past its cell's own edge would be cut
   off there. */
.mi-badge {
  position: absolute; top: 3px; left: 3px; z-index: 2;
  display: inline-flex; align-items: center; gap: 2px;
  min-height: 20px; padding: 2px 7px; border-radius: 999px;
  background: var(--g-round-white); box-shadow: var(--sh-round);
  color: var(--ink-soft);
  font: 700 calc(11.5px * var(--ts2))/1 var(--font); white-space: nowrap;
  cursor: pointer;
}
/* the visible chip stays small ("subtle"); an invisible pad grows the tap target to >= 32px
   (SPEC) around it without widening the chip itself or covering more of the note's text. */
/* (only 3px past its left side = its own distance from the note's edge: a pad sticking out of the
   last column's note made the week board scroll sideways by a few px and show its "more" arrow) */
.mi-badge::before { content: ""; position: absolute; inset: -7px -7px -7px -3px; }
.mi-badge-ic { font-size: calc(11px * var(--ts2)); line-height: 1; }
.mi-badge-n { font-variant-numeric: tabular-nums; }
/* board wiring (ui/board.js adds .has-miss to a note / day that carries a badge): the badge never
   covers what is written. A week note's text starts under it (its top strip, "the tape"); a meal
   row of the day sheet is wide, so its text keeps clear of it sideways; a day of the month is too
   narrow on a phone for the badge beside its number, so there it sits in the flow, at the bottom
   corner (after the day's little notes). */
.wb .note.has-miss { padding-top: calc(6px + 19px * var(--ts2)); }
.day-list .ds-note.has-miss { padding-left: calc(12px + 34px * var(--ts2)); }
.mday .mi-badge {
  position: relative; top: auto; left: auto; align-self: flex-end; margin-top: auto;
  gap: 1px; padding: 2px 3px; max-width: 100%;   /* a phone's day is ~41px inside: "🛒 12" still fits at 160% */
}
.mday .mi-badge::before { inset: -7px -3px -5px; }   /* the tap pad stays inside the day (>= 32px high) */
/* the clean look: its round chips are the very grey of its cells (--g-round-white = --c-fill, no
   shadow), so the badge would be bare text there — a page-coloured chip with a hairline instead */
html[data-theme="clean"] .mi-badge { background: var(--c-bg); box-shadow: 0 0 0 1px var(--c-line); }
@media (hover: hover) { .mi-badge:hover { filter: brightness(0.97); } }
.mi-badge:active { transform: scale(0.94); }

/* ---------------- "חסר לארוחה הזו:" popover (a compact bottom sheet — SHEETS.missing) ---------------- */
.mi-list { list-style: none; }
.mi-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 2px; border-bottom: 1px solid var(--rule);
}
.mi-row:last-child { border-bottom: none; }
.mi-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mi-name { font: 600 calc(16.5px * var(--ts))/1.25 var(--font); color: var(--ink); overflow-wrap: anywhere; }
.mi-for { font: 500 calc(13px * var(--ts))/1.3 var(--font); color: var(--ink-soft); overflow-wrap: anywhere; }
.mi-have-btn {
  flex: none; min-height: 40px; padding: 0 14px; border-radius: 999px;
  background: var(--g-round-white); box-shadow: var(--sh-round); color: var(--marker-green);
  font: 700 calc(14px * var(--ts))/1 var(--font); white-space: nowrap;
}
.mi-have-btn:active { transform: scale(0.96); }
.mi-empty { padding: 18px 4px; text-align: center; font: 600 calc(16px * var(--ts))/1.3 var(--font); color: var(--ink-soft); }

/* SPEC-v2.4: the badge must never show in an export (PNG/PDF). export.js draws the board on a
   <canvas> straight from weekView/monthView data (it never reads the live board's DOM), so as
   long as the wiring step does not teach drawNote()/its cell-drawing code about missing.js, the
   badge is already excluded there by construction — no CSS or export.js change needed. */
