/* פלאגינים – עיצוב האתר
   Layout: notebook-grid hero, grade picker, worksheet pages with preview + download box.
   כל הצבעים מוגדרים כמשתנים כאן. לשינוי צבע המותג משנים רק את הבלוק הזה. */
:root {
  --ground: #f3f6fa;      /* רקע הדף */
  --paper: #ffffff;       /* משטחים לבנים */
  --ink: #1d3a8a;         /* כחול שורות המחברת – צבע המותג */
  --ink-soft: #3d5aa8;
  --grid: #dbe5f1;        /* קווי המשבצות */
  --pencil: #f2c230;      /* צהוב עיפרון – רק לכפתורי הורדה */
  --pencil-dark: #2a2208;
  --text: #172033;
  --muted: #566079;
  --line: #d4dceb;
  --ad-bg: #eef2f8;

  --font-display: "Secular One", "Assistant", "Arial Hebrew", Arial, sans-serif;
  --font-body: "Assistant", "Arial Hebrew", Arial, sans-serif;

  --step--1: 0.9rem;
  --step-0: 1.075rem;
  --step-1: 1.3rem;
  --step-2: 1.65rem;
  --step-3: 2.2rem;
  --step-4: 3rem;

  --wrap: 72rem;
  --radius: 10px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0f1729;
    --paper: #16213a;
    --ink: #9db4ff;
    --ink-soft: #b9c9ff;
    --grid: #1f2c48;
    --pencil: #f2c230;
    --pencil-dark: #2a2208;
    --text: #e7ecf6;
    --muted: #a3adc4;
    --line: #2a3858;
    --ad-bg: #1a2742;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.65;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ink); text-underline-offset: 3px; }
a:hover { color: var(--ink-soft); }
:focus-visible { outline: 3px solid var(--pencil); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.2;
  text-wrap: balance;
  color: var(--text);
  margin: 0;
}
h1 { font-size: var(--step-3); }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); }
p { margin: 0; }

/* מספרים ותרגילים תמיד משמאל לימין */
.math { direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; }

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

.skip-link {
  position: absolute; inset-inline-start: 1rem; top: -4rem;
  background: var(--paper); color: var(--ink); padding: .5rem 1rem; z-index: 20;
}
.skip-link:focus { top: 1rem; }

/* ---------- כותרת עליונה ---------- */
.site-header { background: var(--paper); border-bottom: 1px solid var(--line); }
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding-block: .85rem;
}
.logo {
  display: flex; align-items: center; gap: .55rem;
  font-family: var(--font-display); font-size: 1.55rem;
  color: var(--ink); text-decoration: none;
}
.logo-mark {
  width: 2.1rem; height: 2.1rem; flex: none;
  display: grid; place-items: center;
  border: 2px solid var(--ink); border-radius: 6px;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 7px 7px;
  font-size: 1.05rem; line-height: 1;
}
.logo-text { display: grid; line-height: 1.05; }
.logo-latin {
  font-family: var(--font-body); font-size: .72rem; font-weight: 600;
  letter-spacing: .08em; color: var(--muted); direction: ltr; text-align: right;
}
.nav ul { list-style: none; display: flex; align-items: center; gap: 1.2rem; margin: 0; padding: 0; }
.nav a, .sub-toggle { color: var(--text); text-decoration: none; font-weight: 600; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; }

/* תפריטים נפתחים: מתמטיקה, אנגלית, פיזיקה, פסיכומטרי */
.has-sub { position: relative; }
.sub-toggle {
  background: none; border: 0; padding: .2rem 0; font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; gap: .3rem;
}
.sub-toggle::after {
  content: ""; width: .42rem; height: .42rem; margin-top: -.2rem;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg); transition: transform .15s;
}
.sub-toggle[aria-expanded="true"]::after { transform: rotate(-135deg); margin-top: .2rem; }
.sub-toggle:hover, .sub-toggle[aria-current="page"] { color: var(--ink); }
.sub-toggle[aria-current="page"] { text-decoration: underline; text-underline-offset: .3em; }
.nav .sub {
  display: none; position: absolute; top: calc(100% + .55rem); left: 50%; right: auto; transform: translateX(-50%); z-index: 20;
  min-width: 13.5rem; width: max-content; flex-direction: column; align-items: stretch; gap: 0;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 10px 28px rgba(23, 32, 51, .12); padding: .4rem;
}
.nav .sub.open { display: flex; }

.nav .sub a { display: block; padding: .5rem .7rem; border-radius: 6px; font-weight: 600; white-space: nowrap; }
.nav .sub a:hover, .nav .sub a:focus-visible { background: var(--ground); text-decoration: none; color: var(--ink); }
.menu-toggle {
  display: none; background: none; border: 0; border-radius: 8px;
  color: var(--text); font: inherit; font-weight: 600; padding: .4rem .7rem; cursor: pointer;
}
.menu-toggle:hover, .menu-toggle:focus-visible, .menu-toggle[aria-expanded="true"] { color: var(--ink); background: var(--ground); }
@media (max-width: 940px) {
  .menu-toggle { display: block; }
  .nav { display: none; width: 100%; }
  .nav.open { display: block; }
  .site-header .wrap { flex-wrap: wrap; }
  .nav ul { flex-direction: column; align-items: stretch; gap: .2rem; padding-block: .6rem; }
  .sub-toggle { width: 100%; justify-content: space-between; padding: .45rem 0; }
  .nav > ul > li > a { display: block; padding: .45rem 0; }
  .nav .sub { position: static; box-shadow: none; border: 0; border-inline-start: 2px solid var(--grid);
              border-radius: 0; padding: 0 .8rem .4rem 0; min-width: 0; width: auto; transform: none; left: auto; }
  .nav .sub a { white-space: normal; }
}

