/* ============================================================
   מעקב כושר — מערכת עיצוב
   כהה כברירת מחדל, זכוכית עדינה, RTL מלא.
   ============================================================ */

:root {
  --r-xs: 10px; --r-sm: 14px; --r-md: 20px; --r-lg: 28px; --r-full: 999px;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px;
  --sp-6: 24px; --sp-8: 32px; --sp-10: 40px;
  --tap: 44px;
  --ease: cubic-bezier(.22,.61,.36,1);
  --dur: 220ms;
  --tabbar-h: 62px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --font: 'Heebo', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
}

/* ---------- ערכות נושא ---------- */
html[data-theme="dark"] {
  --bg-0: #080d18;
  --bg-1: #0d1526;
  --bg-2: #111c32;
  --ink: #eef3fb;
  --ink-2: #aab8cf;
  --ink-3: #74859f;
  --glass: rgba(255,255,255,.055);
  --glass-2: rgba(255,255,255,.085);
  --stroke: rgba(255,255,255,.10);
  --stroke-2: rgba(255,255,255,.16);
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --shadow-lg: 0 24px 60px rgba(0,0,0,.45);
  --field: rgba(255,255,255,.06);
  --field-focus: rgba(255,255,255,.10);
  --track: rgba(255,255,255,.10);
  --good: #34d399; --bad: #fb7185; --warn: #fbbf24; --info: #60a5fa;
  --scrim: rgba(3,7,18,.65);
}
html[data-theme="light"] {
  --bg-0: #eaeff7;
  --bg-1: #f3f6fb;
  --bg-2: #ffffff;
  --ink: #0f1b2e;
  --ink-2: #44546e;
  --ink-3: #74859f;
  --glass: rgba(255,255,255,.72);
  --glass-2: rgba(255,255,255,.92);
  --stroke: rgba(15,27,46,.09);
  --stroke-2: rgba(15,27,46,.16);
  --shadow: 0 8px 24px rgba(20,35,66,.10);
  --shadow-lg: 0 20px 48px rgba(20,35,66,.16);
  --field: rgba(15,27,46,.045);
  --field-focus: rgba(15,27,46,.08);
  --track: rgba(15,27,46,.10);
  --good: #0f9d6e; --bad: #dc3b57; --warn: #c07c08; --info: #2563eb;
  --scrim: rgba(15,27,46,.4);
}

