/* ============================================================
   סקר נופי פרת · מערכת עיצוב v3 ("פוסטר" רגוע בצבעי מעיין)
   קרנטינה לכותרות, רוביק לטקסט. בלוקים צבעוניים לכל תחום,
   פלטה חמה של מדבר ומעיין. כל הצבעים כאן, בטוקנים.
   ============================================================ */

:root {
  --paper:        #F6F1E7;
  --paper-deep:   #EDE4D3;
  --surface:      #FFFDF9;
  --ink:          #1E2A24;
  --ink-soft:     #4D5A52;
  --muted:        #656C64;
  --line:         #E6DCCB;
  --line-strong:  #CFC3AE;

  /* צבעי התחומים (טקסט לבן עליהם עומד ב-4.5:1, חוץ מאוקר שעליו כותבים בדיו) */
  --teal:  #0E6B5B;  --teal-deep:  #0A4F44;  --teal-soft:  #DCEFE9;
  --terra: #BF5533;  --terra-deep: #9A4025;  --terra-soft: #F7E3DA;
  --ochre: #E2A73E;  --ochre-deep: #A87A16;  --ochre-soft: #F8EDD3;
  --olive: #6B7A2E;  --olive-deep: #525E20;  --olive-soft: #ECEFD9;
  --plum:  #8E5A86;  --plum-deep:  #6C4266;  --plum-soft:  #F2E6F0;
  --sky:   #3F7A93;  --sky-deep:   #2D5F74;  --sky-soft:   #E1EDF3;
  --night: #0F4A40;  /* רקע הפוסטר */
  --sand:  #E8D9BC;
  --spring:#8FD0C2;
  --danger:#B3402A;

  --action:      var(--terra);   /* כפתור הפעולה הראשי, בכל המסכים */
  --action-deep: var(--terra-deep);

  --font-display: 'Karantina', 'Rubik', sans-serif;
  --font-body: 'Rubik', -apple-system, 'Segoe UI', sans-serif;

  --r-xl: 28px;
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(30, 42, 36, .05), 0 3px 10px rgba(30, 42, 36, .05);
  --shadow-md: 0 10px 28px rgba(30, 42, 36, .12);
  --shadow-lg: 0 24px 60px rgba(30, 42, 36, .24);

  --maxw: 600px;
}

