/* "מה בא לי להכין?" — שפה ים-תיכונית מודרנית: גברת לוין + Rubik, RTL, Mobile First */
:root {
  --bg: #faf6f0;          /* Cream */
  --bg-deep: #f1e9dc;
  --card: #fffefb;
  --ink: #1e1e1e;         /* Soft Charcoal */
  --ink-soft: #6e6862;
  --ink-faint: #a8a29b;
  --accent: #ee6a4d;      /* Coral: CTA, לבבות, נגיעות */
  --accent-deep: #d5502f;
  --accent-soft: #fbe0d8;
  --mustard: #f7c845;     /* קטגוריות ואלמנטים שמחים */
  --mustard-soft: #fbeec6;
  --gold: #5ca77e;        /* Sage */
  --gold-soft: #ddebe0;
  --sage: #406b63;        /* Deep Green: accent עמוק וטקסט על רקעים רכים */
  --peach: #f6a98d;
  --peach-soft: #fce3d7;
  --coral: #ee6a4d;
  --coral-soft: #fbe0d8;
  --sage-soft: #ddebe0;
  --deep: #406b63;
  --deep-soft: #dbe7e4;
  --line: #ebe2d4;
  --shadow-sm: 0 1px 4px rgba(30, 30, 30, .07);
  --shadow: 0 4px 18px rgba(30, 30, 30, .10);
  --shadow-lg: 0 10px 34px rgba(30, 30, 30, .16);
  --radius: 20px;
  --serif: 'Gveret Levin', 'Rubik', -apple-system, sans-serif;
  --sans: 'Rubik', -apple-system, sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  background:
    radial-gradient(1000px 500px at 85% -80px, #fbeec6 0%, transparent 60%),
    radial-gradient(800px 420px at -120px 300px, #ddebe0 0%, transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  min-height: 100vh; direction: rtl;
  padding-bottom: env(safe-area-inset-bottom);
}
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }

.view { max-width: 680px; margin: 0 auto; padding: 0 18px 48px; animation: viewIn .35s ease both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- בית ---------- */
.home-header { padding-top: max(30px, env(safe-area-inset-top)); text-align: center; position: relative; }
.settings-btn { position: absolute; left: 0; top: max(26px, env(safe-area-inset-top)); }
.icon-btn {
  border: 0; background: var(--card); box-shadow: var(--shadow);
  width: 44px; height: 44px; border-radius: 50%; font-size: 18px; color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform .15s ease, box-shadow .15s ease;
}
.icon-btn:active { transform: scale(.92); }

.home-kicker {
  display: inline-block; font-size: 13px; letter-spacing: .12em; font-weight: 700;
  color: var(--accent); text-transform: uppercase; margin-bottom: 6px;
}
.home-kicker::before, .home-kicker::after { content: '·'; margin: 0 8px; color: var(--gold); }
.home-title {
  font-family: var(--serif); font-weight: 400; font-size: 40px; line-height: 1.15;
  margin: 2px 0 20px; padding-left: 50px; text-align: right;
}
.home-title em { font-style: normal; color: var(--accent); }

.search-wrap { position: relative; }
.search-big {
  width: 100%; padding: 17px 52px 17px 20px; border: 1.5px solid transparent; border-radius: 999px;
  background: var(--card); box-shadow: var(--shadow); font-size: 17px; font-family: inherit; color: var(--ink);
  transition: box-shadow .2s ease, border-color .2s ease;
}
.search-big:focus { outline: none; border-color: var(--accent); box-shadow: var(--shadow-lg); }
.search-big::placeholder { color: var(--ink-faint); }
.search-icon { position: absolute; right: 20px; top: 50%; transform: translateY(-50%); opacity: .5; pointer-events: none; }
.search-wrap.small .search-big { padding: 13px 20px; box-shadow: var(--shadow-sm); }

/* צ'יפים */
.chips-row { display: flex; flex-wrap: wrap; gap: 8px; padding: 16px 0 4px; }
.chip {
  flex: 0 0 auto; padding: 9px 16px; border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--card); font-size: 14.5px; font-weight: 600; color: var(--ink); white-space: nowrap;
  box-shadow: var(--shadow-sm); transition: all .15s ease;
}
.chip:active { transform: scale(.95); }
.chip.on { background: linear-gradient(135deg, var(--accent), var(--accent-deep)); border-color: transparent; color: #fff; box-shadow: 0 4px 12px rgba(238, 106, 77, .35); }
.chips-row.tags .chip { font-size: 13px; padding: 7px 13px; background: transparent; box-shadow: none; }
.chips-row.tags .chip.on { background: linear-gradient(135deg, var(--gold), var(--sage)); border-color: transparent; color: #fff; box-shadow: 0 3px 10px rgba(92, 167, 126, .35); }

/* כותרות מקטע */
.home-section { margin-top: 30px; }
.home-section h2 {
  font-family: var(--serif); font-size: 25px; font-weight: 400;
  display: flex; align-items: center; gap: 12px; margin-bottom: 14px;
}
.home-section h2::after { content: ''; flex: 1; height: 1px; background: linear-gradient(to left, var(--line), transparent); }
.heart { color: var(--accent); }

.cards-row { display: flex; gap: 14px; overflow-x: auto; padding: 4px 2px 14px; scrollbar-width: none; }
.cards-row::-webkit-scrollbar { display: none; }
.cards-row .card { flex: 0 0 160px; }

/* אריחי קטגוריות */
.cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.cat-tile {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 16px 8px 13px; text-align: center; border: 1px solid rgba(236, 223, 205, .6);
  font-size: 14.5px; font-weight: 700; color: var(--ink);
  transition: transform .15s ease, box-shadow .15s ease;
  position: relative; overflow: hidden;
}
/* הכתם האורגני שמאחורי האייקון נותן את הצבע; בלי פס צבע נוסף על האריח */
.cat-tile:active { transform: scale(.96); }
.cat-tile .emoji { display: block; font-size: 30px; margin-bottom: 7px; position: relative; filter: drop-shadow(0 2px 3px rgba(66,58,69,.15)); }
.cat-tile .count { display: block; color: var(--ink-soft); font-weight: 500; font-size: 12px; margin-top: 2px; }

/* ---------- כרטיס מתכון ---------- */
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  overflow: hidden; border: 1px solid rgba(236, 223, 205, .5); text-align: right; padding: 0; color: var(--ink);
  display: flex; flex-direction: column; position: relative;
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:active { transform: scale(.97); }
.card-media { position: relative; overflow: hidden; }
.card-img { width: 100%; aspect-ratio: 4/3.1; object-fit: cover; display: block; background: var(--accent-soft); }
.card-ph {
  width: 100%; aspect-ratio: 4/3.1; display: flex; align-items: center; justify-content: center; font-size: 44px;
}
.card-ph .ph-emoji { filter: drop-shadow(0 3px 5px rgba(66,58,69,.18)); }
.card-scrim {
  position: absolute; inset: auto 0 0 0; height: 46%;
  background: linear-gradient(to top, rgba(50, 42, 52, .48), transparent); pointer-events: none;
}
.card-cat {
  position: absolute; bottom: 8px; right: 10px; font-size: 11.5px; font-weight: 700; color: #fff;
  background: rgba(50, 42, 52, .4); backdrop-filter: blur(4px); border-radius: 999px; padding: 4px 10px;
}
.card-body { padding: 11px 13px 13px; }
.card-name { font-family: var(--sans); font-size: 15.5px; font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-tags { display: block; margin-top: 5px; color: var(--ink-soft); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-fav { position: absolute; top: 9px; left: 9px; color: var(--deep); background: rgba(255, 254, 251, .92); border-radius: 50%; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-sm); }
.card-fav.on { color: var(--accent); }
.card-fav svg.ico { width: 17px; height: 17px; display: block; }
.card-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.card-chip { font-size: 11.5px; font-weight: 600; color: var(--deep); background: var(--sage-soft); border-radius: 999px; padding: 2.5px 9px; }

.cards-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 12px; }
@media (min-width: 560px) { .cards-grid { grid-template-columns: repeat(3, 1fr); } }

/* ---------- תוצאות ---------- */
.results-header { display: flex; gap: 10px; align-items: center; padding-top: max(20px, env(safe-area-inset-top)); }
.results-header .search-wrap { flex: 1; }
.results-count { color: var(--ink-soft); font-size: 14px; margin-top: 8px; }
.empty-state { text-align: center; padding: 48px 20px; color: var(--ink-soft); }
.empty-state .big { font-size: 52px; margin-bottom: 12px; }

/* ---------- עמוד מתכון ---------- */
#view-recipe { padding: 0 0 48px; max-width: 680px; }
.recipe-hero { position: relative; }
.recipe-hero img { width: 100%; max-height: 440px; object-fit: cover; display: block; }
.recipe-hero .hero-ph { aspect-ratio: 16/10.5; display: flex; align-items: center; justify-content: center; font-size: 84px; }
.recipe-hero .hero-ph span { filter: drop-shadow(0 6px 10px rgba(66,58,69,.22)); }
.hero-scrim { position: absolute; inset: auto 0 0 0; height: 40%; background: linear-gradient(to top, rgba(50,42,52,.38), transparent); }
.recipe-back {
  position: absolute; top: max(16px, env(safe-area-inset-top)); right: 16px;
  background: rgba(255, 253, 249, .82); backdrop-filter: blur(8px);
}
.recipe-sheet {
  position: relative; margin-top: -26px; background: var(--card);
  border-radius: 28px 28px 0 0; box-shadow: 0 -8px 30px rgba(66, 58, 69, .12);
  padding: 26px 20px 0;
}
.recipe-title { font-family: var(--serif); font-size: 33px; font-weight: 400; line-height: 1.2; }
.recipe-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.pill { background: var(--accent-soft); color: var(--accent-deep); border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 700; }
.pill.gold { background: var(--gold-soft); color: var(--sage); font-weight: 600; }
.review-note { margin-top: 14px; background: var(--gold-soft); border-radius: 14px; padding: 11px 14px; font-size: 14px; color: var(--sage); line-height: 1.45; }

.actions { display: flex; gap: 9px; margin-top: 18px; }
.act-btn {
  flex: 1; border: 1.5px solid var(--line); background: var(--card); border-radius: 16px;
  padding: 11px 4px; font-size: 13.5px; font-weight: 700; color: var(--ink);
  transition: all .15s ease; box-shadow: var(--shadow-sm);
}
.act-btn:active { transform: scale(.94); }
.act-btn .ico { display: block; font-size: 21px; margin-bottom: 3px; }
.act-btn.on { background: linear-gradient(135deg, var(--accent), var(--accent-deep)); border-color: transparent; color: #fff; box-shadow: 0 5px 14px rgba(238, 106, 77, .35); }

.stars { margin-top: 18px; font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.stars .s { font-size: 28px; cursor: pointer; color: #e8e0d3; transition: transform .12s ease, color .12s ease; }
.stars .s:active { transform: scale(1.25); }
.stars .s.on { color: var(--accent); text-shadow: 0 2px 6px rgba(238, 106, 77, .4); }

/* קלף תוכן */
.content-card {
  margin-top: 20px; background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 16px;
}
.content-card > h3 {
  font-family: var(--sans); font-size: 18px; font-weight: 700; margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
/* מרכיבים כצ'ק-ליסט */
.ing-list { list-style: none; }
.ing-list li { padding: 0; }
.ing-check { display: flex; align-items: flex-start; gap: 10px; padding: 7px 0; cursor: pointer; font-size: 15.5px; line-height: 1.45; }
.ing-check input { display: none; }
.ing-check .box {
  flex: 0 0 auto; width: 21px; height: 21px; margin-top: 1px; border-radius: 7px;
  border: 2px solid var(--ink-faint); display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; color: transparent; transition: all .15s ease; background: var(--card);
}
.ing-check input:checked + .box { background: var(--sage); border-color: var(--sage); color: #fff; }
.ing-check input:checked ~ .txt { color: var(--ink-faint); text-decoration: line-through; }
/* הוראות ממוספרות */
.inst-list { list-style: none; counter-reset: step; }
.inst-list li {
  counter-increment: step; display: flex; gap: 12px; padding: 9px 0; font-size: 15.5px; line-height: 1.55;
}
.inst-list li::before {
  content: counter(step); flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep)); color: #fff;
  font-size: 13.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
  margin-top: 1px; box-shadow: 0 3px 8px rgba(238, 106, 77, .32);
}
.free-text { white-space: pre-wrap; line-height: 1.6; font-size: 15.5px; }

.source-btn {
  display: block; margin-top: 20px; background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff; text-decoration: none; text-align: center; padding: 16px; border-radius: 16px;
  font-size: 16.5px; font-weight: 700; box-shadow: 0 6px 18px rgba(238, 106, 77, .35);
  transition: transform .15s ease;
}
.source-btn:active { transform: scale(.97); }

/* עיפרון עריכה ליד כל פרמטר */
.pencil-btn {
  border: 0; background: var(--accent-soft); color: var(--accent-deep);
  width: 30px; height: 30px; border-radius: 50%; vertical-align: middle;
  display: inline-flex; align-items: center; justify-content: center; margin-right: 6px;
  transition: transform .12s ease, background .12s ease;
}
.pencil-btn svg.ico { width: 15px; height: 15px; }
.pencil-btn:active { transform: scale(.9); }
.recipe-title .pencil-btn { margin-right: 8px; }
.content-card > h3 .pencil-btn { margin: 0 4px 0 2px; }
/* כפתור הוספת מרכיבים/הוראות כשאין עדיין */
.add-field-btn {
  display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 20px;
  border: 1.5px dashed var(--line); border-radius: var(--radius); background: var(--bg);
  padding: 15px 16px; font-family: inherit; font-size: 15px; font-weight: 600; color: var(--ink-soft);
  transition: border-color .15s ease, color .15s ease;
}
.add-field-btn svg.ico { width: 18px; height: 18px; }
.add-field-btn:active { border-color: var(--accent); color: var(--accent-deep); }
/* עריכת שם בכותרת */
.field-edit { margin-bottom: 4px; }
.field-edit .edit-input { font-size: 20px; font-weight: 700; }
/* כפתור הדפסה */
.print-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; margin-top: 14px; border: 1.5px solid var(--line); border-radius: 16px;
  background: var(--card); padding: 14px; font-family: inherit; font-size: 16px; font-weight: 700;
  color: var(--ink); box-shadow: var(--shadow-sm); transition: transform .15s ease;
}
.print-btn svg.ico { width: 20px; height: 20px; }
.print-btn:active { transform: scale(.98); }

/* ---------- אזור הדפסה: תמיד עמוד אחד ---------- */
/* הטיפוגרפיה מוגדרת תמיד (לא רק בהדפסה) כדי שאפשר יהיה למדוד את הגובה ולהקטין בול לעמוד. */
#print-area { display: none; direction: rtl; text-align: right; color: #000; background: #fff; font-family: 'Rubik', Arial, sans-serif; }
#print-area.measuring { display: block; position: fixed; left: -10000px; top: 0; width: 673px; z-index: -1; }
#print-area article { transform-origin: top right; transform: scale(var(--print-scale, 1)); break-inside: avoid; }
#print-area h1 { font-family: 'Gveret Levin', 'Rubik', sans-serif; font-size: 26pt; font-weight: 400; margin: 0 0 6pt; }
#print-area h2 { font-size: 14pt; font-weight: 700; border-bottom: 1.5pt solid #000; padding-bottom: 3pt; margin: 16pt 0 8pt; }
#print-area .print-meta { font-size: 11pt; margin: 0 0 6pt; }
#print-area ul, #print-area ol { margin: 0; padding-right: 22pt; }
#print-area li { font-size: 12pt; line-height: 1.6; margin-bottom: 3pt; }
#print-area .print-body { font-size: 12pt; line-height: 1.6; white-space: pre-wrap; }
#print-area .print-src { font-size: 9pt; margin-top: 14pt; word-break: break-all; }
#print-area .print-foot { font-size: 9pt; color: #444; margin-top: 4pt; border-top: 0.5pt solid #999; padding-top: 4pt; }
@media print {
  html, body { background: #fff !important; min-height: 0 !important; height: auto !important; margin: 0 !important; padding: 0 !important; }
  #app, .tabbar, #drawer, #drawer-overlay, #lightbox, .modal { display: none !important; }
  /* הגובה נקבע ב-JS בול לגובה התוכן המוקטן, כך שחלוקת העמודים רואה עמוד אחד */
  #print-area { display: block; overflow: hidden; }
  @page { margin: 1.6cm; size: auto; }
}

.note-wrap { margin-top: 22px; }
.note-wrap label { font-family: var(--serif); font-weight: 700; font-size: 17px; }
.note-wrap textarea {
  width: 100%; margin-top: 10px; border: 1.5px solid var(--line); border-radius: 16px;
  padding: 13px; font-family: inherit; font-size: 15px; min-height: 76px; background: var(--card); resize: vertical;
  transition: border-color .2s ease;
}
.note-wrap textarea:focus { outline: none; border-color: var(--gold); }
.recipe-date { margin-top: 16px; color: var(--ink-faint); font-size: 12.5px; }
.del-btn {
  display: block; margin: 26px auto 0; border: 0; background: none; color: var(--ink-faint);
  font-size: 13.5px; text-decoration: underline; text-underline-offset: 3px;
}
.del-btn:active { color: #b0483a; }

/* ---------- מודאל הגדרות ---------- */
.modal { position: fixed; inset: 0; background: rgba(40, 25, 15, .5); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.modal-box { background: var(--card); border-radius: 24px; padding: 26px 22px; width: 100%; max-height: 82vh; overflow-y: auto; max-width: 400px; box-shadow: var(--shadow-lg); }
.modal-box { position: relative; }
.modal-head {
  position: sticky; top: -26px; z-index: 3; background: var(--card);
  display: flex; align-items: center; justify-content: space-between;
  margin: -8px -4px 8px; padding: 8px 4px 6px;
}
.modal-head h2 { margin: 0; }
.modal-x {
  flex: none; width: 38px; height: 38px; border: 0; border-radius: 50%;
  background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1;
  display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-sm);
}
.modal-x:active { transform: scale(.92); }
.modal-box h2 { font-family: var(--serif); font-size: 26px; font-weight: 400; margin-bottom: 8px; }
.modal-note { color: var(--ink-soft); font-size: 14px; margin-bottom: 16px; line-height: 1.5; }
.btn-line { display: block; width: 100%; margin-top: 10px; padding: 14px 16px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--bg); font-size: 15.5px; font-weight: 600; color: var(--ink); text-align: right; transition: all .15s ease; }
.btn-line:active { transform: scale(.98); background: var(--bg-deep); }
.btn-plain { display: block; margin: 18px auto 0; border: 0; background: none; color: var(--ink-soft); font-size: 15px; }
.modal-msg { margin-top: 10px; font-size: 14px; color: #4d7a3f; min-height: 18px; }
.deleted-title { font-family: var(--serif); margin-top: 18px; font-size: 17px; }
.deleted-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.restore-btn { border: 1.5px solid var(--line); border-radius: 999px; background: var(--card); padding: 5px 14px; font-size: 13px; font-weight: 600; color: var(--accent-deep); }

/* ---------- עריכת מתכון ---------- */
.pill.edited { background: var(--accent-soft); color: var(--accent-deep); }
.edit-form { border: 1.5px dashed var(--accent); }
.edit-label { display: block; margin: 14px 0 5px; font-size: 13.5px; font-weight: 700; color: var(--ink-soft); }
.edit-input, .edit-area {
  width: 100%; border: 1.5px solid var(--line); border-radius: 12px; background: var(--bg);
  padding: 10px 12px; font-family: var(--sans); font-size: 15px; color: var(--ink); line-height: 1.55;
}
.edit-input:focus, .edit-area:focus { outline: none; border-color: var(--accent); }
.edit-area { resize: vertical; }
.edit-actions { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.save-btn {
  flex: 1; border: 0; border-radius: 16px; background: var(--accent); color: #fff;
  font-family: var(--sans); font-size: 16px; font-weight: 700; padding: 12px 18px; box-shadow: var(--shadow-sm);
}
.save-btn:active { background: var(--accent-deep); }
.edit-actions .btn-plain { margin: 0; }
.btn-plain.danger { color: #a33; }
.edit-note { margin-top: 12px; font-size: 12.5px; color: var(--ink-faint); line-height: 1.5; }

/* ---------- תצוגת תמונה מלאה ---------- */
#hero-img { cursor: zoom-in; }
.lightbox {
  position: fixed; inset: 0; z-index: 200; background: rgba(20, 12, 7, .93);
  display: flex; align-items: center; justify-content: center; padding: 14px; cursor: zoom-out;
}
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 10px; box-shadow: var(--shadow-lg); }
.lightbox-close {
  position: absolute; top: max(14px, env(safe-area-inset-top)); left: 14px; z-index: 1;
  width: 42px; height: 42px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .16);
  color: #fff; font-size: 19px; line-height: 1;
}

/* ---------- מגירת ניווט ---------- */
.drawer-overlay {
  position: fixed; inset: 0; z-index: 110; background: rgba(50, 42, 52, .45); backdrop-filter: blur(2px);
}
.drawer {
  position: fixed; top: 0; bottom: 0; right: 0; z-index: 120;
  width: min(78vw, 320px); background: var(--card); box-shadow: var(--shadow-lg);
  transform: translateX(100%); transition: transform .28s cubic-bezier(.4, 0, .2, 1);
  display: flex; flex-direction: column;
  padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom);
  border-radius: 22px 0 0 22px;
}
.drawer.open { transform: none; }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 18px 12px; border-bottom: 1px solid var(--line);
}
.drawer-title { font-family: var(--serif); font-size: 22px; font-weight: 400; }
.drawer-close-btn { width: 38px; height: 38px; font-size: 15px; box-shadow: none; background: var(--bg); }
.drawer-list { flex: 1; overflow-y: auto; padding: 10px 12px 20px; }
.drawer-item {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: right;
  border: 0; background: none; padding: 13px 10px; border-radius: 14px;
  font-size: 16px; font-weight: 600; color: var(--ink); transition: background .15s ease;
}
.drawer-item:active { background: var(--bg-deep); }
.drawer-item.on { background: var(--accent-soft); color: var(--accent-deep); }
.drawer-item .d-emoji { font-size: 21px; width: 28px; text-align: center; }
.drawer-item .d-count { margin-right: auto; font-size: 13px; font-weight: 500; color: var(--ink-faint); }
.drawer-sep { height: 1px; background: var(--line); margin: 8px 6px; }

/* ---------- התאמות אייפון ---------- */
/* קלט בגודל 16px ומעלה מונע מ-iOS לעשות זום אוטומטי בפוקוס */
.edit-input, .edit-area, .note-wrap textarea { font-size: 16px; }
body { min-height: 100dvh; }
.drawer { height: 100dvh; }
@media (max-width: 360px) {
  .home-title { font-size: 30px; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .cards-row .card { flex: 0 0 146px; }
  .act-btn { font-size: 12.5px; }
}
@media (max-height: 450px) and (orientation: landscape) {
  .recipe-hero img { max-height: 240px; }
}

/* ---------- אייקוני קו ---------- */
svg.ico { width: 1.2em; height: 1.2em; flex: none; vertical-align: -0.22em; }
.icon-btn svg.ico { width: 20px; height: 20px; }
.search-icon svg.ico { width: 19px; height: 19px; display: block; }
.card-ph svg.ico, .card-ph .ico { width: 46px; height: 46px; color: var(--ink); opacity: .82; }
.hero-ph svg.ico { width: 92px; height: 92px; color: var(--ink); opacity: .82; }
.empty-state svg.ico { display: block; margin: 0 auto 12px; width: 42px; height: 42px; color: var(--ink-faint); }
.d-emoji svg.ico { width: 22px; height: 22px; }
.act-btn svg.ico { display: block; margin: 0 auto 4px; width: 22px; height: 22px; }
.act-btn.on svg.ico { color: #fff; }

/* כתם צבע אורגני מאחורי אייקון קטגוריה */
.blob {
  display: flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; margin: 0 auto 8px; color: var(--ink);
}
.blob svg.ico { width: 28px; height: 28px; }
.cat-tile { padding: 14px 8px 12px; }
.cat-tile .cat-name { display: block; font-size: 14.5px; font-weight: 700; }
.cat-tile .count { display: block; color: var(--ink-soft); font-weight: 500; font-size: 12px; margin-top: 2px; }

/* ---------- מסך שמורים ---------- */
.saved-header { padding-top: max(30px, env(safe-area-inset-top)); }
.saved-title { font-family: var(--serif); font-weight: 400; font-size: 34px; margin-bottom: 18px; }
.saved-row {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: right;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 12px; box-shadow: var(--shadow-sm);
  font-family: inherit; color: var(--ink); transition: transform .15s ease;
}
.saved-row:active { transform: scale(.98); }
.saved-ico { width: 46px; height: 46px; border-radius: 16px; display: flex; align-items: center; justify-content: center; flex: none; }
.saved-ico svg.ico { width: 22px; height: 22px; }
.saved-txt { flex: 1; }
.saved-lbl { display: block; font-size: 16.5px; font-weight: 700; }
.saved-num { display: block; font-size: 13px; color: var(--ink-soft); margin-top: 2px; }
.saved-arrow { color: var(--ink-faint); transform: scaleX(-1); }
.saved-arrow svg.ico { width: 18px; height: 18px; }

/* ---------- כותרת תוצאות (מסנן שמורים) ---------- */
.results-title { font-family: var(--serif); font-weight: 400; font-size: 28px; margin-top: 14px; }

/* ---------- סרגל ניווט תחתון ---------- */
.tabbar {
  position: fixed; bottom: 0; right: 0; left: 0; z-index: 90;
  display: flex; align-items: center; justify-content: space-around;
  background: var(--card); border-top: 1px solid var(--line);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 18px rgba(30, 30, 30, .07);
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  border: 0; background: none; color: var(--ink-soft); padding: 5px 10px;
  font-family: inherit; font-size: 11px; font-weight: 600; border-radius: 12px;
  transition: color .15s ease;
}
.tab .tab-ico svg.ico { width: 23px; height: 23px; display: block; }
.tab.on { color: var(--accent); }
.tab-add {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep)); color: #fff;
  width: 52px; height: 52px; border-radius: 50%; margin-top: -22px;
  box-shadow: 0 6px 18px rgba(238, 106, 77, .4); justify-content: center;
}
.tab-add .tab-ico svg.ico { width: 25px; height: 25px; }
.tab-add:active { transform: scale(.92); }
.view, #view-recipe { padding-bottom: 96px; }
.chip b { font-weight: 500; color: var(--ink-faint); margin-right: 2px; }

.ltr-input { direction: ltr; text-align: left; }

/* ---------- הוספת מתכון חדש ---------- */
.add-photo-input { display: block; width: 100%; margin-top: 4px; font-size: 14px; color: var(--ink-soft); }
.add-photo-input::file-selector-button {
  border: 1.5px solid var(--line); border-radius: 999px; background: var(--card);
  padding: 8px 16px; margin-left: 10px; font-family: inherit; font-size: 14px; font-weight: 600; color: var(--ink);
}
.add-preview { margin-top: 10px; text-align: center; }
.add-preview img { max-width: 100%; max-height: 180px; border-radius: 14px; box-shadow: var(--shadow-sm); }
.add-preview .btn-plain { margin-top: 6px; font-size: 13px; }

/* ---------- סנכרון בהגדרות ---------- */
.sync-input {
  width: 100%; margin-top: 10px; border: 1.5px solid var(--line); border-radius: 14px;
  padding: 12px 14px; font-family: inherit; font-size: 16px; background: var(--bg);
  direction: ltr; text-align: left;
}
.sync-input:focus { outline: none; border-color: var(--accent); }
