:root {
  --ink: var(--kb-ink);
  --green: var(--kb-green);
  --green-d: var(--kb-green-deep);
  --mustard: var(--kb-mustard);
  --orange: var(--kb-orange);
  --red: var(--kb-red);
  --leaf: var(--kb-leaf);
  --slate: var(--kb-slate);
  --paper: var(--kb-paper);
  --cream: var(--kb-cream);
  --muted: var(--kb-muted);
  --line: var(--kb-line);
  --font-head: var(--kb-head);
  --font-body: var(--kb-body);
  --r: 22px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  min-height: 100vh;
  display: flex; flex-direction: column;
}
h1, h2, h3 { font-family: var(--font-head); line-height: 1.12; text-wrap: balance; }
button { font: inherit; }

/* ---------- כותרת עליונה ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px clamp(16px, 4vw, 40px);
  background: #fff; border-bottom: 1px solid var(--line);
}
.logo { width: 170px; height: 76px; overflow: hidden; display: grid; place-items: center; }
.logo img { width: 100%; transform: scale(1.18) translateY(-3%); }
.top__tag {
  font-family: var(--font-head); font-weight: 900; font-size: 15px;
  color: var(--green); background: #FCEFC9; padding: 6px 14px; border-radius: 999px;
}

main { flex: 1; width: 100%; max-width: 1040px; margin: 0 auto; padding: clamp(18px, 4vw, 40px) clamp(14px, 4vw, 32px) 48px; }

.screen { display: none; }
.screen.is-active { display: block; animation: rise .5s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- טיפוגרפיה ---------- */
.eyebrow { font-weight: 800; font-size: 15px; color: var(--green); margin-bottom: 10px; }
.eyebrow--light { color: #FCDD8A; }
.h1 { font-size: clamp(32px, 5vw, 52px); font-weight: 900; color: var(--green); margin-bottom: 18px; }
.h2 { font-size: 26px; font-weight: 900; color: var(--green); margin-bottom: 18px; }
.lead { font-size: 19px; }
.lead p + p { margin-top: 8px; }
.muted { color: var(--muted); }
.fine { font-size: 14px; color: var(--muted); margin-top: 14px; }
.mark {
  background: linear-gradient(transparent 58%, rgba(217,162,27,.55) 58%, rgba(217,162,27,.55) 92%, transparent 92%);
  padding: 0 4px;
}

/* ---------- פתיחה: מסך רוחבי אחד, הטופס גלוי בלי גלילה ---------- */
.hero {
  position: relative; overflow: hidden;
  background: var(--green); color: #fff;
  border-radius: 32px;
  min-height: calc(100vh - 150px);
  display: grid; grid-template-columns: 1.15fr 1fr; align-items: center;
  gap: clamp(24px, 4vw, 56px);
  padding: clamp(28px, 4vw, 56px) clamp(22px, 4.5vw, 60px);
}
.hero__inner { position: relative; z-index: 2; }
.hero__title { font-size: clamp(38px, 5.2vw, 68px); font-weight: 900; margin-bottom: 22px; }
.hero__title .mark { background: linear-gradient(transparent 60%, rgba(217,162,27,.85) 60%, rgba(217,162,27,.85) 90%, transparent 90%); }
.hero__text { font-size: 18px; max-width: 520px; color: #E9F3EE; }
.hero__text p + p { margin-top: 10px; }
.blob { position: absolute; z-index: 1; }
.blob--a { width: 240px; height: 240px; background: var(--mustard); left: -70px; top: -70px; border-radius: 58% 42% 55% 45% / 50% 60% 40% 50%; }
.blob--b { width: 150px; height: 150px; background: var(--orange); left: 34%; bottom: -70px; border-radius: 45% 55% 40% 60% / 55% 45% 55% 45%; }
.blob--c { width: 80px; height: 80px; background: var(--leaf); right: -24px; bottom: 60px; border-radius: 50%; }

.card {
  background: #fff; border-radius: var(--r);
  box-shadow: 0 1px 0 var(--line), 0 18px 40px -24px rgba(6,89,69,.35);
  padding: clamp(24px, 5vw, 44px);
}
.form-card {
  position: relative; z-index: 3; color: var(--ink);
  padding: clamp(22px, 3vw, 36px);
  border-top: 6px solid var(--mustard);
  box-shadow: 0 30px 60px -20px rgba(0,0,0,.45);
  animation: pop .7s cubic-bezier(.2,1.4,.4,1) .25s both;
}
@keyframes pop { from { opacity: 0; transform: translateY(40px) scale(.92) rotate(-2deg); } to { opacity: 1; transform: none; } }
.form-card .h2 { margin-bottom: 14px; }
.form-card .field { margin-bottom: 16px; }

@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; min-height: 0; border-radius: 24px; gap: 18px; padding: 24px 18px; }
  .hero__title { font-size: 34px; margin-bottom: 10px; }
  .hero__text { font-size: 17px; }
  .hide-sm { display: none; }
  .blob--a { width: 120px; height: 120px; left: -50px; top: -50px; }
  .blob--b, .blob--c { display: none; }
  .form-card .h2 { font-size: 22px; }
  input[type=text] { padding: 11px 14px; }
  .seg span { padding: 10px; }
  .btn--big { padding: 14px; }
  .fine { margin-top: 8px; }
  .seg label { min-width: 0; }
  .hero .eyebrow { display: none; }
  main { padding-top: 12px; }
  .top { padding: 8px 16px; }
  .logo { width: 130px; height: 58px; }
}