/* תחום פעיל: --hue הוא צבע הבלוק, --hue-on הטקסט שעליו */
.hue-green { --hue: var(--teal);  --hue-deep: var(--teal-deep);  --hue-soft: var(--teal-soft);  --hue-on: #fff; }
.hue-terra { --hue: var(--terra); --hue-deep: var(--terra-deep); --hue-soft: var(--terra-soft); --hue-on: #fff; }
.hue-olive { --hue: var(--olive); --hue-deep: var(--olive-deep); --hue-soft: var(--olive-soft); --hue-on: #fff; }
.hue-gold  { --hue: var(--ochre); --hue-deep: var(--ochre-deep); --hue-soft: var(--ochre-soft); --hue-on: var(--ink); }
.hue-plum  { --hue: var(--plum);  --hue-deep: var(--plum-deep);  --hue-soft: var(--plum-soft);  --hue-on: #fff; }
.hue-sky   { --hue: var(--sky);   --hue-deep: var(--sky-deep);   --hue-soft: var(--sky-soft);   --hue-on: #fff; }

/* ── בסיס ─────────────────────────────────────────────── */

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  font-size: 16px;
  direction: rtl;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: .95; letter-spacing: 0; }

h3 { font-family: var(--font-body); font-weight: 700; line-height: 1.25; }

a { color: var(--teal); }

img, svg { max-width: 100%; }

button { font-family: inherit; cursor: pointer; color: inherit; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

input, textarea, select { font-family: inherit; font-size: 16px; color: inherit; }

:focus-visible { outline: 3px solid var(--ochre); outline-offset: 2px; border-radius: 8px; }

::selection { background: var(--ochre-soft); }

svg.ic { width: 1em; height: 1em; flex: none; display: inline-block; vertical-align: -0.14em; }

.ic-txt { display: inline-block; line-height: 1; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

.wrap { max-width: var(--maxw); margin-inline: auto; padding: 0 16px 120px; }

.wide { max-width: 1080px; }

/* ── כותרת עליונה ─────────────────────────────────────── */

.topbar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(246, 241, 231, .86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(207, 195, 174, .45);
}

.topbar-in {
  max-width: var(--maxw); margin-inline: auto;
  padding: 8px 16px;
  display: flex; align-items: center; gap: 8px;
  min-height: 58px;
}

.topbar.wide-bar .topbar-in { max-width: 1080px; }

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 30px;
  line-height: 1;
  color: var(--ink);
  display: flex; align-items: center; gap: 8px;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark { width: 28px; height: 28px; flex: none; display: block; }

.spacer { flex: 1; }

.topbar-btn {
  height: 40px; min-width: 40px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-weight: 500;
  font-size: 14px;
  padding: 0 13px;
  border-radius: 99px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  white-space: nowrap;
  transition: background .15s ease, border-color .15s ease;
}

.topbar-btn svg.ic { font-size: 18px; }

.topbar-btn.icon-only { padding: 0; width: 40px; }

.topbar-btn:hover { border-color: var(--line-strong); }

.progress-rail { height: 6px; background: var(--paper-deep); border-radius: 99px; overflow: hidden; flex: 1; max-width: 110px; }

.progress-fill { height: 100%; width: 0; background: var(--teal); border-radius: 99px; transition: width .6s cubic-bezier(.22, 1, .36, 1); }

.progress-label { font-size: 13px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 500; }

@media (max-width: 460px) {
  .topbar-in { gap: 8px; padding-inline: 12px; }
  .brand { font-size: 27px; }
  .progress-rail { max-width: 90px; }
}

/* באנר תצוגה מקדימה: האתר לא מחובר לשרת */
.preview-banner {
  background: var(--ochre-soft);
  color: #6B5320;
  border-bottom: 1px solid #E9CB8A;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  padding: 7px 16px;
  line-height: 1.4;
}

.preview-banner[hidden] { display: none; }

/* ── כפתורים ──────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 54px;
  padding: 0 26px;
  border: none;
  border-radius: 99px;
  font-weight: 600;
  font-size: 17px;
  text-decoration: none;
  transition: transform .12s ease, box-shadow .12s ease, background .15s ease;
}

.btn svg.ic { font-size: 20px; }

.btn-primary { background: var(--action); color: #fff; box-shadow: 0 4px 0 var(--action-deep); }

.btn-primary:hover { background: #C95F3D; }

.btn-primary:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--action-deep); }

.btn-accent { background: var(--ochre); color: var(--ink); box-shadow: 0 4px 0 var(--ochre-deep); }

.btn-accent:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ochre-deep); }

.btn-ghost { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line-strong); }

.btn-ghost:hover { box-shadow: inset 0 0 0 1.5px var(--ink-soft); }

.btn-block { width: 100%; }

.btn[disabled] { opacity: .5; cursor: not-allowed; box-shadow: none; transform: none; }

.btn-sm { min-height: 42px; padding: 0 18px; font-size: 15px; }

.btn-round { width: 54px; min-width: 54px; padding: 0; flex: none; }

.link-btn {
  background: none; border: none;
  font-size: 15px; font-weight: 500;
  color: var(--ink-soft);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 5px;
  padding: 10px 6px;
}

.link-btn:hover { color: var(--ink); text-decoration-color: var(--ink-soft); }

/* ── מסך פתיחה: פוסטר ─────────────────────────────────── */

.land { padding-top: 14px; }

.poster {
  position: relative;
  height: 440px;
  border-radius: var(--r-xl);
  overflow: hidden;
  background: var(--night);
  color: #FBF7F0;
  isolation: isolate;
  box-shadow: var(--shadow-md);
}

.poster-art { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }

.poster-copy { position: absolute; top: 92px; right: 24px; left: 24px; }

.poster-kicker { font-size: 14px; font-weight: 500; color: #BFDCD4; display: flex; align-items: center; gap: 8px; }

.poster-kicker::before { content: ''; width: 20px; height: 2px; border-radius: 2px; background: var(--ochre); }

.poster h1 { font-size: 92px; line-height: .82; margin: 10px 0 14px; }

.poster h1 em { font-style: normal; display: block; color: #F0BE5A; }

.poster-sub { font-size: 16px; line-height: 1.45; color: #DCEBE6; max-width: 250px; }

.sticker {
  position: absolute;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-weight: 600; color: var(--ink);
  line-height: 1.05; text-align: center;
}

.sticker-time {
  top: 22px; left: 22px;
  width: 84px; height: 84px; border-radius: 50%;
  background: var(--ochre);
  flex-direction: column; gap: 0;
  font-size: 13px;
  transform: rotate(-10deg);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .18);
}

.sticker-time b { font-family: var(--font-display); font-size: 40px; line-height: .8; }

.sticker-raffle {
  bottom: 26px; left: 20px;
  background: var(--surface);
  border-radius: 14px;
  padding: 9px 13px;
  font-size: 14px;
  transform: rotate(5deg);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .18);
}

.sticker-raffle svg.ic { color: var(--terra); font-size: 18px; }

.land-cta { display: grid; gap: 4px; margin-top: 20px; }

.land-cta .link-btn { justify-self: center; }

.land-note { text-align: center; color: var(--muted); font-size: 14px; margin-top: 8px; line-height: 1.5; }

@media (min-width: 560px) {
  .poster { height: 470px; }
  .poster h1 { font-size: 110px; }
  .poster-sub { max-width: 300px; }
}

/* ── מסך התחומים ──────────────────────────────────────── */

.screen-head { margin: 22px 2px 14px; }

.screen-head h2 { font-size: 54px; color: var(--ink); }

.screen-head p { color: var(--muted); font-size: 15px; margin-top: 4px; }

.profile-strip {
  width: 100%;
  display: flex; align-items: center; gap: 12px;
  text-align: right;
  background: var(--night);
  color: #fff;
  border: none;
  border-radius: var(--r-lg);
  padding: 14px 16px;
  margin-bottom: 12px;
  transition: transform .15s ease, box-shadow .15s ease;
}

.profile-strip:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.profile-strip .p-icon {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--ochre); color: var(--ink);
  display: grid; place-items: center; font-size: 22px; flex: none;
}

.profile-strip .p-body { flex: 1; min-width: 0; }

.profile-strip .p-title { display: block; font-weight: 600; font-size: 17px; }

.profile-strip .p-sub { display: block; font-size: 13.5px; color: #BFDCD4; line-height: 1.4; }

.profile-strip .p-status { flex: none; font-family: var(--font-display); font-size: 28px; color: #F0BE5A; line-height: 1; }

.profile-strip.is-done { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }

.profile-strip.is-done .p-icon { background: var(--teal-soft); color: var(--teal); }

.profile-strip.is-done .p-sub { color: var(--muted); }

.profile-strip.is-done .p-status { font-family: var(--font-body); font-size: 20px; color: var(--teal); }

.cat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.cat-card {
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start;
  min-height: 140px;
  padding: 15px 15px 14px;
  border: none;
  border-radius: var(--r-lg);
  background: var(--hue);
  color: var(--hue-on);
  text-align: right;
  overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease;
}

.cat-card::after {
  content: ''; position: absolute; width: 120px; height: 120px; border-radius: 50%;
  left: -46px; bottom: -58px; background: rgba(255, 255, 255, .12); pointer-events: none;
}

.cat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.cat-icon { font-size: 26px; display: block; }

.cat-count { position: absolute; top: 10px; left: 14px; font-family: var(--font-display); font-weight: 700; font-size: 40px; line-height: 1; font-variant-numeric: tabular-nums; }

.cat-title { margin-top: auto; font-weight: 700; font-size: 16.5px; line-height: 1.2; }

.cat-meta { font-size: 13px; opacity: .85; margin-top: 2px; }

.cat-card.cat-done .cat-count { display: flex; align-items: center; gap: 4px; }

.raffle-strip {
  display: flex; align-items: center; gap: 12px;
  border: 1.5px dashed #D9B567;
  background: rgba(248, 237, 211, .55);
  border-radius: var(--r-lg);
  padding: 12px 16px;
  margin-top: 12px;
}

.raffle-strip .r-icon { font-size: 24px; color: var(--terra); flex: none; display: grid; }

.raffle-strip .txt { flex: 1; font-size: 14.5px; color: #5C4A1E; line-height: 1.4; }

.raffle-strip strong { font-weight: 700; }

/* ── מסך תחום ─────────────────────────────────────────── */

.cat-hero {
  position: relative;
  margin: 18px 0 14px;
  border-radius: var(--r-xl);
  background: var(--hue);
  color: var(--hue-on);
  padding: 20px 20px 22px;
  overflow: hidden;
}

.cat-hero::after {
  content: ''; position: absolute; width: 200px; height: 200px; border-radius: 50%;
  left: -70px; bottom: -110px; background: rgba(255, 255, 255, .13);
}

.cat-hero .cat-icon { font-size: 30px; }

.cat-hero h2 { font-size: 56px; margin-top: 10px; }

.cat-hero p { font-size: 15px; opacity: .9; margin-top: 4px; }

.chap-list { display: grid; gap: 8px; margin-top: 14px; }

.chap-row {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  min-height: 70px;
  padding: 12px 14px;
  background: var(--surface);
  border: none;
  box-shadow: inset 0 0 0 1px var(--line);
  border-radius: var(--r-md);
  text-align: right;
  transition: box-shadow .15s ease, transform .15s ease;
}

.chap-row:hover { box-shadow: inset 0 0 0 1.5px var(--hue, var(--teal)); transform: translateX(-2px); }

.chap-row .ch-icon {
  width: 44px; height: 44px; border-radius: 14px;
  background: var(--hue-soft, var(--teal-soft)); color: var(--hue-deep, var(--teal));
  display: grid; place-items: center; font-size: 21px; flex: none;
}

.chap-row .ch-body { flex: 1; min-width: 0; }

.chap-row .ch-title { display: block; font-weight: 600; font-size: 16.5px; }

.chap-row .ch-meta { display: block; font-size: 13px; color: var(--muted); line-height: 1.35; }

.chap-row .ch-status { flex: none; font-size: 13px; font-weight: 600; border-radius: 99px; padding: 4px 11px; background: var(--paper-deep); color: var(--ink-soft); display: inline-flex; align-items: center; gap: 4px; }

.chap-row.is-done .ch-status { background: var(--hue, var(--teal)); color: var(--hue-on, #fff); }

.chap-row.is-partial .ch-status { background: var(--ochre-soft); color: #6B5320; }

/* ── מסך נושא (פרק) ───────────────────────────────────── */

.chapter-header { display: flex; align-items: center; gap: 12px; margin: 20px 2px 6px; }

.chapter-header .ch-icon {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--hue, var(--teal)); color: var(--hue-on, #fff);
  display: grid; place-items: center; font-size: 26px; flex: none;
}

.chapter-header h2 { font-size: 54px; color: var(--ink); }

.chapter-header .ch-desc { color: var(--muted); font-size: 14px; margin-top: 2px; }

.chapter-pos { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin: 6px 2px 14px; }

.chapter-pos .pos-bar { flex: 1; max-width: 120px; height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; margin-inline-start: auto; }

.chapter-pos .pos-bar i { display: block; height: 100%; background: var(--hue, var(--teal)); border-radius: 99px; }

.ch-intro, .ch-outro {
  background: var(--hue-soft, var(--teal-soft));
  border-radius: var(--r-lg);
  padding: 15px 17px;
  margin-bottom: 12px;
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--ink);
  white-space: pre-line;
}

.ch-outro { text-align: center; margin-top: 4px; }

.q-card {
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 18px 16px 18px;
  margin-bottom: 12px;
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow-sm);
}

.q-card.hidden-q { display: none; }

.q-text { font-weight: 600; font-size: 17.5px; line-height: 1.45; }

.q-help { font-size: 14px; color: var(--muted); margin-top: 2px; }

.q-body { margin-top: 14px; }

/* סולם: עיגולים ("מדבקות"). 1–10 נשבר ל-5+5 במובייל, סולם קצר בשורה אחת */
.scale-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px 8px; justify-items: center; }

@media (min-width: 560px) { .scale-grid { grid-template-columns: repeat(10, 1fr); } }

.scale-chip {
  width: 100%; max-width: 50px; aspect-ratio: 1;
  border-radius: 50%;
  border: none;
  background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--line-strong);
  font-weight: 600; font-size: 17px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  transition: transform .14s ease, background .14s ease, box-shadow .14s ease;
}

.scale-chip:hover { box-shadow: inset 0 0 0 2px var(--hue, var(--teal)); color: var(--ink); }

.scale-chip.sel {
  background: var(--hue, var(--teal));
  color: var(--hue-on, #fff);
  box-shadow: 0 3px 0 var(--hue-deep, var(--teal-deep));
  transform: scale(1.08);
}

.scale-labels { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; font-size: 13px; color: var(--muted); font-weight: 500; }

/* בחירה יחידה / מרובה */
.opt-list { display: grid; gap: 8px; }

.opt {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 11px 15px;
  border: none;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--line);
  text-align: right;
  font-size: 16px;
  line-height: 1.35;
  transition: background .13s ease, box-shadow .13s ease, opacity .13s ease;
}

.opt:hover { box-shadow: inset 0 0 0 1.5px var(--line-strong); }

.opt .mark {
  flex: none; width: 24px; height: 24px;
  border: 1.5px solid var(--line-strong);
  background: #fff;
  display: grid; place-items: center;
  color: transparent;
  font-size: 15px;
  transition: all .13s ease;
}

.opt.radio .mark { border-radius: 50%; }

.opt.check .mark { border-radius: 8px; }

.opt.sel {
  background: var(--hue-soft, var(--teal-soft));
  box-shadow: inset 0 0 0 1.5px var(--hue, var(--teal));
  font-weight: 600;
}

.opt.sel .mark { background: var(--hue, var(--teal)); border-color: var(--hue, var(--teal)); color: var(--hue-on, #fff); }

/* "בחר עד 3": כשמגיעים לתקרה, האפשרויות שלא נבחרו מתעמעמות */
.opt-list.maxed .opt:not(.sel) { opacity: .45; }

.other-input { margin-top: 2px; }

.txt-input, .num-input {
  width: 100%;
  border: none;
  box-shadow: inset 0 0 0 1.5px var(--line);
  border-radius: var(--r-md);
  background: #fff;
  padding: 13px 15px;
  font-size: 16px;
  line-height: 1.5;
  transition: box-shadow .15s ease;
}

textarea.txt-input { min-height: 104px; resize: vertical; }

.txt-input:focus, .num-input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--hue, var(--teal)), 0 0 0 4px var(--hue-soft, var(--teal-soft)); }

.txt-input::placeholder { color: #9A9F97; }

.num-input { max-width: 130px; text-align: center; font-weight: 600; }

/* דירוג בגרירה (נתמך, לא בשימוש בשאלון הנוכחי) */
.rank-list { display: grid; gap: 8px; counter-reset: rank; }

.rank-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1.5px var(--line);
  border-radius: var(--r-md);
  padding: 8px 10px;
  counter-increment: rank;
  touch-action: pan-y;
  user-select: none;
}

.rank-item.dragging { box-shadow: var(--shadow-md), inset 0 0 0 2px var(--hue, var(--teal)); position: relative; z-index: 5; }

.rank-item .rank-num { width: 30px; height: 30px; border-radius: 50%; background: var(--paper-deep); display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; }

.rank-item .rank-num::before { content: counter(rank); }

.rank-item:nth-child(1) .rank-num { background: var(--ochre); color: var(--ink); }

.rank-item .rank-label { flex: 1; font-size: 15px; font-weight: 500; }

.rank-item .rank-grip { width: 34px; height: 40px; display: grid; place-items: center; color: var(--muted); cursor: grab; border-radius: 10px; touch-action: none; }

.rank-item .rank-btns { display: flex; gap: 4px; }

.rank-item .rank-btns button { width: 34px; height: 34px; border-radius: 10px; border: none; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); font-size: 12px; }

.rank-item .rank-btns button[disabled] { opacity: .3; }

.skip-link {
  background: none; border: none;
  color: var(--ink-soft);
  font-size: 14.5px; font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 5px;
  padding: 12px 8px;
  margin: 2px 0 4px;
}

.skip-link:hover { color: var(--ink); }

/* סרגל פעולה תחתון, דבוק */
.chapter-nav {
  position: sticky; bottom: 0; z-index: 30;
  background: linear-gradient(180deg, rgba(246, 241, 231, 0), var(--paper) 34%);
  padding: 22px 0 calc(16px + env(safe-area-inset-bottom));
  display: flex; gap: 10px;
}

.chapter-nav .btn-primary { flex: 1; }

/* ── כרטיסים כלליים (דשבורד, דוח, התקנה) ────────────────── */

.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow-sm);
  padding: 20px 18px;
  margin-bottom: 14px;
}

.card h2 { font-size: 40px; }

.card.tinted { background: var(--teal-soft); box-shadow: none; }

/* ── מודאל: במובייל גיליון מלמטה, בדסקטופ במרכז ─────────── */

.modal-back {
  position: fixed; inset: 0;
  background: rgba(20, 30, 25, .5);
  backdrop-filter: blur(3px);
  z-index: 90;
  display: flex; align-items: flex-end; justify-content: center;
  animation: fadeIn .18s ease;
}

.modal {
  background: var(--surface);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 480px;
  padding: 26px 20px calc(22px + env(safe-area-inset-bottom));
  animation: sheetUp .26s cubic-bezier(.2, 1, .4, 1);
  max-height: 90dvh; overflow-y: auto;
}

.modal h3 { font-size: 22px; color: var(--ink); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }

.modal h3 svg.ic { color: var(--terra); }

.modal p { color: var(--ink-soft); font-size: 15.5px; margin-bottom: 10px; }

.modal .txt-input { margin-top: 4px; }

.modal-actions { display: flex; gap: 8px; margin-top: 14px; }

.modal-actions .btn { flex: 1; }

@media (min-width: 560px) {
  .modal-back { align-items: center; padding: 18px; }
  .modal { border-radius: var(--r-xl); padding: 28px 24px; animation-name: popIn; }
}

@keyframes fadeIn { from { opacity: 0; } }

@keyframes popIn { from { opacity: 0; transform: scale(.94) translateY(12px); } }

@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } }

/* חלונית שו"ת */
.drawer-back { position: fixed; inset: 0; background: rgba(20, 30, 25, .4); z-index: 80; animation: fadeIn .2s ease; }

.drawer {
  position: fixed; top: 0; bottom: 0; inset-inline-start: 0;
  width: min(380px, 90vw);
  background: var(--surface);
  z-index: 85;
  box-shadow: var(--shadow-lg);
  border-radius: var(--r-xl) 0 0 var(--r-xl);
  padding: 24px 20px;
  overflow-y: auto;
  animation: slideInRtl .28s cubic-bezier(.2, 1, .4, 1);
}

@keyframes slideInRtl { from { transform: translateX(30px); opacity: 0; } }

.drawer h3 { font-family: var(--font-display); font-size: 44px; line-height: .95; margin-bottom: 12px; }

.faq-item { border-bottom: 1px solid var(--line); }

.faq-item summary {
  font-weight: 600; font-size: 16px;
  padding: 14px 2px; cursor: pointer;
  list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after { content: '+'; color: var(--terra); font-weight: 700; font-size: 20px; transition: transform .18s; }

.faq-item[open] summary::after { transform: rotate(45deg); }

.faq-item p { font-size: 15px; color: var(--ink-soft); padding: 0 2px 14px; }

/* ── חגיגה ───────────────────────────────────────────── */

.confetti-piece {
  position: fixed; top: -12px; z-index: 99;
  width: 9px; height: 14px; border-radius: 2px;
  animation: confetti-fall linear forwards;
  pointer-events: none;
}

@keyframes confetti-fall { to { transform: translateY(105vh) rotate(660deg); opacity: .2; } }

/* ── טוסטים: למעלה, כדי לא להסתיר את כפתור ההמשך ────────── */

.toast-container {
  position: fixed; top: 70px; right: 50%; transform: translateX(50%);
  z-index: 120;
  display: flex; flex-direction: column; gap: 8px;
  width: min(440px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--ink); color: #fff;
  border-radius: var(--r-md);
  padding: 12px 16px;
  font-size: 15px; font-weight: 500;
  box-shadow: var(--shadow-md);
  opacity: 0; transform: translateY(-10px);
  transition: opacity .25s ease, transform .25s ease;
}

.toast-show { opacity: 1; transform: translateY(0); }

.toast-hide { opacity: 0; }

.toast-success { background: var(--teal-deep); }

.toast-error { background: var(--danger); }

.toast-warning { background: #7A5B12; }

.toast-icon { font-weight: 700; }

/* ── דוח ציבורי ודשבורד ───────────────────────────────── */

.hero { text-align: center; padding: 34px 8px 20px; }

.hero .kicker {
  display: inline-block;
  background: var(--ochre-soft); color: #6B5320;
  font-weight: 600; font-size: 13px;
  border-radius: 99px; padding: 4px 12px; margin-bottom: 10px;
}

.hero h1 { font-size: clamp(56px, 14vw, 80px); color: var(--ink); margin-bottom: 8px; }

.hero .sub { font-size: 17px; color: var(--ink-soft); max-width: 460px; margin: 0 auto; }

.chapters-head { display: flex; align-items: center; gap: 10px; margin: 24px 2px 14px; flex-wrap: wrap; }

.chapters-head h2 { font-size: 48px; color: var(--ink); display: flex; align-items: center; gap: 10px; }

.chapters-head h2 svg.ic { font-size: 30px; color: var(--teal); }

.chapters-head p { color: var(--muted); font-size: 15px; width: 100%; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); gap: 10px; margin-bottom: 18px; }

.stat-tile { background: var(--surface); border-radius: var(--r-md); padding: 14px 16px; box-shadow: inset 0 0 0 1px var(--line); }

.stat-tile .num { font-family: var(--font-display); font-size: 46px; line-height: 1; color: var(--teal); font-variant-numeric: tabular-nums; }

.stat-tile .lbl { font-size: 13.5px; color: var(--muted); }

.bar-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; margin-bottom: 9px; }

.bar-track { background: var(--paper-deep); border-radius: 99px; height: 26px; overflow: hidden; }

.bar-fill {
  height: 100%; border-radius: 99px;
  background: var(--teal);
  display: flex; align-items: center;
  padding-inline-start: 10px;
  color: #fff; font-size: 13px; font-weight: 600;
  min-width: 32px;
  transition: width .6s cubic-bezier(.22, 1, .36, 1);
}

.bar-name { font-size: 15px; color: var(--ink-soft); display: flex; align-items: center; gap: 6px; }

.avg-chip {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 99px; padding: 3px 12px;
  font-weight: 700; font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.avg-good { background: var(--teal-soft); color: var(--teal-deep); }

.avg-mid { background: var(--ochre-soft); color: #6B5320; }

.avg-low { background: var(--terra-soft); color: var(--terra-deep); }

.open-answer {
  border-inline-start: 3px solid var(--teal-soft);
  padding: 8px 14px; margin-bottom: 8px;
  background: var(--paper);
  border-radius: var(--r-sm);
  font-size: 15px; color: var(--ink-soft);
}

.pill-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }

.pill-tab {
  border: none; box-shadow: inset 0 0 0 1.5px var(--line);
  background: var(--surface); border-radius: 99px;
  padding: 7px 14px; font-size: 14px; font-weight: 500;
  color: var(--ink-soft);
  display: inline-flex; align-items: center; gap: 6px;
}

.pill-tab.sel { background: var(--teal); box-shadow: none; color: #fff; }

/* ── עזרים ────────────────────────────────────────────── */

.tag { display: inline-block; background: var(--paper-deep); color: var(--ink-soft); border-radius: 99px; font-size: 13px; font-weight: 600; padding: 3px 10px; }

.center { text-align: center; }

.muted { color: var(--muted); }

.small { font-size: 14px; }

.mt { margin-top: 14px; }

.mb { margin-bottom: 14px; }

.loading-screen {
  position: fixed; inset: 0; background: var(--paper);
  z-index: 200; display: grid; place-items: center;
  transition: opacity .4s;
}

.loading-screen.hidden { opacity: 0; pointer-events: none; }

.spinner {
  width: 42px; height: 42px;
  border: 4px solid var(--line); border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 0 auto 14px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.fade-in { animation: viewIn .3s cubic-bezier(.2, 1, .4, 1); }

@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } }

@media print {
  .topbar, .chapter-nav, .btn, .toast-container { display: none !important; }
  body { background: #fff; }
  .card, .q-card { box-shadow: none; break-inside: avoid; }
}
