/* מה אוכלים? — "לוח על המקרר" (the fridge board), v2.1 look:
   "מגנטים בצבעי הארוחות" (designs/tb-4-meal-colors) + "כתב יד ידידותי" (designs/font-2-playpen).
   The screen is a fridge door; on it hang a whiteboard in a silver frame, sticky notes,
   a torn notepad page and MATTE magnets, each in the colour of its job:
     day magnets neutral, today lemon, the chosen board chip + the active tab magnet in the
     board owner's colour (--member), main action buttons warm tomato, the title one tomato sign.
   Fonts: Assistant for the UI, Playpen Sans Hebrew for titles and the handwriting (notes,
   the picker, the shopping list) — with system fallbacks, so it all works with no connection.
   RTL, phone first, fine on a desktop. Text ON the door uses --door-ink; text on paper,
   notes and the whiteboard uses --ink (these objects stay light in dark mode too). */

/* When Playpen Sans Hebrew is not available (offline, never cached), a system font stands
   in for the handwriting at about the same size (Playpen is a wide hand). */
@font-face {
  font-family: "Hand Fallback";
  src: local("Arial Hebrew"), local("ArialHebrew"), local("Arial"), local("Segoe UI"), local("Helvetica");
  size-adjust: 104%;
}

:root {
  /* the fridge door */
  --door-a: #EDEAE2; --door-b: #F8F6F1; --door-c: #E6E2D9;
  --door-lines: rgba(0, 0, 0, 0.018);
  --door-ink: #2B2F3A; --door-soft: #5B6270;
  --bar: rgba(255, 255, 255, 0.94); --bar-ink: #5B6270; --bar-icon: #6B7280; --bar-line: rgba(0, 0, 0, 0.08);

  /* objects on the door */
  --board: #FFFFFF; --frame-a: #E3E6EA; --frame-b: #B4BAC3;
  --paper: #FFFDF3; --sheet: #FFFDF8; --rule: #C9DDF3; --margin: #F2A6A6;
  --ink: #1F2430; --ink-soft: #4F5664; --ink-mute: #7A808B;
  --field: #FFFFFF; --field-line: #C3C8D0;
  --grid-line: #E3E6EA;

  /* markers & doodles */
  --marker-red: #E0393E; --marker-blue: #2456C9; --marker-green: #2E9E4F;
  --doodle: #E8891D; --sun: #FFD84D;

  /* masking tape */
  --tape-a: rgba(247, 230, 178, 0.97); --tape-b: rgba(240, 218, 150, 0.97); --tape-ink: #3A2E22;

  /* matte magnets in the colour of their job (not glossy): a soft light rim, a faint dark
     hairline, a little body shading and a "sits on the fridge" shadow */
  --lemon: #FFD23F; --lemon-hi: #FFE46E; --lemon-ink: #3A2E22; --lemon-sub: #6B5518;
  --tom: #D94A22; --tom-hi: #EC6134; --tom-lo: #BD3D19;
  --neut: #E4E5E9; --neut-hi: #FAFAFB;
  --rim-on-color: inset 0 0 0 2px rgba(255, 255, 255, 0.34), inset 0 0 0 3px rgba(0, 0, 0, 0.07), inset 0 -2px 3px rgba(0, 0, 0, 0.12), 0 2px 3px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(0, 0, 0, 0.05);
  --rim-on-light: inset 0 0 0 2px #FFFFFF, inset 0 0 0 3px rgba(0, 0, 0, 0.07), inset 0 -2px 2px rgba(0, 0, 0, 0.05), 0 2px 3px rgba(0, 0, 0, 0.20), 0 0 0 1px rgba(0, 0, 0, 0.05);
  --rim-lemon: inset 0 0 0 2px rgba(255, 255, 255, 0.55), inset 0 0 0 3px rgba(0, 0, 0, 0.08), inset 0 -2px 3px rgba(0, 0, 0, 0.10), 0 2px 3px rgba(0, 0, 0, 0.24), 0 0 0 1px rgba(0, 0, 0, 0.06);
  --rim-pressed: inset 0 0 0 2px rgba(255, 255, 255, 0.28), inset 0 0 0 3px rgba(0, 0, 0, 0.08), inset 0 2px 3px rgba(0, 0, 0, 0.18), 0 1px 1px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.05);
  --g-lemon: linear-gradient(180deg, var(--lemon-hi), var(--lemon));
  --g-tom: linear-gradient(180deg, var(--tom-hi), var(--tom));
  --sh-tom: inset 0 0 0 2px rgba(255, 255, 255, 0.34), inset 0 0 0 3px rgba(0, 0, 0, 0.07), inset 0 -2px 3px rgba(0, 0, 0, 0.12), 0 4px 7px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(0, 0, 0, 0.05);

  /* action = tomato (the old names are kept so every place that used the loud red is covered) */
  --g-red: var(--g-tom);
  --sh-red: var(--sh-tom);
  --g-white: linear-gradient(180deg, #FFFFFF, #ECECEC);
  --sh-white: inset 0 1px 0 #fff, inset 0 -2px 3px rgba(0, 0, 0, 0.10), 0 2px 3px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.06);
  --g-wa: radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0) 60%), linear-gradient(180deg, #3BE07A, #1DA851);
  --sh-wa: inset 0 -3px 4px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 4px 8px rgba(29, 168, 81, 0.35);
  --g-round-white: linear-gradient(180deg, var(--neut-hi), var(--neut));
  --sh-round: var(--rim-on-light);
  --g-round-red: var(--g-tom);
  --sh-round-red: var(--rim-on-color);
  --g-round-blue: linear-gradient(180deg, #5C8FE6, #2E66CC);
  --sh-round-dark: var(--rim-on-color);

  --overlay: rgba(40, 28, 14, 0.5);

  --font: "Assistant", "Heebo", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Hebrew", "Arial Hebrew", Arial, sans-serif;
  --hand: "Playpen Sans Hebrew", "Hand Fallback", "Arial Hebrew", Arial, sans-serif;
  --display: "Playpen Sans Hebrew", "Assistant", "Arial Hebrew", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;

  /* text size (SPEC-v2): every font-size is calc(Npx * var(--ts)); --ts2 grows half as fast,
     for the dense board chrome (day magnets, meal headers), the logo and emoji in circles */
  --ts: 1;
  --ts2: calc(0.5 + var(--ts) * 0.5);
  --nav-h: calc(58px + 16px * var(--ts));
  --maxw: 560px;
  --maxw-wide: 980px;
  --dayw: calc(56px * var(--ts2));     /* the day-magnet column of the week */
  --notew: 84px;    /* the narrowest a note column may get before the board scrolls sideways */
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* a dark (graphite) fridge; paper, notes and the whiteboard stay light objects on it */
    --door-a: #25282D; --door-b: #2F3238; --door-c: #222529;
    --door-lines: rgba(255, 255, 255, 0.02);
    --door-ink: #F1F2F4; --door-soft: #C2C7CF;
    --bar: rgba(31, 34, 39, 0.95); --bar-ink: #C2C7CF; --bar-icon: #AEB4BD; --bar-line: rgba(255, 255, 255, 0.08);
    --board: #F3F4F6; --frame-a: #A7ADB6; --frame-b: #6E747D;
    --paper: #F5F1E4; --sheet: #F3EFE6;
    --grid-line: #DADDE2;
    --overlay: rgba(0, 0, 0, 0.62);
  }
}

/* --member = the colour of the board owner (the chosen board chip, the active tab magnet,
   "selected" states). The board's colour lives only on its chip (style="--bc:…"), so on the
   board tab the chosen chip lends it to the whole page (the 8 colours of the board editor);
   elsewhere the first board colour. If app.js sets --member / --member-ink on <body> itself,
   that wins (inline style). */
