/* =====================================================================
   סט - מערכת עיצוב
   כל הצבעים והמידות כמשתנים ב-:root. מצב כהה לפי הגדרת המכשיר.
   ===================================================================== */

@font-face {
  font-family: "Heebo";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/heebo-hebrew-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}
@font-face {
  font-family: "Heebo";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/heebo-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --bg: #F4F5F7;
  --surface: #FFFFFF;
  --surface-2: #EEF0F3;
  --surface-3: #E4E7EC;
  --line: rgba(14, 17, 22, .08);
  --line-strong: rgba(14, 17, 22, .14);
  --text: #0E1116;
  --text-2: #4D5562;
  --text-3: #7D8693;

  --accent: #B8F24A;            /* רקע של כפתור ראשי, תמיד עם טקסט כהה */
  --on-accent: #10140A;
  --accent-ink: #3F6A00;        /* צבע המבטא כטקסט על רקע בהיר */
  --accent-soft: rgba(132, 196, 20, .14);

  --a: #0E9F92;
  --b: #6B5AE8;
  --a-soft: rgba(14, 159, 146, .12);
  --b-soft: rgba(107, 90, 232, .12);

  --danger: #D93A40;
  --danger-soft: rgba(217, 58, 64, .10);
  --warm: #C26A00;
  --warm-soft: rgba(245, 165, 36, .16);

  /* פס הזמן מאז הפעם הקודמת */
  --tb-early: #E8771E;
  --tb-soon: #8BCB45;
  --tb-soon-ink: #4F8A12;
  --tb-ontime: #1FA463;
  --tb-late: #E7B416;
  --tb-late-ink: #946E00;
  --tb-overdue: #E5484D;

  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 10px 30px -12px rgba(16, 24, 40, .14);
  --shadow-lg: 0 2px 4px rgba(16, 24, 40, .04), 0 24px 48px -16px rgba(16, 24, 40, .22);

  --r-xl: 28px;
  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;

  --tap: 56px;
  --nav-h: 66px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(.2, .8, .2, 1);

  --font: "Heebo", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0E1013;
    --surface: #171A1F;
    --surface-2: #1F232A;
    --surface-3: #292E37;
    --line: rgba(255, 255, 255, .07);
    --line-strong: rgba(255, 255, 255, .13);
    --text: #F2F4F7;
    --text-2: #B3BAC4;
    --text-3: #838C98;
    --accent-ink: #B8F24A;
    --accent-soft: rgba(184, 242, 74, .12);
    --a: #2EC4B6;
    --b: #8B7CF6;
    --a-soft: rgba(46, 196, 182, .14);
    --b-soft: rgba(139, 124, 246, .16);
    --danger: #FF5A5F;
    --danger-soft: rgba(255, 90, 95, .13);
    --warm: #F5A524;
    --warm-soft: rgba(245, 165, 36, .13);
    --tb-early: #FF9A3C;
    --tb-soon: #B8F24A;
    --tb-soon-ink: #B8F24A;
    --tb-ontime: #34C77B;
    --tb-late: #F5C83A;
    --tb-late-ink: #F5C83A;
    --tb-overdue: #FF5A5F;
    --shadow: 0 0 0 1px rgba(255, 255, 255, .05);
    --shadow-lg: 0 0 0 1px rgba(255, 255, 255, .06), 0 24px 48px -16px rgba(0, 0, 0, .6);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0E1013;
  --surface: #171A1F;
  --surface-2: #1F232A;
  --surface-3: #292E37;
  --line: rgba(255, 255, 255, .07);
  --line-strong: rgba(255, 255, 255, .13);
  --text: #F2F4F7;
  --text-2: #B3BAC4;
  --text-3: #838C98;
  --accent-ink: #B8F24A;
  --accent-soft: rgba(184, 242, 74, .12);
  --a: #2EC4B6;
  --b: #8B7CF6;
  --a-soft: rgba(46, 196, 182, .14);
  --b-soft: rgba(139, 124, 246, .16);
  --danger: #FF5A5F;
  --danger-soft: rgba(255, 90, 95, .13);
  --warm: #F5A524;
  --warm-soft: rgba(245, 165, 36, .13);
  --tb-early: #FF9A3C;
  --tb-soon: #B8F24A;
  --tb-soon-ink: #B8F24A;
  --tb-ontime: #34C77B;
  --tb-late: #F5C83A;
  --tb-late-ink: #F5C83A;
  --tb-overdue: #FF5A5F;
  --shadow: 0 0 0 1px rgba(255, 255, 255, .05);
  --shadow-lg: 0 0 0 1px rgba(255, 255, 255, .06), 0 24px 48px -16px rgba(0, 0, 0, .6);
}

