/* THE STRIP SCREEN'S VERDICT BAR. Sticky rather than fixed, so it cannot
   cover the page on a short viewport, and it carries its own background
   because `position: sticky` leaves the content behind it visible. Stated in
   the accent family rather than a literal colour - the wing switcher repoints
   `--color-primary`, and a hardcoded indigo here would be the one rule
   CLAUDE.md names by name. */
.strip-verdict-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  gap: var(--space-3);
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  border-inline-start: 4px solid var(--color-primary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .12);
}
/* `--color-danger-solid`, and the first version wrote `--color-danger`, which
   this sheet does not define. An unresolvable `var()` with no fallback makes
   the declaration invalid at computed-value time, so the border fell back to
   `currentColor` - near-black. It MOVED, so it did not look broken; it simply
   carried no danger signal. There was a `--warn` rule too, dead twice over:
   no JS applied it and its variable did not exist either. Deleted rather than
   wired, because nothing here has a middle verdict to paint. */
.strip-verdict-bar--bad { border-inline-start-color: var(--color-danger-solid); }

/* ============================================================
   מערכת מילויי מקום — עיצוב 2026
   Modern, polished, RTL-first. System fonts + inline SVG only —
   zero external requests, zero runtime cost.
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  /* Ink & surfaces */
  --color-bg: #f4f6fb;
  --color-bg-accent: #eef1f9;
  --color-surface: #ffffff;
  --color-border: #e4e8f1;
  --color-border-strong: #d4dae7;
  --color-text: #16213a;
  --color-text-muted: #5d6b85;

  /* Brand — deep indigo */
  --color-primary: #4f46e5;
  --color-primary-hover: #4338ca;
  --color-primary-bg: #eef2ff;
  --color-primary-ring: rgba(79, 70, 229, .25);

  /* Main call-to-action (report an absence) — warm, unmistakable */
  --color-cta: #ea580c;
  --color-cta-hover: #c2410c;
  --color-cta-bg: #fff7ed;

  /* Semantic */
  --color-success-bg: #ecfdf5;
  --color-success-text: #047857;
  --color-warning-bg: #fffbeb;
  --color-warning-text: #b45309;
  --color-danger-bg: #fef2f2;
  --color-danger-text: #be123c;
  /* The SOLID danger fill, for the one shape that is a filled mark rather
     than a tinted pill: a count badge. The pale pair above is unreadable as
     white-on-fill, which is why `.pt-badge` reached for a raw hex and became
     the only semantic colour in this file outside the token system. */
  --color-danger-solid: #dc2626;
  --color-neutral-bg: #eef0f5;
  --color-neutral-text: #5b6472;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(22, 33, 58, .05), 0 1px 3px rgba(22, 33, 58, .04);
  --shadow-md: 0 10px 30px rgba(22, 33, 58, .10);
  --shadow-focus: 0 0 0 3px var(--color-primary-ring);

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;

  --grad-brand: linear-gradient(135deg, #6366f1, #4f46e5 55%, #4338ca);
  --grad-cta: linear-gradient(135deg, #f97316, #ea580c 60%, #c2410c);
}

/* ---------- Reset & base ---------- */
* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  /* Phones: no grey/blue flash on every tap, and no font inflation when a
     phone is turned sideways. Pull-to-refresh is left alone on purpose:
     these are documents people do refresh. */
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}

/* A tap is answered at once instead of waiting to see whether it was the
   first half of a double-tap zoom. Pinch zoom still works. */
a, button, summary, label, [role="button"], input[type=submit] { touch-action: manipulation; }

/* iPhone zooms the whole page into any field whose text is under 16px, and
   does not zoom back out. On a touch screen every field gets 16px whatever
   a narrower rule says; on a computer the denser sizes below still apply.
   !important because some screens set a smaller size with a more specific
   selector, and the reason here is a platform rule, not a style choice. */
@media (pointer: coarse) {
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]),
  select,
  textarea { font-size: 16px !important; }
}

/* Every :hover in this file sits inside @media (hover: hover), so a tap on a
   phone does not leave a button lifted or a row highlighted after the finger
   is gone. Exceptions, on purpose: the builder grids, and .sb-add, which a
   touch user can only reveal by tapping its cell. */

body {
  font-family: "Segoe UI Variable Text", "Segoe UI", -apple-system, "Noto Sans Hebrew", Arial, sans-serif;
  background:
    radial-gradient(1100px 400px at 85% -50px, rgba(99, 102, 241, .07), transparent 60%),
    radial-gradient(900px 350px at 10% -80px, rgba(234, 88, 12, .05), transparent 55%),
    var(--color-bg);
  color: var(--color-text);
  margin: 0;
  line-height: 1.55;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.3;
  letter-spacing: -.01em;
}

h1 { font-size: 1.55rem; margin: 0 0 var(--space-4); }
h2 { font-size: 1.18rem; margin: var(--space-6) 0 var(--space-3); }
h3 { font-size: 1.02rem; margin: var(--space-5) 0 var(--space-2); }

p { color: var(--color-text-muted); }

a { color: var(--color-primary); }

/* ---------- Icons (SVG sprite) ---------- */
.icon {
  width: 1.15em;
  height: 1.15em;
  vertical-align: -0.22em;
  flex-shrink: 0;
}

/* ============================================================
   TEACHER PORTAL (templates/portal/*)

   Its own shell, its own accent (purple), its own prefix. Everything below
   is either .pt-* or scoped under .portal, so restyling the portal cannot
   reach a staff screen - and the staff wings cannot repaint the portal,
   because no portal page carries a data-wing.

   Built for a phone held in one hand: one column, big tap targets, and the
   thing she came to do at the top.
   ============================================================ */
.portal {
  --pt-accent: #7e22ce;
  --pt-accent-hover: #6b21a8;
  --pt-accent-soft: #faf5ff;
  --pt-accent-ring: rgba(126, 34, 206, .22);

  /* The portal never shows a wing switcher, so point the shared primary
     tokens at its accent - shared components (badges, boxes) follow. */
  --color-primary: #7e22ce;
  --color-primary-hover: #6b21a8;
  --color-primary-bg: #faf5ff;
  --color-primary-ring: rgba(126, 34, 206, .22);

  background:
    radial-gradient(900px 380px at 80% -60px, rgba(126, 34, 206, .10), transparent 60%),
    var(--color-bg);
  min-height: 100vh;
  min-height: 100dvh;
}

/* ---------- Portal shell ---------- */
.pt-header {
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.pt-header__inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 10px var(--space-4);
  padding-inline: max(var(--space-4), env(safe-area-inset-right, 0px)) max(var(--space-4), env(safe-area-inset-left, 0px));
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.pt-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.pt-brand__mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, #a855f7, var(--pt-accent) 60%, #6b21a8);
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 5px 14px rgba(126, 34, 206, .35);
  flex-shrink: 0;
}
.pt-brand__mark .icon { width: 19px; height: 19px; vertical-align: 0; }
.pt-brand__text { display: flex; flex-direction: column; min-width: 0; }
.pt-brand__name { font-weight: 800; font-size: .98rem; color: var(--color-text); letter-spacing: -.01em; }
.pt-brand__sub { font-size: .72rem; color: var(--color-text-muted); }

