/* ============================================================
   "סטודיו" — מערכת העיצוב של אפליקציית הקניות (עברית RTL)
   אפור-לבן קריר, דיו שחור לכותרות ולפעולה הראשית, סגול אחד למותג.
   IBM Plex Sans Hebrew. עומק עדין בשכבות, תנועה שעונה לפעולה.
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Hebrew:wght@300;400;500;600;700&family=IBM+Plex+Mono:wght@500&display=swap');

:root {
  color-scheme: light;
  /* ---- משטחים (אפור קריר) ---- */
  --paper-0: #ffffff;
  --paper-50: #eff1f4;
  --paper-100: #e6e9ee;
  --paper-150: #dde1e7;
  --paper-200: #e2e5ea;
  --paper-300: #cdd2da;

  /* ---- דיו ---- */
  --ink-900: #0f1419;
  --ink-800: #1d242d;
  --ink-700: #3a434f;
  --ink-500: #5d6774;
  --ink-400: #858e9b;
  --ink-300: #a8afba;

  /* ---- סגול (מותג) — שמות ה"green" נשמרו כדי לא לשבור הפניות ישנות ---- */
  --green-700: #4a2fe0;
  --green-600: #5b3df5;
  --green-500: #6e55ff;
  --green-300: #b3a6ff;
  --green-100: #e9e5ff;
  --green-50: #f3f1ff;

  /* ---- צבעי חברים ---- */
  --m-teal: #12a594;
  --m-amber: #e2860f;
  --m-blue: #2f6fed;
  --m-rose: #e5487a;
  --m-violet: #7c5cff;
  --m-clay: #e0662f;

  --red-600: #d92d3a;
  --red-100: #fdecee;
  --white: #ffffff;

  /* ---- כינויים סמנטיים ---- */
  --bg-app: var(--paper-50);
  --surface-card: var(--paper-0);
  --surface-sunken: var(--paper-100);
  --surface-tint: var(--green-50);
  --surface-ink: var(--ink-900);      /* כרטיס "הסל" והכפתור הראשי */
  --on-ink: #ffffff;

  --text-strong: var(--ink-900);
  --text-body: var(--ink-800);
  --text-muted: var(--ink-500);
  --text-faint: var(--ink-400);
  --text-placeholder: var(--ink-300);

  --border-hairline: var(--paper-200);
  --border-strong: var(--paper-300);
  --border-focus: var(--green-500);

  --accent: var(--green-600);
  --accent-hover: var(--green-700);
  --accent-bright: var(--green-500);
  --accent-tint: var(--green-100);
  --on-accent: var(--white);

  --danger: var(--red-600);
  --danger-tint: var(--red-100);

  --overlay-scrim: rgba(15, 20, 25, 0.38);
  --overlay-glass: rgba(255, 255, 255, 0.72);

  /* ---- טיפוגרפיה ---- */
  --font-sans: 'IBM Plex Sans Hebrew', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  --w-light: 300;
  --w-regular: 400;
  --w-medium: 500;
  --w-semibold: 600;
  --w-bold: 700;
  --w-extrabold: 700;
  --fs-display: 40px;
  --fs-title: 28px;
  --fs-h1: 24px;
  --fs-h2: 18px;
  --fs-body: 16px;
  --fs-sm: 14px;
  --fs-xs: 12.5px;
  --fs-xxs: 11.5px;
  --ls-tight: -0.022em;
  --ls-snug: -0.012em;
  --ls-wide: 0;
  --ls-wider: 0;

  /* ---- מרווחים ---- */
  --app-max: 480px;
  --tap-min: 44px;
  --nav-h: 64px;
  --nav-gap: 12px;
  --nav-space: calc(var(--nav-h) + var(--nav-gap) + env(safe-area-inset-bottom) + 22px);

  /* ---- פינות ---- */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 13px;
  --r-lg: 18px;
  --r-xl: 22px;
  --r-2xl: 28px;
  --r-pill: 999px;

  /* ---- צללים (קרירים, בשכבות) ---- */
  --shadow-xs: 0 1px 2px rgba(15, 20, 25, 0.06);
  --shadow-sm: 0 1px 2px rgba(15, 20, 25, 0.05), 0 4px 12px -6px rgba(15, 20, 25, 0.10);
  --shadow-md: 0 1px 2px rgba(15, 20, 25, 0.05), 0 10px 24px -10px rgba(15, 20, 25, 0.16);
  --shadow-lg: 0 2px 6px rgba(15, 20, 25, 0.06), 0 22px 44px -16px rgba(15, 20, 25, 0.24);
  --shadow-xl: 0 4px 12px rgba(15, 20, 25, 0.08), 0 36px 70px -20px rgba(15, 20, 25, 0.32);
  --ring: 0 0 0 3px color-mix(in srgb, var(--accent-bright) 30%, transparent);

  /* ---- תנועה ---- */
  --dur-fast: 140ms;
  --dur-base: 220ms;
  --dur-slow: 360ms;
  --dur-celebrate: 520ms;
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ---- מצב כהה: גרפיט עמוק, סגול בהיר יותר ---- */
.theme-dark {
  color-scheme: dark;
  --paper-0: #171a20;
  --paper-50: #0c0e12;
  --paper-100: #20242c;
  --paper-150: #282d36;
  --paper-200: #252a33;
  --paper-300: #363c48;
  --ink-900: #f3f5f8;
  --ink-800: #e3e7ed;
  --ink-700: #c3c9d2;
  --ink-500: #959eab;
  --ink-400: #737c89;
  --ink-300: #555d69;
  --green-700: #a596ff;
  --green-600: #8b78ff;
  --green-500: #9d8cff;
  --green-300: #b8adff;
  --green-100: #272150;
  --green-50: #1b1838;
  --red-600: #ff6b74;
  --red-100: #3a1d22;
  --surface-ink: #f3f5f8;
  --on-ink: #0f1419;
  --overlay-scrim: rgba(0, 0, 0, 0.6);
  --overlay-glass: rgba(23, 26, 32, 0.72);
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 8px 22px -10px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 20px 44px -16px rgba(0, 0, 0, 0.8);
  --shadow-xl: 0 32px 70px -20px rgba(0, 0, 0, 0.85);
}

@keyframes stocked-enter {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes stocked-check {
  from { transform: scale(0.6); opacity: 0; }
  60% { transform: scale(1.08); opacity: 1; }
  to { transform: scale(1); opacity: 1; }
}
@keyframes stocked-shimmer {
  from { background-position: -160% 0; }
  to { background-position: 260% 0; }
}
@media (prefers-reduced-motion: reduce) {
  :root { --dur-fast: 0ms; --dur-base: 0ms; --dur-slow: 0ms; --dur-celebrate: 0ms; }
}

/* ============================================================ Base */
*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html { text-size-adjust: 100%; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  /* ביטול דאבל-טאפ-לזום (manipulation) */
  touch-action: manipulation;
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.5;
  color: var(--text-body);
  background: var(--bg-app);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100dvh;
}
h1, h2, h3, p { margin: 0; }
button { font-family: inherit; cursor: pointer; }
input, select { font-family: inherit; }
::selection { background: var(--accent-tint); color: var(--text-strong); }
:focus-visible { outline: none; box-shadow: var(--ring); }
.hidden { display: none !important; }
.tabular { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); }

/* ============================================================ App shell */
.app {
  max-width: var(--app-max);
  margin: 0 auto;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden; /* רק תוכן המסך גולל — הכותרת והניווט נעולים */
}
.screen {
  flex: 1;
  min-height: 0; /* מאפשר לילד הגולל להתכווץ בתוך ה-flex */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-bottom: 24px;
}
.pad { padding-inline: 20px; }
.fade { animation: stocked-enter var(--dur-slow) var(--ease-out); }

/* ============================================================ Header */
.app-header {
  flex: none; /* נעול בראש — לא גולל */
  z-index: 20;
  background: color-mix(in srgb, var(--bg-app) 86%, transparent);
  padding: calc(env(safe-area-inset-top) + 18px) 20px 14px;
  border-bottom: 1px solid var(--border-hairline);
}
.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.eyebrow {
  font-size: var(--fs-xs);
  font-weight: var(--w-semibold);
  letter-spacing: var(--ls-wide);
  color: var(--text-faint);
}
.greeting {
  font-size: 26px;
  font-weight: var(--w-extrabold);
  letter-spacing: var(--ls-tight);
  color: var(--text-strong);
  margin-top: 2px;
}
.greeting-status {
  font-size: var(--fs-sm);
  font-weight: var(--w-medium);
  color: var(--text-muted);
  margin-top: 3px;
  min-height: 1.1em;
}
.greeting-status b { color: var(--accent); font-weight: var(--w-bold); }
.synced {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--surface-tint);
  border-radius: var(--r-pill);
  flex: none;
}
.synced .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}
.synced.offline { background: var(--danger-tint); }
.synced.offline .dot { background: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 22%, transparent); }
.synced span { font-size: 12px; font-weight: var(--w-semibold); color: var(--accent); }
.synced.offline span { color: var(--danger); }

.header-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.user-chip {
  width: 40px; height: 40px; padding: 0;
  border: none; background: transparent;
  border-radius: var(--r-pill);
  display: grid; place-items: center;
}
.user-chip .avatar { box-shadow: 0 0 0 2px var(--surface-card), 0 0 0 3px var(--border-hairline); }
.auth-toggle {
  margin-top: 16px;
  border: none; background: transparent;
  color: var(--accent); font-weight: var(--w-semibold); font-size: 14px;
}
.share-box {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--surface-tint);
  border-radius: var(--r-md);
}
.share-label { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.share-row { display: flex; align-items: center; gap: 10px; }
.share-code {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 22px; font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--accent);
  text-align: center;
}
.share-btn { height: 40px; }

