/* ===== צבעים: סגנון "רך ועגול" (ורוד, אפרסק ומנטה) ===== */
:root {
  --bg: #FFF4EE;          /* שמנת-אפרסק חמימה */
  --card: #FFFFFF;
  --text: #3A2A2A;
  --text-soft: #8A6A6A;
  --text-muted: #B79E9E;
  --border: #F3E1D8;

  /* הצבע הראשי: ורוד */
  --accent: #D9466A;      /* כפתורים */
  --accent-strong: #B8325A; /* טקסט מודגש */
  --accent-soft: #FFE3EA; /* רקע עדין */
  --on-accent: #FFFFFF;
  --hero: #FF8FA3;        /* כרטיס הברכה */

  /* "הושלם" / מנה שלמה: מנטה */
  --ok: #19A57A;
  --ok-strong: #0B5E45;
  --ok-soft: #C9F2E3;

  /* חריגה: כתום עדין */
  --warn: #E58A2E;
  --warn-strong: #9A4E00;

  /* ריבועי סיכום */
  --peach: #FFE0B8;  --peach-text: #8A4B00;
  --mint: #C9F2E3;   --mint-text: #0B5E45;
  --sky: #D6ECFF;    --sky-text: #1C5F99;

  /* צבע לכל ארוחה */
  --first-bg: #FFE9B8;  --first-text: #7A4A00;  --first-ring: #F2B33D;
  --snack-bg: #FFE3EA;  --snack-text: #A3304F;  --snack-ring: #F07A98;
  --dinner-bg: #ECE6FF; --dinner-text: #4B3A99; --dinner-ring: #9D88E8;
  --post-bg: #FFDCCF;   --post-text: #9A3412;   --post-ring: #F2875F;

  --font-title: "Fredoka", "Rubik", -apple-system, sans-serif;
  --font-body: "Rubik", -apple-system, "Segoe UI", Arial, sans-serif;

  --radius: 20px;
  --tabbar-h: 66px;
}

/* מצב כהה: אותם צבעים בגרסה כהה (מופעל לפי הגדרות הטלפון) */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1F1719;
    --card: #2A2023;
    --text: #F6ECEE;
    --text-soft: #C7AEB4;
    --text-muted: #8C747A;
    --border: #3D2E33;

    --accent: #FF8FA3;
    --accent-strong: #FFB3C1;
    --accent-soft: #4A2530;
    --on-accent: #3A0F1C;
    --hero: #B8325A;

    --ok: #4FD1A5;
    --ok-strong: #9FF0D2;
    --ok-soft: #133D31;
    --warn: #F2A65A;
    --warn-strong: #FFCB94;

    --peach: #4A3417; --peach-text: #FFD49E;
    --mint: #133D31;  --mint-text: #9FF0D2;
    --sky: #17324D;   --sky-text: #A9D4FF;

    --first-bg: #4A3A12;  --first-text: #FFE29A;  --first-ring: #F2B33D;
    --snack-bg: #4A2530;  --snack-text: #FFB3C1;  --snack-ring: #F07A98;
    --dinner-bg: #2E2850; --dinner-text: #CFC4FF; --dinner-ring: #9D88E8;
    --post-bg: #4D2618;   --post-text: #FFC2AC;   --post-ring: #F2875F;
  }
}

/* ===== בסיס ===== */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, h4, .meal-title, .stat-num, .target-num, .free-left, .day-nav-title {
  font-family: var(--font-title);
}

#app {
  max-width: 560px;
  margin: 0 auto;
  /* מקום לפס העליון של האייפון ולתפריט התחתון */
  padding: calc(env(safe-area-inset-top) + 20px) 16px
           calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 24px);
}

h1 {
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 20px;
}

.date {
  margin: 0;
  font-size: 14px;
  color: var(--text-soft);
}

.muted { color: var(--text-muted); font-size: 14px; }

/* ===== כרטיס זמני ("ייבנה בחלק...") ===== */
.placeholder {
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
}
.placeholder p { margin: 4px 0; }

/* ===== כרטיסים ===== */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
}

/* ===== מסך התפריט ===== */
.targets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  text-align: center;
  background: var(--accent-soft);
  border-color: transparent;
}
.target-num {
  display: block;
  font-size: 22px;
  font-weight: 700;
  color: var(--accent-strong);
}
.target-label { font-size: 12px; color: var(--text-soft); }

.hint {
  font-size: 14px;
  color: var(--text-soft);
  margin: 4px 2px 14px;
}

.meal-card summary {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  list-style: none;
  min-height: 32px;
}
.meal-card summary::-webkit-details-marker { display: none; }
.meal-card summary::after {
  content: "‹";
  margin-inline-start: auto;
  font-size: 22px;
  color: var(--text-muted);
  transition: transform 0.2s;
}
.meal-card[open] summary::after { transform: rotate(-90deg); }

.meal-title { font-size: 17px; font-weight: 500; }

.badge {
  font-size: 12px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-radius: 999px;
  padding: 1px 10px;
}

.meal-note {
  font-size: 14px;
  color: var(--text-soft);
  margin: 8px 0 4px;
}

.variant-name {
  font-weight: 700;
  color: var(--accent-strong);
  margin: 14px 0 0;
}
.variant-or, .plus {
  text-align: center;
  color: var(--text-muted);
  margin: 6px 0;
  font-weight: 500;
}

.group h4 {
  font-size: 15px;
  font-weight: 700;
  margin: 12px 0 6px;
}
.group-note { font-weight: 400; font-size: 13px; color: var(--text-soft); }

.options { list-style: none; margin: 0; padding: 0; }
.option {
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 8px 0;
  border-top: 1px solid var(--border);
}
.option:first-child { border-top: none; }
.amount {
  flex: 0 0 82px;
  font-weight: 700;
  color: var(--accent-strong);
  font-size: 15px;
}
.option-text { display: flex; flex-direction: column; }
.option-name { font-size: 15px; }
.option-details { font-size: 13px; color: var(--text-soft); }