/* ---------- בסיס ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.i {
  width: 22px; height: 22px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.num { font-variant-numeric: tabular-nums; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------- מעטפת וניווט ---------- */

.shell { min-height: 100dvh; }
.main {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px 16px calc(var(--nav-h) + var(--safe-b) + 24px);
}

.nav {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  height: calc(var(--nav-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(18px);
  -webkit-backdrop-filter: saturate(1.4) blur(18px);
  border-top: 1px solid var(--line);
}
.nav__brand { display: none; }
.nav__item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-size: 12px; font-weight: 500; color: var(--text-3);
  transition: color .2s var(--ease);
}
.nav__item .i { width: 24px; height: 24px; }
.nav__item.is-active { color: var(--text); font-weight: 700; }
.nav__item.is-active .i {
  background: var(--accent); color: var(--on-accent);
  width: 52px; height: 30px; padding: 4px 14px; border-radius: 99px;
  stroke-width: 2.2;
}

@media (min-width: 960px) {
  .shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); }
  .nav {
    position: sticky; top: 0; inset: auto;
    height: 100dvh; padding: 28px 16px;
    display: flex; flex-direction: column; gap: 4px;
    background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none;
    border-top: 0; border-inline-end: 1px solid var(--line);
  }
  .nav__brand {
    display: flex; align-items: center; gap: 12px;
    font-size: 24px; font-weight: 800; letter-spacing: -.02em;
    padding: 0 10px 26px;
  }
  .nav__brand img { border-radius: 11px; }
  .nav__item {
    flex-direction: row; justify-content: flex-start; gap: 14px;
    font-size: 16px; padding: 12px 14px; border-radius: var(--r-md);
    color: var(--text-2);
  }
  .nav__item:hover { background: var(--surface-2); color: var(--text); }
  .nav__item.is-active { background: var(--surface); box-shadow: var(--shadow); }
  .nav__item.is-active .i { width: 22px; height: 22px; padding: 0; background: none; color: var(--accent-ink); }
  .main { padding: 32px 40px 48px; }
}

/* ---------- כותרות עמוד ---------- */

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 4px 2px 18px; }
.page-head h1 { font-size: 28px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.page-head p { color: var(--text-2); margin-top: 4px; }
@media (min-width: 960px) { .page-head h1 { font-size: 34px; } }

.section-title { font-size: 13px; font-weight: 700; letter-spacing: .02em; color: var(--text-3); margin: 26px 4px 10px; }

/* ---------- כרטיסים ---------- */

.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: 18px;
}
.card + .card { margin-top: 12px; }
.card__title { font-size: 17px; font-weight: 700; }
.card__sub { color: var(--text-2); font-size: 14px; }

/* ---------- כפתורים ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px;
  border: 0; border-radius: 99px;
  font-weight: 700; font-size: 16px;
  background: var(--surface-2); color: var(--text);
  transition: transform .15s var(--ease), background .2s var(--ease), opacity .2s;
  user-select: none;
}
.btn:active { transform: scale(.97); }
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--ghost { background: transparent; color: var(--text-2); }
.btn--ghost:hover { background: var(--surface-2); color: var(--text); }
.btn--soft-danger { background: var(--danger-soft); color: var(--danger); }
.btn--block { width: 100%; }
.btn--sm { min-height: 40px; padding: 0 14px; font-size: 14px; }
.btn--xl { min-height: 64px; font-size: 20px; border-radius: 22px; }
.btn .i { width: 20px; height: 20px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: var(--surface-2); color: var(--text-2);
}
.icon-btn:hover { color: var(--text); }
.icon-btn .i { width: 20px; height: 20px; }

/* ---------- טפסים ---------- */

