/* ===========================================================
   נתיב – שפת עיצוב
   נייר חם, דיו כהה, צבע אחד שמשמש במשורה, צללים רכים במקום מסגרות.
   =========================================================== */

html, body { margin: 0; padding: 0; }
:root { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
img { max-width: 100%; }
[hidden] { display: none !important; }

:root {
  /* משטחים */
  --bg: #f6f5f2;
  --surface: #ffffff;
  --surface-2: #f4f3f0;
  --surface-3: #eeece8;

  /* דיו */
  --ink: #15171c;
  --ink-2: #5c626d;
  --ink-3: #91969f;

  /* קווים – שקופים, כדי שיישבו על כל רקע */
  --line: rgba(21, 23, 28, .11);
  --line-2: rgba(21, 23, 28, .06);

  /* צבע */
  --accent: #2a55c8;
  --accent-hover: #21469f;
  --accent-ink: #ffffff;
  --accent-soft: #edf1fc;
  --accent-line: rgba(42, 85, 200, .28);

  /* פעולה ראשית – דיו כחול־כהה */
  --primary: #18213a;
  --primary-hover: #101729;
  --primary-ink: #ffffff;

  /* סמנטי */
  --lane: #9c6b12;
  --lane-soft: #faf1e0;
  --lane-ink: #85590b;
  --ok: #17714f;
  --ok-soft: #e7f2ed;
  --warn: #96601a;
  --warn-soft: #fbf0de;
  --bad: #a83a2e;
  --bad-soft: #fbeae7;

  /* עיגול */
  --r1: 9px;
  --r2: 12px;
  --r3: 16px;
  --r4: 20px;

  /* צל */
  --sh-1: 0 1px 2px rgba(18, 20, 28, .05);
  --sh-2: 0 1px 2px rgba(18, 20, 28, .04), 0 6px 16px -8px rgba(18, 20, 28, .13);
  --sh-3: 0 2px 4px rgba(18, 20, 28, .04), 0 18px 44px -22px rgba(18, 20, 28, .24);
  --sh-4: 0 24px 70px -20px rgba(12, 16, 28, .40), 0 4px 12px rgba(12, 16, 28, .10);

  /* תנועה */
  --ease: cubic-bezier(.22, .72, .28, 1);
  --dur: .17s;

  --toast-link: #9db8f7;
  --font: "Assistant", "Segoe UI", "Arial Hebrew", Arial, sans-serif;
  --mono: var(--font);
  --display: var(--font);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101216; --surface: #191c22; --surface-2: #20242b; --surface-3: #272c34;
    --ink: #e9ebef; --ink-2: #a3aab6; --ink-3: #79818e;
    --line: rgba(255, 255, 255, .12); --line-2: rgba(255, 255, 255, .07);
    --accent: #7ba0f5; --accent-hover: #9ab7f8; --accent-ink: #0d1626; --accent-soft: #1c2740; --accent-line: rgba(123, 160, 245, .35);
    --primary: #e9ebef; --primary-hover: #ffffff; --primary-ink: #14171d;
    --lane: #e0a94a; --lane-soft: #2e2413; --lane-ink: #eabd6b;
    --ok: #55c28f; --ok-soft: #13291f; --warn: #dda157; --warn-soft: #2e2413;
    --bad: #ef8272; --bad-soft: #321b18;
    --sh-1: 0 1px 2px rgba(0,0,0,.4);
    --sh-2: 0 1px 2px rgba(0,0,0,.4), 0 8px 20px -10px rgba(0,0,0,.6);
    --sh-3: 0 2px 6px rgba(0,0,0,.4), 0 20px 46px -24px rgba(0,0,0,.7);
    --sh-4: 0 28px 80px -20px rgba(0,0,0,.75);
  --toast-link: #2a55c8;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #101216; --surface: #191c22; --surface-2: #20242b; --surface-3: #272c34;
  --ink: #e9ebef; --ink-2: #a3aab6; --ink-3: #79818e;
  --line: rgba(255, 255, 255, .12); --line-2: rgba(255, 255, 255, .07);
  --accent: #7ba0f5; --accent-hover: #9ab7f8; --accent-ink: #0d1626; --accent-soft: #1c2740; --accent-line: rgba(123, 160, 245, .35);
  --primary: #e9ebef; --primary-hover: #ffffff; --primary-ink: #14171d;
  --lane: #e0a94a; --lane-soft: #2e2413; --lane-ink: #eabd6b;
  --ok: #55c28f; --ok-soft: #13291f; --warn: #dda157; --warn-soft: #2e2413;
  --bad: #ef8272; --bad-soft: #321b18;
  --sh-1: 0 1px 2px rgba(0,0,0,.4);
  --sh-2: 0 1px 2px rgba(0,0,0,.4), 0 8px 20px -10px rgba(0,0,0,.6);
  --sh-3: 0 2px 6px rgba(0,0,0,.4), 0 20px 46px -24px rgba(0,0,0,.7);
  --sh-4: 0 28px 80px -20px rgba(0,0,0,.75);
  --toast-link: #2a55c8;
  color-scheme: dark;
}

* { box-sizing: border-box; }
/* המסך נשאר תמיד בגודל אחד: בלי זום בצביטה ובלי הגדלה בהקשה כפולה.
   יחד עם שדות של 16px, אין שום מצב שבו המסך קופץ והמשתמש צריך לצבוט חזרה. */
html { touch-action: pan-x pan-y; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  background: var(--bg); color: var(--ink);
  touch-action: pan-x pan-y;
  font-family: var(--font); font-size: 15px; line-height: 1.55; font-weight: 400;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
#app { max-width: 1160px; margin: 0 auto; padding-inline: 18px; padding-block: 0 110px; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent-soft); color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
:focus:not(:focus-visible) { outline: none; }

/* מספרים וזמנים – רוחב אחיד, בלי גופן מכונת־כתיבה */
.t, .tm, .av, .slot, .dl-t, .date, .linkbox, code {
  font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1;
}
.t { font-weight: 600; letter-spacing: .005em; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: 13px; }
h1, h2, h3 { margin: 0; text-wrap: balance; letter-spacing: -.018em; font-weight: 700; }

/* ---------- כותרת עליונה ---------- */
.top {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: color-mix(in srgb, var(--bg) 95%, transparent);
  backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
  padding-block: 12px 0; margin-inline: -18px; padding-inline: 18px;
}
.bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 42px; }
.brand { display: flex; align-items: center; gap: 10px; margin-inline-end: auto; min-width: 0; }
.brand .txt { display: grid; min-width: 0; }
.brand b { font-size: 21px; line-height: 1.15; font-weight: 700; letter-spacing: -.03em; color: var(--ink); }
.brand .sign {
  width: 30px; height: 30px; border-radius: 9px; background: var(--primary);
  display: grid; place-items: center; flex: none; box-shadow: var(--sh-1);
}
.brand .sign i { width: 3px; height: 16px; background: repeating-linear-gradient(to bottom, var(--primary-ink) 0 5px, transparent 5px 8px); border-radius: 2px; }
.brand span { color: var(--ink-3); font-size: 12.5px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; background: var(--surface); border: 1px solid var(--line);
  white-space: nowrap; box-shadow: var(--sh-1);
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { color: var(--ok); background: var(--ok-soft); border-color: transparent; box-shadow: none; }
.pill.warn { color: var(--warn); background: var(--warn-soft); border-color: transparent; box-shadow: none; }
.pill.bad { color: var(--bad); background: var(--bad-soft); border-color: transparent; box-shadow: none; }
.pill.info { color: var(--accent); background: var(--accent-soft); border-color: transparent; box-shadow: none; }
.pill.lane { color: var(--lane-ink); background: var(--lane-soft); border-color: transparent; box-shadow: none; }
.save { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
@media (max-width: 560px) {
  .bar > .pill.t { display: none; }
  .brand b { font-size: 19px; }
}

.tabs { display: flex; gap: 4px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; position: relative; }
.tabs::-webkit-scrollbar { display: none; }
.tabs::after { content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 1px; background: var(--line-2); }
.tabs button {
  position: relative; background: none; border: 0; padding: 9px 2px 11px; margin-inline-end: 18px;
  font-weight: 600; font-size: 14.5px; color: var(--ink-3); cursor: pointer; white-space: nowrap;
  transition: color var(--dur) var(--ease);
}
.tabs button::after {
  content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 2px; border-radius: 2px 2px 0 0;
  background: var(--ink); transform: scaleX(0); transition: transform var(--dur) var(--ease); z-index: 1;
}
.tabs button:hover { color: var(--ink-2); }
.tabs button[aria-selected="true"] { color: var(--ink); }
.tabs button[aria-selected="true"]::after { transform: scaleX(1); }
.tabs button .n { font-size: 12px; font-weight: 600; color: var(--ink-3); margin-inline-start: 5px; font-variant-numeric: tabular-nums; }
.tabs button[aria-selected="true"] .n { color: var(--accent); }

/* ---------- כפתורים ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 38px; padding: 7px 15px; border-radius: var(--r1);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font-weight: 600; font-size: 14.5px; cursor: pointer; text-decoration: none; white-space: nowrap;
  box-shadow: var(--sh-1);
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease), color var(--dur) var(--ease);
}
.btn:hover { border-color: var(--line); box-shadow: var(--sh-2); transform: translateY(-1px); }
.btn:active { transform: translateY(0); box-shadow: var(--sh-1); }
.btn.primary { background: var(--primary); border-color: transparent; color: var(--primary-ink); box-shadow: var(--sh-2); }
.btn.primary:hover { background: var(--primary-hover); box-shadow: var(--sh-3); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--accent); box-shadow: none; }
.btn.ghost:hover { background: var(--accent-soft); box-shadow: none; transform: none; }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); border-color: transparent; }
.btn.sm { min-height: 31px; padding: 3px 11px; font-size: 13px; border-radius: 8px; }
.btn[disabled] { opacity: .4; cursor: not-allowed; box-shadow: none; transform: none; }
.btn.busy { pointer-events: none; opacity: .65; }
.icon-btn {
  width: 30px; height: 30px; display: inline-grid; place-items: center; border-radius: 8px;
  border: 1px solid transparent; background: none; color: var(--ink-3); cursor: pointer; flex: none;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn[aria-pressed="true"] { color: var(--accent); }
.linkish {
  background: none; border: 0; padding: 3px 0; color: var(--accent); cursor: pointer; font-size: inherit;
  font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--accent-line);
  transition: border-color var(--dur) var(--ease); line-height: 1.5;
}
.linkish:hover { border-bottom-color: currentColor; }

/* ---------- טפסים ---------- */
label.f { display: grid; gap: 5px; font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
/* כל שדה שמקלידים בו, כולל סוגים שנוספים בעתיד. שדה מייל היה חסר כאן
   לגמרי וקיבל את עיצוב ברירת המחדל של הדפדפן. */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not([type="submit"]):not([type="button"]),
select, textarea {
  width: 100%; min-height: 44px; padding: 9px 12px; border-radius: var(--r1);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  /* 16px זה הסף שמתחתיו ספארי באייפון מזום פנימה על כל הקלדה.
     אסור לרדת מזה בשום שדה. */
  font-size: 16px;
  font-weight: 400; box-shadow: var(--sh-1);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.tp-in, input[type="number"], input[type="date"] { font-variant-numeric: tabular-nums; font-weight: 500; letter-spacing: .01em; }
select { cursor: pointer; }
textarea { min-height: 92px; resize: vertical; line-height: 1.6; }
input::placeholder, textarea::placeholder { color: var(--ink-3); }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--ink-3) 55%, transparent); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3.5px var(--accent-soft);
}
input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--accent); vertical-align: middle; flex: none; cursor: pointer; }
/* התווית כולה היא שטח הנגיעה, ולכן היא מקבלת גובה מינימלי נוח לאצבע */
.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; line-height: 1.35; min-height: 30px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ---------- משטחים ---------- */
.section { margin-top: 26px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.section-head h2 { font-size: 17px; font-weight: 700; }
.panel { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r3); box-shadow: var(--sh-2); }
.pad { padding: 18px; }
.banner {
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
  padding: 13px 16px; border-radius: var(--r2); margin-top: 16px; font-size: 14px; line-height: 1.5;
}
.banner.info { background: var(--accent-soft); color: color-mix(in srgb, var(--accent) 75%, var(--ink)); }
.banner.warn { background: var(--warn-soft); color: var(--warn); }
.banner.bad { background: var(--bad-soft); color: var(--bad); }
.banner.lane { background: var(--lane-soft); color: var(--lane-ink); }
.banner b { color: inherit; }
.banner p { margin: 0; flex: 1 1 280px; }
.banner .btn:not(.primary) { background: var(--surface); border-color: transparent; }