.field { display: block; border: 0; margin-bottom: 20px; }
.field__label { display: block; font-weight: 700; margin-bottom: 8px; }
.field__label small { font-weight: 400; color: var(--muted); font-size: 15px; }
input[type=text] {
  width: 100%; font: inherit; font-size: 18px; padding: 14px 16px;
  border: 2px solid var(--line); border-radius: 14px; background: var(--paper);
}
input[type=text]:focus { outline: none; border-color: var(--green); background: #fff; }
.seg { display: flex; gap: 10px; flex-wrap: wrap; }
.seg label { flex: 1; min-width: 130px; cursor: pointer; }
.seg input { position: absolute; opacity: 0; }
.seg span {
  display: block; text-align: center; padding: 12px; border-radius: 14px;
  border: 2px solid var(--line); font-weight: 700; transition: .2s;
}
.seg input:checked + span { border-color: var(--green); background: var(--green); color: #fff; }
.seg input:focus-visible + span { outline: 3px solid var(--mustard); outline-offset: 2px; }

/* ---------- כפתורים ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; cursor: pointer; border-radius: 999px;
  background: var(--mustard); color: var(--ink);
  font-family: var(--font-head); font-weight: 900; font-size: 18px;
  padding: 14px 30px; transition: transform .15s, box-shadow .15s, background .15s;
  box-shadow: 0 4px 0 #A87B0F;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 0 #A87B0F; }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #A87B0F; }
.btn:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; }
.btn--big { width: 100%; font-size: 21px; padding: 17px 30px; margin-top: 8px; }
.btn--ghost { background: transparent; color: var(--green); box-shadow: inset 0 0 0 2px var(--green); }
.btn--ghost:hover { background: #EAF3EF; box-shadow: inset 0 0 0 2px var(--green); }
.btn--ghost:active { box-shadow: inset 0 0 0 2px var(--green); }
.btn--ghost:disabled { opacity: .35; cursor: default; transform: none; }
.btn--small { font-size: 15px; padding: 10px 18px; margin-top: 14px; width: 100%; }

/* ---------- הסבר ---------- */
.intro-card { max-width: 680px; margin: 0 auto; text-align: center; }
.intro-card .lead { margin-bottom: 24px; }
.fan { height: 120px; position: relative; margin: 4px auto 44px; width: 240px; }
.fan span {
  position: absolute; left: 50%; bottom: 0; width: 44px; height: 64px; margin-left: -22px;
  border-radius: 8px; background: var(--c); transform-origin: 50% 160%;
  transform: rotate(var(--r)); box-shadow: 0 0 0 3px #fff, 0 6px 14px -6px rgba(0,0,0,.4);
}
.fan span.w { box-shadow: inset 0 0 0 1px #DDD5C6, 0 0 0 3px #fff, 0 6px 14px -6px rgba(0,0,0,.4); }
.steps { list-style: none; text-align: right; display: grid; gap: 12px; margin: 0 auto 26px; max-width: 520px; }
.steps li { display: flex; gap: 14px; align-items: center; background: var(--paper); border-radius: 16px; padding: 12px 16px; }
.steps b {
  flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: var(--green); color: #fff; font-family: var(--font-head); font-weight: 900;
}
.breath { width: 110px; height: 110px; margin: 0 auto 20px; display: grid; place-items: center; }
.breath i {
  width: 70px; height: 70px; border-radius: 50%;
  background: conic-gradient(#FFD21F, #F28A1A, #D7261E, #F39BC4, #7B3FA6, #1F4AA8, #7FC8EC, #0F6B34, #FFD21F);
  animation: breathe 6s ease-in-out infinite;
}
@keyframes breathe { 0%,100% { transform: scale(.8); opacity: .8; } 50% { transform: scale(1.4); opacity: 1; } }

/* ---------- בחירה ---------- */
.pick-head { text-align: center; margin-bottom: 22px; }
.progress { max-width: 420px; margin: 0 auto 18px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; font-weight: 700; font-size: 15px; }
.progress__round { color: var(--green); font-family: var(--font-head); font-weight: 900; }
.progress__count { color: var(--muted); }
.progress__bar { flex-basis: 100%; height: 8px; border-radius: 99px; background: var(--cream); overflow: hidden; }
.progress__bar i { display: block; height: 100%; width: 0; background: var(--mustard); border-radius: 99px; transition: width .4s; }
.question { font-size: clamp(28px, 4.6vw, 44px); font-weight: 900; color: var(--green); }
.question.is-in { animation: rise .45s ease both; }
.question em {
  font-style: normal; font-size: 1.32em; color: var(--orange);
  display: inline-block; padding: 0 6px; line-height: 1;
  text-shadow: 0 3px 0 rgba(237,134,13,.18);
}
.question em.neg { color: var(--red); text-shadow: 0 3px 0 rgba(211,14,23,.15); }
.hint { min-height: 28px; margin-top: 8px; color: var(--muted); font-size: 17px; }

/* הקלפים בתפזורת: המיקום והסיבוב נקבעים ב־app.js */
.deck { position: relative; max-width: 900px; height: clamp(400px, 56vh, 560px); margin: 0 auto; }
.ccard {
  position: absolute; left: var(--x); top: var(--y); width: var(--w);
  aspect-ratio: 3 / 4; border: 0; cursor: pointer;
  border-radius: 16px; background: var(--c);
  transform: rotate(var(--rot));
  box-shadow: 0 0 0 6px #fff, 0 0 0 7px var(--line), 0 14px 26px -14px rgba(0,0,0,.45);
  transition: transform .2s ease, box-shadow .2s ease, opacity .4s ease;
}
.ccard--white { box-shadow: 0 0 0 1px #DDD5C6 inset, 0 0 0 6px #fff, 0 0 0 7px var(--line), 0 14px 26px -14px rgba(0,0,0,.45); }
.ccard:hover { transform: rotate(var(--rot)) translateY(-6px) scale(1.05); z-index: 5; }
.ccard:focus-visible { outline: 4px solid var(--green); outline-offset: 9px; z-index: 5; }
.ccard.is-gone { opacity: 0; transform: rotate(calc(var(--rot) + 12deg)) scale(.6); pointer-events: none; visibility: hidden; transition: transform .35s ease, opacity .35s ease, visibility 0s linear .36s; }
@media (max-width: 600px) { .deck { height: 520px; } }

.pick-foot { text-align: center; margin-top: 30px; }
.pick-foot .btn { font-size: 16px; padding: 10px 22px; }
@media (max-width: 600px) {
  .deck { gap: 12px; }
  .ccard { border-radius: 14px; box-shadow: 0 0 0 4px #fff, 0 0 0 5px var(--line), 0 10px 20px -12px rgba(0,0,0,.45); }
  .ccard--white { box-shadow: 0 0 0 1px #DDD5C6 inset, 0 0 0 4px #fff, 0 0 0 5px var(--line), 0 10px 20px -12px rgba(0,0,0,.45); }
}

/* ---------- מכתב ---------- */
.letter {
  background: #fff; border-radius: var(--r); max-width: 820px; margin: 0 auto;
  padding: clamp(24px, 6vw, 64px);
  box-shadow: 0 1px 0 var(--line), 0 24px 50px -28px rgba(6,89,69,.4);
  border-top: 10px solid var(--green);
}
.letter__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 20px; border-bottom: 2px dashed var(--line); margin-bottom: 28px; }
.letter__logo { width: 150px; }
.letter__head > div { text-align: left; }
.letter__date { color: var(--muted); font-size: 15px; }
.letter__hi { font-size: clamp(34px, 5vw, 50px); font-weight: 900; color: var(--green); margin-bottom: 14px; }
.letter > p { margin-bottom: 12px; }
.sec { margin-top: 40px; }
.sec__t { font-size: clamp(24px, 3.4vw, 32px); font-weight: 900; color: var(--green); margin-bottom: 14px; }
.sec p + p { margin-top: 10px; }
.sub { font-size: 21px; color: var(--green); margin: 28px 0 12px; }

.dot {
  flex: none; display: inline-block; width: 26px; height: 26px; border-radius: 50%;
  background: var(--c); vertical-align: middle;
}
.dot--white { box-shadow: inset 0 0 0 1.5px #CFC6B5; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--paper); border: 1px solid var(--line); border-radius: 99px; padding: 3px 12px 3px 6px; font-weight: 700; font-size: 15px; margin: 2px; }
.chip .dot { width: 18px; height: 18px; }

.qlist { list-style: none; display: grid; gap: 14px; margin-top: 18px; }
.qlist li { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-radius: 16px; background: #F4F9F6; border-right: 5px solid var(--green); }
.qlist--soft li { background: #FFF8E8; border-right-color: var(--mustard); }
.qlist .dot { width: 34px; height: 34px; margin-top: 2px; }
.qlist h3 { font-size: 20px; color: var(--ink); margin-bottom: 4px; }
.qlist h3 small, .lastbox h3 small { font-family: var(--font-body); font-weight: 500; font-size: 15px; color: var(--muted); margin-right: 6px; }
.note { margin-top: 14px; padding: 12px 16px; border-radius: 14px; background: var(--paper); }
.note--care { background: #FDECEA; border-right: 5px solid var(--red); }

.lastbox { display: flex; gap: 16px; align-items: flex-start; padding: 22px; border-radius: 18px; background: var(--slate); color: #fff; margin-top: 14px; }
.lastbox .dot { width: 46px; height: 46px; box-shadow: 0 0 0 4px rgba(255,255,255,.25); }
.lastbox h3 { font-size: 24px; margin-bottom: 6px; }
.lastbox h3 small { color: #C9D5D8; }
.lastbox .strong { font-weight: 700; color: #FCDD8A; }

/* מפת הצבעים */
.map { margin-top: 18px; overflow-x: auto; }
.map__heads, .map__row { display: grid; grid-template-columns: 92px repeat(12, minmax(34px, 1fr)); gap: 5px; min-width: 560px; }
.map__h { text-align: center; font-weight: 800; font-size: 14px; padding: 6px; border-radius: 10px 10px 0 0; color: #fff; }
.map__h--act { background: var(--green); }
.map__h--pas { background: var(--slate); }
.map__heads--z { margin: 5px 0; }
.map__z { text-align: center; font-weight: 700; font-size: 14px; background: var(--paper); border-radius: 8px; padding: 3px; }
.map__row { margin-bottom: 8px; align-items: center; }
.map__label { font-size: 14px; font-weight: 700; color: var(--muted); line-height: 1.25; }
.map__cell { text-align: center; font-size: 12px; color: var(--muted); }
.map__cell .sw { display: block; aspect-ratio: 3/4; border-radius: 8px; background: var(--c); margin-bottom: 3px; box-shadow: 0 4px 10px -6px rgba(0,0,0,.5); }
.map__cell .sw--white { box-shadow: inset 0 0 0 1.5px #CFC6B5; }
.map__cell--last .sw { outline: 3px solid var(--mustard); outline-offset: 2px; }

@media (max-width: 600px) {
  .map__heads, .map__row { grid-template-columns: repeat(12, 1fr); gap: 3px; min-width: 0; }
  .map__heads > div:first-child { display: none; }
  .map__label { grid-column: 1 / -1; margin-top: 6px; }
  .map__h { font-size: 12px; padding: 5px 2px; }
  .map__z { font-size: 12px; }
  .map__cell span { display: none; }
  .map__cell .sw { border-radius: 5px; }
}

/* עבודה עצמית */
.work { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin-top: 18px; }
.work__card { border-radius: 18px; padding: 18px 20px; background: var(--paper); border-top: 8px solid var(--c); }
.work__card h3 { font-size: 19px; display: flex; gap: 10px; align-items: center; margin-bottom: 10px; color: var(--green); }
.work__card .dot { width: 22px; height: 22px; }
.work__card ul { padding-right: 18px; display: grid; gap: 8px; }
.general { padding-right: 22px; display: grid; gap: 12px; }
.general b { color: var(--green); }

.sec--end { padding-top: 30px; border-top: 2px dashed var(--line); }
.sign { margin-top: 26px !important; font-size: 18px; }
.sign b { font-family: var(--font-head); font-size: 26px; color: var(--green); }
.sign span { font-size: 15px; color: var(--muted); }

.letter-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 28px auto 0; }

.foot { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; padding: 22px; font-size: 15px; color: var(--muted); }
.foot a { color: var(--green); font-weight: 700; }

/* ---------- הדפסה ---------- */
@media print {
  @page { margin: 14mm; }
  body { background: #fff; font-size: 13pt; }
  .top, .no-print, .foot { display: none !important; }
  main { padding: 0; max-width: none; }
  .screen { display: none !important; }
  #s-letter { display: block !important; animation: none; }
  .letter { box-shadow: none; padding: 0; border-top: 0; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .qlist li, .work__card, .lastbox, .map { break-inside: avoid; }
}

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

/* =========================================================
   כל מסך נכנס בגובה החלון, בלי גלילה (חוץ מהמכתב)
   ========================================================= */
body.fit { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
body.fit .foot { display: none; }
.top { padding: 6px clamp(16px, 4vw, 40px); flex: none; }
.logo { width: 130px; height: 56px; }
body.fit main {
  flex: 1; min-height: 0; max-width: 1200px; display: flex;
  padding: clamp(10px, 2vh, 22px) clamp(12px, 3vw, 32px);
  overflow-y: auto;              /* רשת ביטחון למסכים קטנים מאוד */
}
body.fit .screen.is-active { flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* פתיחה */
body.fit .hero { flex: 1; min-height: 0; padding: clamp(18px, 4vh, 48px) clamp(20px, 4vw, 56px); }
.hero__title { font-size: clamp(30px, min(5vw, 9vh), 72px); margin-bottom: clamp(10px, 2.4vh, 22px); }
.hero__text { font-size: clamp(15px, 2.5vh, 19px); }
.hero__text p + p { margin-top: clamp(4px, 1vh, 10px); }
.form-card { padding: clamp(16px, 3.4vh, 34px) clamp(18px, 2.6vw, 34px); }
.form-card .h2 { font-size: clamp(20px, 3.4vh, 26px); margin-bottom: clamp(6px, 1.6vh, 14px); }
.form-card .field { margin-bottom: clamp(8px, 1.8vh, 16px); }
.form-card .field__label { margin-bottom: clamp(4px, .9vh, 8px); }
.form-card input[type=text] { padding: clamp(8px, 1.5vh, 14px) 14px; }
.form-card .seg span { padding: clamp(7px, 1.3vh, 12px); }
.form-card .btn--big { padding: clamp(10px, 1.9vh, 17px) 20px; margin-top: 0; }
.form-card .fine { margin-top: clamp(4px, 1vh, 12px); }
.form-card .btn--small { margin-top: clamp(6px, 1.2vh, 12px); padding: clamp(6px, 1.1vh, 10px) 14px; }

/* הסבר: שני טורים במסך רחב */
.intro-card--split { width: 100%; max-width: 1080px; margin: auto; }
@media (min-width: 821px) {
  .intro-card--split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 4vw, 56px); align-items: center; text-align: right; }
  .intro-card--split .fan { margin-right: 0; margin-left: auto; margin-inline: 0 auto; }
  .intro-card--split .steps { margin: 0 0 clamp(12px, 2.4vh, 24px); max-width: none; }
}
body.fit .card { padding: clamp(18px, 4vh, 44px) clamp(18px, 4vw, 48px); }
body.fit .intro-card { margin: auto; width: 100%; }
.fan { height: clamp(60px, 13vh, 120px); width: clamp(140px, 26vh, 240px); margin: 0 auto clamp(26px, 6.4vh, 52px); }
.fan span { width: clamp(24px, 4.8vh, 44px); height: clamp(34px, 7vh, 64px); margin-left: calc(clamp(24px, 4.8vh, 44px) / -2); }
.h1 { font-size: clamp(26px, min(5vw, 7vh), 52px); margin-bottom: clamp(8px, 2vh, 18px); }
.lead { font-size: clamp(16px, 2.5vh, 19px); }
.intro-card .lead { margin-bottom: clamp(10px, 2.4vh, 24px); }
.steps { gap: clamp(6px, 1.3vh, 12px); margin-bottom: clamp(12px, 2.4vh, 26px); }
.steps li { padding: clamp(6px, 1.3vh, 12px) 16px; }
.steps b { width: clamp(28px, 4.4vh, 36px); height: clamp(28px, 4.4vh, 36px); }
.intro-card .btn--big { margin-top: 0; padding: clamp(10px, 1.9vh, 17px) 20px; }
.breath { width: clamp(60px, 12vh, 110px); height: clamp(60px, 12vh, 110px); margin-bottom: clamp(6px, 1.6vh, 20px); }
.breath i { width: 64%; height: 64%; }

/* בחירה: הקלפים ממלאים את כל המקום שנשאר */
.pick-head { margin-bottom: clamp(4px, 1.2vh, 14px); flex: none; }
.progress { margin-bottom: clamp(6px, 1.4vh, 16px); }
.question { font-size: clamp(24px, min(4.6vw, 6.2vh), 46px); }
.hint { min-height: 1.6em; margin-top: clamp(2px, .6vh, 8px); font-size: clamp(15px, 2.2vh, 17px); }
body.fit .deck, .deck { flex: 1; min-height: 160px; height: auto; width: 100%; max-width: 1000px; }
@media (max-width: 600px) { .deck { height: auto; } }
.pick-foot { margin-top: clamp(4px, 1vh, 12px); flex: none; padding-bottom: 2px; }
.pick-foot .btn { padding: clamp(6px, 1.2vh, 10px) 20px; }

/* מחיקה וחלון האבחונים הקודמים */
.btn--danger { background: transparent; color: var(--red); box-shadow: inset 0 0 0 2px var(--red); }
.btn--danger:hover { background: #FDECEA; box-shadow: inset 0 0 0 2px var(--red); }
.btn--danger:active { box-shadow: inset 0 0 0 2px var(--red); }
.history {
  margin: auto; width: min(560px, 92vw); max-height: 84vh; border: 0; border-radius: var(--r);
  padding: clamp(18px, 4vw, 32px); box-shadow: 0 30px 80px -20px rgba(0,0,0,.5);
  font-family: var(--font-body); color: var(--ink);
}
.history::backdrop { background: rgba(31,42,39,.55); }
.history__head { display: flex; align-items: center; justify-content: space-between; }
.history__head .h2 { margin: 0; }
.history__x { border: 0; background: var(--paper); width: 40px; height: 40px; border-radius: 50%; cursor: pointer; font-size: 18px; color: var(--ink); }
.history__list { list-style: none; display: grid; gap: 10px; margin: 16px 0; }
.history__list li { display: flex; align-items: center; gap: 8px; background: var(--paper); border-radius: 14px; padding: 10px 14px; }
.history__list li div { flex: 1; display: flex; flex-direction: column; line-height: 1.35; }
.history__list li span { font-size: 15px; color: var(--muted); }
.history__list .btn--small { width: auto; margin: 0; padding: 8px 14px; }
.history .btn--small { margin-top: 0; }

@media (max-width: 720px) {
  .logo { width: 110px; height: 48px; }
  .top__tag { font-size: 13px; }
  body.fit .hero { flex: 1; align-content: center; gap: clamp(10px, 2vh, 18px); }
  .hero__title { font-size: clamp(26px, 5vh, 34px); }
}
@media print { body.fit { height: auto; overflow: visible; } }
body.fit main:has(#s-pick.is-active) { overflow: hidden; }

/* טלפונים: צמצום נוסף כדי שהכל ייכנס */
@media (max-width: 720px) {
  .intro-card .eyebrow, #s-between .eyebrow { display: none; }
  .steps li { font-size: 15px; line-height: 1.4; gap: 10px; }
  .lead { line-height: 1.5; }
  .progress { font-size: 14px; }
  .hint { font-size: 14px; line-height: 1.35; }
  .question { line-height: 1.15; }
  .question em { font-size: 1.25em; }
}
@media (max-width: 720px) and (max-height: 760px) {
  .fan { display: none; }
  .steps li:nth-child(3) { display: none; }
  .h1 { font-size: 26px; }
}
@media (max-width: 720px) { .hint { min-height: 2.7em; } }

/* קלפים קרובים יותר זה לזה */
body.fit .deck, .deck { max-width: 820px; }

/* כפתור הספרייה בכותרת */
button.top__tag { border: 0; cursor: pointer; font-family: var(--font-head); transition: background .15s; }
button.top__tag:hover { background: #F8DE95; }

/* ---------- ספריית האבחונים ---------- */
.lib { width: 100%; max-width: 900px; margin: 0 auto; }
.lib__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.lib__head .h1 { margin-bottom: 0; }
.lib__head .btn--small { width: auto; margin: 0; }
.lib__list { list-style: none; display: grid; gap: 12px; }
.lib__item {
  display: grid; grid-template-columns: 1.1fr 1.3fr auto; gap: 16px; align-items: center;
  background: #fff; border-radius: 18px; padding: 16px 20px;
  box-shadow: 0 1px 0 var(--line), 0 12px 28px -22px rgba(6,89,69,.45);
  border-right: 6px solid var(--mustard);
}
.lib__date { display: flex; flex-direction: column; line-height: 1.35; }
.lib__date b { font-family: var(--font-head); font-size: 19px; color: var(--green); }
.lib__date span { color: var(--muted); font-size: 15px; }
.lib__rows { display: grid; gap: 6px; }
.lib__rows > div { display: flex; align-items: center; gap: 8px; }
.lib__rows small { width: 58px; flex: none; font-size: 13px; color: var(--muted); font-weight: 700; }
.mini { display: flex; gap: 3px; }
.mini i { width: 16px; height: 21px; border-radius: 4px; background: var(--c); }
.mini i.w { box-shadow: inset 0 0 0 1px #CFC6B5; }
.mini i.cut { margin-left: 7px; }
.lib__btns { display: flex; gap: 8px; }
.lib__btns .btn--small { width: auto; margin: 0; padding: 9px 16px; white-space: nowrap; }
.lib__empty { text-align: center; background: #fff; border-radius: 18px; padding: 36px 20px; }
.lib__empty p { margin-bottom: 16px; color: var(--muted); }
.lib__foot { margin-top: 18px; text-align: center; }
.lib__foot .btn--small { width: auto; }
@media (max-width: 820px) {
  .lib__item { grid-template-columns: 1fr; gap: 10px; }
  .lib__btns .btn--small { flex: 1; }
  .mini i { width: 14px; height: 19px; }
}

/* ---------- יצירת קשר בסוף המכתב ---------- */
.contact { margin-top: 28px; padding: 20px; border-radius: 18px; background: var(--paper); text-align: center; }
.contact__t { font-family: var(--font-head); font-weight: 900; font-size: 21px; color: var(--green); margin-bottom: 12px; }
.contact__btns { display: flex; gap: 14px 20px; align-items: center; justify-content: center; flex-wrap: wrap; }
.btn--wa { background: #25D366; color: #fff; box-shadow: 0 4px 0 #1A9E4B; text-decoration: none; }
.btn--wa:hover { box-shadow: 0 6px 0 #1A9E4B; }
.btn--wa svg { width: 22px; height: 22px; }
.contact__mail { font-weight: 700; font-size: 18px; color: var(--green); }

/* שם המשחק בשורת הכותרת, ליד הלוגו */
.top__brand { display: flex; align-items: center; gap: clamp(10px, 2vw, 22px); min-width: 0; }
.top__title {
  font-family: var(--font-head); font-weight: 900; color: var(--green);
  font-size: clamp(18px, 2.4vw, 26px); line-height: 1.1; white-space: nowrap;
}
@media (max-width: 420px) { .top__title { font-size: 16px; white-space: normal; } .top__tag { padding: 6px 10px; } }
.top__tag { white-space: nowrap; flex: none; }
.top { gap: 10px; }
@media (max-width: 420px) { .top__tag { font-size: 13px; } .top__title { font-size: 15px; } .logo { width: 96px; height: 44px; } }
[hidden] { display: none !important; }
@media (max-width: 720px) { body.fit .hero { align-content: start; } }

.btn--reg { text-decoration: none; }