.field { display: grid; gap: 6px; }
.field + .field { margin-top: 14px; }
.field label, .field__label { font-size: 14px; font-weight: 600; color: var(--text-2); }
.input {
  width: 100%; min-height: 52px; padding: 0 16px;
  border: 1.5px solid transparent; border-radius: var(--r-md);
  background: var(--surface-2); font-size: 17px;
  transition: border-color .2s, background .2s;
}
.input:focus { outline: 0; border-color: var(--accent-ink); background: var(--surface); }
.input--num { font-variant-numeric: tabular-nums; }
.form-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.form-row > .field { flex: 1 1 140px; margin: 0; }
.form-error { color: var(--danger); font-weight: 600; font-size: 14px; }

/* מתג */
.switch { position: relative; display: inline-flex; width: 52px; height: 32px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch span {
  width: 100%; height: 100%; border-radius: 99px; background: var(--surface-3);
  transition: background .2s var(--ease); pointer-events: none;
}
.switch span::after {
  content: ""; position: absolute; top: 4px; inset-inline-start: 4px;
  width: 24px; height: 24px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s var(--ease);
}
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(-20px); }

/* ---------- תגיות ---------- */

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 30px; padding: 0 12px; border-radius: 99px;
  background: var(--surface-2); color: var(--text-2);
  font-size: 14px; font-weight: 600; white-space: nowrap;
}
.chip .i { width: 16px; height: 16px; }
.chip--w { background: var(--w-soft); color: var(--w); }
.chip--opt { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line-strong); color: var(--text-2); }
.chip--est { background: var(--warm-soft); color: var(--warm); white-space: normal; height: auto; padding-block: 5px; line-height: 1.35; }

.w-A { --w: var(--a); --w-soft: var(--a-soft); }
.w-B { --w: var(--b); --w-soft: var(--b-soft); }