.pt-user { margin-inline-start: auto; display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.pt-user__name {
  font-weight: 600;
  font-size: .85rem;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pt-user__out {
  background: none;
  border: 0;
  color: var(--color-text-muted);
  padding: 8px;
  border-radius: 9px;
  cursor: pointer;
  box-shadow: none;
}
@media (hover: hover) {
.pt-user__out:hover { background: var(--pt-accent-soft); color: var(--pt-accent); transform: none; }
}
.pt-user__out .icon { width: 18px; height: 18px; vertical-align: 0; }

.pt-main {
  max-width: 760px;
  margin: 0 auto;
  /* Extra bottom padding so the last card never sits under the fixed tab
     bar below - it must not overlap content on a short screen. */
  padding: var(--space-4) var(--space-4) calc(72px + var(--space-6));
  /* Turned sideways, an iPhone's notch is at one side; inline-start is the
     right edge in RTL, hence right first. */
  padding-inline: max(var(--space-4), env(safe-area-inset-right, 0px)) max(var(--space-4), env(safe-area-inset-left, 0px));
  padding-bottom: calc(72px + var(--space-6) + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* ---------- Bottom tab bar (every signed-in portal screen) ---------- */
.pt-tabbar {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 15;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--color-border);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.pt-tabbar__inner {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
}
.pt-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 9px 4px 8px;
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: .72rem;
  font-weight: 600;
}
.pt-tab .icon { width: 20px; height: 20px; vertical-align: 0; }
.pt-tab.is-active { color: var(--pt-accent); }

/* ---------- Home: today ---------- */
.pt-today__day { font-size: 1.05rem; font-weight: 800; }
.pt-today__date { font-size: .82rem; color: var(--color-text-muted); }
.pt-today__summary { margin: var(--space-2) 0 0; font-size: .92rem; }

.pt-sched { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.pt-sched__row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 9px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: .88rem;
}
.pt-sched__row:last-child { border-bottom: 0; }
.pt-sched__row--covering { background: var(--pt-accent-soft); margin: 0 calc(var(--space-3) * -1); padding-inline: var(--space-3); border-radius: var(--radius-sm); border-bottom-color: transparent; }
/* An hour that is off for her today (absence / approved release): still
   listed, so she can see the system registered it, but visibly not hers. */
.portal .pt-sched__row--off { opacity: .62; }
.portal .pt-sched__row--off .pt-sched__subject { text-decoration: line-through; }
/* Long swap/board strings must wrap on a 360px phone rather than push the
   card sideways - .pt-list__key is nowrap by default (QA review). */
.portal .pt-needs .pt-list__key { white-space: normal; }

.pt-sched__period { font-weight: 700; white-space: nowrap; flex-shrink: 0; }
.pt-sched__time { display: block; font-weight: 500; font-size: .74rem; color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.pt-sched__subject { color: var(--color-text-muted); flex: 1; }
/* Her day on any date (portal /portal/day, 2026-10-21). */
.pt-day-nav { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-3); }
/* One row, not four stacked full-width buttons (2026-11-24). */
.pt-day-nav .pt-btn { width: auto; flex: 1 1 0; min-height: 42px; padding: 8px 6px; font-size: .9rem; white-space: nowrap; }
.pt-day__chip { display: inline-block; width: 12px; height: 12px; min-height: 0; padding: 0; margin: 0 0 0 6px; vertical-align: middle; }
.pt-day__state { color: var(--color-text-muted); }
.pt-day-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-3); }
.pt-day-list a[aria-current] { font-weight: 700; }
/* Day / week switch and her week on a grid (portal /portal/week, 2026-12-02). */
.pt-view-switch { display: flex; gap: var(--space-2); margin-bottom: var(--space-2); }
.pt-view-switch .pt-btn { width: auto; flex: 1 1 0; min-height: 38px; padding: 6px; font-size: .9rem; }
.pt-week-wrap { overflow-x: auto; margin: 0 calc(-1 * var(--space-2)) var(--space-3); -webkit-overflow-scrolling: touch; }
/* Fixed layout reads the widths off the FIRST row, so the hour column's
   width is set on the header cell; the day columns then share the rest. */
.pt-week { width: 100%; min-width: 480px; border-collapse: collapse; table-layout: fixed; font-size: .8rem; }
.pt-week thead th:first-child { width: 48px; }
.pt-week__range { white-space: nowrap; unicode-bidi: isolate; }
.pt-week th, .pt-week td { border: 1px solid var(--color-border); padding: 3px; vertical-align: top; }
.pt-week thead th { background: var(--color-surface-2, #f8fafc); font-weight: 700; text-align: center; }
.pt-week thead th a { color: inherit; text-decoration: none; display: block; }
.pt-week thead th small { font-weight: 500; color: var(--color-text-muted); }
.pt-week tbody th { text-align: center; font-weight: 700; background: var(--color-surface-2, #f8fafc); }
.pt-week .is-today { box-shadow: inset 0 0 0 2px var(--color-primary); }
/* .pt-week__tile takes its box from .dt-tile (and its colour from
   .dt-tile--<look>), the same tile the coordinator's grid draws. */
.pt-week .pt-week__tile { display: block; padding: 3px 4px; overflow-wrap: break-word; }
.pt-week__subject { display: block; font-weight: 600; }
.pt-week__class, .pt-week__state { display: block; font-size: .74rem; opacity: .85; }
.pt-week__hint { font-size: .8rem; }

/* ---------- Cards ---------- */
.pt-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: var(--space-5);
}
.pt-card--primary { border-color: var(--pt-accent-ring); box-shadow: 0 10px 30px rgba(126, 34, 206, .10); }
.pt-card__title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 var(--space-4);
}
.pt-card__title .icon { width: 19px; height: 19px; color: var(--pt-accent); }
.pt-empty { margin: 0; color: var(--color-text-muted); font-size: .9rem; }
.pt-muted { color: var(--color-text-muted); }

/* ---------- הלב של הצוות (app/appreciation.py) ---------- */
.heart-card { background: linear-gradient(160deg, #fff7fb, var(--color-surface) 55%); }
.heart-card__summary { cursor: pointer; list-style: none; margin-bottom: 0; }
.heart-card__summary::-webkit-details-marker { display: none; }
.heart-card__summary::after { content: "▾"; margin-inline-start: auto; font-size: .8rem; color: var(--color-text-muted); transition: transform .2s; }
.heart-card:not([open]) .heart-card__summary::after { transform: rotate(90deg); }
.heart-card[open] .heart-card__summary { margin-bottom: var(--space-4); }
.heart-card__summary .icon { color: #db2777; }
.heart-card__lead { margin: 0 0 var(--space-2); font-weight: 600; }
.heart-card__facts { margin: 0 0 var(--space-3); padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.heart-card__facts li { background: #fdf2f8; border: 1px solid #fbcfe8; border-radius: 999px; padding: 4px 12px; font-size: .9rem; }
.heart-card__facts b { color: #be185d; font-size: 1.05rem; }
.heart-card__milestone { display: flex; align-items: center; gap: 8px; margin: 0 0 var(--space-3); padding: 8px 12px; border-radius: var(--radius-sm); background: #fffbeb; color: #92400e; font-size: .92rem; }
.heart-card__milestone .icon { width: 18px; height: 18px; flex: none; color: #d97706; }
.heart-card__team { border-top: 1px dashed var(--color-border); padding-top: var(--space-3); }
.heart-card__team-line { margin: 0 0 var(--space-2); font-size: .92rem; }
.heart-card__bar { height: 8px; border-radius: 999px; background: #f3e8ff; overflow: hidden; margin-bottom: 4px; }
.heart-card__bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #ec4899, var(--pt-accent, #7e22ce)); }

/* ---------- Forms, sized for a thumb ---------- */
.pt-form { display: flex; flex-direction: column; gap: var(--space-4); margin: 0; background: none; border: 0; box-shadow: none; padding: 0; }
.pt-field { display: flex; flex-direction: column; gap: 6px; }
.pt-field__label { font-size: .85rem; font-weight: 600; color: var(--color-text); }
.pt-field__label em { font-style: normal; font-weight: 400; color: var(--color-text-muted); font-size: .78rem; }
.pt-field__hint { font-size: .76rem; color: var(--color-text-muted); }
.pt-field input,
.pt-field select,
.pt-field textarea {
  width: 100%;
  /* 16px minimum: anything smaller makes iOS Safari zoom on focus. */
  font-size: 16px;
  padding: 12px 13px;
  border: 1px solid var(--color-border-strong);
  border-radius: 11px;
  background: var(--color-surface);
  color: var(--color-text);
  margin: 0;
}
.pt-field input:focus,
.pt-field select:focus,
.pt-field textarea:focus {
  outline: none;
  border-color: var(--pt-accent);
  box-shadow: 0 0 0 3px var(--pt-accent-ring);
}
.pt-field__code { text-align: center; font-size: 1.5rem; letter-spacing: .4em; font-weight: 700; }
.pt-field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }

/* Hour picker on the absence request (שעות מסוימות). The boxes live inside a
   .pt-field, so they must escape the `width:100%` rule above or each checkbox
   stretches across the screen; min-height keeps them thumb-sized on a phone. */
.pt-hours { display: flex; flex-wrap: wrap; gap: 8px; }
.pt-hours__box {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid var(--color-border-strong);
  border-radius: 11px;
  background: var(--color-surface);
  font-size: .9rem;
  cursor: pointer;
}
.pt-hours__box input[type="checkbox"] {
  width: auto;
  min-width: 18px;
  min-height: 18px;
  margin: 0;
  padding: 0;
  accent-color: var(--pt-accent);
}

.pt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 13px 20px;
  border: 0;
  border-radius: 12px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform .12s ease-out, filter .15s ease-out;
  -webkit-user-select: none;
  user-select: none;
}
/* The press is answered under the finger, before the page reacts. */
.pt-btn:active { transform: scale(.97); }
.pt-btn--primary {
  background: linear-gradient(135deg, #a855f7, var(--pt-accent) 60%, #6b21a8);
  color: #fff;
  box-shadow: 0 8px 20px rgba(126, 34, 206, .28);
}
@media (hover: hover) {
.pt-btn--primary:hover { filter: brightness(1.05); transform: translateY(-1px); }
}
.pt-btn--quiet {
  background: none;
  color: var(--color-text-muted);
  font-weight: 600;
  font-size: .88rem;
  min-height: 0;
  padding: 10px;
  box-shadow: none;
}
@media (hover: hover) {
.pt-btn--quiet:hover { color: var(--pt-accent); background: none; transform: none; }
}

/* ---------- Sign-in ---------- */
.pt-signin {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}
.pt-signin__card { width: 100%; max-width: 400px; text-align: center; }
.pt-signin__card h1 { font-size: 1.35rem; margin: 0 0 2px; }
.pt-signin__mark {
  width: 56px;
  height: 56px;
  border-radius: 17px;
  background: linear-gradient(135deg, #a855f7, var(--pt-accent) 60%, #6b21a8);
  display: inline-grid;
  place-items: center;
  color: #fff;
  margin-bottom: var(--space-3);
  box-shadow: 0 10px 24px rgba(126, 34, 206, .35);
}
.pt-signin__mark .icon { width: 28px; height: 28px; vertical-align: 0; }
.pt-signin__school { color: var(--color-text-muted); font-size: .88rem; margin: 0 0 var(--space-5); }
.pt-signin__note { font-size: .8rem; color: var(--color-text-muted); margin: var(--space-4) 0 0; }
.pt-signin .pt-field { text-align: start; }
.pt-signin .pt-form { margin-top: var(--space-2); }

/* ---------- Request list ---------- */
.pt-reqs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.pt-req {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  background: #fcfcfe;
}
.pt-req__top { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.pt-req__dates { font-weight: 700; font-size: .92rem; }
.pt-req__top .badge { margin-inline-start: auto; }
.pt-req__reason { font-size: .87rem; margin-top: 3px; }
.pt-req__note {
  font-size: .82rem;
  color: var(--color-text-muted);
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed var(--color-border);
}

/* ---------- Lists ---------- */
.pt-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.pt-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 4px var(--space-3);
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
  font-size: .87rem;
}
.pt-list li:last-child { border-bottom: 0; }
.pt-list__key { font-weight: 700; white-space: nowrap; }
.pt-list__val { color: var(--color-text-muted); }

/* ---------- Number tiles ---------- */
.pt-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.pt-tile { padding: 0; }
.pt-tile > summary {
  list-style: none;
  cursor: pointer;
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pt-tile > summary::-webkit-details-marker { display: none; }
.pt-tile__head { display: flex; align-items: center; gap: 8px; font-size: .85rem; font-weight: 600; }
.pt-tile__icon { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; }
.pt-tile__icon .icon { width: 15px; height: 15px; vertical-align: 0; }
.pt-tile__icon--green { background: var(--color-success-bg); color: var(--color-success-text); }
.pt-tile__icon--rose { background: var(--color-danger-bg); color: var(--color-danger-text); }
.pt-tile__value { font-size: 1.7rem; font-weight: 700; line-height: 1.1; }
.pt-tile__value small { font-size: .8rem; font-weight: 400; color: var(--color-text-muted); }
.pt-tile__sub { font-size: .75rem; color: var(--color-text-muted); }
.pt-tile__hint { color: var(--pt-accent); font-weight: 600; white-space: nowrap; }
.pt-tile[open] .pt-tile__hint { display: none; }
.pt-tile .pt-list { padding: 0 var(--space-4) var(--space-4); }
.pt-tile .pt-empty { padding: 0 var(--space-4) var(--space-4); }

/* ---------- Callout + install tip ---------- */
.pt-callout {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--pt-accent-soft);
  border: 1px solid var(--pt-accent-ring);
  border-radius: var(--radius);
  padding: var(--space-4);
  text-decoration: none;
  color: var(--color-text);
}
@media (hover: hover) {
.pt-callout:hover { border-color: var(--pt-accent); }
}
.pt-callout__icon {
  width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0;
  background: var(--pt-accent); color: #fff; display: grid; place-items: center;
}
.pt-callout__icon .icon { width: 19px; height: 19px; vertical-align: 0; }
.pt-callout b { display: block; font-size: .94rem; }
.pt-callout small { color: var(--color-text-muted); font-size: .8rem; }
.pt-callout__arrow { margin-inline-start: auto; color: var(--pt-accent); font-size: 1.2rem; }

.pt-tip {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--color-success-bg);
  border: 1px solid rgba(4, 120, 87, .2);
  color: var(--color-success-text);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  font-size: .85rem;
}
.pt-tip__go, .pt-tip__close {
  background: none; border: 0; box-shadow: none; cursor: pointer;
  font: inherit; font-weight: 700; color: inherit; padding: 4px 6px;
}
.pt-tip__close { margin-inline-start: auto; opacity: .7; white-space: nowrap; }
@media (hover: hover) {
.pt-tip__close:hover, .pt-tip__go:hover { background: none; transform: none; text-decoration: underline; }
}

.pt-yearpick {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: 0;
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  font-size: .87rem;
}
.pt-yearpick label { font-weight: 600; }
.pt-yearpick select { margin: 0; padding: 8px 11px; border-radius: 9px; font-size: 16px; }

@media (max-width: 560px) {
  .pt-tiles { grid-template-columns: 1fr; }
  .pt-field-pair { grid-template-columns: 1fr; }
  .pt-card { padding: var(--space-4); }
  .pt-brand__sub { display: none; }
}

/* ============================================================
   Legacy portal rules — still used by the year-opening intake form,
   which keeps its original markup until it is redesigned separately.
   ============================================================ */
.app-header {
  background: rgba(255, 255, 255, .86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.app-header__inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: var(--space-3) var(--space-5);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
}

.app-header__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.04rem;
  color: var(--color-text);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: -.01em;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--grad-brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 10px rgba(79, 70, 229, .35);
}
.brand-mark .icon { width: 19px; height: 19px; vertical-align: 0; }

.app-main {
  max-width: 1040px;
  margin: 0 auto;
  padding: var(--space-5);
}

.app-user {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-inline-start: auto;
  font-size: 0.87rem;
}

.app-user a {
  color: var(--color-text-muted);
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
@media (hover: hover) {
.app-user a:hover { color: var(--color-primary); }
}

/* The portal's sign-in card sits on the plain page background, not on the
   staff entry screen's dark backdrop, so it keeps the lighter shadow. Its
   form is a plain <form>, so it still needs the card styling stripped. */
.app-main .login-card { box-shadow: var(--shadow-md); border: 1px solid var(--color-border); }
.login-card form {
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;
  text-align: start;
}
.login-card input { width: 100%; }
.login-card button { width: 100%; margin-top: var(--space-3); }

@media (max-width: 640px) {
  .app-main { padding: var(--space-3); }
  .app-header__inner { padding: var(--space-3) var(--space-4); gap: var(--space-2); }
  .app-header__brand { font-size: 0.98rem; }
  .app-user { font-size: 0.8rem; }
}

/* ============================================================
   THE SHELL — four wings, one layout
   Every screen sits inside a persistent dark sidebar. The wing
   (day / build / org) comes from the URL and re-points --accent,
   so the whole screen tells you where you are.
   ============================================================ */

.ws {
  --side-w: 262px;
  --nav-bg: #111a2e;
  --nav-bg-2: #0b1223;
  --nav-text: #c3cbdd;
  --nav-muted: #7c88a3;

  --accent: var(--color-primary);
  --accent-hover: var(--color-primary-hover);
  --accent-soft: var(--color-primary-bg);
  --accent-ring: var(--color-primary-ring);
}
/* Each wing also re-points the --color-primary family, so every component
   written before the wings existed (buttons, badges, focus rings, links)
   picks up the wing colour with no rule of its own. */
.ws[data-wing="build"] {
  --accent: #0d9488;
  --accent-hover: #0f766e;
  --accent-soft: #ecfdf7;
  --accent-ring: rgba(13, 148, 136, .25);

  --color-primary: #0d9488;
  --color-primary-hover: #0f766e;
  --color-primary-bg: #ecfdf7;
  --color-primary-ring: rgba(13, 148, 136, .25);
}
/* Slate, not amber: an amber accent here was byte-identical to the warning
   palette, so ordinary rows on /import read as "needs attention". */
.ws[data-wing="org"] {
  --accent: #475569;
  --accent-hover: #334155;
  --accent-soft: #f1f5f9;
  --accent-ring: rgba(71, 85, 105, .25);

  --color-primary: #475569;
  --color-primary-hover: #334155;
  --color-primary-bg: #f1f5f9;
  --color-primary-ring: rgba(71, 85, 105, .25);
}
/* Team board (לוח): pink-magenta. Every neighbouring hue is taken - indigo is
   the day wing, teal the builder, slate the org wing, purple the PORTAL - and
   amber reads as the warning palette (see the org note above). */
.ws[data-wing="board"] {
  --accent: #db2777;
  --accent-hover: #be185d;
  --accent-soft: #fdf2f8;
  --accent-ring: rgba(219, 39, 119, .25);

  --color-primary: #db2777;
  --color-primary-hover: #be185d;
  --color-primary-bg: #fdf2f8;
  --color-primary-ring: rgba(219, 39, 119, .25);
}

.ws-shell {
  display: grid;
  grid-template-columns: var(--side-w) 1fr;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ---------- Sidebar ---------- */
.ws-side {
  background: linear-gradient(180deg, var(--nav-bg), var(--nav-bg-2));
  color: var(--nav-text);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: 14px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  z-index: 20;
}

.ws-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 10px;
  text-decoration: none;
}
.ws-brand__mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--accent);
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
  transition: background .2s;
  flex-shrink: 0;
}
.ws-brand__mark .icon { width: 20px; height: 20px; vertical-align: 0; }
.ws-brand__text { display: flex; flex-direction: column; min-width: 0; }
.ws-brand__name {
  font-weight: 700;
  font-size: 0.93rem;
  color: #fff;
  letter-spacing: -.01em;
  line-height: 1.25;
}
.ws-brand__sub { font-size: 0.72rem; color: var(--nav-muted); }

/* Wing switcher. auto-fit: an admin has four tiles, a coordinator three
   (no builder) - the grid follows whatever the template renders, so adding
   or role-gating a wing never needs a per-count modifier again. */
.ws-wings {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 5px;
  background: rgba(255, 255, 255, .055);
  padding: 5px;
  border-radius: 12px;
}
.ws-wing {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 9px 2px;
  border-radius: 9px;
  font-size: 0.67rem;
  font-weight: 600;
  color: var(--nav-muted);
  text-decoration: none;
  transition: background .15s, color .15s;
}
.ws-wing__glyph { width: 18px; height: 18px; }
@media (hover: hover) {
.ws-wing:hover { background: rgba(255, 255, 255, .07); color: #e6ebf5; }
}
.ws[data-wing="day"]   .ws-wing[data-wing-key="day"],
.ws[data-wing="build"] .ws-wing[data-wing-key="build"],
.ws[data-wing="board"] .ws-wing[data-wing-key="board"],
.ws[data-wing="org"]   .ws-wing[data-wing-key="org"] {
  background: #fff;
  color: #111a2e;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
}

/* Wing navigation */
.ws-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
}
.ws-nav__group {
  font-size: 0.67rem;
  letter-spacing: .06em;
  color: var(--nav-muted);
  font-weight: 700;
  margin: 14px 10px 5px;
}
.ws-nav__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 10px;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--nav-text);
  text-decoration: none;
  transition: background .15s, color .15s;
}
.ws-nav__icon { width: 17px; height: 17px; vertical-align: 0; opacity: .8; flex-shrink: 0; }
@media (hover: hover) {
.ws-nav__item:hover { background: rgba(255, 255, 255, .07); color: #fff; }
}
.ws-nav__item.is-active {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .3);
}
.ws-nav__item.is-active .ws-nav__icon { opacity: 1; }

/* Signed-in user */
.ws-user {
  border-top: 1px solid rgba(255, 255, 255, .08);
  padding-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ws-user__link {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--nav-text);
  flex: 1;
  min-width: 0;
  padding: 4px;
  border-radius: 9px;
}
@media (hover: hover) {
.ws-user__link:hover { background: rgba(255, 255, 255, .07); }
}
.ws-user__avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.ws-user__avatar .icon { width: 16px; height: 16px; vertical-align: 0; }
.ws-user__name {
  display: flex;
  flex-direction: column;
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
  min-width: 0;
}
.ws-user__name small { font-weight: 400; font-size: 0.68rem; color: var(--nav-muted); }
.ws-user__out {
  background: none;
  border: 0;
  color: var(--nav-muted);
  padding: 7px;
  border-radius: 9px;
  cursor: pointer;
}
@media (hover: hover) {
.ws-user__out:hover { background: rgba(255, 255, 255, .09); color: #fff; }
}
.ws-user__out .icon { width: 17px; height: 17px; vertical-align: 0; }

/* ---------- Content area ---------- */
.ws-main {
  min-width: 0;
  padding: var(--space-5) var(--space-6) var(--space-6);
  max-width: 1320px;
}

.ws-topbar {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
}
.ws-topbar--bare { margin-bottom: var(--space-3); }
.ws-topbar__title { min-width: 0; }
.ws-topbar__title h1 { font-size: 1.5rem; margin: 0; }
.ws-topbar__title p { margin: 2px 0 0; color: var(--color-text-muted); font-size: 0.87rem; }
.ws-topbar__actions {
  margin-inline-start: auto;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}
/* Toolbars pulled up into the header arrive as whatever markup the page had -
   a <p> of links, a filter <form>, a bare <div>. Flatten them all so the
   header stays one tidy row instead of a stack of blocks. */
.ws-topbar__actions p,
.ws-topbar__actions form,
.ws-topbar__actions > div {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  background: none;
  border: 0;
  box-shadow: none;
  flex-wrap: wrap;
}
.ws-topbar__actions label { font-size: .82rem; color: var(--color-text-muted); }
/* A moved toolbar sometimes brings its own little heading ("סינון"). Keep it
   inline instead of letting its block margins break the header row. */
.ws-topbar__actions h2,
.ws-topbar__actions h3,
.ws-topbar__actions h4 {
  margin: 0;
  font-size: .82rem;
  font-weight: 600;
  color: var(--color-text-muted);
  white-space: nowrap;
}
/* A plain link in the header reads as an action, so give it a button shape. */
.ws-topbar__actions a:not(.btn-cta) {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  background: var(--color-surface);
  color: var(--color-primary);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 8px 15px;
  font-weight: 600;
  font-size: .87rem;
  white-space: nowrap;
}
@media (hover: hover) {
.ws-topbar__actions a:not(.btn-cta):hover {
  background: var(--color-primary-bg);
  border-color: var(--color-primary);
}
}

.ws-burger {
  display: none;
  cursor: pointer;
  padding: 9px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text-muted);
}
.ws-burger .icon { width: 20px; height: 20px; vertical-align: 0; }
.ws-scrim { display: none; }

/* Search field in the page header */
.field-search {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 11px;
  padding: 0 13px;
  box-shadow: var(--shadow-sm);
  color: var(--color-text-muted);
}
.field-search .icon { width: 17px; height: 17px; vertical-align: 0; }
.field-search input {
  border: 0;
  background: none;
  padding: 10px 0;
  font: inherit;
  font-size: 0.87rem;
  min-width: 210px;
  color: var(--color-text);
}
.field-search input:focus { outline: none; }
.field-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }

.btn-link {
  background: none;
  border: none;
  color: var(--color-text-muted);
  padding: var(--space-1) var(--space-2);
  font-weight: 600;
  border-radius: var(--radius-sm);
}
@media (hover: hover) {
.btn-link:hover { background: var(--color-danger-bg); color: var(--color-danger-text); }
}

/* ---------- Quick actions (home) ---------- */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  text-decoration: none;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-5) var(--space-3);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
  transition: transform .12s, box-shadow .18s, border-color .18s;
}

@media (hover: hover) {
.quick-action:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary);
}
}

.quick-action__icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary-bg);
  color: var(--color-primary);
  font-size: 1.35rem;
}
.quick-action__icon .icon { width: 23px; height: 23px; vertical-align: 0; }
.quick-action__label { font-size: 0.93rem; }

.quick-action--cta {
  background: var(--grad-cta);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 20px rgba(234, 88, 12, .28);
}
.quick-action--cta .quick-action__icon { background: rgba(255, 255, 255, .18); color: #fff; }
@media (hover: hover) {
.quick-action--cta:hover { border-color: transparent; filter: brightness(1.05); }
}

/* ---------- Stat cards / insights ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: var(--space-3);
  margin: var(--space-4) 0 var(--space-5);
}

.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-4) var(--space-4) var(--space-3);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform .12s, box-shadow .18s;
}
@media (hover: hover) {
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
}

.stat-card__head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text-muted);
  font-weight: 600;
  font-size: 0.85rem;
}

.stat-card__chip {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-card__chip .icon { width: 18px; height: 18px; vertical-align: 0; }

.chip-indigo  { background: var(--color-primary-bg);  color: var(--color-primary); }
.chip-green   { background: var(--color-success-bg);  color: var(--color-success-text); }
.chip-amber   { background: var(--color-warning-bg);  color: var(--color-warning-text); }
.chip-rose    { background: var(--color-danger-bg);   color: var(--color-danger-text); }
.chip-orange  { background: var(--color-cta-bg);      color: var(--color-cta); }

.stat-card__value {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.15;
}
.stat-card__value small { font-size: 0.9rem; font-weight: 600; color: var(--color-text-muted); }

.stat-card__sub { font-size: 0.83rem; color: var(--color-text-muted); }

/* clickable stat-card that expands into a full breakdown (<details>) */
details.stat-card--clickable {
  padding: var(--space-4) var(--space-4) var(--space-3);
  margin: 0;
}
details.stat-card--clickable > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: inherit;
  font-weight: inherit;
}
details.stat-card--clickable > summary::-webkit-details-marker { display: none; }
@media (hover: hover) {
details.stat-card--clickable > summary:hover .expand-hint { color: var(--color-primary); }
}
.expand-hint {
  color: var(--color-primary);
  font-weight: 700;
}
details.stat-card--clickable[open] .expand-hint { opacity: .55; }
details.stat-card--clickable[open] {
  grid-column: 1 / -1;   /* opened breakdown gets the full row width */
}
details.stat-card--clickable .insight-list {
  margin-top: var(--space-3);
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-2);
  max-height: 340px;
  overflow-y: auto;
}