/* ---------- צבעי מבטא ---------- */
html[data-accent="teal"]   { --acc: #2dd4bf; --acc-2: #0ea5a4; --acc-ink: #04221f; }
html[data-accent="violet"] { --acc: #a78bfa; --acc-2: #7c3aed; --acc-ink: #190b35; }
html[data-accent="amber"]  { --acc: #fbbf24; --acc-2: #d97706; --acc-ink: #2a1a00; }
html[data-accent="rose"]   { --acc: #fb7185; --acc-2: #e11d48; --acc-ink: #2d0510; }

/* ---------- בסיס ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg-0);
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
.bg-layer {
  position: fixed; inset: 0; z-index: -1; overflow: hidden;
  background:
    radial-gradient(120% 80% at 50% 0%, var(--bg-2) 0%, var(--bg-1) 45%, var(--bg-0) 100%);
}
.orb { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .22; }
.orb-a { width: 360px; height: 360px; inset-block-start: -90px; inset-inline-end: -90px; background: var(--acc); }
.orb-b { width: 300px; height: 300px; inset-block-end: 8%; inset-inline-start: -110px; background: var(--info); opacity: .14; }

h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.012em; }
h1 { font-size: 1.3rem; }
h2 { font-size: 1.08rem; }
h3 { font-size: .98rem; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }
.muted { color: var(--ink-2); }
.dim { color: var(--ink-3); }
.tiny { font-size: .78rem; }
.sm { font-size: .86rem; }
.bold { font-weight: 700; }
.good { color: var(--good); }
.bad { color: var(--bad); }
.warn-c { color: var(--warn); }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: var(--sp-3); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.col { display: flex; flex-direction: column; gap: var(--sp-3); }
.grow { flex: 1 1 auto; min-width: 0; }
.wrap { flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-3); }
.mt-2 { margin-block-start: var(--sp-2); } .mt-3 { margin-block-start: var(--sp-3); }
.mt-4 { margin-block-start: var(--sp-4); } .mt-5 { margin-block-start: var(--sp-5); }
.num { font-variant-numeric: tabular-nums; }

:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; border-radius: 6px; }

/* ---------- אייקונים ---------- */
.ic {
  width: 1.15em; height: 1.15em; flex: 0 0 auto;
  fill: none; stroke: currentColor; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round;
  vertical-align: -.16em;
}
h2 > .ic, h3 > .ic { color: var(--acc); margin-inline-end: 2px; }
.btn > .ic { width: 1.2em; height: 1.2em; }
.chip > .ic { width: 1em; height: 1em; }
.item > .ic { width: 20px; height: 20px; color: var(--ink-3); }
.tab .ic { width: 23px; height: 23px; }
.btn-icon .ic { width: 20px; height: 20px; }
.datenav .ic { width: 18px; height: 18px; }
.check .ic { width: 16px; height: 16px; stroke-width: 3; }
.set-check .ic { width: 17px; height: 17px; stroke-width: 3; }
.delta .ic { width: 14px; height: 14px; stroke-width: 2.6; }
.empty .ic { width: 44px; height: 44px; stroke-width: 1.4; }
.suggestion .ic { width: 16px; height: 16px; }
.login-mark svg { stroke: currentColor; fill: none; }

/* ---------- זכוכית ---------- */
.glass {
  background: var(--glass);
  border: 1px solid var(--stroke);
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
}
.card { padding: var(--sp-4); }
.card-tight { padding: var(--sp-3); }

/* ---------- מסך התחברות ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: var(--sp-5); }
.login-card { width: min(380px, 100%); padding: var(--sp-8) var(--sp-6); text-align: center; }
.login-mark {
  width: 84px; height: 84px; margin: 0 auto var(--sp-4);
  display: grid; place-items: center; border-radius: var(--r-lg);
  background: linear-gradient(145deg, var(--acc), var(--acc-2)); color: var(--acc-ink);
  box-shadow: 0 14px 34px color-mix(in srgb, var(--acc) 34%, transparent);
}
.login-card h1 { font-size: 1.6rem; margin-block-end: var(--sp-2); }
.login-card .btn-google { margin-block-start: var(--sp-6); width: 100%; }
.login-error {
  margin-block-start: var(--sp-4); padding: var(--sp-3);
  border-radius: var(--r-sm); font-size: .9rem;
  background: color-mix(in srgb, var(--bad) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--bad) 35%, transparent);
  color: var(--bad);
}
#login-note { margin-block-start: var(--sp-4); }

/* ---------- מעטפת ---------- */
.app { min-height: 100dvh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  padding-block-start: var(--safe-t);
  background: color-mix(in srgb, var(--bg-0) 72%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-block-end: 1px solid var(--stroke);
}
.topbar-inner {
  max-width: 680px; margin: 0 auto;
  padding: var(--sp-3) var(--sp-4);
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
}
.topbar-actions { display: flex; align-items: center; gap: var(--sp-2); }
.save-state { font-size: .75rem; color: var(--ink-3); opacity: 0; transition: opacity var(--dur); }
.save-state.on { opacity: 1; }
.save-state.saved { color: var(--good); }

.view {
  flex: 1; width: 100%; max-width: 680px; margin: 0 auto;
  padding: var(--sp-4) var(--sp-4) calc(var(--tabbar-h) + var(--safe-b) + var(--sp-8));
  display: flex; flex-direction: column; gap: var(--sp-4);
  animation: fade var(--dur) var(--ease);
}
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- ניווט תחתון ---------- */
.tabbar {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding-block-end: var(--safe-b);
  background: color-mix(in srgb, var(--bg-0) 84%, transparent);
  backdrop-filter: blur(22px) saturate(1.4); -webkit-backdrop-filter: blur(22px) saturate(1.4);
  border-block-start: 1px solid var(--stroke);
}
.tab {
  min-height: var(--tabbar-h);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--ink-3); font-size: .7rem; font-weight: 500;
  transition: color var(--dur) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.tab svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; transition: transform var(--dur) var(--ease); }
.tab.active { color: var(--acc); }
.tab.active svg { transform: translateY(-1px) scale(1.06); }
.tab:active svg { transform: scale(.92); }

/* ---------- כפתורים ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: var(--tap); padding: 0 var(--sp-5);
  border: 1px solid var(--stroke-2); border-radius: var(--r-sm);
  background: var(--glass-2); color: var(--ink);
  font: inherit; font-weight: 600; font-size: .94rem;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: transform 120ms var(--ease), background var(--dur), opacity var(--dur);
}
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn-primary {
  background: linear-gradient(145deg, var(--acc), var(--acc-2));
  color: var(--acc-ink); border-color: transparent; font-weight: 700;
  box-shadow: 0 8px 22px color-mix(in srgb, var(--acc) 28%, transparent);
}
.btn-ghost { background: transparent; border-color: var(--stroke); color: var(--ink-2); }
.btn-danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent);
  background: color-mix(in srgb, var(--bad) 12%, transparent); }
.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: 0 var(--sp-3); font-size: .85rem; border-radius: var(--r-xs); }
.btn-icon { min-height: var(--tap); width: var(--tap); padding: 0; border-radius: var(--r-sm); }
.btn-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round; }
.btn-google { background: #fff; color: #1f2430; border-color: transparent; font-weight: 700; }
html[data-theme="light"] .btn-google { border: 1px solid var(--stroke-2); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px var(--sp-3); border-radius: var(--r-full);
  background: var(--field); border: 1px solid var(--stroke);
  font-size: .78rem; font-weight: 600; color: var(--ink-2);
  cursor: pointer; font-family: inherit;
}
.chip.on { background: color-mix(in srgb, var(--acc) 20%, transparent);
  border-color: color-mix(in srgb, var(--acc) 50%, transparent); color: var(--acc); }
.chip-warn { background: color-mix(in srgb, var(--warn) 18%, transparent);
  border-color: color-mix(in srgb, var(--warn) 40%, transparent); color: var(--warn); }
.chip-good { background: color-mix(in srgb, var(--good) 16%, transparent);
  border-color: color-mix(in srgb, var(--good) 38%, transparent); color: var(--good); }

/* ---------- שדות ---------- */
label { display: block; font-size: .8rem; font-weight: 600; color: var(--ink-2);
  margin-block-end: 6px; }
input, select, textarea {
  width: 100%; min-height: var(--tap);
  padding: var(--sp-2) var(--sp-3);
  font: inherit; font-size: 1rem; color: var(--ink);
  background: var(--field); border: 1px solid var(--stroke);
  border-radius: var(--r-sm); outline: none;
  transition: border-color var(--dur), background var(--dur);
  font-variant-numeric: tabular-nums;
}
textarea { min-height: 80px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { border-color: var(--acc); background: var(--field-focus); }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
input[type="number"] { -moz-appearance: textfield; }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
select {
  appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%),
                    linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(var(--sp-4) - 2px) calc(50% + 1px), calc(var(--sp-4) + 3px) calc(50% + 1px);
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
  padding-inline-start: var(--sp-8);
}
input[type="checkbox"] { width: auto; min-height: 0; }
.field { display: block; }
.field + .field { margin-block-start: var(--sp-3); }

/* מונה +/- */
.stepper { display: flex; align-items: center; gap: var(--sp-2); }
.stepper input { text-align: center; }
.stepper button {
  flex: 0 0 var(--tap); width: var(--tap); height: var(--tap);
  border-radius: var(--r-sm); border: 1px solid var(--stroke);
  background: var(--field); color: var(--ink); font-size: 1.3rem; font-weight: 600;
  cursor: pointer; line-height: 1; font-family: inherit;
}
.stepper button:active { transform: scale(.94); }

/* ---------- כותרות מקטע ---------- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); }
.section-head h2 { display: flex; align-items: center; gap: var(--sp-2); }
.eyebrow { font-size: .72rem; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--ink-3); }

/* ---------- בר התקדמות ---------- */
.bar { height: 9px; border-radius: var(--r-full); background: var(--track); overflow: hidden; }
.bar > i {
  display: block; height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, var(--acc-2), var(--acc));
  transition: width 450ms var(--ease);
}
.bar.over > i { background: linear-gradient(90deg, var(--warn), var(--bad)); }

/* ---------- טבעות מאקרו ---------- */
.rings { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-2); }
.rings.rings-6 { grid-template-columns: repeat(3, 1fr); }
.ring-item {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: none; border: 0; padding: var(--sp-2) 2px; cursor: pointer;
  color: inherit; font-family: inherit; border-radius: var(--r-sm);
  -webkit-tap-highlight-color: transparent;
}
.ring-item:active { background: var(--field); }
.ring { position: relative; width: 100%; max-width: 76px; aspect-ratio: 1; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-linecap: round; }
.ring .trk { stroke: var(--track); }
.ring .val { transition: stroke-dashoffset 650ms var(--ease); }
.ring-center {
  position: absolute; inset: 0; display: grid; place-content: center; text-align: center;
}
.ring-center b { font-size: .92rem; font-weight: 800; display: block; line-height: 1.1;
  font-variant-numeric: tabular-nums; }
.ring-center small { font-size: .62rem; color: var(--ink-3); }
.ring-label { font-size: .74rem; color: var(--ink-2); font-weight: 600; }

/* ---------- אריחי סטטיסטיקה ---------- */
.stat { padding: var(--sp-3); border-radius: var(--r-sm); background: var(--field);
  border: 1px solid var(--stroke); }
.stat .k { font-size: .74rem; color: var(--ink-3); font-weight: 600; }
.stat .v { font-size: 1.22rem; font-weight: 800; font-variant-numeric: tabular-nums;
  line-height: 1.25; margin-block-start: 2px; }
.stat .s { font-size: .74rem; color: var(--ink-2); }
.delta { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; font-size: .8rem; }

/* ---------- רשימות ---------- */
.list { display: flex; flex-direction: column; gap: var(--sp-2); }
.item {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3); border-radius: var(--r-sm);
  background: var(--field); border: 1px solid var(--stroke);
  width: 100%; text-align: start; font: inherit; color: inherit; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--dur), border-color var(--dur);
}
.item:active { background: var(--field-focus); }
.item.flat { background: transparent; }
.item-title { font-weight: 600; font-size: .95rem; }
.item-sub { font-size: .78rem; color: var(--ink-3); }