/* ---- Avatar ---- */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-pill);
  font-weight: var(--w-bold);
  letter-spacing: -0.01em;
  flex: none;
}

/* ---- Member chip ---- */
.mchip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-hairline);
  background: transparent;
  color: var(--text-muted);
  font-weight: var(--w-semibold);
  font-size: 14.5px;
  transition: all var(--dur-fast) var(--ease-standard);
}
.mchip.active {
  border-color: transparent;
  background: var(--surface-card);
  box-shadow: var(--shadow-sm);
  color: var(--text-strong);
  padding-inline-start: 6px;
}
.mchip-add {
  width: 38px; height: 38px; padding: 0;
  display: inline-grid; place-items: center;
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--text-faint);
}

/* ============================================================ Lists bar */
.lists-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 14px 20px 2px;
  scrollbar-width: none;
}
.lists-bar::-webkit-scrollbar { display: none; }
.list-tab {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 15px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-hairline);
  background: var(--surface-card);
  color: var(--text-muted);
  font-weight: var(--w-semibold);
  font-size: 14px;
  white-space: nowrap;
  box-shadow: var(--shadow-xs);
}
.list-tab.active {
  background: var(--accent);
  border-color: transparent;
  color: var(--on-accent);
  box-shadow: var(--shadow-sm);
}
.list-tab-add {
  flex: none;
  width: 36px; height: 36px;
  border-radius: var(--r-pill);
  border: 1px dashed var(--border-strong);
  background: transparent;
  color: var(--text-faint);
  display: grid; place-items: center;
}

/* ============================================================ Quick add */
.quick-add {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding-inline-start: 16px;
  padding-inline-end: 8px;
  background: var(--surface-card);
  border: 1px solid var(--border-hairline);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
  margin-top: 12px;
}
.quick-add:focus-within {
  border-color: var(--border-focus);
  box-shadow: var(--ring);
}
.quick-add .lead { color: var(--text-faint); display: flex; transition: color var(--dur-fast); }
.quick-add:focus-within .lead { color: var(--accent); }
.quick-add input {
  flex: 1; min-width: 0;
  border: none; outline: none; background: transparent;
  font-size: 17px; font-weight: var(--w-medium);
  color: var(--text-strong);
}
.quick-add input::placeholder { color: var(--text-placeholder); font-weight: var(--w-regular); }
.qa-submit {
  flex: none;
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border: none; border-radius: var(--r-md);
  background: var(--surface-sunken);
  color: var(--text-placeholder);
  transition: background var(--dur-base) var(--ease-standard), color var(--dur-base), transform var(--dur-fast);
}
.quick-add.has-text .qa-submit { background: var(--accent); color: var(--on-accent); }
.qa-submit:active { transform: scale(0.92); }
.qa-mic {
  flex: none; width: 40px; height: 40px;
  display: grid; place-items: center;
  border: none; border-radius: var(--r-pill);
  background: transparent; color: var(--text-faint);
  transition: color var(--dur-fast), background var(--dur-fast);
}
.qa-mic.listening { color: var(--on-accent); background: var(--accent); animation: mic-pulse 1.2s ease-in-out infinite; }
@keyframes mic-pulse { 0%,100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); } 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent) 0%, transparent); } }

/* ---- suggestion chips ---- */
.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.suggestions:empty { display: none; }
.sugg-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding-inline: 13px 10px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-hairline);
  background: var(--surface-card);
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: var(--w-semibold);
}
.sugg-chip .ic { color: var(--accent); display: flex; }

/* ============================================================ Section header */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
  margin: 0 0 10px;
}
.section-head .sh-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: transparent;
  padding: 0;
}
.sh-title {
  font-size: var(--fs-sm);
  font-weight: var(--w-bold);
  letter-spacing: var(--ls-wide);
  color: var(--text-muted);
}
.sh-chevron { color: var(--text-faint); display: flex; transition: transform var(--dur-base) var(--ease-standard); }
.sh-btn.collapsed .sh-chevron { transform: rotate(90deg); }
.count-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 1px 7px;
  border-radius: var(--r-pill);
  background: var(--surface-sunken);
  color: var(--text-muted);
  font-size: 11.5px; font-weight: var(--w-semibold);
  font-variant-numeric: tabular-nums;
}

.section { margin-top: 18px; }

/* ---- category sub-label inside "to buy" ---- */
.cat-sub {
  margin: 12px 4px 5px;
  font-size: var(--fs-xs);
  font-weight: var(--w-bold);
  letter-spacing: var(--ls-wide);
  color: var(--text-faint);
}
.cat-group:first-child .cat-sub { margin-top: 2px; }

.items { display: flex; flex-direction: column; gap: 6px; }

/* ============================================================ List item */
.item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  background: var(--surface-card);
  border: 1px solid var(--border-hairline);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--dur-base), transform var(--dur-base);
}
.item.fresh { animation: stocked-enter var(--dur-slow) var(--ease-out); }
.item.done { opacity: 0.92; }
.item { touch-action: pan-y; }
.item.swipe-armed { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent); }
.qty-wrap { display: flex; align-items: center; gap: 5px; flex: none; }

#screen-list.no-lists-mode .pad > *:not(#noLists) { display: none !important; }

/* complete button */
.complete {
  flex: none;
  width: 24px; height: 24px;
  border-radius: var(--r-pill);
  border: 2px solid var(--border-strong);
  background: transparent;
  display: grid; place-items: center;
  padding: 0;
  transition: background var(--dur-base) var(--ease-standard), border-color var(--dur-base), transform var(--dur-fast);
}
.complete:active { transform: scale(0.9); }
.item.done .complete { border-color: var(--accent); background: var(--accent); }
.complete .chk { color: var(--on-accent); display: grid; place-items: center; opacity: 0; transform: scale(0.5); transition: opacity var(--dur-fast), transform var(--dur-fast); }
.item.done .complete .chk { opacity: 1; transform: scale(1); animation: stocked-check var(--dur-celebrate) var(--ease-spring); }

.item-main { flex: 1; min-width: 0; cursor: pointer; }
.item-name {
  font-size: var(--fs-body);
  font-weight: var(--w-semibold);
  letter-spacing: -0.006em;
  color: var(--text-strong);
  word-break: break-word;
  transition: color var(--dur-base);
}
.item.done .item-name {
  color: var(--text-faint);
  text-decoration: line-through;
  text-decoration-color: var(--text-placeholder);
}
.item-note { font-size: 13px; color: var(--text-muted); margin-top: 0; word-break: break-word; }
.item-deal { display: flex; align-items: flex-start; gap: 5px; margin-top: 3px; font-size: 12px; font-weight: var(--w-semibold); color: var(--accent); }
.item-deal > svg { margin-top: 2px; flex: none; }
.item-deal > span { min-width: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item-meta {
  display: flex; align-items: center; gap: 6px;
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}
.item-meta .who {
  display: inline-flex; align-items: center; gap: 5px;
  font-weight: var(--w-semibold); color: var(--text-muted);
}
.item-meta .who-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.item-meta .sep { opacity: 0.5; }

/* qty stepper */
.qty {
  flex: none;
  display: inline-flex; align-items: center; gap: 2px;
  background: var(--surface-sunken);
  border-radius: var(--r-pill);
  padding: 2px;
}
.qty button {
  width: 22px; height: 22px;
  border: none; background: transparent;
  color: var(--accent);
  font-size: 15px; font-weight: var(--w-bold);
  border-radius: 50%;
  display: grid; place-items: center; line-height: 1;
}
.qty button:active { background: var(--border-hairline); }
.qty .qv { min-width: 16px; text-align: center; font-weight: var(--w-bold); font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--text-strong); }

.del {
  flex: none;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border: none; border-radius: var(--r-pill);
  background: transparent;
  color: var(--text-faint);
  transition: color var(--dur-fast);
}
.del:hover { color: var(--danger); }

/* ============================================================ Empty state */
.empty {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 48px 24px;
}
.empty .disc {
  display: grid; place-items: center;
  width: 64px; height: 64px;
  border-radius: var(--r-2xl);
  background: var(--surface-tint);
  color: var(--accent);
  margin-bottom: 18px;
}
.empty .et { font-size: var(--fs-h1); font-weight: var(--w-bold); letter-spacing: var(--ls-snug); color: var(--text-strong); }
.empty .eh { font-size: var(--fs-sm); color: var(--text-muted); margin-top: 6px; max-width: 280px; }

/* clear button (ghost) */
.ghost-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 12px;
  border: none; background: transparent;
  color: var(--text-muted);
  font-weight: var(--w-semibold); font-size: 13.5px;
  border-radius: var(--r-sm);
}
.ghost-btn:hover { color: var(--danger); }
.ghost-btn.accent { color: var(--accent); }
.ghost-btn.accent:hover { color: var(--accent-hover); }

