:root {
  --bg: #f2f4f4;
  --card: #ffffff;
  --ink: #12161c;
  --muted: #5f6b76;
  --line: #e1e6e8;
  --brand: #0b7d71;
  --brand-ink: #ffffff;
  --brand-soft: #dcf3ef;
  --brand-line: #bfe6df;
  --chart: #0e9384;
  --chart-soft: #c5e9e3;
  --head: #10201f;
  --head-muted: #a9bab7;
  --warn: #b45309;
  --warn-soft: #fdf1df;
  --danger: #b3261e;
  --radius: 12px;
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Rubik', 'Segoe UI', 'Heebo', 'Arial Hebrew', Arial, sans-serif;
  line-height: 1.5;
}
a { color: var(--brand); }
h1 { font-size: 1.5rem; margin: 0 0 4px; }
h2 { font-size: 1.1rem; margin: 0 0 12px; }
h3 { font-size: 1rem; margin: 0 0 8px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }

.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.topbar-in {
  max-width: 1080px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.brand { font-weight: 700; margin-inline-end: 12px; }
.topbar a.tab, .tabs button {
  padding: 8px 12px; border-radius: 8px; text-decoration: none; color: var(--ink);
  border: 0; background: none; font: inherit; cursor: pointer;
}
.topbar a.tab.on, .tabs button.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.spacer { flex: 1; }

main { max-width: 1080px; margin: 0 auto; padding: 20px 16px 80px; }
.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-bottom: 16px;
}
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.cols-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.stat { font-size: 1.75rem; font-weight: 700; line-height: 1.1; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 10px 0; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.list li:first-child { border-top: 0; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: start; padding: 9px 8px; border-top: 1px solid var(--line); vertical-align: middle; }
thead th { border-top: 0; font-size: 0.8125rem; color: var(--muted); font-weight: 600; white-space: nowrap; }
td.num, th.num { text-align: end; font-variant-numeric: tabular-nums; }

.fields { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); align-items: end; }
.fields .wide { grid-column: 1 / -1; }
label { display: grid; gap: 4px; font-size: 0.875rem; color: var(--muted); }
label.check { display: flex; gap: 8px; align-items: flex-start; color: var(--ink); font-size: 0.9375rem; }
label.check input { width: auto; margin-top: 4px; }
input, select, textarea {
  font: inherit; color: var(--ink); background: #fff;
  border: 1px solid #c4ccc8; border-radius: 8px; padding: 9px 10px; width: 100%; min-height: 42px;
}
textarea { min-height: 76px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 3px solid #6fcabf; outline-offset: 1px;
}
.btn {
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--brand); background: var(--brand); color: var(--brand-ink);
  border-radius: 8px; padding: 9px 14px; min-height: 42px; white-space: nowrap;
}
.btn.ghost { background: #fff; color: var(--brand); }
.btn.quiet { background: none; border-color: transparent; color: var(--muted); font-weight: 500; }
.btn.danger { background: #fff; border-color: var(--danger); color: var(--danger); }
.btn.sm { min-height: 34px; padding: 4px 10px; font-size: 0.875rem; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 0.8125rem; font-weight: 600; background: #eceeed; color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--brand-soft); color: var(--brand); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }

.checks { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.checks label.check { align-items: center; min-height: 32px; }
.checks label.check input { margin: 0; min-height: 0; width: 18px; height: 18px; }
fieldset.group { border: 0; padding: 0; margin: 0; }
fieldset.group legend { padding: 0; margin-bottom: 4px; font-size: 0.875rem; color: var(--muted); }
.conflict { grid-column: 1 / -1; color: var(--danger); font-weight: 600; font-size: 0.875rem; }
.conflict.unknown { color: var(--warn); }
.alert { background: #fbe9e7; border-color: #f0b8b2; color: var(--danger); font-weight: 600; }
.alert.unknown { background: var(--warn-soft); border-color: #f1d3a4; color: var(--warn); }

/* עורך תפריט */
.totals { position: sticky; top: 8px; z-index: 4; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.total b { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.bar { height: 6px; background: #e6eae8; border-radius: 99px; overflow: hidden; margin-top: 4px; }
.bar i { display: block; height: 100%; background: var(--brand); width: 0; }
.total.over b { color: var(--danger); }
.total.over .bar i { background: var(--danger); }
.meal-head { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.meal-head input { font-weight: 600; }
.meal-head .move { min-width: 40px; padding: 4px 8px; border-color: var(--line); color: var(--ink); }
.meal-head .move:disabled { opacity: 0.3; }
.item { display: grid; grid-template-columns: 1fr 84px auto; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.item .mac { grid-column: 1 / -1; }
.item-name { font-weight: 600; }
.option { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-top: 10px; background: #fafbfa; }
.opt-head { display: flex; justify-content: space-between; align-items: center; color: var(--brand); }
.option .item:first-of-type { border-top: 0; }
.btn:disabled { opacity: 0.6; cursor: wait; }

/* אזור מתאמן */
.t-main { max-width: 640px; }
.tabs { display: flex; gap: 4px; margin-bottom: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px; }
.tabs button { flex: 1; min-height: 44px; }
.scale { display: flex; gap: 6px; }
.scale label { flex: 1; display: block; }
.scale input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.scale span { display: block; text-align: center; padding: 9px 0; border: 1px solid #c4ccc8; border-radius: 8px; color: var(--ink); cursor: pointer; }
.scale input:checked + span { background: var(--brand); color: #fff; border-color: var(--brand); }
.scale input:focus-visible + span { outline: 3px solid #6fcabf; }
.feedback { background: var(--brand-soft); border-radius: 8px; padding: 10px 12px; margin-top: 8px; }

.chart { width: 100%; height: auto; max-height: 300px; direction: ltr; display: block; }
.chart .grid { stroke: var(--line); }
.chart .area { fill: var(--chart-soft); opacity: 0.5; }
.chart .goal { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 5 4; }
.chart .line { fill: none; stroke: var(--chart); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart circle { fill: var(--chart); stroke: var(--card); stroke-width: 2; }
.chart text { font-size: 11px; fill: var(--muted); }
.chart text.val { fill: var(--ink); font-weight: 700; font-size: 12px; }

.toast {
  /* למעלה ולא למטה: בטלפון, הודעה בתחתית המסך מסתתרת מאחורי המקלדת */
  position: fixed; top: calc(12px + env(safe-area-inset-top, 0px)); inset-inline: 0; margin: 0 auto; width: fit-content; max-width: 90vw;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25); text-align: center;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 20;
}
.toast.err { background: var(--danger); }
.login { max-width: 380px; margin: 12vh auto 0; }
.form-error { color: var(--danger); font-weight: 600; background: #fbe9e7; border-radius: 8px; padding: 8px 10px; margin: 10px 0; }
/* מתחת ל-16px ספארי באייפון מגדיל את המסך בכל הקלדה */
@media (max-width: 760px) { input, select, textarea { font-size: 16px; } }

@media (max-width: 600px) {
  .totals { grid-template-columns: repeat(2, 1fr); }
}
@media print {
  .no-print, .topbar, .side, .tabs, .toast { display: none !important; }
  body { background: #fff; }
  main { padding: 0; max-width: none; }
  .card { border: 0; padding: 0 0 8px; }
  .option, .card h3 { break-inside: avoid; break-after: avoid; }
  .option { break-after: auto; }
}

/* צ'אט */
.chat { display: flex; flex-direction: column; gap: 10px; }
.chat-log {
  display: flex; flex-direction: column; gap: 8px; overflow-y: auto;
  height: min(58vh, 560px); min-height: 260px; padding: 12px; background: var(--bg); border-radius: 10px;
}
.msg { max-width: 82%; padding: 8px 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); align-self: flex-end; overflow-wrap: anywhere; }
.msg.mine { background: var(--brand-soft); border-color: var(--brand-line); align-self: flex-start; }
.msg.event { align-self: center; max-width: 94%; background: none; border: 0; color: var(--muted); font-size: 0.8125rem; text-align: center; padding: 2px 8px; }
.msg-body { white-space: pre-wrap; }
.msg-time { color: var(--muted); font-size: 0.75rem; }
.msg-tag { color: var(--brand); font-weight: 600; font-size: 0.8125rem; margin-bottom: 4px; }
.msg img { display: block; max-width: 100%; width: 260px; max-height: 320px; object-fit: cover; border-radius: 10px; margin-bottom: 6px; }
.chat-form { display: flex; gap: 8px; align-items: flex-end; }
.chat-form textarea { flex: 1; min-height: 44px; max-height: 140px; }
.meal-form { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #fafbfa; }
.meal-form[hidden] { display: none; }

.chat-layout { display: grid; grid-template-columns: 290px 1fr; gap: 16px; align-items: start; }
.chat-list { padding: 6px; max-height: 76vh; overflow-y: auto; margin: 0; }
.chat-item { display: block; padding: 10px 12px; border-radius: 8px; text-decoration: none; color: var(--ink); }
.chat-item + .chat-item { border-top: 1px solid var(--line); }
.chat-item.on { background: var(--brand-soft); }
.chat-item-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.chat-snippet { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-pane { margin: 0; }
.chat-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.chat-head .back { display: none; }
#chat-badge { margin-inline-start: 4px; }

/* תיעוד יומי */
.log-day + .log-day { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.log-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.log-entry { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fafbfa; }
.log-entry img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.log-text { padding: 8px 10px; font-size: 0.9375rem; overflow-wrap: anywhere; }

@media (max-width: 760px) {
  .chat-layout { grid-template-columns: 1fr; }
  .chat-layout.has-thread .chat-list { display: none; }
  .chat-layout:not(.has-thread) .chat-pane { display: none; }
  .chat-head .back { display: inline-flex; }
  .chat-log { height: 56vh; }
  .tabs button { padding: 8px 4px; font-size: 0.9375rem; }
}
@media print {
  .chat, .chat-layout { display: none !important; }
}

[hidden] { display: none !important; }

/* צ'אט: שורת כתיבה ומתחתיה הלחצנים */
.chat-form { flex-wrap: wrap; }
.chat-form textarea { flex: 1 1 100%; }
.chat-form .send { margin-inline-start: auto; }
.attach { flex: 1 1 100%; display: flex; justify-content: space-between; align-items: center; gap: 8px; background: var(--brand-soft); border-radius: 8px; padding: 4px 10px; font-size: 0.875rem; }
.attach-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* שיטת הנקודות */
.pts-field { display: flex; align-items: center; gap: 6px; white-space: nowrap; color: var(--ink); font-weight: 600; }
.pts-field input { width: 84px; }
.opt-edit { display: grid; grid-template-columns: 1fr 110px; gap: 8px; align-items: start; margin-top: 6px; }
.opt-edit textarea { min-height: 60px; }
.option.over { border-color: #f0b8b2; background: #fdf3f2; }
.option.over .opt-head { color: var(--danger); }
.opt-head { gap: 8px; flex-wrap: wrap; }
.picker { border: 1px dashed #c4ccc8; border-radius: 10px; padding: 10px 12px; margin-top: 10px; max-height: 360px; overflow-y: auto; }
@media (max-width: 600px) {
  .opt-edit { grid-template-columns: 1fr; }
  .meal-head { flex-wrap: wrap; }
  .meal-head .meal-name { flex: 1 1 100%; }
}

/* דגשים מתחת לתפריט */
.tips { background: var(--brand-soft); border-color: var(--brand-line); }
.tips ul { margin: 0; padding-inline-start: 20px; }
.tips li + li { margin-top: 6px; }
.tips-note { margin: 10px 0 0; padding-top: 8px; border-top: 1px solid var(--brand-line); font-size: 0.875rem; color: var(--muted); }
.tips ul + .tips-note { margin-top: 10px; }
.tips h3 + .tips-note { border-top: 0; padding-top: 0; margin-top: 0; }
.keep-btn { margin-bottom: 6px; }
.attach { flex-wrap: wrap; }
h3.step { margin: 6px 0 0; padding-top: 12px; border-top: 1px solid var(--line); color: var(--brand); }
form .step:first-child { border-top: 0; padding-top: 0; margin-top: 0; }

/* ---------- שפת העיצוב: כותרת כהה וטורקיז ---------- */
h1, h2, h3, .stat, .brand { font-weight: 700; letter-spacing: -0.01em; }
.topbar { background: var(--head); border-bottom: 0; }
.topbar .brand { color: #fff; }
.topbar a.tab { color: #d5dedc; }
.topbar a.tab.on { background: rgba(255, 255, 255, 0.14); color: #fff; }
.topbar .btn.quiet { color: #d5dedc; }

/* אזור הלקוח */
.t-main { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
.t-head { background: var(--head); color: #fff; margin: -20px -16px 16px; padding: 22px 20px 18px; border-radius: 0 0 20px 20px; }
.t-head h1 { font-size: 1.6rem; font-weight: 800; margin: 0; line-height: 1.2; }
.t-head p, .t-hello { color: var(--head-muted); font-size: 0.875rem; margin: 0; }
.t-head p { margin-top: 4px; }
.t-tabs {
  position: fixed; bottom: 0; inset-inline: 0; z-index: 6; max-width: 640px; margin: 0 auto;
  background: var(--head); display: grid; grid-template-columns: repeat(5, 1fr);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.t-tabs button {
  position: relative; border: 0; background: none; font: inherit; font-size: 0.75rem; color: #9fb0ad; cursor: pointer;
  display: grid; gap: 2px; justify-items: center; padding: 9px 2px 8px; min-height: 60px;
}
.t-tabs svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.t-tabs button.on { color: #4fd8c6; font-weight: 700; }
.t-tabs .dot {
  position: absolute; top: 5px; inset-inline-start: 50%; margin-inline-start: 4px; min-width: 18px; height: 18px; border-radius: 99px;
  background: #d93025; color: #fff; font-size: 0.6875rem; font-weight: 700; line-height: 18px; padding: 0 5px;
}
.t-main .chat-log { height: calc(100dvh - 350px); min-height: 220px; }
.chip { display: inline-block; padding: 3px 10px; border-radius: 99px; background: var(--brand-soft); color: var(--brand); font-size: 0.8125rem; font-weight: 700; white-space: nowrap; }

/* המכסה היומית */
.quota { display: flex; align-items: center; gap: 14px; }
.quota h2 { margin: 0; }
.quota p { margin: 2px 0 0; }
.quota-body { flex: 1; min-width: 0; }
.ring { width: 84px; height: 84px; flex: none; direction: ltr; }
.ring circle { fill: none; stroke: var(--chart-soft); stroke-width: 9; }
.ring text { text-anchor: middle; fill: var(--muted); font-size: 10px; }
.ring text.ring-n { fill: var(--ink); font-weight: 800; font-size: 24px; }
.ring text.ring-n.long { font-size: 18px; }
.seg { display: flex; gap: 3px; margin-top: 8px; }
.seg i { height: 8px; border-radius: 4px; background: var(--chart); display: block; }
.meal-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; }
.meal-top h3 { margin: 0; }
.meal-top .small { display: block; }
.opt-row { border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; margin-top: 8px; display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; break-inside: avoid; }
.opt-row span { white-space: pre-line; overflow-wrap: anywhere; }
.opt-row b { white-space: nowrap; color: var(--brand); }

/* התקדמות */
.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; margin-bottom: 8px; }
.hero-n { font-size: 2.25rem; font-weight: 800; line-height: 1.05; }
.hero-n span { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.hero-n small { font-size: 1rem; font-weight: 600; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 10px; margin-bottom: 16px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 8px; text-align: center; }
.tile b { display: block; font-size: 1.25rem; font-weight: 800; direction: ltr; }
.tile span { font-size: 0.75rem; color: var(--muted); }
.spark { display: grid; grid-template-columns: 96px 1fr 36px; align-items: center; gap: 8px; }
.spark + .spark { margin-top: 8px; }
.spark svg { width: 100%; height: auto; direction: ltr; display: block; }
.spark path { fill: none; stroke: var(--chart); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.spark circle { fill: var(--chart); }
.spark b { text-align: end; }
@media print { .t-head, .t-tabs { display: none !important; } }

/* ---------- צד המנהל: תפריט צד במחשב, סרגל תחתון בטלפון ---------- */
.side { position: fixed; inset-block: 0; inset-inline-start: 0; width: 208px; background: var(--head); z-index: 7; overflow-y: auto; }
.side nav { display: flex; flex-direction: column; gap: 3px; padding: 18px 10px; min-height: 100%; }
.side .brand { color: #fff; font-weight: 800; font-size: 1.0625rem; padding: 0 10px 14px; margin: 0; }
.side .tab {
  display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 9px; color: #cfdad8; text-decoration: none;
  border: 0; background: none; font: inherit; cursor: pointer; text-align: start; position: relative; width: 100%;
}
.side .tab svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.side .tab:hover { color: #fff; }
.side .tab.on { background: rgba(255, 255, 255, 0.13); color: #fff; font-weight: 600; }
.side .dot { margin-inline-start: auto; background: #d93025; color: #fff; font-size: 0.6875rem; font-weight: 700; border-radius: 99px; padding: 1px 7px; }
.side .more-btn { display: none; }
.side .more { display: flex; flex-direction: column; gap: 3px; flex: 1; margin-top: 8px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, 0.12); }
.side .more #logout { margin-top: auto; }
.side:not([hidden]) ~ main { margin: 0; margin-inline-start: 208px; max-width: none; padding: 22px 24px 60px; }
.side:not([hidden]) ~ main > div { max-width: 1100px; margin: 0 auto; }
@media (max-width: 760px) {
  .side { inset-block: auto 0; inset-inline: 0; width: auto; overflow: visible; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .side nav { display: grid; grid-template-columns: repeat(4, 1fr); padding: 0; gap: 0; min-height: 0; }
  .side .brand { display: none; }
  .side nav > .tab { flex-direction: column; gap: 2px; font-size: 0.75rem; padding: 9px 2px 8px; border-radius: 0; justify-content: center; text-align: center; color: #9fb0ad; min-height: 60px; }
  .side nav > .tab svg { width: 24px; height: 24px; }
  .side nav > .tab.on { background: none; color: #4fd8c6; font-weight: 700; }
  .side nav > .tab .dot { position: absolute; top: 5px; inset-inline-start: 50%; margin-inline-start: 4px; min-width: 18px; line-height: 16px; padding: 1px 5px; }
  .side .more-btn { display: flex; }
  .side .more { display: none; position: absolute; bottom: 100%; inset-inline: 0; background: var(--head); margin: 0; padding: 10px; border-top: 0; border-radius: 16px 16px 0 0; box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.25); }
  .side.open .more { display: flex; }
  .side .more #logout { margin-top: 0; }
  .side:not([hidden]) ~ main { margin-inline-start: 0; padding: 16px 14px calc(92px + env(safe-area-inset-bottom, 0px)); }
}

.av { width: 36px; height: 36px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 700; display: inline-grid; place-items: center; flex: none; }
.av.big { width: 54px; height: 54px; font-size: 1.375rem; }
.grow { flex: 1; min-width: 0; }
.list li.todo { flex-wrap: nowrap; justify-content: flex-start; }
.list li.todo a { text-decoration: none; }
.dash-cols { display: grid; grid-template-columns: 1fr 1.25fr; gap: 16px; align-items: start; }
.tiles.big { grid-template-columns: repeat(4, 1fr); gap: 12px; }
.tiles.big .tile { text-align: start; padding: 14px 16px; text-decoration: none; color: inherit; border-radius: 14px; }
.tiles.big .tile b { font-size: 1.75rem; line-height: 1.15; text-align: right; }
.tiles.big .tile span { font-size: 0.8125rem; }
.tile.hot { background: var(--head); border-color: var(--head); }
.tile.hot b { color: #4fd8c6; }
.tile.hot span { color: var(--head-muted); }
.spark-s { width: 70px; height: 22px; direction: ltr; display: block; }
.spark-s path { fill: none; stroke: var(--chart); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.gbar { height: 6px; width: 84px; background: var(--chart-soft); border-radius: 9px; overflow: hidden; }
.gbar i { display: block; height: 100%; background: var(--chart); }
.name-cell { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.chead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.chead h1 { margin: 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ctabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; overflow-y: hidden; }
.ctabs button { flex: none; }
.ctabs button { border: 0; background: none; font: inherit; color: var(--muted); padding: 10px 14px; cursor: pointer; white-space: nowrap; border-bottom: 3px solid transparent; min-height: 44px; }
.ctabs button.on { color: var(--brand); font-weight: 700; border-bottom-color: var(--brand); }
.over { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 980px) { .dash-cols, .over { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .tiles.big { grid-template-columns: 1fr 1fr; } }
/* בטלפון: שום חלק לא מרחיב את הדף מעבר לרוחב המסך */
.dash-cols > *, .over > * { min-width: 0; }
.tiles.big { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 600px) { .tiles.big { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ctabs { scrollbar-width: none; }
.ctabs::-webkit-scrollbar { display: none; }
.dash-cols th, .dash-cols td { padding-inline: 5px; }
.dash-cols .gbar { width: 60px; }
.dash-cols .spark-s { width: 56px; }

/* ---------- דיווח שבועי בצעדים ---------- */
.ci-steps { display: flex; gap: 5px; margin-bottom: 6px; }
.ci-steps i { flex: 1; height: 6px; border-radius: 3px; background: var(--chart-soft); }
.ci-steps i.on { background: var(--chart); }
.q { display: block; font-size: 1rem; font-weight: 700; color: var(--ink); margin-bottom: 8px; padding: 0; }
label.q textarea { margin-top: 4px; font-weight: 400; }
.big-in { display: flex; align-items: baseline; justify-content: center; gap: 8px; border: 2px solid var(--brand); border-radius: 12px; padding: 6px 12px; }
.big-in input { border: 0; min-height: 0; padding: 4px 0; width: 5.5ch; text-align: center; font-size: 2rem; font-weight: 800; background: none; }
.big-in input:focus-visible { outline: 0; }
.big-in:focus-within { outline: 3px solid #6fcabf; outline-offset: 1px; }
.big-in span { color: var(--muted); font-weight: 600; }
.faces { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.faces label { display: block; }
.faces input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.faces label > span { display: block; text-align: center; border: 1px solid #c4ccc8; border-radius: 10px; padding: 7px 2px 5px; cursor: pointer; }
.faces .emo { display: block; font-size: 1.375rem; line-height: 1.2; }
.faces small { display: block; font-size: 0.6875rem; color: var(--muted); margin-top: 2px; }
.faces input:checked + span { background: var(--brand); border-color: var(--brand); }
.faces input:checked + span small { color: #fff; font-weight: 600; }
.faces input:focus-visible + span { outline: 3px solid #6fcabf; }
.stepper { display: flex; align-items: center; justify-content: space-between; }
.stepper output { font-size: 1.75rem; font-weight: 800; }
.round { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--brand); background: #fff; color: var(--brand); font: inherit; font-size: 1.5rem; font-weight: 600; cursor: pointer; line-height: 1; }
.btn.block { display: flex; width: 100%; margin-bottom: 16px; }
.done { text-align: center; }
.done .ok { width: 56px; height: 56px; border-radius: 50%; background: var(--brand-soft); display: grid; place-items: center; margin: 0 auto 10px; }
.done .ok svg { width: 28px; height: 28px; stroke: var(--brand); fill: none; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.cmp { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.cmp:first-of-type { border-top: 0; }
.t-tabs .dot.due { min-width: 10px; width: 10px; height: 10px; padding: 0; top: 8px; }


fieldset.group legend.q { color: var(--ink); font-size: 1rem; margin-bottom: 8px; }

/* מסך הפתיחה והכניסה של המלווה */
.login-screen { position: fixed; inset: 0; background: var(--head); display: grid; place-items: center; padding: 16px; overflow: auto; }
.login-screen .login { margin: 0; width: 100%; max-width: 380px; text-align: center; padding: 28px 22px; border-radius: 18px; border: 0; }
.login-screen .login label { text-align: start; margin-top: 14px; }
.login-screen .login .btn { width: 100%; margin-top: 14px; }
.login-icon { border-radius: 18px; margin-bottom: 10px; }

.login-logo { display: block; width: 100%; max-width: 280px; height: auto; margin: 0 auto 14px; }

/* קוד הכניסה של הלקוח */
.code { font-size: 1.25rem; font-weight: 800; letter-spacing: 0.18em; background: var(--brand-soft); color: var(--brand); border-radius: 8px; padding: 2px 10px; unicode-bidi: isolate; }
.code-in { text-align: center; font-size: 1.5rem; font-weight: 700; letter-spacing: 0.3em; }

/* כותרת כרטיס הלקוח בטלפון: השם והפרטים בשורה אחת, והלחצנים בשורה משלהם מתחת */
.chead .grow { flex: 1 1 180px; }
@media (max-width: 760px) {
  .chead > .row { flex: 1 1 100%; }
  .chead > .row .btn { flex: 1; }
}

.boot { text-align: center; color: var(--muted); margin: 30vh 0 0; }

/* עורך תפריט: ארוחות מקופלות, חיפוש במאגר ואופציה חופשית */
.meal-card { padding: 0; }
.meal-row { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 54px; padding: 12px 14px; background: none; border: 0; font: inherit; color: var(--ink); text-align: start; cursor: pointer; border-radius: inherit; }
.meal-row b { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.meal-row .chev, .tog .chev { color: var(--muted); width: 14px; flex: none; text-align: center; }
.meal-card .meal-body { padding: 4px 14px 14px; border-top: 1px solid var(--line); }
.meal-card:not(.open) > .meal-body { display: none; }
.mchip { flex: none; padding: 2px 9px; border-radius: 99px; background: var(--brand-soft); color: var(--brand); font-size: 0.8125rem; font-weight: 600; white-space: nowrap; }
.mchip.empty { background: #eceeed; color: var(--muted); }
.mchip.over { background: #fdecea; color: var(--danger); }
.meal-set { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-items: end; padding: 12px; margin: 10px 0; border-radius: 10px; background: #f5f7f6; }
.meal-set .meal-head { grid-column: 1 / -1; }
.opt-line { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.opt-line .opt-name { flex: 1; min-width: 0; overflow-wrap: anywhere; white-space: pre-line; }
.opt-line b { white-space: nowrap; color: var(--brand); }
.opt-line.over b { color: var(--danger); }
.opt-line.editing { flex-wrap: wrap; align-items: flex-end; }
.opt-line.editing textarea { flex: 1 1 100%; min-height: 60px; }
.finder { margin-top: 12px; display: grid; gap: 8px; }
.res-title { margin: 4px 0 0; }
.list.res li { flex-wrap: nowrap; padding: 8px 0; }
.list.res .res-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.list.res b { white-space: nowrap; }
.free-form { display: grid; gap: 12px; margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fafbfa; }
.free-form .f-label { display: block; font-size: 0.875rem; color: var(--muted); margin-bottom: 4px; padding: 0; }
.pstep { display: flex; align-items: center; gap: 10px; }
.pstep .btn { min-width: 46px; font-size: 1.25rem; padding: 4px 0; }
.pstep b { min-width: 46px; text-align: center; font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.slot-pick { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.slot-pick legend { width: 100%; }
.slot-pick input { position: absolute; opacity: 0; pointer-events: none; }
.slot-pick span { display: inline-block; padding: 7px 14px; border: 1px solid var(--line); border-radius: 99px; background: #fff; cursor: pointer; }
.slot-pick input:checked + span { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); font-weight: 600; }
.slot-pick input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.f-contains summary, details.meta summary { cursor: pointer; }
.f-contains .checks { margin-top: 8px; }
.pbar { position: sticky; top: 8px; z-index: 4; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 10px 14px; }
.pbar b { font-size: 1.125rem; font-variant-numeric: tabular-nums; }
.pbar .conflict { font-size: inherit; }
.actbar { position: sticky; bottom: 10px; z-index: 4; display: flex; gap: 8px; margin: 12px 0; padding: 8px; background: var(--bg); border-radius: 12px; box-shadow: 0 0 0 1px var(--line); }
.actbar .btn { flex: 1; }
.meal-card .meal-head { margin: 0; padding: 8px 10px; }
.meal-card .meal-set .meal-head { padding: 0; }
.meal-card:not(.open) > .meal-head .move, .meal-card:not(.open) > .meal-head [data-act="del-meal"] { display: none; }
.meal-head .tog { min-width: 38px; padding: 4px; }
@media (max-width: 760px) {
  .actbar { bottom: calc(70px + env(safe-area-inset-bottom, 0px)); }
  .meal-card > .meal-head .meal-name { flex: 1 1 50%; }
}
.finder label.check, .free-form > label.check { align-items: center; }
.finder label.check input, .free-form > label.check input { margin: 0; min-height: 0; width: 18px; height: 18px; flex: none; }

/* ארוחה פתוחה: כותרת כהה ושני אזורים בצבעים שונים (בתפריט של הלקוח / הוספה מהמאגר) */
.side:not([hidden]) ~ main > div.editor { max-width: 760px; }
.meal-card { overflow: hidden; }
.meal-card.open > .meal-row { background: var(--head); color: #fff; border-radius: 0; }
.meal-card.open > .meal-row .muted, .meal-card.open > .meal-row .chev { color: var(--head-muted, #9fb0ad); }
.meal-card.open > .meal-body { padding: 0; border-top: 0; }
.zone { padding: 12px 14px; }
.zone.chosen { background: var(--brand-soft); }
.zone.bank { background: #eef0ef; margin: 0; border-top: 1px solid var(--line); }
.zone-title { display: flex; justify-content: space-between; gap: 8px; margin: 0 0 8px; font-size: 0.8125rem; font-weight: 600; color: var(--brand); }
.zone.bank .zone-title { color: var(--muted); }
.zone .opt-line { background: #fff; border: 0; border-radius: 10px; padding: 6px 6px 6px 4px; padding-inline-start: 12px; margin-top: 6px; }
.zone .opt-line.over { box-shadow: inset 0 0 0 1px #f0b8b2; }
.zone .opt-line.editing { padding: 10px 12px; }
button.opt-name { background: none; border: 0; padding: 6px 0; font: inherit; color: var(--ink); text-align: start; cursor: pointer; }
.zone .list.res li { background: #fff; border: 0; border-radius: 10px; padding: 8px 12px; margin-top: 6px; }
.zone .res-title { margin: 2px 0 0; }
.est { color: var(--warn); font-weight: 600; margin-inline-end: 3px; }
.meal-set { margin: 12px 14px; }
.meal-tools { padding: 10px 14px 14px; background: #eef0ef; margin: 0; }
.meal-tools .btn { flex: 1; background: #fff; }
.meal-body > .free-form { margin: 12px 14px 14px; }
.meal-manage { padding: 10px 14px; margin: 0; border-top: 1px solid var(--line); background: #fff; }
.meal-card .meal-manage.meal-head { padding: 10px 14px; }

/* ---------- מתכונים ---------- */
.rhead h2 { margin: 0; }
.rhead p { margin: 2px 0 10px; }
.rsearch { margin-bottom: 10px; }
.rchips { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 12px; }
.rchip { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 7px 14px; font: inherit; font-size: 0.875rem; color: var(--ink); cursor: pointer; }
.rchip.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.rgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.rgrid.coach { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); margin-bottom: 16px; }
.rcard { background: #fff; border-radius: 16px; overflow: hidden; box-shadow: 0 1px 3px rgba(16, 32, 31, 0.1); display: flex; flex-direction: column; }
.rcard-open { position: relative; display: block; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; }
.rimg { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--brand-soft); }
.rimg.ph { background: var(--brand-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230b7d71' stroke-width='1.4' stroke-linecap='round'%3E%3Cpath d='M5 4v7a3 3 0 0 0 6 0V4M8 4v16M17 4c-2 2-2 6 0 8v8'/%3E%3C/svg%3E") center / 40px no-repeat; }
.rimg.hero { aspect-ratio: 16 / 10; border-radius: 14px; }
.rimg.thumb { width: 200px; border-radius: 10px; }
.rpts { position: absolute; bottom: 8px; inset-inline-start: 8px; background: rgba(16, 32, 31, 0.82); color: #fff; font-size: 0.8125rem; font-weight: 700; padding: 3px 10px; border-radius: 99px; }
.rcard-body { padding: 10px 12px 12px; display: grid; gap: 2px; }
.rcard-body b { line-height: 1.3; overflow-wrap: anywhere; }
.rback { margin-bottom: 8px; }
.rfull .rtitle { font-size: 1.4rem; margin: 14px 0 8px; line-height: 1.25; }
.rmeta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.rtag { display: inline-block; padding: 3px 10px; border-radius: 99px; background: #eef0ef; color: var(--ink); font-size: 0.8125rem; white-space: nowrap; }
.rfull h3 { margin: 18px 0 8px; font-size: 1.0625rem; }
.ring-list { list-style: none; margin: 0; padding: 0; }
.ring-list li { padding: 9px 0; border-bottom: 1px solid var(--line); }
.ring-list li:last-child { border-bottom: 0; }
.rsteps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 10px; }
.rsteps li { counter-increment: step; display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start; line-height: 1.5; }
.rsteps li::before { content: counter(step); width: 30px; height: 30px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-weight: 700; display: grid; place-items: center; }
#recipe-view .rfull { max-width: 520px; }
.t-tabs { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 380px) { .t-tabs button { font-size: 0.6875rem; } }
@media (min-width: 560px) { .t-main .rgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---------- ניהול הלקוח ---------- */
.mng h3 { margin: 18px 0 8px; font-size: 1rem; padding-top: 14px; border-top: 1px solid var(--line); }
.mng-state { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-radius: 12px; border-inline-start: 5px solid var(--brand); background: var(--brand-soft); }
.mng-state.off { border-color: var(--danger); background: #fdecec; }
.mng-state span { font-size: .9rem; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; }
.seg span { display: block; text-align: center; padding: 10px 6px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-weight: 600; cursor: pointer; }
.seg input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.seg input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.switch { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; position: relative; }
.switch input { position: absolute; opacity: 0; width: 46px; height: 26px; margin: 0; }
.switch i { flex: none; width: 46px; height: 26px; border-radius: 13px; background: #c5cfcd; position: relative; transition: background .15s; }
.switch i::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: inset-inline-start .15s; }
.switch input:checked + i { background: var(--brand); }
.switch input:checked + i::after { inset-inline-start: 23px; }
.switch input:focus-visible + i { outline: 2px solid var(--brand); outline-offset: 2px; }
.badge.bad { background: #fdecec; color: var(--danger); }
.login.blocked { text-align: center; }
/* פחות לשוניות כשהמלווה הסתיר חלק: מתחלקות שווה בשווה */
.t-tabs { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 1fr; }