/* ---------- כרטיס תרגיל באימון ---------- */
.exercise { padding: 0; overflow: hidden; }
.exercise.done { border-color: color-mix(in srgb, var(--good) 40%, transparent); }
.exercise-head {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4); width: 100%;
  background: none; border: 0; color: inherit; font: inherit; cursor: pointer; text-align: start;
}
.check {
  flex: 0 0 30px; width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid var(--stroke-2); display: grid; place-items: center;
  transition: all var(--dur) var(--ease); background: transparent;
  cursor: pointer; padding: 0;
}
.check svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 3;
  stroke-linecap: round; stroke-linejoin: round; opacity: 0; transform: scale(.5);
  transition: all var(--dur) var(--ease); }
.check.on { background: var(--good); border-color: var(--good); color: #042b1e; }
.check.on svg { opacity: 1; transform: none; }
.exercise-body { padding: 0 var(--sp-3) var(--sp-3); }
.prev-line { font-size: .76rem; color: var(--ink-3); }

/* טבלת סטים */
.sets { display: flex; flex-direction: column; gap: 6px; }
.set-head, .set-row {
  display: grid; grid-template-columns: 26px 1fr 1fr 64px 40px;
  gap: 6px; align-items: center;
}
.set-head { font-size: .68rem; color: var(--ink-3); font-weight: 700; padding: 0 2px; }
.set-row input, .set-row select { min-height: 42px; padding: 4px 6px; text-align: center;
  font-size: .95rem; border-radius: var(--r-xs); }
.set-row.done input, .set-row.done select { background: color-mix(in srgb, var(--good) 11%, transparent);
  border-color: color-mix(in srgb, var(--good) 28%, transparent); }
.set-idx { font-size: .8rem; font-weight: 700; color: var(--ink-3); text-align: center; }
.set-idx.fail { color: var(--bad); }
.set-check {
  width: 38px; height: 38px; margin-inline-start: auto; border-radius: var(--r-xs);
  border: 1px solid var(--stroke-2); background: var(--field); color: var(--ink-3);
  display: grid; place-items: center; cursor: pointer; padding: 0;
}
.set-check svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 3;
  stroke-linecap: round; stroke-linejoin: round; }
