:root {
  --navy: #1f3a5f;
  --navy-dark: #16293f;
  --accent: #a07f36;        /* זהב — לכותרות גדולות בלבד (טקסט גדול) */
  --accent-dark: #8a6b2e;   /* זהב כהה — לטקסט רגיל ולכפתורים (יחס ניגודיות 4.97) */
  --accent-lite: #d9b45c;   /* זהב בהיר — על רקע כחול כהה (יחס ניגודיות 5.81) */
  --bg: #f2f4f7;
  --card: #ffffff;
  --line: #d5dce4;
  --text: #1d2733;
  --muted: #5b6a80;
  --ok: #157042;
  --err: #b3373d;
  --warn-bg: #fdf3e3;
  --warn-line: #e2c186;
  /* גובה הסרגל העליון — זהה בכל רוחב מסך. כל רכיב דביק שנשען עליו
     (לשוניות המקטעים, כותרות טבלה) מחושב ממנו. */
  --topbar-h: 56px;
}
* { box-sizing: border-box; }
img { max-width: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Segoe UI", "Arial Hebrew", Arial, sans-serif; font-size: 15px;
}
/* קישורים בתוך טקסט מסומנים בקו תחתי ולא בצבע בלבד (ת"י 5568 / WCAG 1.4.1).
   רכיבי ניווט וכפתורים, שצורתם מזהה אותם ממילא, פטורים מכך. */
a { color: var(--navy); text-decoration: underline; }
a:hover { text-decoration: underline; }
.topbar nav a, .btn, .gate, .cust-pcard, .gate-cta, .skip-link,
details.adder summary, details.editwrap summary, .a11y-menu .opt,
.pcard a.btn, .toolbar a.btn, .sitefoot .sep { text-decoration: none; }

/* ---------- נגישות: מיקוד מקלדת גלוי (ת"י 5568 / WCAG 2.4.7) ---------- */
:focus { outline: 3px solid var(--accent-dark); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }
:focus-visible { outline: 3px solid var(--accent-dark); outline-offset: 2px; }
.topbar :focus-visible, .btn:focus-visible {
  outline: 3px solid var(--accent-lite); outline-offset: 2px;
}