.simple-list { margin: 8px 0 0; padding-inline-start: 20px; }
.simple-list li { margin: 4px 0; font-size: 15px; }

/* ===== מסך "היום" ===== */
.center { text-align: center; }

.progress-card {
  background: var(--accent-soft);
  border-color: transparent;
}
.progress-label { display: block; font-size: 14px; color: var(--accent-strong); }
.progress-num {
  display: block;
  font-size: 28px;
  font-weight: 700;
  color: var(--accent-strong);
  direction: ltr;
  text-align: right;
}
.progress-bar {
  height: 8px;
  background: var(--card);
  border-radius: 4px;
  margin-top: 8px;
  overflow: hidden;
}
.progress-bar > div {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.3s;
}

.workout-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.workout-toggle > span { flex: 1; display: flex; flex-direction: column; }
.workout-title { font-size: 16px; font-weight: 500; }
.workout-sub { font-size: 13px; color: var(--text-soft); }

/* מתג בסגנון אייפון */
.switch {
  appearance: none;
  -webkit-appearance: none;
  width: 52px;
  height: 32px;
  border-radius: 16px;
  background: var(--border);
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  margin: 0;
  transition: background 0.2s;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  right: 2px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: right 0.2s;
}
.switch:checked { background: var(--accent); }
.switch:checked::after { right: 22px; }

.today-meals { list-style: none; margin: 16px 0 0; padding: 0; }
.today-meal {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
}
.check {
  width: 44px;
  height: 44px;
  margin: -6px;
  padding: 6px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-muted);
  flex-shrink: 0;
}
.check svg {
  width: 32px;
  height: 32px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.check svg path { opacity: 0; }
.today-meal.done .check { color: var(--accent); }
.today-meal.done .check svg circle { fill: var(--accent); }
.today-meal.done .check svg path { opacity: 1; stroke: #fff; stroke-width: 2.4; }

.today-meal-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  color: inherit;
  text-decoration: none;
  min-height: 44px;
  justify-content: center;
}
.chevron {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.today-meal-name { font-size: 16px; font-weight: 500; }
.today-meal-status { font-size: 13px; color: var(--text-soft); }
.today-meal.done .today-meal-status { color: var(--accent-strong); }

/* --- קלוריות חופשיות --- */
.free-card { margin-top: 4px; }
.free-card h3 { font-size: 16px; font-weight: 700; margin: 0 0 4px; }
.free-summary { display: flex; align-items: baseline; gap: 8px; }
.free-left { font-size: 26px; font-weight: 700; color: var(--accent-strong); }
.free-total { font-size: 14px; color: var(--text-soft); }
.free-carried { font-size: 13px; color: var(--accent-strong); margin: 0; }
.free-card .progress-bar { background: var(--border); margin-bottom: 10px; }
.free-card.over .free-left { color: #B5660D; }
.free-card.over .progress-bar > div { background: #E09B3D; }

.free-list { list-style: none; margin: 0 0 10px; padding: 0; }
.free-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-top: 1px solid var(--border);
}
.free-name { flex: 1; font-size: 15px; }
.free-cal { font-weight: 500; color: var(--accent-strong); }
.free-del {
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  font-size: 22px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
}

.free-form { display: flex; gap: 8px; }
.free-form input {
  min-width: 0;
  height: 44px;
  font: inherit;
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 10px;
}
.free-form #free-name { flex: 1; }
.free-form #free-cal { width: 92px; text-align: center; }
.free-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.free-add {
  height: 44px;
  padding: 0 14px;
  font: inherit;
  font-weight: 700;
  color: var(--on-accent, #fff);
  background: var(--accent);
  border: none;
  border-radius: 10px;
  cursor: pointer;
}
.free-error { color: #C0392B; font-size: 13px; margin: 4px 0 0; min-height: 0; }
.free-error:empty { display: none; }

.free-examples { margin-top: 10px; }
.free-examples summary {
  font-size: 14px;
  color: var(--accent-strong);
  cursor: pointer;
  padding: 6px 0;
}
.free-examples .chips { margin-top: 6px; }
.chip.small { min-height: 36px; padding: 6px 10px; font-size: 14px; }

/* ===== יומן ===== */
.day-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.day-nav-title { flex: 1; text-align: center; font-size: 17px; font-weight: 500; }
.day-nav-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--accent-strong);
  flex-shrink: 0;
}
.day-nav-btn.disabled { visibility: hidden; }
.day-nav-btn svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.diary-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.diary-stats > div {
  background: var(--accent-soft);
  border-radius: 12px;
  padding: 10px 8px;
  text-align: center;
}
.stat-num { display: block; font-size: 20px; font-weight: 700; color: var(--accent-strong); }
.stat-label { font-size: 12px; color: var(--text-soft); line-height: 1.3; display: block; }

.diary-meal-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.diary-meal-name { flex: 1; font-size: 16px; font-weight: 700; }
.diary-meal-status { font-size: 13px; color: var(--text-soft); }
.diary-meal.done .diary-meal-status { color: var(--accent-strong); font-weight: 500; }
.diary-group {
  display: flex;
  gap: 10px;
  padding: 6px 0;
  border-top: 1px solid var(--border);
  font-size: 14px;
}
.diary-group-name { flex: 0 0 72px; color: var(--text-soft); }
.diary-group-items { flex: 1; }
.diary-group-pct { font-weight: 700; color: var(--accent-strong); }
.diary-empty-line { margin: 2px 0; }
.diary-photos:not(:empty) { margin: 10px 0 0; }
.diary-h3 { font-size: 16px; font-weight: 700; margin: 0 0 6px; }

.diary-recent-title { font-size: 18px; font-weight: 700; margin: 24px 0 8px; }
.diary-recent { list-style: none; margin: 0; padding: 0; }
.diary-recent a {
  display: flex;
  justify-content: space-between;
  padding: 12px 14px;
  margin-bottom: 6px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
}
.diary-recent a.current { border-color: var(--accent); background: var(--accent-soft); }

/* ===== הגדרות ===== */
.settings-card h3 { font-size: 16px; font-weight: 700; margin: 0 0 8px; }
.settings-title { font-size: 18px; font-weight: 700; margin: 22px 0 8px; }

.setting-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
  font-size: 15px;
}
.setting-line:first-of-type { border-top: none; }
.setting-line small { color: var(--text-soft); font-size: 12px; }

#settings-content input,
#settings-content textarea {
  font: inherit;
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  min-height: 42px;
  width: 100%;
}
#settings-content input:focus,
#settings-content textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.setting-line input { width: 96px !important; text-align: center; flex-shrink: 0; }

.setting-block { display: block; margin-top: 10px; font-size: 15px; }
.setting-block:first-of-type { margin-top: 0; }
.setting-block span { display: block; margin-bottom: 6px; font-weight: 500; }
.setting-block textarea { resize: vertical; line-height: 1.5; }

.edit-group h4 { font-size: 15px; font-weight: 700; margin: 14px 0 6px; }
.edit-option {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  margin-bottom: 8px;
  background: var(--bg);
  border-radius: 12px;
}
.edit-option input { background: var(--card) !important; }
.edit-row { display: flex; gap: 6px; }
.edit-row .edit-amount { width: 84px !important; flex-shrink: 0; text-align: center; }
.edit-del {
  flex-shrink: 0;
  font: inherit;
  font-size: 14px;
  color: #B83A3A;
  background: none;
  border: 1px solid #F0C4C4;
  border-radius: 10px;
  padding: 0 10px;
  cursor: pointer;
}
.edit-add {
  width: 100%;
  font: inherit;
  font-size: 15px;
  color: var(--accent-strong);
  background: none;
  border: 1.5px dashed var(--accent);
  border-radius: 12px;
  min-height: 44px;
  cursor: pointer;
}

.reset-btn {
  display: block;
  width: 100%;
  margin-top: 20px;
  font: inherit;
  font-size: 15px;
  color: var(--text-soft);
  background: none;
  border: 1px solid var(--border);
  border-radius: 12px;
  min-height: 48px;
  cursor: pointer;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 14px);
  transform: translate(-50%, 20px);
  background: var(--text);
  color: var(--bg);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 15px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 40;
  max-width: calc(100% - 32px);
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ===== מסך ארוחה ===== */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent-strong);
  text-decoration: none;
  font-size: 15px;
  margin: -4px 0 8px;
  min-height: 44px;
}
.back-link svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#screen-meal h1 { margin-bottom: 4px; }
#screen-meal .meal-note { margin-bottom: 14px; }