.set-check .ic { opacity: .22; transition: opacity var(--dur), transform var(--dur); }
.set-check.on { background: var(--good); border-color: var(--good); color: #042b1e; }
.set-check.on .ic { opacity: 1; transform: scale(1.05); }
/* שורת העזר מתחת לכל סט: "קודם", העתקה ומחיקה */
.set-aux {
  display: flex; align-items: center; gap: 4px;
  margin: -2px 0 4px; padding-inline-start: 2px;
}
.set-aux .chip { padding: 1px 7px; font-size: .72rem; min-height: 24px; }
.set-aux .prev { font-size: .7rem; color: var(--ink-3); margin-inline-start: auto;
  font-variant-numeric: tabular-nums; }

.suggestion {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3); border-radius: var(--r-xs); font-size: .8rem;
  background: color-mix(in srgb, var(--acc) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--acc) 30%, transparent);
  color: var(--acc);
}
.swapped { font-size: .72rem; color: var(--warn); }

/* ---------- טיימר מנוחה ---------- */
.rest-bar {
  position: fixed; inset-inline: 0; bottom: calc(var(--tabbar-h) + var(--safe-b));
  z-index: 45; padding: var(--sp-3) var(--sp-4);
  display: flex; align-items: center; gap: var(--sp-3);
  background: color-mix(in srgb, var(--bg-2) 92%, transparent);
  border-block-start: 1px solid var(--stroke);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-lg);
  animation: slideUp var(--dur) var(--ease);
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: none; } }
.rest-time { font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums;
  min-width: 76px; color: var(--acc); }
