/* ============================================================
   שלימות — יצירת ספר (book maker)
   ============================================================ */
.bm{ --bg:#0E1116; --panel:#141A23; --line:rgba(244,241,234,.12); --txt:#F4F1EA; --mute:rgba(244,241,234,.62);
  --field:#0F141C; --desk:#232831; --accent:#C9A24B; --accent-ink:#1A1714; }
[data-theme="light"] .bm{ --bg:#FAF8F3; --panel:#fff; --line:rgba(26,23,20,.12); --txt:#1A1714; --mute:rgba(26,23,20,.6);
  --field:#fff; --desk:#E7E3DA; --accent:#A8832F; --accent-ink:#fff; }
body.bm{ background:var(--bg); color:var(--txt); margin:0; }

.bm-app{ display:grid; grid-template-columns:360px 1fr; height:calc(100vh - 69px - var(--dock-h,68px)); }
body.bm{ padding-bottom:var(--dock-h,68px); }
.bm-side{ background:var(--panel); border-left:1px solid var(--line); display:flex; flex-direction:column; min-height:0; }
.bm-tabs{ display:flex; border-bottom:1px solid var(--line); }
.bm-tabs button{ flex:1; padding:14px 6px; background:none; border:0; border-bottom:2px solid transparent; color:var(--mute);
  font:inherit; font-weight:700; cursor:pointer; }
.bm-tabs button[aria-selected="true"]{ color:var(--txt); border-bottom-color:var(--accent); }
.bm-pane{ display:none; padding:18px; overflow:auto; flex:1; min-height:0; }
.bm-pane.on{ display:flex; flex-direction:column; gap:14px; }
.bm label{ display:flex; flex-direction:column; gap:6px; font-size:.92rem; color:var(--mute); }
.bm label.chk{ flex-direction:row; align-items:center; gap:10px; color:var(--txt); }
.bm input[type=text], .bm input[type=number], .bm select, .bm textarea{ font:inherit; color:var(--txt); background:var(--field);
  border:1px solid var(--line); border-radius:6px; padding:9px 10px; }
.bm textarea{ min-height:46vh; resize:vertical; line-height:1.6; font-family:"Frank Ruhl Libre", serif; font-size:1.02rem; }
.bm .row2{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.bm .row4{ display:grid; grid-template-columns:repeat(4,1fr); gap:8px; }
.bm h3{ margin:8px 0 0; font-size:1rem; color:var(--txt); }
.bm .hint{ font-size:.85rem; color:var(--mute); line-height:1.55; margin:0; }
.bm .hint code{ background:var(--field); border:1px solid var(--line); padding:0 5px; border-radius:4px; }
.bm-btn{ display:inline-flex; align-items:center; justify-content:center; gap:8px; padding:10px 16px; border-radius:100px; cursor:pointer;
  border:1px solid var(--line); background:transparent; color:var(--txt); font:inherit; font-weight:700; white-space:nowrap; }
.bm-btn:hover{ border-color:var(--accent); }
.bm-btn.danger:hover{ border-color:#C8102E; color:#C8102E; }
.bm-btn.pri{ background:var(--accent); color:var(--accent-ink); border-color:var(--accent); }
.bm-drop{ border:1.5px dashed var(--line); border-radius:10px; padding:16px; text-align:center; color:var(--mute); cursor:pointer; }
.bm-drop.over{ border-color:var(--accent); color:var(--txt); }

.bm-main{ display:flex; flex-direction:column; min-width:0; min-height:0; }
.bm-bar{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; padding:10px 16px; border-bottom:1px solid var(--line); background:var(--panel); }
.bm-bar .sp{ flex:1; }
.bm-bar .stat{ color:var(--mute); font-size:.92rem; }
.bm-bar input[type=range]{ width:110px; accent-color:var(--accent); }
.bm-desk{ flex:1; overflow:auto; background:var(--desk); padding:28px 16px 60px; }
.bm-pages{ display:flex; flex-direction:column; align-items:center; gap:22px; }
.bm-spread{ display:flex; gap:0; justify-content:center; }
.bm-pages.spreads .bm-spread.first{ justify-content:flex-end; width:calc(var(--pw) * 2); }
.bm-pro{ margin:48px auto 0; max-width:820px; text-align:center; padding:clamp(28px,5vw,52px) clamp(18px,4vw,48px);
  background:var(--panel); border:1px solid var(--line); border-radius:18px; box-shadow:0 30px 60px -36px rgba(0,0,0,.45); position:relative; overflow:hidden; }
.bm-pro::before{ content:""; position:absolute; inset:0 0 auto; height:5px; background:linear-gradient(90deg,var(--accent),#F3DFA4,var(--accent),#F3DFA4,var(--accent)); background-size:200% 100%; animation:bm-flow 3s linear infinite; }
.bm-pro__tag{ color:var(--accent); font-weight:700; letter-spacing:.14em; font-size:.82rem; }
.bm-pro h2{ font-size:clamp(1.6rem,3.4vw,2.5rem); line-height:1.15; margin:.5rem 0 .8rem; color:var(--txt); }
.bm-pro__lead{ color:var(--mute); font-size:1.08rem; line-height:1.65; max-width:36em; margin:0 auto 1.3rem; }
.bm-pro__list{ list-style:none; padding:0; margin:0 auto 1.8rem; display:flex; flex-wrap:wrap; justify-content:center; gap:.5rem .6rem; }
.bm-pro__list li{ border:1px solid var(--line); border-radius:100px; padding:.45em 1em; font-weight:600; font-size:.95rem; }
.bm-pro__list li::before{ content:"✓"; color:var(--accent); font-weight:800; margin-inline-end:.45em; }
.bm-pro__contact{ display:flex; flex-wrap:wrap; justify-content:center; gap:14px; }
.bm-pro__btn{ display:inline-flex; align-items:center; gap:14px; text-align:right; padding:14px 26px 14px 30px; border-radius:100px;
  border:1.5px solid var(--accent); color:var(--txt); text-decoration:none; transition:transform .3s, box-shadow .3s; min-width:250px; }
.bm-pro__btn:hover{ transform:translateY(-3px); box-shadow:0 16px 36px -16px rgba(168,131,47,.6); }
.bm-pro__btn.pri{ background:var(--accent); color:var(--accent-ink); animation:bm-glow 2.2s ease-in-out infinite; }
.bm-pro__btn .ic{ font-size:1.6rem; line-height:1; }
.bm-pro__btn small{ display:block; font-size:.8rem; opacity:.8; font-weight:600; }
.bm-pro__btn b{ display:block; font-size:1.3rem; direction:ltr; unicode-bidi:isolate; text-align:right; letter-spacing:.02em; }
.bm-pro__more{ display:inline-block; margin-top:1.4rem; color:var(--accent); font-weight:700; }

/* ---------------- the book page ---------------- */
.bk-page{ position:relative; background:#fff; color:#111; box-shadow:0 2px 14px rgba(0,0,0,.28); overflow:hidden; flex:none;
  direction:rtl; font-kerning:normal; }
.bk-head{ position:absolute; display:flex; justify-content:space-between; align-items:flex-end; font-size:.82em;
  border-bottom:.5pt solid #555; padding-bottom:1.2mm; color:#222; }
.bk-foot{ position:absolute; text-align:center; font-size:.9em; color:#222; }
.bk-body{ position:absolute; display:flex; flex-direction:column; }
.bk-cols{ flex:1 1 auto; min-height:0; display:grid; }
.bk-col{ min-height:0; height:100%; overflow:hidden; }
.bk-notes{ flex:none; }
.bk-notes:not(:empty){ border-top:.5pt solid #444; padding-top:1.5mm; margin-top:2mm; }
.bk-notes .bk-note{ margin:0 0 .6mm; text-align:justify; }
.bk-notes .bk-note sup{ font-weight:700; margin-left:.25em; }
.bk-ref{ font-size:.62em; line-height:0; font-weight:700; vertical-align:super; margin-right:.05em; }
.bk-p{ margin:0; }
.bk-h1{ text-align:center; font-weight:700; margin:0 0 .9em; line-height:1.25; }
.bk-h1.top{ margin-top:2.2em; }
.bk-h2{ font-weight:700; margin:.8em 0 .35em; line-height:1.3; }
.bk-col > :first-child.bk-h2{ margin-top:0; }
.bk-sep{ text-align:center; margin:.4em 0; letter-spacing:.6em; }

.bk-title{ display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; height:100%; gap:5mm; }
.bk-title .t1{ font-weight:700; line-height:1.15; }
.bk-title .t2{ font-size:1.25em; }
.bk-title .t3{ font-size:1.15em; margin-top:8mm; }
.bk-title .orn{ letter-spacing:.8em; color:#555; }
.bk-title .pub{ position:absolute; bottom:18mm; left:0; right:0; text-align:center; font-size:.95em; }
.bk-toc .bk-h1{ margin-bottom:1.2em; }
.bk-toc-e{ display:flex; align-items:baseline; gap:2mm; margin:0 0 .35em; }
.bk-toc-e.l2{ padding-right:6mm; font-size:.95em; }
.bk-toc-e .dots{ flex:1; border-bottom:1pt dotted #777; transform:translateY(-.25em); }

.bm-measure{ position:absolute; top:0; left:-200000px; visibility:hidden; }

@media (max-width: 900px){
  .bm-app{ grid-template-columns:1fr; height:auto; }
  .bm-side{ border-left:0; border-bottom:1px solid var(--line); }
  .bm textarea{ min-height:34vh; }
  .bm-desk{ min-height:70vh; }
}

@media print{
  body.bm{ background:#fff !important; }
  .bm .blog-hdr, .bm-side, .bm-bar, .bm-pro, .bm-measure, #cursor, .cursor{ display:none !important; }
  .bm-app{ display:block; height:auto; }
  .bm-desk{ padding:0; background:none; overflow:visible; }
  .bm-pages{ zoom:1 !important; display:block; gap:0; }
  .bm-spread{ display:block; width:auto !important; }
  .bk-page{ box-shadow:none; break-after:page; page-break-after:always; }
  .bm-spread:last-child .bk-page:last-child{ break-after:auto; page-break-after:auto; }
}
.bk-p.ind{ text-indent:1.4em; }
.bk-col.jst .bk-p.split{ text-align-last:justify; }
body.bm::after{ display:none !important; }
.bk-body > .bk-h1{ flex:none; }
.bk-notes .bk-note sup{ font-family:"Frank Ruhl Libre", serif; }

/* ---- contact: shared animation ---- */
.ic.ring{ position:relative; display:inline-grid; place-items:center; animation:bm-ring 2.4s ease-in-out infinite; transform-origin:50% 60%; }
.ic.ring::after{ content:""; position:absolute; inset:-8px; border-radius:50%; border:2px solid currentColor; opacity:0; animation:bm-wave 2.4s ease-out infinite; }
@keyframes bm-ring{ 0%,60%,100%{ transform:rotate(0); } 64%{ transform:rotate(-16deg); } 68%{ transform:rotate(14deg); } 72%{ transform:rotate(-12deg); } 76%{ transform:rotate(10deg); } 80%{ transform:rotate(0); } }
@keyframes bm-wave{ 0%{ opacity:.7; transform:scale(.7); } 100%{ opacity:0; transform:scale(1.6); } }
@keyframes bm-flow{ from{ background-position:0 0; } to{ background-position:200% 0; } }
@keyframes bm-glow{ 0%,100%{ box-shadow:0 0 0 0 rgba(201,162,75,.55); } 50%{ box-shadow:0 0 0 10px rgba(201,162,75,0); } }

/* ---- the contact dock: always at the bottom of the screen ---- */
.bm-dock{ position:fixed; inset:auto 0 0 0; z-index:60; height:var(--dock-h,68px); display:flex; align-items:center; justify-content:center; gap:14px;
  padding:0 16px; color:#F4F1EA; background:linear-gradient(90deg,#141A23,#1E2633 50%,#141A23); border-top:2px solid #C9A24B;
  box-shadow:0 -12px 30px -14px rgba(0,0,0,.55); animation:bm-dock-in .7s cubic-bezier(.22,1,.36,1) both .4s; }
.bm-dock::before{ content:""; position:absolute; inset:-2px 0 auto; height:2px; background:linear-gradient(90deg,transparent,#F3DFA4,transparent); background-size:40% 100%; background-repeat:no-repeat; animation:bm-dock-sweep 3.2s linear infinite; }
.bm-dock__txt{ font-size:.98rem; }
.bm-dock__txt b{ color:#DCBE7A; font-size:1.08rem; }
.bm-dock__txt span{ opacity:.75; }
.bm-dock__btn{ display:inline-flex; align-items:center; gap:10px; padding:10px 20px; border-radius:100px; border:1.5px solid #C9A24B; color:#F4F1EA;
  text-decoration:none; font-size:1.05rem; transition:transform .25s, background .25s; }
.bm-dock__btn b{ direction:ltr; unicode-bidi:isolate; letter-spacing:.02em; }
.bm-dock__btn:hover{ transform:translateY(-2px); background:rgba(201,162,75,.15); }
.bm-dock__btn.pri{ background:#C9A24B; color:#1A1714; animation:bm-glow 2.2s ease-in-out infinite; }
.bm-dock__btn .ic{ font-size:1.25rem; line-height:1; }
@keyframes bm-dock-in{ from{ transform:translateY(100%); } to{ transform:none; } }
@keyframes bm-dock-sweep{ from{ background-position:-40% 0; } to{ background-position:140% 0; } }
@media (max-width:1000px){ .bm-dock__txt span{ display:none; } }
@media (max-width:700px){
  .bm{ --dock-h:60px; }
  .bm-dock{ gap:8px; padding:0 10px; }
  .bm-dock__txt{ display:none; }
  .bm-dock__btn{ flex:1; justify-content:center; padding:9px 10px; font-size:.92rem; }
  .bm-dock__btn:not(.pri) b{ font-size:.82rem; }
}
@media (prefers-reduced-motion:reduce){ .ic.ring, .ic.ring::after, .bm-dock, .bm-dock::before, .bm-dock__btn.pri, .bm-pro__btn.pri, .bm-pro::before{ animation:none; } }
@media print{ .bm-dock{ display:none !important; } body.bm{ padding-bottom:0; } }