.segmented {
  display: flex;
  background: var(--border);
  border-radius: 12px;
  padding: 3px;
  margin-bottom: 14px;
}
.segmented button {
  flex: 1;
  border: none;
  background: none;
  font: inherit;
  font-size: 15px;
  color: var(--text);
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
}
.segmented button.selected {
  background: var(--card);
  font-weight: 700;
  color: var(--accent-strong);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.pick-group h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 10px;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  font: inherit;
  text-align: right;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 12px;
  cursor: pointer;
  min-height: 44px;
  transition: background 0.15s, border-color 0.15s;
}
.chip-name { font-size: 15px; line-height: 1.3; }
.chip-amount { font-size: 13px; color: var(--accent-strong); font-weight: 500; }
.chip.selected {
  background: var(--accent-soft);
  border: 2px solid var(--accent);
  padding: 7px 11px;
}
.chip.selected .chip-name { font-weight: 500; }

/* --- המחשבון --- */
.calc {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.calc-title {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-soft);
}
.calc-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}
.calc-name {
  flex: 1;
  font-size: 15px;
  display: flex;
  flex-direction: column;
  line-height: 1.35;
}
.calc-details { font-size: 12px; color: var(--text-soft); }
.calc-input {
  display: flex;
  align-items: center;
  gap: 4px;
}
.calc-input input {
  width: 72px;
  height: 40px;
  font: inherit;
  font-size: 17px; /* 16 ומעלה: האייפון לא עושה זום כשנכנסים לשדה */
  text-align: center;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  -moz-appearance: textfield;
}
.calc-input input::-webkit-outer-spin-button,
.calc-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.calc-input input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.calc-unit { font-size: 13px; color: var(--text-soft); min-width: 40px; }
.calc-pct {
  min-width: 48px;
  text-align: left;
  font-weight: 700;
  color: var(--accent-strong);
  direction: ltr;
}