.rest-bar .bar { flex: 1; }

/* ---------- תאריך ---------- */
.datenav { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.datenav button { background: var(--field); border: 1px solid var(--stroke); color: var(--ink);
  width: var(--tap); height: var(--tap); border-radius: var(--r-sm); cursor: pointer;
  display: grid; place-items: center; }
.datenav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }
.datenav-label { text-align: center; }
.datenav-label b { display: block; font-size: 1rem; }
.datenav-label span { font-size: .75rem; color: var(--ink-3); }

/* ---------- גיליון תחתון ---------- */
.scrim {
  position: fixed; inset: 0; z-index: 60; background: var(--scrim);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  animation: fadeIn var(--dur) var(--ease);
  display: flex; align-items: flex-end; justify-content: center;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.sheet {
  width: min(680px, 100%);
  max-height: 88dvh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  background: var(--bg-2); border: 1px solid var(--stroke); border-block-end: 0;
  padding: var(--sp-3) var(--sp-4) calc(var(--sp-6) + var(--safe-b));
  box-shadow: var(--shadow-lg);
  animation: sheetIn 280ms var(--ease);
}
@keyframes sheetIn { from { transform: translateY(100%); } to { transform: none; } }
.sheet-grip { width: 38px; height: 4px; border-radius: 2px; background: var(--stroke-2);
  margin: 0 auto var(--sp-4); }
.sheet h2 { margin-block-end: var(--sp-4); }
.sheet-actions { display: flex; gap: var(--sp-2); margin-block-start: var(--sp-5); }
.sheet-actions .btn { flex: 1; }

/* ---------- טוסט ---------- */
.toasts {
  position: fixed; inset-inline: 0; z-index: 90;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 14px);
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-2);
  pointer-events: none; padding: 0 var(--sp-4);
}
.toast {
  padding: var(--sp-3) var(--sp-5); border-radius: var(--r-full);
  background: var(--bg-2); border: 1px solid var(--stroke);
  box-shadow: var(--shadow-lg); font-size: .88rem; font-weight: 600;
  animation: toastIn 240ms var(--ease);
  max-width: 100%;
}
.toast.err { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.toast.ok { color: var(--good); border-color: color-mix(in srgb, var(--good) 38%, transparent); }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
.toast.out { animation: toastOut 200ms var(--ease) forwards; }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }

/* ---------- שלד טעינה ---------- */
.skel { border-radius: var(--r-sm); background: var(--field); position: relative; overflow: hidden; }
.skel::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, var(--glass-2), transparent);
  animation: shimmer 1.3s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.skel-line { height: 14px; margin-block-end: var(--sp-2); }
.skel-card { height: 110px; }

/* ---------- מצבים ריקים ושגיאה ---------- */
.empty { text-align: center; padding: var(--sp-8) var(--sp-4); color: var(--ink-3); }
.empty svg { width: 44px; height: 44px; margin-block-end: var(--sp-3); opacity: .5;
  fill: none; stroke: currentColor; stroke-width: 1.5; }
.error-box {
  padding: var(--sp-4); border-radius: var(--r-sm); text-align: center;
  background: color-mix(in srgb, var(--bad) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--bad) 32%, transparent); color: var(--bad);
}

/* ---------- גרפים ---------- */
.chart-box { position: relative; height: 230px; }
.chart-box.tall { height: 280px; }
.range-tabs { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- תמונות ---------- */
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-2); }
.photo-cell { position: relative; aspect-ratio: 3/4; border-radius: var(--r-sm); overflow: hidden;
  background: var(--field); border: 1px solid var(--stroke); cursor: pointer; padding: 0; }