.ex-num {
  display: inline-grid; place-items: center;
  min-width: 34px; height: 34px; padding: 0 8px; border-radius: 11px;
  background: var(--w, var(--text)); color: #fff;
  font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums;
}
:root[data-theme="dark"] .ex-num { color: #0E1013; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ex-num { color: #0E1013; } }

/* ---------- הודעות ---------- */

.toasts { display: grid; gap: 8px; margin-bottom: 14px; }
.toast {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border-radius: var(--r-md);
  background: var(--text); color: var(--bg);
  font-weight: 600; font-size: 15px;
  animation: rise .35s var(--ease) both;
}
.toast--error { background: var(--danger); color: #fff; }
.toast form { margin: 0; }
.toast__action {
  display: inline-flex; align-items: center; gap: 6px;
  border: 0; background: transparent; color: inherit; font-weight: 800; padding: 6px 4px;
}
.toast__action .i { width: 18px; height: 18px; }

.note {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-radius: var(--r-md);
  font-size: 15px; font-weight: 500; line-height: 1.45;
}
.note .i { width: 20px; height: 20px; margin-top: 1px; }
.note--warm { background: var(--warm-soft); color: var(--warm); }
.note--accent { background: var(--accent-soft); color: var(--accent-ink); }

/* ---------- מסך ראשי: סט בודד ---------- */

.home { display: flex; flex-direction: column; gap: 14px; min-height: calc(100dvh - var(--nav-h) - var(--safe-b) - 40px); }
.set-flow { display: flex; flex-direction: column; gap: 12px; flex: 1; }
.done-bar { margin-top: auto; }
.home__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand-mini { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; letter-spacing: -.02em; }
.brand-mini img { width: 32px; height: 32px; border-radius: 10px; }
@media (min-width: 960px) { .home__top { display: none; } }

.week-pill {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 14px 6px 6px; border-radius: 99px;
  background: var(--surface); box-shadow: var(--shadow);
  font-size: 14px; font-weight: 600; color: var(--text-2);
}
.week-pill b { color: var(--text); font-size: 16px; }
.ring { --p: 0; --c: var(--accent-ink); width: 34px; height: 34px; flex: none; }
.ring circle { fill: none; stroke-width: 4; }
.ring .ring__track { stroke: var(--surface-3); }
.ring .ring__val { stroke: var(--c); stroke-linecap: round; transition: stroke-dasharray .6s var(--ease); }

.round {
  display: grid; gap: 8px; padding: 0 4px;
}
.round__row { display: flex; justify-content: space-between; align-items: baseline; font-size: 15px; color: var(--text-2); }
.round__row b { color: var(--text); font-weight: 700; }
.bar { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: inherit; background: var(--w, var(--accent)); transition: width .6s var(--ease); }

.set-card {
  position: relative;
  display: grid; gap: 16px;
  padding: 20px;
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: rise .4s var(--ease) both;
}
.set-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--w);
}
.set-card__head { display: flex; gap: 14px; align-items: flex-start; }
.thumb {
  position: relative; flex: none;
  width: 76px; height: 76px; border-radius: 18px; overflow: hidden;
  background: var(--w-soft, var(--surface-2)); color: var(--w, var(--text-3));
  display: grid; place-items: center; border: 0; padding: 0;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .i { width: 30px; height: 30px; stroke-width: 1.6; }
.thumb--sm { width: 48px; height: 48px; border-radius: 13px; }
.thumb--sm .i { width: 22px; height: 22px; }
.thumb--lg { width: 112px; height: 112px; border-radius: 24px; }
button.thumb { cursor: zoom-in; }

.set-card__title { display: grid; gap: 6px; min-width: 0; }
.set-card__name { font-size: 21px; font-weight: 800; line-height: 1.25; letter-spacing: -.01em; }
.set-card__name .ex-num { margin-inline-end: 8px; vertical-align: 2px; }
.set-card__setno { font-size: 15px; font-weight: 600; color: var(--text-2); }
.set-card__setno b { color: var(--w); font-size: 17px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.set-card__body { display: grid; gap: 14px; }
.narrow { max-width: 620px; margin: 0 auto; }
.danger-zone { margin-top: 14px; }

.steppers { display: grid; gap: 12px; }
.stepper { display: grid; gap: 6px; }
.stepper__label { display: flex; justify-content: space-between; font-size: 14px; font-weight: 600; color: var(--text-2); padding: 0 4px; }
.stepper__box {
  display: grid; grid-template-columns: var(--tap) minmax(0, 1fr) var(--tap); align-items: center; gap: 8px;
  padding: 6px; border-radius: 22px; background: var(--surface-2);
}
.stepper__btn {
  width: var(--tap); height: var(--tap); border-radius: 17px; border: 0;
  background: var(--surface); color: var(--text); display: grid; place-items: center;
  box-shadow: var(--shadow); transition: transform .12s var(--ease);
}
.stepper__btn:active { transform: scale(.92); }
.stepper__btn .i { width: 24px; height: 24px; stroke-width: 2.4; }
.stepper__input {
  color: var(--text);
  width: 100%; min-width: 0; border: 0; background: transparent; text-align: center;
  font-size: 38px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums;
  padding: 0; height: var(--tap);
}
.stepper__input:focus { outline: 0; }
.stepper__box:focus-within { box-shadow: inset 0 0 0 2px var(--accent-ink); }
.stepper__unit { font-size: 15px; font-weight: 600; color: var(--text-3); }
@media (min-width: 420px) { .steppers { grid-template-columns: 1fr 1fr; } }

.prev-line { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-3); padding: 0 4px; }
.prev-line .i { width: 16px; height: 16px; }

.when { border-top: 1px dashed var(--line-strong); padding-top: 12px; }
.when summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 600; color: var(--text-2); padding: 4px;
}
.when summary::-webkit-details-marker { display: none; }
.when summary .i { width: 18px; height: 18px; }
.when__fields { display: grid; grid-template-columns: 1.3fr 1fr; gap: 10px; margin-top: 10px; }