/* ---------- תהליך שבועי ---------- */
.flow { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 18px; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r3); box-shadow: var(--sh-2); overflow: hidden; }
.step { padding: 16px 18px; border-inline-start: 1px solid var(--line-2); display: grid; gap: 6px; align-content: start; position: relative; }
.step:first-child { border-inline-start: 0; }
.step .k { display: flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; color: var(--ink-3); }
.step .k i { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 11px; font-weight: 700; border: 1.5px solid var(--line); color: var(--ink-3); }
.step.done .k i { background: var(--ok); border-color: var(--ok); color: #fff; }
.step.now { background: var(--accent-soft); }
.step.now .k { color: var(--accent); }
.step.now .k i { border-color: var(--accent); color: var(--accent); }
.step h3 { font-size: 15.5px; font-weight: 700; }
.step p { margin: 0; font-size: 13px; color: var(--ink-2); }
.step .row-actions { margin-top: 4px; }
@media (max-width: 860px) { .flow { grid-template-columns: 1fr 1fr; } .step:nth-child(3) { border-inline-start: 0; } .step:nth-child(n+3) { border-top: 1px solid var(--line-2); } }
@media (max-width: 520px) { .flow { grid-template-columns: 1fr; } .step { border-inline-start: 0; } .step + .step { border-top: 1px solid var(--line-2); } }

/* ---------- כותרת השבוע ---------- */
.hero {
  margin-top: 18px; display: flex; gap: 28px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r4);
  padding: 22px 24px; box-shadow: var(--sh-2);
}
.hero-main { flex: 1 1 360px; display: grid; gap: 7px; min-width: 0; }
.hero-kicker { margin: 0; font-size: 11.5px; font-weight: 700; letter-spacing: .1em; color: var(--ink-3); }
.hero h1 { font-size: 31px; line-height: 1.1; font-weight: 700; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.hero h1 .rng { unicode-bidi: isolate; }
.hero-state { margin: 0; font-size: 15px; color: var(--ink-2); max-width: 54ch; }
.facts { display: flex; gap: 8px 18px; flex-wrap: wrap; font-size: 13px; color: var(--ink-3); margin-top: 3px; }
.facts span { display: inline-flex; align-items: baseline; gap: 5px; }
.facts b { color: var(--ink); font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.bad-t, .bad-t b { color: var(--bad) !important; }
.ok-t { color: var(--ok); font-weight: 600; }
.hero-actions { display: grid; gap: 10px; justify-items: stretch; flex: 0 1 290px; }
.hero-actions > .btn { min-height: 48px; font-size: 15.5px; border-radius: var(--r2); }
.hero-actions .row-actions { justify-content: center; }
@media (max-width: 640px) {
  .hero { padding: 18px; gap: 18px; border-radius: var(--r3); }
  .hero h1 { font-size: 27px; }
  .hero-actions { flex-basis: 100%; }
}
details.more > summary { cursor: pointer; font-weight: 600; color: var(--ink-2); font-size: 13.5px; list-style-position: inside; }
details.more > summary:hover { color: var(--ink); }
.blk-row { grid-template-columns: 1.1fr .9fr .9fr 1.4fr 32px; }
/* בלי זה, select עם אפשרות ארוכה כמו "ראשון 27.9" מרחיב את כל השורה */
.av-row > *, .blk-row > * { min-width: 0; }
@media (max-width: 620px) { .blk-row { grid-template-columns: 1fr 1fr; } .blk-row > input[type="text"] { grid-column: 1 / -1; } }
@media (max-width: 430px) {
  .blk-row { grid-template-columns: 1fr 1fr; }
  .blk-row > select { grid-column: 1 / -1; }
  .av-row { grid-template-columns: 1fr 1fr 32px; }
  .av-row > select { grid-column: 1 / -1; }
}

/* ---------- ימים ---------- */
.days { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
@media (max-width: 420px) { .days { grid-template-columns: 1fr; } }
.day {
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r3);
  box-shadow: var(--sh-2); display: flex; flex-direction: column; overflow: hidden;
  transition: box-shadow var(--dur) var(--ease);
}
.day:hover { box-shadow: var(--sh-3); }
.day-h { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; padding: 15px 16px 0; }
.day-h h3 { font-size: 17px; font-weight: 700; letter-spacing: -.02em; }
.day-h .date { font-size: 13px; color: var(--ink-3); font-weight: 600; }
.day-tools { display: flex; gap: 2px; flex-wrap: wrap; margin-inline-start: auto; }
.day-tools .btn { box-shadow: none; color: var(--ink-3); font-weight: 600; }
.day-tools .btn:hover { color: var(--accent); }
.day-meta { margin: 3px 16px 0; font-size: 12.5px; color: var(--ink-3); }
.day-meta .t { font-weight: 600; color: var(--ink-2); }

.track { position: relative; height: 5px; margin: 11px 16px 0; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.track span { position: absolute; top: 0; bottom: 0; }
.track .l { background: var(--accent); border-radius: 999px; }
.track .l.bad { background: var(--bad); }
.track .b { background: var(--lane); opacity: .45; }
.track .x { background: var(--ink-3); opacity: .3; }
.track-scale { display: none; }

.rows { display: grid; gap: 1px; padding: 10px 10px 12px; }
.r {
  display: grid; grid-template-columns: max-content minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 9px 10px; border-radius: 10px; text-align: start; background: none; border: 0; width: 100%;
  position: relative;
}
.r .tm { font-size: 13px; font-weight: 600; white-space: nowrap; color: var(--ink-2); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }

.r.lesson { cursor: pointer; transition: background var(--dur) var(--ease); }
.r.lesson::before {
  content: ""; position: absolute; inset-block: 7px; inset-inline-start: 0; width: 3px;
  border-radius: 999px; background: var(--accent); opacity: .85;
}
.r.lesson:hover { background: var(--surface-2); }
.r.lesson .bd { display: grid; gap: 1px; min-width: 0; }
.r.lesson .nm-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.r.lesson .nm { font-weight: 700; font-size: 14.5px; letter-spacing: -.012em; }
.r.lesson .sub { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r.lesson .tm { color: var(--ink); }
.r.lesson.has-err::before { background: var(--bad); }
.r.lesson.has-err { background: var(--bad-soft); }
.r.lesson.has-warn::before { background: var(--warn); }

.r.gap { padding: 1px 10px; min-height: 16px; font-size: 11px; color: var(--lane-ink); grid-template-columns: max-content 1fr; }
.r.gap .tm { font-size: 11px; font-weight: 600; color: var(--lane-ink); }
.r.gap .ln { height: 0; border-top: 1.5px dashed var(--lane); opacity: .45; }
.r.gap.none, .r.gap.none .tm { color: var(--ink-3); }
.r.gap.none .ln { border-top-style: solid; border-top-color: var(--line-2); opacity: 1; }
.r.gap .slack { font-size: 10px; opacity: .7; font-weight: 600; }
.r.gap.drive .ln { border-top-color: var(--accent); }
.r.gap.drive, .r.gap.drive .tm { color: var(--accent); }
.drive-t { color: var(--accent); font-weight: 600; }

.r.brk { color: var(--lane-ink); background: var(--lane-soft); font-size: 13px; font-weight: 600; }
.r.blk { color: var(--ink-2); background: var(--surface-2); font-size: 13px; font-weight: 600; }
.r.free {
  color: var(--ink-3); font-size: 12.5px; cursor: pointer; border: 1px dashed transparent;
  padding-block: 6px; opacity: .8;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease), background var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.r.free .tm { color: var(--ink-3); font-weight: 500; }
.r.free:hover { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); opacity: 1; }
.r.free:hover .tm { color: var(--accent); }
.r.free .add { font-weight: 700; color: var(--accent); opacity: 0; transition: opacity var(--dur) var(--ease); }
.r.free:hover .add, .r.free:focus-visible .add { opacity: 1; }
@media (hover: none) { .r.free .add { opacity: 1; } }

.badges { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.badges:empty { display: none; }
.r > span:empty { display: none; }

/* ---------- ניווט ----------
   כפתור שנלחץ באצבע, לרוב בעמידה ליד הרכב. הוא צבוע בצבע הפעולה
   כדי שהעין תמצא אותו מיד, ושטח הנגיעה שלו גדול מהעיגול הנראה. */
.nav-btn {
  position: relative; width: 34px; height: 34px; text-decoration: none;
  color: var(--accent); background: var(--accent-soft);
}
.nav-btn::after { content: ""; position: absolute; inset-block: -5px; inset-inline: -2px; }
.nav-btn svg { display: block; }
.nav-btn:hover { background: var(--accent); color: var(--accent-ink); }
@media (hover: none) { .nav-btn:hover { background: var(--accent-soft); color: var(--accent); } }
/* בזמן העברת שיעור כל שורה היא יעד להחלפה, וכפתור בתוכה רק יגנוב את הלחיצה */
body.lifting .nav-btn { display: none; }
.dm-stop .nav-btn { align-self: center; margin-inline-start: auto; }
.nav-line { color: var(--ink-3); }
.nav-line .nav-link { margin-inline-start: 4px; }
.nav-line:empty { display: none; }
.nav-inline { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); vertical-align: -6px; }
.nav-inline svg { width: 14px; height: 14px; }
.tag {
  font-size: 11px; padding: 2px 8px; border-radius: 999px; font-weight: 700; white-space: nowrap;
  letter-spacing: -.005em; background: var(--surface-2); color: var(--ink-2);
}
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.bad { background: var(--bad-soft); color: var(--bad); }
.tag.info { background: var(--accent-soft); color: var(--accent); }
.tag.lane { background: var(--lane-soft); color: var(--lane-ink); }
.tag.ok-tag { background: var(--ok-soft); color: var(--ok); font-size: 11px; padding: 2px 8px; border-radius: 999px; font-weight: 700; }
.day-off { padding: 8px 16px 16px; color: var(--ink-3); font-size: 13px; }

/* ---------- לא שובצו ---------- */
.miss { border-color: color-mix(in srgb, var(--bad) 26%, transparent); }
.miss-list { display: grid; }
.miss-item { display: grid; grid-template-columns: minmax(130px, 190px) 1fr auto; gap: 14px; align-items: center; padding: 13px 18px; border-top: 1px solid var(--line-2); }
.miss-item > * { min-width: 0; }
/* ההסברים כאן ארוכים ("כל השעות האפשריות תפוסות על ידי שיעורים אחרים"),
   ותגית שלא נשברת הייתה דוחפת את כל המסך הצידה בטלפון צר */
.miss-item .tag { white-space: normal; text-align: start; }
.miss-item:first-child { border-top: 0; }
@media (max-width: 640px) { .miss-item { grid-template-columns: 1fr; gap: 6px; } }

/* ---------- תלמידים ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--r3); }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th { text-align: start; font-size: 11.5px; color: var(--ink-3); font-weight: 700; letter-spacing: .03em; padding: 12px 16px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
table.list td { padding: 13px 16px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
table.list tr:last-child td { border-bottom: 0; }
table.list tr.click { cursor: pointer; }
table.list tr.click td { transition: background var(--dur) var(--ease); }
table.list tr.click:hover td { background: var(--surface-2); }
table.list td b { font-weight: 700; letter-spacing: -.012em; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.av { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; font-weight: 500; font-variant-numeric: tabular-nums; }
.av b { font-weight: 700; margin-inline-end: 5px; color: var(--ink); }
.cards { display: none; }
@media (max-width: 720px) {
  .table-wrap.students { display: none; }
  .cards { display: grid; gap: 10px; }
}
.scard {
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r2); box-shadow: var(--sh-1);
  padding: 14px; display: grid; gap: 7px; cursor: pointer; text-align: start; width: 100%;
  transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.scard:hover { box-shadow: var(--sh-2); transform: translateY(-1px); }

/* ---------- הגדרות ---------- */
.narrow { max-width: 880px; }
.wk { display: grid; gap: 0; }
.wk-row { display: grid; grid-template-columns: 116px minmax(0, auto) minmax(0, 1fr); gap: 10px 18px; align-items: center; padding: 13px 18px; border-top: 1px solid var(--line-2); }
.hours { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; min-width: 0; }
.hours .tp { width: 136px; min-width: 100px; flex: 0 1 136px; }
.hours .sep { color: var(--ink-3); font-size: 13px; font-weight: 600; }
.wk-row:first-child { border-top: 0; }
.wk-row.off { color: var(--ink-3); }
.wk-row > .check b { font-weight: 700; }
.brks { display: grid; gap: 7px; }
.brks { min-width: 0; }
.brk { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; min-width: 0; }
.brk .tp { width: 128px; min-width: 100px; flex: 0 1 128px; }
/* מתחת לרוחב הזה שלוש עמודות כבר לא נכנסות בלי לגלוש */
@media (max-width: 940px) {
  .wk-row { grid-template-columns: 1fr; gap: 9px; }
  .wk-row > .check, .wk-row .brks, .wk-row > .faint, .wk-row .hours { grid-column: 1 / -1; }
  .hours .tp, .brk .tp { width: auto; flex: 1 1 100px; }
}
.err-inline { color: var(--bad); font-size: 12px; }

/* ---------- מנויים ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(156px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r2); box-shadow: var(--sh-1); padding: 14px 16px; }
.stat .v { font-size: 27px; font-weight: 700; line-height: 1.2; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat .k { font-size: 12px; color: var(--ink-3); }

/* ---------- דיאלוג ---------- */
dialog {
  border: 0; padding: 0; border-radius: var(--r4); background: var(--surface); color: var(--ink);
  width: min(600px, calc(100vw - 24px)); max-height: calc(100dvh - 40px); box-shadow: var(--sh-4);
}
dialog::backdrop { background: rgba(14, 17, 24, .38); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.dlg { display: flex; flex-direction: column; max-height: calc(100dvh - 40px); }
.dlg-h { display: flex; align-items: center; gap: 10px; padding: 18px 22px 14px; }
.dlg-h h2 { font-size: 19px; font-weight: 700; margin-inline-end: auto; letter-spacing: -.025em; }
.dlg-b { padding: 4px 22px 20px; overflow-y: auto; display: grid; gap: 16px; overscroll-behavior: contain; }
.dlg-f { display: flex; gap: 8px; flex-wrap: wrap; padding: 14px 22px; border-top: 1px solid var(--line-2); align-items: center; background: var(--surface); }
.dlg-f .spacer { flex: 1; }
.msgs { display: grid; gap: 7px; }
.msg { display: flex; gap: 8px; align-items: flex-start; padding: 10px 13px; border-radius: 10px; font-size: 13.5px; line-height: 1.45; font-weight: 500; }
.msg.err { background: var(--bad-soft); color: var(--bad); }
.msg.warn { background: var(--warn-soft); color: var(--warn); }
.msg.ok { background: var(--ok-soft); color: var(--ok); }
.slots { display: flex; flex-wrap: wrap; gap: 7px; }
.slot {
  font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; font-variant-numeric: tabular-nums;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.slot b { font-weight: 700; margin-inline-end: 3px; }
.slot:hover { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); }
.slot.on { border-color: transparent; background: var(--primary); color: var(--primary-ink); }
.av-edit { display: grid; gap: 7px; }
.av-row { display: grid; grid-template-columns: 1.2fr 1fr 1fr 32px; gap: 7px; align-items: center; }
.sub-h { font-size: 12.5px; font-weight: 700; color: var(--ink-2); display: flex; align-items: center; gap: 8px 14px; justify-content: space-between; flex-wrap: wrap; }
.sub-h .check { font-weight: 600; }
.msgcard { border: 1px solid var(--line-2); border-radius: var(--r2); padding: 13px 14px; display: grid; gap: 9px; box-shadow: var(--sh-1); }
/* קישור אישי ארוך הוא מילה אחת בלי רווחים. בלי השבירה הזאת הוא דוחף
   את כל החלונית הצידה ואפשר לגרור את המסך ימינה ושמאלה. */
.msgcard pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; font-family: var(--font); font-size: 13.5px; line-height: 1.6; background: var(--surface-2); padding: 11px 13px; border-radius: 10px; }
.msgcard { min-width: 0; }
.msgcard > * { min-width: 0; }
.msgcard.sent { opacity: .55; }

/* ---------- הודעה צפה ---------- */
.toast {
  position: fixed; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); inset-inline: 0; margin-inline: auto;
  width: max-content; max-width: calc(100vw - 32px); background: var(--ink); color: var(--surface);
  padding: 12px 18px; border-radius: 999px; display: flex; gap: 16px; align-items: center; z-index: 50;
  box-shadow: var(--sh-4); font-size: 14px; font-weight: 500;
}
.toast button { background: none; border: 0; color: var(--toast-link, #9db8f7); font-weight: 700; cursor: pointer; padding: 0; }
.empty { padding: 40px 20px; text-align: center; color: var(--ink-2); }
.empty h3 { font-size: 17px; color: var(--ink); margin-bottom: 5px; }
.welcome { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: end; }
@media (max-width: 640px) { .welcome { grid-template-columns: 1fr; } }

/* ---------- תנועה ---------- */
@media (prefers-reduced-motion: no-preference) {
  .toast { animation: rise .22s var(--ease); }
  @keyframes rise { from { transform: translateY(10px); opacity: 0; } }
  dialog[open] { animation: pop .2s var(--ease); }
  @keyframes pop { from { transform: translateY(8px) scale(.985); opacity: 0; } }
  dialog[open]::backdrop { animation: fade .2s var(--ease); }
  @keyframes fade { from { opacity: 0; } }
  #view { animation: viewin .24s var(--ease); }
  @keyframes viewin { from { opacity: 0; transform: translateY(5px); } }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ---------- כניסה ושורת חשבון ---------- */
.center { min-height: 74dvh; display: grid; place-items: center; padding: 28px 18px; }
.login-card { width: min(430px, 100%); }
.acct-bar { display: flex; align-items: center; justify-content: flex-end; gap: 8px; max-width: 1160px; margin: 0 auto; padding: 10px 18px 0; }
.acct-bar .t { direction: ltr; font-weight: 500; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-bar .btn { box-shadow: none; background: transparent; border-color: transparent; color: var(--ink-3); }
.acct-bar .btn:hover { background: var(--surface-2); color: var(--ink); transform: none; }
code { font-size: .9em; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; }

/* ---------- כתובות ומפות ---------- */
.locf { display: grid; gap: 7px; }
.loc-row { display: flex; gap: 7px; align-items: center; }
.loc-row .loc-q { flex: 1 1 auto; min-width: 0; }
.loc-hits { display: grid; gap: 2px; border: 1px solid var(--line-2); border-radius: var(--r1); padding: 5px; background: var(--surface); max-height: 190px; overflow: auto; box-shadow: var(--sh-2); }
.loc-hit { text-align: start; background: none; border: 0; border-radius: 7px; padding: 8px 9px; font: inherit; font-size: 14px; color: var(--ink); cursor: pointer; }
.loc-hit:hover, .loc-hit:focus-visible { background: var(--accent-soft); color: var(--accent); }
.loc-state { min-height: 16px; }
.loc-map-box { border: 1px solid var(--line-2); border-radius: var(--r2); overflow: hidden; }
.leaflet-container { font: inherit; background: var(--surface-2); }
.stop-pin { background: none; border: 0; }
.stop-pin span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 13px; font-weight: 700; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.day-map { border: 1px solid var(--line-2); border-radius: var(--r2); overflow: hidden; display: grid; place-items: center; min-height: 60px; background: var(--surface-2); }
.dm-list { display: grid; gap: 2px; }
.dm-stop { display: flex; gap: 12px; align-items: baseline; padding: 8px 2px; border-top: 1px solid var(--line-2); }
.dm-stop .t { font-size: 13px; color: var(--ink-2); min-width: 48px; }
.dm-leg { font-size: 11px; color: var(--lane-ink); padding-inline: 60px 2px; font-weight: 600; }
.day-map-btn { align-self: center; }

/* ---------- עיכובים ---------- */
.pickrow { display: flex; flex-wrap: wrap; gap: 7px; }
.dl-box { display: grid; gap: 11px; border-radius: var(--r2); padding: 14px; background: var(--surface-2); }
.dl-head { margin: 0; font-size: 15px; font-weight: 700; }
.dl-list { display: grid; gap: 7px; }
.dl-row { display: grid; grid-template-columns: 1fr auto auto; gap: 11px; align-items: center; background: var(--surface); border-radius: 10px; padding: 10px 12px; box-shadow: var(--sh-1); }
.dl-row.bad { background: var(--bad-soft); box-shadow: none; }
.dl-row.off { opacity: .6; }
.dl-row .dl-t { font-size: 13px; white-space: nowrap; font-weight: 600; font-variant-numeric: tabular-nums; }
.dl-row .dl-nm { min-width: 0; font-weight: 600; }
@media (max-width: 560px) { .dl-row { grid-template-columns: 1fr auto; } .dl-row > :last-child { grid-column: 1 / -1; } }

/* ---------- הדף של התלמיד ---------- */
body.stu { background: var(--bg); }
.stu-wrap { max-width: 540px; margin: 0 auto; padding: 18px 18px calc(32px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 16px; }
.stu-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stu-top .brand { flex: 1 1 auto; min-width: 0; }
.stu-hi { font-size: 26px; line-height: 1.2; font-weight: 700; letter-spacing: -.03em; margin: 2px 0 0; }
.stu-card { display: block; }
.stu-lessons { display: grid; gap: 9px; }
.stu-lesson {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px 16px; border-radius: var(--r2); background: var(--accent-soft); color: var(--accent);
}
.stu-lesson .d b { color: inherit; font-size: 15.5px; font-weight: 700; }
.stu-lesson .t { font-size: 17px; font-weight: 700; white-space: nowrap; direction: ltr; unicode-bidi: isolate; letter-spacing: -.02em; }
.stu-days { display: grid; gap: 9px; }
.stu-day {
  border: 1px solid var(--line-2); border-radius: var(--r2); padding: 13px 14px; display: grid; gap: 10px;
  box-shadow: var(--sh-1); background: var(--surface);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.stu-day.on { border-color: var(--accent-line); box-shadow: var(--sh-2); }
.stu-day .check { margin: 0; }
.stu-day .check b { font-size: 15.5px; font-weight: 700; }
.stu-hours { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stu-hours .hr { display: grid; gap: 6px; margin: 0; }
.stu-hours .tp { width: 100%; }
.stu-hours .tp-in { min-height: 48px; font-size: 17px; font-weight: 600; text-align: center; padding-inline: 34px 34px; }
.stu-send { position: sticky; bottom: 0; padding: 12px 0 calc(12px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(to top, var(--bg) 62%, transparent); }
.stu-send .btn { width: 100%; min-height: 54px; font-size: 16.5px; border-radius: var(--r2); }
.stu-foot { text-align: center; margin: 0; }
.stu-ok { width: 66px; height: 66px; margin: 0 auto; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; font-size: 34px; font-weight: 700; }
@media (max-width: 420px) { .stu-hi { font-size: 23px; } }

.linkbox { font-size: 12px; background: var(--surface-2); border-radius: var(--r1); padding: 10px 12px; word-break: break-all; color: var(--ink-2); direction: ltr; text-align: start; }
.linkbox-wrap { direction: rtl; }

/* ---------- כתובת שצמודה ליום ---------- */
.f-cap { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
.stu-where { border-top: 1px solid var(--line-2); padding-top: 10px; margin-top: 2px; }
.stu-where-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stu-loc { display: block; }
.av-block { display: grid; gap: 5px; padding: 8px 0; border-top: 1px solid var(--line-2); }
.av-block:first-child { border-top: 0; padding-top: 2px; }
.av-loc { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; }
.av-loc .tag { max-width: 100%; white-space: normal; text-align: start; line-height: 1.4; }
.av-loc-edit { background: var(--surface-2); border-radius: var(--r2); padding: 12px; margin-top: 2px; }

/* תוצאת חיפוש שהיא רחוב בלבד, בלי מספר בית */
.warn-t { color: var(--warn); font-weight: 600; }
.loc-part { font-size: 11px; font-weight: 700; color: var(--warn); background: var(--warn-soft); padding: 1px 7px; border-radius: 999px; margin-inline-start: 6px; }
.loc-hit:hover .loc-part, .loc-hit:focus-visible .loc-part { background: var(--surface); }

/* היום הנוכחי – כדי שמורה שפותח את האפליקציה באמצע השבוע ימצא את עצמו מיד */
.day.today { border-color: var(--accent-line); box-shadow: var(--sh-2), inset 0 2px 0 0 var(--accent); }
.day.today .day-h h3 { color: var(--accent); }

/* ---------- מסך הטעינה הראשוני ----------
   מוצג עד שהנתונים של המורה מגיעים. בלי זה נראה רגע לוח הדגמה,
   ועריכה שנעשית באותו רגע נמחקת כשהנתונים האמיתיים נטענים. */
.boot-wait {
  display: grid; place-items: center; gap: 10px;
  padding: 72px 20px; text-align: center; animation: fade var(--dur) var(--ease);
}
.boot-wait .sign {
  width: 44px; height: 44px; border-radius: 13px; background: var(--primary);
  display: grid; place-items: center; box-shadow: var(--sh-2);
}
.boot-wait .sign i {
  width: 4px; height: 23px; border-radius: 2px;
  background: repeating-linear-gradient(to bottom, var(--primary-ink) 0 7px, transparent 7px 11px);
}
.boot-wait b { font-size: 20px; font-weight: 700; letter-spacing: -.03em; color: var(--ink); }
.boot-wait .muted { font-size: 13.5px; }
.boot-wait .boot-bar {
  width: 148px; height: 3px; border-radius: 999px; overflow: hidden;
  background: var(--line-2); margin-top: 4px;
}
.boot-wait .boot-bar i {
  display: block; width: 40%; height: 100%; border-radius: 999px;
  background: var(--accent); animation: bootslide 1.6s var(--ease) infinite;
}
@keyframes bootslide {
  0%, 100% { transform: translateX(-72%); }
  50% { transform: translateX(222%); }
}
@media (prefers-reduced-motion: reduce) {
  .boot-wait .boot-bar i { animation: none; width: 100%; opacity: .45; }
}

/* ---------- בחירת שעה ----------
   שדה טקסט רגיל, ומתוכו בחירה בשתי עמודות: שעה ודקות.
   שתי עמודות קצרות במקום רשימה אחת ארוכה – הגלילה קצרה,
   והבחירה מדויקת לדקה. */
.tp { position: relative; display: block; min-width: 0; }
.tp-in {
  width: 100%; padding-inline-end: 34px; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
/* במגע השדה הוא כפתור לכל דבר: בלי סמן מהבהב, בלי סימון טקסט
   ובלי תפריט "גזור/הדבק" בלחיצה כפולה. */
.tp-in[readonly] {
  caret-color: transparent; cursor: pointer;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.tp-in[readonly]::selection { background: transparent; }
.tp-in:hover { border-color: var(--line); background: var(--surface-2); }
.tp.open .tp-in {
  border-color: var(--accent-line);
  box-shadow: var(--sh-1), 0 0 0 3px var(--accent-soft);
  background: var(--surface);
}
.tp-ic {
  position: absolute; inset-inline-end: 11px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; color: var(--ink-3); pointer-events: none;
  transition: color var(--dur) var(--ease);
}
.tp.open .tp-ic { color: var(--accent); }
.tp-in:disabled { cursor: default; }
.tp-in:disabled + .tp-ic { opacity: .45; }

.tp-pop {
  position: fixed; z-index: 120; box-sizing: border-box; overflow: hidden;
  overscroll-behavior: contain; -webkit-tap-highlight-color: transparent;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r2);
  box-shadow: var(--sh-3); animation: tppop .15s var(--ease);
}
@keyframes tppop { from { opacity: 0; transform: translateY(-5px); } }
/* השדה מציג 08:30 – שעות משמאל, דקות מימין. העמודות חייבות לשבת
   באותו סדר, אחרת מה שרואים בחלונית הפוך ממה שכתוב בשדה שמעליה. */
.tp-cols { display: grid; grid-template-columns: 1fr 1fr; direction: ltr; }
.tp-head, .tp-opt { direction: rtl; }
.tp-col { display: grid; grid-template-rows: auto 1fr; min-width: 0; }
.tp-col + .tp-col { border-inline-start: 1px solid var(--line-2); }
.tp-head {
  font-size: 11px; font-weight: 700; letter-spacing: .02em; color: var(--ink-3);
  text-align: center; padding: 7px 0 6px; border-bottom: 1px solid var(--line-2);
  background: var(--surface-2);
}
.tp-list {
  overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  /* חובה: בלי זה נעילת הזום של הדף חוסמת גם את הגלילה כאן */
  touch-action: pan-y; scrollbar-width: thin; padding: 4px; display: grid; gap: 1px;
  /* הגלילה נעצרת על שורה שלמה, כמו גלגלת – בלי חצי שורה חתוכה */
  scroll-snap-type: y proximity;
}
.tp-list::-webkit-scrollbar { width: 8px; }
.tp-list::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }
.tp-opt {
  border: 0; background: none; cursor: pointer; width: 100%;
  scroll-snap-align: center;
  user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
  padding: 10px 6px; border-radius: 8px; color: var(--ink);
  font-size: 15.5px; font-weight: 500; line-height: 1.15; text-align: center;
  font-variant-numeric: tabular-nums; letter-spacing: .01em;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.tp-opt:hover { background: var(--surface-2); }
.tp-opt.sel { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.tp-opt.sel:hover { background: var(--accent-hover); }
@media (prefers-reduced-motion: reduce) { .tp-pop { animation: none; } }

/* ---------- הרמה והנחה של שיעור ----------
   לחיצה על שיעור מרימה אותו, כל השבוע נדלק במקומות האפשריים,
   ולחיצה שנייה מניחה. לחיצה על שיעור אחר מחליפה ביניהם. */
/* בתחתית המסך ולא למעלה: כך הוא אף פעם לא מכסה את השיעור שהרמת,
   והכפתורים נמצאים איפה שהאגודל ממילא נמצא. */
.lift-bar {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 30;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 11px 16px calc(11px + env(safe-area-inset-bottom, 0px));
  background: var(--primary); color: var(--primary-ink);
  box-shadow: 0 -10px 30px -12px rgba(12, 16, 28, .45);
  animation: rise var(--dur) var(--ease);
}
@media (min-width: 900px) {
  .lift-bar {
    inset-inline: auto; inset-inline-start: 50%; transform: translateX(50%);
    bottom: 18px; border-radius: var(--r3); max-width: 720px; width: max-content;
    box-shadow: var(--sh-4);
  }
}
.lift-txt { display: grid; gap: 1px; min-width: 0; flex: 1 1 180px; }
.lift-txt b { font-size: 15px; }
.lift-txt .muted { color: color-mix(in srgb, var(--primary-ink) 72%, transparent); font-size: 12.5px; }
.lift-bar .check { color: var(--primary-ink); margin: 0; }
.lift-bar .btn { background: color-mix(in srgb, var(--primary-ink) 14%, transparent); border-color: transparent; color: var(--primary-ink); }
.lift-bar .btn:hover { background: color-mix(in srgb, var(--primary-ink) 24%, transparent); }
.lift-bar .btn.ghost { background: none; }

/* השיעור שהורם */
.r.lesson.lifted {
  background: var(--accent-soft); border-color: var(--accent-line);
  box-shadow: inset 0 0 0 2px var(--accent);
}
/* כל שאר השיעורים הופכים ליעד החלפה */
.day.lifting .r.lesson.swap-target { border-inline-start-color: var(--ink-3); }
.r.lesson.swap-target:hover, .r.lesson.swap-target:focus-visible { background: var(--surface-2); }
.r.lesson .tag.swap-hint { background: var(--surface-3); color: var(--ink-2); font-weight: 600; }
.r.lesson.swap-target:hover .tag.swap-hint, .r.lesson.swap-target:focus-visible .tag.swap-hint { background: var(--accent); color: var(--accent-ink); }

/* מקום שאפשר להניח בו */
.r.target {
  align-items: start; background: var(--ok-soft);
  border-radius: var(--r1); padding-block: 9px;
  box-shadow: inset 2px 0 0 0 var(--ok);
}
.r.target .tm { color: var(--ok); font-weight: 700; }
.tgt { display: grid; gap: 6px; min-width: 0; }
.tgt-cap { font-size: 12px; font-weight: 600; color: var(--ok); }
.tgt-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tgt-chip {
  border: 1px solid var(--ok); background: var(--surface); color: var(--ok);
  font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums;
  min-height: 38px; padding: 0 12px; border-radius: 999px; cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.tgt-chip:hover, .tgt-chip:focus-visible { background: var(--ok); color: var(--surface); }
.tgt-chip:active { transform: scale(.96); }
/* שעה שהתלמיד לא סימן כזמינה – אפשרית, אבל בצבע אזהרה */
.tgt-chip.out { border-color: var(--warn); color: var(--warn); }
.tgt-chip.out:hover, .tgt-chip.out:focus-visible { background: var(--warn); color: var(--surface); }

.dlg.sm { max-width: 420px; }
.swap-rows { display: grid; gap: 8px; margin-bottom: 10px; }
.swap-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--surface-2); border-radius: var(--r1); padding: 10px 12px;
}
@media (max-width: 560px) {
  .lift-bar { padding-inline: 12px; gap: 8px; }
  .lift-bar .lift-txt { flex: 1 1 100%; }
  .lift-bar .btn { flex: 1 1 auto; }
}
/* הסרגל יושב מעל התוכן – משאירים לו מקום בתחתית העמוד */
body.lifting #app { padding-bottom: 190px; }

/* שני הקישורים מתחת לכפתור הכניסה – משני קצות הכרטיס, לא דבוקים */
.login-links { justify-content: space-between; gap: 14px; }
.login-links:only-child { justify-content: flex-start; }

/* ---------- שדה סיסמה עם "הצג" ---------- */
.pw-wrap { position: relative; display: block; }
.pw-wrap .pw-in { padding-inline-end: 62px; }
.pw-eye {
  position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%);
  border: 0; background: none; cursor: pointer; color: var(--accent);
  font-size: 13px; font-weight: 700; padding: 8px 8px; min-height: 34px;
  border-radius: var(--r1);
}
.pw-eye:hover { background: var(--accent-soft); }

/* ---------- עמודי מדיניות ותנאים ---------- */
.legal { max-width: 720px; margin: 0 auto; padding: 24px 18px 80px; }
.legal-top { margin-bottom: 26px; }
.legal-top .brand { text-decoration: none; }
.legal h1 { font-size: 27px; margin-bottom: 4px; }
.legal h2 { font-size: 17px; margin: 26px 0 6px; color: var(--ink); }
.legal p { margin: 0 0 10px; color: var(--ink-2); line-height: 1.7; }
.legal p b { color: var(--ink); font-weight: 600; }
.legal a { color: var(--accent); }
.legal-foot { margin-top: 32px; padding-top: 18px; border-top: 1px solid var(--line-2); }