/* ranked list inside an insight card */
.insight-list { list-style: none; margin: var(--space-2) 0 0; padding: 0; }
.insight-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: 7px 2px;
  border-bottom: 1px dashed var(--color-border);
  font-size: 0.9rem;
}
.insight-list li:last-child { border-bottom: none; }
.insight-list .who { font-weight: 600; }
.insight-list .val { color: var(--color-text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* tiny horizontal bar */
.mini-bar {
  height: 7px;
  border-radius: 999px;
  background: var(--color-neutral-bg);
  overflow: hidden;
  flex: 1;
  max-width: 130px;
}
.mini-bar > span { display: block; height: 100%; border-radius: 999px; background: var(--grad-brand); }
.mini-bar--warn > span { background: linear-gradient(90deg, #f59e0b, #ea580c); }

.empty-state {
  text-align: center;
  padding: var(--space-6);
  background: var(--color-surface);
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius);
  color: var(--color-text-muted);
}
.empty-state .icon { width: 42px; height: 42px; opacity: .4; }

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title .icon { color: var(--color-primary); }

/* ---------- Daily sheet ---------- */
.daily-controls { margin-bottom: var(--space-4); }
.inline-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;
  margin: 0;
}
/* The `hidden` attribute comes from the user-agent stylesheet, so ANY author
   `display` rule beats it - which quietly made el.hidden = true a no-op on
   every element we style. It had already broken closeMenu() in the timetable
   grid (.lesson-menu is display:flex, so the lesson menu never closed) before
   it broke the "add another role" button. One rule instead of one workaround
   per call site. */
[hidden] { display: none !important; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  background: var(--color-surface);
  color: var(--color-primary);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 8px 15px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background .15s, border-color .15s;
}
@media (hover: hover) {
.btn-secondary:hover { background: var(--color-primary-bg); border-color: var(--color-primary); }
}
.print-school { color: var(--color-text-muted); font-weight: 600; margin-top: -8px; }

/* On screen the page header carries the title; on paper the sidebar and the
   header are gone, so pages that get printed keep a print-only heading. */
.print-only { display: none; }

@media print {
  .ws-side, .ws-topbar, .app-header, .no-print { display: none !important; }
  .ws-shell { display: block; }
  .ws-main, .app-main { padding: 0; max-width: none; }
  .print-only { display: block; }
  body { background: #fff; font-size: 12pt; }
  table { box-shadow: none; border: 1px solid #000; }
  th, td { border-bottom: 1px solid #999; }
  .badge { border: 1px solid #999; }
  .card { border: 0; box-shadow: none; }
}

/* ---------- Login ---------- */
/* ---------- Entry screen ---------- */
.login-page {
  background:
    radial-gradient(900px 500px at 80% -10%, rgba(79, 70, 229, .28), transparent 60%),
    radial-gradient(700px 420px at 5% 105%, rgba(234, 88, 12, .18), transparent 55%),
    linear-gradient(180deg, #111a2e, #0b1223);
  min-height: 100vh;
  min-height: 100dvh;
}

.login-wrap {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: var(--space-4);
  min-height: 100vh;
  min-height: 100dvh;
  padding: var(--space-4);
}

.login-card {
  background: var(--color-surface);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(6, 11, 25, .45);
  padding: var(--space-6);
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.login-mark {
  width: 56px;
  height: 56px;
  border-radius: 17px;
  background: var(--grad-brand);
  color: #fff;
  display: inline-grid;
  place-items: center;
  margin-bottom: var(--space-3);
  box-shadow: 0 10px 24px rgba(79, 70, 229, .4);
}
.login-mark .icon { width: 29px; height: 29px; vertical-align: 0; }

.login-card h1 { font-size: 1.5rem; margin: 0; }
.login-sub {
  color: var(--color-text-muted);
  font-size: .85rem;
  margin: var(--space-2) 0 var(--space-5);
}

.login-form {
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;
  text-align: start;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.login-form label { font-size: .82rem; font-weight: 600; color: var(--color-text-muted); }
.login-form input { width: 100%; margin-bottom: var(--space-3); }
.login-form button { width: 100%; margin-top: var(--space-2); padding: 12px; font-size: 1rem; }

.login-foot { color: #8e9ab7; font-size: .85rem; margin: 0; }
.login-foot a { color: #c7d0e6; font-weight: 600; }

.success-box {
  background: var(--color-success-bg);
  border: 1px solid rgba(4, 120, 87, .35);
  color: var(--color-success-text);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  margin: var(--space-3) 0;
}

/* ---------- Tables ---------- */
table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  margin: var(--space-3) 0 var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

th, td {
  padding: 11px var(--space-4);
  text-align: start;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

th {
  background: var(--color-bg-accent);
  color: var(--color-text-muted);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: none;
  letter-spacing: .01em;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background .12s; }
@media (hover: hover) {
tbody tr:hover { background: var(--color-bg-accent); }
}

ul { margin: 0; padding-inline-start: 1.1rem; }

/* Slot-type row highlighting */
.frontal { background: var(--color-success-bg); }
.non-frontal { background: var(--color-neutral-bg); color: var(--color-neutral-text); }
.standby { background: var(--color-primary-bg); color: var(--color-primary); }

@media (hover: hover) {
tbody tr.frontal:hover,
tbody tr.non-frontal:hover,
tbody tr.standby:hover { filter: brightness(0.98); }
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 0.77rem;
  font-weight: 700;
}
.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: .75;
}

.badge-open { background: var(--color-danger-bg); color: var(--color-danger-text); }
.badge-partially_filled { background: var(--color-warning-bg); color: var(--color-warning-text); }
.badge-fully_filled { background: var(--color-success-bg); color: var(--color-success-text); }
.badge-confirmed { background: var(--color-success-bg); color: var(--color-success-text); }
.badge-pending { background: var(--color-warning-bg); color: var(--color-warning-text); }
.badge-unfilled { background: var(--color-danger-bg); color: var(--color-danger-text); }
.badge-yes { background: var(--color-success-bg); color: var(--color-success-text); }
.badge-no { background: var(--color-danger-bg); color: var(--color-danger-text); }
.badge-no_reply { background: var(--color-neutral-bg); color: var(--color-neutral-text); }
.badge-cancelled { background: var(--color-neutral-bg); color: var(--color-neutral-text); }
/* Non-frontal absence hours on the daily sheet: nothing to arrange, so they
   must not wear the red "לא מאויש" badge that means children need a teacher. */
.badge-neutral { background: var(--color-neutral-bg); color: var(--color-neutral-text); }

/* ---------- Forms ---------- */
form {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-4) var(--space-5);
  margin: var(--space-3) 0 var(--space-5);
  box-shadow: var(--shadow-sm);
}

form.inline {
  display: inline;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  box-shadow: none;
}

form > div { margin-bottom: var(--space-3); }
form > div:last-of-type { margin-bottom: 0; }

label {
  display: inline-block;
  max-width: 100%;  /* so a <select> inside one can be held to the screen too */
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--color-text-muted);
  margin-inline-end: var(--space-2);
}

input[type=text],
input[type=date],
input[type=time],
input[type=number],
input[type=password],
input[type=file],
select,
textarea {
  /* A <select> is as wide as its LONGEST option, and on a phone one long
     name (the suggestions screen's "כל הצוות" list) made it wider than the
     screen. The browser then widened the whole page to fit it: the layout
     broke and the off-canvas menu was pushed into view. */
  max-width: 100%;
  font-family: inherit;
  font-size: 0.95rem;
  padding: 8px 12px;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  transition: border-color .15s, box-shadow .15s;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-focus);
}

input[type=checkbox], input[type=radio] {
  accent-color: var(--color-primary);
  width: 16px;
  height: 16px;
  margin-inline-end: var(--space-1);
}

/* ---------- Buttons ---------- */
button, input[type=submit] {
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 9px 18px;
  border-radius: 999px;
  border: none;
  background: var(--grad-brand);
  color: #fff;
  box-shadow: 0 3px 10px rgba(79, 70, 229, .25);
  transition: transform .1s, filter .15s, box-shadow .15s;
}

@media (hover: hover) {
button:hover, input[type=submit]:hover {
  filter: brightness(1.07);
  box-shadow: 0 5px 14px rgba(79, 70, 229, .32);
}
}

button:active, input[type=submit]:active { transform: translateY(1px); }

button:focus-visible, input[type=submit]:focus-visible,
a:focus-visible { outline: none; box-shadow: var(--shadow-focus); }

/* Small "remove this" control that sits inside a field label, next to the
   input it clears - quiet until you reach for it, red once you do. */
.btn-icon {
  background: none;
  border: none;
  box-shadow: none;
  padding: 2px 6px;
  margin-inline-start: 4px;
  font-size: .95rem;
  line-height: 1;
  color: var(--color-text-muted);
  cursor: pointer;
}
@media (hover: hover) {
.btn-icon:hover {
  color: var(--color-danger-text);
  background: var(--color-danger-bg);
  border-radius: var(--radius-sm, 6px);
  filter: none;
}
}

.btn-danger {
  background: var(--color-surface);
  border: 1px solid rgba(190, 18, 60, .4);
  color: var(--color-danger-text);
  box-shadow: none;
}
@media (hover: hover) {
.btn-danger:hover { background: var(--color-danger-bg); filter: none; }
}

.btn-link { box-shadow: none; }
@media (hover: hover) {
.btn-link:hover { box-shadow: none; }
}

/* ---------- Misc ---------- */
.error-box {
  background: var(--color-danger-bg);
  border: 1px solid rgba(190, 18, 60, .35);
  color: var(--color-danger-text);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  margin: var(--space-3) 0;
}

/* An explanation, not a warning (UX-BUILD-4). It was amber, which is the
   warning colour, in some 360 places - so the few real warnings among them
   could not be told apart. A note that IS a warning adds review-note--warn. */
.review-note { color: var(--color-text-muted); font-size: 0.85rem; }
.review-note--warn { color: var(--color-warning-text); font-weight: 600; }
/* The solve panel's per-option note: what a time limit buys, and what it
   costs. The pro/con lines carry meaning, not decoration - without a colour
   they read as one undifferentiated paragraph. */
.time-limit-note { margin-top: 0.4rem; line-height: 1.6; }
.time-limit-note .pro { color: var(--color-success-text); }
.time-limit-note .con { color: var(--color-danger-text); }

details {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  margin: var(--space-5) 0;
  box-shadow: var(--shadow-sm);
}

details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--color-text-muted);
}
@media (hover: hover) {
details summary:hover { color: var(--color-primary); }
}

details table { margin-top: var(--space-3); box-shadow: none; }

/* ---------- Responsive ---------- */
.table-scroll {
  overflow-x: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin: var(--space-3) 0 var(--space-5);
}

.table-scroll table { margin: 0; box-shadow: none; min-width: 560px; }

/* Below 1080px the sidebar becomes an off-canvas drawer driven by the
   #nav-toggle checkbox, so the layout needs no JavaScript at any width. */
@media (max-width: 1080px) {
  .ws-shell { grid-template-columns: 1fr; }

  /* Physical right/translateX on purpose: the app is RTL everywhere, and
     transforms are not mirrored by direction. */
  .ws-side {
    position: fixed;
    top: 0;
    right: 0;
    width: var(--side-w);
    transform: translateX(100%);
    transition: transform .2s ease;
    box-shadow: -12px 0 34px rgba(11, 18, 35, .3);
    /* 100vh on a phone is taller than what is visible (the address bar), so
       the last items sat below the screen with no way to scroll to them. */
    height: 100dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  #nav-toggle:checked ~ .ws-shell .ws-side { transform: translateX(0); }

  #nav-toggle:checked ~ .ws-scrim {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(11, 18, 35, .45);
    z-index: 15;
  }

  .ws-burger { display: inline-flex; }
  .ws-main { padding: var(--space-4); }
}

@media (max-width: 640px) {
  .ws-main { padding: var(--space-3); }
  .ws-topbar__title h1 { font-size: 1.25rem; }
  .ws-topbar__actions { width: 100%; margin-inline-start: 0; }
  .field-search { flex: 1; }
  .field-search input { min-width: 0; width: 100%; }

  button, input[type=submit], .btn-cta { padding: 10px 18px; }

  .quick-actions { grid-template-columns: repeat(2, 1fr); gap: var(--space-2); }
  .quick-action { padding: var(--space-4) var(--space-2); }
  .stats-grid { grid-template-columns: 1fr 1fr; }

  table:not(.table-scroll table):not(.cover-grid) {
    display: block;
    overflow-x: auto;
    box-shadow: none;
  }
}

@media (max-width: 420px) {
  .stats-grid { grid-template-columns: 1fr; }
}

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}

/* ============================================================
   Timetable builder (אזור בניית מערכת — אדמין בלבד)
   ============================================================ */

.badge-success { background: var(--color-success-bg); color: var(--color-success-text); }
.badge-warning { background: var(--color-warning-bg); color: var(--color-warning-text); }
.badge-danger { background: var(--color-danger-bg); color: var(--color-danger-text); }

.warning-box {
  background: var(--color-warning-bg);
  color: var(--color-warning-text);
  border: 1px solid rgba(180, 83, 9, .25);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  margin: var(--space-3) 0;
}

.row-inactive { opacity: .5; }
.row-review { background: var(--color-warning-bg); }

.btn-small { padding: 4px 10px; font-size: .85rem; }

.btn-cta {
  background: var(--grad-cta);
  color: #fff;
  border: none;
  text-decoration: none;
  font-size: 1.05rem;
  padding: 10px 22px;
}

.checkbox-label { display: inline-flex; align-items: center; gap: 6px; color: var(--color-text-muted); }

.narrow-table { max-width: 360px; }

/* Wizard checklist */
.builder-steps { display: flex; flex-direction: column; gap: var(--space-3); margin: var(--space-4) 0; }

.builder-step {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-right: 4px solid var(--color-border-strong);
  border-radius: var(--radius);
  padding: var(--space-4);
  text-decoration: none;
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .15s;
}
@media (hover: hover) {
.builder-step:hover { box-shadow: var(--shadow-md); }
}
.builder-step--done { border-right-color: var(--color-success-text); }
.builder-step--warn { border-right-color: var(--color-warning-text); }
.builder-step--error { border-right-color: var(--color-danger-text); }

.builder-step__num {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--color-primary-bg); color: var(--color-primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; flex-shrink: 0;
}
.builder-step__title { font-weight: 700; display: flex; align-items: center; gap: var(--space-2); }
.builder-step__summary { color: var(--color-text-muted); font-size: .9rem; }
.builder-step__issue { color: var(--color-warning-text); font-size: .85rem; margin-top: 4px; }
.builder-step__issue--error { color: var(--color-danger-text); }

/* Shared builder bits */
.builder-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-4);
  margin: var(--space-3) 0;
  box-shadow: var(--shadow-sm);
}

.builder-inline-form { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; margin: var(--space-3) 0; }
.builder-form-row { display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: center; margin-bottom: var(--space-3); }

.builder-tabs { display: flex; gap: var(--space-2); flex-wrap: wrap; margin: var(--space-4) 0; }
.builder-tab {
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid var(--color-border-strong);
  text-decoration: none;
  color: var(--color-text-muted);
  background: var(--color-surface);
}
.builder-tab--active { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }

/* Requirements matrix */
.req-matrix th { min-width: 130px; }
.req-cell { text-align: center; }
.req-hours { width: 56px; text-align: center; }
.req-teacher { max-width: 130px; font-size: .8rem; display: block; margin: 4px auto 0; }
.req-totals td { font-weight: 700; background: var(--color-bg-accent); }
/* "N ברצועה": hours of this cell a learning strip already teaches, so the
   solver places only the remainder as an ordinary lesson. Quiet by design -
   it annotates a number that is not wrong. Its red sibling does the opposite:
   strip hours with no תקן to come out of, which DO add to the class's week. */
.req-in-strip,
.req-strip-over {
  display: block;
  margin-top: 3px;
  font-size: .7rem;
  line-height: 1.3;
  border-radius: 4px;
  padding: 1px 4px;
}
.req-in-strip { color: var(--color-text-muted); background: var(--color-bg-accent); }
.req-strip-over { color: #b42318; background: #fef3f2; font-weight: 600; }

/* Availability grid (teacher constraints) */
.avail-grid td, .avail-grid th { text-align: center; padding: 4px; }
.avail-cell {
  width: 90px; min-height: 34px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  /* The ROOT of the invisible-day-names bug: these cells are <button>s, and
     the global `button { color: #fff }` rule paints white text on this white
     background. It went unnoticed for a year because an EMPTY cell has no
     text and a marked one gets its colour from .avail-cell--avoid/--blocked -
     so the only permanently-labelled cell, the day header, was the only one
     that looked blank. Set the colour here rather than only on the header,
     so the next label added to a cell is legible by default. */
  color: var(--color-text);
  cursor: pointer;
  font-size: .8rem;
}
.avail-cell--blocked { background: var(--color-danger-bg); color: var(--color-danger-text); border-color: currentColor; }
.avail-cell--avoid { background: var(--color-warning-bg); color: var(--color-warning-text); border-color: currentColor; }
.avail-cell--off { background: var(--color-neutral-bg); }
.day-select { font-size: .75rem; margin-top: 2px; }

/* Day-header toggle button on the intake availability grid: must read as a
   header, not as one more blank cell, and stay legible once .avail-cell--avoid
   / .avail-cell--blocked are toggled on top by JS (applyCellVisual). */
/* Two min-widths are load-bearing here, and BOTH are needed - measured on a
   375px viewport, which is where teachers actually fill this form:
   - .avail-scroll is a flex ITEM (the grid sits beside the capacity card) and
     a flex item's default min-width:auto refuses to shrink below its content;
   - #intake-fieldset is a <fieldset>, and every browser's UA stylesheet gives
     it min-width:min-content, which no amount of overflow-x on a descendant
     can override. Without it the fieldset stayed 458px wide inside a 375px
     main and the whole PAGE scrolled sideways instead of just the grid. */
/* shrink-only (flex-grow 0): growing stretched the grid across the whole row
   on a desktop and pushed the capacity card underneath it. */
.avail-scroll { overflow-x: auto; max-width: 100%; min-width: 0; flex: 0 1 auto; }
#intake-fieldset { min-width: 0; }
.avail-grid th { position: sticky; top: 0; z-index: 2; background: var(--color-surface); }
.avail-grid td:first-child, .avail-grid th:first-child {
  position: sticky; inset-inline-start: 0; z-index: 1;
  background: var(--color-surface);
}
.avail-grid th:first-child { z-index: 3; }
.day-toggle {
  width: 100%;
  min-height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: var(--color-bg-accent);
  font-weight: 700;
  font-size: .9rem;
}
.day-toggle__name { font-weight: 700; color: var(--color-text); }
.day-toggle__state { font-size: .7rem; color: var(--color-text-muted); font-weight: 400; }
.day-toggle--set { border-width: 2px; font-weight: 700; }
.day-toggle--set .day-toggle__state { color: inherit; font-weight: 600; }
/* .day-toggle sets its own background, and it is declared AFTER the state
   classes - so without these two the marked day lost its colour entirely and
   only the caption changed. Colour was the ONLY signal before this change;
   it stays a signal, now alongside the word. */
.day-toggle.avail-cell--avoid { background: var(--color-warning-bg); }
.day-toggle.avail-cell--blocked { background: var(--color-danger-bg); }
.day-toggle.avail-cell--avoid .day-toggle__name { color: var(--color-warning-text); }
.day-toggle.avail-cell--blocked .day-toggle__name { color: var(--color-danger-text); }

@media (max-width: 640px) {
  .avail-grid .avail-cell { width: 62px; font-size: .72rem; }
  .avail-grid .day-toggle__name { font-size: .82rem; }
  .avail-grid .day-toggle__state { font-size: .62rem; }
}

.cell-tag { padding: 1px 8px; border-radius: 999px; font-size: .8rem; }
.cell-tag--blocked { background: var(--color-danger-bg); color: var(--color-danger-text); }
.cell-tag--avoid { background: var(--color-warning-bg); color: var(--color-warning-text); }

/* Draft grid editor */
.grid-toolbar { display: flex; gap: var(--space-4); align-items: center; flex-wrap: wrap; margin-bottom: var(--space-3); }

.chip-pool {
  display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center;
  background: var(--color-bg-accent);
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius);
  padding: var(--space-3);
  margin-bottom: var(--space-3);
  min-height: 46px;
}
.chip-pool__hint { width: 100%; color: var(--color-text-muted); font-size: .85rem; }

.pool-chip {
  border: 1px solid var(--color-primary);
  background: var(--color-primary-bg);
  color: var(--color-primary);
  border-radius: 999px;
  padding: 5px 14px;
  cursor: pointer;
  font-weight: 600;
}
.pool-chip--armed { background: var(--color-primary); color: #fff; box-shadow: var(--shadow-focus); }
/* Nothing left to place: a learning strip teaches this subject in full. Kept
   in the list rather than removed, so the subject does not silently vanish
   from the one screen that says what a class still owes. */
.pool-chip--in-strip {
  border-color: var(--color-border);
  background: var(--color-bg-accent);
  color: var(--color-text-muted);
  cursor: default;
  font-weight: 500;
}
.pool-chip--in-strip .pool-chip__count { color: var(--color-text-muted); }
.pool-chip__count {
  display: inline-block; min-width: 20px;
  background: rgba(255, 255, 255, .8);
  color: var(--color-primary);
  border-radius: 999px; font-size: .8rem; text-align: center;
}
.pool-chip__teacher { font-size: .8rem; max-width: 140px; }
.pool-chip__warn { color: var(--color-danger-text); font-size: .8rem; }
/* Feature 18a: optional purpose for the next פרטני/שהייה placement. */
.pool-note { font-size: .85rem; min-width: 220px; flex: 1 1 220px; }

.grid-toast {
  position: sticky; top: 64px; z-index: 20;
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-3);
  font-weight: 600;
  box-shadow: var(--shadow-md);
}
.grid-toast--error { background: var(--color-danger-bg); color: var(--color-danger-text); }
.grid-toast--warn { background: var(--color-warning-bg); color: var(--color-warning-text); }

.tt-grid { border-collapse: collapse; min-width: 700px; }
.tt-grid th, .tt-grid td { border: 1px solid var(--color-border); padding: 4px; }
.tt-cell { min-width: 110px; height: 52px; vertical-align: top; }
.tt-cell--empty { cursor: pointer; }
.tt-cell--empty:hover { background: var(--color-primary-bg); }
.tt-cell--off { background: var(--color-neutral-bg); }
/* An armed chip can only be placed in its own class's column (the server
   derives the class from the requirement, not from the click) - the other
   columns say so instead of refusing after the click. */
.tt-cell--dim { opacity: .45; }

/* Where the ARMED chip may go. The verdicts come from the server running the
   real check_placement over the frame, so a cell painted clean here and a cell
   the drop accepts are the same answer - the shading has no opinion of its
   own. Red = a HARD refusal, amber = it would be accepted with a warning; the
   reason is in the cell's tooltip. Cells with nothing to say stay plain. */
.tt-cell--refuse { cursor: not-allowed; }
/* The frontal cutoff for this class's grade on this day. Drawn ALWAYS, not
   only while a chip is armed - it is a property of the grade's week. A hatch
   rather than a fill, so it survives underneath the two colours above: the
   verdict paints below set background-COLOR only, never the shorthand. */
.tt-cell--nofrontal {
  background-image: repeating-linear-gradient(
    45deg, transparent, transparent 7px,
    var(--color-neutral-bg) 7px, var(--color-neutral-bg) 14px
  );
}
.grid-legend { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.grid-legend__key {
  display: inline-block; width: 14px; height: 14px;
  border: 1px solid var(--color-border); border-radius: 3px;
  vertical-align: -2px; margin-inline-end: 4px;
}

/* The grade board's trailing column: פרטני/שהייה of the teachers who teach
   these classes. Read-only - those hours belong to a teacher and not to any
   column on this board. */
.tt-cell--support { background: var(--color-bg-accent); min-width: 150px; }
.tt-support {
  font-size: .74rem; line-height: 1.3;
  padding: 1px 4px; margin-bottom: 2px;
  border-radius: 3px; background: var(--color-neutral-bg);
}
.tt-support--individual { background: var(--color-primary-bg); }

/* ---------- Grade / custom board: a column per class, a row per hour ------- */
.tt-grid--multi { min-width: 0; }
.tt-grid--multi th { position: sticky; top: 0; background: var(--color-bg-accent); z-index: 2; }
.tt-grid--multi .tt-cell { min-width: 96px; height: 46px; }
.tt-grid--multi .tt-lesson__title { font-size: .82rem; }
.tt-grid--multi .tt-lesson__sub { font-size: .74rem; }
.tt-daysep td {
  background: var(--grad-brand); color: #fff; font-weight: 700; text-align: center;
}
/* The hour in which every selected class is free - the one a shared activity
   between two classes can actually use. */
.tt-row--free td { background: var(--color-success-bg); }
.tt-row--free .tt-cell--empty:hover { background: var(--color-primary-bg); }

/* ---------------------------------------------------------------------------
   The verdict paints, stated LAST and at a specificity nothing above reaches.

   They were written next to the other `.tt-cell--*` rules and lost twice over:
   `.tt-row--free td` is (0,1,1) against their (0,1,0) AND comes later, so on
   the grade board with "כל הכיתות פנויות" ticked - the board this feature was
   built for, with the tick that is the reason it exists - a HARD refusal
   rendered GREEN. `.tt-cell--empty:hover` (0,2,0) did the same to amber at the
   exact moment she hovers to read the reason out of the tooltip.

   background-COLOR, never the `background` shorthand: the cutoff hatch above
   is a background-IMAGE, and the shorthand resets it. A cell can legitimately
   be both.
   --------------------------------------------------------------------------- */
.tt-grid .tt-cell--caution,
.tt-grid .tt-cell--caution:hover,
.tt-row--free .tt-cell--caution { background-color: var(--color-warning-bg); }
.tt-grid .tt-cell--refuse,
.tt-grid .tt-cell--refuse:hover,
.tt-row--free .tt-cell--refuse { background-color: var(--color-danger-bg); }
.tt-grid .tt-cell--nofrontal:hover,
.tt-row--free .tt-cell--nofrontal {
  background-image: repeating-linear-gradient(
    45deg, transparent, transparent 7px,
    var(--color-neutral-bg) 7px, var(--color-neutral-bg) 14px
  );
}

.custom-classes {
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius);
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-3);
}
.custom-classes summary { cursor: pointer; font-weight: 600; }
.custom-classes__body { display: flex; flex-wrap: wrap; gap: var(--space-4); margin-top: var(--space-2); }
.custom-classes__grade { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.custom-classes__item { white-space: nowrap; }

.tt-lesson {
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  margin-bottom: 2px;
  background: var(--color-primary-bg);
  border-right: 3px solid var(--color-primary);
  cursor: pointer;
  font-size: .85rem;
}
.tt-lesson--individual { background: var(--color-success-bg); border-right-color: var(--color-success-text); }
.tt-lesson--stay { background: var(--color-neutral-bg); border-right-color: var(--color-neutral-text); }
/* שילוב — runs alongside the class's own lesson rather than instead of it, so
   it gets its own tint and a dashed edge: the cell is shared, not owned. */
.tt-lesson--inclusion { background: var(--color-warning-bg); border-right-color: var(--color-warning-text); border-right-style: dashed; }
.tt-lesson--locked { outline: 2px solid var(--color-border-strong); }
.tt-lesson__title { font-weight: 700; }
.tt-lesson__sub { color: var(--color-text-muted); font-size: .78rem; }

.lesson-menu {
  position: absolute; z-index: 30;
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: var(--space-3);
  display: flex; flex-direction: column; gap: var(--space-2);
  max-width: 280px;
}
.lesson-menu__title { font-weight: 700; }
/* Swap suggestions: the menu is narrow and the list can hold several options,
   so it scrolls inside itself rather than pushing the menu off the screen. */
#menu-swaps-panel { max-height: 300px; overflow-y: auto; }
.swap-option {
  border-top: 1px solid var(--color-border);
  padding: var(--space-2) 0;
  display: flex; flex-direction: column; gap: 4px;
}
.swap-option:first-child { border-top: 0; }

/* Solve panel */
.solve-panel details { margin-top: var(--space-2); }
.solve-panel summary { cursor: pointer; color: var(--color-text-muted); }
.solve-config { margin-top: var(--space-3); }
.solve-weight {
  display: flex; align-items: center; gap: var(--space-3);
  margin-bottom: 6px; max-width: 480px;
}
.solve-weight input[type="range"] { flex: 1; }
.solve-weight output { min-width: 24px; font-weight: 700; text-align: center; }

/* Phase 3: strips, lab, compare */
.strip-pick {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-3);
  display: flex; flex-wrap: wrap; gap: var(--space-2);
  max-width: 420px;
}
.strip-pick legend { font-weight: 700; padding: 0 6px; }
.lab-profile { display: block; width: 100%; }
.compare-win { background: var(--color-success-bg); color: var(--color-success-text); font-weight: 700; }
.req-advanced { text-decoration: none; font-size: .9rem; opacity: .6; }
@media (hover: hover) {
.req-advanced:hover { opacity: 1; }
}

/* ============================================================
   Cards — the standard content container across all three wings
   ============================================================ */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-4);
  overflow: hidden;
}
.card__head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 13px 17px;
  border-bottom: 1px solid var(--color-border);
  flex-wrap: wrap;
}
.card__head h2 { font-size: 1rem; margin: 0; }
.card__note {
  margin: 0;
  padding: 11px 17px 0;
  color: var(--color-text-muted);
  font-size: .84rem;
}
/* SEND-5 marker: the "בסבב" tab used to promise the system was handling
   these. When nothing has actually been sent that is a false reassurance,
   so the note stops being muted grey. */