.photo-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-cell figcaption { position: absolute; inset-inline: 0; bottom: 0; padding: 4px 6px;
  font-size: .68rem; background: linear-gradient(transparent, rgba(0,0,0,.75)); color: #fff; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
.compare img { width: 100%; border-radius: var(--r-sm); display: block; }

/* ---------- מחשבון צלחות ---------- */
.plates { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; }
.plate { padding: var(--sp-2) var(--sp-3); border-radius: var(--r-xs); font-weight: 800;
  font-size: .85rem; color: #fff; font-variant-numeric: tabular-nums; }

/* ---------- נגישות ותנועה ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@supports not (backdrop-filter: blur(1px)) {
  .glass, .topbar, .tabbar { background: var(--bg-2); }
}
@media (min-width: 720px) {
  .rings.rings-6 { grid-template-columns: repeat(6, 1fr); }
}

/* ---------- דוח שבועי ---------- */
.report {
  background: var(--glass); border: 1px solid var(--stroke);
  border-radius: var(--r-md); padding: var(--sp-5);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.report-head { text-align: center; padding-block-end: var(--sp-4);
  border-block-end: 2px solid var(--acc); margin-block-end: var(--sp-4); }
.report-head h2 { font-size: 1.3rem; }
.report-block { margin-block-end: var(--sp-5); }
.report-block h3 {
  font-size: .82rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--acc); margin-block-end: var(--sp-2);
  padding-block-end: 4px; border-block-end: 1px solid var(--stroke);
}
.report-row {
  display: flex; justify-content: space-between; gap: var(--sp-3);
  padding: 5px 0; font-size: .92rem; border-block-end: 1px dashed var(--stroke);
}
.report-row:last-child { border-block-end: 0; }
.report-row b { font-variant-numeric: tabular-nums; }
.report-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.report-table th {
  text-align: start; font-size: .72rem; color: var(--ink-3); font-weight: 700;
  padding: 4px 6px; border-block-end: 1px solid var(--stroke);
}
.report-table td { padding: 5px 6px; border-block-end: 1px dashed var(--stroke); }
.report-table td.num { font-variant-numeric: tabular-nums; }

@media print {
  @page { size: A4; margin: 14mm; }
  .bg-layer, .topbar, .tabbar, .toasts, .no-print, .rest-bar { display: none !important; }
  body { background: #fff !important; color: #111 !important; }
  .view { padding: 0 !important; max-width: none !important; display: block !important; }
  .report {
    background: #fff !important; border: 0 !important; box-shadow: none !important;
    backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
    padding: 0 !important; color: #111 !important;
  }
  .report-head { border-color: #111 !important; }
  .report-block h3 { color: #111 !important; border-color: #999 !important; }
  .report-row, .report-table td { border-color: #ddd !important; }
  .report-table th { border-color: #999 !important; color: #444 !important; }
  .tiny.dim, .dim { color: #666 !important; }
  .good { color: #0a7a52 !important; }
  .bad { color: #b02a3a !important; }
  .report-block { break-inside: avoid; }
}

/* ---------- סליידר השוואת תמונות ---------- */
.cmp {
  position: relative; width: 100%; aspect-ratio: 3/4; overflow: hidden;
  border-radius: var(--r-sm); border: 1px solid var(--stroke);
  background: var(--field); touch-action: none; cursor: ew-resize;
  user-select: none; -webkit-user-select: none;
}
.cmp img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: block; pointer-events: none;
}
.cmp .cmp-top { clip-path: inset(0 0 0 var(--split, 50%)); }
.cmp-handle {
  position: absolute; top: 0; bottom: 0; left: var(--split, 50%);
  width: 2px; background: #fff; box-shadow: 0 0 10px rgba(0,0,0,.6);
  pointer-events: none; transform: translateX(-1px);
}
.cmp-handle::after {
  content: ''; position: absolute; top: 50%; left: 50%;
  width: 36px; height: 36px; margin: -18px 0 0 -18px;
  border-radius: 50%; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.45);
}
.cmp-tag {
  position: absolute; top: 8px; padding: 3px 9px; border-radius: var(--r-full);
  font-size: .7rem; font-weight: 700; color: #fff; background: rgba(0,0,0,.6);
  pointer-events: none; backdrop-filter: blur(4px);
}
.cmp-tag.a { right: 8px; }   /* הישנה — בצד ימין, כמו זרימת הזמן בגרפים */
.cmp-tag.b { left: 8px; }    /* החדשה — בצד שמאל */

/* ---------- גרירה במגע ---------- */
.item.dragging {
  opacity: .85; transform: scale(1.02);
  border-color: var(--acc); box-shadow: var(--shadow-lg);
  position: relative; z-index: 5;
}
.item.drag-over { border-color: var(--acc); background: var(--field-focus); }
.drag-handle { cursor: grab; touch-action: none; padding: 6px 2px; }
.drag-handle:active { cursor: grabbing; }