.done-bar {
  position: sticky; bottom: calc(var(--nav-h) + var(--safe-b) + 10px); z-index: 5;
  display: grid; gap: 4px;
}
.done-bar .btn--xl { box-shadow: 0 12px 28px -10px rgba(120, 170, 20, .55); }
.later-btn { min-height: 44px; font-size: 15px; }
@media (min-width: 960px) { .done-bar { bottom: 20px; } }

.warmup { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--warm); }
.warmup .i { width: 17px; height: 17px; }

/* פס הזמן מאז הפעם הקודמת: סקאלה של 8 ימים, בכיוון הקריאה (מימין לשמאל) */
.timebar { display: grid; gap: 8px; }
.timebar__track { position: relative; display: flex; height: 8px; border-radius: 99px; }
.timebar__seg { height: 100%; opacity: .32; }
.timebar__seg:first-child { border-start-start-radius: 99px; border-end-start-radius: 99px; }
.timebar__seg:nth-child(5) { border-start-end-radius: 99px; border-end-end-radius: 99px; }
.timebar__seg--early   { flex: 2; background: var(--tb-early); }
.timebar__seg--soon    { flex: 1; background: var(--tb-soon); }
.timebar__seg--ontime  { flex: 2; background: var(--tb-ontime); }
.timebar__seg--late    { flex: 2; background: var(--tb-late); }
.timebar__seg--overdue { flex: 1; background: var(--tb-overdue); }
.timebar--early   .timebar__seg--early,
.timebar--soon    .timebar__seg--soon,
.timebar--ontime  .timebar__seg--ontime,
.timebar--late    .timebar__seg--late,
.timebar--overdue .timebar__seg--overdue { opacity: 1; }
.timebar__marker {
  position: absolute; top: 50%; width: 18px; height: 18px; margin-inline-start: -9px; transform: translateY(-50%);
  border-radius: 50%; background: var(--surface); border: 4px solid var(--tb-c); box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
}
.timebar__text { font-size: 14px; color: var(--text-2); }
.timebar__text b { color: var(--tb-c); font-weight: 700; }
.timebar--early   { --tb-c: var(--tb-early); }
.timebar--soon    { --tb-c: var(--tb-soon-ink); }
.timebar--ontime  { --tb-c: var(--tb-ontime); }
.timebar--late    { --tb-c: var(--tb-late-ink); }
.timebar--overdue { --tb-c: var(--tb-overdue); }

.saved {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: var(--r-lg);
  background: var(--accent-soft); color: var(--text);
  animation: rise .35s var(--ease) both;
}
.saved__check { width: 44px; height: 44px; flex: none; }
.saved__check circle { fill: var(--accent); }
.saved__check path { fill: none; stroke: var(--on-accent); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw .5s .15s var(--ease) forwards; }
.saved__check { animation: pop .45s var(--ease) both; }
.saved__text { flex: 1; min-width: 0; font-size: 15px; }
.saved__text b { display: block; font-size: 16px; }
.saved__edit { color: var(--text-2); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 4px; }
.saved__edit .i { width: 16px; height: 16px; }

/* עמודת צד בלפטופ */
.home-grid { display: grid; gap: 14px; }
.aside { display: none; }
@media (min-width: 960px) {
  .home-grid { grid-template-columns: minmax(0, 620px) minmax(280px, 340px); gap: 28px; justify-content: center; align-items: start; }
  .aside { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; position: sticky; top: 32px; min-width: 0; }
  .home { max-width: 620px; min-height: 0; }
}
.queue-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 2px; }
.queue-list li { display: flex; align-items: center; gap: 10px; padding: 8px 4px; font-size: 14px; border-radius: 10px; }
.queue-list li .ex-num { min-width: 28px; height: 28px; font-size: 13px; border-radius: 9px; }
.queue-list__name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.queue-list li small { color: var(--text-3); font-size: 13px; }
.queue-list li.is-next { background: var(--surface-2); font-weight: 700; }