/* ---------- פירורי לחם ---------- */
.crumbs { font-size: var(--step--1); color: var(--muted); padding-block: 1rem 0; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; padding: 0; }
.crumbs li + li::before { content: "‹"; margin-inline-end: .4rem; color: var(--muted); }
.crumbs a { color: var(--muted); }

/* ---------- Hero על דף משבצות ---------- */
.hero {
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 28px 28px;
  border-bottom: 1px solid var(--line);
}
.hero .wrap {
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 2.5rem;
  align-items: center; padding-block: 3.5rem;
}
.hero h1 { font-size: var(--step-4); color: var(--ink); }
.hero-lead { font-size: var(--step-1); color: var(--text); margin-top: 1rem; max-width: 34rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.6rem; }
.hero-sheet {
  background: var(--paper); border: 1px solid var(--line); border-radius: 4px;
  box-shadow: 0 18px 40px -22px rgba(29, 58, 138, .45);
  transform: rotate(-2.5deg); max-width: 22rem; justify-self: center;
}
@media (max-width: 760px) {
  .hero .wrap { grid-template-columns: 1fr; padding-block: 2.2rem; }
  .hero h1 { font-size: var(--step-3); }
  .hero-sheet { max-width: 16rem; }
}

/* ---------- כפתורים ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  font: 700 var(--step-0) var(--font-body);
  padding: .75rem 1.35rem; border-radius: 8px; text-decoration: none;
  border: 2px solid var(--ink); color: var(--ink); background: var(--paper);
  cursor: pointer;
}
.btn:hover { background: var(--ground); color: var(--ink); }
.btn-download {
  background: var(--pencil); border-color: var(--pencil); color: var(--pencil-dark);
  font-size: var(--step-1); padding: .9rem 1.6rem;
}
.btn-download:hover { filter: brightness(.95); background: var(--pencil); color: var(--pencil-dark); }
.btn-buy { background: var(--ink); color: var(--paper); }
.btn-buy:hover { background: var(--ink-soft); color: var(--paper); }

/* ---------- סקשנים ---------- */
.section { padding-block: 3rem; }
.section-head { display: grid; gap: .4rem; margin-bottom: 1.6rem; }
.section-head p { color: var(--muted); max-width: 40rem; }

/* בורר כיתות – אותיות הכיתות הן רצף אמיתי, לכן מוצגות בסדר */
.grade-group { display: grid; gap: .8rem; }
.grade-group + .grade-group { margin-top: 2rem; }
.grade-group h3 { color: var(--muted); font-size: var(--step-0); font-family: var(--font-body); font-weight: 700; }
.grades { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1rem; }
/* כל הקבוצות על אותה רשת של 6 עמודות, כדי שהכרטיסים יהיו באותו רוחב */
.grades.three { grid-template-columns: repeat(6, 1fr); }
.grades.one { grid-template-columns: repeat(6, 1fr); }
.grades.one .grade { grid-column: span 2; }
.grade-wide .grade-letter { font-size: 2.2rem; }
@media (max-width: 760px) { .grades.three { max-width: none; grid-template-columns: repeat(3, 1fr); } .grades.one { grid-template-columns: minmax(0, 1fr); } .grades.one .grade { grid-column: auto; } .grades.three .grade { padding: .9rem; } .grades.three .grade-letter { font-size: 2.3rem; } }

/* כרטיס כלי */
.tool-card {
  display: grid; grid-template-columns: auto 1fr; gap: 1.4rem; align-items: center;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.4rem; text-decoration: none; color: var(--text);
}
.tool-card:hover { border-color: var(--ink); }
.tool-card .glyphs { font-family: var(--font-display); color: var(--ink); line-height: 1.1; width: 9rem; text-align: center; display: grid; gap: .25rem; }
.tool-card .glyphs span { display: block; }
.tool-card p { color: var(--muted); }
@media (max-width: 600px) { .tool-card { grid-template-columns: 1fr; } }
.grade {
  display: grid; gap: .25rem; justify-items: start;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem 1.2rem; text-decoration: none; color: var(--text);
}
.grade-letter { font-family: var(--font-display); font-size: 3rem; line-height: 1; color: var(--ink); }
.grade-name { font-weight: 700; }
.grade-meta { font-size: var(--step--1); color: var(--muted); }
a.grade:hover { border-color: var(--ink); }
.grade[aria-disabled="true"] .grade-letter { color: var(--muted); opacity: .55; }
@media (max-width: 760px) { .grades { grid-template-columns: repeat(2, 1fr); } }

/* רשימת דפי עבודה */
.sheet-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1.4rem; }
.sheet-card {
  display: grid; grid-template-rows: auto 1fr; text-decoration: none; color: var(--text);
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.sheet-card img { border-bottom: 1px solid var(--line); aspect-ratio: 210 / 140; object-fit: cover; object-position: top; width: 100%; }
.sheet-card .body { padding: 1rem 1.1rem 1.2rem; display: grid; gap: .3rem; align-content: start; }
.sheet-card h3 { font-size: var(--step-1); }
.sheet-card p { color: var(--muted); font-size: var(--step--1); }
a.sheet-card:hover { border-color: var(--ink); }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.6rem; counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: s; display: grid; gap: .35rem; }
.steps li::before {
  content: counter(s); font-family: var(--font-display); font-size: var(--step-2); color: var(--ink);
  width: 2.6rem; height: 2.6rem; display: grid; place-items: center;
  border: 2px solid var(--ink); border-radius: 50%;
}
.steps p { color: var(--muted); }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }

/* ---------- עמוד דף עבודה ---------- */
.ws-top { display: grid; grid-template-columns: minmax(0, 1fr) 21rem; gap: 2.5rem; padding-block: 1.5rem 2.5rem; align-items: start; }
.ws-intro { display: grid; gap: 1rem; min-width: 0; }
.ws-intro .lead { font-size: var(--step-1); }
.ws-preview {
  background: var(--paper); border: 1px solid var(--line); border-radius: 4px;
  box-shadow: 0 14px 34px -24px rgba(29, 58, 138, .5); max-width: min(26rem, 100%);
}
.hero-sheet { max-width: min(22rem, 100%); }
.download-box {
  position: sticky; top: 1rem;
  background: var(--paper); border: 2px solid var(--ink); border-radius: var(--radius);
  padding: 1.4rem; display: grid; gap: 1rem;
}
.download-box dl { display: grid; grid-template-columns: auto 1fr; gap: .35rem 1rem; margin: 0; }
.download-box dt { color: var(--muted); }
.download-box dd { margin: 0; font-weight: 600; }
.download-box .note { font-size: var(--step--1); color: var(--muted); }
.download-box .gen-link { display: block; margin-top: -.3rem; text-align: center; color: var(--ink); font-weight: 600; text-decoration: none; }
.download-box .gen-link:hover { text-decoration: underline; }
@media (max-width: 860px) {
  .ws-top { grid-template-columns: minmax(0, 1fr); }
  .download-box { position: static; min-width: 0; }
  .download-box .btn-download { justify-content: center; text-align: center; }
}

.prose { max-width: 42rem; display: grid; gap: 1rem; }
.prose h2 { margin-top: 1.2rem; }
.prose ul { margin: 0; padding-inline-start: 1.3rem; display: grid; gap: .35rem; }

/* כרטיס מוצר בתשלום */
.product {
  display: grid; grid-template-columns: auto 1fr; gap: 1.6rem; align-items: center;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.6rem;
}
.product-stack { width: 7.5rem; aspect-ratio: 210 / 297; position: relative; }
.product-stack span {
  position: absolute; inset: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 3px;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 10px 10px;
}
.product-stack span:nth-child(1) { transform: rotate(-6deg); }
.product-stack span:nth-child(2) { transform: rotate(3deg); }
.product-stack span:nth-child(3) { display: grid; place-items: center; font-family: var(--font-display); color: var(--ink); font-size: 1.5rem; }
.product-body { display: grid; gap: .6rem; min-width: 0; justify-items: start; }
.price { font-family: var(--font-display); font-size: var(--step-2); color: var(--ink); }
@media (max-width: 600px) { .product { grid-template-columns: 1fr; } .product-stack { width: 6rem; } }

/* ---------- מקום לפרסומת ----------
   בדוגמה הקופסה מסומנת כדי שתראה איפה הפרסומות יופיעו.
   אחרי שמדביקים את קוד AdSense, מוחקים את התווית ואת הגבול המקווקו. */
.ad-slot {
  margin-block: 2rem; min-height: 120px;
  display: grid; place-items: center;
  background: var(--ad-bg); border: 1px dashed var(--line); border-radius: 6px;
  color: var(--muted); font-size: var(--step--1);
}
/* הקופסאות מוסתרות עד שיש פרסומות אמיתיות.
   כשמטמיעים AdSense עם יחידות פרסום ידניות: מוחקים את השורה הבאה, ומוחקים מכל קופסה את הטקסט "מקום לפרסומת".
   אם משתמשים בפרסומות אוטומטיות של גוגל, אפשר להשאיר את השורה הזו כמו שהיא. */
.ad-slot { display: none; }

/* ---------- עמודי טקסט (אודות, פרטיות) ---------- */
.page-head { padding-block: 2.5rem 1rem; display: grid; gap: .6rem; }
.page-head p { color: var(--muted); }
.contact-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.4rem; display: grid; gap: .8rem; max-width: 34rem; }
.field { display: grid; gap: .3rem; }
.field input, .field textarea {
  font: inherit; color: var(--text); background: var(--ground);
  border: 1px solid var(--line); border-radius: 8px; padding: .6rem .8rem;
}