.group-total {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg);
}
.group-total-line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 14px;
}
.group-total-msg { color: var(--text-soft); }
.group-total.full .group-total-msg { color: var(--accent-strong); font-weight: 500; }
.group-total.over .group-total-msg { color: #B5660D; font-weight: 500; }
.group-total.over .progress-bar > div { background: #E09B3D; }
.group-total .progress-bar { background: var(--border); }

.pick-details {
  font-size: 13px;
  color: var(--text-soft);
  margin: 10px 0 0;
}

/* --- תמונות --- */
.photos-card h3 { font-size: 16px; font-weight: 700; margin: 0 0 10px; }
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.photo-grid:not(:empty) { margin-bottom: 12px; }
.photo-thumb {
  position: relative;
  aspect-ratio: 1;
  padding: 0;
  border: none;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  background: var(--border);
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-time {
  position: absolute;
  bottom: 4px;
  right: 4px;
  font-size: 11px;
  color: #fff;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 6px;
  padding: 0 6px;
}
.photo-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  border: 1.5px dashed var(--accent);
  border-radius: 12px;
  color: var(--accent-strong);
  font-weight: 500;
  cursor: pointer;
}
.photo-btn svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linejoin: round;
}
.photo-status { font-size: 13px; color: var(--text-soft); margin: 6px 0 0; min-height: 1em; }

.photo-viewer {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: calc(env(safe-area-inset-top) + 16px) 16px calc(env(safe-area-inset-bottom) + 16px);
}
.photo-viewer[hidden] { display: none; }
.photo-viewer img {
  max-width: 100%;
  max-height: calc(100% - 80px);
  object-fit: contain;
  border-radius: 8px;
}
.photo-viewer-actions { display: flex; gap: 12px; }
.viewer-btn {
  font: inherit;
  font-size: 16px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: transparent;
  color: #fff;
  cursor: pointer;
}
.viewer-btn.danger { border-color: #F09595; color: #F7C1C1; }

.primary-btn {
  display: block;
  width: 100%;
  font: inherit;
  font-size: 17px;
  font-weight: 700;
  color: var(--on-accent, #fff);
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  padding: 15px;
  margin-top: 8px;
  cursor: pointer;
}
.primary-btn.is-done {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

/* ===== תפריט תחתון ===== */
.tabbar {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  display: flex;
  justify-content: space-around;
  background: var(--card);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 10;
}

.tab {
  flex: 1;
  height: var(--tabbar-h);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 12px;
}

.tab svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tab.active {
  color: var(--accent-strong);
  font-weight: 500;
}

/* =====================================================
   עיצוב "רך ועגול": מה שמחליף את המראה הבסיסי
   ===================================================== */

/* צבעי ארוחה: כל כרטיס מקבל את הצבעים שלו */
.theme-first  { --m-bg: var(--first-bg);  --m-text: var(--first-text);  --m-ring: var(--first-ring); }
.theme-snack  { --m-bg: var(--snack-bg);  --m-text: var(--snack-text);  --m-ring: var(--snack-ring); }
.theme-dinner { --m-bg: var(--dinner-bg); --m-text: var(--dinner-text); --m-ring: var(--dinner-ring); }
.theme-post   { --m-bg: var(--post-bg);   --m-text: var(--post-text);   --m-ring: var(--post-ring); }

h1 { font-size: 28px; font-weight: 600; letter-spacing: -0.2px; }

.card {
  border: none;
  border-radius: var(--radius);
  box-shadow: 0 2px 10px rgba(180, 90, 90, 0.07);
}
@media (prefers-color-scheme: dark) {
  .card { box-shadow: none; }
}

/* --- כרטיס הברכה --- */
.hero {
  background: var(--hero);
  color: #fff;
  border-radius: 26px;
  padding: 18px 18px 20px;
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
}
.hero::before, .hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
}
.hero::before { width: 140px; height: 140px; top: -50px; left: -40px; }
.hero::after { width: 80px; height: 80px; bottom: -30px; left: 70px; }
.hero > * { position: relative; }
.hero h1 { color: #fff; margin: 0; font-size: 28px; line-height: 1.25; }
.hero-date { margin: 0 0 2px; font-size: 14px; opacity: 0.92; }
.hero-quote {
  margin: 12px 0 0;
  padding: 10px 12px;
  font-size: 15px;
  line-height: 1.5;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 14px;
}

/* --- ריבועי סיכום עם עיגולי התקדמות --- */
.stat-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.stat-tile {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: var(--radius);
  padding: 12px;
  text-decoration: none;
}
.tile-peach { background: var(--peach); color: var(--peach-text); --ring-color: #F2A33D; }
.tile-mint  { background: var(--mint);  color: var(--mint-text);  --ring-color: var(--ok); }
.tile-sky   { background: var(--sky);   color: var(--sky-text);   --ring-color: #4A9BEA; }
.tile-text { display: flex; flex-direction: column; min-width: 0; }
.tile-label { font-size: 12px; opacity: 0.85; }
.tile-value { font-family: var(--font-title); font-size: 17px; font-weight: 600; line-height: 1.25; }

.ring { width: 52px; height: 52px; flex-shrink: 0; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: rgba(255, 255, 255, 0.6); stroke-width: 6; }
.ring-fill {
  fill: none;
  stroke: var(--ring-color, var(--accent));
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.5s ease;
}
.ring-text {
  transform: rotate(90deg);
  transform-origin: 26px 26px;
  text-anchor: middle;
  dominant-baseline: middle;
  font-family: var(--font-title);
  font-size: 13px;
  font-weight: 600;
  fill: currentColor;
  direction: ltr;
}
@media (prefers-color-scheme: dark) {
  .ring-track { stroke: rgba(255, 255, 255, 0.12); }
}

/* --- מתג יום אימון --- */
.workout-toggle .workout-title { font-family: var(--font-title); font-weight: 600; }
.switch:checked { background: var(--post-ring); }

/* --- כרטיסי הארוחות במסך "היום" --- */
.today-meal {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--m-bg);
  color: var(--m-text);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 10px;
  transition: transform 0.15s;
}
.today-meal:active { transform: scale(0.98); }
.meal-emoji {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 16px;
}
.meal-emoji.small { width: 34px; height: 34px; font-size: 20px; border-radius: 12px; }
@media (prefers-color-scheme: dark) {
  .meal-emoji { background: rgba(255, 255, 255, 0.1); }
}
.today-meal-name { font-family: var(--font-title); font-size: 18px; font-weight: 600; color: var(--m-text); }
.today-meal-status, .today-meal.done .today-meal-status { color: var(--m-text); opacity: 0.8; font-size: 13px; }
.today-meal .check { color: var(--m-ring); }
.today-meal.done .check { color: var(--m-ring); }
.today-meal.done .check svg circle { fill: var(--m-ring); }
.today-meal .check svg circle { stroke-width: 2; }
.today-meal.done .check svg { animation: pop 0.35s ease; }

@keyframes pop {
  0% { transform: scale(0.6); }
  60% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* --- מסך ארוחה --- */
.meal-hero {
  background: var(--m-bg);
  color: var(--m-text);
  border-radius: 26px;
  padding: 16px 18px;
  margin-bottom: 14px;
}
.meal-hero h1 { color: var(--m-text); margin: 4px 0 0; font-size: 26px; }
.meal-hero-emoji { font-size: 34px; line-height: 1; }
.meal-hero .meal-note { color: var(--m-text); opacity: 0.85; margin: 6px 0 0; }
#screen-meal h1 { margin-bottom: 0; }
.back-link { font-weight: 500; }

.pick-group h3 { font-family: var(--font-title); font-weight: 600; font-size: 18px; }
.chip {
  border-radius: 16px;
  background: var(--bg);
  border-color: transparent;
}
.chip-name { font-weight: 500; }
.chip.selected { background: var(--accent-soft); border-color: var(--accent); }
.chip.selected .chip-amount { color: var(--accent-strong); }
.chip-amount { color: var(--ok-strong); }

.segmented { background: var(--accent-soft); border-radius: 16px; }
.segmented button { border-radius: 13px; font-family: var(--font-title); font-weight: 500; }
.segmented button.selected { color: var(--accent-strong); }

.calc-pct { color: var(--accent-strong); font-family: var(--font-title); }
.group-total { border-radius: 14px; }
.group-total.full { background: var(--ok-soft); }
.group-total.full .group-total-msg { color: var(--ok-strong); }
.group-total.full .progress-bar > div { background: var(--ok); }
.group-total.over .group-total-msg { color: var(--warn-strong); }
.group-total.over .progress-bar > div { background: var(--warn); }
.progress-bar > div { background: var(--accent); }

.photo-btn { border-color: var(--accent); color: var(--accent-strong); border-radius: 16px; }

.primary-btn {
  font-family: var(--font-title);
  font-size: 19px;
  font-weight: 600;
  border-radius: 20px;
  padding: 16px;
  box-shadow: 0 6px 16px rgba(217, 70, 106, 0.28);
}
.primary-btn.is-done { background: var(--ok-soft); color: var(--ok-strong); box-shadow: none; }

/* --- קלוריות חופשיות --- */
.free-card h3 { font-family: var(--font-title); font-weight: 600; font-size: 18px; }
.free-left { color: var(--ok-strong); }
.free-card .progress-bar > div { background: var(--ok); }
.free-card.over .free-left { color: var(--warn-strong); }
.free-card.over .progress-bar > div { background: var(--warn); }
.free-cal { color: var(--accent-strong); }
.free-add { border-radius: 14px; font-family: var(--font-title); }

/* --- מסך התפריט --- */
.targets { background: var(--peach); grid-template-columns: repeat(2, 1fr); row-gap: 10px; }
.diary-stats { grid-template-columns: repeat(2, 1fr); }
.diary-stats > div:nth-child(4) { background: var(--sky); }
.diary-stats > div:nth-child(4) .stat-num, .diary-stats > div:nth-child(4) .stat-label { color: var(--sky-text); }
.target-num { color: var(--peach-text); }
.target-label { color: var(--peach-text); opacity: 0.85; }
.menu-meal { background: var(--m-bg); }
.menu-meal .meal-title { color: var(--m-text); font-weight: 600; }
.menu-meal .meal-note, .menu-meal .variant-name { color: var(--m-text); }
.menu-meal .group {
  background: var(--card);
  border-radius: 16px;
  padding: 2px 12px 6px;
  margin-top: 10px;
}
.menu-meal .group h4 { margin-top: 10px; }
.menu-meal .plus, .menu-meal .variant-or { color: var(--m-text); }
.amount { color: var(--accent-strong); font-family: var(--font-title); }
.badge { background: var(--card); color: var(--m-text, var(--accent-strong)); }

/* --- יומן --- */
.diary-stats > div { background: var(--peach); }
.diary-stats > div:nth-child(2) { background: var(--mint); }
.diary-stats > div:nth-child(3) { background: var(--accent-soft); }
.diary-stats > div:nth-child(1) .stat-num, .diary-stats > div:nth-child(1) .stat-label { color: var(--peach-text); }
.diary-stats > div:nth-child(2) .stat-num, .diary-stats > div:nth-child(2) .stat-label { color: var(--mint-text); }
.diary-stats > div:nth-child(3) .stat-num, .diary-stats > div:nth-child(3) .stat-label { color: var(--accent-strong); }
.diary-meal { border-top: 6px solid var(--m-ring); border-radius: 0 0 var(--radius) var(--radius); }
.diary-meal-name { font-family: var(--font-title); font-weight: 600; }
.diary-meal.done .diary-meal-status { color: var(--ok-strong); }
.diary-group-pct { color: var(--accent-strong); }
.day-nav-btn { border: none; box-shadow: 0 2px 10px rgba(180, 90, 90, 0.08); border-radius: 16px; }
.diary-recent a { border: none; border-radius: 16px; }
.diary-recent a.current { background: var(--accent-soft); }

/* --- הגדרות --- */
.settings-meal { background: var(--card); }
.edit-option { border-radius: 16px; }
.toast { font-family: var(--font-title); }

/* --- תפריט תחתון --- */
.tabbar {
  border-top: none;
  box-shadow: 0 -4px 18px rgba(180, 90, 90, 0.08);
  border-radius: 22px 22px 0 0;
}
.tab.active svg { stroke-width: 2.2; }
.tab.active span {
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 0 10px;
}

/* --- כרטיס ארוחה במסך "היום": כל הכרטיס לחיץ --- */
a.today-meal { text-decoration: none; cursor: pointer; }
.today-meal .check { pointer-events: none; }
.today-meal-eaten {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--m-text);
  background: rgba(255, 255, 255, 0.55);
  border-radius: 10px;
  padding: 4px 8px;
}
@media (prefers-color-scheme: dark) {
  .today-meal-eaten { background: rgba(255, 255, 255, 0.08); }
}

/* --- מסך ארוחה: שאלה, שגיאה וכפתור ביטול --- */
.meal-ask {
  margin: 10px 0 0;
  font-family: var(--font-title);
  font-size: 17px;
  font-weight: 600;
  color: var(--m-text);
}
.meal-done-error {
  margin: 0 0 6px;
  text-align: center;
  font-weight: 500;
  color: var(--accent-strong);
}
.meal-done-error:empty { display: none; }
.text-btn {
  display: block;
  margin: 12px auto 0;
  background: none;
  border: none;
  font: inherit;
  font-size: 14px;
  color: var(--text-soft);
  text-decoration: underline;
  cursor: pointer;
  min-height: 44px;
}

/* --- אייקונים של מאכלים --- */
.food-icon { line-height: 1; flex-shrink: 0; }
.option-icon {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: var(--bg);
  border-radius: 12px;
  align-self: center;
}
.chip { flex-direction: row; align-items: center; gap: 8px; }
.chip-icon { font-size: 24px; }
.chip-text { display: flex; flex-direction: column; align-items: flex-start; }
.calc-icon { font-size: 22px; }
#settings-content .edit-icon {
  width: 52px !important;
  flex-shrink: 0;
  text-align: center;
  font-size: 22px;
  padding: 4px;
}

/* --- כפתור הגדרות בכרטיס הברכה --- */
.gear-btn {
  position: absolute !important;
  top: 12px;
  left: 12px;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  z-index: 2;
}
.gear-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.hero h1, .hero-date { padding-left: 44px; }

/* --- אימון: הכרטיס במסך "היום" --- */
.training-card { background: var(--post-bg); color: var(--post-text); padding: 6px 14px 10px; }
.training-link { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; min-height: 64px; }
.training-link .workout-title { font-family: var(--font-title); font-size: 18px; font-weight: 600; }
.training-link .workout-sub { font-size: 13px; opacity: 0.85; }
.training-link .chevron { stroke: var(--post-text); }
.training-card .workout-toggle {
  border-top: 1px solid rgba(0, 0, 0, 0.07);
  padding-top: 8px;
  margin-top: 2px;
}
.workout-sub-title { font-size: 14px; font-weight: 500; }
.training-card .workout-toggle .workout-sub { font-size: 12px; opacity: 0.8; color: inherit; }
.training-card.done .workout-sub { font-weight: 500; }

/* --- מסך האימון --- */
.workout-hero .workout-bar { background: rgba(255, 255, 255, 0.6); margin-top: 10px; }
.workout-hero .workout-bar > div { background: var(--post-ring); }
.exercise-card { position: relative; }
.exercise-card.done { background: var(--ok-soft); }
.exercise-top { display: flex; gap: 12px; align-items: center; }
/* איורים עדינים: ורוד-שזיף על רקע ורוד-לבנדר רך */
:root { --ea-ink: #C8507A; --ea-hair: #8E3A5E; --ea-prop: #E9D5FF; --ea-move: #A78BDA; --ea-spark: #F2B33D; --ea-bg: #FFF0F4; }
@media (prefers-color-scheme: dark) {
  :root { --ea-ink: #FFB3C8; --ea-hair: #F7D2E0; --ea-prop: #4B3A73; --ea-move: #C9B6F5; --ea-spark: #F2C46B; --ea-bg: #3A2430; }
}
.exercise-art-box {
  width: 108px;
  height: 70px;
  flex-shrink: 0;
  background: var(--ea-bg);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.exercise-card.done .exercise-art-box { background: var(--card); }
.exercise-art { width: 100px; height: 62px; }
.ea-body { fill: none; stroke: var(--ea-ink); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.ea-body.thin { stroke-width: 3; }
.ea-head { fill: var(--ea-ink); }
.ea-pony { fill: none; stroke: var(--ea-hair); stroke-width: 3.2; stroke-linecap: round; }
.ea-bun { fill: var(--ea-hair); }
.ea-prop { fill: var(--ea-prop); }
.ea-prop.soft { opacity: 0.7; }
.ea-floor { stroke: var(--ea-prop); stroke-width: 2; stroke-linecap: round; }
.ea-move { fill: none; stroke: var(--ea-move); stroke-width: 2; stroke-dasharray: 1 4; stroke-linecap: round; }
.ea-move-head { fill: none; stroke: var(--ea-move); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ea-spark { fill: var(--ea-spark); opacity: 0.85; }
.exercise-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.exercise-num { font-size: 12px; color: var(--text-soft); }
.exercise-info h3 { margin: 0; font-family: var(--font-title); font-size: 18px; font-weight: 600; line-height: 1.25; }
.exercise-sets-label { font-size: 14px; color: var(--post-text); font-weight: 500; }
.exercise-best { font-size: 12px; color: var(--first-text); }
.exercise-check {
  position: absolute;
  top: 10px;
  left: 12px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ok);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  animation: pop 0.35s ease;
}

.set-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.set-dot {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2.5px solid var(--post-ring);
  background: var(--card);
  color: var(--post-text);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font: inherit;
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s, background 0.2s;
}
.set-dot:active { transform: scale(0.92); }
.set-n { font-family: var(--font-title); font-size: 18px; font-weight: 600; line-height: 1; }
.set-i { font-size: 10px; opacity: 0.8; }
.set-dot.on { background: var(--post-ring); border-color: var(--post-ring); color: #fff; animation: pop 0.3s ease; }
.set-dot.max input {
  width: 40px;
  border: none;
  background: transparent;
  text-align: center;
  font-family: var(--font-title);
  font-size: 18px;
  font-weight: 600;
  color: inherit;
  padding: 0;
  -moz-appearance: textfield;
}
.set-dot.max input::-webkit-outer-spin-button,
.set-dot.max input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.set-dot.max input:focus { outline: none; }
.set-dot.max input::placeholder { color: var(--post-text); opacity: 0.5; }
.set-dot.max:focus-within { box-shadow: 0 0 0 3px var(--accent-soft); }

/* --- שעון האימון --- */
.clock-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 18px;
  padding: 8px 10px 8px 8px;
}
@media (prefers-color-scheme: dark) { .clock-row { background: rgba(255, 255, 255, 0.07); } }
.clock-face { display: flex; flex-direction: column; }
.clock-label { font-size: 12px; opacity: 0.8; }
.clock-time {
  font-family: var(--font-title);
  font-size: 30px;
  font-weight: 600;
  line-height: 1.1;
  direction: ltr;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.clock-face.running .clock-time { color: var(--accent-strong); }
.clock-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.clock-btn {
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 14px;
  border: none;
  background: var(--post-ring);
  color: #fff;
  cursor: pointer;
}
.clock-btn.main { background: var(--accent); font-family: var(--font-title); font-size: 15px; }
.clock-btn.ghost { background: transparent; color: var(--post-text); border: 1.5px solid var(--post-ring); }

/* --- טיימר מנוחה --- */
.rest-bar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 10px);
  max-width: 536px;
  margin: 0 auto;
  background: var(--card);
  border-radius: 22px;
  box-shadow: 0 8px 28px rgba(150, 60, 80, 0.22);
  padding: 10px 12px;
  z-index: 30;
  animation: rest-in 0.25s ease;
}
.rest-bar[hidden] { display: none; }
@keyframes rest-in { from { transform: translateY(20px); opacity: 0; } }
.rest-run { display: flex; align-items: center; gap: 8px; }
.rest-ring { width: 48px; height: 48px; transform: rotate(-90deg); flex-shrink: 0; }
.rest-track { fill: none; stroke: var(--post-bg); stroke-width: 5; }
.rest-fill { fill: none; stroke: var(--post-ring); stroke-width: 5; stroke-linecap: round; transition: stroke-dashoffset 0.25s linear; }
.rest-text { display: flex; flex-direction: column; flex: 1; }
.rest-title { font-size: 13px; color: var(--text-soft); font-weight: 500; }
.rest-time { font-family: var(--font-title); font-size: 26px; font-weight: 600; line-height: 1.1; color: var(--post-text); direction: ltr; text-align: right; font-variant-numeric: tabular-nums; }
.rest-btn {
  font: inherit;
  font-size: 13px;
  min-height: 40px;
  padding: 0 10px;
  border-radius: 12px;
  border: 1.5px solid var(--post-ring);
  background: transparent;
  color: var(--post-text);
  cursor: pointer;
}
.rest-btn.primary { background: var(--post-ring); color: #fff; }
.rest-btn.icon { padding: 0 8px; border: none; font-size: 18px; }
.rest-ask .rest-title { display: block; margin-bottom: 8px; font-family: var(--font-title); font-size: 16px; color: var(--text); }
.rest-choices { display: flex; flex-wrap: wrap; gap: 6px; }
.rest-choices button {
  flex: 1 1 auto;
  font: inherit;
  font-size: 14px;
  min-height: 42px;
  border-radius: 12px;
  border: none;
  background: var(--post-bg);
  color: var(--post-text);
  font-weight: 500;
  cursor: pointer;
}
.rest-off {
  display: block;
  margin: 8px auto 0;
  background: none;
  border: none;
  font: inherit;
  font-size: 13px;
  color: var(--text-soft);
  text-decoration: underline;
  cursor: pointer;
  min-height: 36px;
}
#screen-workout { padding-bottom: 90px; }

#settings-content .edit-mini { display: flex; flex-direction: column; flex: 1; font-size: 12px; color: var(--text-soft); }
#settings-content .edit-mini input { text-align: center; }

/* --- משקל --- */
.weight-card { background: var(--dinner-bg); color: var(--dinner-text); --m-ring: var(--dinner-ring); }
.weight-card h3 { margin: 0; font-family: var(--font-title); font-size: 19px; font-weight: 600; color: var(--dinner-text); }
.weight-head { display: flex; align-items: center; justify-content: space-between; }
.text-btn.small { margin: 0; min-height: 36px; font-size: 13px; color: var(--dinner-text); }
.weight-intro { margin: 6px 0 10px; font-size: 15px; }
.weight-form { display: flex; flex-direction: column; gap: 10px; }
.weight-form label span { display: block; font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.weight-card input {
  width: 100%;
  min-width: 0;
  height: 46px;
  font: inherit;
  font-size: 17px;
  color: var(--text);
  background: var(--card);
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 0 12px;
}
.weight-card input:focus { outline: none; border-color: var(--dinner-ring); box-shadow: 0 0 0 3px rgba(157, 136, 232, 0.25); }
.primary-btn.small { font-size: 17px; padding: 12px; margin-top: 4px; }

.weight-numbers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0 8px;
  text-align: center;
}
.weight-numbers > div { background: rgba(255, 255, 255, 0.6); border-radius: 14px; padding: 8px 4px; }
@media (prefers-color-scheme: dark) { .weight-numbers > div { background: rgba(255, 255, 255, 0.07); } }
.wn-num { display: block; font-family: var(--font-title); font-size: 22px; font-weight: 600; direction: ltr; }
.wn-label { font-size: 12px; opacity: 0.85; }
.weight-remaining { margin: 6px 0; font-size: 17px; text-align: center; font-family: var(--font-title); font-weight: 500; }
.weight-remaining b { font-size: 22px; }
.weight-remaining.reached { font-size: 20px; font-weight: 600; }
.weight-bar { background: rgba(255, 255, 255, 0.6) !important; }
.weight-bar > div { background: var(--dinner-ring) !important; }
.weight-change { margin: 6px 0 4px; text-align: center; font-size: 14px; opacity: 0.85; }

.weight-chart { width: 100%; height: auto; margin: 10px 0 4px; display: block; }
.wc-line { fill: none; stroke: var(--dinner-ring); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.wc-dot { fill: var(--card); stroke: var(--dinner-ring); stroke-width: 2; }
.wc-last { fill: var(--dinner-ring); stroke: var(--card); stroke-width: 2.5; }
.wc-goal { stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 5 4; }
.wc-goal-label { font-size: 11px; fill: var(--accent-strong); font-family: var(--font-body); }
.wc-axis { font-size: 10px; fill: currentColor; opacity: 0.7; font-family: var(--font-body); }

.weight-inline { display: flex; gap: 8px; margin-top: 10px; }
.weight-inline #w-kg, .weight-inline #w-goal { flex: 1; }
.weight-inline #w-date { flex: 1.2; font-size: 15px; }
.weight-inline .free-add { flex-shrink: 0; height: 46px; background: var(--dinner-ring); color: #fff; }
.weight-add { flex-wrap: wrap; }
.weight-add #w-kg { flex: 1 1 90px; }
.weight-add #w-date { flex: 1.6 1 150px; }
.weight-add .free-add { flex: 1 1 100%; }
.wc-goal-label, .wc-axis { direction: ltr; unicode-bidi: plaintext; }
.weight-history { margin-top: 8px; }
.weight-history summary { cursor: pointer; font-size: 14px; padding: 6px 0; }
.weight-history .free-list li { border-color: rgba(0, 0, 0, 0.06); }
.weight-history .free-cal { color: var(--dinner-text); direction: ltr; }

.weight-reminder {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--dinner-bg);
  color: var(--dinner-text);
  text-decoration: none;
}
.wr-emoji { font-size: 30px; }
.wr-text { display: flex; flex-direction: column; font-size: 13px; }
.wr-text b { font-family: var(--font-title); font-size: 16px; font-weight: 600; }
.diary-days-title { margin-top: 18px; }

/* --- רשימת קניות --- */
.shop-summary { margin-bottom: 12px; }
.shop-form { display: flex; gap: 8px; padding: 10px; }
.shop-form input {
  min-width: 0;
  height: 46px;
  font: inherit;
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 12px;
}
.shop-form #shop-name { flex: 1; }
.shop-form #shop-qty { width: 84px; }
.shop-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.shop-form .free-add { height: 46px; }

.shop-list { list-style: none; margin: 12px 0; padding: 0; }
.shop-item {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--card);
  border-radius: 18px;
  margin-bottom: 8px;
  padding-inline-end: 4px;
  box-shadow: 0 2px 10px rgba(180, 90, 90, 0.06);
  transition: opacity 0.2s;
}
.shop-toggle {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 8px 12px;
  background: none;
  border: none;
  font: inherit;
  color: var(--text);
  text-align: right;
  cursor: pointer;
}
.shop-check {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2.5px solid var(--snack-ring);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.shop-icon { font-size: 24px; line-height: 1; }
.shop-text { display: flex; flex-direction: column; }
.shop-name { font-size: 16px; font-weight: 500; }
.shop-qty { font-size: 13px; color: var(--text-soft); }
.shop-item.in-cart { background: var(--ok-soft); box-shadow: none; }
.shop-item.in-cart .shop-check { border-color: var(--ok); background: var(--card); animation: pop 0.35s ease; }
.shop-item.in-cart .shop-name { text-decoration: line-through; color: var(--ok-strong); }
.shop-item.in-cart .shop-qty { color: var(--ok-strong); }
.shop-empty { margin-top: 12px; }
.shop-quick summary {
  cursor: pointer;
  font-family: var(--font-title);
  font-weight: 600;
  color: var(--accent-strong);
  padding: 4px 0;
}
.shop-quick .chips { margin-top: 10px; }
.chip.small .food-icon { font-size: 18px; }

/* תפריט תחתון עם 5 לשוניות */
.tab { font-size: 11px; }
.tab svg { width: 24px; height: 24px; }

/* --- מים --- */
.water-card { background: var(--sky); color: var(--sky-text); }
.water-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.water-head h3 { margin: 0; font-size: 18px; font-weight: 600; color: var(--sky-text); }
.water-count { font-size: 14px; font-weight: 500; }
.water-card.done .water-count { font-family: var(--font-title); font-weight: 600; }
.bottles { display: flex; gap: 22px; justify-content: center; }
.bottle {
  flex: 0 0 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  padding: 4px 0;
  cursor: pointer;
  font: inherit;
  color: var(--sky-text);
}
.bottle-cap {
  width: 22px;
  height: 8px;
  border-radius: 4px 4px 2px 2px;
  background: #4A9BEA;
}
.bottle-body {
  position: relative;
  width: 54px;
  height: 96px;
  border-radius: 18px 18px 16px 16px;
  background: rgba(255, 255, 255, 0.7);
  border: 2px solid #8CC3F5;
  overflow: hidden;
}
.bottle-water {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 0;
  background: #4A9BEA;
  transition: height 0.45s cubic-bezier(0.3, 1.4, 0.5, 1);
}
.bottle.full .bottle-water { height: 100%; }
.bottle.full .bottle-body { border-color: #4A9BEA; }
.bottle-label { font-size: 13px; font-weight: 500; }
@media (prefers-color-scheme: dark) {
  .bottle-body { background: rgba(255, 255, 255, 0.06); border-color: #2F6FAF; }
  .bottle-cap, .bottle-water { background: #5AA9F2; }
}

/* --- קונפטי --- */
.confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 60;
}
.confetti i {
  position: absolute;
  top: -12px;
  width: 9px;
  height: 14px;
  border-radius: 3px;
  animation-name: confetti-fall;
  animation-timing-function: cubic-bezier(0.25, 0.6, 0.5, 1);
  animation-fill-mode: forwards;
}
@keyframes confetti-fall {
  to {
    transform: translate(var(--drift), 70vh) rotate(var(--spin));
    opacity: 0;
  }
}