.big-stat { display: flex; align-items: baseline; gap: 8px; margin-top: 6px; }
.big-stat b { font-size: 40px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.05; }
.big-stat span { color: var(--text-2); font-weight: 600; }

.goal-track { position: relative; height: 10px; border-radius: 99px; background: var(--surface-3); margin-top: 14px; }
.goal-track__fill { position: absolute; inset-block: 0; inset-inline-start: 0; border-radius: inherit; background: var(--accent); transition: width .6s var(--ease); }
.goal-track__fill.is-low { background: var(--warm); }
.goal-track__min { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-inline-start: -1.5px; border-radius: 2px; background: var(--text); opacity: .55; }
.goal-track__legend { display: flex; justify-content: space-between; gap: 10px; margin-top: 10px; font-size: 14px; font-weight: 600; color: var(--text-2); }

/* ---------- היסטוריה ---------- */

.tabs {
  display: inline-flex; padding: 4px; gap: 4px; border-radius: 99px; background: var(--surface-2);
  margin-bottom: 16px;
}
.tabs a { padding: 8px 18px; border-radius: 99px; font-weight: 600; font-size: 15px; color: var(--text-2); }
.tabs a.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.week { margin-top: 22px; }
.week__head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  padding: 0 4px 8px; border-bottom: 1px solid var(--line); margin-bottom: 10px;
}
.week__head h2 { font-size: 15px; font-weight: 700; }
.week__head span { font-size: 14px; color: var(--text-2); font-weight: 600; }
.day { padding: 4px 0 8px; }
.day__head { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-3); font-weight: 600; padding: 6px 4px; }
.log-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.log-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.log-item + .log-item { border-top: 1px solid var(--line); }
.log-item__main { flex: 1; min-width: 0; }
.log-item__name { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.log-item__meta { color: var(--text-3); font-size: 13px; }
.log-item__val { font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.log-item__val small { font-weight: 600; color: var(--text-3); font-size: 13px; }
.log-item .icon-btn { width: 38px; height: 38px; }

.legacy {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: var(--r-lg);
  border: 1.5px dashed var(--line-strong); color: var(--text-2);
}
.legacy + .legacy { margin-top: 8px; }
.legacy__badge {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  background: var(--w-soft); color: var(--w); font-weight: 800; flex: none;
}
.legacy__main { flex: 1; }
.legacy__main b { color: var(--text); display: block; font-size: 15px; }
.legacy__main span { font-size: 13px; }

.pager { display: flex; justify-content: center; gap: 10px; margin-top: 26px; }

.ex-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.ex-list li + li { border-top: 1px solid var(--line); }
.ex-list a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.ex-list a:hover { background: var(--surface-2); }
.ex-list__main { flex: 1; min-width: 0; }
.ex-list__name { font-weight: 600; }
.ex-list__meta { font-size: 13px; color: var(--text-3); }
.ex-list .i-chev { color: var(--text-3); width: 18px; height: 18px; }

/* ---------- גרפים ---------- */

.chart-card { padding: 16px 16px 10px; }
.chart--wide { display: none; }
@media (min-width: 760px) { .chart--narrow { display: none; } .chart--wide { display: block; } }
.chart .lbl-goal, .chart .lbl-min { paint-order: stroke; stroke: var(--surface); stroke-width: 5px; stroke-linejoin: round; }
.chart-card__head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { font-family: var(--font); font-size: 12.5px; fill: var(--text-3); font-variant-numeric: tabular-nums; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .goal { stroke: var(--accent-ink); stroke-width: 1.5; stroke-dasharray: 5 5; }
.chart .min { stroke: var(--warm); stroke-width: 1.5; stroke-dasharray: 2 4; }
.chart .line { fill: none; stroke: var(--w, var(--accent-ink)); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--w-soft, var(--accent-soft)); }
.chart .dot { fill: var(--surface); stroke: var(--w, var(--accent-ink)); stroke-width: 2.5; }
.chart .bar-real { fill: var(--accent-ink); }
.chart .bar-est { fill: var(--warm); opacity: .55; }
.chart .bar-now { fill: var(--accent); }
.chart .lbl-goal { fill: var(--accent-ink); font-weight: 700; }
.chart .lbl-min { fill: var(--warm); font-weight: 700; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-3); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-inline-end: 5px; vertical-align: -1px; }

/* ---------- תרגיל ---------- */

.ex-hero { display: flex; gap: 16px; align-items: center; }
.ex-hero h1 { font-size: 24px; font-weight: 800; line-height: 1.2; }
.ex-hero .chips { margin-top: 8px; }
.photo-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ---------- משקל גוף ---------- */

.weight-hero { display: grid; gap: 14px; }
@media (min-width: 760px) { .weight-hero { grid-template-columns: 1.1fr 1fr; } }
.goal-bar { margin-top: 14px; }
.goal-bar__row { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-3); margin-top: 6px; }