/* ---- restock prompt (פריט חוזר) ---- */
.restock {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--surface-tint);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-radius: var(--r-lg);
  animation: stocked-enter var(--dur-slow) var(--ease-out);
}
.restock:empty { display: none; }
.restock .rk-ic {
  width: 38px; height: 38px; flex: none;
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--accent) 16%, var(--surface-card));
  color: var(--accent);
  display: grid; place-items: center;
}
.restock .rk-body { flex: 1; min-width: 0; }
.restock .rk-title { font-size: 15px; font-weight: var(--w-bold); color: var(--text-strong); }
.restock .rk-title b { color: var(--accent); }
.restock .rk-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 1px; }
.restock .rk-add {
  flex: none;
  height: 36px; padding: 0 16px;
  border: none; border-radius: var(--r-pill);
  background: var(--accent); color: var(--on-accent);
  font-weight: var(--w-bold); font-size: 14px;
  display: inline-flex; align-items: center; gap: 6px;
  transition: transform var(--dur-fast);
}
.restock .rk-add:active { transform: scale(0.96); }
.restock .rk-dismiss {
  flex: none;
  width: 32px; height: 32px;
  border: none; background: transparent;
  color: var(--text-faint);
  border-radius: var(--r-pill);
  display: grid; place-items: center;
}
.restock .rk-dismiss:hover { color: var(--text-muted); }

/* ============================================================ Bottom nav */
.bottom-nav {
  flex: none; /* נעול בתחתית — חלק מהפריסה, לא position:fixed */
  z-index: 30;
  display: flex;
  border-top: 1px solid var(--border-hairline);
  background: var(--surface-card);
  padding: 8px 12px calc(env(safe-area-inset-bottom) + 14px);
}
.nav-item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  border: none; background: transparent;
  color: var(--text-faint);
  padding: 6px 0;
  transition: color var(--dur-base);
}
.nav-item.active { color: var(--accent); }
.nav-item .nav-ic { position: relative; display: flex; }
.nav-item .nav-label { font-size: 11px; font-weight: var(--w-medium); }
.nav-item.active .nav-label { font-weight: var(--w-bold); }
.nav-badge {
  position: absolute; top: -4px; inset-inline-end: -8px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: var(--r-pill);
  background: var(--accent); color: #fff;
  font-size: 10px; font-weight: var(--w-bold);
  display: grid; place-items: center;
  font-variant-numeric: tabular-nums;
}

/* ============================================================ Activity */
.screen-title {
  font-size: var(--fs-h1);
  font-weight: var(--w-bold);
  letter-spacing: var(--ls-tight);
  color: var(--text-strong);
}
.screen-sub { font-size: var(--fs-sm); color: var(--text-muted); margin-top: 4px; margin-bottom: 18px; }
.card-group {
  background: var(--surface-card);
  border: 1px solid var(--border-hairline);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: 4px 14px;
}
.activity-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 0;
}
.activity-row + .activity-row { border-top: 1px solid var(--border-hairline); }
.activity-text { flex: 1; min-width: 0; font-size: var(--fs-sm); line-height: 1.35; color: var(--text-body); }
.activity-text b { font-weight: var(--w-bold); color: var(--text-strong); }
.activity-text .verb { color: var(--text-muted); }
.activity-time { font-size: var(--fs-xs); color: var(--text-faint); font-variant-numeric: tabular-nums; flex: none; }

/* ============================================================ Settings */
.settings-card {
  background: var(--surface-card);
  border: 1px solid var(--border-hairline);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.set-row {
  width: 100%;
  display: flex; align-items: center; gap: 13px;
  padding: 14px;
  border: none; background: transparent;
  text-align: start;
}
.set-row + .set-row { border-top: 1px solid var(--border-hairline); }
.set-ic {
  width: 36px; height: 36px; flex: none;
  border-radius: var(--r-sm);
  background: var(--surface-sunken);
  display: grid; place-items: center;
  color: var(--text-muted);
}
.set-body { flex: 1; min-width: 0; }
.set-title { font-size: 15px; font-weight: var(--w-semibold); color: var(--text-strong); }
.set-sub { font-size: 12.5px; color: var(--text-faint); margin-top: 1px; }
.household-head {
  display: flex; align-items: center; gap: 13px; padding: 16px 14px;
  border-bottom: 1px solid var(--border-hairline);
}
.household-tile {
  width: 44px; height: 44px; flex: none;
  border-radius: var(--r-md);
  background: var(--accent);
  display: grid; place-items: center; color: #fff;
}
.member-strip { display: flex; align-items: center; gap: 8px; padding: 12px 14px; flex-wrap: wrap; }

/* toggle switch */
.switch {
  flex: none;
  width: 46px; height: 28px;
  border-radius: 999px;
  border: none;
  background: var(--paper-300);
  position: relative;
  transition: background var(--dur-base);
}
.switch.on { background: var(--accent); }
.switch .knob {
  position: absolute; top: 3px;
  inset-inline-start: 3px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: inset-inline-start var(--dur-base) var(--ease-standard);
}
.switch.on .knob { inset-inline-start: 21px; }

.version { text-align: center; margin-top: 20px; font-size: 12px; color: var(--text-faint); font-family: var(--font-mono); }

/* ============================================================ Dialog / sheet */
dialog.sheet {
  border: none;
  padding: 0;
  background: var(--surface-card);
  color: var(--text-body);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xl);
  max-width: 380px;
  width: calc(100% - 32px);
  margin: auto;
}
dialog.sheet::backdrop { background: var(--overlay-scrim); backdrop-filter: blur(2px); }
.sheet-form { padding: 22px; }
.sheet-form h3 { font-size: var(--fs-h2); font-weight: var(--w-bold); color: var(--text-strong); margin-bottom: 16px; }
.field-label { display: block; font-size: var(--fs-xs); font-weight: var(--w-semibold); color: var(--text-muted); margin: 14px 0 6px; }
.field {
  width: 100%;
  height: 50px;
  border: 1px solid var(--border-hairline);
  background: var(--surface-card);
  color: var(--text-strong);
  border-radius: var(--r-md);
  padding: 0 14px;
  font-size: 16px; font-weight: var(--w-medium);
  box-shadow: var(--shadow-xs);
}
.field:focus { outline: none; border-color: var(--border-focus); box-shadow: var(--ring); }
select.field { appearance: none; }
.sheet-actions { display: flex; align-items: center; gap: 8px; margin-top: 20px; }
.sheet-actions .spacer { flex: 1; }
.btn {
  height: 44px; padding: 0 18px;
  border: none; border-radius: var(--r-md);
  font-weight: var(--w-semibold); font-size: 15px;
  display: inline-flex; align-items: center; gap: 7px;
  transition: transform var(--dur-fast);
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow-xs); }
.btn-secondary { background: var(--surface-card); color: var(--text-strong); border: 1px solid var(--border-strong); }
.receipt-actions { flex-wrap: wrap; gap: 8px; }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-danger { background: var(--danger-tint); color: var(--danger); }

/* emoji picker (list dialog) */
.emoji-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.emoji-opt {
  width: 40px; height: 40px;
  border: 1px solid var(--border-hairline);
  background: var(--surface-card);
  border-radius: var(--r-md);
  font-size: 20px;
}
.emoji-opt.active { border-color: var(--accent); background: var(--surface-tint); }

