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

:root {
  --bg: #F6F7F9;
  --surface: #FFFFFF;
  --surface-2: #F0F2F5;
  --text: #17212B;
  --text-2: #4F5B69;
  --border: #E1E4EA;
  --border-strong: #8A94A3;
  --primary: #245BDB;
  --primary-hover: #1C49B3;
  --primary-soft: #E8EEFC;
  --focus: #245BDB;
  --danger: #B3261E;
  --danger-soft: #FCEBEA;
  --todo: #B3261E;
  --todo-soft: #FCE4E2;
  --progress: #1C4AB8;
  --progress-soft: #DCE7FF;
  --waiting: #8F4700;
  --waiting-soft: #FFF0DD;
  --waiting-chip: #FFDFB0;
  --waiting-strong: #7A3E00;
  --waiting-accent: #E8710A;
  --done: #146B37;
  --done-soft: #E2F4E8;
  --radius: 12px;
  --radius-sm: 8px;
  --tap: 2.75rem;
  --shadow: 0 8px 28px rgb(23 33 43 / 0.14);
  --nav-height: 3.875rem;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { font-size: 100%; -webkit-text-size-adjust: 100%; }
html.modal-open { overflow: hidden; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Heebo', 'Segoe UI', 'Arial Hebrew', Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
h1, h2, h3, p { margin: 0; }
h1 { font-size: 1.625rem; font-weight: 700; line-height: 1.25; }
h2 { font-size: 1.0625rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 500; }
ul { margin: 0; padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--primary); }
img { max-width: 100%; }
svg.icon { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
[tabindex="-1"]:focus-visible { outline: none; }
[hidden] { display: none !important; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: absolute; inset-inline-start: 0.5rem; top: -4rem; z-index: 100; background: var(--surface); padding: 0.75rem 1rem; border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.skip-link:focus { top: 0.5rem; }
.noscript { padding: 2rem; text-align: center; }
.muted { color: var(--text-2); }
.small { font-size: 0.875rem; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.stack { display: flex; flex-direction: column; gap: 0.75rem; }
.stack > .btn { align-self: flex-start; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.spread { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; }
.grow { flex: 1 1 auto; min-width: 0; }

/* כפתורים */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: var(--tap); padding: 0.5rem 1rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-weight: 500; text-decoration: none; cursor: pointer; transition: background 0.12s, border-color 0.12s;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #8F1E18; border-color: #8F1E18; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--primary); }
.btn-ghost:hover { background: var(--primary-soft); }
.btn-small { min-height: 2.75rem; padding: 0.25rem 0.75rem; font-size: 0.9375rem; }
.btn-icon { width: var(--tap); padding: 0; flex: none; }
.btn-danger-text { color: var(--danger); }

/* שדות */
.field { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.field > label, .field > .label, legend.label { font-weight: 500; }
.field-hint { font-size: 0.875rem; color: var(--text-2); }
.field-error { font-size: 0.875rem; color: var(--danger); font-weight: 500; display: flex; gap: 0.25rem; align-items: flex-start; }
input[type='text'], input[type='email'], input[type='url'], input[type='search'], input[type='date'], input[type='time'], input[inputmode='numeric'], select, textarea {
  width: 100%; min-height: var(--tap); padding: 0.5rem 0.75rem;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
}
textarea { min-height: 6rem; resize: vertical; line-height: 1.5; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 0; border-color: var(--focus); border-radius: var(--radius-sm); }
[aria-invalid='true'] { border-color: var(--danger) !important; }
.check-row { display: flex; align-items: center; gap: 0.625rem; min-height: var(--tap); cursor: pointer; }
input[type='file'] { width: 100%; min-height: var(--tap); padding: 0.375rem; background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); }
.check-row input { width: 1.25rem; height: 1.25rem; flex: none; accent-color: var(--primary); margin: 0; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }

/* שלד אפליקציה */
.shell { display: grid; grid-template-columns: 15rem minmax(0, 1fr); min-height: 100dvh; }
.sidebar {
  position: sticky; top: 0; align-self: start; height: 100dvh; overflow-y: auto;
  background: var(--surface); border-inline-end: 1px solid var(--border);
  padding: 1rem 0.75rem; display: flex; flex-direction: column; gap: 1.25rem;
}
.workspace-name { display: flex; align-items: center; gap: 0.625rem; padding: 0.25rem 0.5rem; font-weight: 700; font-size: 1.0625rem; }
.logo { width: 2rem; height: 2rem; border-radius: 9px; background: var(--primary); color: #fff; display: grid; place-items: center; flex: none; }
.nav-list { display: flex; flex-direction: column; gap: 0.125rem; }
.nav-item {
  display: flex; align-items: center; gap: 0.625rem; min-height: var(--tap); padding: 0.375rem 0.625rem;
  border-radius: var(--radius-sm); color: var(--text); text-decoration: none; font-weight: 500;
}
.nav-item:hover { background: var(--surface-2); }
.nav-item[aria-current='page'] { background: var(--primary-soft); color: var(--primary-hover); }
.nav-group { font-weight: 400; }
.nav-heading { font-size: 0.8125rem; font-weight: 500; color: var(--text-2); padding: 0 0.625rem 0.25rem; }
.badge { margin-inline-start: auto; min-width: 1.375rem; padding: 0 0.375rem; border-radius: 999px; background: var(--primary); color: #fff; font-size: 0.8125rem; font-weight: 700; text-align: center; line-height: 1.375rem; }
.main-col { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem;
  background: var(--bg); padding: 0.75rem 1.5rem; border-bottom: 1px solid var(--border);
}
.topbar-title { display: none; font-weight: 700; font-size: 1.125rem; }
.top-search { position: relative; flex: 1 1 14rem; max-width: 28rem; min-width: 0; }
.top-search input { padding-inline-start: 2.5rem; }
.top-search svg { position: absolute; inset-inline-start: 0.75rem; top: 50%; transform: translateY(-50%); color: var(--text-2); pointer-events: none; }
.org-switch { display: flex; flex-wrap: wrap; gap: 0.125rem; padding: 0.125rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.org-switch button { min-height: var(--tap); padding: 0.25rem 0.875rem; border: 0; border-radius: 6px; background: none; color: var(--text-2); font-weight: 500; cursor: pointer; }
.org-switch button:hover { color: var(--text); }
.org-switch button[aria-pressed='true'] { background: var(--surface); color: var(--primary-hover); font-weight: 700; box-shadow: 0 1px 2px rgb(23 33 43 / 0.18); }
.org-slot { flex: 0 1 auto; min-width: 0; }
.search-toggle { display: none; }
.topbar-actions { display: flex; align-items: center; gap: 0.5rem; margin-inline-start: auto; }
.main { flex: 1 1 auto; width: 100%; max-width: 62rem; margin-inline: auto; padding: 1.5rem; display: flex; flex-direction: column; gap: 1.25rem; }
.main:focus { outline: none; }
.banner { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; padding: 0.625rem 1rem; font-weight: 500; }
.banner-offline { background: var(--waiting-soft); color: var(--waiting); }
.banner-info { background: var(--primary-soft); color: var(--primary-hover); border-radius: var(--radius-sm); }
.banner-warn { background: var(--waiting-soft); color: var(--waiting); border-radius: var(--radius-sm); }
.bottom-nav, .fab { display: none; }

/* תפריטים נפתחים */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-panel {
  position: absolute; z-index: 30; inset-inline-end: 0; top: calc(100% + 0.25rem); min-width: 13rem; max-width: min(20rem, calc(100vw - 2rem));
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 0.25rem;
}
.menu-item { display: flex; align-items: center; gap: 0.5rem; width: 100%; min-height: var(--tap); padding: 0.375rem 0.625rem; border: 0; border-radius: 6px; background: none; color: var(--text); text-align: start; text-decoration: none; cursor: pointer; }
.menu-item:hover { background: var(--surface-2); }
.menu-label { padding: 0.5rem 0.625rem; font-size: 0.875rem; color: var(--text-2); border-bottom: 1px solid var(--border); margin-bottom: 0.25rem; }
.avatar { width: 2.25rem; height: 2.25rem; border-radius: 50%; background: var(--primary-soft); color: var(--primary-hover); display: inline-grid; place-items: center; font-weight: 700; font-size: 0.9375rem; flex: none; object-fit: cover; }
.avatar-small { width: 1.75rem; height: 1.75rem; font-size: 0.8125rem; }
.user-button { display: inline-flex; border: 0; background: none; padding: 0.25rem; border-radius: 50%; min-width: var(--tap); min-height: var(--tap); align-items: center; justify-content: center; cursor: pointer; }

/* ראש מסך */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 0.75rem; }
.page-head h1:focus { outline: none; }

/* מונים */
/* יחידות יחסיות: בהגדלת טקסט המונים יורדים לשורה חדשה במקום לשבור מילה באמצע. */
.counters { display: grid; grid-template-columns: repeat(auto-fit, minmax(6rem, 1fr)); gap: 0.75rem; }
.counters-4 { grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); }
.counter {
  display: flex; flex-direction: column; align-items: flex-start; gap: 0.125rem; padding: 0.75rem 1rem; min-height: var(--tap);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); text-align: start; cursor: pointer; transition: border-color 0.12s;
}
.counter:hover { border-color: var(--border-strong); }
.counter[aria-pressed='true'] { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.counter-value { font-size: 1.75rem; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.counter-label { font-size: 0.9375rem; color: var(--text-2); }
.counter-danger .counter-value { color: var(--danger); }
.counter-waiting .counter-value { color: var(--waiting); }
.counter-done .counter-value { color: var(--done); }

/* מסננים */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.filters .filter-search { flex: 1 1 14rem; min-width: 0; max-width: 24rem; }
.filter > summary { display: inline-flex; align-items: center; gap: 0.375rem; min-height: var(--tap); padding: 0.25rem 0.75rem; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font-weight: 500; }
.filter > summary::after { content: ''; width: 0.5rem; height: 0.5rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.filter.is-active > summary { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-hover); }
.filter .menu-panel { inset-inline-end: auto; inset-inline-start: 0; padding: 0.25rem 0.5rem; max-height: 18rem; overflow-y: auto; }

/* אזורי רשימה */
.section { display: flex; flex-direction: column; gap: 0.5rem; }
.section-title { display: flex; align-items: center; gap: 0.5rem; color: var(--text); }
.section-count { font-size: 0.875rem; font-weight: 500; color: var(--text-2); }
.section-overdue .section-title { color: var(--danger); }
.task-list { display: flex; flex-direction: column; gap: 0.5rem; }
.done-area { border-top: 1px solid var(--border); padding-top: 0.75rem; }
.done-area > summary { display: flex; align-items: center; gap: 0.5rem; min-height: var(--tap); font-weight: 700; cursor: pointer; }
.done-area[open] > summary { margin-bottom: 0.5rem; }

/* כרטיס משימה */
.task-card {
  display: grid; grid-template-columns: var(--tap) minmax(0, 1fr); gap: 0 0.25rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.5rem 0.75rem 0.75rem 1rem;
  transition: border-color 0.12s, opacity 0.15s;
}
.task-card, .attention-row { content-visibility: auto; contain-intrinsic-size: auto 7.5rem; }
.task-card:hover { border-color: var(--border-strong); }
.task-card.is-pending { opacity: 0.7; }
.task-card.no-check { grid-template-columns: minmax(0, 1fr); padding-inline-start: 1rem; }
.check {
  width: var(--tap); height: var(--tap); display: grid; place-items: center; border: 0; background: none; padding: 0; cursor: pointer; color: var(--border-strong); border-radius: 50%;
}
.check-box { width: 1.5rem; height: 1.5rem; border: 2px solid currentColor; border-radius: 50%; display: grid; place-items: center; color: inherit; transition: background 0.12s; }
.check-box svg { width: 1rem; height: 1rem; opacity: 0; }
.check:hover { color: var(--done); }
.check:hover .check-box svg { opacity: 0.5; }
.check[aria-checked='true'] { color: var(--done); }
.check[aria-checked='true'] .check-box { background: var(--done); border-color: var(--done); }
.check[aria-checked='true'] .check-box svg { opacity: 1; color: #fff; }
.task-body { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; }
.task-title { font-weight: 500; font-size: 1.0625rem; line-height: 1.3; color: var(--text); text-decoration: none; display: inline-flex; align-items: center; min-height: var(--tap); }
.task-title:hover { color: var(--primary); text-decoration: underline; }
.task-card[data-status='done'] .task-title { color: var(--text-2); text-decoration: line-through; }
.task-meta { display: flex; flex-wrap: wrap; gap: 0 0.375rem; color: var(--text-2); font-size: 0.9375rem; }
.task-meta > span:not(:last-child)::after { content: '·'; margin-inline-start: 0.375rem; }
.task-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem; margin-top: 0.125rem; }
.chip { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.0625rem 0.5rem; border-radius: 999px; font-size: 0.875rem; font-weight: 500; background: var(--surface-2); color: var(--text-2); }
.chip svg { width: 0.9375rem; height: 0.9375rem; }
.chip-plain { background: none; padding-inline: 0.125rem; font-weight: 400; }
.status-todo { background: var(--todo-soft); color: var(--todo); }
.status-in_progress { background: var(--progress-soft); color: var(--progress); }
.status-waiting { background: var(--waiting-chip); color: var(--waiting-strong); }
.status-waiting .status-dot { background: var(--waiting-accent); }
.status-done { background: var(--done); color: #fff; font-weight: 700; }
.status-done svg { stroke-width: 3; }
.status-dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: currentColor; flex: none; }
.chip-high { background: var(--danger-soft); color: var(--danger); }
.chip-archived { background: var(--surface-2); color: var(--text-2); border: 1px dashed var(--border-strong); }
.task-note { display: flex; align-items: flex-start; gap: 0.375rem; font-size: 0.9375rem; margin-top: 0.125rem; }
.task-note svg { margin-top: 0.15em; }
.note-waiting { color: var(--waiting); }
.note-overdue { color: var(--danger); font-weight: 500; }
.saving-note { font-size: 0.875rem; color: var(--text-2); }

/* מצבים ריקים, טעינה ושגיאה */
.empty { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; padding: 2.5rem 1rem; text-align: center; background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.empty-icon { color: var(--text-2); }
.empty-icon svg { width: 2rem; height: 2rem; }
.empty .row { justify-content: center; }
.error-state { border-style: solid; border-color: var(--danger); }
.skeleton { display: flex; flex-direction: column; gap: 0.5rem; }
.skeleton-card { height: 5.25rem; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface-2), #FAFBFC, var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* דיאלוגים */
dialog { color: var(--text); padding: 0; border: 0; max-width: none; max-height: none; }
dialog::backdrop { background: rgb(23 33 43 / 0.45); }
.dialog { width: min(34rem, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.dialog[open] { display: flex; flex-direction: column; animation: rise 0.14s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.75rem 1rem 0.75rem 0.5rem; border-bottom: 1px solid var(--border); flex: none; }
.dialog-head h2 { font-size: 1.125rem; }
.dialog-body { padding: 1rem; overflow-y: auto; display: flex; flex-direction: column; gap: 1rem; flex: 1 1 auto; min-height: 0; }
.dialog-foot { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0.75rem 1rem; border-top: 1px solid var(--border); flex: none; padding-bottom: calc(0.75rem + var(--safe-bottom)); }
.dialog-foot .btn-primary, .dialog-foot .btn-danger { order: -1; }
.dialog-wide { width: min(46rem, calc(100vw - 2rem)); }

.panel { margin: 0; margin-inline-start: auto; width: min(48rem, 100vw); height: 100dvh; max-height: 100dvh; background: var(--bg); box-shadow: var(--shadow); overflow: hidden; }
.panel[open] { display: flex; flex-direction: column; animation: slide 0.16s ease-out; }
@keyframes slide { from { opacity: 0.4; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.5rem 0.75rem; background: var(--surface); border-bottom: 1px solid var(--border); flex: none; }
.panel-body { flex: 1 1 auto; overflow-y: auto; padding: 1.25rem; display: flex; flex-direction: column; gap: 1rem; min-height: 0; }

/* הודעות קופצות */
.toasts { position: fixed; z-index: 90; inset-inline: 1rem; bottom: calc(1rem + var(--safe-bottom)); display: flex; flex-direction: column; align-items: center; gap: 0.5rem; pointer-events: none; }
.toast { pointer-events: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; max-width: min(32rem, 100%); padding: 0.5rem 1rem; min-height: 3rem; background: #1F2A36; color: #fff; border-radius: var(--radius-sm); box-shadow: var(--shadow); animation: rise 0.14s ease-out; }
.toast-error { background: #8F1E18; }
.toast .btn-toast { min-height: var(--tap); border: 0; background: none; color: #B9CDFB; font-weight: 700; text-decoration: underline; cursor: pointer; padding: 0.25rem 0.5rem; }
.toast-error .btn-toast { color: #fff; }

/* פרטי משימה */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; display: flex; flex-direction: column; gap: 0.75rem; }
.card > h2 { display: flex; align-items: center; gap: 0.5rem; }
.detail-title { font-size: 1.375rem; font-weight: 700; line-height: 1.3; }
.detail-title:focus { outline: none; }
.meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr)); gap: 0.75rem; margin: 0; }
.meta-grid dt { font-size: 0.875rem; color: var(--text-2); }
.meta-grid dd { margin: 0; font-weight: 500; }
.rich-text p { margin: 0 0 0.625rem; white-space: pre-wrap; }
.rich-text p:last-child { margin-bottom: 0; }
.status-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.status-select { width: auto; flex: 0 1 11rem; }
.blocker { display: flex; flex-direction: column; gap: 0.125rem; background: var(--waiting-soft); color: var(--waiting); padding: 0.75rem 1rem; border-radius: var(--radius-sm); }
.blocker strong { font-weight: 700; }
.overdue-box { background: var(--danger-soft); color: var(--danger); padding: 0.5rem 1rem; border-radius: var(--radius-sm); font-weight: 500; }
.step-row { display: flex; align-items: center; gap: 0.25rem; border-bottom: 1px solid var(--border); }
.step-row:last-child { border-bottom: 0; }
.step-row .check-row { flex: 1 1 auto; min-width: 0; }
.step-row.is-done .step-text { color: var(--text-2); text-decoration: line-through; }
.add-row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: flex-end; }
.add-row .field { flex: 1 1 12rem; }
.file-row { display: flex; align-items: center; gap: 0.5rem; padding: 0.25rem 0; border-bottom: 1px solid var(--border); }
.file-row:last-child { border-bottom: 0; }
.file-row a { font-weight: 500; display: inline-flex; align-items: center; min-height: var(--tap); }
.comment { display: flex; flex-direction: column; gap: 0.25rem; padding: 0.75rem 0; border-bottom: 1px solid var(--border); }
.comment:first-child { padding-top: 0; }
.comment:last-child { border-bottom: 0; }
.comment-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.comment-author { font-weight: 700; }
.comment-body { white-space: pre-wrap; }
.comment-removed { color: var(--text-2); font-style: italic; }
.mention { color: var(--primary-hover); background: var(--primary-soft); border-radius: 4px; padding: 0 0.1875rem; font-weight: 500; }
.composer { position: relative; display: flex; flex-direction: column; gap: 0.5rem; }
.mention-list { position: absolute; z-index: 5; inset-inline-start: 0; bottom: calc(100% - 1.5rem); min-width: 12rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 0.25rem; max-height: 12rem; overflow-y: auto; }
.mention-option { display: block; width: 100%; min-height: var(--tap); padding: 0.375rem 0.625rem; border: 0; border-radius: 6px; background: none; text-align: start; cursor: pointer; }
.mention-option[aria-selected='true'], .mention-option:hover { background: var(--primary-soft); }
.activity-item { display: flex; flex-wrap: wrap; gap: 0 0.5rem; padding: 0.375rem 0; font-size: 0.9375rem; border-bottom: 1px solid var(--border); }
.activity-item:last-child { border-bottom: 0; }
.activity-time { color: var(--text-2); font-size: 0.875rem; }
.collapsible > summary { display: flex; align-items: center; gap: 0.5rem; min-height: var(--tap); font-weight: 700; cursor: pointer; }
.more-details { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 0.75rem; }
.more-details[open] { padding-bottom: 0.75rem; }
.more-details > summary { display: flex; align-items: center; gap: 0.5rem; min-height: var(--tap); font-weight: 500; cursor: pointer; color: var(--primary-hover); }
.more-details-body { display: flex; flex-direction: column; gap: 1rem; padding-top: 0.5rem; }

/* טופס משימה */
.audience { display: flex; align-items: flex-start; gap: 0.375rem; font-size: 0.9375rem; color: var(--text-2); background: var(--surface-2); padding: 0.5rem 0.625rem; border-radius: 6px; }
.audience svg { margin-top: 0.15em; }
.quick-dates { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.quick-dates .btn[aria-pressed='true'] { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-hover); }
.date-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 0.5rem; }
.step-draft { display: flex; align-items: center; gap: 0.25rem; }
.step-draft span { flex: 1 1 auto; min-width: 0; }
.segmented { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.segmented label { display: inline-flex; align-items: center; gap: 0.375rem; min-height: var(--tap); padding: 0.25rem 0.75rem; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); cursor: pointer; }
.segmented input { accent-color: var(--primary); width: 1.125rem; height: 1.125rem; margin: 0; }
.segmented label:has(input:checked) { background: var(--primary-soft); border-color: var(--primary); }
.segmented label:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }

/* קבוצות */
.group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 0.75rem; }
.group-card { display: flex; flex-direction: column; gap: 0.5rem; padding: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; color: var(--text); transition: border-color 0.12s; }
.group-card:hover { border-color: var(--primary); }
.group-card-title { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 1.0625rem; }
.group-card.is-static:hover { border-color: var(--border); }
.post-list { display: flex; flex-direction: column; gap: 0.75rem; list-style: none; margin: 0; padding: 0; }
.post-program { font-size: 1.0625rem; font-weight: 700; overflow-wrap: anywhere; }
.post-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.group-stats { display: flex; flex-wrap: wrap; gap: 0.25rem 0.875rem; font-size: 0.9375rem; color: var(--text-2); }
.group-stats .is-late { color: var(--danger); font-weight: 500; }
.lock-chip { display: inline-flex; align-items: center; gap: 0.25rem; font-size: 0.875rem; font-weight: 500; color: var(--text-2); }
.invite-note { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.75rem 1rem; background: var(--primary-soft); border-radius: var(--radius); }
.people-line { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.5rem; }
.person-pill { display: inline-flex; align-items: center; gap: 0.375rem; font-size: 0.9375rem; }
.tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--border); }
.tab { min-height: var(--tap); padding: 0.375rem 1rem; border: 0; border-bottom: 3px solid transparent; background: none; font-weight: 500; color: var(--text-2); cursor: pointer; }
.tab[aria-selected='true'] { color: var(--primary-hover); border-bottom-color: var(--primary); }
.view-toggle { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.view-toggle button { min-height: var(--tap); padding: 0.25rem 0.875rem; border: 0; background: var(--surface); cursor: pointer; display: inline-flex; gap: 0.375rem; align-items: center; }
.view-toggle button[aria-pressed='true'] { background: var(--primary-soft); color: var(--primary-hover); font-weight: 500; }
.member-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; padding: 0.625rem 0; border-bottom: 1px solid var(--border); }
.member-row:last-child { border-bottom: 0; }
.member-info { flex: 1 1 11rem; min-width: 0; }
.member-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.member-actions select { width: auto; }

/* לוח */
.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.75rem; align-items: start; }
.board-col { display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; background: var(--surface-2); border-radius: var(--radius); padding: 0.625rem; min-height: 9rem; }
.board-col.is-over { outline: 2px dashed var(--primary); outline-offset: -2px; }
.board-col h3 { display: flex; align-items: center; gap: 0.375rem; font-weight: 700; }
.board-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.625rem; display: flex; flex-direction: column; gap: 0.375rem; }
.board-card[draggable='true'] { cursor: grab; }
.board-card[data-status='todo'] { border-inline-start: 4px solid var(--todo); }
.board-card[data-status='in_progress'] { border-inline-start: 4px solid var(--progress); }
.board-card[data-status='waiting'] { border-inline-start: 4px solid var(--waiting-accent); }
.board-card[data-status='done'] { border-inline-start: 4px solid var(--done); background: var(--done-soft); }
.board-card .task-title { font-size: 0.9375rem; }
.board-card select { font-size: 0.9375rem; }

/* מעקב */
.attention-row { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; padding: 0.75rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.attention-info { flex: 1 1 16rem; min-width: 0; display: flex; flex-direction: column; gap: 0.125rem; }
.people-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.people-table th, .people-table td { padding: 0.25rem 0.75rem; text-align: start; border-bottom: 1px solid var(--border); }
.people-table thead th { font-size: 0.875rem; font-weight: 500; color: var(--text-2); padding-block: 0.625rem; }
.people-table tr:last-child td, .people-table tr:last-child th { border-bottom: 0; }
.people-table tbody th { font-weight: 500; }
.num-link { min-width: var(--tap); min-height: var(--tap); border: 0; background: none; color: var(--primary); text-decoration: underline; font-variant-numeric: tabular-nums; font-weight: 500; cursor: pointer; padding: 0 0.25rem; border-radius: 6px; }
.num-link:hover { background: var(--primary-soft); }
.num-link.is-zero { color: var(--text-2); text-decoration: none; font-weight: 400; }
.num-link.is-late { color: var(--danger); }
.toolbar { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: flex-end; }
.result-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; }

/* התראות */
.note-item { display: flex; align-items: flex-start; gap: 0.5rem; padding: 0.5rem 0.75rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.note-item.is-unread { border-color: var(--primary); box-shadow: inset -3px 0 0 var(--primary); }
.note-main { flex: 1 1 auto; min-width: 0; min-height: var(--tap); display: flex; flex-direction: column; justify-content: center; border: 0; background: none; text-align: start; color: inherit; text-decoration: none; cursor: pointer; padding: 0.125rem 0; }
.note-main:hover .note-text { text-decoration: underline; }
.note-text { font-weight: 500; }
.is-unread .note-text { font-weight: 700; }
.note-new { font-size: 0.8125rem; font-weight: 700; color: var(--primary-hover); }

/* הגדרות */
.prefs-table { width: 100%; border-collapse: collapse; }
.prefs-table th, .prefs-table td { padding: 0.25rem 0.5rem; text-align: start; border-bottom: 1px solid var(--border); }
.prefs-table thead th { font-size: 0.875rem; font-weight: 500; color: var(--text-2); }
.prefs-table tbody th { font-weight: 400; }
.prefs-table input { width: 1.25rem; height: 1.25rem; accent-color: var(--primary); }
.prefs-table label { display: inline-grid; place-items: center; min-width: var(--tap); min-height: var(--tap); cursor: pointer; }
.more-links { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.more-links .menu-item { min-height: 3.25rem; padding-inline: 1rem; border-radius: 0; border-bottom: 1px solid var(--border); }
.more-links .menu-item:last-child { border-bottom: 0; }
.help h2 { margin-top: 0.5rem; }
.help ol, .help ul { margin: 0; padding-inline-start: 1.25rem; list-style: revert; display: flex; flex-direction: column; gap: 0.25rem; }

/* כניסה */
.auth-page { min-height: 100dvh; display: grid; place-items: center; padding: 1rem; }
.auth-card { width: min(26rem, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.75rem; display: flex; flex-direction: column; gap: 1rem; }
.auth-brand { display: flex; align-items: center; gap: 0.625rem; font-weight: 700; color: var(--text-2); }
.auth-card h1 { font-size: 1.5rem; }
.auth-card form { display: flex; flex-direction: column; gap: 1rem; }
.code-input { letter-spacing: 0.4em; font-size: 1.25rem; text-align: center; font-variant-numeric: tabular-nums; }
.dev-note { font-size: 0.9375rem; background: var(--waiting-soft); color: var(--waiting); padding: 0.625rem 0.75rem; border-radius: var(--radius-sm); }
.dev-note a { color: inherit; font-weight: 700; }
.invite-facts { display: grid; gap: 0.25rem; margin: 0; }
.invite-facts div { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.invite-facts dt { color: var(--text-2); }
.invite-facts dd { margin: 0; font-weight: 500; }
.boot { min-height: 100dvh; }

/* תיבת דואר לבדיקה */
.mailbox main { max-width: 42rem; margin: 0 auto; padding: 1.5rem 1rem; display: flex; flex-direction: column; gap: 1rem; }
.mailbox-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.mailbox-item pre { white-space: pre-wrap; font: inherit; margin: 0; }
.mailbox-to { color: var(--text-2); font-size: 0.875rem; }

/* טלפון */
@media (max-width: 47.99rem) {
  .shell { display: block; padding-bottom: calc(var(--nav-height) + var(--safe-bottom)); }
  .sidebar { display: none; }
  .topbar { padding: 0.5rem 1rem; gap: 0.5rem; flex-wrap: wrap; }
  .topbar-title { display: block; flex: 1 1 auto; min-width: 0; }
  .org-slot { order: 4; flex: 1 1 100%; }
  .org-switch button { flex: 1 1 auto; }
  .topbar-new { display: none; }
  .top-search { display: none; order: 5; flex: 1 1 100%; max-width: none; }
  .top-search.is-open { display: block; }
  .search-toggle { display: inline-flex !important; }
  .topbar-actions { margin-inline-start: 0; }
  .main { padding: 1rem 1rem calc(5rem + var(--safe-bottom)); gap: 1rem; }
  /* בטלפון הכותרת מופיעה בראש המסך. כאן היא נשארת לקורא מסך ולמיקוד בלבד. */
  .page-head h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .bottom-nav {
    position: fixed; z-index: 20; inset-inline: 0; bottom: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    background: var(--surface); border-top: 1px solid var(--border); padding-bottom: var(--safe-bottom);
  }
  .bottom-item { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.0625rem; min-height: var(--nav-height); color: var(--text-2); text-decoration: none; font-size: 0.8125rem; font-weight: 500; }
  .bottom-item svg { width: 1.5rem; height: 1.5rem; }
  .bottom-item[aria-current='page'] { color: var(--primary); font-weight: 700; }
  .bottom-item .badge { position: absolute; top: 0.25rem; inset-inline-start: calc(50% + 0.375rem); margin: 0; }
  .fab {
    position: fixed; z-index: 21; inset-inline-start: 1rem; bottom: calc(var(--nav-height) + var(--safe-bottom) + 0.75rem); display: inline-flex;
    min-height: 3.25rem; padding-inline: 1.125rem; border-radius: 999px; box-shadow: var(--shadow);
  }
  .toasts { bottom: calc(var(--nav-height) + var(--safe-bottom) + 0.75rem); }
  dialog .toasts, .dialog .toasts, .panel .toasts { bottom: calc(1rem + var(--safe-bottom)); }
  .counters { gap: 0.5rem; }
  .counter { padding: 0.625rem 0.75rem; }
  .counter-value { font-size: 1.5rem; }
  .board { grid-template-columns: minmax(0, 1fr); }
  .board-col { min-height: 0; }
  .filters .filter-search { flex-basis: 100%; max-width: none; }
  .filter .menu-panel { position: fixed; inset-inline: 1rem; top: auto; bottom: calc(var(--nav-height) + var(--safe-bottom) + 0.5rem); max-width: none; max-height: 50dvh; }

  .dialog-full, .panel { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border-radius: 0; }
  .panel-body { padding: 1rem; }
  .dialog-body { padding: 1rem; }

  /* טבלת אנשים הופכת לכרטיסים: בלי גלילה אופקית ברוחב 360 */
  .people-table, .people-table tbody { display: block; background: none; border: 0; }
  .people-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .people-table tr { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.5rem 0.625rem; margin-bottom: 0.5rem; }
  .people-table tbody th { grid-column: 1 / -1; border: 0; padding: 0 0 0.25rem; font-weight: 700; }
  .people-table td { display: flex; flex-direction: column; align-items: center; border: 0; padding: 0; text-align: center; }
  .people-table td::before { content: attr(data-label); font-size: 0.75rem; color: var(--text-2); line-height: 1.2; min-height: 1.8em; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