/* ---------- הגדרות ---------- */

.settings { display: grid; gap: 4px; max-width: 760px; }
.list { list-style: none; margin: 0; padding: 0; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.list-row + .list-row { border-top: 1px solid var(--line); }
.list-row__main { flex: 1; min-width: 0; }
.list-row__main b { display: block; font-weight: 600; }
.list-row__main span { font-size: 13px; color: var(--text-3); }
.list-row form { margin: 0; }
.time-input { width: 120px; min-height: 46px; text-align: center; font-weight: 700; font-size: 18px; }
.inline-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- כניסה ---------- */

.bare__main { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login { width: 100%; max-width: 380px; display: grid; gap: 22px; text-align: center; }
.login__mark { width: 84px; height: 84px; margin: 0 auto; border-radius: 26px; box-shadow: var(--shadow-lg); }
.login h1 { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.login p { color: var(--text-2); margin-top: 4px; }
.login form { display: grid; gap: 12px; text-align: start; }

/* ---------- דף ריק / שגיאה ---------- */

.empty { text-align: center; padding: 60px 20px; display: grid; gap: 12px; justify-items: center; }
.empty__code { font-size: 64px; font-weight: 900; color: var(--text-3); letter-spacing: -.04em; line-height: 1; }
.empty__title { font-size: 24px; font-weight: 800; }
.empty__text { color: var(--text-2); max-width: 420px; }

/* ---------- לייטבוקס ודיאלוג ---------- */

.lightbox {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  background: rgba(5, 6, 8, .92); padding: 16px; cursor: zoom-out;
  animation: fade .2s ease both;
}
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 16px; object-fit: contain; }
.lightbox__close {
  position: absolute; top: max(16px, env(safe-area-inset-top)); inset-inline-end: 16px;
  width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .14); color: #fff;
  display: grid; place-items: center;
}

.confirm {
  border: 0; padding: 24px; border-radius: var(--r-xl); width: min(360px, calc(100% - 32px));
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
}
.confirm::backdrop { background: rgba(5, 6, 8, .55); backdrop-filter: blur(2px); }
.confirm[open] { animation: rise .25s var(--ease) both; }
.confirm__text { font-size: 18px; font-weight: 700; margin-bottom: 20px; }
.confirm__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- אנימציות ---------- */

@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
  .saved__check path { stroke-dashoffset: 0; }
}

.ex-num--sm { min-width: 26px; height: 26px; font-size: 13px; border-radius: 8px; padding: 0 6px; margin-inline-end: 4px; vertical-align: 1px; }
.i-flip { transform: scaleX(-1); }
.weight-form { display: grid; gap: 14px; margin-top: 14px; }
.weight-form .field + .field { margin-top: 0; }
.log-item form { margin: 0; }
.photo-actions form { margin: 0; }
.list-row .photo-actions { margin-top: 8px; }
.file-btn.is-busy, form.is-busy .file-btn { opacity: .6; pointer-events: none; }
.log-item--legacy { color: var(--text-2); background: repeating-linear-gradient(-45deg, transparent 0 8px, var(--surface-2) 8px 9px); }