:root { --member: #6ba368; --member-ink: #2b2416; }
body:has(.boards-row .bchip.on[style*="#e9b824" i]) { --member: #e9b824; }
body:has(.boards-row .bchip.on[style*="#e07a5f" i]) { --member: #e07a5f; }
body:has(.boards-row .bchip.on[style*="#5b8db8" i]) { --member: #5b8db8; }
body:has(.boards-row .bchip.on[style*="#9b6fb0" i]) { --member: #9b6fb0; }
body:has(.boards-row .bchip.on[style*="#e58fa8" i]) { --member: #e58fa8; }
body:has(.boards-row .bchip.on[style*="#4fa3a5" i]) { --member: #4fa3a5; }
body:has(.boards-row .bchip.on[style*="#c98b4b" i]) { --member: #c98b4b; }
body { --g-member: linear-gradient(180deg, color-mix(in srgb, var(--member) 72%, #fff), var(--member)); }
@supports not (background: color-mix(in srgb, red 50%, white)) {
  body { --g-member: var(--member); }
}

/* sticky-note colours: y yellow, p peach, b blue, g green, k pink, l lilac */
.k-y { --na: #FFF3A6; --nb: #FFE45C; }
.k-p { --na: #FFDDB8; --nb: #FFC27C; }
.k-b { --na: #D3E9FF; --nb: #A9D2FF; }
.k-g { --na: #D8F5C8; --nb: #B4E6A0; }
.k-k { --na: #FFD6E4; --nb: #FFB3CB; }
.k-l { --na: #E6DDFF; --nb: #CDBBFF; }

/* ---------------- base ---------------- */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--door-b); }
body {
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: calc(17px * var(--ts));
  line-height: 1.45;
  color: var(--door-ink);
  background-color: var(--door-b);
  background-image:
    repeating-linear-gradient(90deg, var(--door-lines) 0 1px, transparent 1px 3px),
    linear-gradient(90deg, var(--door-a) 0%, var(--door-b) 35%, var(--door-b) 65%, var(--door-c) 100%);
  padding-bottom: calc(var(--nav-h) + 22px + env(safe-area-inset-bottom));
  overflow-x: hidden;
}
body.locked, body.login-open { overflow: hidden; }
button {
  font: inherit; color: inherit; cursor: pointer; background: none; border: none;
  touch-action: manipulation; -webkit-user-select: none; user-select: none; text-align: inherit;
}
button:disabled { cursor: default; }
input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; }
svg { display: block; }
b, strong { font-weight: 700; }
:focus-visible { outline: 3px solid var(--marker-blue); outline-offset: 2px; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.muted { color: var(--ink-soft); }
.small { font-size: calc(14px * var(--ts)); }
.center { text-align: center; }
.num { font-variant-numeric: tabular-nums; unicode-bidi: isolate; }

/* ---------------- the title: ONE tomato magnet sign "מה אוכלים?" ---------------- */
/* (the login screen still sends the old letter-by-letter markup: .logo-l > .L / .sp — it is
   drawn as the same single sign, the letters just plain text on it) */
.logo { display: inline-flex; padding: 4px 4px 6px; }
.logo-l {
  position: relative; display: inline-block;
  padding: 0 0.62em 0 0.58em; border-radius: 9px;
  font: 800 calc(22px * var(--ts2))/1.82 var(--hand); color: #fff; letter-spacing: 0; white-space: nowrap;
  background: var(--g-tom);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.34), inset 0 0 0 3px rgba(0, 0, 0, 0.07), inset 0 -2px 3px rgba(0, 0, 0, 0.12), 0 3px 4px rgba(0, 0, 0, 0.24), 0 0 0 1px rgba(0, 0, 0, 0.05);
  transform: rotate(-2deg); transform-origin: 50% 60%;
}
/* a printed hairline inside the plate, so it reads as a sign and not as a button */
.logo-l::before {
  content: ""; position: absolute; inset: 5px; border-radius: 5px;
  border: 1.5px solid rgba(255, 255, 255, 0.38); pointer-events: none;
}
.L { display: inline; font: inherit; color: inherit; background: none; transform: none; filter: none; }
.logo .sp { display: inline-block; width: 0.26em; }
.logo.big .logo-l { font-size: calc(34px * var(--ts2)); border-radius: 13px; }
.logo.big .logo-l::before { inset: 7px; border-radius: 7px; border-width: 2px; }

/* ---------------- header (on the board tab) ---------------- */
.app-header {
  max-width: var(--maxw);
  margin: 0 auto;
  min-height: 60px;
  padding: calc(10px + env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 2px max(14px, env(safe-area-inset-left));
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  flex-wrap: wrap;
}
body.wide .app-header { max-width: var(--maxw-wide); }
.brand { margin: 0; font-size: 1em; line-height: 1; min-width: 0; }
.hdr-action { flex: none; }
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 44px; padding: 0 16px; border-radius: 999px;
  background: var(--g-white); box-shadow: var(--sh-white);
  font: 700 calc(16px * var(--ts))/1 var(--font); color: var(--ink); white-space: nowrap;
}
.pill svg { width: 20px; height: 20px; }
.pill:active { transform: translateY(1px); }

/* ---------------- the "no connection" strip of masking tape ---------------- */
.offline {
  position: sticky; top: 0; z-index: 40;
  display: flex; justify-content: center;
  padding: calc(6px + env(safe-area-inset-top)) 12px 6px;
  pointer-events: none;
}
.off-tape {
  display: inline-block; max-width: 100%;
  padding: 9px 22px;
  font: 600 calc(15.5px * var(--ts))/1.3 var(--font); color: var(--tape-ink); text-align: center;
  background: linear-gradient(180deg, var(--tape-a), var(--tape-b));
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.22);
  transform: rotate(-1deg);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 7px, #000 calc(100% - 7px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 7px, #000 calc(100% - 7px), transparent 100%);
}

/* ---------------- layout ---------------- */
#main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 4px max(16px, env(safe-area-inset-right)) 16px max(16px, env(safe-area-inset-left));
}
body.wide #main { max-width: var(--maxw-wide); }
body[data-tab="board"] #main { padding-right: max(12px, env(safe-area-inset-right)); padding-left: max(12px, env(safe-area-inset-left)); }

/* a page's own title (shopping, menus, more) */
.page-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(14px + env(safe-area-inset-top)) 2px 6px;
}
.ph-text { min-width: 0; }
.page-title { font: 800 calc(25px * var(--ts))/1.15 var(--display); color: var(--door-ink); letter-spacing: 0; }
.page-sub { display: block; font: 600 calc(14.5px * var(--ts))/1.3 var(--font); color: var(--door-soft); margin-top: 6px; }
.page-help { font-size: calc(15px * var(--ts)); color: var(--door-soft); margin: 2px 2px 16px; line-height: 1.5; }
.cnt-mag {
  flex: none; width: calc(60px * var(--ts2)); height: calc(60px * var(--ts2)); border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--g-round-white); box-shadow: var(--sh-round); color: var(--tom);
}
.cnt-mag b { font: 800 calc(22px * var(--ts2))/1 var(--font); }
.cnt-mag small { font: 700 calc(13px * var(--ts2))/1 var(--font); color: var(--ink-soft); margin-top: 1px; }
.big-emoji { font-size: calc(44px * var(--ts)); line-height: 1.1; margin-bottom: 8px; }
.tap-hint { text-align: center; font: 500 calc(14.5px * var(--ts))/1.4 var(--font); color: var(--door-soft); margin: 2px 0 14px; }
.version { text-align: center; font: 500 calc(13px * var(--ts)) var(--font); color: var(--door-soft); margin-top: 8px; }

/* ---------------- things on the door: paper, sticky notes, magnets ---------------- */
.paper, .card {
  position: relative;
  background: var(--paper); color: var(--ink);
  border-radius: 4px;
  padding: 20px 16px 16px;
  margin: 0 0 20px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.06), 0 6px 14px rgba(60, 45, 20, 0.14);
  color-scheme: light;
}
.paper.pinned::before, .paper.pinned::after {
  content: ""; position: absolute; top: -9px; width: 24px; height: 24px; border-radius: 50%; z-index: 2;
  box-shadow: var(--sh-round-dark);
}
.paper.pinned::before { right: 22px; background: var(--g-lemon); box-shadow: var(--rim-lemon); }
.paper.pinned::after { left: 24px; background: var(--g-member); }
.paper.ruled {
  background: linear-gradient(to left, transparent 0 30px, var(--margin) 30px 32px, transparent 32px), var(--paper);
  padding-right: 44px;
}
.empty-paper { padding: 30px 18px 20px; }
.empty-paper p { margin-bottom: 6px; }
.card-title { font: 700 calc(19px * var(--ts))/1.3 var(--font); color: var(--ink); margin-bottom: 6px; }

.stick {
  position: relative;
  color: var(--ink);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.05) 0 12px, transparent 12px), linear-gradient(180deg, var(--na, #FFF3A6), var(--nb, #FFE45C));
  border-radius: 2px;
  box-shadow: 1px 3px 6px rgba(0, 0, 0, 0.2), 0 0 0 0.5px rgba(0, 0, 0, 0.05);
  padding: 20px 16px 16px;
  margin: 0 0 20px;
  color-scheme: light;
}
.stick::after {
  content: ""; position: absolute; right: 0; bottom: 0;
  border-style: solid; border-width: 0 16px 16px 0;
  border-color: transparent var(--fold, var(--door-b)) rgba(0, 0, 0, 0.12) transparent;
}
.stick p { color: var(--ink-soft); }

.pin-mag {
  position: absolute; top: -10px; right: 50%; transform: translateX(50%);
  width: 26px; height: 26px; border-radius: 50%; z-index: 3;
  box-shadow: var(--sh-round-dark);
}
/* pins: a lemon magnet and one in the board owner's colour (were red and blue) */
.pin-mag.red { background: var(--g-lemon); box-shadow: var(--rim-lemon); }
.pin-mag.blue { background: var(--g-member); }

/* ---------------- buttons & fields ---------------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 50px;
  margin-top: 12px; padding: 10px 16px;
  border-radius: 14px;
  font: 700 calc(17px * var(--ts))/1.2 var(--font); color: var(--ink); text-align: center; text-decoration: none;
  background: var(--g-white); box-shadow: var(--sh-white);
  transition: transform 0.08s ease, opacity 0.15s ease;
}
.btn:active:not(:disabled) { transform: translateY(1px) scale(0.99); }
.btn:disabled { opacity: 0.55; }
/* the main action: a warm tomato matte magnet */
.btn.primary {
  color: #fff; font-weight: 800; font-size: calc(18px * var(--ts));
  background: var(--g-tom); box-shadow: var(--sh-tom);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
}
/* pressed: the magnet is pushed onto the fridge — the shadow collapses, the body darkens a touch */
.btn.primary:active:not(:disabled), .bchip.on:active, .tabbar .tab.selected:active .ic, .today-btn:active, #toastAction:active {
  transform: translateY(1px); box-shadow: var(--rim-pressed); filter: brightness(0.94);
}
.btn.ghost {
  background: rgba(255, 255, 255, 0.62); box-shadow: none;
  border: 2px dashed #A9AFB8; color: var(--ink-soft);
}
.btn.danger-ghost {
  background: rgba(255, 255, 255, 0.75); box-shadow: none;
  border: 2px solid rgba(224, 57, 62, 0.6); color: #B8232A;
}
.btn.wa {
  color: #fff; font-weight: 800; font-size: calc(18px * var(--ts));
  background: var(--g-wa); box-shadow: var(--sh-wa);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}
.btn.wa .wa-ico { width: 24px; height: 24px; flex: none; }
.btn.big { min-height: 58px; font-size: calc(19px * var(--ts)); border-radius: 18px; }
.btn.spaced { margin-top: 30px; }
.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; min-width: 0; }
.link-btn {
  min-height: 44px; padding: 6px 14px; margin-top: 12px;
  font-weight: 700; color: var(--door-ink);
  text-decoration: underline; text-underline-offset: 3px;
}

.input {
  display: block; width: 100%; min-height: 50px;
  background: var(--field); color: var(--ink);
  border: 2px solid var(--field-line); border-radius: 12px;
  padding: 10px 12px;
  font: 500 max(16px, calc(17px * var(--ts)))/1.3 var(--font);
  outline: none;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
  color-scheme: light;
}
.input:focus { border-color: var(--marker-blue); box-shadow: 0 0 0 3px rgba(36, 86, 201, 0.18); }
.input::placeholder { color: #80868F; opacity: 1; }
textarea.input { resize: vertical; min-height: 80px; line-height: 1.4; }
.field-label { display: block; font: 700 calc(16px * var(--ts))/1.3 var(--font); color: var(--ink); margin: 18px 2px 7px; }
.field-label .muted, .opt { font-weight: 500; font-size: calc(14px * var(--ts)); color: var(--ink-soft); }
.field-help { font-size: calc(14px * var(--ts)); color: var(--ink-soft); margin: -2px 2px 9px; }
.sheet-text { color: var(--ink-soft); }

.mini-btn, .icon-btn {
  flex: none; width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--g-round-white); box-shadow: var(--sh-round); color: var(--ink);
}
.mini-btn svg { width: 20px; height: 20px; }
.icon-btn svg { width: 21px; height: 21px; }
.mini-btn:disabled { opacity: 0.35; box-shadow: none; }
.mini-btn.danger { color: #B8232A; }
.mini-btn:active:not(:disabled), .icon-btn:active { transform: translateY(1px); }
.chev { flex: none; color: var(--ink-soft); }
.chev svg { width: 20px; height: 20px; }

/* hand-drawn checkbox + green marker tick */
.cb {
  position: relative; flex: none;
  width: 30px; height: 30px;
  border: 2.5px solid #2B2F3A;
  border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
  background: #fff;
}
.cb .tick { position: absolute; left: -3px; top: -9px; width: 37px; height: 37px; }

/* ---------------- hints on the board ---------------- */
.hint-note { display: flex; gap: 12px; align-items: flex-start; transform: rotate(-0.6deg); margin: 8px 0 18px; }
.hint-note .hint-emoji { font-size: calc(32px * var(--ts)); line-height: 1; padding-top: 2px; }
.hint-body { flex: 1; min-width: 0; }
.hint-body b { font: 700 calc(18px * var(--ts))/1.3 var(--font); }
.hint-body p { font-size: calc(15.5px * var(--ts)); margin-top: 3px; }
.install-hint {
  display: flex; align-items: center; gap: 6px;
  padding: 14px 6px 8px 4px; margin: 10px 0 12px;
  font-size: calc(15px * var(--ts)); transform: rotate(0.5deg);
}
.install-hint .hint-emoji { font-size: calc(22px * var(--ts)); padding-inline-start: 8px; }
.hint-text { flex: 1; line-height: 1.3; }
.hint-link { font-weight: 700; color: var(--marker-blue); text-decoration: underline; text-underline-offset: 3px; padding: 8px 6px; min-height: 44px; }
.hint-x { color: var(--ink-soft); min-width: 44px; min-height: 44px; display: flex; align-items: center; justify-content: center; }
.hint-x svg { width: 18px; height: 18px; }

/* ---------------- the board: whose board, the period ---------------- */
.boards-row { display: flex; align-items: center; gap: 8px; margin: 4px 0 8px; }
.chips-lbl { font: 600 calc(14px * var(--ts))/1 var(--font); color: var(--door-soft); white-space: nowrap; }
.bchips { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bchip {
  min-height: 44px; max-width: 100%;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 0 14px; border-radius: 999px;
  font: 700 calc(17px * var(--ts))/1 var(--font); color: var(--ink);
  background: var(--g-white); box-shadow: var(--sh-white);
}
.bname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 2px 0; }
.bdot {
  display: inline-block; width: 12px; height: 12px; border-radius: 50%; flex: none; vertical-align: middle;
  background: var(--bc, #6ba368);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.55), 0 1px 1px rgba(0, 0, 0, 0.18);
}
/* the chosen board = a matte magnet in the board's own colour, a white dot on it */
.bchip.on {
  color: var(--bc-ink, #fff);
  background: var(--bc, #6ba368);
  box-shadow: var(--rim-on-color);
}
.bchip.on .bdot { background: #fff; box-shadow: 0 1px 1px rgba(0, 0, 0, 0.18); }
@supports (background: color-mix(in srgb, red 50%, white)) {
  .bchip.on { background: linear-gradient(180deg, color-mix(in srgb, var(--bc, #6ba368) 72%, #fff), var(--bc, #6ba368)); }
}
.bchip.add {
  width: calc(44px * var(--ts2)); min-height: calc(44px * var(--ts2)); padding: 0; border-radius: 50%;
  font: 500 calc(26px * var(--ts2))/1 var(--font); color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.55); box-shadow: none; border: 2px dashed #A9AFB8;
}

.ctrl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 0 12px; }
.tape {
  flex: 1 1 calc(172px * var(--ts)); max-width: calc(290px * var(--ts)); min-width: 0;
  display: flex; align-items: center; justify-content: space-between;
  min-height: 52px; padding: 0 5px;
  color: var(--tape-ink);
  background: linear-gradient(180deg, var(--tape-a), var(--tape-b));
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  transform: rotate(-1deg);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 6px, #000 calc(100% - 6px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 6px, #000 calc(100% - 6px), transparent 100%);
}
.nav-arrow {
  flex: none; width: 42px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: var(--tape-ink);
}
.nav-arrow svg { width: 22px; height: 22px; stroke-width: 2.8; }
.nav-arrow:active { background: rgba(0, 0, 0, 0.06); }
.period-title { flex: 1; min-width: 0; text-align: center; }
.pt-main { font: 700 calc(17.5px * var(--ts))/1.15 var(--font); white-space: nowrap; }
.pt-sub { font: 600 calc(13px * var(--ts))/1.2 var(--font); color: #6B5A43; margin-top: 1px; }
/* "back to today" = a lemon magnet, like today on the board */
.today-btn {
  flex: none; width: calc(46px * var(--ts2)); height: calc(46px * var(--ts2)); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--g-lemon); box-shadow: var(--rim-lemon);
  color: var(--lemon-ink); font: 800 calc(14px * var(--ts))/1 var(--font);
}
.seg {
  flex: none; margin-inline-start: auto;
  display: flex; height: 46px; padding: 3px; border-radius: 999px;
  background: rgba(0, 0, 0, 0.07); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.12);
}
.seg-btn { min-width: 56px; padding: 0 11px; border-radius: 999px; font: 700 calc(16px * var(--ts))/40px var(--font); color: var(--door-soft); text-align: center; }
.seg-btn.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); }
@media (prefers-color-scheme: dark) {
  .seg { background: rgba(255, 255, 255, 0.1); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3); }
  .seg-btn.on { background: #F1F2F4; color: #1F2430; }
}

/* ---------------- the whiteboard ---------------- */
.wb {
  position: relative;
  margin: 2px auto 8px;
  max-width: calc(var(--dayw) + var(--cols, 3) * 196px + 50px);
  padding: 9px; border-radius: 12px;
  background: linear-gradient(180deg, var(--frame-a), var(--frame-b));
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  color: var(--ink);
  color-scheme: light;
}
.wb-scroll {
  background: var(--board); border-radius: 8px;
  box-shadow: inset 0 1px 6px rgba(0, 0, 0, 0.12);
  overflow-x: auto; overflow-y: hidden;
  -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
  scrollbar-width: thin; scrollbar-color: #C7CCD4 transparent;
}
.wgrid {
  display: flex; flex-direction: column; gap: 5px;
  padding: 6px 4px 9px;
  min-width: calc(var(--dayw) + var(--cols, 3) * (var(--notew) + 6px) + 8px);
}
/* more meals than fit: round magnet arrows on the left edge of the frame */
.wb-arrow {
  position: absolute; left: -8px; z-index: 5;
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--g-round-white); box-shadow: var(--sh-round); color: var(--ink);
}
.wb-arrow svg { width: 22px; height: 22px; stroke-width: 2.8; }
.wb-arrow.next { top: calc(50% - 52px); }
.wb-arrow.prev { top: calc(50% + 8px); }
.wb-arrow:active { transform: translateY(1px); }
.tap-hint .h-more { display: none; }
.wb.overflow + .tap-hint .h-more { display: inline; }
.wrow {
  position: relative;
  display: grid;
  grid-template-columns: var(--dayw) repeat(var(--cols, 3), minmax(0, 1fr));
  gap: 6px; align-items: stretch; min-height: 76px;
}
.wrow.whead { min-height: 30px; align-items: center; }
.wday {
  position: sticky; right: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  background: var(--board);
}
.wslot {
  display: flex; align-items: center; justify-content: center; gap: 4px; min-width: 0;
  font: 600 calc(15px * var(--ts2))/1.1 var(--hand); color: var(--marker-blue); text-align: center;
}
.wslot svg { width: 19px; height: 19px; flex: none; }
.wslot-n { overflow-wrap: anywhere; }

/* a day = a round matte magnet: neutral; Saturday light blue; today lemon with "היום"
   and a tomato marker loop around the row */
.mag {
  width: calc(50px * var(--ts2)); height: calc(50px * var(--ts2)); border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--g-round-white); box-shadow: var(--rim-on-light);
}
.mag b { font: 800 calc(14px * var(--ts2))/1 var(--font); color: var(--ink); }
.mag i { font: 700 calc(13px * var(--ts2))/1 var(--font); font-style: normal; color: var(--ink-soft); margin-top: 2px; }
.wrow.shabbat .mag { background: linear-gradient(180deg, #E4EFFF, #BFD5F2); }
.wrow.shabbat .mag b, .wrow.shabbat .mag i { color: #1D4BAA; }
.wrow.today .mag { background: var(--g-lemon); box-shadow: var(--rim-lemon); }
.wrow.today .mag b { color: var(--lemon-ink); }
.wrow.today .mag i { color: var(--lemon-sub); }
.tdy { font: 600 calc(14px * var(--ts2))/1 var(--hand); color: var(--tom); transform: rotate(-6deg); margin-bottom: 1px; }
.loop {
  position: absolute; left: -4px; top: -4px;
  width: calc(100% + 8px); height: calc(100% + 8px);
  pointer-events: none; z-index: 3; overflow: visible;
  stroke: var(--tom); opacity: 0.9;
}
.loop path { vector-effect: non-scaling-stroke; }

/* sticky notes */
.note {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 100%; max-width: 220px; min-height: 68px; justify-self: center;
  padding: 9px 5px 8px;
  text-align: center;
  font: 600 calc(15px * var(--ts2))/1.08 var(--hand); color: var(--ink); letter-spacing: -0.25px;   /* grows gently: a phone column is narrow */
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.06) 0 11px, transparent 11px), linear-gradient(180deg, var(--na, #FFF3A6), var(--nb, #FFE45C));
  border-radius: 2px;
  box-shadow: 1px 2px 3px rgba(0, 0, 0, 0.22), 0 0 0 0.5px rgba(0, 0, 0, 0.05);
  overflow-wrap: anywhere;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.note::after {
  content: ""; position: absolute; right: 0; bottom: 0;
  border-style: solid; border-width: 0 11px 11px 0;
  border-color: transparent var(--fold, var(--board)) rgba(0, 0, 0, 0.14) transparent;
}
.note .nt { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.note .gone { opacity: 0.55; }
.note.r0 { transform: rotate(1.3deg); }
.note.r1 { transform: rotate(-1.6deg); }
.note.r2 { transform: rotate(1.1deg); }
.note.r3 { transform: rotate(-0.8deg); }
button.note:active { transform: scale(0.96); }
@media (hover: hover) {
  button.note:not(.empty):hover { transform: rotate(0deg) translateY(-2px); box-shadow: 2px 6px 9px rgba(0, 0, 0, 0.24); }
}
.note.empty {
  background: transparent; box-shadow: none;
  border: 2px dashed #C7CCD4; color: #9AA1AB;
  font: 600 calc(32px * var(--ts2))/1 var(--font); transform: none; letter-spacing: 0;
}
.note.empty::after { display: none; }
@media (hover: hover) { button.note.empty:hover { border-color: #9AA1AB; color: #6B7280; background: rgba(0, 0, 0, 0.02); } }

/* ---------------- the month: a whiteboard calendar ---------------- */
.month-wb { max-width: none; }
.mgrid {
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1.5px;
  background: var(--grid-line); border-radius: 8px; overflow: hidden;
}
.mh { background: var(--board); text-align: center; font: 600 calc(14px * var(--ts))/1.1 var(--hand); color: var(--marker-blue); padding: 8px 0 6px; }
.mh .long { display: none; }
.mday {
  position: relative; min-width: 0; min-height: 78px;
  display: flex; flex-direction: column; align-items: stretch; gap: 3px;
  padding: 3px 3px 5px;
  background: var(--board); color: var(--ink); text-align: start;
}
.mday.out { background: #F2F3F5; }
.mday.out > * { opacity: 0.45; }
.mnum {
  align-self: flex-start;
  min-width: calc(26px * var(--ts2)); min-height: calc(26px * var(--ts2)); border-radius: 999px; padding: 1px 5px;
  display: inline-flex; align-items: center; justify-content: center;
  font: 700 calc(14.5px * var(--ts))/1 var(--font); font-variant-numeric: tabular-nums;
}
.mday.sat .mnum { color: #1D4BAA; }
.mday.today .mnum { background: var(--g-lemon); box-shadow: var(--rim-lemon); color: var(--lemon-ink); font-weight: 800; }
.mday.today::after {
  content: ""; position: absolute; inset: 2px;
  border: 2.5px solid var(--tom); opacity: 0.9;
  border-radius: 14px 8px 12px 6px / 8px 12px 6px 14px;
  pointer-events: none;
}
.mnote {
  display: block; min-width: 0;
  padding: 2px 3px 1px; border-radius: 1px;
  font: 500 calc(13px * var(--ts2))/1.15 var(--hand); color: var(--ink); letter-spacing: -0.3px;
  background: linear-gradient(180deg, var(--na), var(--nb));
  box-shadow: 0 1px 1.5px rgba(0, 0, 0, 0.2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transform: rotate(-1deg);
}
.mnote:nth-of-type(even) { transform: rotate(0.8deg); }
.mslot { display: none; font: 700 calc(13px * var(--ts))/1 var(--font); color: var(--ink-soft); letter-spacing: 0; }
.mmore { font: 700 calc(13px * var(--ts))/1 var(--font); color: var(--ink-soft); padding: 0 2px; }
@media (hover: hover) { .mday:hover { background: #F7F9FC; } }
.legend {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px;
  margin: 4px 0 4px; font: 600 calc(14.5px * var(--ts))/1.3 var(--font); color: var(--door-soft);
}
.legend .lg { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 18px; height: 13px; border-radius: 2px; background: linear-gradient(var(--na), var(--nb)); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.22); transform: rotate(-3deg); }

/* ---------------- shopping list: a torn notepad page ---------------- */
.padwrap { position: relative; margin: 16px 2px 8px; transform: rotate(-0.5deg); color-scheme: light; }
.padwrap .pin-mag.red { right: 22px; top: -9px; transform: none; }
.padwrap .pin-mag.blue { right: auto; left: 26px; top: -7px; transform: none; }
.pad { filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.18)); }
.torn {
  height: 9px;
  background: linear-gradient(135deg, transparent 11.3px, var(--paper) 0), linear-gradient(225deg, transparent 11.3px, var(--paper) 0);
  background-size: 16px 16px; background-repeat: repeat-x;
}
.padbody {
  background: linear-gradient(to left, transparent 0 44px, var(--margin) 44px 46px, transparent 46px), var(--paper);
  padding: 10px 0 12px; border-radius: 0 0 6px 6px; color: var(--ink);
}
.pad-hint { padding: 0 56px 6px 16px; font: 500 calc(14px * var(--ts))/1.45 var(--hand); color: var(--ink-mute); }
.sec {
  position: relative;
  display: flex; align-items: center; gap: 8px;
  padding: 12px 56px 6px 16px;
  font: 600 calc(19px * var(--ts))/1.15 var(--hand);
  border-bottom: 1px solid var(--rule);
}
.sec.need { color: var(--marker-red); }
.sec.have { color: var(--marker-green); margin-top: 8px; }
.sec small {
  font: 700 calc(13px * var(--ts))/1 var(--font); color: #fff;
  min-width: 24px; min-height: calc(22px * var(--ts)); padding: 0 7px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
}
.sec.need small { background: var(--marker-red); }
.sec.have small { background: var(--marker-green); }
.sec .ul { position: absolute; right: 52px; bottom: 1px; width: calc(100px * var(--ts)); height: 8px; }
.shop-list { list-style: none; }
.sitem {
  width: 100%; min-height: 52px;
  display: flex; align-items: center; gap: 12px;
  padding: 7px 56px 7px 14px;
  text-align: start; color: var(--ink);
  border-bottom: 1px solid var(--rule);
}
.sitem .cb { width: 28px; height: 28px; background: rgba(255, 255, 255, 0.75); }
.si-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.si-name { font: 500 calc(18px * var(--ts))/1.2 var(--hand); overflow-wrap: anywhere; }
.si-for { font: 600 calc(13px * var(--ts))/1.3 var(--font); color: var(--ink-soft); }
/* "×3" written in blue marker next to the item */
.qty {
  flex: none;
  min-width: 30px; padding: 2px 2px 0;
  font: 600 calc(16px * var(--ts))/1 var(--hand); color: var(--marker-blue); text-align: center;
  direction: ltr; unicode-bidi: isolate;
}
.sitem.done .si-name {
  color: var(--ink-mute);
  text-decoration: line-through; text-decoration-color: var(--marker-green); text-decoration-thickness: 2.5px;
}
.sitem.done .cb { border-color: #7E8590; }
.sitem.done .qty { opacity: 0.55; }
@media (hover: hover) { .sitem:hover { background: rgba(36, 86, 201, 0.04); } }
.all-done { font: 600 calc(19px * var(--ts))/1.3 var(--hand); color: var(--marker-green); padding: 10px 56px 8px 16px; }
.pad-note { padding: 10px 56px 6px 16px; font-size: calc(14.5px * var(--ts)); color: var(--ink-soft); }

/* ---------------- menus: recipe index cards ---------------- */
.menu-cards { list-style: none; margin: 4px 0 8px; }
.menu-li { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.menu-card {
  flex: 1; min-width: 0; min-height: 78px;
  display: flex; align-items: center; gap: 12px;
  padding: 16px 14px 12px;
  text-align: start; color: var(--ink);
  background: linear-gradient(180deg, var(--nb) 0 7px, transparent 7px), var(--paper);
  border-radius: 3px 3px 6px 6px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.06), 0 5px 12px rgba(60, 45, 20, 0.14);
  transform: rotate(-0.4deg);
  color-scheme: light;
}
.menu-li:nth-child(even) .menu-card { transform: rotate(0.35deg); }
.menu-card:active { transform: scale(0.99); }
.menu-cards.reorder .menu-card { transform: none; }
.menu-emoji {
  flex: none; width: calc(50px * var(--ts2)); height: calc(50px * var(--ts2)); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: calc(26px * var(--ts2)); line-height: 1;
  background: var(--g-round-white); box-shadow: var(--sh-round);
}
.menu-emoji.big { width: calc(58px * var(--ts2)); height: calc(58px * var(--ts2)); font-size: calc(30px * var(--ts2)); }
.menu-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.menu-name { font: 600 calc(20px * var(--ts))/1.2 var(--hand); overflow-wrap: anywhere; }
.menu-count { font: 600 calc(14.5px * var(--ts))/1.3 var(--font); color: var(--ink-soft); }
.order-btns { display: flex; gap: 6px; }

.back-link {
  display: inline-flex; align-items: center; gap: 4px;
  min-height: 44px; padding: 0 18px 0 14px;
  margin: calc(12px + env(safe-area-inset-top)) 0 16px;
  border-radius: 999px;
  font: 700 calc(16px * var(--ts))/1 var(--font); color: var(--ink);
  background: var(--g-white); box-shadow: var(--sh-white);
}
.back-link svg { width: 20px; height: 20px; }
.recipe {
  position: relative;
  background: linear-gradient(180deg, var(--nb) 0 8px, transparent 8px), var(--paper);
  color: var(--ink);
  border-radius: 3px 3px 8px 8px;
  padding: 20px 14px 16px;
  margin-bottom: 20px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.06), 0 6px 14px rgba(60, 45, 20, 0.14);
  color-scheme: light;
}
.menu-title-row { display: flex; align-items: center; gap: 12px; }
.menu-title { flex: 1; min-width: 0; font: 800 calc(22px * var(--ts))/1.2 var(--display); overflow-wrap: anywhere; }
.recipe-sub { font: 600 calc(14.5px * var(--ts))/1.4 var(--font); color: var(--ink-soft); margin: 10px 2px 8px; }
.dish-list { list-style: none; border-top: 1.5px solid var(--rule); }
.dish-row {
  width: 100%; min-height: 62px;
  display: flex; align-items: center; gap: 10px;
  padding: 9px 4px; text-align: start; color: var(--ink);
  border-bottom: 1.5px solid var(--rule);
}
.dish-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dish-name { font: 600 calc(19px * var(--ts))/1.2 var(--hand); overflow-wrap: anywhere; }
.dish-ingr { font: 600 calc(14px * var(--ts))/1.35 var(--font); color: var(--ink-soft); }
.dish-ingr.none { font-style: italic; }
.dish-note { font: 600 calc(13.5px * var(--ts))/1.35 var(--font); color: var(--ink-soft); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
@media (hover: hover) { .dish-row:hover { background: rgba(36, 86, 201, 0.04); } }
.recipe-empty { text-align: center; color: var(--ink-soft); padding: 22px 8px; line-height: 1.7; }
.recipe-foot .btn { margin-top: 16px; }

/* ---------------- more ---------------- */
.me-note { transform: rotate(-0.5deg); padding-top: 24px; }
.me-hello { font: 800 calc(21px * var(--ts))/1.25 var(--display); margin-bottom: 4px; overflow-wrap: anywhere; }
.code-big {
  font: 800 calc(30px * var(--ts))/1.25 var(--display); text-align: center; letter-spacing: 0; color: var(--ink);
  padding: 12px 10px; margin: 12px 0 10px;
  border: 2.5px dashed var(--marker-blue);
  border-radius: 14px 10px 16px 8px / 10px 16px 8px 14px;
  background: rgba(255, 255, 255, 0.65);
  overflow-wrap: anywhere;
  -webkit-user-select: all; user-select: all;
}
.ok-line { color: var(--marker-green); font-weight: 700; }
.install-block { margin-top: 16px; }
.install-head { font: 700 calc(17px * var(--ts))/1.3 var(--font); margin-bottom: 6px; }
.steps { list-style: none; counter-reset: s; }
.steps li { counter-increment: s; position: relative; padding: 5px calc(12px + 28px * var(--ts2)) 8px 0; line-height: 1.5; }
.steps li::before {
  content: counter(s);
  position: absolute; right: 0; top: 4px;
  width: calc(28px * var(--ts2)); height: calc(28px * var(--ts2)); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font: 800 calc(14px * var(--ts2))/1 var(--font); color: var(--member-ink);
  background: var(--g-member); box-shadow: var(--rim-on-color);
}
.share-ico { display: inline-block; border: 1.5px solid currentColor; border-radius: 5px; padding: 0 4px; font-size: calc(13px * var(--ts)); line-height: 1.3; }
.logout-help { margin-top: 8px; }

/* ---------------- sheets ---------------- */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  background: var(--overlay);
  display: flex; align-items: flex-end; justify-content: center;
}
.overlay.center { align-items: center; padding: 24px; z-index: 80; }
.sheet {
  --fold: var(--sheet);
  width: 100%; max-width: var(--maxw);
  max-height: 92vh; max-height: 92dvh;
  display: flex; flex-direction: column;
  background: var(--sheet); color: var(--ink);
  border-radius: 26px 26px 0 0;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.28);
  animation: up 220ms ease-out;
  color-scheme: light;
}
.sheet.full { height: 100vh; height: 100dvh; max-height: none; border-radius: 0; }
.sheet.picker { height: 84vh; height: min(calc(620px * var(--ts)), 88dvh); }
@keyframes up { from { transform: translateY(30px); opacity: 0.6; } to { transform: none; opacity: 1; } }
.sheet-top { flex: none; padding: 8px max(16px, env(safe-area-inset-right)) 6px max(16px, env(safe-area-inset-left)); }
.sheet.full .sheet-top { padding-top: calc(12px + env(safe-area-inset-top)); }
.sheet.full .grabber { display: none; }
.grabber { width: 44px; height: 5px; border-radius: 3px; background: #D5D7DC; margin: 0 auto 6px; }
.sheet-head { display: flex; align-items: center; gap: 10px; min-height: 56px; }
.sheet-titles { flex: 1; min-width: 0; }
.sheet-title { font: 800 calc(22px * var(--ts))/1.2 var(--font); color: var(--ink); overflow-wrap: anywhere; }
.sheet-sub { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font: 600 calc(14px * var(--ts))/1.3 var(--font); color: var(--ink-soft); margin-top: 4px; }
.x {
  flex: none; width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--g-round-white); box-shadow: var(--sh-round); color: var(--ink-soft);
}
.x svg { width: 20px; height: 20px; }
.sheet-body {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 4px max(16px, env(safe-area-inset-right)) 18px max(16px, env(safe-area-inset-left));
  scrollbar-width: thin; scrollbar-color: #D5D7DC transparent;
}
.sheet-foot {
  flex: none; display: flex; gap: 10px;
  padding: 12px max(16px, env(safe-area-inset-right)) calc(14px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: var(--sheet);
  box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.06);
}
.sheet-foot .btn { margin-top: 0; flex: 1; min-width: 0; }
.sheet-foot .btn.grow { flex: 1.3; }
.sheet-foot .btn.light { flex: 0.8; }

/* the meal picker: index-card tabs per menu, a ruled card, hand-drawn checkboxes */
.note.mini {
  flex: none; width: 88px; max-width: 88px; min-height: 60px;
  padding: 8px 4px 6px; font-size: calc(13px * var(--ts)); transform: rotate(3deg);
}
.note.mini .nt { -webkit-line-clamp: 3; }
.note.mini.empty { font-size: calc(24px * var(--ts)); }
.sel-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 2px 0 10px; }
.sel-lbl { font: 700 calc(14px * var(--ts))/1 var(--font); color: var(--ink-soft); }
.sel-chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 6px 10px 4px 8px; border-radius: 2px;
  font: 600 calc(16px * var(--ts))/1.15 var(--hand); color: var(--ink);
  background: linear-gradient(180deg, #FFF3A6, #FFE45C);
  box-shadow: 1px 2px 3px rgba(0, 0, 0, 0.2);
}
.sel-chip:nth-of-type(odd) { transform: rotate(-1deg); }
.sel-chip svg { width: 16px; height: 16px; color: var(--ink-soft); }
.ptabs {
  position: sticky; top: 0; z-index: 3;
  display: flex; gap: 5px; align-items: flex-end;
  min-height: calc(36px + 36px * var(--ts)); padding: 6px 2px 0; margin: 0 -2px;
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none;
  background: var(--sheet);
}
.ptabs::-webkit-scrollbar { display: none; }
.ptab {
  flex: 1 0 calc(74px * var(--ts2)); max-width: calc(136px * var(--ts2)); height: calc(24px + 36px * var(--ts));
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  padding: 4px 8px 2px;
  border-radius: 10px 10px 0 0;
  font: 700 calc(14px * var(--ts))/1.1 var(--font); color: var(--ink-soft); text-align: center;
  background: var(--na);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.06);
}
.ptab .te { font-size: calc(21px * var(--ts2)); line-height: 1; }
.ptab .tn { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 100%; overflow-wrap: anywhere; }
.ptab.on {
  height: calc(32px + 36px * var(--ts));
  background: linear-gradient(var(--na), var(--nb));
  color: var(--ink); font-weight: 800; font-size: calc(15px * var(--ts));
  box-shadow: 0 -3px 6px rgba(0, 0, 0, 0.10);
  position: relative; z-index: 2;
}
.pcard {
  position: relative;
  background: var(--paper);
  border-radius: 0 0 12px 12px;
  padding: 4px 8px 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12), inset 0 4px 0 var(--nb);
}
.pk-list { list-style: none; }
.pk-dish {
  width: 100%; min-height: 56px;
  display: flex; align-items: center; gap: 12px;
  padding: 7px 6px; text-align: start; color: var(--ink);
  border-bottom: 1px solid var(--rule);
}
.pk-list li:last-child .pk-dish { border-bottom: 0; }
.pk-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pk-name { font: 600 calc(19px * var(--ts))/1.25 var(--hand); color: var(--ink); overflow-wrap: anywhere; }
.hl { position: relative; z-index: 0; padding: 0 5px; margin: 0 -5px; }
.pk-dish.on .hl::before {
  content: ""; position: absolute; left: 0; right: 0; top: 3px; bottom: 1px; z-index: -1;
  background: rgba(255, 222, 70, 0.65); transform: rotate(-1deg); border-radius: 3px;
}
.pk-ingr { font: 600 calc(13px * var(--ts))/1.3 var(--font); color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (hover: hover) { .pk-dish:hover { background: rgba(36, 86, 201, 0.04); } }
.pk-empty { padding: 24px 10px; text-align: center; color: var(--ink-soft); line-height: 1.6; }
.add-form {
  margin: 8px 0 10px; padding: 2px 12px 14px;
  border-radius: 8px; background: rgba(255, 255, 255, 0.8); border: 2px dashed #A9AFB8;
}
.add-title { font: 700 calc(16px * var(--ts))/1.3 var(--font); margin-top: 10px; }
.add-form .field-label { margin-top: 10px; }

/* a day of the month */
.day-list { list-style: none; padding-top: 2px; }
.day-slot {
  width: 100%; min-height: 80px;
  display: flex; align-items: center; gap: 12px;
  padding: 8px 4px; text-align: start; color: var(--ink);
  border-bottom: 1.5px solid var(--rule);
}
.ds-name {
  flex: none; width: calc(88px * var(--ts2));
  display: flex; align-items: center; gap: 5px;
  font: 600 calc(16px * var(--ts))/1.15 var(--hand); color: var(--marker-blue); overflow-wrap: anywhere;
}
.ds-name svg { width: 20px; height: 20px; flex: none; }
.ds-note { flex: 1; min-width: 0; max-width: none; min-height: 62px; font-size: calc(17px * var(--ts)); transform: rotate(-0.8deg); }
.day-list li:nth-child(even) .ds-note { transform: rotate(0.9deg); }
.ds-note.empty { gap: 8px; font: 700 calc(17px * var(--ts))/1 var(--font); transform: none; }
.ds-note.empty .plus { font-size: calc(26px * var(--ts)); }

/* editors */
.swatches { display: grid; grid-template-columns: repeat(4, 52px); gap: 14px 18px; padding: 4px 2px; }
.swatch {
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--sw-ink);
  background: var(--sw);
  box-shadow: var(--rim-on-color);
}
@supports (background: color-mix(in srgb, red 50%, white)) {
  .swatch { background: linear-gradient(180deg, color-mix(in srgb, var(--sw) 72%, #fff), var(--sw)); }
}
.swatch.on { outline: 3px solid var(--ink); outline-offset: 3px; }
.swatch svg { width: 24px; height: 24px; }
.slot-rows, .ingr-rows { list-style: none; }
.slot-row, .ingr-row { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.slot-row .input, .ingr-row .input { flex: 1; min-width: 0; }
.slot-dot { flex: none; width: 18px; height: 22px; border-radius: 2px; background: linear-gradient(var(--na), var(--nb)); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.22); transform: rotate(-4deg); }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(calc(52px * var(--ts2)), 1fr)); gap: 10px 6px; padding: 4px 0; }
.emoji-btn {
  justify-self: center; width: calc(50px * var(--ts2)); height: calc(50px * var(--ts2)); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: calc(25px * var(--ts2)); line-height: 1;
  background: var(--g-round-white); box-shadow: var(--sh-round);
}
.emoji-btn.none { font: 700 calc(14px * var(--ts))/1 var(--font); color: var(--ink-soft); }
.emoji-btn.on { background: var(--g-member); box-shadow: var(--rim-on-color); color: var(--member-ink); outline: 3px solid var(--ink); outline-offset: 2px; }

/* download chooser */
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.choice {
  min-height: 136px; margin: 0; padding: 20px 8px 14px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  text-align: center;
}
.choice:first-child { transform: rotate(-1.2deg); }
.choice:last-child { transform: rotate(1deg); }
.choice:active:not(:disabled) { transform: scale(0.98); }
.choice:disabled { opacity: 0.55; }
.choice-emoji { font-size: calc(38px * var(--ts)); line-height: 1.1; }
.choice-name { font: 800 calc(20px * var(--ts))/1.2 var(--font); }
.choice-sub { font: 600 calc(13.5px * var(--ts))/1.3 var(--font); color: var(--ink-soft); }
.busy-line { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 20px; font-weight: 700; }
.spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 3px solid rgba(217, 74, 34, 0.22); border-top-color: var(--tom);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- the yes / no question: a note pinned to the fridge ---------------- */
.ask-card {
  position: relative;
  width: 100%; max-width: 380px;
  background: var(--paper); color: var(--ink);
  border-radius: 4px;
  padding: 26px 18px 18px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.32);
  transform: rotate(-0.6deg);
  animation: pop 180ms ease-out;
  color-scheme: light;
}
@keyframes pop { from { transform: rotate(-0.6deg) scale(0.94); opacity: 0.4; } to { transform: rotate(-0.6deg); opacity: 1; } }
.ask-text { white-space: pre-wrap; font: 700 calc(18px * var(--ts))/1.5 var(--font); overflow-wrap: anywhere; }
.ask-card .btn-row { margin-top: 6px; }

/* ---------------- toast: a sticky note held by a magnet in the board owner's colour ---------------- */
.toast {
  position: fixed; z-index: 90;
  left: 50%; transform: translateX(-50%) rotate(-0.8deg);
  bottom: calc(var(--nav-h) + 14px + env(safe-area-inset-bottom));
  width: min(calc(100vw - 28px), 460px);
  display: flex; align-items: center; gap: 10px;
  min-height: 56px; padding: 16px 12px 12px 16px;
  color: var(--ink);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.05) 0 10px, transparent 10px), linear-gradient(180deg, #FFF3A6, #FFE45C);
  border-radius: 2px;
  box-shadow: 2px 6px 16px rgba(0, 0, 0, 0.28);
  font: 700 calc(16.5px * var(--ts))/1.35 var(--font);
}
.toast::before {
  content: ""; position: absolute; top: -9px; left: 50%; margin-left: -11px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--g-member); box-shadow: var(--rim-on-color);
}
.toast #toastText { flex: 1; padding-inline-start: 4px; }
.toast.show { animation: toast-in 240ms ease-out; }
@keyframes toast-in {
  from { transform: translate(-50%, 14px) rotate(-0.8deg); opacity: 0; }
  to { transform: translate(-50%, 0) rotate(-0.8deg); opacity: 1; }
}
#toastAction {
  flex: none; min-height: 44px; padding: 0 16px; border-radius: 999px;
  background: var(--g-tom); box-shadow: var(--rim-on-color);
  color: #fff; font-weight: 800;
}
body.locked .toast { top: calc(18px + env(safe-area-inset-top)); bottom: auto; }
body.login-open .toast { bottom: calc(20px + env(safe-area-inset-bottom)); }

/* ---------------- tab bar (the active tab = a matte magnet in the board owner's colour) ---------------- */
.tabbar {
  position: fixed; bottom: 0; right: 0; left: 0; z-index: 30;
  display: flex; justify-content: space-around; align-items: flex-start;
  background: var(--bar);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: 0 -1px 0 var(--bar-line), 0 -6px 14px rgba(0, 0, 0, 0.06);
  padding: 6px max(8px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(8px, env(safe-area-inset-left));
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
}
.tabbar .tab {
  flex: 1; min-width: 0; max-width: 120px; min-height: calc(46px + 16px * var(--ts));
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 3px;
  font: 700 calc(14px * var(--ts))/1.1 var(--font); color: var(--bar-ink);
}
.tabbar .ic {
  width: 42px; height: 42px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--bar-icon); transition: background 0.15s ease;
}
.tabbar .ic svg { width: 24px; height: 24px; }
.tabbar .tab.selected { color: var(--door-ink); font-weight: 800; }
.tabbar .tab.selected .ic { color: var(--member-ink); background: var(--g-member); box-shadow: var(--rim-on-color); }
body.login-open .tabbar { display: none; }

/* ---------------- loading ---------------- */
.loading-note {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  max-width: 250px; margin: 56px auto 24px; padding: 28px 18px 22px;
  transform: rotate(-2deg);
  font: 600 calc(20px * var(--ts))/1 var(--font);
}
.ln-text { font: 600 calc(24px * var(--ts))/1.2 var(--hand); }
.loading-note .pin-mag { animation: bob 1.2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translate(50%, 3px); } }

/* ---------------- login ---------------- */
.login {
  position: fixed; inset: 0; z-index: 70;
  display: flex; overflow-y: auto;
  background-color: var(--door-b);
  background-image:
    repeating-linear-gradient(90deg, var(--door-lines) 0 1px, transparent 1px 3px),
    linear-gradient(90deg, var(--door-a) 0%, var(--door-b) 35%, var(--door-b) 65%, var(--door-c) 100%);
  padding: calc(24px + env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
}
.login-card { width: 100%; max-width: 420px; margin: auto; text-align: center; }
.login-logo { margin: 4px 0 4px; font-size: 1em; line-height: 1; }
.login-sub { font: 600 calc(17px * var(--ts))/1.45 var(--font); color: var(--door-soft); margin: 10px 0 24px; }
.big-choice {
  width: 100%; min-height: 96px; margin: 0 0 22px;
  display: flex; align-items: center; gap: 14px;
  padding: 22px 18px 16px; text-align: start;
}
.big-choice.k-y { transform: rotate(-1.2deg); }
.big-choice.k-b { transform: rotate(1deg); }
.big-choice:active { transform: scale(0.98); }
.bc-emoji { font-size: calc(36px * var(--ts)); line-height: 1; flex: none; }
.bc-text { display: flex; flex-direction: column; gap: 2px; }
.bc-title { font: 800 calc(22px * var(--ts))/1.2 var(--display); }
.bc-sub { font: 600 calc(15px * var(--ts))/1.35 var(--font); color: var(--ink-soft); }
.login-form { margin-top: 22px; text-align: start; padding: 24px 18px 16px; }
.login-label { display: block; font: 700 calc(17px * var(--ts))/1.3 var(--font); margin: 10px 2px 8px; }
.login-label + .input + .login-label { margin-top: 18px; }
.big-input { min-height: 58px; font: 700 calc(21px * var(--ts))/1.2 var(--font); text-align: center; border-radius: 14px; }
.big-input::placeholder { font-size: calc(16px * var(--ts)); font-weight: 500; }
.login-error { min-height: 1.5em; margin-top: 10px; color: #B8232A; font-weight: 700; text-align: center; }
.login-help { color: var(--ink-soft); font-size: calc(14.5px * var(--ts)); margin-top: 4px; text-align: center; line-height: 1.5; }
.login-title { font: 800 calc(25px * var(--ts))/1.25 var(--display); color: var(--door-ink); margin: 6px 0 12px; }
.code-note { max-width: 320px; margin: 18px auto 16px; padding: 28px 14px 18px; transform: rotate(-1.5deg); }
.code-note .code-big { border: 0; background: transparent; font-size: calc(34px * var(--ts)); margin: 0; padding: 4px; }
.keep-line { font: 700 calc(16px * var(--ts))/1.4 var(--font); color: var(--door-ink); margin-bottom: 8px; }

/* ================================================================== *
 * גרסה 2 (SPEC-v2): text size, sharing, reminders, day totals, hearts, copy week,
 * the family's menus and the cookbook — same fridge-door objects as everything else
 * ================================================================== */

/* ---------------- on / off switch: a magnet sliding on a track ---------------- */
.switch-row {
  width: 100%; min-height: 58px; margin: 6px 0 8px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 12px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.75); border: 2px solid var(--rule);
  text-align: start; color: var(--ink);
}
.sw-text { flex: 1; min-width: 0; font: 700 calc(16.5px * var(--ts))/1.3 var(--font); }
.switch {
  flex: none; position: relative;
  width: 58px; height: 34px; border-radius: 999px;
  background: #C9CDD4; box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.22);
  transition: background 0.15s ease;
}
.switch i {
  position: absolute; top: 3px; right: 3px;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--g-round-white); box-shadow: var(--sh-round);
  transition: right 0.15s ease;
}
.switch.on { background: var(--marker-green); }
.switch.on i { right: 27px; }

/* ---------------- text size (עוד) ---------------- */
.ts-sample {
  margin: 8px 0 12px; padding: 10px 12px;
  font: 600 calc(17px * var(--tsp, var(--ts)))/1.4 var(--font); color: var(--ink); text-align: center;
  background: #fff; border: 2px dashed var(--rule); border-radius: 12px;
  overflow-wrap: anywhere;
}
.ts-row { display: flex; align-items: center; gap: 10px; }
.ts-step {
  flex: none; width: calc(56px * var(--ts2)); height: calc(56px * var(--ts2)); border-radius: 50%;
  display: flex; align-items: baseline; justify-content: center; gap: 1px;
  padding-top: calc(12px * var(--ts2));
  background: var(--g-round-white); box-shadow: var(--sh-round); color: var(--ink);
  font: 700 calc(16px * var(--ts2))/1 var(--font);
}
.ts-step:disabled { opacity: 0.4; box-shadow: none; }
.ts-step:active:not(:disabled) { transform: translateY(1px); }
.ts-a.sm { font-size: calc(15px * var(--ts2)); }
.ts-a.lg { font-size: calc(25px * var(--ts2)); }
.ts-range {
  -webkit-appearance: none; appearance: none;
  flex: 1; min-width: 0; height: 48px; margin: 0;
  background: transparent; cursor: pointer; touch-action: pan-y;
}
.ts-range:focus { outline: none; }
.ts-range:focus-visible { outline: 3px solid var(--marker-blue); outline-offset: 2px; border-radius: 8px; }
.ts-range::-webkit-slider-runnable-track {
  height: 12px; border-radius: 6px;
  background: linear-gradient(180deg, var(--tape-a), var(--tape-b)); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25);
}
.ts-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 36px; height: 36px; margin-top: -12px; border: 0; border-radius: 50%;
  background: var(--g-member); box-shadow: var(--rim-on-color);
}
.ts-range::-moz-range-track {
  height: 12px; border-radius: 6px;
  background: linear-gradient(180deg, var(--tape-a), var(--tape-b)); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25);
}
.ts-range::-moz-range-thumb {
  width: 36px; height: 36px; border: 0; border-radius: 50%;
  background: var(--g-member); box-shadow: var(--rim-on-color);
}
.ts-foot { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; }
.ts-val { font: 800 calc(20px * var(--ts))/1.2 var(--font); color: var(--ink); }
.ts-foot .link-btn { margin-top: 0; color: var(--marker-blue); }
.rem-help { margin-top: 12px; }

/* ---------------- the week: a day's values, copy the last week ---------------- */
.wtot {
  position: sticky; right: 0; align-self: flex-start;
  margin: -2px 0 2px; padding: 0 calc(var(--dayw) + 8px) 0 6px;
  font: 700 calc(13px * var(--ts))/1.3 var(--font); color: var(--ink-soft);
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.copy-week { margin: 0 0 18px; }

/* the full totals of a day (day sheet, meal picker): a small green-dashed receipt */
.day-tot {
  margin: 4px 0 12px; padding: 8px 10px 9px;
  border: 2px dashed rgba(46, 158, 79, 0.5); border-radius: 10px;
  background: rgba(46, 158, 79, 0.07);
}
.day-tot-title { font: 800 calc(14.5px * var(--ts))/1.3 var(--font); color: #1F7D39; margin-bottom: 5px; }
.day-tot-miss { font: 600 calc(13px * var(--ts))/1.35 var(--font); color: var(--ink-soft); margin-top: 6px; }
.day-list + .day-tot { margin-top: 16px; }
.day-tot.compact { margin: 2px 0 8px; padding: 6px 10px; font: 600 calc(14px * var(--ts))/1.4 var(--font); color: var(--ink); }
.day-tot.compact .day-tot-title { display: inline; margin: 0; font-size: inherit; }
.day-tot.compact .day-tot-miss { display: inline; margin: 0; font-size: inherit; }
.nut-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.nut-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.85); border: 1.5px solid var(--rule);
  font: 600 calc(14px * var(--ts))/1.25 var(--font); color: var(--ink-soft);
}
.nut-chip b { color: var(--ink); font-weight: 800; }

/* ---------------- hearts ---------------- */
.heart { width: 24px; height: 24px; flex: none; }
.heart path { fill: none; stroke: #9AA1AB; stroke-width: 2.2; stroke-linejoin: round; }
.heart.on path { fill: var(--bc, #E0393E); stroke: rgba(0, 0, 0, 0.3); stroke-width: 1.2; }
.pk-li { display: flex; align-items: stretch; border-bottom: 1px solid var(--rule); }
.pk-li .pk-dish { flex: 1; min-width: 0; border-bottom: 0; }
.pk-list .pk-li:last-child { border-bottom: 0; }
.pk-heart {
  flex: none; width: calc(52px * var(--ts2)); min-height: 52px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
}
.pk-heart .heart { width: calc(28px * var(--ts2)); height: calc(28px * var(--ts2)); }
.pk-heart:active .heart { transform: scale(1.2); }
@media (hover: hover) { .pk-heart:hover { background: rgba(0, 0, 0, 0.04); } }
.mini-hearts { display: inline-flex; align-items: center; gap: 2px; }
.mh-one .heart { width: calc(17px * var(--ts2)); height: calc(17px * var(--ts2)); }
.dish-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 3px; font: 700 calc(14px * var(--ts))/1.3 var(--font); color: var(--ink-soft); }

/* ---------------- the dish editor's new parts ---------------- */
.ed-sec { margin-top: 26px; padding-top: 14px; border-top: 2px dashed var(--rule); }
.ed-h { font: 800 calc(18px * var(--ts))/1.3 var(--font); color: var(--ink); margin: 0 2px 6px; }
.ed-h .muted { font-weight: 500; font-size: calc(14px * var(--ts)); }
.src-line {
  margin: 6px 0 0; padding: 8px 12px; border-radius: 10px;
  background: rgba(255, 222, 70, 0.3); color: var(--ink);
  font: 600 calc(15px * var(--ts))/1.35 var(--font); overflow-wrap: anywhere;
}
.nut-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(calc(128px * var(--ts)), 1fr)); gap: 10px 12px; }
.nut-f { min-width: 0; }
.nut-l { display: block; font: 700 calc(15px * var(--ts))/1.3 var(--font); color: var(--ink); margin: 0 2px 5px; }
.nut-l .muted { font-weight: 500; font-size: calc(13px * var(--ts)); }
.nut-in { text-align: center; font-variant-numeric: tabular-nums; }
.like-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.like-chip {
  min-height: 50px; max-width: 100%;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 0 16px 0 14px; border-radius: 999px;
  background: #fff; border: 2.5px solid var(--bc, #6ba368); color: var(--ink);
  font: 700 calc(16.5px * var(--ts))/1.2 var(--font);
}
.like-chip .heart path { stroke: var(--bc, #6ba368); }
.like-chip.on {
  color: var(--bc-ink, #fff);
  background: var(--bc, #6ba368); border-color: transparent;
  box-shadow: var(--rim-on-color);
}
@supports (background: color-mix(in srgb, red 50%, white)) {
  .like-chip.on { background: linear-gradient(180deg, color-mix(in srgb, var(--bc, #6ba368) 72%, #fff), var(--bc, #6ba368)); }
}
.like-chip.on .heart path { fill: var(--bc-ink, #fff); stroke: none; }
.lc-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opt-row { display: flex; flex-wrap: wrap; gap: 8px; }
.opt-btn {
  flex: 1 1 auto; min-height: 50px; padding: 6px 14px; border-radius: 999px;
  background: var(--g-white); box-shadow: var(--sh-white); color: var(--ink);
  font: 700 calc(16px * var(--ts))/1.2 var(--font); text-align: center;
}
.opt-btn.on { color: var(--member-ink); font-weight: 800; background: var(--g-member); box-shadow: var(--rim-on-color); }
.time-in { max-width: 12em; text-align: center; }
.rem-note { margin-top: 10px; color: #8A5A00; }

/* ---------------- menus tab: שלי · של המשפחה · 📖 ספר המתכונים ---------------- */
.sec-switch {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px;
  margin: calc(12px + env(safe-area-inset-top)) 0 4px; padding: 4px; border-radius: 18px;
  background: rgba(0, 0, 0, 0.07); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.12);
}
.sec-btn {
  min-width: 0; min-height: 50px; padding: 6px 4px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font: 700 calc(15.5px * var(--ts))/1.15 var(--font); color: var(--door-soft); text-align: center;
  overflow-wrap: anywhere;
}
.sec-btn.on { background: #fff; color: var(--ink); font-weight: 800; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); }
@media (prefers-color-scheme: dark) {
  .sec-switch { background: rgba(255, 255, 255, 0.1); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3); }
  .sec-btn.on { background: #F1F2F4; color: #1F2430; }
}
.sec-switch + .page-head { padding-top: 12px; }
.sec-switch + .back-link { margin-top: 12px; }

/* the family's dishes: read-only cards on a recipe card */
.fdish-list { list-style: none; border-top: 1.5px solid var(--rule); }
.fdish { padding: 12px 4px 14px; border-bottom: 1.5px solid var(--rule); }
.fd-name { font: 600 calc(19px * var(--ts))/1.2 var(--hand); overflow-wrap: anywhere; }
.fd-src { font: 700 calc(13.5px * var(--ts))/1.35 var(--font); color: var(--ink-soft); margin-top: 2px; }
.fd-ingr { font: 600 calc(14.5px * var(--ts))/1.45 var(--font); color: var(--ink); margin: 6px 0 8px; overflow-wrap: anywhere; }
.fd-ingr.none { color: var(--ink-soft); font-style: italic; }
.fd-note { font: 600 calc(14px * var(--ts))/1.45 var(--font); color: var(--ink-soft); margin-top: 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.fd-copy { margin-top: 12px; }

/* the cookbook */
.book-add { margin-top: 4px; }
.book-search { margin: 16px 0 14px; }
.book-count, .book-none { font: 600 calc(14.5px * var(--ts))/1.4 var(--font); color: var(--door-soft); margin: 0 4px 10px; }
.book-none { text-align: center; padding: 14px 0; }
.rcards { list-style: none; }
.rcard {
  width: 100%; min-height: 76px; margin-bottom: 14px;
  display: flex; align-items: center; gap: 10px;
  padding: 16px 14px 12px;
  text-align: start; color: var(--ink);
  background: linear-gradient(180deg, var(--nb) 0 7px, transparent 7px), var(--paper);
  border-radius: 3px 3px 6px 6px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.06), 0 5px 12px rgba(60, 45, 20, 0.14);
  transform: rotate(0.3deg);
  color-scheme: light;
}
.rcards li:nth-child(even) .rcard { transform: rotate(-0.35deg); }
.rcard:active { transform: scale(0.99); }
.rc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rc-name { font: 600 calc(20px * var(--ts))/1.2 var(--hand); overflow-wrap: anywhere; }
.rc-from { font: 700 calc(15px * var(--ts))/1.3 var(--font); color: var(--ink); }
.rc-by { font: 600 calc(13.5px * var(--ts))/1.3 var(--font); color: var(--ink-soft); }
.rc-mine {
  flex: none; padding: 4px 10px; border-radius: 999px;
  font: 800 calc(13px * var(--ts))/1.2 var(--font); color: var(--member-ink);
  background: var(--g-member); box-shadow: var(--rim-on-color);
}
.rc-body .ed-h { margin-top: 16px; }
.rc-body .ed-h:first-child { margin-top: 4px; }
.rc-ingr { list-style: disc; padding-right: 24px; }
.rc-ingr li { padding: 3px 0; border-bottom: 1px solid var(--rule); overflow-wrap: anywhere; }
.rc-note { white-space: pre-wrap; line-height: 1.6; overflow-wrap: anywhere; }
.rc-own { margin-top: 20px; }

/* "לאיזה תפריט להעתיק?" */
.pick-menus { list-style: none; margin-top: 12px; }
.pick-menu {
  width: 100%; min-height: 66px; margin-bottom: 10px;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 12px 10px;
  text-align: start; color: var(--ink);
  background: linear-gradient(180deg, var(--nb) 0 6px, transparent 6px), var(--paper);
  border-radius: 3px 3px 8px 8px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.06), 0 3px 8px rgba(60, 45, 20, 0.14);
}
.pick-menu:disabled { opacity: 0.6; }
.pick-menu:active:not(:disabled) { transform: scale(0.99); }
.pm-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.pm-name { font: 600 calc(18px * var(--ts))/1.2 var(--hand); overflow-wrap: anywhere; }
.pm-count { font: 600 calc(13.5px * var(--ts))/1.3 var(--font); color: var(--ink-soft); }

/* big text on a phone: things that sat side by side may stack */
@media (max-width: 440px) {
  .btn-row { flex-wrap: wrap; }
  .btn-row .btn { flex: 1 1 calc(7em * var(--ts2)); }
}

/* ---------------- screen sizes ---------------- */
@media (max-width: 380px) {
  :root { --dayw: calc(50px * var(--ts2)); --notew: 80px; }
  .chips-lbl { display: none; }
  .mag { width: calc(46px * var(--ts2)); height: calc(46px * var(--ts2)); }
  .mag b { font-size: calc(13px * var(--ts2)); }
  .mag i { font-size: calc(13px * var(--ts2)); margin-top: 1px; }
  .note { font-size: calc(14px * var(--ts2)); padding-left: 4px; padding-right: 4px; }
  .wslot { font-size: calc(14px * var(--ts2)); }
  .logo-l { font-size: calc(20px * var(--ts2)); }
  .logo.big .logo-l { font-size: calc(30px * var(--ts2)); }
  .pill { padding: 0 13px; }
  .page-title { font-size: calc(23px * var(--ts)); }
  .code-big { font-size: calc(26px * var(--ts)); }
  .seg-btn { min-width: 50px; padding: 0 9px; }
  .paper, .card, .stick { padding-left: 13px; padding-right: 13px; }
  .paper.ruled { padding-right: 42px; }
  .swatches { gap: 12px 12px; }
}
/* four meals a day (e.g. בוקר, עשר, צהריים, ערב) still fit a phone: slimmer notes, no sideways scrolling */
@media (max-width: 440px) {
  .wb.c4 { --dayw: calc(46px * var(--ts2)); --notew: 52px; padding-left: 7px; padding-right: 7px; }
  .wb.c4 .wrow { gap: 5px; }
  .wb.c4 .wslot { flex-direction: column; gap: 1px; font-size: calc(13px * var(--ts2)); }
  .wb.c4 .wslot svg { width: 18px; height: 18px; }
  .wb.c4 .note { font-size: calc(13px * var(--ts2)); letter-spacing: -0.4px; padding: 9px 2px 7px; min-height: 64px; }   /* the slimmest notes grow gently */
  .wb.c4 .note.empty { font-size: calc(26px * var(--ts2)); }
  .wb.c4 .mag { width: calc(44px * var(--ts2)); height: calc(44px * var(--ts2)); }
  .wb.c4 .mag b { font-size: calc(13px * var(--ts2)); letter-spacing: -0.2px; }
  .wb.c4 .mag i { font-size: calc(13px * var(--ts2)); margin-top: 1px; }
  .wb.c4 .tdy { font-size: calc(13px * var(--ts2)); }
}
@media (min-width: 480px) {
  .swatches { grid-template-columns: repeat(8, 46px); gap: 12px; }
  .swatch { width: 46px; height: 46px; }
}
@media (min-width: 700px) {
  :root { --dayw: calc(66px * var(--ts2)); --notew: 110px; }
  .app-header { padding-top: calc(18px + env(safe-area-inset-top)); }
  .logo-l { font-size: calc(26px * var(--ts2)); }
  .logo.big .logo-l { font-size: calc(36px * var(--ts2)); }
  .overlay:not(.center) { align-items: center; padding: 24px; }
  .sheet, .sheet.full { border-radius: 24px; height: auto; max-height: min(88vh, 900px); }
  .sheet.picker { height: min(calc(700px * var(--ts)), 88vh); }
  .sheet.full .grabber { display: none; }
  .sheet.full .sheet-top { padding-top: 14px; }
  .sheet-foot { padding-bottom: 16px; border-radius: 0 0 24px 24px; }
  .wrow { min-height: 92px; }
  .note { max-width: 180px; min-height: 86px; font-size: calc(18px * var(--ts)); padding: 12px 8px 10px; }
  .bchips { flex: 0 1 auto; }
  .mag { width: calc(56px * var(--ts2)); height: calc(56px * var(--ts2)); }
  .mag b { font-size: calc(15px * var(--ts2)); }
  .mag i { font-size: calc(13.5px * var(--ts2)); }
  .wslot { font-size: calc(17px * var(--ts2)); }
  .tdy { font-size: calc(15px * var(--ts2)); }
  .mh { font-size: calc(16px * var(--ts)); }
  .mh .long { display: inline; }
  .mh .short { display: none; }
  .mday { min-height: 112px; padding: 6px 6px 7px; gap: 4px; }
  .mnum { font-size: calc(15.5px * var(--ts)); }
  .mnote { font-size: calc(14.5px * var(--ts)); white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .mslot { display: inline; }
}

@media (min-width: 900px) {
  /* whose board and which week share one row */
  .board-top { display: flex; align-items: center; justify-content: space-between; gap: 10px 24px; flex-wrap: wrap; margin: 6px 0 14px; }
  .board-top .boards-row, .board-top .ctrl { margin: 0; }
  .board-top .ctrl { flex: 0 1 auto; flex-wrap: nowrap; }
  .board-top .tape { flex: 0 1 calc(260px * var(--ts)); }
  .board-top .seg { margin-inline-start: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