/* ---------- מחולל ענן מילים ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wc-layout { display: grid; grid-template-columns: 22rem minmax(0, 1fr); gap: 2rem; align-items: start; padding-block: .5rem 2.5rem; }
.wc-controls {
  display: grid; gap: 1rem; min-width: 0;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem;
}
.wc-controls label { font-weight: 600; }
.wc-controls textarea { resize: vertical; min-height: 9rem; }
.field select {
  font: inherit; color: var(--text); background: var(--ground);
  border: 1px solid var(--line); border-radius: 8px; padding: .5rem .6rem; width: 100%;
}
.wc-row { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.wc-samples { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: var(--step--1); }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.wc-checks { border: 0; margin: 0; padding: 0; display: grid; gap: .45rem; }
.wc-checks label { font-weight: 400; display: flex; gap: .5rem; align-items: baseline; }
.wc-controls .btn { justify-content: center; }
.wc-status { font-size: var(--step--1); color: var(--muted); min-height: 1.4em; }
.wc-output { display: grid; gap: 1rem; min-width: 0; }
.wc-canvas-frame {
  background: #ffffff; border: 1px solid var(--line); border-radius: 6px; overflow: hidden;
  background-image: linear-gradient(45deg, #f1f4f9 25%, transparent 25%), linear-gradient(-45deg, #f1f4f9 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f1f4f9 75%), linear-gradient(-45deg, transparent 75%, #f1f4f9 75%);
  background-size: 20px 20px; background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}
.wc-canvas-frame canvas { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; }
.wc-actions { display: flex; flex-wrap: wrap; gap: .8rem; }
.wc-words h2 { font-size: var(--step-1); }
.wc-hint { font-size: var(--step--1); color: var(--muted); }
.chips { list-style: none; margin: .6rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.chip {
  font: inherit; font-size: var(--step--1); color: var(--text); background: var(--paper);
  border: 1px solid var(--line); border-radius: 999px; padding: .2rem .7rem; cursor: pointer;
}
.chip:hover { border-color: var(--ink); text-decoration: line-through; }
@media (max-width: 900px) { .wc-layout { grid-template-columns: minmax(0, 1fr); } }

/* ---------- פוטר ---------- */
.site-footer { margin-top: 3rem; background: var(--paper); border-top: 1px solid var(--line); }
.site-footer .wrap { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; padding-block: 2.2rem; }
.site-footer p { color: var(--muted); font-size: var(--step--1); max-width: 26rem; }
.site-footer h2 { font-size: var(--step-0); font-family: var(--font-body); font-weight: 700; margin-bottom: .5rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; font-size: var(--step--1); }
.site-footer .copy { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 1rem; }
@media (max-width: 760px) { .site-footer .wrap { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  .hero-sheet { transform: none; }
}

/* ---------- מקצועות בדף הבית ---------- */
.subjects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.2rem; }
.subject-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.3rem 1.4rem; display: grid; gap: .8rem; align-content: start;
}
.subject-head { display: flex; align-items: center; gap: 1rem; text-decoration: none; color: var(--text); }
.subject-head:hover h3 { color: var(--ink); text-decoration: underline; }
.subject-glyph {
  width: 3.4rem; height: 3.4rem; flex: none; display: grid; place-items: center;
  font-family: var(--font-display); font-size: 1.6rem; color: var(--ink); direction: ltr;
  border: 2px solid var(--ink); border-radius: 8px;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 9px 9px;
}
.subject-head h3 { font-size: var(--step-1); margin: 0; }
.subject-meta { font-size: var(--step--1); color: var(--muted); }
.subject-card p { color: var(--muted); margin: 0; }
.level-row { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; padding-top: .55rem; border-top: 1px dashed var(--line); }
.level-row > a:not(.level-name) { font-weight: 700; color: var(--ink); }
.level-name { font-weight: 700; color: var(--text); min-width: 7.5rem; }
.grade-chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.grade-chips a {
  min-width: 2.4rem; padding: .2rem .45rem; text-align: center; text-decoration: none;
  border: 1px solid var(--line); border-radius: 6px; color: var(--ink); font-weight: 700;
}
.grade-chips a:hover { border-color: var(--ink); background: var(--ground); }
@media (max-width: 760px) { .subjects { grid-template-columns: minmax(0, 1fr); } }