.card__note--warn {
  color: var(--color-danger-text);
  font-weight: 600;
}
.card__empty {
  margin: 0;
  padding: var(--space-6) var(--space-4);
  text-align: center;
  color: var(--color-text-muted);
}

.legend {
  margin-inline-start: auto;
  display: flex;
  gap: var(--space-3);
  font-size: .76rem;
  color: var(--color-text-muted);
  flex-wrap: wrap;
}
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.dot { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.dot--covered { background: #86efac; }
.dot--round { background: #fcd34d; }
.dot--missing { background: #fda4af; }
.dot--untouched { background: #d6dbe6; }

/* ============================================================
   Dashboard (דורש טיפול) — the day at a glance
   ============================================================ */
.dash {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: var(--space-4);
  align-items: start;
}
.dash__main { min-width: 0; }
.dash__side { display: flex; flex-direction: column; gap: var(--space-4); position: sticky; top: var(--space-4); }

/* --- coverage grid --- */
.grid-scroll { overflow-x: auto; padding: var(--space-3) var(--space-4) var(--space-4); }
.cover-grid { width: 100%; margin: 0; box-shadow: none; border-collapse: separate; border-spacing: 4px; }
.cover-grid thead th {
  background: none;
  border: 0;
  padding: 0 0 4px;
  font-size: .76rem;
  color: var(--color-text-muted);
  font-weight: 600;
  text-align: center;
}
.cover-grid tbody th {
  background: none;
  border: 0;
  padding: 0 6px 0 0;
  font-size: .84rem;
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}
.cover-grid td { border: 0; padding: 0; }
.cover-grid .cell {
  display: block;
  min-width: 62px;
  height: 30px;
  line-height: 30px;
  border-radius: 8px;
  text-align: center;
  font-size: .78rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform .1s, filter .12s;
}
@media (hover: hover) {
.cover-grid a.cell:hover { transform: translateY(-1px); filter: brightness(.97); }
}
.cell--covered { background: #dcfce7; color: #047857; }
.cell--round { background: #fef3c7; color: #b45309; }
.cell--missing { background: #ffe4e6; color: #be123c; }
.cell--untouched { background: #eef0f5; color: #5b6472; }
.cell--none { background: #f6f8fc; }

/* --- tabs --- */
/* Tabs and the row filter share one bar, so the filter visibly belongs to the
   list it filters rather than looking like a global search. */
.queue-head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  border-bottom: 1px solid var(--color-border);
  padding-inline-end: var(--space-3);
}

.tabs {
  display: flex;
  gap: var(--space-1);
  padding: 0 var(--space-3);
  overflow-x: auto;
  flex: 1;
  min-width: 0;
}

.field-filter {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--color-bg-accent);
  border: 1px solid var(--color-border);
  border-radius: 9px;
  padding: 0 11px;
  color: var(--color-text-muted);
  flex-shrink: 0;
}
.field-filter .icon { width: 15px; height: 15px; vertical-align: 0; }
.field-filter input {
  border: 0;
  background: none;
  padding: 7px 0;
  font: inherit;
  font-size: .82rem;
  width: 145px;
  color: var(--color-text);
}
.field-filter input:focus { outline: none; }
.field-filter:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }

@media (max-width: 640px) {
  .queue-head { flex-wrap: wrap; padding-bottom: var(--space-2); }
  .field-filter { width: 100%; margin-inline-start: var(--space-3); }
  .field-filter input { width: 100%; }
}
.tab {
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  box-shadow: none;
  padding: 12px 14px;
  font-size: .89rem;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
@media (hover: hover) {
.tab:hover { color: var(--color-text); background: none; transform: none; }
}
.tab.is-active { color: var(--accent); border-bottom-color: var(--accent); }
.tab__n {
  background: var(--color-neutral-bg);
  color: var(--color-neutral-text);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: .74rem;
  font-weight: 700;
}
.tab__n--danger { background: var(--color-danger-bg); color: var(--color-danger-text); }
.tab-pane { display: none; }
.tab-pane.is-active { display: block; }

table.rows { margin: var(--space-3) 0 0; box-shadow: none; border-radius: 0; }
table.rows th { font-size: .74rem; }
.btn-row {
  display: inline-block;
  border: 1px solid var(--color-border-strong);
  background: var(--color-surface);
  color: var(--color-text);
  border-radius: 9px;
  padding: 5px 12px;
  font-size: .82rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: none;
  cursor: pointer;
}
@media (hover: hover) {
.btn-row:hover { background: var(--color-bg-accent); transform: none; }
}
.btn-row--go { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (hover: hover) {
.btn-row--go:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
}
.btn-row--danger { color: var(--color-danger-text); border-color: rgba(190, 18, 60, .3); }
@media (hover: hover) {
.btn-row--danger:hover { background: var(--color-danger-bg); }
}
.nowrap { white-space: nowrap; }
.muted { color: var(--color-text-muted); }

/* --- hero: the single next action --- */
.hero {
  background: linear-gradient(160deg, #1b2540, #0f1729);
  color: #fff;
  border-radius: var(--radius);
  padding: var(--space-5);
  box-shadow: var(--shadow-md);
}
.hero__kicker {
  display: block;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: #93a4c8;
  margin-bottom: var(--space-2);
}
.hero__title { font-size: 1.2rem; color: #fff; margin: 0 0 var(--space-2); }
.hero__text { margin: 0 0 var(--space-4); font-size: .87rem; color: #c3cbdd; line-height: 1.5; }
.hero__go {
  display: block;
  text-align: center;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  padding: 11px;
  border-radius: 11px;
  transition: background .15s;
}
@media (hover: hover) {
.hero__go:hover { background: var(--accent-hover); }
}
.hero--calm { background: linear-gradient(160deg, #10603f, #0b3f2b); }

/* --- day status --- */
.statebox { padding: var(--space-4); margin-bottom: 0; }
.statebox__head { display: flex; align-items: baseline; gap: var(--space-2); }
.statebox__head h2 { font-size: .95rem; margin: 0; }
.statebox__pct { margin-inline-start: auto; font-size: 1.3rem; color: var(--color-success-text); }
.statebar {
  display: flex;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--color-neutral-bg);
  margin: var(--space-3) 0;
}
.statebar__seg { height: 100%; }
.statebar__seg--covered { background: #10b981; }
.statebar__seg--round { background: #f59e0b; }
.statebar__seg--missing { background: #e11d48; }
.statebar__seg--untouched { background: #cbd5e1; }
.statebox__nums { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-2); text-align: center; }
.statebox__nums b { display: block; font-size: 1.25rem; color: var(--color-success-text); }
.statebox__nums span { font-size: .72rem; color: var(--color-text-muted); }
.statebox__nums .is-warn { color: var(--color-warning-text); }
.statebox__nums .is-danger { color: var(--color-danger-text); }
.statebox__nums .is-muted { color: var(--color-text-muted); }

.quicklinks { padding: var(--space-2); margin-bottom: 0; display: flex; flex-direction: column; }
.quicklinks a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--color-text);
  font-size: .87rem;
  font-weight: 600;
}
@media (hover: hover) {
.quicklinks a:hover { background: var(--color-bg-accent); }
}
.quicklinks .icon { color: var(--color-text-muted); }

@media (max-width: 1100px) {
  .dash { grid-template-columns: 1fr; }
  .dash__side { position: static; }
}

/* ============================================================
   Settings hub (אגף הארגון)
   ============================================================ */
.hub {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: var(--space-4);
}
.hub__sec {
  grid-column: 1 / -1;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--color-text-muted);
  margin: var(--space-3) 0 calc(-1 * var(--space-2));
}
.hub__sec:first-child { margin-top: 0; }

.tile {
  display: block;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--color-text);
  transition: transform .12s, box-shadow .18s, border-color .18s;
}
@media (hover: hover) {
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--accent); }
}
.tile__icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  margin-bottom: var(--space-3);
}
.tile__icon .icon { width: 20px; height: 20px; vertical-align: 0; }
.tile b { display: block; font-size: .95rem; margin-bottom: 3px; }
.tile > span:not(.tile__icon):not(.tag) { display: block; font-size: .82rem; color: var(--color-text-muted); line-height: 1.45; }
.tile .tag { margin-top: var(--space-3); display: inline-block; }

.tag {
  font-size: .74rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 10px;
  white-space: nowrap;
}
.tag--ok { background: var(--color-success-bg); color: var(--color-success-text); }
.tag--warn { background: var(--color-warning-bg); color: var(--color-warning-text); }
.tag--danger { background: var(--color-danger-bg); color: var(--color-danger-text); }

/* ---------- Master (whole-school) grid ---------- */
.master-toolbar { flex-wrap: wrap; }
.master-tabs { display: inline-flex; border: 1px solid var(--color-border-strong); border-radius: 999px; overflow: hidden; }
.master-tab {
  border: none; background: var(--color-surface); color: var(--color-text-muted);
  padding: 6px 16px; box-shadow: none; border-radius: 0; font-size: .9rem;
}
.master-tab--active { background: var(--color-primary); color: #fff; }

.master-grid { min-width: 640px; }
.master-grid th { position: sticky; background: var(--color-bg-accent); z-index: 1; }
.master-grid tr > th:first-child { right: 0; z-index: 2; }
.master-grid tr:first-child th { top: 0; z-index: 3; }
.master-grid .tt-cell { min-width: 92px; height: 46px; }
.master-grid .tt-lesson__title { font-size: .82rem; }
.master-grid .tt-lesson__sub { font-size: .74rem; }

.master-daysep td {
  background: var(--grad-brand); color: #fff; font-weight: 700;
  text-align: center; position: sticky; right: 0;
}

.master-grade-wrap { display: flex; flex-wrap: wrap; gap: var(--space-5); align-items: flex-start; }
.master-grade-block { flex: 0 0 auto; }
.master-grade-block h3 { margin: 0 0 var(--space-2); }
.master-grade-block .master-grid { min-width: 0; }

.master-placer { max-width: 300px; }
.master-placer button:not(.btn-link) {
  display: block; width: 100%; text-align: right; margin: 2px 0;
  background: var(--color-bg-accent); color: var(--color-text); box-shadow: none;
  border: 1px solid var(--color-border); font-size: .88rem; padding: 6px 10px;
}
.master-placer button:disabled { opacity: .5; }

/* ---------- Reporting: stats dashboard ---------- */
.stat-tiles { display: flex; flex-wrap: wrap; gap: var(--space-3); margin: var(--space-4) 0; }
.stat-tile {
  flex: 1 1 130px; background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius); padding: var(--space-4); box-shadow: var(--shadow-sm); text-align: center;
}
.stat-tile--warn { border-color: var(--color-warning-text); background: var(--color-warning-bg); }
.stat-tile__n { font-size: 1.8rem; font-weight: 700; color: var(--color-primary); }
.stat-tile--warn .stat-tile__n { color: var(--color-warning-text); }
.stat-tile__l { font-size: .82rem; color: var(--color-text-muted); }
td.over { color: var(--color-danger-text); font-weight: 700; }

.util-bar { display: inline-block; width: 200px; height: 12px; background: var(--color-bg-accent);
  border-radius: 999px; overflow: hidden; vertical-align: middle; }
.util-bar__fill { height: 100%; background: var(--grad-brand); }
.util-label { font-size: .82rem; color: var(--color-text-muted); margin-inline-start: var(--space-2); }

/* ---------- Reporting: printable timetables ---------- */
.print-toolbar {
  display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius); padding: var(--space-3) var(--space-4); margin-bottom: var(--space-4);
}
.print-page { margin-bottom: var(--space-6); }
.print-title { margin: 0 0 var(--space-2); }
.print-sub { color: var(--color-text-muted); font-weight: 400; font-size: .9rem; }
.print-grid { width: 100%; border-collapse: collapse; }
.print-grid th, .print-grid td {
  border: 1px solid var(--color-border-strong); padding: 4px 6px; text-align: center; vertical-align: top;
}
.print-grid th { background: var(--color-bg-accent); }
.print-period { font-weight: 700; white-space: nowrap; }
.print-time { font-weight: 400; font-size: .72rem; color: var(--color-text-muted); }
.print-off { background: var(--color-neutral-bg); }
.print-cell { padding: 1px 0; }
.print-cell__t { font-weight: 600; font-size: .86rem; }
.print-cell__s { font-size: .76rem; color: var(--color-text-muted); }
.print-cell--individual .print-cell__t, .print-cell--stay .print-cell__t { font-weight: 400; color: var(--color-text-muted); }

@media print {
  .ws-side, .ws-topbar, .app-header, .no-print { display: none !important; }
  .ws-shell { display: block; }
  .ws-main, .app-main { padding: 0; max-width: none; }
  .print-page { page-break-after: always; }
  .print-page:last-child { page-break-after: auto; }
  .print-grid th, .print-grid td { border-color: #000; }
  .print-title { page-break-after: avoid; }
  body { background: #fff; }
}

/* Bulk-save bar: stays reachable at the bottom of long edit tables. */
.sticky-save {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  position: sticky;
  bottom: 0;
  background: linear-gradient(to top, var(--color-bg) 55%, transparent);
  padding: var(--space-4) 0 var(--space-2);
  margin-top: var(--space-2);
  z-index: 5;
}

/* ישיבות צוות panel on the draft grid */
.meeting-answer { margin-top: 4px; }
.meeting-answer--ok { color: var(--color-success-text, #15803d); }
.meeting-answer--error { color: var(--color-danger-text); }
.meeting-answer--ask { color: var(--color-warning-text, #92400e); }

/* Grid drag-and-drop (master grid + the per-class editor) */
.tt-lesson--draggable { cursor: grab; }
.tt-lesson--draggable:active { cursor: grabbing; }
.tt-lesson--dragging { opacity: .45; }
.tt-cell--drop { outline: 2px dashed var(--color-primary); outline-offset: -2px; background: var(--color-primary-bg); position: relative; }
/* A drop the editor will refuse: another class's column. Offered visibly and
   then refused with a sentence, because a cell that simply does not react
   teaches nothing - and this is the one gesture a grade view invites. */
.tt-cell--nodrop { outline-color: var(--color-danger-text); background: var(--color-danger-bg); }
.tt-cell--nodrop[data-drop-hint]::after { background: var(--color-danger-text); }
/* What releasing here will DO, on the cell under the cursor. The text is set
   on every dragover, so it follows the Shift key mid-drag; pointer-events
   stays off or the badge itself would swallow the drop. The master grid sets
   no data-drop-hint and is unaffected. */
.tt-cell--drop[data-drop-hint]::after {
  content: attr(data-drop-hint);
  position: absolute;
  inset-inline-start: 3px;
  bottom: 3px;
  z-index: 3;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--color-primary);
  color: #fff;
  font-size: .68rem;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
}

/* Claude advisor (Phase 4) */
.advisor-usage__row { display: flex; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.advisor-usage__bar { height: 10px; border-radius: 6px; background: var(--color-border); overflow: hidden; margin-top: 8px; }
.advisor-usage__fill { height: 100%; background: var(--color-primary); transition: width .3s; }
.advisor-usage__fill--hot { background: var(--color-danger-text); }
.advisor-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; margin-bottom: 20px; }
.advisor-msg { border: 1px solid var(--color-border); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; background: var(--color-surface); }
.advisor-msg--assistant { border-inline-start: 4px solid var(--color-primary); }
.advisor-msg__meta { font-size: .85em; color: var(--color-text-muted); margin-bottom: 6px; }
.advisor-msg__body { white-space: pre-wrap; line-height: 1.55; }
.advisor-wishes .checkbox-label { display: block; margin: 4px 0; }

/* ============================================================
   TEAM BOARD (הלוח) — the fourth wing, plus the portal's view.
   Category colours are shared by both sides on purpose, so what
   the coordinator publishes is what the teacher recognises:
     event=teal, deadline=orange, task=violet.
   ============================================================ */
.bd-form label { font-size: .9em; }
.bd-form__row { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-bottom: 8px; }
.bd-team-pick { display: inline-flex; align-items: center; gap: 5px; background: var(--color-primary-bg); border-radius: 8px; padding: 5px 10px; font-size: .88em; }
.bd-month { font-size: 1.02em; margin: 20px 0 8px; color: var(--color-text-muted); }
.bd-ev {
  display: flex; align-items: center; gap: 12px;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-inline-start: 4px solid var(--color-border);
  border-radius: 10px; padding: 10px 12px; margin-bottom: 8px;
  text-decoration: none; color: inherit;
}
@media (hover: hover) {
.bd-ev:hover { border-color: var(--color-primary); }
}
.bd-ev--event    { border-inline-start-color: #0d9488; }
.bd-ev--deadline { border-inline-start-color: #ea580c; }
.bd-ev--task     { border-inline-start-color: #7c3aed; }
.bd-ev--closure  { border-inline-start-color: #16a34a; }
.bd-ev__date { min-width: 64px; text-align: center; display: flex; flex-direction: column; }
.bd-ev__date small { color: var(--color-text-muted); font-size: .78em; }
.bd-ev__body { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.bd-ev__body small { color: var(--color-text-muted); }
.bd-chip { border-radius: 999px; padding: 3px 10px; font-size: .78em; font-weight: 600; }
.bd-chip--event    { background: #ccfbf1; color: #115e59; }
.bd-chip--deadline { background: #ffedd5; color: #9a3412; }
.bd-chip--task     { background: #ede9fe; color: #5b21b6; }
.bd-chip--closure  { background: #dcfce7; color: #14532d; }
.bd-items li { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--color-border); }
.bd-members { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---- portal side (.pt- prefix, scoped like the rest of the portal) ---- */
.pt-ev {
  border: 1px solid var(--color-border);
  border-inline-start: 4px solid var(--color-border);
  border-radius: 12px; padding: 10px 12px; margin-bottom: 10px;
  background: #fff;
}
.pt-ev--event    { border-inline-start-color: #0d9488; }
.pt-ev--deadline { border-inline-start-color: #ea580c; }
.pt-ev--task     { border-inline-start-color: #7c3aed; }
.pt-ev--closure  { border-inline-start-color: #16a34a; }
.pt-ev__top { display: flex; align-items: center; gap: 12px; }
.pt-ev__date { min-width: 56px; text-align: center; display: flex; flex-direction: column; }
.pt-ev__date b { font-size: 1.05em; }
.pt-ev__date small { color: var(--color-text-muted); font-size: .75em; }
.pt-ev__body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pt-ev__body small { color: var(--color-text-muted); font-size: .82em; }
.pt-ev__chip { border-radius: 999px; padding: 3px 10px; font-size: .75em; font-weight: 700; align-self: flex-start; }
.pt-ev__chip--event    { background: #ccfbf1; color: #115e59; }
.pt-ev__chip--deadline { background: #ffedd5; color: #9a3412; }
.pt-ev__chip--task     { background: #ede9fe; color: #5b21b6; }
.pt-ev__chip--closure  { background: #dcfce7; color: #14532d; }
.pt-ev__list { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--color-border); }
.pt-check { margin: 0; }
.pt-check__btn {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: none; border: none; padding: 7px 2px; cursor: pointer;
  font-size: .95em; text-align: start; color: inherit; border-radius: 8px;
}
@media (hover: hover) {
.pt-check__btn:hover { background: var(--color-primary-bg); }
}
.pt-check__box {
  width: 22px; height: 22px; border-radius: 6px; flex-shrink: 0;
  border: 2px solid var(--color-border); display: grid; place-items: center;
  font-size: .85em; color: #fff; background: #fff;
}
.pt-check__btn.is-done .pt-check__box { background: #0d9488; border-color: #0d9488; }
.pt-check__btn.is-done span:last-child { text-decoration: line-through; color: var(--color-text-muted); }
.pt-ev__progress { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.pt-ev__progress small { color: var(--color-text-muted); white-space: nowrap; }
.pt-ev__bar { flex: 1; height: 6px; border-radius: 999px; background: var(--color-primary-bg); overflow: hidden; }
.pt-ev__bar span { display: block; height: 100%; border-radius: 999px; background: var(--pt-accent, #7e22ce); }


/* Per-grade priority panel for an external substitute (/teachers/phones).
   Wraps rather than scrolls: six selects fit on a laptop and stack on a
   phone, and the whole panel lives inside one table cell. */
.grade-priority {
  display: flex; flex-wrap: wrap; gap: var(--space-3);
  padding: var(--space-3) 0 var(--space-2);
}
.grade-priority label {
  display: flex; align-items: center; gap: 6px;
  font-size: .92em; color: var(--color-text-muted);
}
.grade-priority select { font-size: .95em; }

/* ---- ארגז חול: problems and suggestions ------------------------------ */
.problem-list { list-style: none; padding: 0; margin: var(--space-3) 0; }
.problem {
  padding: var(--space-2) var(--space-3); margin-bottom: 4px;
  border-radius: var(--radius); border-inline-start: 4px solid transparent;
  background: var(--color-bg-accent); font-size: .95em;
}
.problem__tag { font-size: .78em; font-weight: 700; margin-inline-end: 6px; }
.problem--error { border-inline-start-color: var(--color-danger-text); }
.problem--error .problem__tag { color: var(--color-danger-text); }
.problem--warning { border-inline-start-color: var(--color-warning-text); }
.problem--warning .problem__tag { color: var(--color-warning-text); }
.problem--note { border-inline-start-color: var(--color-text-muted); }
.problem--note .problem__tag { color: var(--color-text-muted); }

/* Anchored to the share so it cannot cover the cell being edited. */
.suggest-box {
  position: absolute; z-index: 20; min-width: 210px; max-width: 280px;
  background: var(--color-bg); border: 1px solid var(--color-border);
  border-radius: var(--radius); box-shadow: var(--shadow-md);
  padding: 4px; font-size: .85em; text-align: start;
}
.sb-edit { position: relative; }
.suggest-item {
  display: block; width: 100%; text-align: start; background: none;
  border: 0; box-shadow: none; padding: 6px 8px; border-radius: 6px;
  cursor: pointer; color: var(--color-text); font-weight: 600; font-size: .9rem;
}
@media (hover: hover) {
.suggest-item:hover { background: var(--color-primary-bg); filter: none; box-shadow: none; }
}
.suggest-item small { display: block; color: var(--color-text-muted); font-weight: 400; font-size: .82rem; }

/* ---------- .btn / .btn-primary ----------
   These two were USED by the sandbox screens and defined nowhere, so every
   `<a class="btn">` rendered as a bare link - which is why the buttons read as
   unclear. `<button>` already had the filled pill from the element selector
   above; anchors inherited none of it.

   Defined here in the vocabulary the app already speaks (.btn-secondary is the
   outlined pill, the base `button` is the filled one) rather than as a second
   parallel system, and .btn-small - which already existed - is the size
   modifier for both. */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  text-decoration: none; cursor: pointer;
  background: var(--color-surface);
  color: var(--color-primary);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 8px 16px;
  font-family: inherit; font-weight: 600; font-size: .9rem; line-height: 1.2;
  box-shadow: none;
  transition: background .15s, border-color .15s, color .15s, transform .1s;
}
@media (hover: hover) {
.btn:hover { background: var(--color-primary-bg); border-color: var(--color-primary); }
}
.btn:active { transform: translateY(1px); }

/* The filled one. Only ever ONE per screen - it is the action the page is
   for, and a second filled pill next to it makes neither of them the answer. */
.btn.btn-primary, a.btn-primary {
  background: var(--grad-brand); border-color: transparent; color: #fff;
  font-weight: 700;
  box-shadow: 0 3px 10px rgba(79, 70, 229, .25);
}
@media (hover: hover) {
.btn.btn-primary:hover, a.btn-primary:hover {
  filter: brightness(1.07); box-shadow: 0 5px 14px rgba(79, 70, 229, .32);
  background: var(--grad-brand); border-color: transparent;
}
}
.btn.btn-danger {
  background: var(--color-surface); border-color: rgba(190, 18, 60, .4);
  color: var(--color-danger-text);
}
@media (hover: hover) {
.btn.btn-danger:hover { background: var(--color-danger-bg); border-color: var(--color-danger-text); }
}
.btn[disabled], .btn:disabled, button[disabled] { opacity: .5; cursor: not-allowed; filter: none; }
/* .btn-small predates .btn and sits EARLIER in this file, so at equal
   specificity .btn wins and the modifier silently does nothing. Two classes
   here, so the size modifier actually modifies. */
.btn.btn-small { padding: 5px 12px; font-size: .84rem; }

/* ---- ארגז חול: the staffing board -----------------------------------
   Three problems this layout is answering, all reported from real use:
   the board did not fit on a large monitor, reaching it took scrolling
   past two full tables, and the one button she comes back to ("החלה")
   sat above all of it where nobody looks for a final action. So: the
   action bar sticks, the grid comes first, and everything that REPORTS
   on the grid is collapsed underneath it. */

.sb-bar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap;
  padding: var(--space-3) 0; margin-bottom: var(--space-3);
  background: var(--color-bg); border-bottom: 1px solid var(--color-border);
}
.sb-bar__grow { flex: 1 1 auto; }
.sb-bar__sep { width: 1px; align-self: stretch; background: var(--color-border); }
.sb-bar__more { display: flex; gap: 4px; flex-wrap: wrap; }

.sb-chip {
  display: inline-block; padding: 3px 11px; border-radius: 999px;
  font-size: .82rem; font-weight: 700; white-space: nowrap;
  letter-spacing: -.01em; border: 1px solid transparent;
  background: var(--color-bg-accent); color: var(--color-text-muted);
}
.sb-chip--error { background: var(--color-danger-bg); color: var(--color-danger-text); border-color: rgba(190,18,60,.3); }
.sb-chip--warn  { background: var(--color-warning-bg); color: var(--color-warning-text); border-color: rgba(180,83,9,.3); }
.sb-chip--ok    { background: var(--color-success-bg); color: var(--color-success-text); border-color: rgba(4,120,87,.25); }

/* The grid scrolls inside its own box, so the PAGE stays short whatever the
   school's size. Both headers stick, because a cell with no class name and no
   subject name above it is unreadable at 15 columns. */
.sb-grid-wrap {
  max-height: calc(100vh - 210px); max-height: calc(100dvh - 210px); min-height: 320px;
  overflow: auto; border: 1px solid var(--color-border);
  border-radius: var(--radius); background: var(--color-bg);
}
.sb-grid {
  display: grid;
  /* One statement for every column width - which is what makes 15 classes
     fit. The subject column is fixed; the rest share what is left but never
     go under 104px, below which "6 · כהן רות" stops being readable. */
  grid-template-columns: 126px repeat(var(--sb-cols, 15), minmax(88px, 1fr));
  min-width: max-content;
}
.sb-grid > * {
  border-inline-end: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  min-width: 0;
}
.sb-head, .sb-subject, .sb-corner { background: var(--color-bg-accent); font-weight: 700; font-size: .85em; }
.sb-head {
  position: sticky; top: 0; z-index: 2;
  padding: 6px 8px; text-align: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sb-subject {
  position: sticky; inset-inline-start: 0; z-index: 3;
  padding: 6px 10px; text-align: start;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sb-corner { position: sticky; top: 0; inset-inline-start: 0; z-index: 4; padding: 6px 10px; }

.sandbox-cell { position: relative; padding-bottom: 2px; }
.sandbox-cell--split { background: var(--color-warning-bg); }

/* A share is TEXT until she clicks it. Cloning one <template> instead of
   rendering a <select> per cell is what makes 15 classes fit at all. */
.sb-share {
  display: flex; align-items: baseline; gap: 5px; cursor: pointer;
  padding: 4px 7px; border-bottom: 1px dashed transparent; font-size: .86em;
}
@media (hover: hover) {
.sb-share:hover { background: var(--color-bg-accent); }
}
.sb-share b { font-size: 1.05em; }
.sb-share .sb-who {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--color-text-muted);
}
.sb-share--editing { background: var(--color-bg-accent); cursor: default; }
.sb-edit { display: flex; gap: 3px; width: 100%; }
.sb-edit .req-hours { width: 3em; padding: 2px 4px; }
.sb-edit .req-teacher { flex: 1 1 auto; min-width: 0; font-size: .95em; padding: 2px; }

/* Only on hover/focus: an always-visible + in 300 cells is noise, and it was
   an entire second editable row per cell before. */
.sb-add {
  display: block; width: 100%; cursor: pointer;
  border: 1px dashed var(--color-border); background: none; box-shadow: none;
  border-radius: var(--radius-sm, 6px);
  color: var(--color-text-muted); font-size: .95rem; font-weight: 700;
  line-height: 1.3; padding: 1px 0; margin-top: 1px;
  opacity: 0; transition: opacity .12s, color .12s, border-color .12s;
}
.sandbox-cell:hover .sb-add, .sb-add:focus { opacity: 1; }
.sb-add:hover { background: var(--color-primary-bg); color: var(--color-primary);
                border-color: var(--color-primary); filter: none; box-shadow: none; }

.sb-hint { margin-top: var(--space-2); font-size: .88em; }

/* Collapsed by default - she asked for a list that opens and closes, and the
   summary carries the count so closing it never hides a blocker's existence.

   The summary is a real heading, not a line of body text: these four rows are
   the page's whole table of contents once the grid is on screen, and at body
   weight they read as paragraphs and get skimmed past. */
.sb-panel {
  border: 1px solid var(--color-border); border-radius: var(--radius);
  margin-top: var(--space-3); background: var(--color-bg);
  overflow: hidden;
}
.sb-panel > summary {
  cursor: pointer; list-style: none;
  padding: var(--space-3) var(--space-4);
  display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap;
  font-size: 1.02rem; font-weight: 700; letter-spacing: -.01em;
  color: var(--color-text);
  background: var(--color-bg-accent);
  transition: background .15s;
}
.sb-panel > summary::-webkit-details-marker { display: none; }
/* A disclosure arrow of our own: the native marker is invisible at this
   weight and points the wrong way in RTL. */
.sb-panel > summary::before {
  content: "›"; display: inline-block; font-size: 1.25em; line-height: 1;
  color: var(--color-text-muted); transition: transform .15s;
  transform: rotate(180deg);
}
.sb-panel[open] > summary::before { transform: rotate(-90deg); }
@media (hover: hover) {
.sb-panel > summary:hover { background: var(--color-primary-bg); }
}
.sb-panel > summary strong { font-weight: 700; }
.sb-panel[open] > summary { border-bottom: 1px solid var(--color-border); }
.sb-panel > *:not(summary) { padding: var(--space-3) var(--space-4) var(--space-4); }
.sb-panel .table-scroll { max-height: 46vh; overflow: auto; padding: 0; margin: 0 var(--space-4) var(--space-4); }

/* Readable rows: the counter tables are numbers scanned in columns, so they
   get tabular figures and a touch more air than a prose table. */
.sb-panel .data-table { font-size: .92rem; }
.sb-panel .data-table th {
  position: sticky; top: 0; z-index: 1;
  background: var(--color-bg-accent);
  font-size: .8rem; font-weight: 700; letter-spacing: .01em;
  text-transform: none; white-space: nowrap; padding: 8px 10px;
}
.sb-panel .data-table td { padding: 7px 10px; font-variant-numeric: tabular-nums; }
.sb-panel .data-table tr:nth-child(even) td { background: var(--color-bg-accent); }
.sb-panel .problem-list { margin: 0; }
.sb-panel .problem { font-size: .94rem; line-height: 1.55; }

@media print {
  .sb-bar, .sb-add, .sb-hint { display: none; }
  .sb-grid-wrap { max-height: none; overflow: visible; border: 0; }
  .sb-panel { break-inside: avoid; }
}

/* Restored: these six live under the sandbox screens but are not the board,
   and they went out with the old board block. Each failure was silent - a
   green suite, no 500, just an unstyled destructive warning. */
.warn-box {
  background: var(--color-warning-bg);
  border: 1px solid rgba(180, 83, 9, .35);
  color: var(--color-warning-text);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  margin: var(--space-3) 0;
}
td.exact { color: var(--color-success-text); font-weight: 700; }
.error-text { color: var(--color-danger-text); font-weight: 600; }
.stack-form { display: flex; flex-direction: column; gap: var(--space-3); max-width: 480px; }
.stack-form label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
.stack-form .checkbox-row { flex-direction: row; align-items: center; gap: 8px; font-weight: 400; }

/* The in-app stand-in for the app-icon badge (2026-08-24). Chrome on Android
   has no Badging API at all, so on the commonest phone at this school this
   little number IS the badge - it is not decoration. Hidden at zero by the
   push client, never by CSS, so "no number" and "zero" cannot diverge. */
.pt-badge {
  display: inline-block;
  min-width: 1.25em;
  margin-inline-start: .3em;
  padding: 0 .35em;
  border-radius: 999px;
  background: var(--color-danger-solid);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* ייעוד שעות פרטניות — a collapsible card per type.
   The summary carries enough to decide whether to open it, so the state table
   above stays at the top of the page however many types the school defines. */
details.earmark-type > summary {
  cursor: pointer;
  list-style: none;
  padding: .15rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  align-items: baseline;
}
details.earmark-type > summary::-webkit-details-marker { display: none; }
/* The affordance, on the INLINE-START edge - this is an RTL page, so a marker
   pinned left would sit at the end of the line where nothing points at it. */
details.earmark-type > summary::before {
  content: "▸";
  color: var(--color-primary);
  font-size: .8em;
  transition: transform .12s ease;
  display: inline-block;
}
details.earmark-type[open] > summary::before { transform: rotate(-90deg); }
@media (hover: hover) {
details.earmark-type > summary:hover { color: var(--color-primary); }
}
details.earmark-type[open] > summary {
  margin-block-end: .6rem;
  border-block-end: 1px solid var(--color-border);
  padding-block-end: .5rem;
}
/* A deactivated type is still listed - rows published under its name must keep
   resolving - but it must not read as one that is in force. */
details.earmark-type[data-inactive] > summary { opacity: .6; }


/* ---- the strip screen's two helper panels (2026-08-27) ---------------- */
.strip-preview { margin: 1.5rem 0; }
.strip-preview-cards { display: flex; gap: 1rem; flex-wrap: wrap; }
.strip-preview-cards > .builder-card { flex: 1 1 22rem; min-width: 0; }
.strip-preview-table { width: 100%; border-collapse: collapse; }
.strip-preview-table th,
.strip-preview-table td { padding: 0.3rem 0.5rem; text-align: right; }
.strip-preview-table th { font-weight: 600; font-size: 0.85em; opacity: 0.75; }
.strip-preview-table tbody tr:nth-child(even) { background: rgba(0, 0, 0, 0.03); }
/* Stated LAST, and as `background-color` rather than the shorthand - the same
   two rules the grid's verdict paints had to learn, for the same reasons: a
   later, more specific row rule would otherwise win, and the shorthand would
   erase a background-image. */
.strip-preview-table td.preview-moved { background-color: #fff7e0; font-weight: 600; }
.strip-preview-table td.preview-warn { background-color: #fde8e8; font-weight: 600; }

/* What the save is about to refuse, said before the click (2026-08-28). It is
   NOT `.error-box`: that one is the answer to something she already did, and
   this is a warning about something she has not done yet. */
.preview-warnings {
  margin: 0.5rem 0 1rem;
  padding: 0.6rem 0.9rem;
  border-radius: 6px;
  background-color: var(--color-warning-bg, #fffbeb);
  border: 1px solid var(--color-warning-text, #92400e);
}
.preview-warnings ul { margin: 0.35rem 0 0; padding-inline-start: 1.2rem; }
.preview-warnings li { margin: 0.15rem 0; }

/* The panels' own explanation and colour key (2026-08-28). The terms the first
   version used - "נגרע לרצועות", "תרומת הרצועה הזו", "מחויב" - only parse if
   you have read `strip_quota`'s docstring, which the coordinator has not. */
.preview-howto { margin: 0 0 0.6rem; }
.preview-legend { margin-top: 0.8rem; }
.preview-key {
  display: inline-block;
  padding: 0.05rem 0.45rem;
  margin-inline-end: 0.2rem;
  border-radius: 4px;
  font-weight: 600;
}

/* The refusal, on the day that caused it (2026-08-28). A message naming
   "יום שלישי" at the top of a six-tile page leaves her to find the tile. */
.day-problem {
  display: inline-block;
  margin-inline-start: 0.6rem;
  padding: 0.1rem 0.5rem;
  border-radius: 4px;
  font-size: 0.85em;
  font-weight: 600;
  background-color: var(--color-danger-bg, #fef2f2);
  color: var(--color-danger-text, #991b1b);
}

/* The day tiles collapse (2026-08-28). Six always-open tiles on a
   twelve-teacher strip is ~360 selects on one page; the earmarks screen
   already answers this with <details> and a summary carrying the numbers. */
/* The box the <fieldset> used to draw for free. `earmarks.html` puts
   `builder-card` on its own <details> for the same reason. */
details.strip-day-tile {
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 6px;
  padding: 0.2rem 0.7rem;
  margin-bottom: 0.8rem;
}
details.strip-day-tile > summary {
  cursor: pointer;
  padding: 0.4rem 0.2rem;
  list-style-position: inside;
}
details.strip-day-tile > summary::-webkit-details-marker { margin-inline-end: 0.3rem; }
.day-summary {
  margin-inline-start: 0.6rem;
  font-size: 0.85em;
  opacity: 0.75;
}
details.strip-day-tile[open] > summary { border-bottom: 1px solid rgba(0,0,0,.08); }

/* חלוקה שונה לכל שכבה בתוך רצועה (2026-08-29). Declared LAST and with
   `background-color` rather than the shorthand, the rule the verdict paints
   in this file already carry. */
.strip-perclass { margin: 0.4rem 0 0.2rem; }
.strip-perclass__grade {
  border-inline-start: 3px solid rgba(0, 0, 0, 0.12);
  padding-inline-start: 0.6rem;
  margin-bottom: 0.5rem;
}
.strip-perclass__head {
  display: flex;
  gap: 0.6rem;
  align-items: baseline;
  margin-bottom: 0.2rem;
}
.strip-perclass__name {
  display: inline-block;
  min-width: 3.2rem;
  font-weight: 600;
}

/* A team block the auto-staffing script has marked `inert` (HEALTH-2026-08-30b
   P2-5). Browsers that implement `inert` already block pointer and keyboard
   interaction; this is the fallback for one that does not, so a dimmed control
   is never a control that still works. Deliberately NOT `disabled`: the strip
   screen's own `sync()` re-enables everything inside `[data-day-body]` at
   load, which is how that mitigation was silently undone once already. */
[data-team-block][inert] {
  pointer-events: none;
  user-select: none;
}

/* עריכה מתקדמת ברצועה. A `<details>` whose children keep POSTING while it is
   shut - see the comments in `strip_edit.html`. Styled as a quiet secondary
   affordance rather than a card, so the five fields above it stay the screen. */
.strip-adv {
  margin: .75rem 0;
  border-top: 1px solid var(--color-border, #ddd);
  padding-top: .5rem;
}
.strip-adv > summary {
  cursor: pointer;
  color: var(--color-primary);
  font-size: .92rem;
  padding: .25rem 0;
  list-style-position: inside;
}
.strip-adv[open] > summary { margin-bottom: .5rem; }

/* ---------- /timetable: the live timetable as tiles (day wing) ----------
   `dt-` and not `tt-`: the builder's grid owns `tt-grid` / `tt-cell`.
   Tile states come from app/timetable_view.STATE_LABELS. */
.dt-controls { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; margin-bottom: var(--space-4); }
.dt-seg { display: inline-flex; border: 1px solid var(--color-border-strong); border-radius: 999px; overflow: hidden; }
.dt-seg__item { padding: 6px 14px; cursor: pointer; font-size: .9rem; background: var(--color-surface); }
.dt-seg__item input { position: absolute; opacity: 0; pointer-events: none; }
.dt-seg__item + .dt-seg__item { border-inline-start: 1px solid var(--color-border-strong); }
.dt-seg__item.is-on { background: var(--color-primary); color: #fff; }
.dt-seg__item:focus-within { box-shadow: var(--shadow-focus); }
.dt-legend { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); list-style: none; padding: 0; margin: 0 0 var(--space-3); font-size: .85rem; }
.dt-legend li { display: inline-flex; align-items: center; gap: 6px; }
.dt-legend__swatch { display: inline-block; width: 18px; height: 14px; min-height: 0; padding: 0; margin: 0; }
.dt-grid { border-collapse: collapse; width: 100%; }
.dt-grid th, .dt-grid td { border: 1px solid var(--color-border); padding: 3px; vertical-align: top; }
.dt-grid thead th { position: sticky; top: 0; background: var(--color-surface); z-index: 1; font-size: .85rem; white-space: nowrap; }
.dt-grid__label { white-space: nowrap; font-size: .82rem; color: var(--color-neutral-text); }
/* The bell time under an hour number (row label, or column head in the
   "lines" orientation). Its own line, so "שעה 1" and "08:00" never run on. */
.dt-grid__time { display: block; font-size: .72rem; font-weight: 400; color: var(--color-text-muted); font-variant-numeric: tabular-nums; }
/* A phone: the controls were five rows of pills taking half the screen, and a
   pill's two words broke onto two lines ("לפי / כיתה"). Each group now keeps
   its words together and scrolls sideways inside itself if it must; printing
   from a phone is not a thing anybody does, so that button goes. */
@media (max-width: 640px) {
  .dt-controls { gap: 8px; margin-bottom: var(--space-3); padding: 12px; }
  .dt-controls > * { margin: 0; }
  .dt-seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .dt-seg::-webkit-scrollbar { display: none; }
  .dt-seg__item { white-space: nowrap; padding: 6px 9px; font-size: .8rem; flex: none; }
  .dt-controls > label { font-size: .9rem; }
  .dt-print { display: none; }
}
.dt-grid__group th { background: var(--color-neutral-bg); text-align: start; font-size: .9rem; }
.dt-grid td { min-width: 84px; }
/* Every class on one screen (owner, 2026-12-01: "לא רואים את כל הכיתות יחד").
   With fourteen class columns the 84px floor plus unbreakable labels like
   "רצוע.מקצ.ליב" pushed the board past the screen and the last classes sat
   behind a horizontal scroll. On a wide screen the columns now share the
   width evenly and a tile breaks a long label instead of widening its column.
   A phone keeps the scroll: fourteen columns in 375px is not a timetable. */
@media (min-width: 900px) {
  .dt-grid--wide { table-layout: fixed; }
  .dt-grid--wide thead th:first-child { width: 6rem; }
  .dt-grid--wide thead th, .dt-grid--wide .dt-grid__label { white-space: normal; overflow-wrap: anywhere; }
  .dt-grid--wide td { min-width: 0; }
  /* A floor, so a narrower laptop scrolls rather than squeezing a column to
     47px of unreadable tile. 64px a column fits fourteen in a 1400px window. */
  .table-scroll table.dt-grid--wide { min-width: calc(6rem + var(--dt-cols, 0) * 64px); }
  .dt-grid--wide .dt-tile { font-size: .72rem; padding: 2px 4px; }
  .dt-grid--wide th, .dt-grid--wide td { padding: 2px; }
}
.dt-tile { overflow-wrap: anywhere; }
.dt-tile { border-radius: var(--radius-sm); padding: 3px 6px; margin-bottom: 3px; font-size: .8rem; line-height: 1.25;
           background: var(--color-neutral-bg); border-inline-start: 4px solid var(--color-border-strong); }
.dt-tile:last-child { margin-bottom: 0; }
.dt-tile__subject { display: block; font-weight: 600; }
.dt-tile__who { display: block; color: var(--color-neutral-text); }
.dt-tile__note { display: block; font-size: .74rem; margin-top: 2px; }
.dt-tile--normal { background: var(--color-primary-bg); border-inline-start-color: var(--color-primary); }
/* פרטני / תפקיד and שהייה - a colour each, but only while nothing happened to the hour (Tile.look). */
.dt-tile--individual { background: #ecfccb; color: #3f6212; border-inline-start-color: #84cc16; }
.dt-tile--individual .dt-tile__who { color: #4d7c0f; }
.dt-tile--standby { background: #fce7f3; color: #9d174d; border-inline-start-color: #ec4899; }
.dt-tile--standby .dt-tile__who { color: #be185d; }
/* The repair panel on the by-date view (2026-10-21). A clickable tile says so; the open one is ringed. */
.dt-tile--clickable { cursor: pointer; }
.dt-tile--clickable:hover, .dt-tile--clickable:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 1px; }
.dt-tile.is-open { outline: 3px solid var(--color-primary); outline-offset: 1px; }
.fix-panel { position: fixed; inset-block: 0; inset-inline-start: 0; width: min(560px, 100vw); background: var(--color-surface, #fff); box-shadow: 0 0 24px rgba(0,0,0,.25); z-index: 60; display: flex; flex-direction: column; }
.fix-panel[hidden] { display: none; }
.fix-panel__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--color-border, #e5e7eb); }
.fix-panel__head button { font-size: 1.2rem; }
.fix-panel__body { overflow-y: auto; padding: var(--space-3) var(--space-4); flex: 1; }
.fix-panel__body h3 { margin-top: var(--space-3); font-size: 1rem; }
.fix-mark label { display: block; margin: var(--space-3) 0; }
/* The absence screen's buttons are pills sized for a wide page; in the narrow panel they wrapped into circles. */
.fix-panel__body { overflow-x: auto; }
.fix-panel__body td form.inline { display: block; margin: 2px 0; }
.fix-panel__body button.btn-secondary, .fix-panel__body button.btn-primary { font-size: .8rem; padding: 4px 10px; border-radius: var(--radius-sm) !important; }
.resolve-with-teacher { display: flex; flex-wrap: wrap; align-items: end; gap: var(--space-2) var(--space-3); margin: var(--space-3) 0; padding: var(--space-2) var(--space-3); border: 1px solid var(--color-border); border-radius: var(--radius-sm); }
.resolve-with-teacher > b { flex-basis: 100%; }
.resolve-with-teacher label { flex: 1 1 100%; }
.resolve-with-teacher select, .resolve-with-teacher input[type=text], .fix-panel__body select { width: 100%; max-width: 100%; }
.dt-tile--uncovered, .dt-tile--vacated { background: var(--color-danger-bg); color: var(--color-danger-text); border-inline-start-color: var(--color-danger-solid); }
.dt-tile--uncovered .dt-tile__who, .dt-tile--vacated .dt-tile__who { color: var(--color-danger-text); }
.dt-tile--covered { background: #ccfbf1; color: #0f766e; border-inline-start-color: #14b8a6; }
.dt-tile--merged { background: #f3e8ff; color: #7e22ce; border-inline-start-color: #a855f7; }
/* חונכות / משימה / משחק with a responsible teacher (fills.RESPONSIBLE, 2026-10-21). */
.dt-tile--responsible { background: #ffedd5; color: #c2410c; border-inline-start-color: #fb923c; }
/* An hour a CLASS has no lesson (stage 2b): the solution it was given, and -
   for the coordinator - the empty hour itself, quiet until hovered. */
.dt-tile--class_fix { background: #e0f2fe; color: #0369a1; border-inline-start-color: #38bdf8; }
.dt-tile--empty { background: transparent; color: var(--color-text-muted, #6b7280); border: 1px dashed #cbd5e1; border-inline-start-width: 1px; font-style: italic; }
.dt-tile--empty.dt-tile--clickable:hover { background: #f1f5f9; }
.class-fix form + form { margin-top: .5rem; }
.dt-tile--cover { background: #e0f2fe; color: #0369a1; border-inline-start-color: #0ea5e9; }
.dt-tile--resolved, .dt-tile--released { background: var(--color-warning-bg); color: var(--color-warning-text); border-inline-start-color: #f59e0b; }
.dt-tile--away { background: var(--color-neutral-bg); color: var(--color-neutral-text); border-inline-start-color: #9ca3af; text-decoration: line-through; }
@media print {
  .dt-tile { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .dt-grid thead th { position: static; }
  /* A wide grid (the whole school is 13-30 class columns) must not be
     clipped by the on-screen scroll box. */
  .table-scroll:has(.dt-grid) { overflow: visible; }
  .dt-grid td { min-width: 0; }
  .dt-grid { font-size: .7rem; }
}
/* A NAMED page, so only this table prints landscape - a bare @page would
   turn every printed sheet in the app (the daily sheet, payroll) sideways. */
.table-scroll:has(.dt-grid) { page: dt-landscape; }
@page dt-landscape { size: landscape; }

/* ============================================================
   בול בזמן (/sub) - the external substitutes' app.
   Same components as the teachers' portal, its own colour: teal, matching
   the manifest's theme-color, so a substitute never mistakes it for the
   staff app. The colour overrides are scoped to body.sub; the hour chips and
   the day/hour labels below are shared with the teachers' portal, whose
   substitutions screen is the same template (_substitutions_body.html).
   ============================================================ */
.portal.sub {
  --pt-accent: #0f766e;
  --pt-accent-hover: #115e59;
  --pt-accent-soft: #f0fdfa;
  --pt-accent-ring: rgba(15, 118, 110, .22);
  --color-primary: #0f766e;
  --color-primary-hover: #115e59;
  --color-primary-bg: #f0fdfa;
  --color-primary-ring: rgba(15, 118, 110, .22);
  background:
    radial-gradient(900px 380px at 80% -60px, rgba(15, 118, 110, .10), transparent 60%),
    var(--color-bg);
}
.sub .pt-brand__mark,
.sub .pt-signin__mark,
.sub .pt-btn--primary {
  background: linear-gradient(135deg, #14b8a6, var(--pt-accent) 60%, #115e59);
}
.sub .pt-brand__mark { box-shadow: 0 5px 14px rgba(15, 118, 110, .35); }
.sub .pt-signin__mark { box-shadow: 0 10px 24px rgba(15, 118, 110, .35); }
.sub .pt-btn--primary { box-shadow: 0 8px 20px rgba(15, 118, 110, .28); }
.sub .pt-card--primary { box-shadow: 0 10px 30px rgba(15, 118, 110, .10); }

/* The header's log-out: a small text button. The global `form` rule paints
   every form as a card, which turned this one-button form into a big white
   box in the corner of every screen. */
.sub .pt-header__out {
  margin: 0 auto 0 0; margin-inline-start: auto; padding: 0;
  background: none; border: 0; box-shadow: none;
}
.sub .pt-header__out .pt-btn {
  width: auto; min-height: 0; padding: 8px 12px; border: 0; background: none; box-shadow: none;
}

/* Home: the one number she opened the app for, large. */
.sub-hero { text-align: center; }
.sub-hero__hello { margin: 0 0 var(--space-1); font-size: 1.15rem; }
.sub-hero__count {
  font-size: 3rem; font-weight: 800; line-height: 1; color: var(--pt-accent);
  margin: var(--space-3) 0 var(--space-1);
}
.sub-hero__label { font-weight: 700; margin: 0 0 var(--space-4); }
.sub-hero--quiet .sub-hero__label { color: var(--color-text-muted); font-weight: 600; }

/* One coming hour: the day on top, the hour and class beneath. */
.sub-when { display: flex; flex-direction: column; gap: 2px; }
.sub-when__day { font-weight: 700; }
.sub-when__hour { color: var(--color-text-muted); font-size: .9rem; }
.sub-when__time { font-weight: 700; color: var(--pt-accent); }

/* Hours and days as big tappable buttons rather than bare checkboxes.
   The input stays in the DOM (visually hidden, still focusable and still
   submitted), so the forms post exactly what they posted before. */
.sub-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-3) 0; }
.sub-chip { position: relative; cursor: pointer; }
.sub-chip input {
  position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer;
}
.sub-chip span {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 84px; min-height: 52px; padding: 8px 14px;
  border: 1.5px solid var(--color-border); border-radius: 12px;
  background: var(--color-surface); color: var(--color-text);
  font-weight: 700; line-height: 1.2; text-align: center;
  transition: background .12s, border-color .12s, color .12s;
}
.sub-chip small { font-weight: 600; font-size: .78rem; color: var(--color-text-muted); }
/* Marked = filled, with a tick; unmarked = outline. A pale tint for "marked"
   read as the same state as unmarked on a phone in daylight. */
.sub-chip input:checked + span {
  background: var(--pt-accent); border-color: var(--pt-accent); color: #fff;
}
.sub-chip input:checked + span::before { content: "✓"; font-size: .85rem; line-height: 1; }
.sub-chip input:checked + span small { color: rgba(255, 255, 255, .88); }
.sub-chip input:focus-visible + span { box-shadow: 0 0 0 3px var(--pt-accent-ring); }
.sub-chips--days .sub-chip { flex: 1 1 calc(33% - var(--space-2)); }
.sub-chips--days .sub-chip span { min-width: 0; }

/* A day label ("מחר · יום שלישי 27/10 · שעה 3 (09:40) · כיתה ג1") is too
   long for .pt-list__key's nowrap on a phone; let these lists wrap. */
.pt-list--hours .pt-list__key { white-space: normal; }

.sub-actions { display: flex; flex-direction: column; gap: var(--space-2); }
.sub details > summary { cursor: pointer; font-weight: 700; color: var(--pt-accent); }

/* ---- בול בזמן, round 2 (2026-10-25) ---- */

/* "השעות הקרובות שלי" stands out from the cards around it (owner): a tinted
   panel with an accent edge, not one more white card. */
.sub-upcoming {
  background: linear-gradient(160deg, var(--pt-accent-soft), #ccfbf1);
  border-color: var(--pt-accent-ring);
  border-inline-start: 5px solid var(--pt-accent);
}
.sub-upcoming .pt-list li { border-bottom-color: var(--pt-accent-ring); }

/* Her confirmed hours (and her history): one block per day, one row per
   hour - the time on one side, the class in the middle, the button under. */
.sub-dayblock + .sub-dayblock { margin-top: var(--space-4); }
.sub-dayblock__title {
  margin: 0 0 var(--space-2); font-size: .95rem; font-weight: 800;
  color: var(--pt-accent); padding-bottom: 4px; border-bottom: 2px solid var(--pt-accent-ring);
}
.sub-hourlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.sub-hourrow {
  display: grid; grid-template-columns: auto 1fr; gap: 4px var(--space-3); align-items: center;
  padding: var(--space-3); border: 1px solid var(--color-border); border-radius: 12px;
  background: var(--color-surface);
}
.sub-hourrow__when {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 64px; padding: 6px 8px; border-radius: 10px;
  background: var(--pt-accent-soft); color: var(--pt-accent);
}
.sub-hourrow__period { font-weight: 800; }
.sub-hourrow__time { font-size: .82rem; font-weight: 700; }
.sub-hourrow__what { line-height: 1.45; }
/* A one-button form: undo the global `form` card rule, as in the header. */
.sub-hourrow__release {
  grid-column: 1 / -1; margin: 4px 0 0; padding: 0; background: none; border: 0; box-shadow: none;
}
.sub-hourrow--past .sub-hourrow__when { background: var(--color-neutral-bg); color: var(--color-text); }

/* "לצערי, בסוף לא אוכל" (owner): a real, visible button - outlined in the
   danger colour, because it undoes a commitment and starts a new search. */
.pt-btn.sub-release {
  background: var(--color-surface); color: var(--color-danger-text);
  border: 2px solid var(--color-danger-text); font-weight: 800; box-shadow: none;
}
@media (hover: hover) {
.pt-btn.sub-release:hover { background: var(--color-danger-bg); transform: none; }
}

/* History: month heading with its count. */
.sub-month { justify-content: space-between; }
.sub-month__count {
  font-size: .85rem; font-weight: 700; color: var(--pt-accent);
  background: var(--pt-accent-soft); padding: 2px 10px; border-radius: 999px;
}

/* Availability: each day a full-width button; its hour range under it. */
.sub-days { display: flex; flex-direction: column; gap: var(--space-2); margin: var(--space-3) 0; }
.sub-day .sub-chip { display: block; }
.sub-day .sub-chip span { min-height: 48px; }
.sub-day__hours {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2);
  margin-top: 6px; padding: var(--space-3); border-radius: 12px;
  background: var(--pt-accent-soft); border: 1px solid var(--pt-accent-ring);
}
.sub-day__hours[hidden] { display: none; }
.sub-day__hours label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; font-weight: 700; }
.sub-day__hours select { width: 100%; min-height: 42px; }

/* ---------- Portal navigation, 2026-11-24 ----------
   A plain link inside a card, the "other request" button, the absence form
   that opens in place, and "אני" in the header. */
.pt-link {
  display: inline-block;
  color: var(--pt-accent);
  font-weight: 600;
  font-size: .92rem;
  text-decoration: none;
  padding: 6px 0;
}
.pt-btn--secondary {
  background: var(--color-surface);
  color: var(--pt-accent);
  border: 1px solid var(--pt-accent-soft, var(--color-border));
  font-size: .95rem;
}
.pt-absence > .pt-absence__summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  font-weight: 800;
  font-size: 1.05rem;
  min-height: 44px;
}
.pt-absence > .pt-absence__summary::-webkit-details-marker { display: none; }
.pt-absence > .pt-absence__summary small { flex-basis: 100%; font-weight: 400; font-size: .85rem; color: var(--color-text-muted); }
.pt-absence[open] > .pt-absence__summary { margin-bottom: var(--space-3); }
.pt-tile--link {
  display: block;
  text-decoration: none;
  color: var(--color-text);
  margin-bottom: var(--space-2);
  padding: var(--space-4);
  border: 1px solid var(--pt-accent-ring, var(--color-border));
  border-radius: var(--radius);
}
.pt-user__me {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 6px 8px;
  border-radius: 10px;
  color: var(--color-text);
  text-decoration: none;
}
.pt-user__me.is-active { background: var(--pt-accent-soft); color: var(--pt-accent); }
/* A <details> tile carries the generic details margin; inside the grid the gap already spaces them. */
.pt-tiles > .pt-tile { margin: 0; }

/* ---- Draft editor (2026-11-25): the board higher, the status in words ---- */
.solve-status { margin: 6px 0 0; font-size: .95rem; color: var(--color-text, inherit); }
.solve-status:empty { display: none; }
.shortage-box > summary { cursor: pointer; list-style-position: inside; }
.shortage-box[open] > summary { margin-bottom: 6px; }
.grid-help { margin: 4px 0 8px; }
.grid-help > summary { cursor: pointer; font-size: .85rem; color: var(--color-text-muted, #64748b); }

/* The guard's "unsaved changes" note, beside the save button (form-guard.js). */
.sticky-save__status {
  color: var(--color-warning-text, #92400e);
  font-weight: 600;
  font-size: var(--text-sm, .9rem);
}
.sticky-save__status[hidden] { display: none; }
.sticky-save > .review-note { flex-basis: 100%; margin: 0; }
/* Inside a card the bar fades from the card, not from the page behind it. */
.builder-card .sticky-save { background: linear-gradient(to top, var(--color-surface) 55%, transparent); }
/* The takan total against the class's week (requirements.html). */
.req-verdict { font-size: var(--text-sm, .9rem); }
.req-verdict--ok { color: var(--color-success-text, #15803d); }
.req-verdict--bad { color: var(--color-danger-text); font-weight: 600; }

/* ---- Portal: absence report vs personal request, 2026-12-01 ----
   Two large choices instead of one form open on home. Stacked on a phone,
   side by side when there is room. */
.pt-choice { display: grid; gap: var(--space-3); }
@media (min-width: 560px) { .pt-choice { grid-template-columns: 1fr 1fr; } }
.pt-choice__item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 64px;
  padding: var(--space-4);
  border: 1px solid var(--pt-accent-ring, var(--color-border));
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
  text-decoration: none;
}
.pt-choice__item--absence { background: var(--pt-accent-soft); }
@media (hover: hover) { .pt-choice__item:hover { border-color: var(--pt-accent); } }
.pt-choice__icon { font-size: 1.6rem; line-height: 1; flex-shrink: 0; }
.pt-choice__text b { display: block; font-size: 1rem; }
.pt-choice__text small { display: block; color: var(--color-text-muted); font-size: .82rem; margin-top: 2px; }
.pt-callout--quiet { background: var(--color-surface); }
.pt-callout--quiet b { display: inline; }
.pt-today__next { margin: var(--space-2) 0 0; font-size: .95rem; }
/* A plain fold inside the today card, not a card of its own: the generic
   `details` rule gives it a border, a background and padding. */
.pt-today__more {
  margin: var(--space-2) 0 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
}
.pt-today__more > summary {
  cursor: pointer;
  color: var(--pt-accent);
  font-weight: 600;
  font-size: .92rem;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.pt-today__more .pt-sched { margin-top: var(--space-2); }

/* Thank-yous from the coordinator (appreciation phase 2) - above her own numbers. */
.heart-card__thanks { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.heart-card__thanks li { display: flex; gap: 8px; align-items: flex-start; background: #fdf0f5; border-radius: 10px; padding: 8px 10px; line-height: 1.5; }
.heart-card__thanks .icon { color: #d6336c; flex: none; margin-top: 3px; }