/* דילוג לתוכן — הקישור הראשון בעמוד, נגלה רק בהגעת מיקוד המקלדת */
.skip-link {
  position: absolute; right: -9999px; top: 0; z-index: 500;
  background: var(--navy); color: #fff; padding: 10px 18px;
  border-radius: 0 0 8px 8px; font-size: 15px; font-weight: 600;
}
.skip-link:focus { right: 12px; text-decoration: none; color: #fff; }

/* הסרגל העליון נשאר בראש החלון בגלילה, בגובה אחד קבוע */
header.topbar {
  background: var(--navy); color: #fff; padding: 0 22px;
  display: flex; align-items: center; gap: 18px; min-height: var(--topbar-h);
  position: sticky; top: 0; z-index: 260;   /* מעל הודעות המערכת (250) */
  box-shadow: 0 1px 6px rgba(16,30,54,.18);
}
/* הניווט ופריטי הקצה (עמוד הבית, הארגון, המשתמש, יציאה) יושבים במעטפת
   אחת: במסך רחב היא שורה אחת, ובמסך צר — תפריט מתקפל (ראו בהמשך) */
.topbar .topnav { display: flex; align-items: center; gap: 18px; flex: 1; min-width: 0; }
.topbar .topbar-end { display: flex; align-items: center; gap: 14px; flex: none; }
.topbar .orglink { color: #c8d4e2; font-size: 12px; text-decoration: none; }
.topbar .orglink, .topbar .melink, .topbar .topbar-end select {
  max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* כשהשורה צרה — שם הארגון מתקצר (…) לפני שמשהו עולה על משהו: הניווט אינו
   מתכווץ, ופריטי הקצה מתכווצים רק דרך שם הארגון / בורר הארגון */
.topbar .topbar-end { flex: 0 1 auto; min-width: 0; }
.topbar .topbar-end > * { flex: none; }
.topbar .topbar-end > .orglink, .topbar .topbar-end > form { flex: 0 1 auto; min-width: 3em; }
.topbar .topbar-end > form select { max-width: 100%; }
.topbar .melink { text-decoration: none; }
.topbar .melink b { color: #fff; }
.topbar .logout { color: #c8d4e2; font-size: 13px; }
.navtoggle { display: none; }
.topbar .brand { font-size: 18px; font-weight: 700; letter-spacing: .3px; }
.topbar .brand span { color: var(--accent-lite); }
.topbar nav { display: flex; gap: 2px; flex: 1 0 auto; flex-wrap: nowrap; min-width: 0; align-items: center; }
.topbar nav a, .navmenu > summary {
  color: #dce6f2; padding: 6px 11px; border-radius: 6px; font-size: 14px;
  white-space: nowrap;
}
.topbar nav a:hover, .topbar nav a.active,
.navmenu > summary:hover, .navmenu[open] > summary, .navmenu.active > summary {
  background: var(--navy-dark); color: #fff; text-decoration: none;
}
.topbar nav a.active, .navmenu.active > summary { box-shadow: inset 0 -2px 0 var(--accent-lite); }
/* מונה פריטים ממתינים שליד פריט ניווט */
.navcount {
  background: var(--err); color: #fff; border-radius: 9px; padding: 0 6px;
  font-size: 11px; margin-inline-start: 3px;
}
/* תפריט נפתח בסרגל — מרכז את מסכי ניהול המערכת, כדי שהסרגל יישאר שורה אחת */
.navmenu { position: relative; }
.navmenu > summary { list-style: none; cursor: pointer; display: block; }
.navmenu > summary::-webkit-details-marker { display: none; }
.navmenu > summary::after { content: " ▾"; font-size: 11px; }
.navmenu-panel {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 210;
  background: var(--navy); border: 1px solid rgba(255,255,255,.18);
  border-radius: 8px; padding: 6px; min-width: 200px;
  display: flex; flex-direction: column; gap: 2px;
  box-shadow: 0 8px 24px rgba(16,30,54,.35);
}
.topbar nav .navmenu-panel a { display: block; }
/* קבוצות בתוך התפריט: למנהל המערכת — ניהול הארגון וניהול המערכת זה לצד זה */
.navmenu-panel.two { flex-direction: row; align-items: flex-start; gap: 0 8px; }
.navmenu-group { display: flex; flex-direction: column; gap: 2px; min-width: 190px; }
.navmenu-group + .navmenu-group {
  border-inline-start: 1px solid rgba(255,255,255,.18); padding-inline-start: 8px;
}
.navmenu-title {
  color: var(--accent-lite); font-size: 12px; font-weight: 600;
  padding: 6px 11px 4px; white-space: nowrap;
}
.topbar .co { color: #c8d4e2; font-size: 13px; }
.topbar .spacer { flex: 1; }
/* וריאנט הכפתור לרקע הכחול של הסרגל — אותה צורה, אותו גובה */
.btn.ghost {
  background: transparent; color: #fff; border-color: rgba(255, 255, 255, .55);
}
.btn.ghost:hover { background: rgba(255, 255, 255, .14); border-color: #fff; color: #fff; }

main { max-width: 1180px; margin: 24px auto 60px; padding: 0 18px; }

/* הודעות מערכת צפות — נראות תמיד, גם כשהעמוד קופץ למדור מסוים */
.flash {
  padding: 10px 44px 10px 16px; border-radius: 8px; margin-bottom: 14px; font-size: 14px;
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%);
  z-index: 250; max-width: min(680px, 92vw);
  box-shadow: 0 6px 20px rgba(16,30,54,.25);
}
.flash + .flash { top: 64px; }
body.has-topbar .flash { top: calc(var(--topbar-h) + 10px); }
body.has-topbar .flash + .flash { top: calc(var(--topbar-h) + 60px); }
body.has-topbar .flash + .flash + .flash { top: calc(var(--topbar-h) + 110px); }
/* סגירת ההודעה בידי המשתמש — ההודעות אינן נעלמות מעצמן (WCAG 2.2.1) */
.flash .x {
  position: absolute; top: 4px; left: 8px; background: none; border: 0;
  font-size: 18px; line-height: 1; cursor: pointer; color: inherit;
  padding: 4px 6px; border-radius: 5px; font-family: inherit;
}
.flash .x:hover { background: rgba(0,0,0,.08); }
.flash.ok { background: #e5f3ec; border: 1px solid #bcdccb; color: var(--ok); }
.flash.err { background: #fbe9ea; border: 1px solid #ecc4c6; color: var(--err); }
.flash.warn { background: var(--warn-bg); border: 1px solid var(--warn-line); color: #8a6118; }
.flash + .flash + .flash { top: 114px; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 18px 20px; margin-bottom: 18px; box-shadow: 0 1px 2px rgba(16,30,54,.05);
}
.card.center { text-align: center; }
.card h2 { margin: 0 0 12px; font-size: 17px; color: var(--navy); }
.card h3 { margin: 0 0 8px; font-size: 15px; color: var(--navy); }

.pagehead { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.pagehead h1 { margin: 0; font-size: 22px; color: var(--navy); }
.pagehead .spacer { flex: 1; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 6px; }

/* ---------- כפתורים ----------
   קו עיצובי אחיד לכל האתר. שלושה גוונים בלבד, ולכל אחד תפקיד קבוע:
     .btn         כחול מלא   — הפעולה העיקרית של המסך
     .btn.sec     מסגרת כחולה — פעולה משנית, ופעולות בתוך טבלאות
     .btn.danger  מסגרת אדומה — מחיקה וביטול (.danger.solid לאישור סופי)
   שלושה גדלים: .sm (בתוך טבלאות), רגיל, .lg (קריאה לפעולה מרכזית).
   הגובה אחיד בכל הווריאנטים: המסגרת נספרת בתוך המידה (border-box)
   ו-min-height קבוע, כך שכפתור עם מסגרת וכפתור מלא יוצאים זהים. */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--navy); color: #fff; border: 1px solid var(--navy);
  padding: 0 18px; min-height: 38px; border-radius: 7px;
  font-size: 14px; line-height: 1.25; font-family: inherit; font-weight: 600;
  text-align: center; cursor: pointer; vertical-align: middle;
  align-self: center;   /* בתוך שורת flex — לא נמתח לגובה השדה שלצידו */
  transition: background .15s ease, border-color .15s ease;
}
.btn:hover { background: var(--navy-dark); border-color: var(--navy-dark);
             text-decoration: none; color: #fff; }
.btn.sec { background: #fff; color: var(--navy); border-color: var(--navy); }
.btn.sec:hover { background: #eef2f7; color: var(--navy); }
.btn.danger { background: #fff; color: var(--err); border-color: var(--err); }
.btn.danger:hover { background: #fbe9ea; color: var(--err); }
.btn.danger.solid { background: var(--err); color: #fff; border-color: var(--err); }
.btn.danger.solid:hover { background: #94272c; border-color: #94272c; color: #fff; }
.btn.sm { min-height: 28px; padding: 0 11px; font-size: 13px; font-weight: 500; }
.btn.lg { min-height: 46px; padding: 0 30px; font-size: 16px; }
.btn[disabled], .btn.disabled { opacity: .55; pointer-events: none; }

/* מעטפת הגלילה של הטבלאות (base.html עוטף בה כל טבלה): במסך צר הטבלה
   נגללת לצדדים בתוכה במקום להרחיב את העמוד. כשהיא אכן גוללת היא מקבלת
   מיקוד מקלדת (tabindex) ורמז ויזואלי בקצה. */
.tscroll { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tscroll.is-scroll {
  background:
    linear-gradient(to left, rgba(16,30,54,.10), rgba(16,30,54,0) 14px) left / 16px 100% no-repeat;
  border-radius: 4px;
}
.tscroll.is-scroll > table { min-width: max-content; }
table.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
table.grid th {
  background: #e8edf2; color: var(--navy); text-align: right; padding: 7px 10px;
  border: 1px solid var(--line); font-size: 13px;
}
table.grid td { padding: 7px 10px; border: 1px solid var(--line); vertical-align: middle; }
table.grid tr:nth-child(even) td { background: #fafbfc; }
tr.cancelled td { color: #646d7a; text-decoration: line-through; background: #f6f6f6 !important; }
tr.cancelled td .keep { text-decoration: none; }
/* יומן הפעולות: לחיצה על הפעולה מציגה את אישור ביצועה. הקישור נשאר בצבע
   הטקסט כדי שהיומן ייקרא כטבלה ולא כרשימת קישורים, והסימון מתחתיו מתגלה
   בריחוף ובמיקוד המקלדת. */
a.act-cert { color: inherit; text-decoration: none; cursor: pointer; }
a.act-cert:hover, a.act-cert:focus { text-decoration: underline; color: var(--navy); }

.badge {
  display: inline-block; border-radius: 20px; padding: 2px 10px; font-size: 12px;
}
.badge.warn { background: var(--warn-bg); border: 1px solid var(--warn-line); color: #8a6118; }
.badge.ok { background: #e5f3ec; border: 1px solid #bcdccb; color: var(--ok); }
.badge.muted { background: #eef1f5; border: 1px solid var(--line); color: var(--muted); }
.badge.demo { background: #ece9f7; border: 1px solid #c8c0e8; color: #5b4a9e; }

.warnbox {
  background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 8px;
  padding: 10px 16px; margin-bottom: 14px; font-size: 14px; color: #7a5614;
}
.warnbox ul { margin: 6px 0 0; padding-right: 18px; }

form.inline { display: inline; }
.formgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(210px, 100%), 1fr)); gap: 12px 16px; }
.formgrid.wide { grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); }
label.f { display: block; font-size: 13px; color: var(--muted); }
label.f b { display: block; color: var(--text); font-weight: 600; margin-bottom: 4px; font-size: 13px; }
input[type=text], input[type=password], input[type=number], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px;
  font-family: inherit; font-size: 14px; background: #fff;
}
input:focus, select:focus, textarea:focus {
  outline: 3px solid var(--accent-dark); outline-offset: 1px; border-color: var(--navy);
}
/* שורת פעולות: כל הכפתורים על אותו קו בסיס, ובאותו מרווח ביניהם */
.formactions {
  margin-top: 16px; display: flex; gap: 10px;
  align-items: center; flex-wrap: wrap;
}
.formactions.center { justify-content: center; }
.formactions.end { justify-content: flex-start; }

details.adder { margin-top: 10px; }
/* פתיחת טופס הוספה היא פעולה — ולכן לחצן (משני), לא קישור */
details.adder summary {
  cursor: pointer; color: var(--navy); font-weight: 600; font-size: 14px;
  list-style: none; display: inline-flex; align-items: center; gap: 4px;
  min-height: 34px; padding: 0 14px; background: #fff;
  border: 1px solid var(--navy); border-radius: 7px;
}
details.adder summary::-webkit-details-marker { display: none; }
details.adder summary:hover, details.adder[open] summary { background: #eef2f7; }
details.adder summary::before { content: "+"; color: var(--accent-dark); font-weight: 700; }
details.adder .inner {
  border: 1px dashed var(--line); border-radius: 8px; padding: 14px; margin-top: 6px;
  background: #fafbfd;
}

.section { margin-top: 22px; }
.section > h2 {
  font-size: 16px; color: var(--navy); border-bottom: 2px solid var(--navy);
  padding-bottom: 5px; margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
/* כפתורי הפעולה של המדור נצמדים לקצה, ותמיד באותו מקום ובאותו גובה */
.section > h2 .sec-actions { margin-inline-start: auto; display: flex; gap: 8px; }
summary.btn { list-style: none; }
summary.btn::-webkit-details-marker { display: none; }
summary.btn::marker { content: ""; }
.checkline { display: flex; align-items: center; gap: 8px; font-size: 14px; padding: 3px 0; }
.checkline input { width: auto; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(330px, 100%), 1fr)); gap: 16px; }
/* כרטיסים זה לצד זה: גובה שווה, והכפתור של כולם על אותו קו — גם כשאורך
   הטקסט שמעליו שונה. הכפתור יושב ב-.card-cta שנדחף לתחתית הכרטיס. */
.cards > .card, .cards > .pcard { display: flex; flex-direction: column; margin-bottom: 0; }
.card-body { flex: 1; }            /* בולע את ההפרש באורך הטקסט */
.card-cta { padding-top: 14px; display: flex; justify-content: center; }
.card-note { margin: 10px 0 0; }
.pcard { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; }
.pcard h3 { margin: 0 0 4px; font-size: 16px; }
.pcard .meta { color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.pcard .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.login-wrap { max-width: 420px; margin: 70px auto; }
.login-wrap.wide { max-width: 900px; margin: 30px auto; }
.login-wrap .brandbig { text-align: center; font-size: 30px; font-weight: 800; color: var(--navy); margin-bottom: 4px; }
.login-wrap .brandbig span { color: var(--accent); }
.login-wrap .sub { text-align: center; color: var(--muted); margin-bottom: 24px; font-size: 14px; }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.small { font-size: 13px; color: var(--muted); }
.nowrap { white-space: nowrap; }

details.editwrap { display:inline-block; position:relative; }
details.editwrap summary { list-style:none; cursor:pointer; }
.editpanel {
  position:absolute; left:0; top:110%; background:#fff; border:1px solid var(--line);
  border-radius:8px; padding:12px; z-index:6; box-shadow:0 4px 14px rgba(0,0,0,.15);
  min-width:min(540px, calc(100vw - 24px));
  max-width:calc(100vw - 24px);
}
.editpanel .formgrid { grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); }

/* ---------- עמוד הפתיחה הציבורי ---------- */
.hero {
  text-align: center; padding: 34px 18px 26px; margin-bottom: 6px;
}
.hero .brandbig {
  font-size: 34px; font-weight: 800; color: var(--navy); letter-spacing: .3px;
}
.hero .brandbig span { color: var(--accent); }
.hero h1 {
  margin: 14px 0 10px; font-size: 27px; color: var(--navy); font-weight: 700;
}
.hero .lead {
  max-width: 760px; margin: 0 auto 10px; font-size: 17px; line-height: 1.7;
  color: var(--text);
}
.hero .sub {
  max-width: 780px; margin: 0 auto; font-size: 14.5px; line-height: 1.75;
  color: var(--muted);
}

.gates {
  display: grid; gap: 18px; margin: 26px 0 22px;
  grid-template-columns: repeat(auto-fit, minmax(min(290px, 100%), 1fr));
}
.gate {
  display: flex; flex-direction: column; background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; padding: 22px 22px 18px;
  color: var(--text); text-decoration: none;
  box-shadow: 0 1px 3px rgba(16,30,54,.06);
  transition: box-shadow .18s, transform .18s, border-color .18s;
  border-top: 3px solid var(--navy);
}
.gate:hover {
  text-decoration: none; transform: translateY(-3px);
  box-shadow: 0 10px 26px rgba(16,30,54,.13); border-color: var(--accent);
}
.gate-ico { font-size: 30px; line-height: 1; margin-bottom: 10px; }
.gate h2 { margin: 0 0 8px; font-size: 19px; color: var(--navy); }
.gate p { margin: 0 0 16px; font-size: 14.5px; line-height: 1.65; color: var(--muted); flex: 1; }
.gate-cta { font-weight: 700; color: var(--navy); font-size: 15px; }
.gate-note {
  margin-top: 8px; font-size: 12.5px; color: var(--muted);
  padding-top: 8px; border-top: 1px dashed var(--line);
}
.gate-note.gate-secure { color: #8a6118; }
.gate-note.gate-secure::before { content: "🔒 "; }

.soon { margin-top: 6px; }
.soon h2 { font-size: 16px; }
.soon-grid {
  display: grid; gap: 12px 18px;
  grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
}
.soon-grid > div {
  border: 1px dashed var(--line); border-radius: 8px; padding: 11px 13px;
  background: #fafbfd;
}
.soon-grid b { display: block; color: var(--navy); font-size: 14px; margin-bottom: 3px; }
.soon-grid span { font-size: 12.5px; color: var(--muted); }

.homefoot {
  text-align: center; margin: 22px auto 8px; max-width: 720px; line-height: 1.6;
}

/* עמודי הלקוחות ועורכי הדין — מעטפת ממורכזת ללא סרגל ניהול */
.cust-wrap { max-width: 780px; margin: 30px auto; }
.cust-wrap.wide { max-width: 1100px; }
.cust-wrap .brandbig {
  text-align: center; font-size: 30px; font-weight: 800; color: var(--navy);
}
.cust-wrap .brandbig span { color: var(--accent); }
.cust-wrap .sub { text-align: center; color: var(--muted); margin-bottom: 20px; font-size: 14px; }
.cust-pcard { display: block; text-decoration: none; }
.cust-pcard:hover { text-decoration: none; border-color: var(--accent); }

/* ---------- כותרת תחתונה קבועה: מסמכים משפטיים ונגישות ---------- */
.sitefoot {
  border-top: 1px solid var(--line); background: #eef1f5; color: var(--muted);
  font-size: 13px; padding: 16px 18px; margin-top: 40px;
}
.sitefoot .inner {
  max-width: 1180px; margin: 0 auto; display: flex; flex-wrap: wrap;
  gap: 8px 18px; align-items: center;
}
.sitefoot a { color: var(--navy); text-decoration: underline; }
.sitefoot .sep { color: var(--line); }
.sitefoot .note { flex-basis: 100%; line-height: 1.6; }

/* ---------- עמודי מדיניות פרטיות והצהרת נגישות ---------- */
.legal { max-width: 860px; margin: 26px auto 10px; }
.legal h1 { font-size: 25px; color: var(--navy); margin: 0 0 4px; }
.legal .updated { color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.legal h2 {
  font-size: 17px; color: var(--navy); margin: 26px 0 8px;
  border-bottom: 2px solid var(--navy); padding-bottom: 5px;
}
.legal h3 { font-size: 15px; color: var(--navy); margin: 16px 0 6px; }
.legal p, .legal li { line-height: 1.8; font-size: 15px; }
.legal ul, .legal ol { padding-right: 22px; margin: 8px 0; }
.legal li { margin-bottom: 5px; }
.legal table.grid { margin: 10px 0 4px; }
.legal .backlink { margin-top: 28px; font-size: 14px; }

/* ---------- תפריט הנגישות ---------- */
.a11y-btn {
  position: fixed; bottom: 18px; left: 18px; z-index: 300;
  width: 46px; height: 46px; border-radius: 50%; border: 2px solid #fff;
  background: var(--navy); color: #fff; font-size: 23px; line-height: 1;
  cursor: pointer; box-shadow: 0 3px 12px rgba(16,30,54,.35); font-family: inherit;
}
.a11y-btn:hover { background: var(--navy-dark); }
.a11y-menu {
  position: fixed; bottom: 72px; left: 18px; z-index: 300;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 8px 28px rgba(16,30,54,.25); padding: 14px 16px;
  width: min(310px, calc(100vw - 36px)); text-align: right;
}
.a11y-menu[hidden] { display: none; }
.a11y-menu h2 { font-size: 15px; color: var(--navy); margin: 0 0 10px; }
.a11y-menu .grp { margin-bottom: 12px; }
.a11y-menu .grp > b { display: block; font-size: 13px; margin-bottom: 5px; }
.a11y-menu button.opt {
  background: #fff; border: 1px solid var(--line); border-radius: 7px;
  padding: 6px 11px; font-size: 13px; cursor: pointer; font-family: inherit;
  color: var(--text); margin-left: 5px; margin-bottom: 5px;
}
.a11y-menu button.opt:hover { background: #eef2f7; }
.a11y-menu button.opt[aria-pressed="true"] {
  background: var(--navy); color: #fff; border-color: var(--navy);
}
.a11y-menu .foot { font-size: 12px; color: var(--muted); line-height: 1.6; }
.a11y-menu .foot a { text-decoration: underline; }

/* מצב ניגודיות גבוהה — רקע שחור, טקסט לבן, קישורים בצהוב */
body.a11y-contrast, body.a11y-contrast * {
  background-color: #000 !important;
  background-image: none !important;
  color: #fff !important;
  border-color: #fff !important;
  box-shadow: none !important;
}
body.a11y-contrast a, body.a11y-contrast a *,
body.a11y-contrast .gate-cta, body.a11y-contrast .brandbig span,
body.a11y-contrast summary { color: #ffea00 !important; }
body.a11y-contrast .btn, body.a11y-contrast .a11y-btn,
body.a11y-contrast button.opt {
  color: #ffea00 !important; border: 2px solid #ffea00 !important;
}
body.a11y-contrast .a11y-menu button.opt[aria-pressed="true"] {
  background: #ffea00 !important; color: #000 !important;
}
body.a11y-contrast :focus-visible { outline: 3px solid #ffea00 !important; }

/* הדגשת קישורים */
body.a11y-links a { text-decoration: underline !important; }
body.a11y-links a:focus, body.a11y-links a:hover { background: #fff2c2; }

/* עצירת אנימציות — לפי בחירת המשתמש או לפי העדפת מערכת ההפעלה */
body.a11y-nomotion *, body.a11y-nomotion *::before, body.a11y-nomotion *::after {
  transition: none !important; animation: none !important; transform: none !important;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: .001ms !important; animation-duration: .001ms !important;
  }
  .gate:hover { transform: none; }
}

/* טקסט לקוראי מסך בלבד */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* קישורי המסמכים המשפטיים בתחתית עמוד הכניסה */
.legal-links {
  display: flex; justify-content: center; gap: 14px; flex-wrap: wrap;
  margin: 22px 0 6px;
}
.legal-links a {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--card); border: 1px solid var(--line); border-radius: 22px;
  padding: 9px 20px; font-size: 14.5px; font-weight: 600; color: var(--navy);
  text-decoration: none; box-shadow: 0 1px 2px rgba(16,30,54,.05);
}
.legal-links a:hover {
  border-color: var(--accent-dark); background: #fbfcfd; text-decoration: underline;
}
.legal-links .li { font-size: 15px; }

/* ---------- צירוף קבצים: כפתור קומפקטי במקום שדה הקובץ של הדפדפן ---------- */
.filepick { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.filepick .fp-input {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
/* מיושר לגוון ולמידות של .btn.sm.sec — אותו קו עיצובי */
.fp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--card); color: var(--navy); border: 1px solid var(--navy);
  border-radius: 7px; padding: 0 12px; min-height: 28px;
  font-family: inherit; font-size: 13px; font-weight: 500; cursor: pointer;
}
.fp-btn:hover { background: #eef2f7; }
/* התכונה hidden גוברת על display של המחלקה — אחרת שני המצבים מוצגים יחד */
.fp-btn[hidden], .fp-file[hidden] { display: none; }
.fp-btn .fp-ico { flex: none; }
.fp-file {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%;
  background: #eef6e3; border: 1px solid #b9d894; border-radius: 7px;
  padding: 4px 10px; font-size: 13px; color: #2f5d12;
}
.fp-file .fp-ok { font-weight: 700; }
.fp-file .fp-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 15em; }
.fp-file .fp-size { color: #4b7a25; font-size: 12px; }
.fp-x {
  background: none; border: 0; color: #4b7a25; cursor: pointer; font-family: inherit;
  font-size: 14px; line-height: 1; padding: 3px 5px; border-radius: 4px;
}
.fp-x:hover { background: #ddebc9; color: #2f5d12; }
.filepick .sizemsg, .filepick .fp-err { width: 100%; }
.fp-err { color: #b3373d; font-size: 12px; }

/* ---------- בחירת תאריך: לוח שנה מובנה לכל שדה תאריך ---------- */
.dtwrap { display: flex; align-items: center; gap: 6px; }
.dtwrap input { flex: 1; min-width: 0; }
.dt-btn {
  flex: none; background: var(--card); border: 1px solid var(--line);
  border-radius: 6px; color: var(--navy); cursor: pointer; padding: 5px 7px;
  line-height: 0;
}
.dt-btn:hover { background: #eef2f7; border-color: var(--navy); }
.dtpick {
  position: absolute; z-index: 900; width: 268px; background: var(--card);
  border: 1px solid var(--navy); border-radius: 8px; font-size: 13px;
  box-shadow: 0 6px 18px rgba(16, 30, 54, .18); overflow: hidden;
}
.dtpick .dt-head, .dtpick .dt-sel { display: flex; gap: 6px; background: var(--navy); }
.dtpick .dt-head { justify-content: space-between; padding: 5px 6px; }
.dtpick .dt-sel { padding: 0 6px 6px; }
.dtpick .dt-head button {
  background: none; border: 0; color: #fff; cursor: pointer; font: inherit;
  font-size: 12.5px; padding: 2px 7px; border-radius: 4px;
}
.dtpick .dt-head button:hover { background: var(--navy-dark); }
.dtpick .dt-sel select { flex: 1; font-size: 13px; padding: 2px 4px; }
.dtpick table { width: 100%; border-collapse: collapse; }
.dtpick th {
  background: var(--navy); color: #fff; font-size: 12px; font-weight: 600;
  padding: 4px 0;
}
.dtpick td { padding: 1px; }
.dtpick .dt-d {
  width: 100%; background: #f2f4f7; border: 0; border-radius: 4px;
  color: #24344d; cursor: pointer; font: inherit; padding: 5px 0;
}
.dtpick .dt-d:hover { background: #dbe6f3; }
.dtpick .dt-d.oth { background: #fafbfc; color: #9aa5b4; }
.dtpick .dt-d.today { box-shadow: inset 0 0 0 1px var(--navy); font-weight: 700; }
.dtpick .dt-d.sel { background: var(--navy); color: #fff; }
.dtpick .dt-foot {
  display: flex; justify-content: space-between; padding: 5px 6px;
  border-top: 1px solid var(--line);
}
.dtpick .dt-foot button {
  background: none; border: 0; color: var(--navy); cursor: pointer; font: inherit;
  font-size: 12.5px; padding: 2px 7px; border-radius: 4px;
}
.dtpick .dt-foot button:hover { background: #eef2f7; text-decoration: underline; }
/* שדה תאריך המשובץ בתוך נוסח הבחירה */
.checkline .dtwrap { display: inline-flex; width: auto; vertical-align: middle; }
.checkline .dtwrap input { width: 106px; flex: none; padding: 3px 6px; }

/* ---------- עמוד שאלות ותשובות ---------- */
details.faq { border-bottom: 1px solid var(--line); padding: 4px 0; }
details.faq:last-of-type { border-bottom: 0; }
details.faq summary {
  cursor: pointer; font-weight: 600; color: var(--navy);
  padding: 8px 4px; list-style-position: inside;
}
details.faq summary:hover { color: var(--accent-dark); }
details.faq[open] summary { color: var(--accent-dark); }
details.faq p { margin: 2px 8px 10px 4px; font-size: 14px; line-height: 1.65; }

/* ---------- העוזר החכם ---------- */
.chat-btn {
  position: fixed; bottom: 18px; left: 74px; z-index: 300;
  width: 46px; height: 46px; border-radius: 50%; border: 2px solid #fff;
  background: var(--navy); color: #fff; cursor: pointer;
  box-shadow: 0 3px 12px rgba(16,30,54,.35); font-family: inherit;
  display: flex; align-items: center; justify-content: center;
}
.chat-btn:hover { background: var(--navy-dark); }
.chat-panel {
  position: fixed; bottom: 72px; left: 18px; z-index: 310;
  width: min(360px, calc(100vw - 36px));
  height: min(520px, calc(100vh - 110px));
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 10px 34px rgba(16,30,54,.3);
  display: flex; flex-direction: column; overflow: hidden; text-align: right;
}
.chat-panel[hidden] { display: none; }
.chat-head {
  background: var(--navy); color: #fff; padding: 10px 14px;
  display: flex; align-items: baseline; gap: 8px;
}
.chat-head b { font-size: 15px; }
.chat-head span { font-size: 12px; color: #c8d4e2; flex: 1; }
.chat-x {
  background: none; border: 0; color: #c8d4e2; font-size: 15px;
  cursor: pointer; font-family: inherit; padding: 0 2px;
}
.chat-x:hover { color: #fff; }
.chat-log {
  flex: 1; overflow-y: auto; padding: 12px;
  display: flex; flex-direction: column; gap: 8px; background: #f5f7fa;
}
.chat-msg {
  max-width: 86%; padding: 8px 12px; border-radius: 12px;
  font-size: 13.5px; line-height: 1.65; white-space: normal;
  word-break: break-word;
}
.chat-msg.bot {
  background: #fff; border: 1px solid var(--line);
  border-radius: 12px 4px 12px 12px; align-self: flex-start;
}
.chat-msg.me {
  background: var(--navy); color: #fff;
  border-radius: 4px 12px 12px 12px; align-self: flex-end;
}
.chat-wait { color: var(--muted); letter-spacing: 3px; }
.chat-links { display: flex; flex-wrap: wrap; gap: 6px; align-self: flex-start; }
.chat-links a {
  font-size: 12.5px; background: #eef2f7; border: 1px solid var(--line);
  border-radius: 14px; padding: 4px 11px; text-decoration: none;
  color: var(--navy); font-weight: 600;
}
.chat-links a:hover { background: var(--navy); color: #fff; }
.chat-chips { display: flex; flex-wrap: wrap; gap: 6px; align-self: flex-start; }
.chat-chips button {
  font-size: 12.5px; background: #fff; border: 1px solid var(--navy);
  color: var(--navy); border-radius: 14px; padding: 4px 11px;
  cursor: pointer; font-family: inherit;
}
.chat-chips button:hover { background: var(--navy); color: #fff; }
.chat-lead {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px; display: flex; flex-direction: column; gap: 6px;
  align-self: stretch;
}
.chat-lead input, .chat-lead textarea {
  border: 1px solid var(--line); border-radius: 7px; padding: 6px 9px;
  font-size: 13px; font-family: inherit; resize: vertical;
}
.chat-lead button {
  background: var(--navy); color: #fff; border: 0; border-radius: 7px;
  padding: 7px; font-size: 13px; cursor: pointer; font-family: inherit;
}
.chat-lead button:hover { background: var(--navy-dark); }
.chat-lead :disabled { opacity: .55; }
.chat-input {
  display: flex; gap: 6px; padding: 9px 10px; border-top: 1px solid var(--line);
  background: #fff;
}
.chat-input input {
  flex: 1; border: 1px solid var(--line); border-radius: 18px;
  padding: 7px 13px; font-size: 13.5px; font-family: inherit;
}
.chat-input button {
  width: 36px; height: 36px; border-radius: 50%; border: 0;
  background: var(--navy); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.chat-input button:hover { background: var(--navy-dark); }
.chat-foot {
  font-size: 11px; color: var(--muted); text-align: center;
  padding: 5px 10px 7px; background: #fff; line-height: 1.5;
}
body.a11y-contrast .chat-btn,
body.a11y-contrast .chat-chips button, body.a11y-contrast .chat-lead button,
body.a11y-contrast .chat-input button {
  color: #ffea00 !important; border: 2px solid #ffea00 !important;
}
@media (max-width: 480px){
  .chat-panel { left: 8px; bottom: 62px; width: calc(100vw - 16px);
                height: min(520px, calc(100vh - 90px)); }
}

/* ---------- הלוגו ---------- */
/* בסרגל העליון (רקע כחול כהה) — גרסת הלוגו ההפוכה, ללא הסלוגן.
   הלוגו הוא קישור לעמוד הבית. */
.topbar a.brand { display: flex; align-items: center; flex: 0 0 auto; }
.topbar a.brand img { height: 30px; width: auto; display: block; }
.topbar a.brand:hover { opacity: .88; }
.topbar a.brand:focus-visible { outline: 3px solid var(--accent-lite); outline-offset: 3px;
  border-radius: 4px; }
/* בראש עמודי הכניסה, אזור הלקוחות ועמודי המידע — הלוגו המלא */
a.brandbig { display: block; text-align: center; margin-bottom: 6px; }
a.brandbig img { display: block; margin: 0 auto; height: auto;
  max-width: min(320px, 82%); }
a.brandbig:hover { opacity: .9; }

/* ==========================================================================
   מסגרת חוויית המשתמש — רכיבים משותפים לכל המסכים
   ========================================================================== */

/* ---------- סרגל פעולות דביק ----------
   שורת הלחצנים של הטופס הראשי במסך (המשך / שמירה / שליחה) נצמדת לתחתית
   החלון, כך שהיא נראית בלי גלילה בכל גובה מסך. base.html מסמן אותה
   (is-sticky) רק כשיש במסך שורה אחת כזו — שני סרגלים היו נערמים זה על זה. */
.formactions.is-sticky {
  position: sticky; bottom: 10px; z-index: 40;
  background: rgba(255, 255, 255, .97); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 12px;
  box-shadow: 0 4px 16px rgba(16, 30, 54, .16);
}
/* הלחצנים המרחפים (נגישות, עוזר) מתרוממים מעל הסרגל הדביק */
body.has-stickybar .a11y-btn, body.has-stickybar .chat-btn { bottom: 74px; }
body.has-stickybar .a11y-menu, body.has-stickybar .chat-panel { bottom: 128px; }
body.has-stickybar .chat-panel { height: min(520px, calc(100vh - 166px)); }
body.has-stickybar .sitefoot { padding-bottom: 16px; }

/* ---------- מקטעים בלשוניות ----------
   עמוד ארוך מחולק למקטעים (section[data-pane]) ומוצג מקטע אחד בכל פעם;
   סרגל הלשוניות דביק מתחת לסרגל העליון. base.html בונה את הסרגל. */
.panetabs {
  position: sticky; top: var(--topbar-h); z-index: 30;
  display: flex; gap: 4px; flex-wrap: nowrap; overflow-x: auto;
  background: var(--bg); padding: 8px 0 0; margin: 0 0 16px;
  border-bottom: 2px solid var(--navy);
  scrollbar-width: thin;
}
body:not(.has-topbar) .panetabs { top: 0; }
.panetabs button {
  flex: none; font-family: inherit; font-size: 14px; font-weight: 600;
  color: var(--navy); background: #e8edf2; border: 1px solid var(--line);
  border-bottom: 0; border-radius: 8px 8px 0 0; padding: 0 16px;
  min-height: 38px; cursor: pointer; white-space: nowrap;
}
.panetabs button:hover { background: #dbe3ec; }
.panetabs button[aria-selected="true"] {
  background: var(--navy); color: #fff; border-color: var(--navy);
}
.panetabs button:focus-visible { outline-offset: -3px; outline-color: var(--accent-lite); }
.panetabs .cnt {
  display: inline-block; margin-inline-start: 6px; font-size: 12px; font-weight: 500;
  background: rgba(255,255,255,.75); color: var(--navy); border-radius: 9px; padding: 0 6px;
}
section[data-pane][hidden] { display: none; }
section[data-pane] > .card:last-child { margin-bottom: 0; }

/* ---------- רשימות ארוכות ----------
   טבלה שהתארכה גוללת בתוך עצמה, עם כותרת דביקה — העמוד עצמו לא מתארך.
   base.html מסמן (is-long) רק טבלאות תצוגה; טבלה שהיא טופס אינה נחתכת. */
.tscroll.is-long {
  max-height: min(62vh, 580px); overflow-y: auto;
  border: 1px solid var(--line); border-radius: 6px;
}
.tscroll.is-long > table.grid th {
  position: sticky; top: 0; z-index: 2;
  box-shadow: inset 0 -1px 0 var(--line), inset 0 1px 0 var(--line);
}
.listcount { color: var(--muted); font-weight: 500; font-size: .9em; }

/* ---------- תיקוף שדות בזמן ההקלדה ---------- */
input.is-invalid, select.is-invalid, textarea.is-invalid,
input[aria-invalid="true"] {
  border-color: var(--err) !important; background: #fdf0f0 !important;
  box-shadow: 0 0 0 2px rgba(179, 55, 61, .18);
}
.fieldmsg { color: var(--err); font-size: 12px; margin-top: 2px; font-weight: 600; }
.fieldmsg:empty { display: none; }

/* בלוק חוזר בתוך כרטיס (רוכש, צד לעסקה) */
.subcard {
  border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px;
  margin-bottom: 10px; background: #fafbfd;
}

/* ---------- רכיב הכתובת: בחירה מרשימה עם הקלדה ---------- */
.addr-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); }
.addr-manual { margin-top: 6px; font-size: 13px; color: var(--muted); }
.cbx { position: relative; display: block; }
.cbx-list {
  position: absolute; top: calc(100% + 2px); right: 0; left: 0; z-index: 70;
  margin: 0; padding: 4px 0; list-style: none; text-align: right;
  background: #fff; border: 1px solid var(--navy); border-radius: 7px;
  box-shadow: 0 8px 22px rgba(16, 30, 54, .18);
  max-height: 236px; overflow-y: auto;
}
.cbx-list[hidden] { display: none; }
.cbx-list li { padding: 7px 12px; font-size: 14px; color: var(--text); cursor: pointer; }
.cbx-list li:hover, .cbx-list li.is-active { background: #e8edf2; }
.cbx-list li.cbx-none { color: var(--muted); cursor: default; background: none; }

/* ---------- עברית: יישור ----------
   כותרות — לימין (או ממורכזות במסכי הפתיחה); גוף הטקסט — יישור דו-צדדי,
   והשורה האחרונה צמודה לימין. מספרים ומילים לועזיות אינם מתהפכים. */
main p, main li, .warnbox, .legal p, .legal li, details.faq p, .gate p {
  text-align: justify; text-align-last: right;
}
.center p, .center li, .hero p, .homefoot, .homefoot p, .login-wrap .sub,
.cust-wrap .sub, .card.center, [style*="text-align:center"] p,
[style*="text-align: center"] p, td p, th p, .chat-msg p {
  text-align: inherit; text-align-last: auto;
}
bdi, .ltr, input[type=email], input[type=tel], input[type=url] { unicode-bidi: isolate; }
input[type=email], input[type=tel], input[type=url] { direction: ltr; text-align: right; }

/* ---------- שתי עמודות ----------
   בלוקים שכנים (קבוצות הרשאה, כרטיסי טופס) זה לצד זה — העמוד מנצל את
   רוחבו במקום להתארך. בלוקים באותה שורה מתחילים באותו גובה ושווים בגובהם;
   בלוק יחיד (או אחרון בודד) תופס את מלוא הרוחב. במסך צר — עמודה אחת. */
.cols2 {
  display: grid; gap: 14px 18px; align-items: stretch;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.cols2 > .card { margin-bottom: 0; }
.cols2 > :last-child:nth-child(odd), .cols2 > .full { grid-column: 1 / -1; }
.cols2 h3:first-child { margin-top: 0; }
.cols2 + .card, .cols2 + .formactions { margin-top: 18px; }
/* רשימת מסמכים לצירוף — שתי עמודות, בלי ריווח אנכי בין השורות */
.cols2.docgrid { gap: 0 28px; align-items: start; }
.cols2.docgrid > :last-child:nth-child(odd) { grid-column: auto; }

/* ---------- "אפשרויות נוספות" ----------
   פעולות משניות מקובצות מאחורי לחצן אחד שנפתח באותו מסך */
details.moremenu { position: relative; display: inline-block; }
details.moremenu > summary { list-style: none; }
details.moremenu > summary::-webkit-details-marker { display: none; }
details.moremenu > summary::after { content: " ▾"; font-size: 11px; margin-inline-start: 4px; }
.moremenu-panel {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 60;
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  padding: 6px; min-width: 220px; display: flex; flex-direction: column; gap: 4px;
  box-shadow: 0 8px 24px rgba(16, 30, 54, .18);
}
.moremenu-panel .btn { justify-content: flex-start; width: 100%; align-self: stretch; }

/* ---------- תצוגה במסך צר: טאבלט וטלפון נייד ----------
   שתי נקודות שבירה: עד 1080px סרגל הניהול מתקפל לתפריט (הלוגו, הניווט,
   שם הארגון והמשתמש אינם נכנסים בשורה אחת ברוחב קטן מזה — גם עם מונים
   לשורה אחת), ועד 700px גם שאר העמוד מותאם לטלפון — שוליים צרים, כרטיסים
   בעמודה אחת, חלוניות עריכה שזורמות בעמוד, אזורי מגע גדולים יותר. */
@media (max-width: 1080px) {
  header.topbar { flex-wrap: wrap; padding: 0 14px; gap: 10px; min-height: var(--topbar-h); }
  .navtoggle {
    display: inline-flex; align-items: center; gap: 8px; margin-inline-start: auto;
    background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.55);
    border-radius: 7px; padding: 0 12px; min-height: 38px; cursor: pointer;
    font-family: inherit; font-size: 14px; font-weight: 600;
  }
  .navtoggle:hover { background: rgba(255,255,255,.14); border-color: #fff; }
  .navtoggle:focus-visible { outline: 3px solid var(--accent-lite); outline-offset: 2px; }
  .navtoggle-bars { display: inline-flex; flex-direction: column; gap: 3px; }
  .navtoggle-bars i {
    display: block; width: 18px; height: 2px; background: #fff; border-radius: 2px;
    transition: transform .15s ease, opacity .15s ease;
  }
  .topbar.nav-open .navtoggle-bars i:nth-child(1) { transform: translateY(5px) rotate(45deg); }
  .topbar.nav-open .navtoggle-bars i:nth-child(2) { opacity: 0; }
  .topbar.nav-open .navtoggle-bars i:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }
  /* התפריט הפתוח: מתחת לסרגל, לרוחב מלא, נגלל אם ארוך מהמסך */
  .topbar .topnav {
    display: none; flex-basis: 100%; flex-direction: column; align-items: stretch;
    gap: 0; padding: 4px 0 12px; border-top: 1px solid rgba(255,255,255,.18);
    max-height: calc(100vh - 64px); overflow-y: auto;
  }
  .topbar.nav-open .topnav { display: flex; }
  .topbar nav { flex-direction: column; gap: 2px; flex: none; }
  .topbar nav { align-items: stretch; }
  .topbar nav a, .navmenu > summary { display: block; padding: 11px 12px; font-size: 15px; border-radius: 7px; }
  .navmenu-panel.two { flex-direction: column; align-items: stretch; gap: 6px 0; }
  .navmenu-group { min-width: 0; }
  .navmenu-group + .navmenu-group { border-inline-start: 0; padding-inline-start: 0; }
  .navmenu-panel {
    position: static; box-shadow: none; border: 0; padding: 0 14px 0 0; min-width: 0;
    border-inline-start: 2px solid rgba(255,255,255,.2); margin-inline-start: 12px; border-radius: 0;
  }
  .topbar .topbar-end {
    flex: none; flex-wrap: wrap; gap: 10px 16px; padding: 12px 12px 0; margin-top: 8px;
    border-top: 1px solid rgba(255,255,255,.18);
  }
  .topbar .topbar-end .btn { min-height: 36px; }
  .topbar .orglink, .topbar .logout { font-size: 14px; }
  .topbar .topbar-end select { font-size: 14px !important; padding: 6px 8px !important; }
}

@media (max-width: 700px) {
  html, body { overflow-x: hidden; }
  .topbar a.brand img { height: 24px; }
  main { margin: 14px auto 40px; padding: 0 12px; }
  .card { padding: 14px; margin-bottom: 14px; }
  .pcard { padding: 14px; }
  .pagehead { gap: 10px; margin-bottom: 12px; }
  .pagehead h1 { font-size: 19px; line-height: 1.3; }
  .card h2 { font-size: 16px; }
  .section > h2 { font-size: 15px; }
  /* שדות קלט ב-16px — בגודל קטן יותר iPhone מגדיל את העמוד אוטומטית
     בכניסה לשדה, והמשתמש נאלץ להקטין חזרה */
  input[type=text], input[type=password], input[type=number], input[type=email],
  input[type=tel], input[type=date], input[type=search], select, textarea { font-size: 16px; }
  /* אזורי מגע נוחים לאצבע (לפחות 36px) */
  .btn.sm { min-height: 36px; padding: 0 12px; }
  .fp-btn { min-height: 36px; }
  .dt-btn { padding: 8px 9px; }
  .a11y-menu button.opt { padding: 8px 12px; }
  table.grid { font-size: 13px; }
  table.grid th, table.grid td { padding: 6px 8px; }
  /* חלוניות עריכה צפות (details.editwrap): במסך צר הן זורמות בתוך העמוד
     ברוחב מלא, במקום לרחף ולחרוג מקצה המסך. ה-!important גובר על רוחב
     מזערי שנקבע בתבניות בודדות (style="min-width:…"). */
  details.editwrap { display: block; }
  .editpanel {
    position: static !important; min-width: 0 !important; max-width: none !important;
    width: 100%; margin-top: 8px; box-shadow: none;
  }
  .hero { padding: 22px 10px 16px; }
  .hero .brandbig { font-size: 28px; }
  .hero h1 { font-size: 22px; }
  .hero .lead { font-size: 15.5px; line-height: 1.6; }
  .gate { padding: 18px 16px 14px; }
  .login-wrap { margin: 24px auto; }
  .cust-wrap { margin: 16px auto; }
  .legal { margin: 14px auto 10px; }
  .legal h1 { font-size: 22px; }
  .flash { top: 8px; max-width: calc(100vw - 16px); }
  .flash + .flash { top: 58px; }
  .flash + .flash + .flash { top: 108px; }
  .sitefoot { padding: 14px 12px; margin-top: 26px; }
  .formactions.is-sticky { bottom: 6px; padding: 7px 8px; }
  body.has-stickybar .a11y-btn, body.has-stickybar .chat-btn { bottom: 66px; }
  body.has-stickybar .a11y-menu, body.has-stickybar .chat-panel { bottom: 116px; }
  .panetabs button { min-height: 40px; padding: 0 13px; }
  .tscroll.is-long { max-height: 66vh; }
  .moremenu-panel { left: auto; right: 0; }
  .cols2 { grid-template-columns: minmax(0, 1fr); }
  .addr-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .sitefoot .sep { display: none; }
  .sitefoot .inner { gap: 6px 14px; }
  .fp-file .fp-name { max-width: 10em; }
  .a11y-btn, .chat-btn { width: 42px; height: 42px; bottom: 12px; font-size: 21px; }
  .a11y-btn { left: 12px; }
  .chat-btn { left: 62px; }
  .a11y-menu { left: 12px; bottom: 62px; }
  .chat-panel { bottom: 62px; }
}

@media (max-width: 480px) {
  /* כפתורי הטופס נמתחים לרוחב השורה — קלים יותר ללחיצה */
  .formactions .btn { flex: 1 1 auto; }
  .pagehead .btn, .pagehead summary.btn { flex: 1 1 auto; }
  .pcard .row { gap: 6px; }
  .badge { font-size: 11.5px; }
}
/* ---------- הדפסה ---------- */
/* המסכים נבנו לרוחב מסך; בהדפסה הם מותאמים לעמוד A4: שוליים אחידים,
   טקסט מוקטן מעט, וטבלאות שנשברות לשורות במקום להיחתך בקצה העמוד.
   הכיווניות נשמרת — התוכן צמוד לימין, כמקובל בעברית. */
@page {
  size: A4;
  margin: 12mm 10mm;
}

@media print {
  html, body {
    direction: rtl;
    background: #fff !important;
    width: auto;
    margin: 0;
    padding: 0;
    font-size: 10.5pt;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* פריטי ממשק שאין להם מקום בנייר */
  .topbar, .sitefoot, .chat-btn, .chat-panel, .a11y-btn, .a11y-menu,
  .skip-link, .crumbs, .noprint, .flash, .dtpick,
  form.inline, .formactions, button, .btn {
    display: none !important;
  }

  /* רוחב מלא של העמוד — בלי מגבלת הרוחב של המסך ובלי מרכוז */
  main {
    max-width: none !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    text-align: right;
  }

  .card {
    border: none !important;
    box-shadow: none !important;
    background: #fff !important;
    padding: 0 !important;
    margin: 0 0 10px !important;
    max-width: none !important;
    break-inside: auto;
  }
  .card h2, .card h3, .pagehead h1 {
    break-after: avoid;
    page-break-after: avoid;
  }
  .pagehead:not(.noprint) { display: block !important; margin: 0 0 8px !important; }
  .pagehead h1 { font-size: 15pt; }

  /* מכולות הגלילה האופקית — בהדפסה הן חותכות את התוכן */
  [style*="overflow-x"], .tscroll {
    overflow: visible !important;
    width: auto !important;
    background: none !important;
  }
  .tscroll > table { min-width: 0 !important; }
  .tscroll.is-long { max-height: none !important; border: 0 !important; }
  .tscroll.is-long > table.grid th { position: static !important; }
  section[data-pane][hidden] { display: block !important; }
  .panetabs, .moremenu { display: none !important; }
  .navtoggle { display: none !important; }

  /* טבלאות: רוחב מלא, שבירת שורות, וכותרת חוזרת בכל עמוד */
  table.grid {
    width: 100% !important;
    max-width: none !important;
    table-layout: auto;
    font-size: 9pt;
    border-collapse: collapse;
    direction: rtl;
  }
  table.grid thead { display: table-header-group; }
  table.grid tr { break-inside: avoid; page-break-inside: avoid; }
  table.grid th, table.grid td {
    padding: 3px 5px !important;
    border: 1px solid #999 !important;
    text-align: right;
    vertical-align: top;
    /* הגורם המרכזי לחיתוך: תאים שאינם נשברים. בנייר הם כן נשברים. */
    white-space: normal !important;
    overflow-wrap: break-word;
    word-break: break-word;
  }
  table.grid th { background: #eef2f7 !important; font-size: 9pt; }
  table.grid tr:nth-child(even) td { background: #fafbfc !important; }
  /* .nowrap נדרש במסך כדי שתאריכים וסכומים לא יישברו — בנייר
     שומרים על כך רק לתאים קצרים באמת (תאריך/סכום), דרך רוחב מזערי */
  table.grid td.nowrap { white-space: nowrap !important; }

  /* פרטים מקופלים (details) — נפתחים בהדפסה, כדי שהפירוט לא ייעלם */
  details { display: block !important; }
  details > summary {
    display: block !important;
    list-style: none;
    font-weight: 700;
    margin: 6px 0 3px;
  }
  details > summary::-webkit-details-marker { display: none; }
  details > *:not(summary) { display: block !important; }

  .printhead {
    display: block !important;
    border-bottom: 2px solid var(--navy);
    padding-bottom: 4px;
    margin-bottom: 10px;
    font-size: 10pt;
  }
  a { color: #000 !important; text-decoration: none !important; }
  .small { font-size: 8.5pt; }

  /* חוזר בסוף בכוונה: כלל ההסתרה חייב לגבור על כל כלל תצוגה שלמעלה
     (בעדיפות זהה, המאוחר גובר) — כך ש-class="pagehead noprint" נעלם */
  .topbar, .sitefoot, .chat-btn, .chat-panel, .a11y-btn, .a11y-menu,
  .skip-link, .crumbs, .noprint, .flash, .dtpick,
  form.inline, .formactions, button, .btn {
    display: none !important;
  }
}