/* ============================================================ Quantity + favorites + search + install */
.qty-row { display: flex; gap: 8px; }
.qty-unit { font-size: 11px; color: var(--text-muted); font-weight: var(--w-semibold); margin-inline-start: 5px; }
.fav-btn {
  width: 100%; margin-top: 16px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; border-radius: var(--r-md);
  border: 1px solid var(--border-hairline); background: var(--surface-tint);
  color: var(--accent); font-weight: var(--w-semibold); font-size: 14.5px;
}
.fav-btn.is-fav { background: var(--surface-sunken); color: var(--text-muted); }
.favorites { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; align-items: center; }
.favorites:empty { display: none; }
.fav-label { font-size: 12px; font-weight: var(--w-bold); letter-spacing: var(--ls-wide); color: var(--text-faint); width: 100%; margin-bottom: -2px; }
.fav-chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding-inline: 13px 11px;
  border-radius: var(--r-pill);
  border: 1px solid color-mix(in srgb, var(--accent) 24%, transparent);
  background: var(--surface-tint); color: var(--accent);
  font-size: 13.5px; font-weight: var(--w-semibold);
}
.fav-chip .star { display: flex; }
.search-wrap {
  display: flex; align-items: center; gap: 10px;
  height: 42px; padding: 0 14px; margin-top: 12px;
  background: var(--surface-card);
  border: 1px solid var(--border-hairline);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-xs);
}
.search-wrap:focus-within { border-color: var(--border-focus); box-shadow: var(--ring); }
.search-ic { color: var(--text-faint); display: flex; }
.search-wrap input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; font-size: 15px; font-family: inherit; color: var(--text-strong); }
.search-wrap input::placeholder { color: var(--text-placeholder); }
.search-clear { border: none; background: transparent; color: var(--text-faint); display: grid; place-items: center; width: 28px; height: 28px; border-radius: var(--r-pill); }
.add-tools { display: flex; gap: 0 16px; flex-wrap: wrap; }
.bulk-trigger { display: inline-flex; align-items: center; gap: 7px; margin-top: 12px; border: none; background: transparent; color: var(--accent); font-weight: var(--w-semibold); font-size: 13.5px; padding: 4px 2px; }
/* רשימה שבועית */
.weekly { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 13px 14px; background: var(--accent); border-radius: var(--r-lg); animation: stocked-enter var(--dur-slow) var(--ease-out); }
.weekly:empty { display: none; }
.weekly .wk-ic { width: 40px; height: 40px; flex: none; border-radius: var(--r-md); background: color-mix(in srgb, #fff 18%, transparent); color: #fff; display: grid; place-items: center; }
.weekly .wk-body { flex: 1; min-width: 0; color: #fff; }
.weekly .wk-title { font-size: 15px; font-weight: var(--w-bold); }
.weekly .wk-sub { font-size: 12.5px; opacity: 0.85; margin-top: 1px; }
.weekly .wk-add { flex: none; height: 38px; padding: 0 16px; border: none; border-radius: var(--r-pill); background: #fff; color: var(--accent); font-weight: var(--w-bold); font-size: 14px; }
.weekly .wk-x { flex: none; width: 32px; height: 32px; border: none; background: transparent; color: #fff; opacity: 0.8; border-radius: var(--r-pill); display: grid; place-items: center; }
/* רשימת קבלה */
.receipt-list { display: flex; flex-direction: column; gap: 4px; max-height: 46vh; overflow-y: auto; }
.receipt-row { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: var(--r-md); background: var(--surface-sunken); }
.receipt-row.off { opacity: 0.45; }
.receipt-row .rc-check { width: 24px; height: 24px; flex: none; border-radius: var(--r-pill); border: 2px solid var(--border-strong); display: grid; place-items: center; color: var(--on-accent); }
.receipt-row.on .rc-check { background: var(--accent); border-color: var(--accent); }
.receipt-row .rc-name { flex: 1; font-weight: var(--w-semibold); font-size: 14.5px; color: var(--text-strong); }
.bulk-trigger span { display: flex; }
.bulk-hint { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
.bulk-text { height: auto; min-height: 150px; padding: 12px 14px; line-height: 1.6; resize: vertical; font-family: inherit; }
.weekly-options { display: flex; flex-direction: column; gap: 6px; max-height: 52vh; overflow-y: auto; }
.weekly-opt { display: flex; align-items: center; gap: 11px; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface-sunken); border: 1.5px solid transparent; font-weight: var(--w-semibold); font-size: 15px; color: var(--text-strong); }
.weekly-opt.sel { border-color: var(--accent); background: var(--surface-tint); color: var(--accent); }
.weekly-opt .wo-dot { width: 18px; height: 18px; flex: none; border-radius: 50%; border: 2px solid var(--border-strong); display: grid; place-items: center; }
.weekly-opt.sel .wo-dot { border-color: var(--accent); }
.weekly-opt.sel .wo-dot::after { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.cat-order-list { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow-y: auto; }
.cat-order-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--surface-sunken); border-radius: var(--r-md); }
.cat-order-row .co-name { flex: 1; font-weight: var(--w-semibold); font-size: 14.5px; color: var(--text-strong); }
.cat-order-row .co-btn { width: 32px; height: 32px; border: none; background: var(--surface-card); border-radius: var(--r-sm); display: grid; place-items: center; color: var(--text-muted); box-shadow: var(--shadow-xs); }
.cat-order-row .co-btn:disabled { opacity: 0.3; }
.no-lists { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 40px 24px; margin-top: 8px; }
.no-lists .disc { display: grid; place-items: center; width: 64px; height: 64px; border-radius: var(--r-2xl); background: var(--surface-tint); color: var(--accent); margin-bottom: 18px; }
.no-lists .et { font-size: var(--fs-h1); font-weight: var(--w-bold); color: var(--text-strong); }
.no-lists .eh { font-size: var(--fs-sm); color: var(--text-muted); margin-top: 6px; max-width: 280px; margin-bottom: 20px; }
.no-lists .actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.install-hint { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 12px 14px; background: var(--surface-card); border: 1px solid var(--border-hairline); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.install-hint .ih-ic { width: 40px; height: 40px; flex: none; border-radius: var(--r-md); background: var(--surface-tint); color: var(--accent); display: grid; place-items: center; }
.install-hint .ih-body { flex: 1; min-width: 0; }
.install-hint .ih-title { font-size: 14.5px; font-weight: var(--w-bold); color: var(--text-strong); }
.install-hint .ih-sub { font-size: 12.5px; color: var(--text-muted); margin-top: 1px; }
.install-hint .ih-btn { flex: none; height: 36px; padding: 0 14px; border: none; border-radius: var(--r-pill); background: var(--accent); color: var(--on-accent); font-weight: var(--w-bold); font-size: 13.5px; }
.install-hint .ih-x { flex: none; width: 30px; height: 30px; border: none; background: transparent; color: var(--text-faint); border-radius: var(--r-pill); display: grid; place-items: center; }

/* ============================================================ Shopping mode */
.shop-mode { position: fixed; inset: 0; z-index: 200; background: var(--bg-app); display: flex; flex-direction: column; }
.shop-head { display: flex; align-items: center; gap: 14px; padding: calc(env(safe-area-inset-top) + 16px) 20px 16px; border-bottom: 1px solid var(--border-hairline); }
.shop-close { width: 40px; height: 40px; flex: none; border: none; background: var(--surface-sunken); border-radius: var(--r-pill); display: grid; place-items: center; color: var(--text-muted); }
.shop-title-t { font-size: var(--fs-h1); font-weight: var(--w-extrabold); color: var(--text-strong); letter-spacing: var(--ls-tight); }
.shop-progress { font-size: var(--fs-sm); color: var(--text-muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.shop-list { flex: 1; overflow-y: auto; padding: 12px 16px calc(env(safe-area-inset-bottom) + 40px); max-width: var(--app-max); width: 100%; margin: 0 auto; }
.shop-cat { font-size: var(--fs-xs); font-weight: var(--w-bold); letter-spacing: var(--ls-wide); color: var(--text-faint); margin: 18px 4px 8px; }
.shop-cat:first-child { margin-top: 4px; }
.shop-item { width: 100%; text-align: start; display: flex; align-items: center; gap: 16px; padding: 18px; background: var(--surface-card); border: 1px solid var(--border-hairline); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); margin-bottom: 10px; transition: opacity .25s, transform .25s; }
.shop-item:active { transform: scale(0.99); }
.shop-check { width: 34px; height: 34px; flex: none; border-radius: var(--r-pill); border: 2.5px solid var(--border-strong); display: grid; place-items: center; color: var(--on-accent); }
.shop-item-name { flex: 1; font-size: 19px; font-weight: var(--w-bold); color: var(--text-strong); }
.shop-item-qty { font-size: 14px; color: var(--text-muted); font-weight: var(--w-semibold); font-variant-numeric: tabular-nums; }
.shop-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px; }
.shop-empty .disc { display: grid; place-items: center; width: 72px; height: 72px; border-radius: var(--r-2xl); background: var(--surface-tint); color: var(--accent); margin-bottom: 18px; }
.shop-empty .et { font-size: var(--fs-title); font-weight: var(--w-extrabold); color: var(--text-strong); letter-spacing: var(--ls-tight); }

/* ============================================================ Toast */
.toast {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom) + 92px);
  z-index: 50;
  display: inline-flex; align-items: center; gap: 12px;
  padding: 10px 18px;
  background: var(--ink-900);
  color: var(--paper-50);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-lg);
  font-size: var(--fs-sm); font-weight: var(--w-medium);
  animation: stocked-enter var(--dur-slow) var(--ease-out);
  max-width: calc(var(--app-max) - 32px);
}
.theme-dark .toast { background: var(--paper-300); color: var(--ink-900); }
.toast.with-action { padding-inline-end: 8px; }
.toast-undo {
  display: inline-flex; align-items: center; gap: 5px;
  border: none;
  background: color-mix(in srgb, var(--paper-50) 16%, transparent);
  color: var(--green-300);
  font-weight: var(--w-bold); font-size: var(--fs-sm);
  padding: 7px 13px; border-radius: var(--r-pill);
}

/* ============================================================ DB banner */
.db-banner {
  background: var(--danger-tint);
  color: var(--danger);
  font-size: var(--fs-sm);
  font-weight: var(--w-medium);
  line-height: 1.45;
  padding: 12px 16px;
  text-align: center;
}
.db-banner code { background: color-mix(in srgb, var(--danger) 14%, transparent); padding: 1px 5px; border-radius: 5px; font-family: var(--font-mono); font-size: 12px; }

/* ============================================================ Login */
.login-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--accent);
  /* גלילה + margin:auto (ולא place-items:center) — כשהמקלדת פתוחה הכרטיס לא נחתך מלמעלה */
  display: flex; flex-direction: column; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: max(24px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
}
.login-overlay > .login-card { margin: auto; flex-shrink: 0; }
.login-card {
  background: var(--surface-card);
  border-radius: var(--r-2xl);
  padding: 36px 28px;
  width: 100%; max-width: 340px;
  text-align: center;
  box-shadow: var(--shadow-xl);
}
.login-disc {
  width: 64px; height: 64px; margin: 0 auto 14px;
  border-radius: var(--r-xl);
  background: var(--surface-tint); color: var(--accent);
  display: grid; place-items: center;
}
.login-card h2 { font-size: var(--fs-title); font-weight: var(--w-extrabold); letter-spacing: var(--ls-tight); color: var(--text-strong); }
.login-sub { color: var(--text-muted); margin: 4px 0 20px; font-size: var(--fs-sm); }
.login-card .field { text-align: center; margin-bottom: 12px; height: 52px; }
.login-error { color: var(--danger); font-size: 13px; margin-top: 10px; }

/* skeleton */
.skeleton {
  background: linear-gradient(100deg, var(--paper-100) 30%, var(--paper-150) 50%, var(--paper-100) 70%);
  background-size: 220% 100%;
  animation: stocked-shimmer 1.5s ease-in-out infinite;
  border-radius: var(--r-sm);
}
.sk-item { height: 70px; border-radius: var(--r-lg); }

/* ============================================================ גיליונות / מטלות */
.sheet-switch {
  display: flex; gap: 6px; margin-top: 14px;
  background: var(--surface-tint); padding: 4px; border-radius: var(--r-pill);
}
.sheet-tab {
  flex: 1; border: none; background: transparent; cursor: pointer;
  padding: 8px 10px; border-radius: var(--r-pill);
  font-family: inherit; font-size: var(--fs-sm); font-weight: var(--w-bold);
  color: var(--text-muted); transition: background var(--dur-base), color var(--dur-base);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.sheet-tab.active { background: var(--surface-card); color: var(--accent); box-shadow: var(--shadow-sm); }
.sheet-ic { display: inline-flex; align-items: center; }

.task-opts { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.task-chip {
  border: 1px solid var(--border-hairline); background: var(--surface-card);
  color: var(--text-muted); font-family: inherit; font-size: 13px; font-weight: var(--w-medium);
  padding: 7px 12px; border-radius: var(--r-pill); cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: border-color var(--dur-fast), background var(--dur-fast), color var(--dur-fast);
}
.task-chip.set { border-color: var(--accent); color: var(--accent); background: var(--accent-tint); }

.task-group-label { font-size: var(--fs-sm); font-weight: var(--w-bold); color: var(--text-muted); margin: 18px 4px 8px; }
.task-card {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--surface-card); border: 1px solid var(--border-hairline);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
  padding: 12px 14px; margin-bottom: 9px;
}
.task-card.done { opacity: 0.5; }
.task-check {
  flex: none; width: 24px; height: 24px; margin-top: 1px;
  border-radius: 50%; border: 2px solid var(--text-faint);
  background: transparent; cursor: pointer; display: grid; place-items: center;
  color: var(--on-accent); transition: background var(--dur-fast), border-color var(--dur-fast);
}
.task-check.checked { background: var(--accent); border-color: var(--accent); }
.task-body { flex: 1; min-width: 0; }
.task-title { font-size: 15px; font-weight: var(--w-semibold); color: var(--text-strong); line-height: 1.3; }
.task-card.done .task-title { text-decoration: line-through; }
.task-meta { display: flex; flex-wrap: wrap; gap: 5px 10px; margin-top: 5px; }
.task-tag { font-size: 12px; color: var(--text-muted); display: inline-flex; align-items: center; gap: 4px; }
.task-tag.assignee { color: var(--accent); font-weight: var(--w-semibold); }
.task-tag.overdue { color: #e8590c; font-weight: var(--w-semibold); }
.task-del { flex: none; border: none; background: transparent; color: var(--text-faint); cursor: pointer; padding: 4px; border-radius: var(--r-md); }
.task-del:active { color: #e03131; }

/* ערכת "מטלות" — משנה את הצבעים של כל המסך (כמו אפליקציה נפרדת) */
:root[data-sheet="tasks"] {
  --accent: #4263eb;
  --accent-tint: #e7ecff;
  --surface-tint: #eef1fb;
  --bg-app: #f5f6fb;
}
:root[data-sheet="tasks"].theme-dark {
  --accent: #91a7ff;
  --accent-tint: #232a45;
  --surface-tint: #1b2036;
  --bg-app: #10121c;
}

/* בוחר אפשרויות בדיאלוג מטלה */
.chip-select { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 4px; }
.chip-select .opt {
  border: 1.5px solid var(--border-hairline); background: var(--surface-card);
  color: var(--text-body); font-family: inherit; font-size: 14px; font-weight: var(--w-medium);
  padding: 9px 14px; border-radius: var(--r-pill); cursor: pointer;
  transition: border-color var(--dur-fast), background var(--dur-fast), color var(--dur-fast);
}
.chip-select .opt.sel { border-color: var(--accent); background: var(--accent-tint); color: var(--accent); font-weight: var(--w-bold); }

/* מסך מטלות — ריווח נדיב יותר */
#screen-tasks .pad { padding-top: 22px; }
#taskAddForm { margin-bottom: 20px; }
#screen-tasks .task-card { margin-bottom: 11px; padding: 14px 16px; }
#screen-tasks .task-meta { margin-top: 7px; }
#screen-tasks .task-group-label { margin: 22px 4px 10px; }

/* בורר זמן מדויק בעברית (במקום datetime-local הלועזי) */
.dlg-custom { display: flex; gap: 8px; margin: 2px 0 4px; }
.dlg-custom #taskDlgDate { flex: 1; }
.dlg-custom #taskDlgTime { flex: 0 0 108px; text-align: center; font-variant-numeric: tabular-nums; }

/* ============================================================ צ'אט לרשימה */
#screen-chat { display: flex; flex-direction: column; overflow: hidden; padding-bottom: 0; }
.chat-messages { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 8px; padding: 18px 16px 12px; }
.chat-empty { flex: 1; }
.chat-bubble { max-width: 78%; padding: 9px 13px; border-radius: 16px; font-size: 15px; line-height: 1.35; box-shadow: var(--shadow-xs); word-break: break-word; }
.chat-bubble .cb-author { font-size: 11.5px; font-weight: var(--w-bold); margin-bottom: 2px; opacity: 0.85; }
.chat-bubble .cb-time { font-size: 10.5px; opacity: 0.65; margin-top: 3px; font-variant-numeric: tabular-nums; }
.chat-row { display: flex; }
.chat-row.mine { justify-content: flex-start; }
.chat-row.theirs { justify-content: flex-end; }
.chat-row.mine .chat-bubble { background: var(--accent); color: var(--on-accent); border-bottom-inline-start: 3px solid transparent; }
.chat-row.theirs .chat-bubble { background: var(--surface-card); color: var(--text-body); border: 1px solid var(--border-hairline); }
.chat-day { align-self: center; font-size: 11.5px; font-weight: var(--w-semibold); color: var(--text-faint); background: var(--surface-tint); padding: 3px 12px; border-radius: var(--r-pill); margin: 6px 0; }
.chat-compose { flex: none; display: flex; gap: 10px; align-items: center; padding: 10px 14px calc(env(safe-area-inset-bottom) + 10px); border-top: 1px solid var(--border-hairline); background: var(--bg-app); }
.chat-compose input { flex: 1; border: 1px solid var(--border-hairline); background: var(--surface-card); border-radius: var(--r-pill); padding: 11px 16px; font-size: 15px; color: var(--text-body); outline: none; }
.chat-compose input:focus { border-color: var(--accent); box-shadow: var(--ring); }
.chat-send { flex: none; width: 42px; height: 42px; border-radius: 50%; border: none; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; }
.chat-send:active { transform: scale(0.92); }
.nav-dot { position: absolute; top: -2px; inset-inline-end: -7px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg-app); }

/* ---- השוואת מחירים ---- */
.price-radius-row { display: flex; align-items: center; gap: 10px; margin: 4px 0 12px; }
.price-radius-label { font-size: var(--fs-xs); font-weight: var(--w-bold); color: var(--text-faint); letter-spacing: var(--ls-wide); flex: none; }
.price-radius-row .chip-select { margin: 0; gap: 6px; }
.price-radius-row .chip-select .opt { padding: 7px 12px; font-size: 13px; }
.price-notice { background: var(--surface-card); border: 1px solid var(--border-hairline); border-radius: var(--r-lg); padding: 14px 16px; margin-bottom: 10px; }
.price-notice.warn { background: var(--surface-tint); }
.price-notice .pn-title { font-weight: var(--w-bold); color: var(--text-strong); font-size: 15px; display: flex; align-items: center; gap: 10px; }
.price-notice .pn-text { font-size: var(--fs-sm); color: var(--text-muted); margin-top: 4px; line-height: 1.5; }
.price-notice .pn-action { margin-top: 12px; }
.price-notice.loading .pn-title::before {
  content: ''; width: 16px; height: 16px; flex: none; border-radius: 50%;
  border: 2px solid var(--accent-tint); border-top-color: var(--accent);
  animation: price-spin 0.8s linear infinite;
}
@keyframes price-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .price-notice.loading .pn-title::before { animation-duration: 2.4s; } }

.price-card { background: var(--surface-card); border: 1px solid var(--border-hairline); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); margin-bottom: 10px; overflow: hidden; }
.price-card.best { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow-sm); }
.pc-head { width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: none; background: transparent; text-align: start; font-family: inherit; color: inherit; cursor: pointer; }
.pc-info { flex: 1; min-width: 0; }
.pc-chain { font-weight: var(--w-bold); font-size: 16px; color: var(--text-strong); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pc-badge { font-size: 11.5px; font-weight: var(--w-bold); color: var(--on-accent); background: var(--accent); border-radius: var(--r-pill); padding: 2px 9px; }
.pc-branch { font-size: 13px; color: var(--text-muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-meta { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-faint); margin-top: 6px; }
.pc-found { margin-inline-start: 8px; color: var(--accent); font-weight: var(--w-semibold); }
.pc-found.partial { color: var(--m-amber); }
.pc-sum { text-align: end; flex: none; }
.pc-total { font-size: 19px; font-weight: var(--w-extrabold); color: var(--text-strong); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pc-diff { font-size: 12.5px; color: var(--text-faint); font-variant-numeric: tabular-nums; margin-top: 2px; white-space: nowrap; }
.pc-order { width: calc(100% - 24px); margin: 0 12px 12px; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 14px; border: 1px solid var(--accent); border-radius: var(--r-md, 12px); background: transparent; color: var(--accent); font-family: inherit; font-size: 15px; font-weight: var(--w-semibold); cursor: pointer; }
.price-card.best .pc-order { background: var(--accent); color: var(--on-accent); }
.pc-order:active { transform: scale(.98); }
.pc-lines { border-top: 1px solid var(--border-hairline); padding: 4px 8px 8px; }
.pc-line { display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-bottom: 1px solid var(--border-hairline); }
.pc-line:last-child { border-bottom: none; }
.pcl-text { flex: 1; min-width: 0; }
.pcl-item { font-weight: var(--w-semibold); font-size: 14.5px; color: var(--text-strong); display: flex; align-items: center; gap: 6px; }
.pcl-pin { color: var(--accent); }
.pcl-product { font-size: 12.5px; color: var(--text-muted); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-line.missing .pcl-product { color: var(--m-amber); }
.pcl-price { text-align: end; font-weight: var(--w-semibold); font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--text-strong); }
.pc-saved { font-size: 12px; font-weight: var(--w-semibold); color: var(--accent); margin-top: 2px; white-space: nowrap; }
.pcl-deal { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; font-size: 12px; font-weight: var(--w-semibold); color: var(--accent); margin-top: 3px; }
.pcl-deal > span { flex: 1 1 0; min-width: 0; white-space: normal; }
.pcl-deal > svg { margin-top: 2px; }
.pcl-deal { align-items: flex-start; }
.pcl-deal.hint { color: var(--m-amber); }
.pcl-deal.club { color: var(--text-faint); font-weight: var(--w-medium); }
.pcl-dealbtn { font: inherit; font-size: 11.5px; font-weight: var(--w-bold); color: var(--m-amber); background: transparent; border: 1px solid currentColor; border-radius: var(--r-pill); padding: 2px 9px; cursor: pointer; }
.pcl-better { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 4px; font-size: 12px; font-weight: var(--w-semibold); color: var(--accent); }
.pcl-better > span { flex: 1 1 0; min-width: 0; }
.pcl-dealbtn.better { color: var(--accent); }
.rv-wrap { display: flex; flex-direction: column; gap: 2px; }
.rv-better { padding: 2px 12px 6px; }
.pcl-was { font-size: 11.5px; font-weight: var(--w-medium); color: var(--text-faint); text-decoration: line-through; }
.pcl-sub { font-size: 11.5px; font-weight: var(--w-medium); color: var(--text-faint); }
.pcl-pick { width: 36px; height: 36px; flex: none; border: none; border-radius: var(--r-pill); background: var(--surface-sunken); color: var(--text-muted); display: grid; place-items: center; cursor: pointer; }
.pcl-pick:hover { color: var(--accent); }
.price-foot { font-size: 12px; color: var(--text-faint); line-height: 1.55; margin: 18px 4px 0; }

.pick-list { display: flex; flex-direction: column; gap: 4px; max-height: min(46vh, calc(var(--vvh, 100dvh) - 270px)); min-height: 120px; overflow-y: auto; margin-top: 10px; }
.pick-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1.5px solid transparent; border-radius: var(--r-md); background: var(--surface-sunken); text-align: start; font-family: inherit; color: inherit; cursor: pointer; }
.pick-row.sel { border-color: var(--accent); background: var(--accent-tint); }
.pick-text { flex: 1; min-width: 0; }
.pick-name { font-weight: var(--w-semibold); font-size: 14.5px; color: var(--text-strong); }
.pick-meta { font-size: 12.5px; color: var(--text-muted); margin-top: 1px; }
.pick-price { font-size: 13.5px; font-weight: var(--w-semibold); font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--text-strong); }
.rv-tag { flex: none; font-size: 12px; font-weight: var(--w-semibold); border-radius: var(--r-pill); padding: 3px 9px; white-space: nowrap; }
.rv-tag.ok { color: var(--accent); background: var(--accent-tint); }
.rv-tag.check { color: var(--m-amber); background: color-mix(in srgb, var(--m-amber) 14%, transparent); }
.rv-tag.miss { color: var(--text-muted); background: var(--surface-card); border: 1px solid var(--border-hairline); }
.scan-row { cursor: default; }
.scan-form .sheet-actions .btn { white-space: nowrap; }
.scan-name { width: 100%; padding: 6px 10px; font-size: 14.5px; }
.scan-qty { flex: none; display: flex; align-items: center; gap: 4px; }
.scan-qbtn { width: 34px; height: 34px; border-radius: var(--r-pill); border: 1px solid var(--border-hairline); background: var(--surface-card); color: var(--text-strong); font: inherit; font-size: 18px; line-height: 1; cursor: pointer; }
.scan-qval { min-width: 22px; text-align: center; font-weight: var(--w-bold); font-variant-numeric: tabular-nums; }
.prod-img { flex: none; width: 44px; height: 44px; border-radius: 10px; background: #fff; overflow: hidden; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border-hairline); }
.prod-img img { width: 100%; height: 100%; object-fit: contain; }
.prod-img.none { background: var(--surface-card); color: var(--text-faint); }
.cf-step { font-size: 12.5px; font-weight: var(--w-semibold); color: var(--accent); margin-bottom: 4px; }
.cf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; max-height: min(52vh, calc(var(--vvh, 100dvh) - 250px)); min-height: 140px; overflow-y: auto; }
.cf-grid .pick-empty { grid-column: 1 / -1; }
.cf-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 10px 10px; border: 1.5px solid var(--border-hairline); border-radius: var(--r-md); background: var(--surface-sunken); font-family: inherit; color: inherit; text-align: center; cursor: pointer; }
.cf-card:active { transform: scale(.98); border-color: var(--accent); }
.cf-card .prod-img { width: 84px; height: 84px; border-radius: 12px; margin-bottom: 4px; }
.cf-name { font-weight: var(--w-semibold); font-size: 13.5px; color: var(--text-strong); line-height: 1.3; }
.cf-meta { font-size: 12px; color: var(--text-muted); }
.cf-price { font-size: 13px; font-weight: var(--w-bold); font-variant-numeric: tabular-nums; color: var(--text-strong); }
.cf-badge { position: absolute; top: 6px; inset-inline-start: 6px; font-size: 10.5px; font-weight: var(--w-bold); color: var(--on-accent); background: var(--accent); border-radius: var(--r-pill); padding: 2px 7px; }
.pick-empty { font-size: var(--fs-sm); color: var(--text-muted); padding: 14px 4px; }
.auth-toggle { min-height: 40px; padding: 0 10px; }
.auth-forgot { display: block; margin: 0 auto; color: var(--text-muted); font-weight: var(--w-medium, 500); }