/* מעבר בין החלק הכמותי לאנגלית בפסיכומטרי */
.tabs { display: flex; gap: .5rem; margin-bottom: 1.4rem; }
.tabs a {
  padding: .45rem 1rem; border: 1px solid var(--line); border-radius: 999px;
  text-decoration: none; color: var(--text); font-weight: 700; background: var(--paper);
}
.subj-tabs { flex-wrap: wrap; }
.tabs a[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: #fff; }

/* קטעים קצרים באנגלית בכותרות לא נשברים באמצע */
h1 bdi, h2 bdi, h3 bdi { white-space: nowrap; }

/* ---------- כלים: מבנה משותף ---------- */
.tool-layout { display: grid; grid-template-columns: 23rem minmax(0, 1fr); gap: 2rem; align-items: start; padding-block: .5rem 2.5rem; }
/* במחולל דפי הצביעה השדות מקובצים לפי סוג הדף: הקבוצה מקבלת את אותו רווח כמו הטופס עצמו */
#cl-mandala-controls:not([hidden]), #cl-pattern-controls:not([hidden]), #cl-number-controls:not([hidden]), #cl-photo-controls:not([hidden]) { display: grid; gap: 1rem; }
.tool-controls {
  display: grid; gap: 1rem; min-width: 0;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem;
}
.tool-controls label, .tool-controls legend { font-weight: 600; }
.tool-controls textarea { resize: vertical; min-height: 9rem; }
.tool-controls .btn { justify-content: center; }
.field input[type=number] { width: 100%; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.opts { border: 0; margin: 0; padding: 0; display: grid; gap: .45rem; }
.opts label { font-weight: 400; display: flex; gap: .5rem; align-items: baseline; }
.tool-status { font-size: var(--step--1); color: var(--muted); min-height: 1.4em; margin: 0; }
.tool-status.warn { color: #9a3412; }
.tool-output { display: grid; gap: 1rem; min-width: 0; }
.tool-actions { display: flex; flex-wrap: wrap; gap: .8rem; }
.hint { font-size: var(--step--1); color: var(--muted); }
@media (max-width: 900px) { .tool-layout { grid-template-columns: minmax(0, 1fr); } }

[hidden] { display: none !important; }

/* תצוגה מקדימה של דף להדפסה. הדף מוקטן כדי שייכנס ברוחב המסך (common.js) */
.sheet-preview .sheet { zoom: var(--z, 1); }
.sheet-preview { overflow-x: auto; background: #dfe5ee; border-radius: var(--radius); padding: 1rem; }
.sheet {
  background: #fff; color: #1a2233; width: 210mm; min-height: 297mm; margin: 0 auto 1rem; padding: 14mm 14mm 10mm;
  box-shadow: 0 4px 18px rgba(23, 32, 51, .15); display: flex; flex-direction: column; font-family: var(--font-body);
}
.sheet:last-child { margin-bottom: 0; }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem;
              border-bottom: 2px solid #1d3a8a; padding-bottom: 4mm; margin-bottom: 6mm; }
.sheet-head h2 { font-family: var(--font-display); font-size: 22pt; color: #1d3a8a; margin: 0; line-height: 1.15; }
.sheet-head .sub { font-size: 10pt; color: #5b6578; margin: 1mm 0 0; }
.sheet-fields { font-size: 11pt; line-height: 2.1; white-space: nowrap; }
.sheet-head .sheet-title { flex: 1; }
.sheet-head .sub .sheet-field { white-space: nowrap; margin-inline-start: .3em; }
.sheet-head .sub .sheet-field > span { display: inline-block; min-width: 38mm; border-bottom: 1px solid #8a94a6; }
/* קוד ה-QR בצד שמאל, והתווית מימינו, צמודה לחלק העליון שלו – כמו בדפי העבודה */
.sheet-qr { flex: none; display: flex; direction: ltr; align-items: flex-start; gap: 1.5mm; align-self: flex-end; }
.sheet-qr > svg { display: block; width: 22mm; height: 22mm; }
.sheet-qr-label { position: relative; display: inline-flex; align-items: center; height: 6.2mm; min-width: 21.5mm; color: #1d3a8a;
                  padding: .85mm 2mm 0 3.6mm; direction: rtl; }
.sheet-qr-label svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.sheet-qr-label span { position: relative; flex: 1; text-align: center; color: #fff; font-weight: bold; font-size: 8pt; line-height: 1; white-space: nowrap; }
.sheet-fields span { display: inline-block; min-width: 40mm; border-bottom: 1px solid #8a94a6; }
.sheet-body { flex: 1; }
.sheet-foot { text-align: center; font-size: 8pt; color: #8a94a6; margin-top: 6mm; }
.sheet-foot bdi { direction: ltr; }

@media print {
  @page { size: A4; margin: 0; }
  body { background: #fff !important; }
  .site-header, .site-footer, .skip-link, .crumbs, .page-head, .tool-controls, .tool-actions, .prose, .ad-slot, .tabs, .search-panel, .bg-caller,
  .tool-screen-only, .tool-output > :not(.sheet-preview) { display: none !important; }
  main, .wrap, .tool-layout, .tool-output, .sheet-preview { display: block !important; padding: 0 !important; margin: 0 !important;
    background: none !important; max-width: none !important; overflow: visible !important; }
  .sheet-preview[hidden] { display: block !important; }
  .sheet-preview .sheet { zoom: 1 !important; }
  .sheet { box-shadow: none; margin: 0; width: 210mm; min-height: 0; height: 296mm; page-break-after: always; break-after: page; overflow: hidden; }
  .sheet:last-child { page-break-after: auto; break-after: auto; }
}

/* ---------- ממוצע משוקלל ---------- */
.mode-switch { display: flex; gap: .4rem; flex-wrap: wrap; }
.mode-switch label { flex: 1; min-width: 8rem; text-align: center; padding: .55rem .6rem; border: 1px solid var(--line);
                     border-radius: 8px; cursor: pointer; background: var(--ground); font-weight: 700; }
.mode-switch input { position: absolute; opacity: 0; pointer-events: none; }
.mode-switch input:checked + span { color: var(--ink); }
.mode-switch label:has(input:checked) { border-color: var(--ink); background: var(--paper); box-shadow: inset 0 0 0 1px var(--ink); }
.mode-switch label:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }
.grades-table { width: 100%; border-collapse: collapse; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.grades-table th { text-align: right; font-size: var(--step--1); color: var(--muted); padding: .6rem .5rem; border-bottom: 1px solid var(--line); }
.grades-table td { padding: .35rem .4rem; border-bottom: 1px solid var(--line); }
.grades-table tr:last-child td { border-bottom: 0; }
.grades-table input { width: 100%; font: inherit; color: var(--text); background: var(--ground); border: 1px solid var(--line);
                      border-radius: 6px; padding: .45rem .55rem; min-width: 0; }
.grades-table td.num { width: 7.5rem; }
.grades-table td.del { width: 2.6rem; text-align: center; }
.icon-btn { background: none; border: 1px solid transparent; border-radius: 6px; width: 2.1rem; height: 2.1rem; cursor: pointer;
            color: var(--muted); font-size: 1.2rem; line-height: 1; }
.icon-btn:hover { border-color: var(--line); color: #9a3412; }
.result-card { background: var(--paper); border: 2px solid var(--ink); border-radius: var(--radius); padding: 1.2rem 1.4rem;
               display: grid; gap: .3rem; }
.result-card .big { font-family: var(--font-display); font-size: 3rem; color: var(--ink); line-height: 1; }
.result-card .label { color: var(--muted); font-weight: 600; }
.need-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.4rem; display: grid; gap: .7rem; }
.need-card h2 { font-size: var(--step-1); margin: 0; }
.need-row { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.need-row input { width: 6rem; font: inherit; background: var(--ground); border: 1px solid var(--line); border-radius: 6px; padding: .45rem .55rem; }
.need-answer { font-weight: 700; font-size: var(--step-1); color: var(--ink); }
.need-answer.bad { color: #9a3412; }
@media (max-width: 600px) { .grades-table td.num { width: 5.2rem; } .grades-table th:first-child, .grades-table td.name { width: 38%; } }

/* ---------- קבוצות ---------- */
.groups-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 1rem; }
.group-card { background: var(--paper); border: 1px solid var(--line); border-top: 4px solid var(--ink); border-radius: var(--radius); padding: 1rem 1.1rem; }
.group-card h3 { margin: 0 0 .5rem; font-size: var(--step-1); color: var(--ink); }
.group-card ol { margin: 0; padding-inline-start: 1.3rem; display: grid; gap: .2rem; }
.sheet .groups-grid { grid-template-columns: repeat(3, 1fr); gap: 5mm; }
.sheet .group-card { border: 1.2px solid #b9c6da; border-top: 3px solid #1d3a8a; border-radius: 2.5mm; padding: 3mm 4mm; break-inside: avoid; }
.sheet .group-card h3 { font-size: 13pt; }
.sheet .group-card li { font-size: 11.5pt; }

/* ---------- מחולל דפי תרגול ---------- */
.ex-grid { display: grid; gap: 9mm 8mm; direction: rtl; }
.ex-item { direction: ltr; display: flex; align-items: center; justify-content: flex-start; gap: 2mm; font-size: 15pt; white-space: nowrap; }
.ex-item .n { font-size: 9pt; color: #8a94a6; min-width: 6mm; }
.ex-item .ans-line { display: inline-block; width: 20mm; border-bottom: 1.5px solid #1a2233; height: 1.1em; }
.ex-item .ans { color: #1d3a8a; font-weight: 700; }
.fr { display: inline-flex; flex-direction: column; text-align: center; vertical-align: middle; line-height: 1.15; font-size: 88%; margin: 0 .5mm; }
.fr > span:last-child { border-top: 1.4px solid currentColor; }
.fr-mixed { display: inline-flex; align-items: center; }
/* מחוללי דפי התרגול: תרגיל בעברית, תרגיל במאונך, מטריצות */
.ex-item.rtl { direction: rtl; white-space: normal; font-size: 13pt; align-items: baseline; }
.ex-item.rtl .q { flex: 1; }
.ex-item .q { line-height: 1.5; }
.ex-item { min-width: 0; }
/* תרגיל במספרים: קו התשובה מתקצר כשהעמודה צרה, כדי שהתרגיל לא יחרוג מהדף */
.ex-item:not(.rtl):not(.multi) .q { display: flex; align-items: center; gap: .3em; min-width: 0; }
.ex-item:not(.rtl):not(.multi) .q .ans-line { flex: 0 1 auto; min-width: 8mm; }
.ex-item:not(.rtl):not(.multi) .q .ans { min-width: 0; white-space: normal; }
.vmul { display: inline-flex; flex-direction: column; align-items: flex-end; font-size: 16pt; line-height: 1.35; min-width: 22mm; }
.vmul .vres { border-top: 1.5px solid #1a2233; align-self: stretch; text-align: right; min-height: 1.35em; margin-top: .5mm; }
.mx { display: inline-grid; gap: .5mm 3mm; vertical-align: middle; padding: .5mm 2mm; margin: 0 1mm; text-align: center;
      border-left: 1.5px solid currentColor; border-right: 1.5px solid currentColor; border-radius: 2mm; }
.ex-item .ans .mx { color: #1d3a8a; }
.mx-blank { display: inline-block; vertical-align: middle; border-left: 1.5px solid #1a2233; border-right: 1.5px solid #1a2233; border-radius: 2mm; margin: 0 1mm; }
.match { display: grid; grid-template-columns: 1fr 1fr; gap: 6mm 14mm; font-size: 14pt; }
.match .col { display: grid; gap: 5mm; align-content: start; }
.match .col div { display: flex; gap: 3mm; align-items: center; }
.match .en { direction: ltr; }
.match .ans-line { display: inline-block; width: 12mm; border-bottom: 1.5px solid #1a2233; height: 1.1em; }
.match .ans { color: #1d3a8a; font-weight: 700; }

/* ---------- תפזורת ---------- */
.ws-grid { border-collapse: collapse; margin: 0 auto; }
.ws-grid td { width: var(--cell, 10mm); height: var(--cell, 10mm); text-align: center; vertical-align: middle;
              font-size: var(--fs, 15pt); font-weight: 700; border: 1px solid #ccd6e6; font-family: 'Assistant', Arial, sans-serif; }
.ws-grid td.hit { background: #dbe5f8; color: #1d3a8a; }
.ws-words { columns: 3; column-gap: 8mm; margin-top: 8mm; font-size: 12pt; list-style: none; padding: 0; }
.ws-words li { padding: 1mm 0; break-inside: avoid; }
.ws-words li::before { content: "☐ "; color: #8a94a6; }

/* ---------- כרטיסיות ---------- */
.fc-fold { display: grid; grid-auto-rows: 1fr; flex: 1; }
.fc-row { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1.2px dashed #8a94a6; }
.fc-row:first-child { border-top: 1.2px dashed #8a94a6; }
.fc-side { display: grid; place-items: center; padding: 3mm 6mm; text-align: center; font-weight: 700; overflow-wrap: anywhere; }
.fc-side + .fc-side { border-inline-start: 1.2px dotted #1d3a8a; }
.fc-side.back { color: #1d3a8a; }
.fc-grid { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; flex: 1; border: 1.2px dashed #8a94a6; }
.fc-grid .fc-side { border: 1.2px dashed #8a94a6; }
.fc-note { font-size: 9pt; color: #5b6578; margin: 0 0 3mm; }

/* רשימת הכלים */
.tools-list { display: grid; gap: 1rem; }
.tool-card h2 { font-size: var(--step-1); margin: 0 0 .3rem; }
.tool-links { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.tool-links a { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: .9rem; height: 100%; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
                padding: 1rem 1.2rem; text-decoration: none; color: var(--text); }
.tool-links a:hover { border-color: var(--ink); }
.tool-links strong { color: var(--ink); font-size: var(--step-0); }
.tool-text { display: grid; gap: .15rem; }
.tool-icon {
  width: 2.9rem; height: 2.9rem; display: grid; place-items: center; color: var(--ink);
  border: 2px solid var(--ink); border-radius: 8px;
  background-color: var(--paper);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 8px 8px;
}
.tool-icon svg { width: 1.65rem; height: 1.65rem; }
.tool-text > span { color: var(--muted); font-size: var(--step--1); }
@media (max-width: 760px) { .tool-links { grid-template-columns: minmax(0, 1fr); } }

/* ---------- חיפוש באתר ---------- */
.search-btn {
  order: 5; display: grid; place-items: center; width: 2.3rem; height: 2.3rem; flex: none; font-size: var(--step-0);
  background: none; border: 0; border-radius: 50%; color: var(--text); cursor: pointer;
  transition: background-color .15s, color .15s;
}
.search-btn svg { width: 1.15em; height: 1.15em; }   /* באותו גודל של הטקסט בתפריט */
.search-btn:hover, .search-btn:focus-visible { color: var(--ink); background: var(--ground); }
.search-btn:focus-visible, .menu-toggle:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.site-header .wrap > .logo { order: 1; }
.site-header .wrap > .nav { order: 4; margin-inline-start: auto; }
@media (min-width: 941px) { .site-header .wrap { justify-content: flex-start; } .menu-toggle { order: 3; } }
.search-panel { position: fixed; inset: 0; z-index: 50; background: rgba(23, 32, 51, .45); display: grid; justify-items: center; align-items: start; padding: 9vh 1rem 1rem; }
.search-panel[hidden] { display: none; }
.search-box { width: min(40rem, 100%); background: var(--paper); border-radius: 14px; box-shadow: 0 24px 60px rgba(0, 0, 0, .25);
              overflow: hidden; display: grid; max-height: 78vh; grid-template-rows: auto minmax(0, 1fr) auto; }
.search-row { display: flex; align-items: center; gap: .7rem; padding: .9rem 1.1rem; border-bottom: 1px solid var(--line); color: var(--muted); }
.search-row input { flex: 1; min-width: 0; font: inherit; font-size: var(--step-1); border: 0; outline: 0; background: none; color: var(--text); }
.search-row input::-webkit-search-cancel-button { display: none; }
.search-close { display: grid; place-items: center; width: 2.2rem; height: 2.2rem; flex: none; color: var(--muted);
                background: none; border: 1px solid transparent; border-radius: 8px; cursor: pointer; }
.search-close:hover, .search-close:focus-visible { color: var(--ink); background: var(--ground); border-color: var(--line); }
.search-results { list-style: none; margin: 0; padding: .4rem; overflow-y: auto; }
.search-results:empty { display: none; }
.search-results a { display: grid; gap: .1rem; padding: .6rem .8rem; border-radius: 8px; text-decoration: none; color: var(--text); }
.search-results a .st { font-weight: 700; color: var(--ink); }
.search-results a .ss { font-size: var(--step--1); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-results a mark { background: #fdf0b8; color: inherit; border-radius: 2px; }
.search-results [aria-selected="true"] a, .search-results a:hover { background: var(--ground); }
.search-empty { margin: 0; padding: 1rem 1.2rem 1.2rem; color: var(--muted); }
@media (max-width: 940px) {
  .search-btn { order: 2; margin-inline-start: auto; }
  .menu-toggle { order: 3; }
  .site-header .wrap > .nav { order: 4; margin-inline-start: 0; }
}

/* בטלפון: לכפתור החיפוש ולכפתור "תפריט" יש מסגרת, ושניהם באותו גובה בדיוק */
@media (max-width: 940px) {
  .search-btn, .menu-toggle { height: 2.6rem; border: 1px solid var(--line); border-radius: 8px; }
  .search-btn { width: 2.6rem; }
  .menu-toggle { padding: 0 .9rem; line-height: 1; }
  .search-btn:hover, .search-btn:focus-visible, .menu-toggle:hover, .menu-toggle[aria-expanded="true"] { border-color: var(--ink); }
}

.subject-glyph svg { width: 2rem; height: 2rem; }

/* ---------- קוד QR ---------- */
.qr-preview { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem;
              display: grid; justify-items: center; gap: .6rem; }
.qr-preview canvas { width: min(300px, 100%); height: auto; image-rendering: pixelated; }
.qr-caption-preview { margin: 0; font-weight: 700; text-align: center; min-height: 1.4em; }
.qr-per { display: inline-flex; align-items: center; gap: .4rem; font-size: var(--step--1); color: var(--muted); }
.qr-per select { font: inherit; padding: .35rem .5rem; border: 1px solid var(--line); border-radius: 6px; background: var(--ground); }
.qr-grid { display: grid; gap: 6mm; align-content: start; }
.qr-sticker { border: 1px dashed #b9c6da; border-radius: 3mm; padding: 4mm; text-align: center; display: grid; justify-items: center; gap: 2mm; }
.qr-sticker img { width: 100%; max-width: 150mm; image-rendering: pixelated; }
.qr-sticker p { margin: 0; font-weight: 700; font-size: 11pt; }
.qr-sheet-page { justify-content: flex-start; }

/* ---------- בינגו ---------- */
.bg-cards { display: grid; gap: 8mm; justify-items: center; }
.bg-card { width: 100%; max-width: 170mm; }
.bg-card-no { margin: 0 0 2mm; font-size: 9pt; color: #8a94a6; }
.bg-grid { width: 100%; border-collapse: collapse; table-layout: fixed; }
.bg-grid td { border: 1.6px solid #1d3a8a; text-align: center; vertical-align: middle; font-weight: 700; padding: 1.5mm;
              overflow-wrap: anywhere; line-height: 1.2; aspect-ratio: 1 / 1; }
.bg-cards:not(.two) .bg-grid td { height: 34mm; }
.bg-cards.two .bg-grid td { height: 22mm; }
.bg-cards.two .bg-card { max-width: 120mm; }
.bg-free { color: #b8860b; font-size: 18pt; background: #fdf6dc; }
.bg-free small { font-size: 9pt; color: #5b6578; }
.bg-calls { columns: 2; column-gap: 10mm; margin: 0; padding-inline-start: 7mm; font-size: 12pt; }
.bg-calls li { padding: 1.4mm 0; break-inside: avoid; }
.bg-calls .cb { display: inline-block; width: 3.4mm; height: 3.4mm; border: 1.2px solid #1a2233; border-radius: .6mm; margin-inline-end: 2mm; vertical-align: middle; }
.bg-calls small { color: #5b6578; }
.bg-caller { position: fixed; inset: 0; z-index: 60; background: #1d3a8a; color: #fff; display: grid;
             grid-template-rows: auto 1fr auto auto auto; justify-items: center; align-items: center; padding: 2rem 1.5rem; text-align: center; }
.bg-caller-sub:empty { display: none; }
.bg-caller[hidden] { display: none; }
.bg-caller-close { position: absolute; top: 1rem; left: 1rem; background: none; border: 0; color: #fff; cursor: pointer; padding: .5rem; border-radius: 8px; }
.bg-caller-close:hover, .bg-caller-close:focus-visible { background: rgba(255,255,255,.12); }
.bg-caller-count { margin: 0; opacity: .8; font-size: 1.1rem; }
.bg-caller-item { margin: 0; font-family: var(--font-display); font-size: clamp(3rem, 12vw, 9rem); line-height: 1.1; overflow-wrap: anywhere; }
.bg-caller-sub { margin: 0; opacity: .8; }
.bg-caller-done { list-style: none; margin: 1rem 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; max-width: 60rem; }
.bg-caller-done li { background: rgba(255,255,255,.14); border-radius: 999px; padding: .2rem .8rem; font-size: .95rem; }

/* ---------- דפי צביעה ---------- */
.cl-art { display: grid; place-items: center; flex: 1; }
.cl-art svg, .cl-art img { width: 100%; max-width: 180mm; max-height: 235mm; height: auto; object-fit: contain; }
.sheet .cl-art { min-height: 230mm; }
.nb-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem 1.2rem; list-style: none; margin: 0 0 4mm; padding: 0; font-size: 12pt; }
.nb-legend li { display: flex; align-items: center; gap: .35rem; }
.nb-legend .sw { width: 5mm; height: 5mm; border: 1px solid #1a2233; border-radius: 1mm; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
.nb-wrap { display: grid; place-items: center; }
.nb-wrap svg { width: 100%; max-width: 180mm; height: auto; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
.field input[type=color] { width: 100%; height: 2.6rem; padding: .25rem; cursor: pointer; }

/* ---------- מחשבון ריבית דריבית ---------- */
.ci-split { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; color: var(--muted); }
.ci-split b { color: var(--text); }
.ci-dot { display: inline-block; width: .7rem; height: .7rem; border-radius: 2px; margin-inline-end: .35rem; vertical-align: baseline; }
.ci-dot.dep, .ci-bar .dep { background: #9fb3d9; }
.ci-dot.int, .ci-bar .int { background: var(--ink); }
.ci-chart { display: flex; align-items: flex-end; gap: 3px; height: 13rem; background: var(--paper); border: 1px solid var(--line);
            border-radius: var(--radius); padding: 1rem .8rem 1.8rem; direction: ltr; }
.ci-bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; position: relative; min-width: 0; }
.ci-bar span { display: block; width: 100%; }
.ci-bar .int { border-radius: 3px 3px 0 0; }
.ci-bar small { position: absolute; bottom: -1.4rem; left: 0; right: 0; text-align: center; font-size: .72rem; color: var(--muted); }
.ci-table td, .ci-table th { text-align: center; }
.ci-table td { padding: .45rem .4rem; }
.disclaimer-note { border: 1px solid #e3b4ae; background: #fdf3f2; color: #7a2a22; border-radius: var(--radius); padding: .8rem 1rem; font-weight: 600; }

/* ---------- תפריט עליון: מקום לכל הכפתורים ----------
   הכותרת רחבה מעט יותר מתוכן הדף. מ-1200px ומעלה הגדלים והרווחים זהים לרגיל;
   בין 941 ל-1199px הטקסט והרווחים קטנים בהדרגה כדי שהכול ייכנס בשורה אחת. הלוגו לא משתנה. */
.site-header .wrap { max-width: calc(var(--wrap) + 2rem); }
@media (min-width: 941px) {
  .nav, .search-btn { font-size: clamp(14px, 1.6px + 1.3vw, 17.2px); }
  .nav ul { gap: clamp(8px, -32px + 4.3vw, 19.2px); }
}

/* במסכים צרים מאוד (320px): קישור ארוך או רשימת בחירה עם טקסט ארוך לא דוחפים את העמוד הצידה */
.prose > *, .tool-controls > * { min-width: 0; }
.prose a { overflow-wrap: anywhere; }
.tool-controls select, .tool-controls textarea, .tool-controls input:not([type=checkbox]):not([type=radio]) { max-width: 100%; min-width: 0; }
.tool-controls .btn { white-space: normal; }
@media (max-width: 360px) {
  .site-header .wrap { gap: .5rem; }
  .menu-toggle { padding: 0 .65rem; }
  .logo { font-size: 1.4rem; }
}

/* ---------- טופס יצירת קשר ---------- */
.contact-form { display: grid; gap: .9rem; }
.contact-form .btn { justify-content: center; }
.contact-form .btn[disabled] { opacity: .6; cursor: wait; }
.contact-form { position: relative; }
.contact-form .hp { position: absolute; top: 0; right: 0; width: 1px; height: 1px; margin: 0; opacity: 0; clip-path: inset(50%); overflow: hidden; pointer-events: none; }
.form-status { margin: 0; min-height: 1.4em; font-weight: 600; color: var(--muted); }
.form-status.good { color: #1f7a3d; }
.form-status.bad { color: #9a3412; }
.see-also a { margin-inline-start: .7rem; white-space: nowrap; }

/* בפונט Assistant הכפתור נכנס בשורה אחת גם ב-320 פיקסלים. אם הפונט לא נטען (Arial במקומו), צריך חצי פיקסל פחות */
@media (max-width: 340px) { .btn-download { font-size: 20.3px; } }