/* כניסה עם Apple — לפי ההנחיות של Apple: כפתור שחור (לבן במצב כהה), לוגו + "המשך עם Apple" */
.apple-wrap { margin-top: 14px; }
.or-sep { display: flex; align-items: center; gap: 10px; color: var(--text-faint); font-size: 13px; margin-bottom: 14px; }
.or-sep::before, .or-sep::after { content: ''; flex: 1; height: 1px; background: var(--border-hairline); }
.apple-btn { width: 100%; height: 52px; border: none; border-radius: var(--r-md); background: #000; color: #fff;
  display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 17px; font-weight: 600; }
.theme-dark .apple-btn { background: #fff; color: #000; }

/* ============================================================
   שכבת "סטודיו" — רכיבים. נמצאת בסוף הקובץ ולכן גוברת על הכללים הישנים.
   ============================================================ */
body { font-feature-settings: 'tnum' 0; letter-spacing: -0.003em; }

/* ---- כותרת עליונה: קומפקטית, זכוכית ---- */
.app-header {
  background: color-mix(in srgb, var(--bg-app) 80%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px);
  border-bottom: 1px solid transparent;
  padding: calc(env(safe-area-inset-top) + 12px) 18px 12px;
  transition: border-color var(--dur-base);
}
.app-header.scrolled { border-bottom-color: var(--border-hairline); }
.header-top > div:first-child { min-width: 0; }
.eyebrow { font-size: 12.5px; font-weight: var(--w-medium); color: var(--text-faint); }
.greeting {
  font-size: 25px; font-weight: var(--w-bold); letter-spacing: var(--ls-tight); line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.greeting-status { display: none; } /* הסטטוס עבר לכרטיס "הסל" */
.synced { padding: 0; background: transparent; gap: 0; }
.synced span:not(.dot) { display: none; }
.synced .dot { width: 9px; height: 9px; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.synced.offline { padding: 5px 10px; gap: 6px; background: var(--danger-tint); }
.synced.offline span:not(.dot) { display: inline; }
.user-chip .avatar { box-shadow: 0 0 0 2px var(--bg-app), 0 0 0 3.5px var(--border-strong); }

/* ---- בורר קניות / מטלות: גלולה שמחליקה ---- */
.sheet-switch {
  position: relative; margin-top: 12px; gap: 0; padding: 3px;
  background: var(--surface-sunken); border-radius: 12px;
}
.sheet-switch::before {
  content: ''; position: absolute; top: 3px; bottom: 3px; inset-inline-start: 3px; width: calc(50% - 3px);
  background: var(--surface-card); border-radius: 9px;
  box-shadow: 0 1px 2px rgba(15,20,25,.08), 0 2px 8px -2px rgba(15,20,25,.12);
  transition: transform var(--dur-slow) var(--ease-spring);
}
.sheet-switch[data-active="tasks"]::before { transform: translateX(-100%); }
.sheet-tab { position: relative; z-index: 1; border-radius: 9px; padding: 7px 10px; font-weight: var(--w-semibold); color: var(--text-muted); }
.sheet-tab.active { background: transparent; box-shadow: none; color: var(--text-strong); }

/* ---- סרגל רשימות ---- */
.lists-bar { padding: 14px 18px 2px; gap: 7px; }
.list-tab { height: 34px; padding: 0 14px; border: 1px solid var(--border-hairline); box-shadow: none; color: var(--text-muted); font-weight: var(--w-medium); }
.list-tab.active { background: var(--surface-ink); color: var(--on-ink); font-weight: var(--w-semibold); }
.list-tab-add { width: 34px; height: 34px; border-style: solid; border-color: var(--border-hairline); background: var(--surface-card); }
.pad { padding-inline: 18px; }

/* ---- כרטיס "הסל": הרגע הבולט של המסך ---- */
.hero {
  position: relative; overflow: hidden; isolation: isolate;
  margin-top: 14px; padding: 18px 18px 16px;
  background: var(--surface-ink); color: var(--on-ink);
  border-radius: var(--r-xl);
  box-shadow: 0 18px 40px -18px color-mix(in srgb, var(--accent) 55%, rgba(15,20,25,.5));
}
.hero::before {
  content: ''; position: absolute; z-index: -1; width: 220px; height: 220px; inset-inline-end: -70px; top: -110px;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent-bright) 70%, transparent), transparent 68%);
  animation: hero-drift 14s ease-in-out infinite alternate;
}
.theme-dark .hero {
  --on-ink: #ffffff;
  background: linear-gradient(160deg, #221d45 0%, #171a22 70%);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
  box-shadow: 0 18px 40px -20px rgba(0,0,0,.9);
}
.theme-dark .hero::before { opacity: .45; }
@keyframes hero-drift { to { transform: translate(-60px, 50px) scale(1.15); } }
.hero-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.hero-label { font-size: 13px; opacity: .66; font-weight: var(--w-medium); }
.hero-count { font-size: 40px; font-weight: var(--w-bold); letter-spacing: -0.04em; line-height: 1.05; font-variant-numeric: tabular-nums; margin-top: 2px; }
.hero-count small { font-size: 16px; font-weight: var(--w-medium); letter-spacing: 0; opacity: .7; margin-inline-start: 6px; }
.hero-done { font-size: 13px; opacity: .7; text-align: end; padding-bottom: 6px; font-variant-numeric: tabular-nums; }
.hero-bar { height: 5px; border-radius: 99px; margin-top: 14px; background: color-mix(in srgb, var(--on-ink) 14%, transparent); overflow: hidden; }
.hero-bar span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--accent-bright); transition: width var(--dur-celebrate) var(--ease-out); }
.hero-actions { display: flex; gap: 8px; margin-top: 14px; }
.hero-btn {
  flex: 1; height: 42px; border: none; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-size: 14px; font-weight: var(--w-semibold);
  background: color-mix(in srgb, var(--on-ink) 12%, transparent); color: var(--on-ink);
  transition: transform var(--dur-fast), background var(--dur-fast);
}
.hero-btn.primary { background: var(--accent); color: #fff; }
.hero-btn:active { transform: scale(0.97); }
.hero-price { margin-top: 12px; font-size: 13px; opacity: .8; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hero-price b { background: var(--accent); color: #fff; padding: 1px 8px; border-radius: 6px; font-weight: var(--w-semibold); opacity: 1; }
.hero.empty-cart .hero-bar, .hero.empty-cart .hero-actions { display: none; }

/* ---- הוספה מהירה ---- */
.quick-add { margin-top: 12px; height: 54px; border-radius: 16px; border-color: transparent; box-shadow: var(--shadow-md); }
.quick-add .lead { color: var(--accent); }
.quick-add.has-text .qa-submit { background: var(--surface-ink); color: var(--on-ink); transform: scale(1); }
.qa-submit { border-radius: 12px; transform: scale(0.9); transition: background var(--dur-base), color var(--dur-base), transform var(--dur-base) var(--ease-spring); }
.add-tools { gap: 6px; margin-top: 12px; }
.bulk-trigger {
  margin: 0; height: 34px; padding: 0 12px; border-radius: var(--r-pill);
  background: var(--surface-card); color: var(--text-body); font-weight: var(--w-medium); font-size: 13px;
  box-shadow: var(--shadow-xs); border: 1px solid var(--border-hairline);
}
.bulk-trigger span { color: var(--accent); }
#priceBtn { display: none !important; } /* עבר לכרטיס "הסל" */
.suggestions { gap: 6px; }
.sugg-chip, .fav-chip { height: 32px; border-color: var(--border-hairline); box-shadow: var(--shadow-xs); }
.fav-chip { background: var(--surface-card); color: var(--text-body); }
.fav-chip .star { color: var(--accent); }
.fav-label { color: var(--text-faint); font-weight: var(--w-semibold); }
.search-wrap { border-color: transparent; box-shadow: var(--shadow-sm); border-radius: 13px; }

/* ---- כותרות מקטע ---- */
.section { margin-top: 22px; }
.section-head { margin-bottom: 10px; }
.sh-title { font-size: 17px; font-weight: var(--w-bold); color: var(--text-strong); letter-spacing: var(--ls-snug); }
.count-badge { background: var(--surface-card); color: var(--text-muted); box-shadow: var(--shadow-xs); }
.ghost-btn { font-weight: var(--w-semibold); }
.ghost-btn.accent { color: var(--accent); }
#shopModeBtn { display: none !important; } /* עבר לכרטיס "הסל" */

/* ---- הרשימה: כרטיס אחד, כותרות מחלקה בתוכו, שורות עם קו דק ---- */
#activeList, #purchasedList {
  background: var(--surface-card); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.cat-group + .cat-group { border-top: 1px solid var(--border-hairline); margin-top: 4px; }
.cat-group .cat-sub, .cat-group:first-child .cat-sub {
  margin: 0; padding: 13px 16px 1px; font-size: 12.5px; font-weight: var(--w-semibold); color: var(--accent);
}
.items { gap: 0; }
.item {
  border: none; border-radius: 0; box-shadow: none; background: transparent;
  padding: 11px 16px; gap: 12px; position: relative;
}
.item + .item::before {
  content: ''; position: absolute; top: 0; inset-inline: 52px 16px; height: 1px; background: var(--border-hairline);
}
.item-name { font-weight: var(--w-medium); font-size: 16px; }
.item-meta { font-size: 12px; }
.item-meta .who { font-weight: var(--w-medium); }
.qty { background: var(--surface-sunken); }
.qty button { color: var(--text-strong); }
.del { opacity: .55; }
.del:hover { opacity: 1; }
.item.swipe-armed { box-shadow: inset 0 0 0 2px var(--accent); border-radius: 12px; }

/* סימון "נקנה": העיגול מתמלא בקפיצה, הקו נמתח על השם והשורה מתקפלת */
.complete { width: 25px; height: 25px; border-width: 2px; border-color: var(--border-strong); }
.item.done .complete { background: var(--accent); border-color: var(--accent); }
.item.checking .complete { background: var(--accent); border-color: var(--accent); animation: chk-pop var(--dur-celebrate) var(--ease-spring); }
.item.checking .complete .chk { opacity: 1; transform: scale(1); }
.item.checking .item-name { color: var(--text-faint); background: linear-gradient(currentColor, currentColor) no-repeat right 55% / 100% 1.5px; animation: strike var(--dur-slow) var(--ease-out); }
.item.leaving { animation: row-out 300ms var(--ease-standard) forwards; }
@keyframes chk-pop { 0% { transform: scale(1); } 40% { transform: scale(1.32); } 100% { transform: scale(1); } }
@keyframes strike { from { background-size: 0 1.5px; } to { background-size: 100% 1.5px; } }
@keyframes row-out { to { opacity: 0; max-height: 0; padding-block: 0; transform: translateX(-24px); } }
.item.arrive { animation: row-in var(--dur-slow) var(--ease-out); }
@keyframes row-in { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
#purchasedList .item-name { color: var(--text-faint); }
#purchasedList .item { opacity: 1; }

/* ---- סרגל ניווט צף מזכוכית ---- */
.app { overflow: hidden; }
.screen { padding-bottom: var(--nav-space); }
.bottom-nav {
  position: absolute; z-index: 30;
  inset-inline: 14px; bottom: calc(env(safe-area-inset-bottom) + var(--nav-gap));
  height: var(--nav-h); padding: 6px; gap: 4px;
  border: 1px solid color-mix(in srgb, var(--border-strong) 55%, transparent);
  border-radius: 22px;
  background: color-mix(in srgb, var(--surface-card) 72%, transparent);
  -webkit-backdrop-filter: saturate(1.8) blur(22px); backdrop-filter: saturate(1.8) blur(22px);
  box-shadow: var(--shadow-lg);
}
.nav-item { border-radius: 16px; gap: 2px; padding: 4px 0; color: var(--text-faint); position: relative; transition: color var(--dur-base), background var(--dur-base); }
.nav-item.active { color: var(--accent); background: var(--accent-tint); animation: nav-pop var(--dur-slow) var(--ease-spring); }
@keyframes nav-pop { from { transform: scale(.92); } }
.nav-item .nav-label { font-size: 11.5px; }
.nav-badge { background: var(--surface-ink); color: var(--on-ink); border: 2px solid var(--surface-card); height: 18px; min-width: 18px; top: -6px; }
.nav-dot { border-color: var(--surface-card); }

/* ---- כרטיסים כלליים ---- */
.settings-card, .card-group, .task-card, .price-notice, .install-hint {
  border: none; box-shadow: var(--shadow-sm); border-radius: var(--r-lg);
}
.set-ic { background: var(--accent-tint); color: var(--accent); border-radius: 10px; }
.set-row { transition: background var(--dur-fast); }
.set-row:active { background: var(--surface-sunken); }
.set-title { font-weight: var(--w-medium); }
.screen-title { font-size: 26px; font-weight: var(--w-bold); }
.cat-sub { font-weight: var(--w-semibold); }
.switch { background: var(--paper-300); }
.switch .knob { box-shadow: 0 1px 3px rgba(15,20,25,.25); transition: inset-inline-start var(--dur-slow) var(--ease-spring); }
.household-tile { background: var(--surface-sunken) !important; }
.weekly { background: var(--surface-ink); }
.weekly .wk-body, .weekly .wk-x { color: var(--on-ink); }
.weekly .wk-ic { background: color-mix(in srgb, var(--on-ink) 14%, transparent); color: var(--on-ink); }
.weekly .wk-add { background: var(--accent); color: #fff; }
.restock { background: var(--surface-card); border: none; box-shadow: var(--shadow-sm); }
.restock .rk-add { background: var(--surface-ink); color: var(--on-ink); }

/* ---- כפתורים ---- */
.btn { border-radius: 12px; font-weight: var(--w-semibold); }
.btn-primary { background: var(--surface-ink); color: var(--on-ink); }
.btn-secondary { border-color: var(--border-strong); }
.field { border-color: var(--border-strong); box-shadow: none; border-radius: 12px; }

/* ---- גיליונות (דיאלוגים) עולים מלמטה ---- */
dialog.sheet {
  max-width: var(--app-max); width: 100%;
  margin: auto auto 0; border-radius: 26px 26px 0 0;
  padding-bottom: env(safe-area-inset-bottom);
  max-height: 92dvh; overflow-y: auto;
  box-shadow: 0 -10px 40px -10px rgba(15,20,25,.25);
  /* מקלדת פתוחה (אייפון): הגיליון יושב מעליה ולא גבוה מהחלק הנראה של המסך — אחרת הכותרת והחיפוש נחתכים למעלה */
  margin-bottom: var(--kb, 0px);
  max-height: min(92dvh, calc(var(--vvh, 100dvh) - env(safe-area-inset-top, 0px) - 8px));
}
dialog.sheet::before { content: ''; display: block; width: 38px; height: 5px; border-radius: 99px; background: var(--border-strong); margin: 9px auto 0; }
dialog.sheet[open] { animation: sheet-up 420ms var(--ease-out); }
dialog.sheet[open]::backdrop { animation: scrim-in 300ms ease-out; }
dialog.sheet::backdrop { backdrop-filter: blur(3px); }
@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes scrim-in { from { opacity: 0; } }
.sheet-form { padding: 14px 20px 22px; }
.sheet-form h3 { font-size: 20px; font-weight: var(--w-bold); letter-spacing: var(--ls-snug); }
@media (min-width: 640px) {
  dialog.sheet { margin: auto; max-width: 420px; border-radius: 24px; padding-bottom: 0; }
  dialog.sheet::before { display: none; }
  dialog.sheet[open] { animation: sheet-pop 320ms var(--ease-out); }
  @keyframes sheet-pop { from { transform: translateY(14px) scale(.97); opacity: 0; } }
}

/* ---- הודעה קופצת (toast) ---- */
.toast {
  width: max-content; max-width: calc(min(100vw, var(--app-max)) - 32px);
  bottom: calc(var(--nav-space) - 6px);
  background: var(--surface-ink); color: var(--on-ink);
  padding: 11px 18px; border-radius: 16px; line-height: 1.4;
  animation: toast-in 420ms var(--ease-spring);
}
.theme-dark .toast { background: var(--surface-ink); color: var(--on-ink); }
.toast-undo { background: color-mix(in srgb, var(--on-ink) 14%, transparent); color: var(--green-300); white-space: nowrap; }
.theme-dark .toast-undo { color: var(--accent); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 16px) scale(.96); } to { transform: translate(-50%, 0); } }

/* ---- מסך כניסה ---- */
.login-overlay {
  background:
    radial-gradient(60% 45% at 85% 0%, color-mix(in srgb, var(--accent-bright) 35%, transparent), transparent 70%),
    radial-gradient(50% 40% at 0% 100%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%),
    var(--bg-app);
}
.login-card { box-shadow: var(--shadow-xl); border-radius: 28px; }
.login-disc { background: var(--surface-ink); color: var(--on-ink); border-radius: 20px; }
.login-card h2 { font-weight: var(--w-bold); }
.login-card .field { text-align: start; }
.auth-toggle { color: var(--accent); }

/* ---- מטלות: אותו מבנה, צבע כחול משלו ---- */
:root[data-sheet="tasks"] { --accent: #2f6fed; --accent-bright: #4c86ff; --accent-tint: #e5eeff; --surface-tint: #eef3ff; --bg-app: var(--paper-50); }
:root[data-sheet="tasks"].theme-dark { --accent: #7aa5ff; --accent-bright: #8db3ff; --accent-tint: #1b2847; --surface-tint: #141d33; --bg-app: var(--paper-50); }
.task-check { border-color: var(--border-strong); }
.task-check.checked { animation: chk-pop var(--dur-celebrate) var(--ease-spring); }
.task-chip { box-shadow: var(--shadow-xs); border-color: var(--border-hairline); }

/* ---- צ'אט ---- */
#screen-chat { padding-bottom: calc(var(--nav-space) - 12px); }
.chat-bubble { border-radius: 18px; box-shadow: none; padding: 9px 14px; }
.chat-row.mine .chat-bubble { border-end-start-radius: 6px; }
.chat-row.theirs .chat-bubble { border: none; box-shadow: var(--shadow-sm); border-end-end-radius: 6px; }
.chat-compose { border-top: none; background: transparent; }
.chat-compose input { border-color: transparent; box-shadow: var(--shadow-sm); }
.chat-send { background: var(--surface-ink); color: var(--on-ink); }
.chat-day { background: var(--surface-card); box-shadow: var(--shadow-xs); }

/* ---- מצב קנייה ---- */
.shop-item { border: none; box-shadow: var(--shadow-sm); border-radius: var(--r-lg); }
.shop-close { background: var(--surface-card); box-shadow: var(--shadow-xs); }

/* ---- תנועה מופחתת ---- */
@media (prefers-reduced-motion: reduce) {
  .hero::before, .item.checking .complete, .item.leaving, .item.arrive, dialog.sheet[open], .toast, .nav-item.active { animation: none !important; }
  .sheet-switch::before, .hero-bar span { transition: none; }
}

/* ---- צ'אט ריק ---- */
.chat-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px 32px; }
.chat-empty.hidden { display: none; }
.chat-empty .ei { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--accent-tint); color: var(--accent); margin-bottom: 16px; }
.chat-empty .et { font-size: 20px; font-weight: var(--w-bold); color: var(--text-strong); }
.chat-empty .eh { font-size: 14px; color: var(--text-muted); margin-top: 6px; max-width: 280px; line-height: 1.5; }
.empty .disc, .no-lists .disc { background: var(--accent-tint); color: var(--accent); border-radius: 20px; }

/* ---- מצב קנייה: פס התקדמות וסימון חי ---- */
.shop-head { border-bottom: none; }
.shop-item .shop-check { transition: background var(--dur-base), border-color var(--dur-base); }
.shop-item.got { opacity: .45; transform: scale(.98); }
.shop-item.got .shop-check { background: var(--accent); border-color: var(--accent); animation: chk-pop var(--dur-celebrate) var(--ease-spring); }
.item-name { width: fit-content; max-width: 100%; }
.auth-legal { margin-top: 14px; font-size: 12.5px; color: var(--text-faint); }
.auth-legal a { color: var(--text-muted); text-decoration: underline; text-underline-offset: 2px; }

/* ---- LITE: בדפדפן רק רשימה ושיתוף. השוואת מחירים, הזמנה, סריקה, צ'אט, מטלות ומצב קנייה — באפליקציה ---- */
.web-lite #sheetSwitch, .web-lite .hero-actions, .web-lite #heroPrice,
.web-lite #scanBtn, .web-lite #micBtn, .web-lite #productBtn, .web-lite #receiptBtn, .web-lite #priceBtn,
.web-lite #editPrice, .web-lite #shopModeBtn { display: none !important; }
.install-hint .ih-logo { width: 40px; height: 40px; flex: none; border-radius: 10px; }
.install-hint a.ih-btn { display: inline-flex; align-items: center; text-decoration: none; }
/* הלוגו החדש במסך הכניסה */
.login-disc:has(.login-logo) { background: none; box-shadow: none; overflow: hidden; border-radius: 22%; }
.login-logo { width: 100%; height: 100%; display: block; }
