/* ── fonts (copied from the app's assets) ───────────────────────────────── */
@font-face { font-family:'Hebrew';    src:url('/fonts/SBL_Hbrw.ttf') format('truetype'); }
@font-face { font-family:'Samaritan'; src:url('/fonts/Sam_font.ttf') format('truetype'); }
@font-face { font-family:'Arabic';    src:url('/fonts/Amiri-Regular.ttf') format('truetype'); }
@font-face { font-family:'Translit';  src:url('/fonts/CharisSIL-Regular.ttf') format('truetype'); }
/* alternate Samaritan face, used only for commentary/translation prose (ממקור
   שומרון sources, the Aramaic translation, and פירוש הפסוק) when the reader
   opts into "כולל פירושים?" — never for the main verse text, which keeps 'Samaritan'. */
@font-face { font-family:'SamComment'; src:url('/fonts/ben-nor23.ttf') format('truetype'); }

:root{
  --navy:#1a3873; --accent:#2e61b8; --active:#3880e6; --cream:#f7f7f2;
  --share:#218c66; --dark:#141414; --muted:#73738c; --line:#c9cfe0;
}
*{ box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html,body{ margin:0; height:100%; }
body{
  font-family:'Hebrew',sans-serif; background:var(--cream); color:var(--dark);
  direction:rtl; overflow:hidden;
}
#app{ display:flex; flex-direction:column; height:100vh; height:100dvh; height:var(--app-h, 100dvh);
      max-width:760px; margin:0 auto;
      background-color:var(--cream); position:relative;
      background-image:linear-gradient(rgba(247,247,242,.86), rgba(247,247,242,.90)),
                       url('/static/img/background.jpg');
      background-size:cover; background-position:center top; background-repeat:no-repeat;
      box-shadow:0 0 26px rgba(0,0,0,.14); }
/* on larger screens (desktop/tablet), let the whole app frame grow to actually
   use the available space instead of staying pinned at phone width — capped
   so Torah text never stretches into unreadably long lines. */
@media (min-width:860px){ #app{ max-width:min(94vw, 1100px); } }

/* ── desktop: fill the screen ────────────────────────────────────────────────
   From 1200px the app stops being a centred card and takes the whole viewport,
   so the navy chrome runs edge to edge like a real desktop application.

   Width alone would wreck the reading, though: a Torah verse set across 2000px
   is unreadable, and stretching the toolbar's 6 buttons that far makes them
   look like banners. So the frame goes full-bleed while the CONTENT keeps two
   shared measures, both centred on the same axis:
     --measure-wide  multi-column things (selection grids, version comparison,
                     the two-panel view) — more width genuinely helps them
     --measure-read  single-column prose (verse rows, source panels) — capped
                     at a comfortable line length no matter how wide the screen
   Everything here is scoped to the media query, so phones and tablets keep
   exactly the layout they have today. */
@media (min-width:1200px){
  :root{ --measure-wide:min(96vw,1560px); --measure-read:min(92vw,1040px); }

  #app{ max-width:none; width:100%; box-shadow:none; }

  /* chrome spans the viewport; its contents stay on the wide measure */
  /* #navbar is deliberately NOT in this list any more: it no longer spans the
     chrome but floats over the page as a pill of its own, and stretching it to
     the wide measure would blow it back out into a full-width band. */
  #hdr .brand-top, #hdr .title-row, #hdr .sam-date, #hdr .toggle-row,
  #crumbs, #toolbar .tb-rows, #toolbar .tb-handle, #hdr .div-handle{
    max-width:var(--measure-wide); margin-inline:auto; width:100%; }

  #content{ padding:10px 16px; }
  /* The reading measure is the DEFAULT for everything in the content area, and
     only genuinely multi-column layouts opt up to the wide one. Deliberately
     this way round: a single-column element stretched to 1560px (five book
     buttons as full-width banners, a verse on one endless line) is the failure
     mode worth defaulting against, and anything added here later inherits the
     safe measure instead of silently spanning the screen. */
  #content > *{ max-width:var(--measure-read); margin-inline:auto; }
  #content > .grid, #content > .cmp-grid, #content > .pair,
  #content > .lib-grid, #content > .dict-wgrid{ max-width:var(--measure-wide); }

  /* more chapter cells per row instead of 8 very wide ones */
  .grid.g15{ grid-template-columns:repeat(14,1fr); }
  .grid.g5{ grid-template-columns:repeat(7,1fr); }

  /* the spread/wide buttons follow the same axis rather than spanning the screen */
  #spreadBtn, .wide-btn{ max-width:var(--measure-read); margin-inline:auto; }

  /* The library gallery is a full-viewport overlay, so it sits outside #content
     and needs the measure applied directly: its auto-fill tracks otherwise
     produce 20 postage-stamp columns on an ultra-wide monitor. Bigger minimum
     tiles keep the covers legible. The other overlays (dictionary app, book
     reader) already have deliberate desktop sizing and are left alone. */
  .lib-grid{ max-width:var(--measure-wide); margin-inline:auto;
             grid-template-columns:repeat(auto-fill,minmax(120px,1fr)); }
  .lib-book-title{ font-size:13px; }
}
/* very wide monitors: one more column, still on the same measures */
@media (min-width:1800px){ .grid.g15{ grid-template-columns:repeat(18,1fr); } }

/* The native Kivy app is laid out physically left→right (first-added widget on
   the left), so "חלוקה שומרונית" (added 2nd) sits on the RIGHT. We reproduce that
   exact physical order by making the button bars LTR; the Hebrew TEXT inside each
   button still shapes right-to-left. Verse/list CONTENT stays RTL (it is below). */
.title-row, .toggle-row, .search-bar, .flag, .root-box-row,
#navbar, .tb-row, .search-foot{ direction:ltr; }

/* header */
#hdr{ background:var(--navy); color:#fff; flex:0 0 auto; }
.brand-top{ text-align:center; font-weight:700; font-size:16px; color:#dfe8ff;
            letter-spacing:.5px; padding:7px 10px 0; }
.title-row{ display:flex; align-items:center; gap:8px; padding:4px 10px 2px; }
.title-row h1{ flex:1; font-size:20px; font-weight:600; text-align:center; margin:0; }
.brand-stack{ flex:0 0 auto; display:flex; flex-direction:column; align-items:center; gap:2px; }
.vsplit-lab{ display:block; text-align:right; font-size:13px; font-weight:600; margin:6px 2px 2px; color:var(--navy); }
.vsplit-area{ width:100%; box-sizing:border-box; min-height:64px; font-family:inherit; font-size:16px;
              border:1px solid #bbb; border-radius:6px; padding:7px; resize:vertical; }
.renum-inp{ width:100%; box-sizing:border-box; height:44px; font-family:inherit; font-size:20px;
            text-align:center; border:1px solid #bbb; border-radius:6px; padding:6px; margin-bottom:4px; }
.scroll-ico{ width:36px; height:36px; object-fit:contain; }
.ver{ font-size:11px; color:#bcd0ff; white-space:nowrap; }
.toggle-row{ display:flex; gap:4px; padding:4px 8px 8px;
             overflow:hidden; transition:max-height .25s ease, opacity .2s ease, padding .25s ease; max-height:60px; }
/* when the bottom toolbar folds, collapse the division-toggle bar upward too (more text) */
body.div-collapsed .toggle-row{ max-height:0 !important; min-height:0 !important; opacity:0 !important;
                                padding-top:0 !important; padding-bottom:0 !important; }
/* ── folded all the way ──────────────────────────────────────────────────────
   Folded, the header keeps ONE line — the app's name — and gives everything
   else back to the text: 'אבני שהם' above it goes, the date goes, the division
   buttons go, and the title row itself draws in. The handle stays exactly what
   it was, so the blind is pulled back down the same way as before. */
.brand-top{ overflow:hidden; transition:max-height .25s ease, opacity .2s ease, padding .25s ease;
            max-height:40px; }
body.div-collapsed .brand-top{ max-height:0; opacity:0; padding-top:0; padding-bottom:0; }
.title-row, .title-row h1, .scroll-ico{ transition:padding .25s ease, font-size .25s ease,
                                                   width .25s ease, height .25s ease; }
body.div-collapsed .title-row{ padding:2px 10px 0; }
body.div-collapsed .title-row h1{ font-size:16px; }
body.div-collapsed .scroll-ico{ width:24px; height:24px; }
body.div-collapsed .ver{ display:none; }
.divbtn{ flex:1; padding:8px; border:0; border-radius:6px; background:#4d4d80; color:#fff;
         font-family:inherit; font-size:14px; cursor:pointer; }
.divbtn.active{ background:var(--active); }
/* drag handle / fold control at the bottom of the division-toggle bar — mirrors #tbHandle */
.div-handle{ display:flex; align-items:center; justify-content:center; gap:10px; position:relative;
  width:100%; height:14px; padding:0 0 2px; border:0; background:transparent; cursor:pointer; touch-action:none; }
body.div-collapsed .div-handle{ height:26px; }
.div-handle .tb-grip{ position:relative; width:60px; height:12px; border-radius:6px;
  background:linear-gradient(#ffffff55,#ffffff2e); box-shadow:inset 0 1px 0 rgba(255,255,255,.35), 0 1px 2px rgba(0,0,0,.3);
  transition:background .2s; }
.div-handle:hover .tb-grip{ background:linear-gradient(#ffffff77,#ffffff44); }
.div-handle .tb-uparrow, .div-handle .tb-downarrow{ display:none; position:absolute; left:50%; bottom:-2px; font-size:28px;
  line-height:1; color:#ffd86b; font-weight:900; text-shadow:0 0 12px rgba(255,216,107,1),0 0 4px rgba(255,216,107,1);
  pointer-events:none; }
/* TOP bar reverses the bottom bar's convention: DOWN arrow while folding inward,
   UP arrow while opening (per request — the top bar opens downward). */
.div-handle.show-arrow .tb-downarrow{ display:block; animation:tbArrowBlinkDown .46s ease-in-out infinite alternate; }
.div-handle.show-down .tb-uparrow{ display:block; animation:tbArrowBlink .46s ease-in-out infinite alternate; }

/* breadcrumb */
/* padding-left reserves room for the .bm-navs cluster pinned in the left corner
   (it ends at ~83px with all three signs showing); flex-wrap lets a long breadcrumb
   path drop to a second line, and the reservation keeps that line clear of the signs */
#crumbs{ flex:0 0 auto; min-height:40px; display:flex; align-items:center; justify-content:flex-start;
         gap:5px; padding:6px 10px 6px 98px; flex-wrap:wrap; font-size:15.5px; position:relative; }
#crumbs .crumb{ color:var(--accent); cursor:pointer; background:none; border:0; font-family:inherit; font-size:15.5px; padding:0; }

/* clear-filter bar — shown above the verses when a single verse is filtered */
.clear-filter-bar{ display:flex; justify-content:flex-end; padding:6px 4px 2px; }
.clear-filter-btn{ background:#bf3930; color:#fff; border:0; border-radius:8px; padding:10px 18px;
                   font-family:inherit; font-size:15px; font-weight:600; cursor:pointer; }
#crumbs .crumb.static{ color:var(--dark); cursor:default; }
#crumbs .sep{ color:var(--muted); }

/* main content */
#content{ flex:1 1 auto; overflow-y:auto; padding:6px 8px; -webkit-overflow-scrolling:touch; }
/* page-turn animation: a clone of the outgoing chapter rotates away like a leaf */
/* ── the turning leaf ────────────────────────────────────────────────────────
   A page does not pivot as a board, it bends — so the leaf is not one plane but
   a row of narrow vertical strips, each carrying the whole page behind its own
   window and each placed on a computed curve (runFlipGhost). The container only
   holds the perspective they are seen through; every strip is a 3D child of it,
   which is why preserve-3d must run all the way down. */
.flip-ghost{ position:fixed; overflow:hidden; z-index:60; pointer-events:none;
  perspective:1600px; perspective-origin:50% 45%;
  transform-style:preserve-3d; will-change:transform; }
.flip-strip{ position:absolute; top:0; height:100%; overflow:hidden;
  backface-visibility:hidden; transform-style:preserve-3d;
  will-change:transform, filter; }
/* the whole page, inside one strip's window: JS pushes it back by that strip's own
   offset, so the strips reassemble into a single continuous page */
.flip-leaf{ position:absolute; top:0; background-color:var(--cream);
  box-shadow:0 10px 30px rgba(0,0,0,.18); }
/* parchment layer inside the leaf: JS sizes/positions it to the app box so it lines up
   pixel-for-pixel with the background behind — the turn no longer wipes the texture flat */
.flip-ghost-bg{ position:absolute; background-repeat:no-repeat; }
.flip-ghost-inner{ position:absolute; left:0; right:0; padding:6px 8px; }
/* a special slow-dissolving blessing floated over a particular verse (Samaritan division) */
.verse-bless{ position:fixed; z-index:55; pointer-events:none; display:flex;
  align-items:center; justify-content:center; text-align:center; padding:0 5vw;
  font-family:'Hebrew',serif; font-weight:800; line-height:1.25; opacity:0;
  color:#b4862c; font-size:min(15vw,80px);
  text-shadow:0 1px 2px rgba(255,255,255,.5), 0 3px 22px rgba(120,86,20,.35); }
#searchScreen{ flex:1 1 auto; display:flex; flex-direction:column; overflow:hidden; padding:10px; }

/* the invisible mark planted at a place in the text that carries a blessing —
   after the verse for an end, before it for an entry; it must take no room */
.bless-cue{ display:block; height:0; margin:0; padding:0; }

/* list buttons (books / portions) */
.listbtn{ display:flex; align-items:center; gap:8px; width:100%; margin-bottom:3px;
          padding:12px 12px; border:0; border-radius:6px; background:#d9d9d9; color:var(--dark);
          font-family:inherit; font-size:20px; text-align:right; cursor:pointer; }
.listbtn .ico{ width:28px; height:28px; opacity:.8; }
.listbtn small{ color:var(--muted); font-size:15px; }
/* A book named twice — in Hebrew letters and again in the Samaritan script,
   with a dash between them. The Samaritan letters are far wider than the Hebrew,
   so the row's type gives a little on a narrow screen (never below 15px, never
   above the 20px the one-name rows use) and the second name is set smaller
   still; that keeps both names and the counts on ONE line down to a 360px
   phone, which is where they stopped fitting. */
.listbtn.twoscripts{ font-size:clamp(15px, 4.7vw, 20px); flex-wrap:wrap; }
/* …and when the week's badge cannot fit beside a whole name, IT gives way
   to the next line rather than pushing the name off the screen */
/* the week's badge always takes a line of its own here */
.listbtn.twoscripts .week-mark{ flex-basis:100%; }
.listbtn .bk-sam{ font-size:.58em; color:#6b4d1e; margin-inline-start:.5em; }
/* (the gap before the dash is a margin, not a space: an inline-block eats a
    leading space, and the two names were left touching) */
/* a WORD is never broken; a long name may fold at one of its own separator
   dots, which is how the line stays beside the icon instead of below it */
.listbtn .bk-sam .samchar{ white-space:nowrap; }
/* the separator between the words of a Samaritan name: a gap, and a dot
   sitting halfway up the line inside it. Not in the Samaritan face — that
   font has no middle dot and would render an empty box (see .wsep above). */
.listbtn .bk-sam .wsep{ font-family:'Hebrew',sans-serif; font-size:.8em;
                        margin:0 .42em; vertical-align:.28em; opacity:.85; }
/* Each name stays whole: the Hebrew one, and the Samaritan one after it. A row
   that cannot hold both — the long portion names, 'ויוסף הורד מצרימה' — breaks
   BETWEEN them rather than dropping the whole label below the icon or breaking
   a name in the middle. */
/* flex-basis 0, not auto: with a basis of auto the browser judges the whole
   double name too wide for the line and drops it BELOW the icon; from 0 it
   simply takes the room that is left and folds inside itself. */
.listbtn.twoscripts > span{ flex:1 1 0; min-width:0; }
.listbtn.twoscripts > span{ white-space:normal; }
.listbtn .bk-sam{ display:inline-block; }

/* the poem in the space under the book list — set in the Torah face, centred as a
   block, and laid out as a two-column table with the rules taken away: the right
   column holds each line up to its colon, the left column what follows it. Both
   columns keep one width down the page (max-content tracks), and the words of a
   half are spread across their column, so the colons and both outer edges fall on
   the same four vertical lines. Never wraps (nowrap) and never clipped — the type
   is measured and scaled to the width available; see fitBookPoem(). */
.bkpoem{ display:flex; justify-content:center; overflow:hidden; padding:10px 14px 6px; }
/* the quill rule above the poem and, turned about, below it */
.ornframe{ width:100%; max-width:min(100%, 620px); box-sizing:border-box;
           display:flex; flex-direction:column; align-items:center; justify-content:center;
           gap:9px; position:relative; isolation:isolate; border-radius:10px; padding:12px 14px;
           aspect-ratio:1.7202; }          /* the plate's own proportion — see below */
/* ── the open codex the poem is written upon ────────────────────────────────
   The photograph of the manuscript is the frame's own background, not a picture
   of its own. The frame is given the plate's exact proportion (578×336 after the
   left margin, which is not part of the book, was cut away), so the background
   fills it corner to corner with the WHOLE book in view — nothing cropped, and
   nothing stretched. Its width is the book list's, capped, so the codex can
   never spill past the menu; fitBookPoem() then takes the type down to whatever
   room is left inside, in height as well as in width. */
.ornframe::before{
  content:''; position:absolute; inset:0; z-index:-1; border-radius:inherit;
  background:url('/static/img/poem_manuscript.jpg') center/100% 100% no-repeat #efe9dc;
  box-shadow:inset 0 0 0 1px rgba(90,60,20,.22);
}
/* While the page is burnt through, the photograph is drawn by the canvas instead
   (see drawScars), because only there can the middle of a hole be cut clean away
   and what lies behind the book be seen through it. */
.ornframe.pierced::before{ background:none; box-shadow:none; }
/* on a narrow telephone the page is small, so give its margins back to the poem */
@media (max-width:420px){ .ornframe{ padding:8px 10px; gap:6px; } }
.orn-rule{ width:100%; line-height:0; }
.orn-rule svg{ display:block; width:100%; height:auto; }
.orn-rule.bot{ transform:rotate(180deg); }
.bkpoem-grid{ flex:0 0 auto; display:grid; grid-template-columns:max-content max-content;
              column-gap:1.1em; row-gap:.3em; direction:rtl; white-space:nowrap;
              font-family:'Hebrew',serif; font-size:23px; line-height:1.45;
              /* letters burnt into the page: a charred core, a rim of live ember
                 around it, and the scorch spreading out into the parchment */
              color:#1e0a02;
              text-shadow:0 0 1px rgba(255,222,158,.85),   /* the live rim */
                          0 0 3px rgba(255,148,46,.72),
                          0 0 6px rgba(198,68,8,.62),
                          0 0 12px rgba(116,38,5,.52),
                          0 0 24px rgba(58,24,5,.44),      /* smoke into the page */
                          0 1px 1px rgba(18,7,1,.85); }
/* ── the letters are still burning ──────────────────────────────────────────
   Four layers stand one upon another over the codex (see bookPoem()):
     · pfirecv — the simulated flame, rising out of the letters and above them;
     · pchar   — the letters that are read, charred, and never covered;
     · pfire   — the same letters filled with a live ember, wrung by turbulence;
     · psparks — what the fire throws off.
   The flame is beneath the letters on purpose: what burns stays legible, and the
   fire is seen licking around it and streaming off its tops. */
.bkpoem-stack{ flex:0 0 auto; position:relative; }
/* the flame covers the whole page, so a tongue may reach any of its margins */
.pfirecv{ position:absolute; inset:0; width:100%; height:100%; z-index:1;
          pointer-events:none; user-select:none;
          filter:blur(1.1px); opacity:.88; }   /* just enough to take the grid off */
/* the burns themselves lie on the page, beneath everything drawn upon it */
.pscar{ position:absolute; inset:0; width:100%; height:100%; z-index:-1;
        pointer-events:none; user-select:none; }
/* and the pieces the page throws off fly over the whole window, touching nothing */
.pscraps{ position:fixed; inset:0; width:100vw; height:100vh; z-index:60;
          pointer-events:none; user-select:none; }
.pchar{ position:relative; z-index:2; }
.psparks{ z-index:4; }
.pfire{ position:absolute; inset:0; width:100%; height:100%; z-index:3;
        pointer-events:none; user-select:none;
        color:transparent; -webkit-text-fill-color:transparent;
        -webkit-background-clip:text; background-clip:text;
        /* one gradient to a line — 1.45em of line box and .3em of gap — so every
           line burns from its own feet up, and the tiling makes the flow seamless */
        background-repeat:repeat; background-size:100% 1.75em;
        background-image:linear-gradient(0deg,
          #fffbe6 0%, #ffe487 14%, #ffb62c 30%, #ff7d09 46%,
          #d8380a 62%, rgba(130,22,0,.30) 78%, rgba(130,22,0,0) 92%);
        filter:url(#poemFire) blur(.5px); opacity:.8;
        /* the bloom — fire gives light, and the light leans upward */
        text-shadow:0 0 5px rgba(255,150,26,.55), 0 0 13px rgba(255,96,10,.38),
                    0 -7px 18px rgba(255,120,20,.3);
        animation:pfireFlow 2.1s linear infinite, pfireBreath 2.6s ease-in-out infinite; }
@keyframes pfireFlow{ from{ background-position:0 0; } to{ background-position:0 -1.75em; } }
@keyframes pfireBreath{ 0%,100%{ opacity:.8; } 41%{ opacity:.64; } 68%{ opacity:.9; } }
/* the sparks the fire throws off, rising and going out */
.psparks{ position:absolute; inset:0; pointer-events:none; overflow:visible; }
.psparks i{ position:absolute; width:3px; height:3px; border-radius:50%;
            background:#fff0bd; box-shadow:0 0 5px 2px rgba(255,146,26,.85);
            opacity:0; animation:pspark 2.4s linear infinite; }
@keyframes pspark{
  0%{ opacity:0; transform:translate(0,0) scale(.6); }
  12%{ opacity:.95; }
  70%{ opacity:.5; }
  100%{ opacity:0; transform:translate(-6px,-38px) scale(.2); } }
.fire-defs{ position:absolute; width:0; height:0; overflow:hidden; }
/* Covered by a library unit, or the app put in the background: the flame and the
   sparks are CSS animations and would go on running behind whatever is over
   them, so they stop too (the simulated fire stops in its own loop — see
   watchPoemCover). The page keeps its burn and takes it up again on the way back. */
body.poem-off .pfire, body.poem-off .psparks i{ animation-play-state:paused; }
/* a reader who asks for stillness gets the burn without the burning */
@media (prefers-reduced-motion:reduce){
  .pfire, .psparks i{ animation:none; }
  .psparks, .pfirecv, .pscar, .pscraps{ display:none; }
}
/* nowrap keeps the half on one line; justifying the last line (which is also the
   only line) spreads its words across the whole column, so the colons line up */
.bkpoem-cell{ text-align:justify; text-align-last:justify; }

/* ── the administrator's animation flags (chapter view + chapter spread) ──── */
.anim-adm{ display:flex; flex-direction:column; gap:5px; margin:0 0 8px; padding:7px 8px;
           border:1px dashed #c9b98a; border-radius:8px; background:rgba(184,145,47,.06); }
.anim-row{ display:flex; flex-wrap:wrap; align-items:center; gap:7px; }
.anim-flag{ display:inline-flex; align-items:center; gap:5px; font-size:13px; color:var(--muted);
            border:1px solid #d9d2bd; border-radius:999px; padding:2px 9px; background:#fff; }
.anim-flag i{ width:9px; height:9px; border-radius:50%; background:#cfc9b8;
              box-shadow:inset 0 0 0 1px rgba(0,0,0,.12); }
.anim-flag.on{ color:#6b4d1e; border-color:#b8912f; background:#fdf7e6; font-weight:600; }
.anim-flag.on i{ background:#e0b53c; box-shadow:0 0 6px rgba(224,181,60,.85); }
.anim-text{ flex:1 1 190px; min-width:0; font-family:inherit; font-size:14px; color:var(--dark);
            border:1px solid #d9d2bd; border-radius:6px; padding:3px 7px; background:#fff; }
.anim-where{ font-size:12.5px; color:var(--muted); }
/* the flags the administrator can press, and a row switched off */
.anim-flag.clickable{ cursor:pointer; user-select:none; }
.anim-flag.clickable:hover{ border-color:#b8912f; }
.anim-row.off .anim-text{ color:var(--muted); background:#f4f2ec; text-decoration:line-through; }
.anim-undo{ border:1px solid #d9d2bd; background:#fff; border-radius:6px; cursor:pointer;
            font-size:14px; line-height:1; padding:3px 7px; color:#6b4d1e; }
.anim-add{ border-top:1px dashed #d9d2bd; padding-top:6px; margin-top:1px; }
.anim-add-lab{ font-size:13px; color:#6b4d1e; font-weight:600; }
.anim-text::placeholder{ color:#b3ab97; font-size:13px; }
.anim-none{ display:flex; align-items:center; gap:8px; }
.anim-none-t{ font-size:13px; color:var(--muted); }
/* the same lamp, small, on a chapter cell in the spread */
.cell.has-anim{ position:relative; }
.cell .cell-anim{ position:absolute; top:1px; inset-inline-end:3px; font-size:10px; color:#c99a20;
                  text-shadow:0 0 5px rgba(224,181,60,.7); line-height:1; }

.hint{ color:var(--muted); font-size:14px; padding:6px 4px; }

/* chapter grids */
.grid{ display:grid; gap:6px; padding:4px 2px; }
.grid.g5{ grid-template-columns:repeat(5,1fr); }
.grid.g3{ grid-template-columns:repeat(3,1fr); }
.grid.g15{ grid-template-columns:repeat(8,1fr); }
.cell{ padding:14px 0; border:0; border-radius:8px; background:#e7ecfb; color:var(--navy);
       font-family:inherit; font-size:17px; cursor:pointer; }
.cell:hover{ background:#d4ddf7; }
.grid.g15 .cell{ padding:10px 0; font-size:13px; }
/* Samaritan chapter cells: number on top, the chapter's opening two words beneath */
.cell.has-incipit{ display:flex; flex-direction:column; align-items:center; gap:3px; padding:10px 4px; }
.cell.has-incipit .cell-num{ font-size:17px; font-weight:700; }
.cell.has-incipit .cell-incipit{ font-size:13px; color:var(--accent); line-height:1.25;
  direction:rtl; word-break:break-word; }

/* verse rows — LTR row so the number button sits on the RIGHT (as in the source
   app); the Hebrew verse text inside stays RTL and right-aligned. */
.vrow{ display:flex; gap:6px; align-items:flex-start; padding:4px 2px; direction:ltr; }
/* live pronunciation preview line (under a verse): transcription → pointed Hebrew the TTS speaks */
.vpron{ direction:rtl; text-align:right; margin:0 40px 8px 2px; padding:5px 9px;
        background:rgba(23,169,196,.09); border-right:3px solid rgba(23,169,196,.5); border-radius:6px; }
.vpron .vpron-lat{ direction:ltr; unicode-bidi:isolate; font-family:'Translit',serif; color:#5a6b7a; font-size:15px; }
.vpron .vpron-arrow{ color:#17a9c4; margin:0 7px; }
.vpron .vpron-heb{ font-size:20px; color:var(--navy); }
.bm-nav.print-nav{ font-size:16px; }
.bm-nav.pron-nav{ padding:0 3px; font-size:19px; font-weight:700; line-height:1; color:#17a9c4; }
.pron-nav.on{ background:rgba(23,169,196,.9); color:#fff; border-radius:6px; }
.vrow .num{ flex:0 0 auto; min-width:34px; height:30px; border:0; border-radius:6px;
            background:#c2cbef; color:var(--navy); font-family:inherit; font-size:14px; cursor:pointer; margin-top:4px; }
.vrow .num.active{ background:var(--accent); color:#fff; }
.vrow .vtext{ flex:1; font-size:20px; line-height:1.7; direction:rtl; text-align:right; }
/* The Torah's text in the Hebrew face is set as the Samaritan is: flush on both
   sides, the verse's own last line — and with it the end of a chapter, with its
   closing mark — to the right (the owner, 2026-12-01). */
.vrow .vtext:not(.eng):not(.interp){ text-align:justify; text-align-last:right; }
.vrow .vtext.eng{ direction:ltr; text-align:left; font-family:'Translit',serif; font-size:17px; }
.vrow .vtext.interp{ white-space:pre-wrap; text-align:justify; text-align-last:right;
                     overflow-wrap:break-word; word-break:break-word; }
.sam .vrow .vtext{ font-size:19px; text-align:justify; text-align-last:right;
                   overflow-wrap:break-word; word-break:break-word; }
/* "כולל פירושים?" — justify commentary/translation prose the same way the main
   Samaritan verse text is justified, so the two read consistently. */
.samfull .cbody, .samfull .pbody{ text-align:justify; text-align-last:right;
                   overflow-wrap:break-word; word-break:break-word; line-height:1.75; }

/* the verse buttons are an index, not a keyboard: small enough to stay out of
   the way of the chapter they belong to, still big enough to hit on a phone */
.numstrip{ display:flex; flex-wrap:wrap; gap:3px; padding:4px 2px; justify-content:flex-end; direction:ltr; }
.numstrip .num{ min-width:26px; height:25px; border:0; border-radius:5px; background:#c2cbef;
                color:var(--navy); font-family:inherit; font-size:11.5px; cursor:pointer;
                padding:0 4px; }
.numstrip .num.active{ background:var(--accent); color:#fff; }
.numstrip .clear{ background:#bf3930; color:#fff; padding:0 10px; font-weight:600; }

/* a quiet way out of the login box — a line of text, not a third button
   competing with "כניסה" and "ביטול" */
.link-btn{ display:block; margin:8px auto 0; border:0; background:transparent;
           color:var(--accent); font-family:inherit; font-size:13.5px;
           text-decoration:underline; cursor:pointer; padding:4px; }
.link-btn.hidden{ display:none; }

/* the password field, with the eye that uncovers it */
.pass-wrap{ position:relative; display:block; }
.pass-wrap input{ width:100%; padding-inline-end:38px; }
.pass-eye{ position:absolute; inset-inline-end:4px; top:50%; transform:translateY(-50%);
           border:0; background:transparent; font-size:17px; line-height:1; cursor:pointer;
           padding:4px 6px; opacity:.45; transition:opacity .15s; }
.pass-eye.on{ opacity:1; filter:drop-shadow(0 0 4px rgba(46,97,184,.6)); }
@media (hover:hover){ .pass-eye:hover{ opacity:.8; } }

/* Samaritan glyphs */
.samchar{ font-family:'Samaritan'; }
/* The stop marks — the colon, the sof pasuq with the dashes that close a
   portion, and the full stop — were pulled back onto the letter before them
   (-.10em) and sat too tight against it. A small gap instead; this one number
   is the whole of it. nowrap now keeps ׃ and its dashes together on one
   line, which it could not do before: the dashes were loose text outside the
   mark's own span. */
.samstop{ margin-inline-start:.06em; white-space:nowrap; }
/* NOTE: the word-separator middot (.wsep) deliberately does NOT get the
   Samaritan font — that font's glyph coverage doesn't include a proper
   middle-dot (U+00B7), so forcing it there renders the dot invisible
   (an empty .notdef box). It keeps the default/inherited font, which does
   have a visible dot; trimEdgeDots() in app.js compares neighbouring
   .samchar elements' positions (not the dot's own box) to decide whether a
   dot falls at a real line-wrap, so the cross-font metric mismatch never
   confuses that decision. */
/* the alternate commentary font (SamComment) — only ever applied to letters/
   punctuation/brackets inside commentary & translation prose (samMarkupFree),
   never to the main verse text (which stays on .samchar / 'Samaritan'). */
.samchar2{ font-family:'SamComment'; }
.eng-credit{ text-align:center; color:var(--navy); font-size:13px; padding:6px; line-height:1.4; }

/* panels (compare / interpret / aramaic / arabic / commentary / source) */
/* LTR pair so the translation/Masoretic panel sits on the LEFT and the original
   on the RIGHT (as in the source app); the Hebrew text inside each panel is RTL. */
.pair{ display:flex; gap:8px; padding:4px 2px; align-items:stretch; direction:ltr; }
/* Masoretic-comparison grid: one row per verse → exact verse-opposite-verse alignment */
.cmp-grid{ display:grid; grid-template-columns:1fr 1fr; column-gap:8px; direction:ltr;
           padding:4px 2px; background:var(--cream); border:1.3px solid rgba(26,56,115,.55); border-radius:6px; }
.cmp-cell{ direction:rtl; text-align:right; line-height:1.6; padding:5px 8px;
           border-bottom:1px solid rgba(26,56,115,.18); }
.cmp-head{ text-align:center; font-weight:700; color:var(--navy); font-size:17px;
           position:sticky; top:0; background:var(--cream); border-bottom:1.3px solid rgba(26,56,115,.5); }
.cmp-missing{ color:#b00020; letter-spacing:2px; font-weight:700; }
/* Onkelos comparison: three columns (source · Samaritan Aramaic · Onkelos) */
.cmp-grid3{ grid-template-columns:1fr 1fr 1fr; }
.cmp-grid3 .cmp-head{ font-size:15.5px; }
.cmp-vn{ color:var(--accent); }
/* a Samaritan-Aramaic verse with no Onkelos counterpart shows a dashed line */
.cmp-dashline{ display:block; height:0; margin:11px 4px; border-top:2px dashed rgba(26,56,115,.5); }
/* a filled bar standing in for a verse/chapter with no counterpart at all in the
   compared text version — deliberately solid rather than blank, so a genuine
   structural gap is never mistaken for an empty cell. */
.cmp-blackbar{ display:block; height:1.15em; margin:2px 4px; border-radius:2px;
               background:#1a1a1a; }
/* the Vulgate's Latin cell, and a verse of the Peshitta/Vulgate that covers several of ours */
.cmp-cell.cmp-la[dir="ltr"]{ direction:ltr; text-align:left; font-family:Georgia, "Times New Roman", serif; }
.cmp-joined{ font-style:italic; opacity:.7; font-size:.85em; }
/* Ben-Ḥayyim Latin phonetic transcription cell (תעתיק הגייה) */
.tr-latin{ direction:ltr; text-align:left; font-family:'Translit', 'CharisSIL', serif; }
/* small "info" icon next to the compared-version name; links to a web article */
.cmp-info{ display:inline-block; font-size:.72em; color:var(--navy); opacity:.72;
           text-decoration:none; vertical-align:super; cursor:pointer; }
.cmp-info{ cursor:pointer; }
.cmp-info:hover{ opacity:1; }
.ver-info{ line-height:1.7; font-size:16px; text-align:right; padding:4px 2px; color:var(--dark); }
.panel{ flex:1; background:var(--cream); border:1.3px solid rgba(26,56,115,.55);
        border-radius:12px; padding:8px; }
.panel .ptitle{ text-align:center; font-weight:700; color:var(--navy); font-size:17px; margin-bottom:4px; }
.panel .pbody{ font-size:20px; line-height:1.7; white-space:pre-wrap; direction:rtl; text-align:right; }
.panel .pbody.ltr{ direction:ltr; text-align:left; font-family:'Translit',serif; font-size:17px; }
.panel .pbody.ar{ font-family:'Arabic'; direction:rtl; text-align:right; font-size:21px; }
.diff{ color:#cc0000; }

.srcpanel{ background:var(--cream); border:1.3px solid rgba(26,56,115,.55); border-radius:12px;
           padding:8px; margin:4px 2px; }
.srcpanel .shead{ display:flex; align-items:center; gap:6px; margin-bottom:6px; }
.srcpanel .shead .stitle{ flex:1; text-align:center; font-weight:700; color:var(--navy); font-size:17px; }
.miniback{ background:var(--accent); color:#fff; border:0; border-radius:6px; padding:6px 10px;
           font-family:inherit; font-size:13px; cursor:pointer; white-space:nowrap; }
.picker-btn{ display:block; width:100%; margin:6px 0; padding:13px; border:0; border-radius:6px;
             background:var(--navy); color:#fff; font-family:inherit; font-size:16px; cursor:pointer; }
.card{ background:#fdfdf7; border:1px solid rgba(46,97,184,.35); border-radius:8px; padding:6px 8px; margin:5px 0; }
.card .chead{ color:var(--accent); font-weight:700; font-size:14px; margin-bottom:3px; cursor:pointer; }
.card .cbody{ font-size:18px; line-height:1.6; }
.note{ color:var(--muted); font-size:15px; text-align:center; padding:8px; }

/* dictionary */
.dictpanel{ background:#f5f5ec; border:1.2px solid rgba(26,56,115,.45); border-radius:12px;
            padding:8px; margin:6px 2px; }
/* word-by-word picker: the hint, the underlined clickable words, the single-word row */
.dict-pick-hint{ background:#eef2fb; border:1px solid rgba(26,56,115,.2); border-radius:10px;
  color:var(--navy); font-size:14.5px; line-height:1.5; padding:8px 12px; margin:2px 2px 8px; text-align:center; }
.vrow .vtext .dw{ cursor:default; }
.vrow .vtext .dw.on{ cursor:pointer; text-decoration:underline; text-decoration-color:rgba(46,97,184,.5);
  text-underline-offset:3px; text-decoration-thickness:1.5px; border-radius:3px; transition:background .12s; }
.vrow .vtext .dw.on:hover{ background:#e2ebfb; }
.vrow .vtext .dw.sel{ background:var(--accent); color:#fff; text-decoration:none; padding:0 2px; }
.dict-one{ position:relative; }
.dict-one.hidden{ display:none; }
.dict-one-close{ position:absolute; top:5px; inset-inline-start:7px; z-index:1; width:28px; height:28px;
  border:0; border-radius:50%; background:var(--navy); color:#fff; font-size:15px; line-height:1; cursor:pointer; }
.dict-one-close:hover{ background:var(--accent); }
.wt-trans{ font-weight:700; color:var(--navy); }
.wt-eng{ direction:ltr; text-align:left; color:#3a4a66; }
.dict-one-tap{ text-align:center; color:var(--muted); font-size:12.5px; padding:6px 2px 2px; }
/* the per-source breakdown popup */
.ws-h{ color:var(--navy); font-weight:700; font-size:15px; margin:10px 0 3px; border-bottom:1px solid rgba(26,56,115,.15); padding-bottom:2px; }
.ws-block{ background:#f7f9ff; border-radius:8px; padding:6px 10px; margin-bottom:4px; }
.ws-val{ color:var(--dark); font-size:16px; line-height:1.5; }
.ws-from{ color:var(--accent); font-size:12.5px; margin-top:1px; }
.ws-from.ws-pending{ color:var(--muted); font-style:italic; }
.dictpanel .dtitle{ text-align:center; font-weight:700; color:var(--navy); font-size:17px; }
.dictpanel .dhint{ text-align:center; color:var(--muted); font-size:12px; margin-bottom:4px; }
.dictpanel .dhint-strong{ text-align:center; color:var(--navy); font-size:16px; font-weight:700; margin-bottom:8px; }
.dictpanel .online-row{ display:flex; align-items:center; justify-content:flex-end; gap:6px; color:var(--navy); font-size:14px; margin-bottom:4px; }
.dict-item{ border-bottom:1px solid rgba(26,56,115,.10); padding-bottom:2px; }
.dictword{ color:var(--accent); font-size:19px; cursor:pointer; padding:3px 2px; border-bottom:1px dotted transparent; }
.dictword:hover{ border-bottom-color:var(--accent); }
/* Tal-dictionary results, expanded inline under the tapped word — clean dark text,
   results one after another separated by a comma. */
.tal-inline{ padding:2px 14px 7px; font-size:15px; line-height:1.7; color:var(--dark);
             direction:rtl; text-align:right; }
.tal-inline b{ color:var(--navy); font-weight:700; }
.tal-inline .pos{ color:var(--muted); font-size:12px; }
.tal-inline .sep{ color:var(--muted); }
.dict-scroll{ max-height:340px; overflow-y:auto; overflow-x:auto; }
.dict-online{ color:var(--dark); font-size:15px; padding:2px 12px 6px; }
.dict-online .src{ color:var(--accent); font-weight:700; font-size:12px; }

/* word table: מילה · תרגום ארמי · פירוש עברי · מילון טל · ערבית */
.wtbl{ width:100%; border-collapse:collapse; direction:rtl; font-size:15px; }
.wtbl th{ position:sticky; top:0; background:var(--navy); color:#fff; font-weight:700;
          font-size:13px; padding:6px 7px; text-align:right; white-space:nowrap; z-index:1; }
.wtbl td{ padding:6px 7px; text-align:right; border-bottom:1px solid rgba(26,56,115,.12);
          vertical-align:top; }
.wtbl tr:nth-child(even) td{ background:rgba(26,56,115,.035); }
.wtbl tr.tappable{ cursor:pointer; }
.wtbl tr.tappable:hover td{ background:rgba(115,84,56,.10); }
.wtbl .wt-word{ font-weight:700; color:var(--navy); white-space:nowrap; }
.wtbl .wt-aram{ color:var(--accent); font-weight:700; white-space:nowrap; }
.wtbl .wt-mean{ color:var(--dark); }
.wtbl .wt-tal{ color:#4d4d80; font-size:13.5px; }
.wtbl .wt-ar{ font-family:'Arabic',serif; font-size:17px; color:var(--dark); direction:rtl; }
.wtbl .wt-meliz{ color:#6b4d2e; font-size:14px; font-weight:600; }
.online-block{ margin-top:8px; border-top:1px solid rgba(26,56,115,.18); padding-top:6px; }
.online-block .online-item{ color:var(--dark); font-size:14.5px; padding:3px 2px; }
.online-block .src{ color:var(--accent); font-weight:700; font-size:12px; }

/* חילופי נוסח — von Gall critical apparatus */
.app-vhead{ color:var(--navy); font-weight:700; font-size:15px; margin:10px 0 4px;
            border-bottom:1px solid rgba(26,56,115,.2); }
.app-card{ background:#f7f3ea; border:1px solid rgba(122,53,80,.30); border-radius:8px;
           padding:6px 9px; margin-bottom:6px; direction:rtl; text-align:right; }
.app-lemma{ font-size:18px; color:var(--dark); }
.app-lemma .app-mark{ color:#7a3550; font-size:11.5px; font-weight:700; }
.app-reg{ background:#7a3550; color:#fff; font-size:11px; padding:1px 6px; border-radius:8px; }
.app-read{ font-size:16px; color:var(--dark); margin-top:2px; }
.app-type{ background:#7a3550; color:#fff; font-size:12px; padding:1px 7px; border-radius:8px; }
.app-wit{ font-size:13.5px; color:var(--accent); margin-top:3px; }
.app-wit .app-wit-h{ font-weight:700; font-size:12.5px; color:var(--accent); }
.app-wit .app-wit-ms{ font-size:12.5px; color:var(--dark); line-height:1.5; padding-inline-start:6px; }
.app-wit .app-sig{ display:inline-block; min-width:22px; background:#7a3550; color:#fff;
  border-radius:5px; padding:0 5px; font-weight:700; font-size:11.5px; margin-inline-end:4px; }
.app-wit .app-wit-unk{ color:var(--muted); }
.app-note{ font-size:12.5px; color:var(--muted); margin-top:2px; }
/* a verse word that carries a textual variant — emphasised + clickable (inline) */
.vtext .app-word{ color:#7a3550; font-weight:700; cursor:pointer;
  border-bottom:2px dotted #7a3550; padding-bottom:1px; }
.vtext .app-word:hover{ background:rgba(122,53,80,.12); }
.app-card{ scroll-margin-top:60px; }
.app-hint{ color:var(--muted); font-size:13px; line-height:1.5; margin-bottom:6px; }
/* brief flash when jumping between a word and its variant card */
@keyframes appFlash{ 0%{ background:rgba(122,53,80,.45); } 100%{ background:transparent; } }
.app-flash{ animation:appFlash 1.3s ease-out; }
.vtext .app-word.app-flash{ border-radius:4px; }

/* spread + navbar */
.wide-btn{ flex:0 0 auto; margin:2px 6px; padding:13px; border:0; border-radius:6px;
           background:var(--navy); color:#fff; font-family:inherit; font-size:16px; cursor:pointer; }
/* ── the nav bar floats ──────────────────────────────────────────────────────
   It is lifted out of the column and hung over the page instead: one tight
   group of controls, centred, riding above the text rather than taking a band
   of the screen away from it. --nav-bottom is written by JS from the toolbar's
   measured height, so the bar sits just clear of it whether it is folded or
   open.

   It also goes away. On a text screen the bar fades out a few seconds after
   the reader settles, and any touch of the screen brings it back
   (see armNavHide) — so nothing stands between the reader and the Torah until
   the moment they reach for it. */
#navbar{ position:absolute; z-index:5; left:50%; transform:translateX(-50%);
         bottom:var(--nav-bottom, 62px);
         display:flex; gap:2px; padding:5px; align-items:center; justify-content:center;
         border-radius:999px; background:#fffdf7ee; border:1px solid #ded7c5;
         box-shadow:0 8px 24px rgba(43,37,25,.22), 0 2px 6px rgba(43,37,25,.12);
         backdrop-filter:blur(6px); -webkit-backdrop-filter:blur(6px);
         max-width:calc(100% - 20px);
         transition:opacity .28s ease, transform .28s ease, box-shadow .22s ease;
         /* a tap on any of these must leave no mark — not on the button, not on
            the row: no text selection, no lingering focus ring, and (below) no
            hover state on devices that only pretend to have one */
         user-select:none; -webkit-user-select:none; }
/* Over the toolbar the shadow lands on navy, not on cream, and the shadow above
   was mixed for cream — on navy it is all but invisible, and the bar looks stuck
   to the toolbar rather than held above it.

   So while the bar is docked it throws a heavier one, and throws it FAR ENOUGH
   TO LAND: the bar rides ten pixels clear of the toolbar, and a shadow that
   fades out in twenty never reaches the thing it is meant to fall on. This one
   carries some forty-five pixels past the bar's foot, so a band across the top
   of the toolbar is visibly darkened and the bar reads as hanging over it.

   Neutral dark grey, not the navy-black it was: over the toolbar's own blue a
   blue shadow tints rather than dims, and dimming is the whole point.

   Three layers, each doing one job — the long fall that darkens the toolbar,
   a middle that keeps it from banding, and a tight line right under the rim so
   the bar has an edge to end at. The bar paints above the toolbar (z-index 5
   against its z-index:auto), so the shadow lands on it rather than under it. */
body.nav-docked:not(.nav-hidden):not(.nav-flip) #navbar{
  box-shadow:0 18px 28px -8px rgba(26,26,28,.52),
             0 8px 14px -4px rgba(26,26,28,.42),
             0 3px 5px rgba(26,26,28,.42); }
#navbar button:focus{ outline:none; }
#navbar button:focus-visible{ outline:2px solid var(--active); outline-offset:2px; }  /* keyboard only */
/* the bar is out of sight until the screen is touched */
body.nav-hidden #navbar{ opacity:0; pointer-events:none;
                         transform:translateX(-50%) translateY(14px); }
/* and it steps out of the way of a turning page entirely — at once, with no
   fade either way, because a bar dissolving over a leaf in mid-turn is exactly
   the thing being avoided (runFlipGhost puts it back the moment the leaf lands) */
body.nav-flip #navbar{ opacity:0; pointer-events:none; transition:none; }

/* On the browse screens — books, parashot, the chapters of a parasha — the bar
   never fades, so a floating bar would sit on the last row of the list and hide
   it. There it is given its footprint back as room at the foot of the list, and
   the list scrolls clear of it. (The text screens need none: the bar goes by
   itself the moment the reader settles.)

   The clearance is --nav-clear: how far the bar actually rises above the
   toolbar, not its whole height — a third of it sits down inside the toolbar and
   reserving for that was room nobody needed.
   It goes to ONE element. "פריסת פרקים" is a sibling of #content rather than a
   child, so when it is on screen it is the thing that must clear the bar and
   #content must not also pad itself, or the column carries two gaps and scrolls
   for nothing. */
body.nav-reserve:not(.has-spread) #content{ padding-bottom:var(--nav-clear, 46px); }
body.nav-reserve.has-spread #spreadBtn{ margin-bottom:var(--nav-clear, 46px); }

/* ── the bar floats, and casts ───────────────────────────────────────────────
   There is no socket any more. The toolbar had been scooping a bay out of its
   own edge for the bar to sit in — first painted in the page's colour, then cut
   for real with a mask — and the bar was sunk a third of its height into it.
   Both are gone. The toolbar's edge is straight and it is left alone.

   What says the bar is above the page now is a shadow, not a hole. It rides
   clear of the toolbar and drops its shadow onto it, which is what a floating
   thing does and needs no cooperation from what it floats over.

   The shadow is two: a wide soft one that gives the height, and a tight dark
   one just under the bar that gives the edge. Over the toolbar it is thrown
   against navy rather than against the page, and a shadow tuned for cream
   disappears there — so while the bar is docked it deepens. */
#toolbar{ position:relative; }
#toolbar > *{ position:relative; z-index:1; }

/* ── the socket, cast instead of cut ─────────────────────────────────────────
   A drop shadow says the bar is above the toolbar. It does not say the toolbar
   is HOLLOWED for it, and that is what the bay used to say. The difference is
   shape: a drop shadow is the bar's own outline blurred, even in depth from end
   to end, while a socket is deepest under the middle of the bar and runs out to
   nothing at its two ends.

   So the darkening is given that shape directly — the same half-ellipse the bay
   was once cut as, in the same place and to the same width (--nav-w, published
   by placeNavbar and following the bar as it grows a label), only painted as
   shade rather than removed as a hole. Nothing is cut, nothing shows through:
   the toolbar's edge stays straight and the toolbar keeps every pixel it has.

   It is laid ABOVE the buttons (z-index 2 against their 1), because a socket
   that stops at the row of buttons is a socket with a floor: the two central
   buttons have to darken along with the ground they sit on, or the eye reads a
   stain rather than a hollow. It takes no pointer events, so nothing beneath it
   is any harder to press.

   Wider than the bar by a margin at each end, so the shade fades out into the
   toolbar instead of ending on a line. */
#toolbar::before{ content:''; position:absolute; z-index:2; pointer-events:none;
  left:50%; transform:translateX(-50%); top:0;
  --sock-w:calc(var(--nav-w, 240px) + 96px);
  --sock-d:40px;
  /* never wider than the bar it sits on: the sock is the nav bar's width plus
     96px, and centred — so on a narrow phone it stuck out 38px each side and,
     being in the flow's overflow, made the whole document wider than the
     screen. The app, centred in that wider document, then sat off to one side
     with a white band beside it and its right edge cut off. */
  width:min(var(--sock-w), 100%); height:var(--sock-d);
  background:radial-gradient(ellipse calc(var(--sock-w) / 2) var(--sock-d) at 50% 0,
             rgba(12,12,14,.58) 0%, rgba(12,12,14,.40) 42%,
             rgba(12,12,14,.18) 72%, rgba(12,12,14,0) 100%);
  opacity:0; transition:opacity .22s ease; }
body.nav-docked:not(.nav-hidden):not(.nav-flip) #toolbar::before{ opacity:1; }

/* ── the pin ─────────────────────────────────────────────────────────────────
   It stands among the chapter's own signs, beside the bookmark, because what it
   holds is that row: the path line at the top of the chapter, and the play
   window. Pressed, those two stay put while the reader reads; released, they
   keep out of the way and come back at a touch, the same touch that calls back
   the nav bar. It is faint while it is holding nothing and lit while it holds. */
.pin-nav{ opacity:.45; transition:opacity .15s, filter .15s; }
.pin-nav.on{ opacity:1; filter:drop-shadow(0 0 5px rgba(224,181,60,.9)); }
@media (hover:hover){ .pin-nav:hover{ opacity:.8; } .pin-nav.on:hover{ opacity:1; } }
/* the pin and the bookmark are set smaller than the printer and the
   pronunciation sign beside them: those two are actions on the chapter, while
   these two only mark a state, and read better as the quieter pair */
#navPin, #bmAddBtn{ font-size:17px; padding:0 3px; }

/* The path line and the play window answer to the pin. Both sit in the column
   rather than over it, so they give their band back to the text instead of
   fading in place and leaving a blank stripe behind. The nav bar is not among
   them — it floats, and takes no room to give back.

   .reading-bar is the chanted-reading player — the panel that carries the
   witness, the play button and the seek bar at the head of a chapter. It is the
   one the reader means by "the play panel"; #audioBar is the smaller read-aloud
   strip. Both answer to the pin, and both go with the path line. */
#crumbs, #audioBar, .reading-bar{ overflow:hidden;
                    transition:max-height .28s ease, opacity .22s ease,
                               padding .28s ease, margin .28s ease; }
#crumbs{ max-height:120px; }
#audioBar{ max-height:80px; }
.reading-bar{ max-height:200px; }
body.nav-hidden:not(.nav-pinned) #crumbs,
body.nav-hidden:not(.nav-pinned) #audioBar,
body.nav-hidden:not(.nav-pinned) .reading-bar{
  max-height:0; min-height:0; opacity:0; padding-top:0; padding-bottom:0;
  margin-top:0; margin-bottom:0; border-width:0; }   /* the rules too, or hairlines stay */
body.nav-flip:not(.nav-pinned) #crumbs,
body.nav-flip:not(.nav-pinned) #audioBar,
body.nav-flip:not(.nav-pinned) .reading-bar{ opacity:0; transition:none; }

/* ── and pinned, the play window HOLDS ───────────────────────────────────────
   Released, the pin only decides whether the play window steps out of the way
   when the furniture fades; it still belonged to the chapter, and scrolled off
   the top with the first verses. Pressed, it stops travelling: it sticks to the
   head of the reading and the chapter runs underneath it, so the witness, the
   play button and the seek bar are still there to reach at verse forty.

   #content is the scroller, and sticky offsets are measured from its scrollport
   — its PADDING box — so top:0 puts the window flush with the very top of the
   view and no line of Torah can appear above it. Its own top margin has to go
   with the same rule, or the margin is honoured as sticky margin and leaves a
   three-pixel slot for text to show through. It rides just under the nav bar's
   layer (5), never over it. */
body.nav-pinned #content > .reading-bar{
  position:sticky; top:0; z-index:4; margin-top:0;
  box-shadow:0 -10px 0 var(--cream),                        /* see the note below */
             0 1px 4px rgba(0,0,0,.07), 0 12px 16px -12px rgba(43,37,25,.5); }
/* A sticky box is held inside its containing block, and for a child of #content
   that is #content's CONTENT box — six pixels down from the scrollport, because
   the scroller pads itself. So the window stops six pixels short of the top and
   the verses go on showing through the slot above it. The scroller gives that
   padding up while the window is holding it: the head of the chapter needs no
   gap above it when something opaque is sitting there. The cream shadow above is
   only for browsers without :has() — where the padding stays, it fills the slot;
   where it goes, it is clipped away at the scrollport and paints nothing. */
body.nav-pinned #content:has(> .reading-bar){ padding-top:0; }
/* transparent arrows: just a glyph while paging chapters; a parasha/book label
   appears inside only at a crossing (set in JS) */
/* ── the nav arrows ──────────────────────────────────────────────────────────
   Three faces, matching what the step actually costs the reader:
     · inside a parasha — a solid teal disc carrying nothing but a chevron
     · into another parasha — the disc stretches into a pill and takes a label,
       set in two lines: what the step is, above the name it leads to
     · out of the book — the same pill, in ink rather than teal, so the largest
       step on the screen is never mistaken for one of the small ones
   flex:0 on the labelled state and flex:1 on the bare one keep the middle pill
   centred either way. */
.nav-arrow{ flex:0 0 auto; width:48px; height:48px; padding:0; border:0; border-radius:999px;
            background:#1a7fa8; color:#fff; font-family:inherit; font-size:15px; font-weight:700;
            cursor:pointer; display:inline-flex; align-items:center; justify-content:center; gap:8px;
            transition:background .15s; }
.nav-arrow .nav-chevron{ width:22px; height:22px; flex:0 0 auto; }
@media (hover:hover){ .nav-arrow:hover{ background:#1f93c1; } }
.nav-arrow:active{ background:#166a8c; }
.nav-arrow:disabled{ opacity:.35; cursor:default; box-shadow:none; }
@media (hover:hover){ .nav-arrow:disabled:hover{ background:#1a7fa8; } }
/* at a crossing the disc becomes a labelled pill */
.nav-arrow.nav-haslabel{ width:auto; max-width:40%; height:48px; padding:0 14px; }
.nav-lab{ display:flex; flex-direction:column; align-items:flex-start; line-height:1.15;
          min-width:0; text-align:start; }
.nav-lab-cap{ font-size:11px; font-weight:600; opacity:.82; }
.nav-lab-name{ font-size:15px; font-weight:700; overflow:hidden; text-overflow:ellipsis;
               white-space:nowrap; max-width:100%; }
/* a step out of the book: ink, not teal */
.nav-arrow.nav-book{ background:#2b2519; color:#f4f1e8; }
@media (hover:hover){ .nav-arrow.nav-book:hover{ background:#3d3524; } }
.nav-arrow.nav-book:active{ background:#1e1a11; }
@media (hover:hover){ .nav-arrow.nav-book:disabled:hover{ background:#2b2519; } }
/* the three middle controls ride together on one raised pill (see index.html);
   the pill is the group, the discs inside it are the buttons */
/* the middle three sit shoulder to shoulder with the arrows now: the bar itself
   is the pill, so this is a plain group and carries no ground of its own */
.nav-pill{ flex:0 0 auto; display:flex; align-items:center; gap:2px; }
.round{ flex:0 0 auto; width:48px; height:48px; padding:0; border:0; border-radius:999px;
        background:transparent; color:#2b2519; font-size:24px; font-weight:700; cursor:pointer;
        display:inline-flex; align-items:center; justify-content:center; transition:background .15s; }
@media (hover:hover){ .round:hover{ background:#efe9da; } }
.round:active{ background:#e3dcc9; }
/* magnifier shown as unavailable (no text to zoom / no search results) */
.round:disabled{ opacity:.3; cursor:default; pointer-events:none; }
.round:disabled:hover{ background:transparent; }
/* back sits at the middle of the pill and is the one filled disc in it, the way
   the centre of a row of controls carries its principal action */
.nav-back{ background:#2b2519; color:#f4f1e8; }
@media (hover:hover){ .nav-back:hover{ background:#3d3524; } }
.nav-back:active{ background:#1e1a11; }
.nav-back:disabled{ background:transparent; color:#2b2519; }
.nav-back .tbi{ width:22px; height:22px; }
.round .zoomi{ width:22px; height:22px; }
/* on the plain browse screens (books / portions / spread) only the back button shows */
#navbar.nav-backonly{ justify-content:center; }
/* There the lone back button floats over the list, so it is see-through — the
   row it lies on shows through it — and the reader can drag it out of the way
   (navBackDrag in app.js writes --nb-dx/--nb-dy and remembers them). Only the
   ground is thinned, never the arrow, which stays as legible as before. */
#navbar.nav-backonly{ left:calc(50% + var(--nb-dx, 0px));
  bottom:calc(var(--nav-bottom, 62px) - var(--nb-dy, 0px));
  background:#fffdf74d; border-color:#ded7c573;
  box-shadow:0 4px 12px rgba(43,37,25,.12);
  backdrop-filter:none; -webkit-backdrop-filter:none;
  touch-action:none; cursor:grab; }
#navbar.nav-backonly .nav-back{ background:rgba(43,37,25,.5); }
@media (hover:hover){ #navbar.nav-backonly .nav-back:hover{ background:rgba(61,53,36,.72); } }
#navbar.nav-backonly .nav-back:active{ background:rgba(30,26,17,.8); }
#navbar.nav-backonly .nav-back:disabled{ background:transparent; }
#navbar.nav-backonly.nb-drag{ cursor:grabbing; transition:none; }

/* toolbar */
#toolbar{ flex:0 0 auto; background:var(--navy); padding:3px; display:flex; flex-direction:column; gap:2px; }
.tb-rows{ display:flex; flex-direction:column; gap:2px; min-height:0; max-height:360px; overflow:hidden;
  transition:max-height .38s ease, opacity .22s ease; }
#toolbar.folded .tb-rows{ max-height:0; opacity:0; pointer-events:none; }
.tb-row{ display:flex; gap:2px; }
/* drag handle / fold control at the top of the bottom toolbar */
.tb-handle{ display:flex; align-items:center; justify-content:center; gap:10px; position:relative;
  width:100%; height:14px; padding:0; border:0; background:transparent; cursor:pointer; touch-action:none; }
#toolbar.folded .tb-handle{ height:32px; }
/* a chunky "shutter handle" — a rounded bar with a groove line down its middle */
.tb-grip{ position:relative; width:60px; height:12px; border-radius:6px;
  background:linear-gradient(#ffffff55,#ffffff2e); box-shadow:inset 0 1px 0 rgba(255,255,255,.35), 0 1px 2px rgba(0,0,0,.3);
  transition:background .2s; }
.tb-grip::after{ content:''; position:absolute; left:9px; right:9px; top:50%; height:2.5px; transform:translateY(-50%);
  background:rgba(16,26,56,.5); border-radius:2px; }
.tb-handle:hover .tb-grip{ background:linear-gradient(#ffffff77,#ffffff44); }
/* prominent blinking arrows on the handle: UP right after folding ("pull up to
   reopen"), DOWN for a moment right after opening ("you can fold it back down") */
.tb-uparrow, .tb-downarrow{ display:none; position:absolute; left:50%; top:-2px; font-size:28px;
  line-height:1; color:#ffd86b; font-weight:900; text-shadow:0 0 12px rgba(255,216,107,1),0 0 4px rgba(255,216,107,1);
  pointer-events:none; }
#toolbar.folded.show-arrow .tb-uparrow{ display:block; animation:tbArrowBlink .46s ease-in-out infinite alternate; }
#toolbar.show-down:not(.folded) .tb-downarrow{ display:block; animation:tbArrowBlinkDown .46s ease-in-out infinite alternate; }
@keyframes tbArrowBlink{
  from{ opacity:.18; transform:translate(-50%,7px) scale(.8); }
  to{   opacity:1;   transform:translate(-50%,-10px) scale(1.28); } }
@keyframes tbArrowBlinkDown{
  from{ opacity:.18; transform:translate(-50%,-7px) scale(.8); }
  to{   opacity:1;   transform:translate(-50%,10px) scale(1.28); } }
/* ── the standing hint: a tiny chevron that stays on a FOLDED handle, bobbing
   gently for as long as the bar is closed, so the reader keeps knowing there is
   something to pull open. It is put up only once the fold animation (and the big
   transient arrow above, which it must never share the handle with) is over — the
   `hint-on` class, set from the fold controller. Bottom bar points UP, the top
   bar's own rule below points DOWN, each towards where its bar would open. */
.tb-hint{ display:none; position:absolute; left:50%; width:6px; height:6px;
  border-left:1.8px solid rgba(255,255,255,.9); border-top:1.8px solid rgba(255,255,255,.9);
  filter:drop-shadow(0 0 2px rgba(0,0,0,.45)); pointer-events:none; }
/* a DOUBLE chevron, so the invitation to pull cannot be mistaken for decoration.
   The second one is drawn inside the first and offset along the element's own
   +x/+y diagonal — which the 45° rotation sends BEHIND the tip, and the 225° one
   equally behind the tip the other way, so a single rule serves both directions. */
.tb-hint::after{ content:''; position:absolute; left:3.6px; top:3.6px; width:6px; height:6px;
  border-left:1.8px solid rgba(255,255,255,.72); border-top:1.8px solid rgba(255,255,255,.72); }
#toolbar.folded.hint-on .tb-hint{ display:block; top:5px; animation:tbHintUp 1.6s ease-in-out infinite; }
body.div-collapsed .div-handle.hint-on .tb-hint{ display:block; bottom:5px; animation:tbHintDown 1.6s ease-in-out infinite; }
@keyframes tbHintUp{
  0%,100%{ transform:translate(-50%,2.5px) rotate(45deg);  opacity:.45; }
  50%    { transform:translate(-50%,-2.5px) rotate(45deg); opacity:1; } }
@keyframes tbHintDown{
  0%,100%{ transform:translate(-50%,-2.5px) rotate(225deg); opacity:.45; }
  50%    { transform:translate(-50%,2.5px) rotate(225deg);  opacity:1; } }
@media (prefers-reduced-motion: reduce){        /* still shown, just not bobbing */
  #toolbar.folded.hint-on .tb-hint{ animation:none; transform:translate(-50%,0) rotate(45deg); opacity:.9; }
  body.div-collapsed .div-handle.hint-on .tb-hint{ animation:none; transform:translate(-50%,0) rotate(225deg); opacity:.9; } }
/* zoom (magnifier ±) buttons centre their icon */
.round{ display:inline-flex; align-items:center; justify-content:center; }
.round .zoomi{ width:31px; height:31px; }
.tb{ flex:1 1 0; min-width:0; padding:12px 3px; border:0; border-radius:5px; background:#414166; color:#fff;
     font-family:inherit; font-size:13.5px; line-height:1.2; cursor:pointer; white-space:normal; }
/* a temporarily-disabled toolbar button: looks unavailable but still tappable (shows a notice) */
.tb.unavail{ opacity:.5; }
.tb.navy{ background:var(--navy); }
.tb.accent{ background:var(--accent); }
/* search button gets its own colour so it stands out from "עיון" next to it */
#searchBtn{ background:#1f8a8a; }
/* small magnifying-glass icon before the "חיפוש" label (i18n sets the text; this
   pseudo-element is independent so it isn't wiped) */
#searchBtn::before{ content:''; display:inline-block; width:13px; height:13px; margin-inline-end:5px;
   vertical-align:-1px; background-color:currentColor;
   -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cline x1='21' y1='21' x2='15.2' y2='15.2'/%3E%3C/svg%3E") center/contain no-repeat;
           mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cline x1='21' y1='21' x2='15.2' y2='15.2'/%3E%3C/svg%3E") center/contain no-repeat; }
.tb.green{ background:var(--share); flex:0 0 auto; min-width:54px; }
#shareBtn{ display:flex; align-items:center; justify-content:center; padding:10px 12px; }
/* compact icon buttons in the search footer (share + Excel export) */
.tb.icon-btn{ flex:0 0 auto; min-width:48px; display:inline-flex; align-items:center;
              justify-content:center; padding:10px 12px; }
.tb.excel{ background:#1d7044; }
#shareBtn svg{ display:block; }
.toast{ position:fixed; left:50%; bottom:96px; transform:translateX(-50%) translateY(8px);
        background:var(--navy); color:#fff; font-size:14px; padding:9px 16px; border-radius:8px;
        box-shadow:0 2px 10px rgba(0,0,0,.35); z-index:80; opacity:0; pointer-events:none;
        transition:opacity .2s, transform .2s; max-width:80%; text-align:center; }
.toast.show{ opacity:1; transform:translateX(-50%) translateY(0); }
.tb.on{ background:var(--active); }
.tb:disabled{ background:#555 !important; opacity:.6; cursor:default; }
.tb.hidden{ display:none; }
/* toolbar icons: book (עיון) · scroll (פירוש) · Samaritan א.ב (כתב שומרוני) */
.tb.has-ico{ display:inline-flex; align-items:center; justify-content:center; gap:5px; }
.tb .tbi{ width:15px; height:15px; flex:0 0 auto; }
/* the כתב-שומרוני button shows only "א-ב", in Samaritan or Hebrew script */
.tb.font-btn .font-ab{ font-size:1.15em; font-weight:700; line-height:1; letter-spacing:.04em; }
.tb.font-btn .font-ab.sam-script{ font-family:'Samaritan',serif; font-size:1.35em; }
/* Samaritan א.ב: only the LETTERS use the Samaritan font; the "." between them stays
   in the default font so it matches the dot in the Hebrew א.ב exactly. */
.tb.font-btn .font-ab .sam-let{ font-family:'Samaritan',serif; font-size:1.18em; }
/* round "back" button — icon only, spins a full turn on press */
.tb.ico-btn{ flex:0 0 auto; min-width:44px; display:inline-flex; align-items:center; justify-content:center; }
.tb.ico-btn .tbi{ width:18px; height:18px; }
@keyframes spin360{ from{ transform:rotate(0); } to{ transform:rotate(-360deg); } }
.tb.ico-btn .tbi.spin360{ animation:spin360 .6s ease; }

/* search */
.search-bar{ display:flex; gap:6px; margin-bottom:6px; }
#searchInput{ flex:1; padding:10px; border:1px solid var(--line); border-radius:6px; font-family:inherit; font-size:18px; }
#doSearchBtn{ width:92px; border:0; border-radius:8px; background:#1f8a8a; color:#fff; font-family:inherit; font-size:19px; font-weight:600; cursor:pointer; }
.flag{ display:flex; align-items:center; justify-content:flex-end; gap:8px; padding:5px 2px; color:var(--accent); font-size:16px; }
.flag input{ width:20px; height:20px; }
.root-box-row input{ flex:1; padding:8px; border:1px solid var(--line); border-radius:6px; font-family:inherit; font-size:18px; }
#searchStatus{ color:var(--accent); font-size:15px; padding:4px 2px; min-height:22px; }
#searchStatus .res-count{ color:var(--navy); font-weight:800; font-size:18px; }
#searchStatus .res-shown{ color:#8a7a55; font-size:13px; }
#searchStatus.searching{ font-size:22px; font-weight:800; color:var(--navy); text-align:center;
                         padding:14px 2px; animation:blink 1s steps(2,start) infinite; }
@keyframes blink{ 50%{ opacity:.2; } }
#searchResults{ flex:1; overflow-y:auto; }
.res-path{ display:block; width:100%; text-align:right; background:none; border:0; font-family:inherit;
           font-size:16.5px; padding:6px 2px; cursor:pointer; line-height:1.4; }
.res-path.jew{ color:var(--accent); }
.res-path.sam{ color:#8c4d1a; }
.res-path b{ font-weight:700; }
.res-path .dir{ unicode-bidi:isolate; color:var(--muted); padding:0 4px; }

/* advanced-search button + panel (holds all the flags) */
.adv-btn{ display:block; width:100%; margin:2px 0 6px; padding:11px; border:0; border-radius:8px;
          background:#405973; color:#fff; font-family:inherit; font-size:16px; cursor:pointer; }
.search-btn-row{ display:flex; gap:6px; }
.search-btn-row .adv-btn{ flex:1 1 0; width:auto; }
.adv-btn.help{ background:#2f6f5e; }
.adv-panel{ border:1px solid var(--line); border-radius:10px; padding:10px; margin-bottom:6px; background:#fbfbf6; }
.adv-hint{ color:#555; font-size:13.5px; line-height:1.55; padding:8px 2px 2px; text-align:right; }
.adv-hint b{ color:var(--navy); }
.adv-apply{ display:block; width:100%; margin-top:6px; padding:12px; border:0; border-radius:8px;
            background:var(--share); color:#fff; font-family:inherit; font-size:17px; font-weight:600; cursor:pointer; }
.res-verse{ font-size:19px; padding:2px 2px 6px; line-height:1.6; }
.res-verse .hl{ color:#cc0000; font-weight:700; }
.res-occ{ font-family:'Translit',serif; color:#337373; font-size:18px; padding:0 2px 2px; }
.res-occ .extra{ color:#8a8a8a; font-family:'Hebrew'; }
.res-meaning{ color:#555; font-size:15px; padding:0 2px 8px; line-height:1.5; }
.res-meaning-btn{ display:inline-block; margin:2px 2px 8px; border:1px solid var(--accent); background:#f3f7ff;
  color:var(--accent); border-radius:9px; padding:6px 12px; font-family:inherit; font-size:14.5px; cursor:pointer; }
.res-meaning-btn:hover{ background:var(--accent); color:#fff; }
.res-meaning-btn b{ color:inherit; }
.res-meaning b{ color:var(--navy); }
.res-meaning .aram-link{ color:var(--accent); cursor:pointer; }
.res-meaning .aram-link:hover{ text-decoration:underline; }
.res-meaning .aram-link b{ color:var(--navy); }
.res-meaning .more-hint{ color:var(--muted); font-size:13px; }

/* search-flags in two columns */
.flags-grid{ display:grid; grid-template-columns:1fr 1fr; gap:0 14px; margin-bottom:2px; }

/* word-sources popup (Tal root + Tibåt Mårqe / tradition occurrences) — readable */
#infoBody .ws-h{ color:var(--navy); font-weight:700; font-size:19px; margin:14px 0 6px;
                 border-bottom:2px solid rgba(26,56,115,.25); padding-bottom:4px; }
#infoBody .ws-item{ font-size:17px; padding:8px 4px; color:var(--dark); line-height:1.65;
                    border-bottom:1px solid rgba(26,56,115,.08); }
#infoBody .ws-item b{ color:var(--navy); }
#infoBody .ws-item .pos{ color:var(--muted); font-size:13px; }
#infoBody .ws-cite{ color:#555; font-size:15px; padding:3px 10px 0; }
#infoBody .ws-snip{ color:#333; font-size:16px; padding:3px 10px 0; line-height:1.6; }

/* user-help window */
#infoBody .help-h{ color:var(--navy); font-weight:700; font-size:18px; margin:14px 0 5px;
                   border-bottom:2px solid rgba(26,56,115,.2); padding-bottom:3px; }
#infoBody .help-list{ margin:0; padding:0 18px 0 0; }
#infoBody .help-list li{ font-size:15.5px; line-height:1.65; margin-bottom:4px; color:var(--dark); }
#infoBody .help-list b{ color:var(--navy); }
/* ── install card (navy + gold parchment, the dedicated install-module look) ── */
.pwa-card{ width:92%; max-width:430px; background:#FBF8F0; border:1px solid #E4D9BE; border-radius:18px;
  overflow:hidden; box-shadow:0 18px 50px -18px rgba(20,33,61,.45); font-family:inherit;
  animation:pwaRise .4s cubic-bezier(.2,.8,.2,1) both; }
@keyframes pwaRise{ from{opacity:0;transform:translateY(20px)} to{opacity:1;transform:none} }
.pwa-head{ display:flex; align-items:center; gap:12px; padding:16px 18px 12px; position:relative;
  background:linear-gradient(180deg,#F4EEDF,#FBF8F0); border-bottom:1px solid #E4D9BE; }
.pwa-head::after{ content:""; position:absolute; inset-inline:18px; bottom:-1px; height:2px;
  background:linear-gradient(90deg,transparent,#B8860B,transparent); opacity:.5; }
.pwa-mark{ flex:none; width:42px; height:42px; border-radius:11px; display:grid; place-items:center;
  background:#1F3864; box-shadow:inset 0 0 0 1px rgba(255,255,255,.12), 0 2px 8px rgba(20,33,61,.3); }
.pwa-titles{ flex:1; min-width:0; }
.pwa-title{ margin:0; font-size:18px; font-weight:700; color:#14213D; }
.pwa-sub{ margin:2px 0 0; font-size:13.5px; color:#6B6B63; }
.pwa-x{ flex:none; width:32px; height:32px; border:none; border-radius:9px; background:transparent; color:#6B6B63;
  cursor:pointer; font-size:22px; line-height:1; display:grid; place-items:center; }
.pwa-x:hover{ background:#F4EEDF; color:#1F3864; }
.pwa-body{ padding:14px 18px 16px; }
/* the install clip, above the written steps. 9:16, so it is capped by height on
   a phone in landscape rather than pushing the steps off the card */
.pwa-vid{ display:block; width:100%; max-height:44vh; margin:0 0 14px; border-radius:12px;
  background:#0d1b3a; border:1px solid #E4D9BE; object-fit:contain; }
.pwa-btn{ width:100%; border:none; cursor:pointer; font-family:inherit; font-size:17px; font-weight:700;
  color:#FBF8F0; background:#1F3864; padding:14px 16px; border-radius:12px; display:flex; align-items:center;
  justify-content:center; gap:10px; box-shadow:0 6px 16px -6px rgba(20,33,61,.55); }
.pwa-btn:hover{ background:#14213D; } .pwa-btn:active{ transform:translateY(1px); }
.pwa-hint{ margin:12px 2px 0; font-size:13px; color:#6B6B63; text-align:center; }
.pwa-steps{ list-style:none; margin:0; padding:0; counter-reset:s; }
.pwa-step{ display:flex; align-items:center; gap:13px; padding:11px 0; counter-increment:s; border-bottom:1px dashed #E4D9BE; }
.pwa-step:last-child{ border-bottom:none; }
.pwa-num{ flex:none; width:30px; height:30px; border-radius:50%; display:grid; place-items:center; background:#F4EEDF;
  color:#7F6000; border:1px solid #E4D9BE; font-size:15px; font-weight:700; font-variant-numeric:tabular-nums; }
.pwa-num::before{ content:counter(s); }
.pwa-text{ flex:1; font-size:15.5px; color:#2A2A28; line-height:1.45; }
.pwa-text b{ color:#14213D; }
.pwa-glyph{ flex:none; width:38px; height:38px; border-radius:10px; display:grid; place-items:center; background:#fff;
  border:1px solid #E4D9BE; box-shadow:0 1px 3px rgba(20,33,61,.08); }
.pwa-glyph svg{ display:block; }
.pwa-warn{ display:flex; gap:12px; align-items:flex-start; background:#FBF1E6; border:1px solid #E8C9A0;
  border-radius:12px; padding:13px 14px; margin-bottom:12px; }
.pwa-warn svg{ flex:none; margin-top:1px; } .pwa-warn p{ margin:0; font-size:14.5px; color:#7A4A12; line-height:1.5; }
/* the install card offers two routes — install from the browser, or download the
   signed Android app — separated by a labelled rule so neither reads as a footnote */
.pwa-opt-h{ margin:0 0 3px; font-size:13px; font-weight:700; letter-spacing:.02em; color:#1F3864; }
.pwa-opt-sub{ margin:0 0 12px; font-size:13.5px; color:#6B6B63; line-height:1.5; }
.pwa-opt-meta{ display:inline-block; margin-inline-start:4px; padding:1px 7px; border-radius:999px;
  background:#F1EADA; border:1px solid #E4D9BE; font-size:12px; color:#7A6A45; white-space:nowrap; }
.pwa-or{ display:flex; align-items:center; gap:10px; margin:18px 0 14px; color:#9A907A; font-size:12.5px; }
.pwa-or::before, .pwa-or::after{ content:''; flex:1; height:1px; background:#E4D9BE; }
a.pwa-btn{ text-decoration:none; box-sizing:border-box; }
/* the two stores stand side by side whatever the screen — someone opening the
   card on one kind of phone is often sending the app to the other. They shrink
   rather than stack: the pair is the point, and a wrapped column reads as if one
   store came second. */
/* the sentences from Tal's pages that a word stands in — for thousands of words
   this is the only thing the dictionary can honestly say, so it is laid out to
   be read, not squeezed into a footnote */
.dict-cite{ border-inline-start:3px solid #E4D9BE; padding:7px 11px; margin:8px 0;
  background:#FBF8F0; border-radius:0 9px 9px 0; }
.dict-cite-q{ font-size:15.5px; line-height:1.7; color:#2A2A28; }
.dict-cite-hit{ color:#7F6000; background:#F6EDD4; border-radius:4px; padding:0 2px; }
.dict-cite-ref{ display:inline-block; margin-top:4px; font-size:13px; color:#6B6B63; }
.dict-cite-he{ margin-top:3px; font-size:14.5px; color:#4A4A44; }
.dict-translit{ font-size:14px; color:#7F6000; font-style:italic; }
.dict-nogloss{ color:#8A8172; font-style:italic; }
a.dict-cite-ref, .dict-cite-ref.tm-ref{ color:#2E61B8; cursor:pointer; }

.pwa-stores2{ display:grid; grid-template-columns:1fr 1fr; gap:9px; align-items:start; }
.pwa-store{ min-width:0; }
.pwa-btn-sm{ font-size:14px; padding:11px 8px; gap:6px; border-radius:11px; white-space:nowrap; }
.pwa-btn-sm svg{ flex:none; }
.pwa-store-plat{ margin:5px 0 0; font-size:12.5px; color:#6B6B63; text-align:center; }
/* the page that holds both stores with a code each, at the foot of the card */
.pwa-stores{ margin:14px 2px 0; text-align:center; font-size:13.5px; }
.pwa-stores a{ color:#2E61B8; text-decoration:none; }
.pwa-stores a:hover{ text-decoration:underline; }
@media (max-width:360px){
  .pwa-btn-sm{ font-size:12.5px; padding:10px 5px; gap:4px; }
  .pwa-btn-sm svg{ width:16px; height:16px; }
}
.pwa-foot{ display:flex; align-items:center; justify-content:space-between; gap:10px; padding:9px 14px 11px;
  border-top:1px solid #E4D9BE; background:#FBF8F0; }
.pwa-langs{ display:inline-flex; gap:2px; padding:2px; background:#F4EEDF; border:1px solid #E4D9BE; border-radius:9px; }
.pwa-lang{ border:none; background:none; cursor:pointer; font-family:inherit; font-size:13px; color:#6B6B63;
  padding:4px 9px; border-radius:7px; line-height:1; }
.pwa-lang:hover{ color:#1F3864; } .pwa-lang.is-on{ background:#1F3864; color:#FBF8F0; }
.pwa-snooze{ background:none; border:none; cursor:pointer; font-family:inherit; color:#6B6B63; font-size:13.5px;
  padding:4px 8px; border-radius:7px; text-decoration:underline; text-underline-offset:3px; }
.pwa-snooze:hover{ color:#1F3864; background:#F4EEDF; }
.res-subroot{ font-size:25px; font-weight:700; text-decoration:underline; padding:8px 2px 2px; }
.search-foot{ display:flex; align-items:center; gap:6px; padding-top:6px; }
.search-foot .grow{ flex:1; }

/* footer */
footer{ flex:0 0 auto; text-align:center; padding:3px; font-size:11px; color:#666;
        padding-bottom:calc(3px + env(safe-area-inset-bottom)); }
footer a{ color:var(--accent); text-decoration:none; }

/* modals */
.modal{ position:fixed; inset:0; background:rgba(0,0,0,.45); display:flex; align-items:center;
        justify-content:center; z-index:50; }
.modal-box{ background:#fff; border-radius:12px; padding:16px; width:80%; max-width:340px; display:flex; flex-direction:column; gap:10px; }
.modal-box.big{ max-width:560px; width:92%; max-height:85vh; }
/* reseed diff-report body */
.rs-h{ font-weight:700; color:var(--navy); margin:10px 0 4px; font-size:14.5px; }
.rs-h.rs-warn{ color:#a02a2a; }
.rs-row{ font-size:13.5px; color:var(--dark); padding:2px 0; }
.rs-row.rs-warn-row{ color:#a02a2a; }
.rs-diff{ font-size:13px; margin:6px 0; padding:6px 8px; background:rgba(26,56,115,.05); border-radius:6px; }
.rs-diff b{ color:var(--navy); }
.rs-old{ color:#a02a2a; text-decoration:line-through; opacity:.8; }
.rs-new{ color:#3a6b34; }
/* the occurrence popup body must scroll inside the capped box, so a long verse/Memar
   passage doesn't push the close button off-screen (was: no scroll, couldn't close) */
#occBody{ overflow-y:auto; flex:1 1 auto; min-height:0; -webkit-overflow-scrolling:touch; }
.modal-title{ text-align:center; font-weight:700; color:var(--navy); font-size:18px; }
.share-opt{ padding:14px; border:0; border-radius:8px; color:#fff; font-family:inherit; font-size:17px; cursor:pointer; }
.share-opt.close{ background:var(--navy); }
.trans-opt.sel{ outline:3px solid #fff; outline-offset:-3px; box-shadow:0 0 0 2px var(--navy); }

/* onboarding cards (welcome · install · notifications) */
.modal-box.ob-box{ max-width:390px; }
#onboardModal .ob-body{ color:var(--dark); font-size:15.5px; line-height:1.7; }
#onboardModal .ob-body b{ color:var(--navy); }
#onboardModal .ob-dont{ display:flex; align-items:center; gap:8px; font-size:14px; color:var(--muted); cursor:pointer; }
#onboardModal .ob-dont input{ width:17px; height:17px; flex:0 0 auto; }
#onboardModal .ob-actions{ display:flex; gap:8px; margin-top:2px; }
#onboardModal .ob-primary{ flex:1 1 auto; padding:12px; border:0; border-radius:8px; background:var(--navy); color:#fff; font:inherit; font-size:16px; cursor:pointer; }
#onboardModal .ob-primary:hover{ background:var(--accent); }
#onboardModal .ob-later{ flex:0 0 auto; padding:12px 16px; border:1px solid #cfd6e6; border-radius:8px; background:#fff; color:var(--dark); font:inherit; font-size:15px; cursor:pointer; }
/* the door in the day's wall: the tick box, and what the browser is doing */
#doorModal .ob-body{ color:var(--dark); font-size:15.5px; line-height:1.7; }
#doorModal .door-tick{ display:flex; align-items:center; gap:10px; margin-top:4px; padding:12px 14px;
  border:1px solid #cfd6e6; border-radius:8px; background:#fff; font-size:16px; color:var(--dark); cursor:pointer; }
#doorModal .door-tick input{ width:22px; height:22px; flex:0 0 auto; cursor:pointer; }
#doorModal .door-tick input:disabled{ cursor:default; }
#doorModal .door-turnstile{ min-height:65px; }
#doorModal .door-state{ min-height:20px; font-size:14px; color:var(--muted); }
#doorModal .ob-actions{ display:flex; gap:8px; margin-top:2px; }
#doorModal .ob-later{ flex:1 1 auto; padding:12px 16px; border:1px solid #cfd6e6; border-radius:8px; background:#fff; color:var(--dark); font:inherit; font-size:15px; cursor:pointer; }
/* welcome carousel: parchment card so a white-filled "current" dot reads against it */
.modal-box.wc-box{ max-width:400px; width:90%; max-height:86vh; gap:12px; background:#f2ecdb; }
.wc-track{ display:flex; overflow-x:auto; scroll-snap-type:x mandatory; scroll-behavior:smooth;
  -webkit-overflow-scrolling:touch; scrollbar-width:none; }
.wc-track::-webkit-scrollbar{ display:none; }
.wc-page{ flex:0 0 100%; min-width:100%; scroll-snap-align:center; box-sizing:border-box;
  padding:2px 6px; max-height:54vh; overflow-y:auto; color:var(--dark); font-size:15.5px; line-height:1.7; }
.wc-page b{ color:var(--navy); }
.wc-page p{ margin:0 0 10px; }
.wc-page p:last-child{ margin-bottom:0; }
.wc-page ul{ margin:6px 0; padding-inline-start:20px; }
.wc-page li{ margin-bottom:3px; }
.wc-page .wc-sign{ text-align:center; margin-top:14px; color:var(--navy); font-size:16px; }
.wc-dots{ display:flex; justify-content:center; gap:10px; padding:2px 0 0; }
.wc-dot{ width:12px; height:12px; border-radius:50%; border:1.6px solid #000;
  background:transparent; padding:0; cursor:pointer; transition:background .15s; }
.wc-dot.active{ background:#fff; }
.wc-read{ display:flex; align-items:center; justify-content:center; gap:8px;
  font-size:14.5px; font-weight:600; color:var(--navy); cursor:pointer; }
.wc-read input{ width:18px; height:18px; flex:0 0 auto; cursor:pointer; }
.popup-close{ padding:14px; border:0; border-radius:8px; background:var(--navy); color:#fff;
              font-family:inherit; font-size:17px; cursor:pointer; margin-top:8px; }
#popupBody, #infoBody{ flex:1 1 auto; min-height:0; overflow-y:auto; }
.modal-box .popup-close, .modal-box .share-opt{ flex:0 0 auto; }
#popupBody .tal-head{ color:var(--navy); font-weight:700; font-size:19px; margin-top:8px; }
#popupBody .tal-gloss{ color:var(--accent); font-size:15px; }
#popupBody .tal-note{ color:var(--dark); font-size:14px; }
#popupBody .tal-cite{ color:var(--muted); font-size:13px; }
#popupBody hr{ border:0; border-top:1px solid rgba(26,56,115,.25); }

/* up-arrow marking "more results" beside an Aramaic word in the word table */
.wtbl .wt-aram .more-arrow{ color:var(--accent); font-size:12px; font-weight:700;
  vertical-align:.35em; margin-inline-start:3px; opacity:.85; }
.wtbl tr.tappable{ cursor:pointer; }
.wtbl tr.tappable:hover{ background:#eef2fd; }

/* authoritative Tal entry (showTalFull popup + dictionary app) */
.tal-sec{ color:var(--navy); font-weight:700; font-size:13.5px; margin:10px 0 3px;
  border-bottom:1px solid rgba(26,56,115,.18); padding-bottom:2px; }
.tal-sense{ color:var(--dark); font-size:15px; line-height:1.6; margin:3px 0; }
.tal-sense .pos{ color:var(--muted); font-size:12.5px; font-style:italic; }
.tal-sense .tal-pg{ color:var(--muted); font-size:12px; }
/* form analysis of an inflected piyyut/Marqe word, above the root entries */
.tal-infl{ border-inline-start:3px solid var(--accent,#b9975b); padding-inline-start:10px; margin:4px 0 10px; }
.tal-phrase{ margin:6px 0; padding-inline-start:8px; border-inline-start:2px solid var(--line,#ddd); }
.tal-locs{ display:flex; flex-wrap:wrap; gap:5px; }
.tal-loc{ background:#eef2fd; color:var(--navy); border-radius:5px; padding:2px 7px; font-size:13px; white-space:nowrap; }
.tal-loc.occ-link{ cursor:pointer; border:1px solid transparent; }
.tal-loc.occ-link:hover{ background:#dde7fb; border-color:var(--accent); }
#occBody .occ-text{ display:block; font-size:19px; line-height:1.7; color:var(--dark); text-align:right; direction:rtl; padding:4px 2px; }
#occBody .occ-text.aram{ color:#5a4326; }
#occBody .occ-heb{ margin-top:8px; padding-top:8px; border-top:1px solid rgba(26,56,115,.15); color:var(--muted); font-size:16px; line-height:1.6; }
.tal-more{ color:var(--muted); }
.tal-formlist{ color:var(--accent); font-size:14px; line-height:1.7; }

/* search result: emphasised dictionary meaning + clickable precise entry */
.res-dict{ margin-top:3px; }
.res-dict .dict-label{ color:var(--muted); font-size:13.5px; }
.res-dict .dict-gloss{ color:var(--navy); font-weight:700; font-size:16px; }
.res-dict .dict-precise{ display:inline-block; margin-inline-start:8px; color:var(--accent);
  font-size:13px; cursor:pointer; text-decoration:underline; }
.res-dict .dict-precise:hover{ color:var(--navy); }

/* ── הספרייה השומרונית: full-page gallery (image + title per book, searchable) ── */
.rd-tolib{ flex:0 0 auto; border:1px solid #8a5a2e; background:#8a5a2e; color:#fff;
  border-radius:8px; padding:7px 12px; font:inherit; font-size:16px; cursor:pointer; }
.rd-tolib:hover{ background:#a8703c; }
/* every standalone unit carries the same printer, in the same place in its header */
.rd-print{ flex:0 0 auto; border:1px solid var(--line,#c9cfe0); background:#fff;
  border-radius:8px; padding:7px 10px; font:inherit; font-size:16px; cursor:pointer; }
.rd-print:hover{ background:#eef2fd; border-color:var(--accent); }
/* same textured background as the Torah reading screen (#app), instead of the
   modals' default flat white */
.modal-box.lib-gallery{
  background-color:var(--cream); position:relative;
  background-image:linear-gradient(rgba(247,247,242,.86), rgba(247,247,242,.90)),
                   url('/static/img/background.jpg');
  background-size:cover; background-position:center top; background-repeat:no-repeat;
}
.lib-gallery .tm-search-row input{ width:100%; }
/* smaller covers than the original captioned cards — the title now lives ON the
   book, so a card is just the cover and many more fit per row */
.lib-grid{ flex:1 1 auto; min-height:0; overflow-y:auto; display:grid;
  grid-template-columns:repeat(auto-fill, minmax(88px,1fr)); gap:14px 10px; padding:10px 4px;
  align-content:start; }   /* rows keep their own height instead of splitting the overlay's */
.lib-card{ display:block; border:0; background:none; font:inherit; cursor:pointer;
  padding:3px; border-radius:10px; }
.lib-card:hover{ background:rgba(26,56,115,.06); }
.lib-card:hover .lib-book{ transform:translateY(-2px); }
/* the book itself: spine on the binding side (right in Hebrew/Arabic, left in
   English), gold rules on the spine, title written across the front. --bk/--bk-dark/
   --bk-lite are set per card in libCoverVars() so every book has its own colour. */
.lib-book{ position:relative; display:flex; align-items:center; justify-content:center;
  width:100%; aspect-ratio:3/4; overflow:hidden; transition:transform .15s;
  padding:9px 9px 9px 9px; padding-inline-start:22%;
  border-radius:2px 6px 6px 2px;
  background:linear-gradient(150deg, var(--bk-lite,#5a6b7a), var(--bk,#46566a) 55%, var(--bk-dark,#2b3542));
  box-shadow:0 2px 5px rgba(0,0,0,.3), inset 0 0 0 1px rgba(255,255,255,.13); }
html[dir="ltr"] .lib-book{ border-radius:6px 2px 2px 6px; }
.lib-book::before{ content:''; position:absolute; inset-block:0; inset-inline-start:0;
  width:17%; background:var(--bk-dark,#2b3542);
  box-shadow:inset -1px 0 0 rgba(0,0,0,.28), 1px 0 2px rgba(255,255,255,.10); }
.lib-book::after{ content:''; position:absolute; top:15%; bottom:15%;
  inset-inline-start:3.5%; width:10%;
  border-top:2px solid rgba(223,165,60,.85); border-bottom:2px solid rgba(223,165,60,.85); }
.lib-book-title{ position:relative; z-index:1; color:#fdf3dd; font-weight:700;
  font-size:11.5px; line-height:1.28; text-align:center; letter-spacing:.2px;
  text-shadow:0 1px 2px rgba(0,0,0,.45);
  padding:5px 1px; border-top:1px solid rgba(253,243,221,.4); border-bottom:1px solid rgba(253,243,221,.4);
  display:-webkit-box; -webkit-line-clamp:6; -webkit-box-orient:vertical; overflow:hidden; }
.lib-noresult{ padding:12px 22px; color:var(--accent); opacity:.7; font-size:14px; text-align:center; }

/* dictionary app modal */
.modal-box.dict-app{ max-width:620px; }
.dict-app-search{ display:flex; gap:8px; }
.dict-app-search input{ flex:1; padding:10px 12px; border:1px solid #cfd6e6; border-radius:8px; font:inherit; font-size:17px; }
.dict-app-go{ flex:0 0 auto; padding:10px 18px; border:0; border-radius:8px; background:var(--navy); color:#fff; font:inherit; font-size:16px; cursor:pointer; }
.dict-app-go:hover{ background:var(--accent); }
.dict-app-hint{ color:var(--muted); font-size:13.5px; line-height:1.5; }
#dictAppBody{ overflow-y:auto; }

/* ── פירוש הפסוק panel (sits UNDER the verse text, like ממקור שומרון) ────── */
.interp-panel{ margin-top:10px; }
.interp-panel .ptitle{ text-align:center; font-weight:700; color:var(--navy);
  font-size:17px; margin-bottom:8px; padding-bottom:6px;
  border-bottom:1px solid rgba(26,56,115,.25); }
.interp-panel .irow{ display:flex; align-items:flex-start; gap:8px; padding:6px 2px;
  border-bottom:1px solid rgba(26,56,115,.10); }
.interp-panel .irow:last-child{ border-bottom:0; }
.interp-panel .inum{ flex:0 0 auto; min-width:32px; height:26px; border:0; border-radius:6px;
  background:#c2cbef; color:var(--navy); font-family:inherit; font-size:13px; cursor:pointer; margin-top:3px; }
.interp-panel .inum.active{ background:var(--accent); color:#fff; }
.interp-panel .itext{ flex:1; line-height:1.75; direction:rtl; text-align:justify;
  text-justify:inter-word; color:var(--dark); }
.interp-panel .itext .samchar2{ font-family:'SamComment'; }
/* the commentary column: the verse's own commentary, then any source set beneath
   it in its own name (ספר האסאטיר) — a quotation, kept visibly apart from the
   synthesised prose above it rather than blended into it */
.interp-panel .icol{ flex:1; min-width:0; }
.interp-panel .iasatir{ margin-top:8px; padding-block:6px; padding-inline-start:10px;
  border-inline-start:3px solid rgba(26,56,115,.28); }
.interp-panel .iasatir-lead{ font-size:13px; font-weight:700; color:var(--navy);
  opacity:.88; margin-bottom:3px; }
.interp-panel .iasatir-text{ line-height:1.75; direction:rtl; text-align:justify;
  text-justify:inter-word; color:var(--dark); opacity:.92; }
.interp-panel .iasatir-text .samchar2{ font-family:'SamComment'; }
.interp-panel .iasatir-text.iar{ font-family:'Noto Naskh Arabic','Amiri','Times New Roman',serif;
  line-height:2.05; }
/* ── the word strip ──────────────────────────────────────────────────────────
   The commentary above it is a synthesis of SOURCES, and a source speaks only
   where it happened to speak. These are the verse's own words — the Hebrew
   sense, the Targum's Aramaic, the Arabic — and they are here because they are
   the same words the commentary is about; until now they lived a screen away in
   מילון מילים.

   It is set to read as apparatus and not as prose: smaller, quieter, each word
   its own chip so the eye can find one rather than read the line. The chips wrap
   and the strip never scrolls sideways. The Arabic gets its own face — a naskh
   at the same size looks smaller than the Hebrew beside it, so it is nudged up. */
.interp-panel .iwords{ margin-top:7px; padding-block:5px; padding-inline-start:10px;
  border-inline-start:3px solid rgba(60,120,60,.30);
  display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 12px; direction:rtl; }
.interp-panel .iwords-lead{ flex:0 0 100%; font-size:12.5px; font-weight:700;
  color:#3d6b3d; opacity:.9; margin-bottom:1px; }
.interp-panel .iword{ display:inline-flex; align-items:baseline; flex-wrap:wrap;
  gap:5px; font-size:12.5px; line-height:1.65; max-width:100%; }
.interp-panel .iw-he{ color:var(--navy); font-weight:700; }
.interp-panel .iw-gloss{ color:var(--dark); opacity:.8; }
.interp-panel .iw-arm{ color:#6a5330; }
.interp-panel .iw-arm::before{ content:'·'; opacity:.45; margin-inline-end:4px; }
.interp-panel .iw-ar{ font-family:'Noto Naskh Arabic','Amiri','Times New Roman',serif;
  font-size:1.12em; color:#2f6060; }
.interp-panel .iw-ar::before{ content:'·'; font-family:inherit; opacity:.45;
  margin-inline-end:4px; }
/* every chip after the first is fenced off from the one before it, so a strip of
   ten words does not read as one run-on line */
.interp-panel .iword + .iword{ border-inline-start:1px solid rgba(43,37,25,.16);
  padding-inline-start:12px; }

/* פירוש אם בחקותי quoted beneath the same way, on its own rule colour so two
   quoted sources under one verse stay visibly distinct from each other */
.interp-panel .ibhuq{ border-inline-start-color:rgba(150,90,30,.34); }
.interp-panel .ibhuq .iasatir-lead{ color:#8a5a22; }
.interp-panel .iasatir-text.iar{ font-family:'Noto Naskh Arabic','Amiri','Times New Roman',serif;
  direction:rtl; line-height:2.05; }
/* Arabic rendering of the commentary: same column, Arabic shaping + numerals */
.interp-panel .itext.iar{ font-family:'Noto Naskh Arabic','Amiri','Times New Roman',serif;
  line-height:2.05; }

/* header: title centred as before, with the two view switches pinned to the end
   of the same row so they never push the title off-centre */
.interp-panel .irow-head{ display:flex; align-items:center; justify-content:space-between;
  gap:8px; text-align:right; }
.interp-panel .irow-head > span{ flex:1; text-align:center; }
.ihead-tools{ display:flex; gap:6px; flex:0 0 auto; }
.ihead-btn{ border:1px solid rgba(26,56,115,.35); background:#fff; color:var(--navy);
  font-family:inherit; font-size:12px; padding:3px 9px; border-radius:999px; cursor:pointer;
  white-space:nowrap; }
.ihead-btn:hover{ background:#eef1fb; }
.ihead-btn.on{ background:var(--navy); color:#fff; border-color:var(--navy); }

/* footer: routes onward to the material the commentary was distilled from */
.ifoot{ display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin-top:10px;
  padding-top:9px; border-top:1px solid rgba(26,56,115,.20); }
.ifoot-lead{ font-size:13px; color:var(--navy); opacity:.85; margin-inline-end:2px; }
.ifoot-btn{ border:1px solid var(--accent); background:#fff; color:var(--accent);
  font-family:inherit; font-size:13px; padding:4px 12px; border-radius:999px; cursor:pointer; }
.ifoot-btn:hover{ background:var(--accent); color:#fff; }
/* marker on a verse still showing its Hebrew inside the Arabic view */
.ipend{ font-size:.82em; color:var(--accent); opacity:.9; }

/* ── "system is updating" blocking screen (server unreachable while online) ── */
#maintScreen{ position:fixed; inset:0; z-index:99999; display:flex; align-items:center;
  justify-content:center; padding:24px; background:var(--navy); color:#fff; text-align:center; }
#maintScreen .maint-card{ max-width:460px; }
#maintScreen .maint-brand{ font-size:15px; letter-spacing:.22em; color:var(--accent); margin-bottom:26px; }
#maintScreen .maint-ico{ font-size:52px; line-height:1; margin-bottom:18px; }
#maintScreen h1{ font-size:25px; font-weight:700; margin:0 0 16px; }
#maintScreen p{ font-size:17px; line-height:1.75; margin:0; opacity:.93; }
#maintScreen button{ margin-top:26px; padding:12px 30px; border:0; border-radius:9px;
  background:var(--accent); color:var(--navy); font-family:inherit; font-size:16px;
  font-weight:700; cursor:pointer; }

/* ── print-to-PDF ──────────────────────────────────────────────────────── */
.modal-box.pr-opts{ gap:14px; }
/* the print range: two lines of pickers, a book and a parasha on each, and the
   size of the selection beneath them in a quieter voice. */
/* what the sharing can and cannot do, said quietly under the buttons */
.pr-share-note{ margin:6px 2px 2px; font-size:12px; line-height:1.45; color:#8d8372; }
.pr-range-row{ display:flex; align-items:center; gap:6px; margin:4px 0; }
.pr-range-lab{ min-width:26px; font-size:13px; color:#5b5346; }
.pr-sel{ flex:0 1 auto; max-width:46%; padding:5px 6px; border:1px solid #d9d0bb;
  border-radius:6px; background:#fffdf7; font-family:inherit; font-size:13px; color:#3d372c; }
.pr-sel-wide{ flex:1 1 auto; max-width:none; }
.pr-range-size{ margin-top:5px; font-size:12px; color:#8d8372; }
.pr-range-size.big{ color:#9a5b2e; }
.pr-field{ display:flex; flex-direction:column; gap:6px; }
.pr-label{ font-weight:700; color:var(--navy); font-size:14px; }
.pr-choice{ display:flex; gap:8px; }
.pr-opt{ flex:1; padding:10px; border:2px solid var(--navy); border-radius:8px; background:#fff;
         color:var(--navy); font-weight:700; cursor:pointer; font-family:inherit; font-size:15px; }
.pr-opt.sel{ background:var(--navy); color:#fff; }
.pr-check{ display:flex; align-items:center; gap:8px; font-size:15px; color:var(--dark); cursor:pointer; }
.pr-check input{ width:18px; height:18px; flex:0 0 auto; }
.pr-check.pr-sub{ margin-inline-start:22px; font-size:13.5px; color:var(--muted,#777); }
.pr-check.pr-disabled{ opacity:.4; cursor:default; }   /* Samaritan-only option, Hebrew font selected */
/* and the font choice itself, while פורמט ספר overrules it (updatePrintBookState) */
.pr-opt.pr-disabled{ opacity:.4; cursor:default; }
.pr-trans-chosen{ font-size:13px; color:var(--accent); text-align:center; }

/* #printArea is normally invisible on screen; it only becomes the whole page
   either while previewing (body.print-preview, screen only — see below) or
   while actually printing (body.printing, via @media print further down).
   Built fresh by buildPrintPage() each time.

   Everything from here to the preview block is SHARED by both destinations and
   sized in pt/mm, never in px or in anything relative to the screen. That is the
   whole point: the preview draws the same A4 sheet the printer produces, at the
   same physical size, so the two cannot drift apart — and a chapter comes out at
   one fixed text size whatever device it was sent from. */
:root{
  --pr-text:12.5pt;      /* the verse text — fixed, never scaled to the content */
  --pr-interp:10pt;      /* פירוש הפסוק and the sources quoted under it */
  --pr-dict:9pt;         /* the word table */
  --pr-sheet:210mm;      /* A4 */
}
#printArea{ display:none; }
.pr-page{ font-family:'Hebrew', serif; direction:rtl; color:#000; background:#fff; }
.pr-header{ text-align:center; border-bottom:1.5pt solid #000; padding-bottom:5pt; margin-bottom:10pt; }
.pr-book{ font-size:17pt; font-weight:900; }
.pr-portion{ font-size:12pt; font-weight:700; margin-top:1pt; }
.pr-chapter{ font-size:10pt; margin-top:1pt; color:#333; }
.pr-main{ font-size:var(--pr-text); line-height:1.85; text-align:justify; text-justify:inter-word; }
.pr-main .samchar{ font-family:'Samaritan'; }
/* continuous "scroll" flow (הסר מספרי פסוק): one justified block with no per-verse
   line breaks. Deliberately NOT page-break-inside:avoid — a whole chapter as a
   single block must be free to run across as many pages as it needs. */
.pr-flow{ text-align:justify; text-justify:inter-word; }
.pr-col .pr-flow{ font-size:inherit; }
.pr-vrow{ margin-bottom:2pt; page-break-inside:avoid; }
.pr-vnum{ font-weight:700; color:#555; font-size:8pt; vertical-align:super; margin-inline-end:3pt; }
/* facing columns (original ‖ translation): a single rule between them rather than
   a box round each — same principle as the sections below. */
.pr-split{ display:flex; gap:8mm; }
.pr-col{ flex:1; min-width:0; text-align:justify; text-justify:inter-word; }
.pr-orig{ border-inline-end:.75pt solid #000; padding-inline-end:8mm; }
.pr-col-title{ font-weight:700; font-size:10pt; margin-bottom:4pt; text-align:center; }
/* פירוש הפסוק / מילון מילים: sections of the sheet, not boxes on it. A frame drawn
   round a commentary that runs over three pages breaks badly at every page edge,
   so each section is set off by a rule above it and is otherwise free to flow. */
.pr-sec{ margin-top:8pt; padding-top:6pt; border-top:.75pt solid #000; page-break-inside:auto; }
.pr-sec-title{ font-weight:700; font-size:11pt; margin-bottom:5pt; }

/* ── פורמט ספר ───────────────────────────────────────────────────────────────
   A frame rather than a flow: the upper half is the Torah and nothing else, the
   lower half is commentary, and the two are separated by a rule and a thin
   space — the only furniture on the page. No header, no verse numbers, no
   heading in any script, because the commentary names its verse by quoting the
   words it opens and closes on instead.

   Both halves are set WHOLE in a Samaritan face — the face is on the band, not
   on spans within it, so that a comma or a bracket cannot quietly fall back to
   the Hebrew font. buildBookDoc() maps away the characters these faces have no
   glyph for before a word ever reaches here.

   The band heights are written by the paginator, which measured the type to
   decide how many lines stand in each; overflow is hidden as a guard only —
   nothing should ever reach it. */
.pr-bk-page{ page-break-after:always; }
.pr-bk-page:last-child{ page-break-after:auto; }
.pr-bk-band{ overflow:hidden; text-align:justify; text-justify:inter-word;
             text-align-last:justify; direction:rtl; }
/* where the stream genuinely ends, the final line stops being stretched */
.pr-bk-band.pr-bk-last{ text-align-last:right; }
.pr-bk-torah{ font-family:'Samaritan', serif; font-size:var(--pr-text); line-height:1.85; }
.pr-bk-comm { font-family:'SamComment', serif; font-size:var(--pr-interp); line-height:1.7; }
.pr-bk-comm b{ font-weight:700; }
/* These are keyed to the FACE classes, not to .pr-bk-band: the box the page is
   measured in (.pr-bk-measure) carries the face class but not the band class,
   and while these rules missed it the layout was measured with the very metrics
   they exist to correct — 32-em apostrophes and all.
   The word divider is not a letter. Set in the Samaritan face it comes out as a
   glyph the reader has to decode; it is a plain middle dot, on the middle of the
   line, tight against the word it follows — which is why the space between two
   words falls AFTER the dot and never before it. */
.pr-bk-torah .wsep, .pr-bk-comm .wsep{ font-family:'Hebrew', serif; vertical-align:middle;
                   margin:0; letter-spacing:0; }
/* and the same for the punctuation that names a verse: three plain dots and a
   plain dash, not three Samaritan glyphs */
.pr-bk-torah .bkpunc, .pr-bk-comm .bkpunc{ font-family:'Hebrew', serif; letter-spacing:.06em; }
.pr-bk-torah .bkw, .pr-bk-comm .bkw{ font-family:inherit; }
/* the rule sits in the MIDDLE of the gap, so there is a clear line of white
   above it as well as below — the Torah used to run straight into it */
.pr-bk-rule{ height:var(--pr-bk-gap, 9mm); position:relative; }
.pr-bk-rule::before{ content:''; position:absolute; left:0; right:0; top:50%;
                     border-top:.75pt solid #000; }
/* the off-screen box the paginator lays the type out in to find its lines. It
   must match the band in every way that affects line breaking — width is set
   per call, the rest comes from the same .pr-bk-torah/.pr-bk-comm rules above. */
.pr-bk-measure{ position:absolute; left:-10000px; top:0; visibility:hidden;
                text-align:justify; text-justify:inter-word; direction:rtl; }
.pr-sec .pr-vrow{ font-size:var(--pr-interp); line-height:1.55;
                  text-align:justify; text-justify:inter-word; }
/* a source quoted under a verse's commentary (ספר האסאטיר, פירוש אם בחקותי) —
   indented and led by its reference rather than run on with the prose above */
.pr-quoted{ margin-inline-start:5mm; margin-bottom:4pt; }
.pr-quoted-lead{ font-weight:700; }
.pr-sec .samchar2{ font-family:'SamComment'; }
.pr-wtbl{ width:100%; border-collapse:collapse; font-size:var(--pr-dict); }
.pr-wtbl th{ text-align:right; font-weight:700; border-bottom:.75pt solid #000; padding:2pt 4pt; }
/* an explicit line-height, because the Samaritan face's own ascent/descent are
   far taller than the type size and would otherwise leave each row half empty */
.pr-wtbl td{ text-align:right; border-bottom:.5pt solid #999; padding:2pt 4pt;
             vertical-align:top; line-height:1.35; }
.pr-wtbl tr{ page-break-inside:avoid; }
.pr-wtbl .samchar{ font-family:'Samaritan'; }
/* a library unit's own sheet. Its references are words, not verse numbers ("§ 12",
   a question number, a citation), so they stand above the passage rather than
   superscript to it. */
.pr-unitrow{ margin-bottom:6pt; }
.pr-unit-ref{ font-weight:700; font-size:9pt; color:#333; margin-bottom:1pt; }
.pr-meta{ font-size:9pt; color:#333; margin-bottom:6pt; }
.pr-lines{ white-space:pre-line; text-align:start; }   /* a poem keeps its own line breaks */
.pr-ar{ font-family:'Arabic', serif; }
/* verse citations and links are live on screen and dead on paper */
.pr-page .tm-ref, .pr-page a{ color:inherit; text-decoration:none; font-weight:inherit; }
/* the two tool units (dictionary app, rhyme finder) print the pane they filled,
   so the screen's colours, chips and shadows are flattened to ink here */
.pr-clone{ font-size:var(--pr-interp); line-height:1.45; }
.pr-clone *{ color:#000 !important; background:none !important; box-shadow:none !important;
             border-color:#999 !important; max-width:100% !important; }
.pr-clone table{ width:100%; border-collapse:collapse; }
.pr-clone th, .pr-clone td{ border-bottom:.5pt solid #999; padding:2pt 4pt;
                            text-align:right; vertical-align:top; }
.pr-clone tr, .pr-clone .pp-item, .pr-clone .dict-entry{ page-break-inside:avoid; }

/* on-screen preview: the very same .pr-page, drawn as the actual sheet it will be
   printed on — 210mm wide with the printer's own margins — over a grey backdrop,
   with a fixed action bar (הדפס / סגור). --pr-zoom (set by fitPreviewSheet) shrinks
   the sheet to fit a narrow screen; `zoom`, not `transform`, so the scroll area
   shrinks with it. Screen-scoped, so none of it can reach the paper. */
@media screen{
  body.print-preview #printArea{ display:block; position:fixed; inset:0; z-index:9990;
    background:#8a8a8a; overflow:auto; padding:56px 8px 24px; }
  body.print-preview .pr-page{ width:var(--pr-sheet); padding:15mm; margin:0 auto 16px;
    zoom:var(--pr-zoom, 1); box-shadow:0 3px 16px rgba(0,0,0,.35); }
}
#printPreviewBar{ position:fixed; top:0; inset-inline-start:0; inset-inline-end:0; z-index:9995;
  display:flex; gap:10px; justify-content:center; padding:10px; background:var(--navy); }
#printPreviewBar.hidden{ display:none; }
#printPreviewBar button{ padding:9px 18px; border:0; border-radius:8px; font:inherit; font-size:15px;
  font-weight:700; cursor:pointer; color:#fff; }
#ppPrintBtn{ background:#3a6b34; }
#ppCloseBtn{ background:#7a3030; }

@media print{
  @page{ size:A4; margin:15mm; }
  /* The app shell holds itself to one viewport — html,body{height:100%} plus
     body{overflow:hidden} — which is right for a phone app and fatal on paper:
     the printer clips everything past the first page, so a chapter came out
     truncated and nothing matched the preview. Undo it for print only. */
  html, body{ height:auto !important; overflow:visible !important; background:#fff !important; }
  /* body.printing is the ONLY thing that governs print output — hides every
     top-level sibling (app UI, every modal, the preview action bar) so nothing
     but #printArea's own content ever reaches paper, regardless of whether
     print was triggered from the options modal, from within the preview, or
     from the browser's own Ctrl+P (see the beforeprint handler in app.js). */
  body.printing > *:not(#printArea){ display:none !important; }
  body.printing #printArea{ display:block !important; }
  /* the sheet is the paper itself here: @page supplies the margins */
  .pr-page{ width:auto; padding:0; }
  .pr-header, .pr-sec-title, .pr-col-title{ page-break-after:avoid; }
}
#dictAppBody .dict-entry{ border-top:1px solid rgba(26,56,115,.15); padding-top:6px; margin-top:8px; }
#dictAppBody .tal-head{ color:var(--navy); font-weight:700; font-size:19px; }
/* dictionary app: mode tabs, page/index nav, clickable forms + locations */
.dict-dir{ display:flex; gap:6px; margin-bottom:6px; }
.dict-dir-btn{ flex:1 1 0; padding:8px 4px; border:1px solid var(--accent); border-radius:8px; background:#fff;
  color:var(--accent); font-family:inherit; font-size:14.5px; font-weight:600; cursor:pointer; }
.dict-dir-btn.active{ background:var(--accent); color:#fff; }
.dict-he-res{ border-top:1px solid rgba(26,56,115,.12); padding:8px 2px; }
.dict-he-word{ color:var(--navy); font-weight:800; font-size:calc(19px*var(--dict-fs,1)); }
.dict-he-rlabel{ color:var(--muted); font-size:13px; margin:3px 0 2px; }
.dict-he-roots{ display:flex; flex-wrap:wrap; gap:6px; }
.dict-he-root{ border:1px solid var(--accent); background:#f3f7ff; color:var(--accent); border-radius:14px;
  padding:4px 12px; font-family:inherit; font-size:calc(16px*var(--dict-fs,1)); cursor:pointer; }
.dict-he-root:hover{ background:var(--accent); color:#fff; }
.dict-tabs{ display:flex; gap:6px; }
.dict-tab.hidden{ display:none; }
.dict-tab{ flex:1 1 0; padding:8px 4px; border:1px solid #cfd6e6; border-radius:8px; background:#fff;
  color:var(--navy); font:inherit; font-size:14px; cursor:pointer; }
.dict-tab.active{ background:var(--navy); color:#fff; border-color:var(--navy); }
.dict-nav{ display:flex; align-items:center; justify-content:center; gap:10px; }
.dict-nav-btn{ border:1px solid #cfd6e6; background:#fff; color:var(--navy); border-radius:8px;
  padding:6px 12px; font:inherit; font-size:14px; cursor:pointer; }
.dict-nav-btn:disabled{ opacity:.4; cursor:default; }
.dict-nav-lbl{ color:var(--navy); font-weight:600; font-size:14px; }
.dict-index{ display:flex; flex-direction:column; }
.dict-index-row{ display:flex; align-items:baseline; gap:10px; width:100%; text-align:right;
  border:0; border-top:1px solid rgba(26,56,115,.1); background:transparent; padding:8px 4px; cursor:pointer; font:inherit; }
.dict-index-row:hover{ background:#f3f5fb; }
.dict-ix-lemma{ flex:1 1 auto; color:var(--navy); font-weight:600; font-size:16px; }
.dict-ix-root{ color:var(--muted); font-size:13px; }
.dict-ix-page{ color:var(--accent); font-size:12.5px; }
.dict-pageentry{ border-top:1px solid rgba(26,56,115,.1); padding:7px 2px; color:var(--dark); font-size:calc(15px*var(--dict-fs,1)); line-height:1.6; }
.dict-direct-sec{ margin-top:2px; }
.dict-direct{ border-inline-start:3px solid var(--accent); padding:5px 8px; margin:4px 0; color:var(--dark);
  font-size:calc(15.5px*var(--dict-fs,1)); line-height:1.6; background:#f7f9ff; border-radius:0 6px 6px 0; }
#dictAppBody .tal-sense{ font-size:calc(15.5px*var(--dict-fs,1)); }
#dictAppBody .dict-ix-lemma{ font-size:calc(16px*var(--dict-fs,1)); }
#dictAppBody .tm-wtbl td{ font-size:calc(15px*var(--dict-fs,1)); }
.dict-direct-root{ color:var(--muted); font-size:13px; }
.dict-form-hint{ color:var(--muted); font-size:12.5px; margin:2px 0; }
.tal-formlist.clickable-forms{ display:flex; flex-wrap:wrap; gap:6px; }
.dict-form{ display:inline-flex; align-items:center; gap:3px; border:1px solid rgba(46,97,184,.4);
  border-radius:14px; padding:3px 10px; color:var(--accent); font-size:15px; cursor:pointer; background:#fff; }
.dict-form:hover{ background:#eef3fc; }
.dict-form.open{ background:var(--accent); color:#fff; }
.dict-form-i{ font-size:11px; opacity:.85; }
.dict-loclist{ flex-basis:100%; margin-top:6px; border:1px solid rgba(46,97,184,.25); border-radius:8px; padding:6px 8px; background:#fbfcff; }
.dict-loc-head{ color:var(--navy); font-weight:700; font-size:13.5px; margin-bottom:4px; }
.dict-loc-row{ display:flex; gap:8px; padding:3px 0; border-top:1px dashed rgba(26,56,115,.12); font-size:14px; }
.dict-loc-ref{ flex:0 0 auto; color:var(--accent); font-weight:600; min-width:70px; }
.dict-loc-q{ color:var(--dark); opacity:.85; }

/* ── comprehensive word index: browsable grid + per-word detail ── */
.dict-wgrid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(118px,1fr)); gap:6px; }
.dict-wcell{ display:flex; flex-direction:column; align-items:flex-start; gap:3px; text-align:right;
  border:1px solid #dfe4f0; border-radius:9px; background:#fff; padding:7px 9px; cursor:pointer; font:inherit; }
.dict-wcell:hover{ background:#f3f5fb; border-color:var(--accent); }
.dict-wword{ color:var(--navy); font-weight:700; font-size:calc(16px*var(--dict-fs,1)); }
.dict-wbadges{ display:flex; gap:4px; }
.dict-wb{ font-size:11px; line-height:1; padding:2px 5px; border-radius:9px; font-weight:700; }
.dict-wb.tor{ background:#e8f0ff; color:var(--accent); }
.dict-wb.mem{ background:#fdf0e3; color:#b9711e; }
.dict-wb.mng{ background:#eef0f4; color:var(--muted); }
.dict-back{ border:1px solid #cfd6e6; background:#fff; color:var(--navy); border-radius:8px;
  padding:5px 12px; cursor:pointer; font:inherit; font-weight:600; margin-bottom:8px; }
.dict-back:hover{ background:#f3f5fb; }
.dict-detail-word{ color:var(--navy); font-weight:800; font-size:calc(22px*var(--dict-fs,1)); margin-bottom:6px; }
.dict-mcard{ border-top:2px solid rgba(26,56,115,.15); padding-top:8px; margin-top:10px; }
.dict-mroot{ color:var(--accent); font-weight:700; font-size:calc(15px*var(--dict-fs,1)); margin-bottom:3px; }
.dict-senses{ background:#f7f9ff; border-radius:7px; padding:6px 9px; margin-bottom:6px; }
.dict-sense{ color:var(--dark); font-size:calc(15px*var(--dict-fs,1)); line-height:1.55; padding:1px 0; }
.dict-occ-h{ color:var(--navy); font-weight:700; font-size:calc(13.5px*var(--dict-fs,1));
  margin:8px 0 4px; border-bottom:1px solid rgba(26,56,115,.12); padding-bottom:2px; }
.dict-occ-list{ display:flex; flex-direction:column; }
.dict-occ{ padding:5px 2px; border-top:1px dashed rgba(26,56,115,.1); }
.dict-occ-ref{ display:inline-block; color:var(--accent); font-weight:600; font-size:calc(13px*var(--dict-fs,1)); margin-inline-end:7px; }
.dict-occ-txt{ color:var(--dark); font-size:calc(15px*var(--dict-fs,1)); line-height:1.65; }
.dict-occ-txt.aram{ color:#5a4326; }
.dict-occ-heb{ color:var(--muted); font-size:calc(14px*var(--dict-fs,1)); line-height:1.55; margin-top:2px; }
.dict-hl{ background:#fff1bf; border-radius:3px; padding:0 1px; font-weight:700; color:var(--navy); }
.dict-noocc{ font-style:italic; }
.dict-more{ color:var(--muted); font-size:12.5px; padding:4px 2px; }
.dict-occ-btn{ display:inline-block; margin-top:8px; border:1px solid var(--accent); background:#f3f7ff;
  color:var(--accent); border-radius:9px; padding:6px 12px; cursor:pointer; font:inherit; font-weight:600; }
.dict-occ-btn:hover{ background:var(--accent); color:#fff; }
.dict-sense-banner{ display:inline-block; background:#fff6da; border:1px solid #e9c97a; color:#6b531a;
  border-radius:7px; padding:3px 10px; font-weight:700; font-size:calc(14px*var(--dict-fs,1)); margin:2px 0 4px; }

/* ── full-book reader (Tibåt Mårqe / Ṣadaqah al-Ḥakīm) — its own full window ── */
.modal.book-full{ align-items:stretch; justify-content:stretch; padding:0; }
.modal-box.book-reader{ max-width:none; width:100%; height:100%; max-height:100%;
  border-radius:0; gap:10px; padding:14px; }
/* ציר הזמן: a whole page of its own inside the app, so it gets the full box with
   only the return bar above it — no padding to waste and no border to box it in */
/* ...and then not even that, 2026-11-19. On a telephone the bar and the ten
   pixels around the frame took the app down to 355×761 of a 375×812 screen,
   and the owner asked for it gone altogether. The app is the whole screen; the
   way back is an arrow inside its OWN header, put there by hub.js, which also
   makes room for it there so that nothing of the app is covered. */
.modal-box.tl-box{ padding:0; gap:0; }
.modal-box.tl-box > .rd-top{ display:none; }
#tlFrame, #shFrame{ flex:1 1 auto; width:100%; border:0; min-height:0; background:#fff; }
/* explicit "return to the Torah app" button inside the reader / dictionary apps */
.rd-totorah{ flex:0 0 auto; border:1px solid var(--navy); background:var(--navy); color:#fff;
             border-radius:8px; padding:7px 12px; font-family:inherit; font-size:14px; font-weight:700;
             cursor:pointer; white-space:nowrap; }
.rd-totorah:hover{ background:var(--accent); border-color:var(--accent); }
/* header controls (return-to-Torah · back · title · zoom · language) wrap instead of
   piling on top of each other on narrow screens; the title truncates rather than push */
.rd-top{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; row-gap:6px; }
.tm-back{ flex:0 0 auto; border:1px solid var(--navy); background:var(--navy); color:#fff;
  border-radius:8px; padding:7px 13px; font:inherit; font-size:14px; font-weight:700;
  cursor:pointer; white-space:nowrap; }
.tm-back:hover{ background:var(--accent); border-color:var(--accent); }
.rd-top .modal-title{ flex:1 1 120px; min-width:0; text-align:center; font-size:17px;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.rd-lang{ flex:0 0 auto; border:0; border-radius:8px; background:var(--navy); color:#fff;
  padding:7px 12px; font:inherit; font-size:13.5px; cursor:pointer; white-space:nowrap; }
.rd-lang:hover{ background:var(--accent); }
.tm-secnum.tm-jump{ cursor:pointer; text-decoration:underline dotted; }
.tm-secnum.tm-jump:hover{ color:var(--active); }
.tm-search-row{ display:flex; gap:8px; }
/* ---- the piyyut menu.
 * The tree is organised by festival and genre, which is right for browsing;
 * someone coming to a particular piece has to open three levels to reach it.
 * This is the short way -- and being the device's own control, it carries
 * type-ahead without a line of code from us.
 */
.piy-jump{
  flex:0 0 auto; max-width:46%;
  font:inherit; font-size:15px; padding:9px 10px;
  border:1px solid #cfd6e6; border-radius:8px;
  background:#fff; color:inherit; cursor:pointer;
}
.piy-jump:hover{ border-color:#c9a227; }
@media (max-width:620px){ .piy-jump{ max-width:42%; font-size:14px; } }
.tm-search-row input{ flex:1; padding:9px 12px; border:1px solid #cfd6e6; border-radius:8px; font:inherit; font-size:16px; }
.tm-body{ flex:1 1 auto; min-height:0; overflow-y:auto; padding:2px 2px 4px; }
.tm-hint{ color:var(--muted); font-size:14px; margin:2px 0 8px; }
/* table of contents */
.tm-toc{ display:flex; flex-direction:column; gap:8px; }
.tm-toc-item{ display:flex; align-items:center; gap:12px; width:100%; text-align:right;
  border:1px solid rgba(26,56,115,.18); border-radius:10px; background:#fbfaf5; padding:12px 14px;
  cursor:pointer; font:inherit; }
.tm-toc-item:hover{ background:#f1eede; border-color:var(--accent); }
.tm-toc-letter{ flex:0 0 auto; width:34px; height:34px; border-radius:50%; background:var(--navy);
  color:#fff; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:17px; }
.tm-toc-title{ flex:1 1 auto; color:var(--navy); font-weight:600; font-size:17px; }
.tm-toc-count{ flex:0 0 auto; color:var(--muted); font-size:12.5px; }
/* chapter view */
.tm-tools{ display:flex; gap:8px; margin-bottom:8px; position:sticky; top:0; background:#fff; padding:2px 0; z-index:1; }
.tm-words-btn{ border:0; border-radius:8px; background:#735438; color:#fff; padding:8px 14px;
  font:inherit; font-size:14px; cursor:pointer; }
.tm-words-btn:hover{ filter:brightness(1.1); }
.tm-sec{ border-top:1px solid rgba(26,56,115,.14); padding:9px 2px; }
.tm-sec.tm-flash{ background:rgba(255,216,107,.35); border-radius:8px; transition:background 1.4s; }
.tm-secnum{ color:var(--accent); font-weight:700; font-size:13px; margin-bottom:3px; }
.tm-aram{ direction:rtl; text-align:right; color:#5a4326; font-size:calc(16px*var(--rd-fs,1)); line-height:1.75; margin-bottom:5px; }
.tm-heb{ direction:rtl; text-align:right; color:var(--dark); font-size:calc(16px*var(--rd-fs,1)); line-height:1.8; }
/* text-zoom control shared by the readers + dictionary (A− / A+) */
.rd-zoom{ flex:0 0 auto; display:flex; gap:4px; }
.rd-zbtn{ border:1px solid #cfd6e6; background:#fff; color:var(--navy); border-radius:7px;
  min-width:30px; padding:5px 7px; font:inherit; font-size:14px; font-weight:700; cursor:pointer; line-height:1; }
.rd-zbtn:hover{ background:#eef2fb; }
.dict-app-head{ display:flex; align-items:center; gap:8px; }
.dict-app-head .modal-title{ flex:1 1 auto; min-width:0; text-align:right; }
/* The title is bound with non-breaking spaces so it can only ever break after
   "מילון". Beside the buttons that unbreakable half needs ~116px, which a phone
   header cannot spare — so below 800px the row wraps and the title takes a line
   of its own, where it fits whole. The break-after-מילון fallback still applies
   on anything narrower than that. */
@media (max-width:800px){
  .dict-app-head{ flex-wrap:wrap; }
  .dict-app-head .modal-title{ flex:1 1 100%; order:3; text-align:center; }
}
.tm-ref{ color:var(--accent); font-weight:600; cursor:pointer; text-decoration:underline dotted; }
.tm-ref:hover{ color:var(--active); }
/* search results */
.tm-result{ display:block; width:100%; text-align:right; border:0; border-top:1px solid rgba(26,56,115,.12);
  background:transparent; padding:9px 4px; cursor:pointer; font:inherit; }
.tm-result:hover{ background:#f3f5fb; }
.tm-res-ref{ display:block; color:var(--accent); font-weight:700; font-size:13.5px; }
.tm-res-snip{ display:block; color:var(--dark); font-size:15px; line-height:1.6; }
/* per-chapter glossary reuses .wtbl */
.tm-wtbl{ width:100%; }

/* ── עיון בפיוטים השומרוניים: festival/genre tree + reader + dictionary pane ── */
.piy-body{ flex:1 1 auto; min-height:0; display:flex; gap:10px; overflow:hidden; }
.piy-tree{ flex:0 0 260px; overflow-y:auto; border-left:1px solid rgba(26,56,115,.18); padding-left:8px; }
.piy-fest > summary{ color:var(--navy); font-weight:700; font-size:15.5px; cursor:pointer; padding:5px 4px; }
.piy-genre{ margin-right:12px; }
.piy-genre > summary{ font-weight:600; font-size:14px; color:var(--dark); cursor:pointer; padding:3px 4px; }
.piy-count{ color:var(--muted); font-weight:400; font-size:12.5px; }
.piy-item{ margin-right:20px; padding:4px 8px; border-radius:6px; cursor:pointer; font-size:13.5px;
  display:flex; justify-content:space-between; gap:6px; }
.piy-item:hover, .piy-item.sel{ background:#fff3cd; }
.piy-item-title{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.piy-item-auth{ color:var(--muted); font-size:12px; white-space:nowrap; flex:0 0 auto; }
.piy-main{ flex:1 1 auto; min-width:0; display:flex; gap:10px; overflow:hidden; }
.piy-textpane{ flex:1 1 auto; min-width:0; overflow-y:auto; padding:2px 6px; }
.piy-dictpane{ flex:1 1 260px; min-width:0; overflow-y:auto; padding:2px 6px; border-right:1px solid rgba(26,56,115,.18); }
#piyDictToggle.active{ background:var(--accent); }
.piy-title{ font-size:1.3em; font-weight:700; color:var(--navy); margin:0 0 4px; }
.piy-meta{ color:var(--muted); font-size:13px; margin-bottom:14px; }
.piy-tag{ background:#fff3cd; border:1px solid rgba(26,56,115,.18); border-radius:10px;
  padding:1px 9px; margin-left:5px; display:inline-block; margin-bottom:4px; }
.piy-text{ font-size:calc(18px*var(--rd-fs,1)); line-height:2.05; white-space:pre-wrap; }
.piy-w{ cursor:pointer; border-radius:4px; }
.piy-w:hover{ background:#fff3cd; }
.piy-w.piy-hasdef{ border-bottom:2px dotted var(--accent); }
.piy-notes{ margin-top:18px; padding:11px 13px; background:#fbfaf5; border:1px solid rgba(26,56,115,.18);
  border-radius:8px; font-size:13.5px; color:var(--muted); }
.piy-dictpane h4{ color:var(--navy); margin:2px 0 8px; }
.piy-dline{ margin-bottom:13px; padding-bottom:9px; border-bottom:1px dashed rgba(26,56,115,.18); }
.piy-dsrc{ font-size:15px; margin-bottom:3px; }
.piy-dw{ display:inline-block; margin:2px 0 2px 10px; font-size:13px; }
.piy-dw b{ color:var(--navy); }
.piy-dw span{ color:#4a6b30; }
/* what kind of answer a piyyut word got, where it is not a plain meaning:
   a reading that corrects the scan, a Hebrew word, a corrupt form. Said in a
   quieter voice than the meaning itself, and on its own line. */
.piy-dw-note{ display:block; font-size:12px; color:#8d8372; font-style:italic; }
.piy-dw-none{ color:var(--muted); }
.piy-wordpop{ position:fixed; background:#fff; border:1px solid var(--accent); border-radius:8px;
  padding:9px 13px; box-shadow:0 4px 14px rgba(0,0,0,.2); z-index:80; max-width:280px; font-size:14px; }
.piy-wordpop b{ color:var(--navy); }
@media (max-width:800px){
  .piy-tree{ display:none; }
  .piy-body.piy-detail-open .piy-tree{ display:none; }
  .piy-body:not(.piy-detail-open) .piy-tree{ display:block; flex:1 1 auto; border-left:0; }
  .piy-body:not(.piy-detail-open) .piy-main{ display:none; }
  .piy-main{ flex-direction:column; }
  .piy-dictpane{ border-right:0; border-top:1px solid rgba(26,56,115,.18); flex:0 0 40%; }
}

/* ── אישי השומרונים: era/A-Z list on one side, the figure's entry on the other ── */
/* the row is shared with the other readers, which are nowrap — this one carries a
   second control, so it must be allowed to wrap or the toggle is pushed off-screen */
.pp-search-row{ align-items:center; flex-wrap:wrap; }
.pp-search-row input{ flex:1 1 200px; min-width:0; }
.pp-modes{ display:flex; gap:3px; background:#f1eede; border-radius:8px; padding:3px; flex:0 0 auto; }
.pp-mode{ border:0; background:transparent; padding:7px 13px; border-radius:6px; cursor:pointer;
  font:inherit; font-size:13.5px; color:var(--dark); }
.pp-mode.on{ background:var(--navy); color:#fff; }
.pp-body{ flex:1 1 auto; min-height:0; display:flex; gap:10px; overflow:hidden; }
.pp-list{ flex:0 0 292px; overflow-y:auto; border-left:1px solid rgba(26,56,115,.18); padding-left:8px; }
.pp-group > summary{ color:var(--navy); font-weight:700; font-size:15.5px; cursor:pointer; padding:5px 4px; }
.pp-item{ margin-right:14px; padding:5px 8px; border-radius:6px; cursor:pointer; font-size:13.5px;
  display:flex; justify-content:space-between; align-items:baseline; gap:8px; }
.pp-item:hover, .pp-item.sel{ background:#fff3cd; }
.pp-item-name{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.pp-item-per{ color:var(--muted); font-size:11.5px; white-space:nowrap; flex:0 0 auto; }
.pp-detail{ flex:1 1 auto; min-width:0; overflow-y:auto; padding:2px 10px; }
.pp-name{ font-size:calc(21px*var(--rd-fs,1)); font-weight:700; color:var(--navy); margin:0 0 8px; }
.pp-chips{ display:flex; flex-wrap:wrap; gap:6px; margin-bottom:14px; }
.pp-chip{ background:#fff3cd; border:1px solid rgba(26,56,115,.18); border-radius:10px;
  padding:3px 10px; font-size:12.5px; color:var(--dark); }
.pp-chip b{ color:var(--muted); font-weight:600; font-size:11px; }
.pp-chip-per{ background:#eef3fb; }
.pp-desc{ font-size:calc(16.5px*var(--rd-fs,1)); line-height:1.85; color:var(--dark); }
/* the enrichment: a note that fills in what the encyclopedia entry left out,
   and links onward — both present only for the figures the source covered */
.pp-note{ margin-top:16px; padding:11px 13px; background:#fbfaf5;
  border:1px solid rgba(26,56,115,.18); border-radius:8px;
  font-size:calc(15px*var(--rd-fs,1)); line-height:1.8; color:var(--dark); }
.pp-note h4, .pp-refs h4{ margin:0 0 6px; color:var(--navy); font-size:14px; }
/* the full Wikipedia article, folded away so it does not bury the entry itself */
.pp-wiki{ margin-top:16px; border:1px solid rgba(26,56,115,.18); border-radius:8px; background:#fff; }
.pp-wiki > summary{ cursor:pointer; padding:10px 13px; color:var(--navy); font-weight:600;
  font-size:14px; list-style:none; }
.pp-wiki > summary::-webkit-details-marker{ display:none; }
.pp-wiki > summary::before{ content:'▸ '; }
.pp-wiki[open] > summary::before{ content:'▾ '; }
.pp-wiki[open] > summary{ border-bottom:1px solid rgba(26,56,115,.14); }
.pp-wiki-body{ padding:4px 14px 2px; font-size:calc(15.5px*var(--rd-fs,1)); line-height:1.85; color:var(--dark); }
.pp-wiki-body p{ margin:0 0 10px; }
.pp-wiki-body h5{ margin:16px 0 6px; color:var(--navy); font-size:calc(16px*var(--rd-fs,1)); }
.pp-wiki-body .pp-wiki-h3{ font-size:calc(14.5px*var(--rd-fs,1)); color:var(--dark); }
.pp-wiki-credit{ padding:8px 14px 11px; color:var(--muted); font-size:12px;
  border-top:1px dashed rgba(26,56,115,.18); }
.pp-refs{ margin-top:14px; }
.pp-refs ul{ margin:0; padding-inline-start:18px; }
.pp-refs li{ font-size:13.5px; line-height:1.7; }
.pp-refs a{ color:var(--navy); }
.pp-src{ margin-top:16px; padding-top:9px; border-top:1px dashed rgba(26,56,115,.22);
  color:var(--muted); font-size:12.5px; }
@media (max-width:800px){
  .pp-list{ flex:0 0 auto; }
  .pp-body.pp-detail-open .pp-list{ display:none; }
  .pp-body:not(.pp-detail-open) .pp-list{ display:block; flex:1 1 auto; border-left:0; }
  .pp-body:not(.pp-detail-open) .pp-detail{ display:none; }
  /* the search takes the first line to itself and the toggle the second, each
     button splitting the width so both are comfortable to tap */
  .pp-search-row input{ flex:1 1 100%; }
  .pp-modes{ width:100%; justify-content:stretch; }
  .pp-mode{ flex:1 1 0; text-align:center; padding:9px 8px; }
}

/* ── מציאת חרוזים: word/suffix/sound rhyme search over the piyyutim word bank ── */
.rhy-controls{ display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
.rhy-modes{ display:flex; gap:3px; background:#f1eede; border-radius:8px; padding:3px; }
.rhy-mode{ border:0; background:transparent; padding:7px 13px; border-radius:6px; cursor:pointer;
  font:inherit; font-size:13.5px; color:var(--dark); }
.rhy-mode.on{ background:var(--navy); color:#fff; }
.rhy-controls input[type=text], .rhy-controls select{ padding:8px 11px; border:1px solid #cfd6e6;
  border-radius:8px; font:inherit; font-size:15px; }
.rhy-clean{ font-size:13px; color:var(--muted); display:flex; align-items:center; gap:4px; }
.rhy-or{ color:var(--muted); font-size:13px; }
.rhy-startletter{ display:flex; align-items:center; gap:6px; font-size:13px; color:var(--muted); }
.rhy-startletter input{ width:44px; text-align:center; }
.rhy-summary{ color:var(--muted); font-size:13.5px; margin:8px 2px; }
.rhy-results{ flex:1 1 auto; min-height:0; overflow-y:auto; }
.rhy-table{ width:100%; border-collapse:collapse; }
.rhy-table th{ background:#f1eede; text-align:right; padding:8px 10px; font-size:13px; color:var(--navy);
  position:sticky; top:0; }
.rhy-table td{ padding:7px 10px; border-top:1px solid rgba(26,56,115,.14); vertical-align:top; font-size:14.5px; }
.rhy-word{ font-size:1.1em; font-weight:700; color:var(--navy); }
.rhy-grp{ background:#fff3cd; border-radius:9px; padding:1px 8px; font-size:12.5px; }
.rhy-conf{ font-size:11.5px; color:var(--muted); }
.rhy-def.rhy-def-none{ color:var(--muted); font-style:italic; }
.rhy-occbtn{ background:none; border:1px solid var(--accent); color:var(--accent); border-radius:6px;
  padding:3px 10px; cursor:pointer; font-size:12.5px; }
.rhy-occlist{ margin-top:6px; font-size:13px; display:flex; flex-direction:column; gap:2px; }
.rhy-occlink{ display:block; text-align:right; background:none; border:0; color:var(--accent);
  cursor:pointer; padding:2px 0; font:inherit; font-size:13px; }
.rhy-occlink:hover{ text-decoration:underline; }

/* ── "חבר לי חיבור": piyyut draft composer (admin-only, first phase) ── */
.cmp-controls{ display:flex; gap:12px; flex-wrap:wrap; align-items:flex-end; font-size:13px; color:var(--muted); }
.cmp-field{ display:flex; flex-direction:column; gap:4px; font-size:13px; color:var(--muted); margin:8px 0; }
.cmp-field select, .cmp-field input[type=number], .cmp-field input[type=text], .cmp-field textarea{
  display:block; padding:7px 10px; border:1px solid #cfd6e6; border-radius:8px;
  font:inherit; font-size:14.5px; color:var(--dark); box-sizing:border-box; width:100%; }
.cmp-controls input[type=number]{ width:64px; }
.cmp-controls input[type=text]{ width:140px; }
.cmp-field-wide{ min-width:160px; }
.cmp-field textarea{ resize:vertical; font-family:inherit; }
.cmp-note{ color:var(--muted); font-size:13px; line-height:1.6; background:#fff3cd;
  border:1px solid rgba(26,56,115,.14); border-radius:8px; padding:9px 12px; margin:10px 0; }
.cmp-poem{ flex:1 1 auto; min-height:0; overflow-y:auto; }
.cmp-stanza-h{ color:var(--navy); font-weight:700; font-size:14px; opacity:.75;
  margin:14px 0 6px; padding-bottom:3px; border-bottom:1px dashed rgba(26,56,115,.25); }
.cmp-stanza-h:first-child{ margin-top:0; }
.cmp-line{ background:#fbfaf5; border:1px solid rgba(26,56,115,.16); border-radius:8px;
  padding:9px 13px; margin-bottom:7px; font-size:17px; line-height:1.7;
  display:flex; justify-content:space-between; align-items:center; gap:8px; }
.cmp-line u{ text-decoration-color:var(--accent); text-decoration-thickness:2px; }
.cmp-frame{ color:var(--accent); font-weight:700; }
.cmp-refrain{ color:#4a6b30; font-weight:600; }
.cmp-reroll{ flex:0 0 auto; border:0; background:#fff3cd; border-radius:6px; cursor:pointer;
  padding:3px 9px; font-size:14px; }
.cmp-copy{ display:block; margin:6px auto 0; }

/* ── "חיבורים פרטיים": AI free-text composer + saved-composition list (admin) ── */
.pc-list{ display:flex; flex-direction:column; gap:7px; margin-top:12px; }
.pc-item{ display:flex; justify-content:space-between; align-items:center; gap:8px;
  background:#fbfaf5; border:1px solid rgba(26,56,115,.16); border-radius:8px;
  padding:10px 13px; font:inherit; font-size:15.5px; color:var(--dark); cursor:pointer; text-align:right; }
.pc-item:hover{ border-color:var(--accent); }
.pc-item-date{ color:var(--muted); font-size:12.5px; flex:0 0 auto; }
.pc-draft{ white-space:pre-wrap; padding:10px 13px; margin:8px 0; }
.pc-lines{ margin:10px 0; }
.pc-line{ background:#fbfaf5; border:1px solid rgba(26,56,115,.16); border-radius:8px;
  padding:9px 13px; margin-bottom:7px; font-size:17px; line-height:1.7; display:flex; align-items:center; gap:8px; }
.pc-detail-actions{ display:flex; gap:8px; margin-top:6px; }

/* ── guided interactive tour ("סרטון הסבר") ── */
.tour{ position:fixed; inset:0; z-index:200; pointer-events:none; }
.tour.hidden{ display:none; }
.tour-ring{ position:fixed; border-radius:10px; opacity:0;
  box-shadow:0 0 0 3px var(--gold-bright,#e9c97a), 0 0 0 9999px rgba(10,18,40,.60);
  transition:left .4s cubic-bezier(.4,0,.2,1), top .4s cubic-bezier(.4,0,.2,1),
             width .4s cubic-bezier(.4,0,.2,1), height .4s cubic-bezier(.4,0,.2,1), opacity .3s; }
.tour-ring.on{ opacity:1; }
.tour-arrow{ position:fixed; font-size:30px; line-height:1; color:var(--gold-bright,#e9c97a);
  text-shadow:0 1px 3px rgba(0,0,0,.6); pointer-events:none; opacity:0; transition:all .35s ease;
  animation:tourArrow 1s ease-in-out infinite alternate; }
.tour-arrow.on{ opacity:1; }
@keyframes tourArrow{ from{ transform:translate(0,0); } to{ transform:translate(0,-7px); } }
.tour-caption{ position:fixed; left:50%; bottom:22px; transform:translateX(-50%); width:min(93%,540px);
  background:#fff; border-radius:14px; box-shadow:0 10px 34px rgba(0,0,0,.45); padding:14px 16px;
  pointer-events:auto; z-index:201; }
.tour-caption.top{ bottom:auto; top:22px; }
.tour-cap-text{ color:var(--dark); font-size:16.5px; line-height:1.65; margin-bottom:10px; min-height:1.6em; }
.tour-controls{ display:flex; align-items:center; gap:7px; justify-content:center; }
.tour-btn{ border:1px solid #cfd6e6; background:#fff; color:var(--navy); border-radius:8px;
  min-width:42px; padding:8px 10px; font:inherit; font-size:17px; cursor:pointer; }
.tour-btn:hover{ background:#eef2fb; }
.tour-btn.tour-end{ color:#bf3930; }
.tour-step{ color:var(--muted); font-size:13px; min-width:48px; text-align:center; }

/* hamburger menu */
.menu-btn{ flex:0 0 auto; width:38px; height:38px; border:0; background:transparent; color:#fff;
           font-size:24px; line-height:1; cursor:pointer; border-radius:6px; }
.menu-btn:hover{ background:rgba(255,255,255,.15); }
/* in admin mode this sits beside the hamburger — the session can rewrite the
   text, and that should never be a state one is in unawares */
.admin-badge{ flex:0 0 auto; border:0; border-radius:7px; padding:4px 9px; cursor:pointer;
  background:#f0c33c; color:#3a2d00; font-family:inherit; font-size:12.5px; font-weight:800;
  box-shadow:0 1px 4px rgba(0,0,0,.25); white-space:nowrap; }
.admin-badge:hover{ background:#ffd75e; }
.admin-badge.hidden{ display:none; }
.menu-overlay{ position:fixed; inset:0; background:rgba(0,0,0,.4); z-index:60; }
/* The drawer has grown past the height of a phone, and the app frame around it
   cannot scroll (body is overflow:hidden), so the last entries were simply cut
   off with no way to reach them. It scrolls on its own instead — bounded by the
   height the app itself measures (--app-h, the real viewport under the browser's
   own chrome), with the bottom inset kept clear of the home indicator. */
.menu-drawer{ position:fixed; top:0; right:0; width:min(330px,82%); z-index:61;
              height:100%; height:100dvh; height:var(--app-h, 100dvh);
              background:var(--cream); box-shadow:-4px 0 20px rgba(0,0,0,.25);
              display:flex; flex-direction:column; padding:0; direction:rtl;
              overflow-y:auto; -webkit-overflow-scrolling:touch;
              overscroll-behavior:contain;   /* the page behind must not scroll with it */
              padding-bottom:env(safe-area-inset-bottom, 0px);
              animation:drawerIn .18s ease-out; }
@keyframes drawerIn{ from{ transform:translateX(100%); } to{ transform:translateX(0); } }
/* every entry keeps its full height in the scroll, rather than being squeezed */
.menu-drawer > *{ flex:0 0 auto; }
/* the title stays in view while the entries run under it */
.menu-head{ position:sticky; top:0; z-index:1;
            background:var(--navy); color:#fff; font-size:20px; font-weight:700; text-align:center; padding:16px; }
.menu-item{ display:flex; align-items:center; gap:12px; width:100%; text-align:right; padding:16px 18px; border:0;
            border-bottom:1px solid rgba(26,56,115,.12); background:transparent; color:var(--dark);
            font-family:inherit; font-size:17px; cursor:pointer; }
.menu-item .mi-ico{ width:19px; height:19px; flex:0 0 auto; color:var(--navy); opacity:.85; }
.menu-item .mi-label{ flex:1 1 auto; text-align:right; }
.menu-item.menu-sub-item .mi-ico{ width:17px; height:17px; opacity:.7; }
.menu-item:hover{ background:#e7ecfb; }
.menu-item:disabled{ opacity:.4; cursor:default; pointer-events:none; }
.menu-sep{ height:1px; background:rgba(26,56,115,.28); margin:8px 14px; }
.menu-item.admin-item{ color:var(--accent); font-weight:700; }
.menu-item.admin-item .mi-ico{ color:var(--accent); }
.edit-pencil{ flex:0 0 auto; align-self:flex-start; width:28px; height:28px; border:0;
              border-radius:50%; background:#f0c33c; color:#3a2d00; font-size:15px; cursor:pointer;
              box-shadow:0 1px 4px rgba(0,0,0,.3); line-height:1; }
.edit-pencil:hover{ background:#ffd84d; }
#editArea{ width:100%; box-sizing:border-box; font-family:inherit; font-size:18px; line-height:1.6;
           direction:rtl; text-align:right; border:1px solid var(--line); border-radius:8px; padding:8px; }
.admin-bar{ display:flex; flex-wrap:wrap; gap:6px; align-items:center; padding:6px; margin-bottom:6px;
            background:#fff4e0; border:1px solid rgba(122,53,80,.35); border-radius:8px; }
.admin-btn{ border:0; border-radius:6px; background:var(--accent); color:#fff; padding:8px 12px;
            font-family:inherit; font-size:14px; font-weight:700; cursor:pointer; }
.admin-btn.cancel{ background:#777; }
.admin-hint{ flex:1 1 100%; color:var(--navy); font-weight:700; font-size:14px; }

/* admin analytics dashboard — one card per visitor session */
.an-list{ display:flex; flex-direction:column; gap:8px; }
.an-row{ border:1px solid var(--line); border-radius:8px; padding:8px 10px; background:#fafafa; }
/* a further visit from the SAME address: drawn as a continuation of the one
   above it — tucked in, tied by a rule, and told which visit it is */
.an-row.an-same{ margin-inline-start:14px; border-top-color:transparent;
  border-start-start-radius:0; border-start-end-radius:0; background:#f4f6fa;
  border-inline-start:3px solid #b9c6dc; }
.an-again{ margin-inline-start:auto; font-size:11.5px; color:#4a5d78;
  background:#eef2f9; border:1px solid #b9c6dc; border-radius:999px; padding:0 7px; }
.an-top{ display:flex; justify-content:space-between; align-items:baseline; gap:8px; }
.an-top b{ color:var(--navy); font-size:15px; }
.an-ip{ color:var(--muted); font-size:12.5px; direction:ltr; }
.an-meta{ color:#555; font-size:12.5px; margin-top:2px; }
.an-pages{ color:#333; font-size:13px; margin-top:4px; line-height:1.5; }

/* floating bookmark button + tooltip */
/* end-of-portion marker (Samaritan division): three centered medium asterisks */
.portion-end{ text-align:center; font-size:20px; letter-spacing:10px; color:var(--navy);
              padding:14px 0 8px; line-height:1; }
.canon-note{ margin:16px auto 8px; max-width:560px; text-align:center; border-top:1px solid var(--border,#ccc);
             padding-top:12px; }
.canon-note-count{ font-weight:600; color:var(--navy); font-size:15px; margin-bottom:4px; }
.canon-note-text{ font-size:12px; color:var(--muted,#777); line-height:1.5; }
/* engraving the count from the end of the portion itself */
.canon-set-btn{ margin-top:8px; }
.canon-note-text.canon-drift{ color:#8a3030; font-weight:700; margin-top:4px; }
/* admin-only: how many times the Android file has been taken */
.pwa-tally{ margin:6px 0 0; font-size:13px; color:#3a2d00; background:#fdf3d0;
  border:1px solid #e2c96a; border-radius:7px; padding:5px 9px; text-align:center; }
.pwa-tally b{ font-size:15px; } .pwa-tally span{ color:#7a6a3a; }
/* the warning that a split/merge takes the count off canon — it asks, it does not refuse */
.modal-box.canon-ask .modal-title{ color:#8a3030; }
.canon-tbl{ width:100%; border-collapse:collapse; font-size:14px; margin:2px 0 6px; }
.canon-tbl th{ background:#f7ece9; color:#8a3030; font-weight:700; padding:3px 6px; }
.canon-tbl td{ padding:3px 6px; text-align:center; border-top:1px solid rgba(138,48,48,.15); }
.canon-tbl td:first-child{ text-align:right; color:var(--navy); }
.canon-tbl td.after{ font-weight:800; color:#8a3030; }
.canon-tbl td.closer{ color:#2f6d3a; font-size:12.5px; }
.canon-tbl td.farther{ color:#8a3030; font-size:12.5px; font-weight:700; }
.modal-box.canon-ask input{ width:100%; padding:9px 10px; border:2px solid #8a3030; border-radius:8px;
  font-family:inherit; font-size:16px; text-align:center; }
/* the three chapter signs (bookmark · printer · pronunciation) — pinned as ONE tight
   row to the left corner of the breadcrumb row. A flex row keeps them shoulder to
   shoulder whatever width each glyph happens to take on the device's emoji font,
   which per-button `left` offsets could not. */
.bm-navs{ position:absolute; left:4px; top:50%; transform:translateY(-50%);
          display:flex; align-items:center; gap:1px; z-index:5; }
.bm-nav{ position:relative; border:0; background:transparent;
         padding:0 2px; font-size:24px; line-height:1; cursor:pointer; }
.bm-nav.hidden{ display:none; }
.bm-nav:hover::after{ content:attr(title); position:absolute; top:34px; left:0; white-space:nowrap;
         background:var(--navy); color:#fff; font-size:13px; padding:5px 9px; border-radius:6px;
         box-shadow:0 1px 5px rgba(0,0,0,.3); z-index:50; }
/* read-aloud play button, just to the right of the bookmark */
.play-nav{ left:42px; color:var(--accent); padding:0 4px; }
.play-nav svg{ width:23px; height:23px; vertical-align:middle; }
.play-nav.playing{ color:#c0392b; }
.play-nav:disabled{ opacity:.35; cursor:default; }   /* dimmed / not yet active */
/* read-aloud mini player above the navbar */
#audioBar{ flex:0 0 auto; display:flex; align-items:center; gap:8px; padding:5px 10px;
           background:var(--cream); border-top:1px solid rgba(26,56,115,.22); }
#audioBar.hidden{ display:none; }
.au-btn{ flex:0 0 auto; border:0; background:transparent; color:var(--navy); cursor:pointer; padding:3px; line-height:0; }
.au-btn svg{ width:24px; height:24px; }
.au-seek{ flex:1 1 auto; accent-color:var(--accent); height:22px; }
.au-pos{ flex:0 0 auto; font-size:13px; color:var(--navy); min-width:46px; text-align:center; }
.tts-reading{ background:rgba(23,169,196,.16); border-radius:6px; }
/* bookmarks list */
#bmList{ max-height:55vh; overflow-y:auto; }
.bm-row{ display:flex; align-items:flex-start; gap:8px; padding:8px 4px;
         border-bottom:1px solid rgba(26,56,115,.12); }
.bm-row input[type=checkbox]{ margin-top:6px; width:18px; height:18px; flex:0 0 auto; }
.bm-main{ flex:1 1 auto; min-width:0; }
.bm-path{ color:var(--navy); font-weight:700; font-size:15.5px; cursor:pointer; text-align:right; }
.bm-path:hover{ text-decoration:underline; }
.bm-div{ font-size:12px; color:var(--accent); }
.bm-note{ width:100%; box-sizing:border-box; margin-top:4px; font-family:inherit; font-size:14px;
          border:1px solid var(--line); border-radius:6px; padding:5px; direction:rtl; text-align:right; }

/* contact form */
.form-row{ display:flex; flex-direction:column; gap:4px; text-align:right; margin-bottom:4px; }
.form-row label{ color:var(--navy); font-size:15px; font-weight:700; }
.form-row input, .form-row textarea{ padding:9px; border:1px solid var(--line); border-radius:6px;
            font-family:inherit; font-size:16px; resize:vertical; }
.form-count{ text-align:left; color:var(--muted); font-size:13px; }
.form-err{ color:#bf3930; font-size:14px; min-height:18px; text-align:right; }
.form-btns{ display:flex; gap:8px; }
.form-send{ flex:1; padding:14px; border:0; border-radius:8px; background:var(--share); color:#fff;
            font-family:inherit; font-size:17px; cursor:pointer; }
#infoBody .whatsnew{ white-space:pre-wrap; font-family:inherit; font-size:15px; line-height:1.7;
                     color:var(--dark); text-align:right; margin:0; }
/* the changelog is hand-wrapped at ~55 characters; on a phone 15px breaks nearly
   every one of those lines a second time, so it steps down to keep them whole */
@media (max-width:430px){ #infoBody .whatsnew{ font-size:12.5px; line-height:1.6; } }
/* the system documentation is far longer than a changelog: smaller type, and the
   section rules may not wrap, so it scrolls sideways inside its own box. It is
   hand-wrapped at ~60 characters, so a phone drops another step to keep a source
   line on one screen line instead of breaking every one of them in the middle. */
#infoBody .whatsnew.sysdoc{ font-size:13.5px; line-height:1.65; overflow-x:auto; }
@media (max-width:430px){ #infoBody .whatsnew.sysdoc{ font-size:11px; line-height:1.6; } }
#infoBody .ver-num{ text-align:center; font-size:30px; font-weight:700; color:var(--navy); padding:14px; }

/* ── responsive: narrow phones — bigger, comfortable touch targets ─────────── */
@media (max-width:430px){
  #toolbar{ padding:3px; }
  .tb-row{ gap:2px; }
  .tb{ font-size:12.5px; padding:11px 2px; }
  .tb.green{ min-width:46px; }
  /* on a phone the row is tightened, but the shapes stay the shapes: discs stay
     round, the pill stays a pill, and only their measures come down */
  .nav-arrow{ width:48px; height:48px; }
  .nav-arrow.nav-haslabel{ width:auto; height:48px; padding:0 12px; max-width:40%; }
  .nav-arrow .nav-chevron{ width:22px; height:22px; }
  .nav-lab-cap{ font-size:10px; }
  .nav-lab-name{ font-size:13.5px; }
  #navbar{ gap:2px; padding:4px; }
  .nav-pill{ gap:2px; padding:0; }
  .round{ width:42px; height:42px; font-size:24px; padding:0; }
  .round .zoomi{ width:20px; height:20px; }
  .nav-back .tbi{ width:20px; height:20px; }
  .divbtn{ font-size:14px; padding:10px; }
  .title-row h1{ font-size:18px; }
  .ver{ font-size:10px; }
  .listbtn{ font-size:21px; padding:15px 12px; }
  .cell{ font-size:19px; padding:16px 0; }
}
@media (max-width:340px){
  .tb{ font-size:11px; padding:10px 1px; }
}

.hidden{ display:none !important; }

/* ───────── entry splash ("אבני שהם") — overlay shown on app launch ───────── */
#samaritan-splash{
  --ink-night:#0a1733; --ink-abyss:#04081a; --lapis:#173a72;
  --gold:#c8a456; --gold-bright:#eccd84; --parchment:#efe6cc;
  position:fixed; inset:0; z-index:99999; display:grid; place-items:center;
  overflow:hidden;
  background:radial-gradient(120% 80% at 50% 32%, var(--lapis) 0%, var(--ink-night) 46%, var(--ink-abyss) 100%);
  font-family:'Heebo',system-ui,sans-serif; color:var(--parchment);
  opacity:1; transition:opacity 1.1s ease;
}
#samaritan-splash.is-done{ opacity:0; pointer-events:none; }
#samaritan-splash .pages{
  position:absolute; inset:-6% -4%; display:flex; gap:2.6vw; justify-content:center;
  pointer-events:none; opacity:0; animation:sp-pages-in 2.4s ease 0.1s forwards;
}
#samaritan-splash .pages .col{
  writing-mode:vertical-rl; font-family:'Samaritan',serif; font-size:2.0vw;
  line-height:1.7; letter-spacing:.18em; color:var(--gold); opacity:.06;
  white-space:nowrap; filter:blur(.4px); user-select:none;
}
@keyframes sp-pages-in{ to{ opacity:1; } }
#samaritan-splash::after{
  content:""; position:absolute; inset:0; pointer-events:none;
  background:radial-gradient(130% 95% at 50% 38%, transparent 52%, rgba(4,8,26,.78) 100%);
}
#samaritan-splash .core{ position:relative; z-index:2; width:min(92vw,760px); text-align:center; padding:6vh 0; }
#samaritan-splash .imprint{
  font-family:'Frank Ruhl Libre',serif; font-weight:500; font-size:clamp(15px,2.4vw,20px);
  letter-spacing:.62em; padding-inline-start:.62em; color:var(--gold);
  opacity:0; transform:translateY(10px); animation:sp-rise .9s ease .35s forwards;
}
#samaritan-splash .imprint::before, #samaritan-splash .imprint::after{
  content:""; display:inline-block; vertical-align:middle;
  width:clamp(26px,7vw,64px); height:1px; margin:0 .9em;
  background:linear-gradient(90deg,transparent,var(--gold)); opacity:.7;
}
#samaritan-splash .imprint::after{ transform:scaleX(-1); }
#samaritan-splash .app-name{
  font-family:'Frank Ruhl Libre',serif; font-weight:700; font-size:clamp(34px,7.4vw,82px);
  line-height:1.05; margin:.18em 0 .12em; color:var(--parchment);
  text-shadow:0 2px 30px rgba(0,0,0,.45);
  opacity:0; transform:translateY(16px) scale(.985);
  animation:sp-rise 1s cubic-bezier(.2,.7,.2,1) .6s forwards;
}
#samaritan-splash .version{
  font-family:'Heebo',sans-serif; font-weight:300; font-size:clamp(13px,2.2vw,17px);
  letter-spacing:.34em; padding-inline-start:.34em; color:var(--gold);
  opacity:0; transform:translateY(10px); animation:sp-rise .9s ease .9s forwards;
}
@keyframes sp-rise{ to{ opacity:1; transform:none; } }
#samaritan-splash .stage{
  position:relative; margin-top:clamp(34px,6vh,64px); padding:clamp(22px,4vh,40px) 0;
  opacity:0; animation:sp-rise 1s ease 1.05s forwards;
}
#samaritan-splash .stage::before, #samaritan-splash .stage::after{
  content:""; position:absolute; left:8%; right:8%; height:1px;
  background:linear-gradient(90deg,transparent,var(--gold) 18%,var(--gold) 82%,transparent); opacity:.42;
}
#samaritan-splash .stage::before{ top:0; }
#samaritan-splash .stage::after{ bottom:0; }
#samaritan-splash .verse{
  direction:rtl; font-family:'Samaritan',serif; color:var(--gold-bright);
  line-height:1.85; letter-spacing:.01em; text-shadow:0 0 0 transparent; transition:text-shadow 1.1s ease;
}
#samaritan-splash .verse.lit{ text-shadow:0 0 22px rgba(236,205,132,.45), 0 0 4px rgba(236,205,132,.5); }
/* the verse starts fully hidden and is revealed only as the quill writes it */
#samaritan-splash .verse-line{ display:block; font-size:clamp(22px,5.6vw,54px);
  white-space:nowrap; clip-path:inset(0 0 0 100%); max-width:100%; }
/* Samaritan word-separator dot, centred in the gap between words */
#samaritan-splash .verse .wsep{ font-style:normal; font-family:'Heebo',sans-serif;
  margin:0 .07em; font-size:.62em; font-weight:700; vertical-align:.2em;
  color:var(--gold-bright); opacity:1; }
#samaritan-splash .pen{
  position:absolute; left:0; top:0; width:clamp(132px,23vw,196px); height:auto; opacity:0;
  pointer-events:none; will-change:transform; filter:drop-shadow(0 10px 16px rgba(0,0,0,.55));
}
#samaritan-splash .skip{
  position:absolute; top:max(18px,2.4vh); inset-inline-end:max(20px,3vw); z-index:3;
  background:none; border:none; cursor:pointer; font-family:'Heebo',sans-serif; font-weight:300;
  font-size:14px; letter-spacing:.12em; color:var(--gold); opacity:0; padding:8px 10px;
  transition:color .2s ease, opacity .4s ease; animation:sp-rise .8s ease 2.4s forwards;
}
#samaritan-splash .skip:hover{ color:var(--gold-bright); }
#samaritan-splash .skip:focus-visible{ outline:1px solid var(--gold); outline-offset:4px; border-radius:4px; }
/* "always skip" pill — centred on the page, on the line just above the copyright
   (installed app only) */
#samaritan-splash .skip-always{
  position:absolute; bottom:max(120px,17vh); left:0; right:0; margin-inline:auto; width:max-content; z-index:3;
  background:rgba(200,164,86,.12); border:1px solid var(--gold); border-radius:20px; cursor:pointer;
  font-family:'Heebo',sans-serif; font-weight:300; font-size:13px; letter-spacing:.06em;
  color:var(--gold-bright); padding:7px 16px;
  opacity:0; transform:translateY(10px); animation:sp-rise .8s ease 2.6s forwards;
  white-space:nowrap;
}
@media (max-width:560px){ #samaritan-splash .skip-always{ bottom:max(132px,19vh); } }
#samaritan-splash .skip-always:hover{ background:rgba(200,164,86,.22); }
#samaritan-splash .skip-always.hidden{ display:none; }
/* enable-sound button (top corner opposite the skip control) */
#samaritan-splash .sp-sound{
  position:absolute; top:max(18px,2.4vh); inset-inline-start:max(20px,3vw); z-index:3;
  width:38px; height:38px; border-radius:50%; cursor:pointer; line-height:1; font-size:17px;
  background:rgba(200,164,86,.12); border:1px solid var(--gold); color:var(--gold-bright);
  opacity:0; animation:sp-rise .8s ease 1.6s forwards;
}
#samaritan-splash .sp-sound:hover{ background:rgba(200,164,86,.22); }
#samaritan-splash .sp-sound.on{ background:rgba(200,164,86,.32); border-color:var(--gold-bright); }
#samaritan-splash .copyright{
  position:absolute; left:0; right:0; bottom:max(16px,2.4vh); z-index:3;
  display:flex; justify-content:space-between; align-items:center; gap:16px;
  padding-inline:clamp(18px,4vw,46px); font-family:'Heebo',sans-serif; font-weight:300;
  font-size:11px; letter-spacing:.05em; color:var(--gold); opacity:0; animation:sp-rise .9s ease 2.7s forwards;
}
#samaritan-splash .copyright .he{ direction:rtl; opacity:.85; }
#samaritan-splash .copyright .en{ direction:ltr; opacity:.75; }
@media (max-width:560px){
  #samaritan-splash .copyright{ flex-direction:column; gap:4px; justify-content:center; text-align:center; }
}
@media (prefers-reduced-motion:reduce){
  #samaritan-splash *{ animation-duration:.01ms!important; animation-delay:0ms!important; transition-duration:.2s!important; }
}
/* transition layer — the dimmed etching the splash dissolves through before the
   app appears; it then fades slowly into the app */
#splash-image{
  position:fixed; inset:0; z-index:99998; background:#f1ead7;
  opacity:1; transition:opacity 1.2s ease;
}
#splash-image .pic{   /* dimmed + washed-out (faded) colours */
  position:absolute; inset:0;
  background:url('/static/img/splash_elder.jpg') center/cover no-repeat;
  opacity:.4; filter:saturate(.4) sepia(.22) brightness(1.12) contrast(.85);
}
/* the source etching is portrait (≈5:6) with a wide cream mat around it — on any
   landscape viewport (virtually all desktops/tablets) "cover" scales it to fill
   the width and crops the top/bottom, cutting into the figure. "contain" shows
   the whole etching instead; its mat colour matches #splash-image's own
   background so the letterboxing reads as an intentional frame, not empty space. */
@media (min-aspect-ratio:1/1){
  #splash-image .pic{ background-size:contain; }
}
#splash-image::after{   /* soft vignette to settle it into the page */
  content:""; position:absolute; inset:0;
  background:radial-gradient(120% 100% at 50% 42%, transparent 55%, rgba(120,104,70,.22) 100%);
}
#splash-image.is-gone{ opacity:0; pointer-events:none; }

/* small biblical-anchor footnote at the foot of a source card (שו"ת / eyalk) */
.srcpanel .card .canchors{ margin-top:8px; padding-top:6px; border-top:1px dashed rgba(26,56,115,.3);
  font-size:12.5px; line-height:1.6; color:var(--muted); }

/* ── chanted-reading recordings bar (הקלטות קריאה) ─────────────────────── */
/* kept deliberately compact — every pixel here is a pixel of Torah text below it */
.reading-bar{ display:flex; flex-direction:column; align-items:stretch; gap:3px; direction:rtl;
  background:linear-gradient(180deg,#fdfbf5,#f4efe2); border:1px solid #d9cfb6;
  border-radius:10px; padding:4px 9px 5px; margin:3px 0 7px;
  box-shadow:0 1px 4px rgba(0,0,0,.07); }
.reading-head{ display:flex; align-items:center; gap:7px; direction:rtl; min-width:0; }
.reading-row{ display:flex; align-items:center; gap:7px; direction:rtl; min-width:0; }
.reading-btn{ flex:0 0 auto; width:32px; height:32px; border-radius:50%;
  border:none; background:var(--accent); color:#fff; font-size:12px;
  cursor:pointer; display:flex; align-items:center; justify-content:center; }
.reading-btn:hover{ background:var(--active); }
.reading-info{ flex:1; min-width:0; display:flex; flex-direction:column; gap:4px; }
.reading-title{ flex:1 1 auto; font-size:12.5px; font-weight:600; color:var(--navy);
  white-space:normal; overflow:visible; line-height:1.25; min-width:0; }
/* continuous-reading flag (הקראה רציפה): keeps playing into the next chapter */
.reading-cont{ flex:0 0 auto; border:1px solid var(--line); border-radius:999px;
  background:#fff; color:var(--muted); font:inherit; font-size:11px; font-weight:700;
  padding:2px 9px; cursor:pointer; white-space:nowrap; line-height:1.45; }
.reading-cont:hover{ border-color:var(--accent); color:var(--accent); }
.reading-cont.on{ background:var(--accent); border-color:var(--accent); color:#fff; }
/* repeat (השמעה חוזרת): off · this reading (play + "1" in the loop) · the parasha.
   The button itself stays transparent — the loop is the frame and the play stands
   inside it; --rd-rep-bg is what the "1" is knocked out of, i.e. whatever shows
   through behind the play. */
.reading-repeat{ flex:0 0 auto; display:inline-flex; align-items:center; justify-content:center;
  --rd-rep-bg:#fbf8ef;
  width:23px; height:23px; padding:0; border:0; border-radius:50%;
  background:transparent; color:var(--muted); cursor:pointer; }
.reading-repeat svg{ width:22px; height:22px; }   /* borderless: the glyph fills the box */
.reading-repeat:hover{ color:var(--accent); }
.reading-repeat.on{ color:var(--accent); }
.reading-seek{ flex:1; min-width:52px; width:auto; height:16px; direction:ltr;
  accent-color:var(--accent); margin:0; }
.reading-time{ flex:0 0 auto; font-size:11.5px; color:var(--muted); direction:ltr; }
.reading-speed{ flex:0 0 auto; border:1px solid var(--line); border-radius:6px;
  background:#fff; color:var(--navy); font:inherit; font-size:12px; font-weight:700;
  padding:2px 7px; cursor:pointer; direction:ltr; }
.reading-speed:hover{ border-color:var(--accent); color:var(--accent); }
.reading-witness{ flex:0 0 auto; width:82px; max-width:82px; border:1px solid var(--line);
  border-radius:6px; background:#fff; color:var(--navy); font:inherit;
  font-size:12px; padding:2px 4px; cursor:pointer;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cell-audio{ display:block; font-size:12px; color:var(--accent); line-height:1; margin-top:2px; }

/* today's date by the Samaritan reckoning, under the title — small, gold, and
   always in Hebrew whatever the interface language */
/* one centred line, never two: when it is too long for the width it is given, the
   type is stepped down (in JS) until it fits rather than wrapping or being cut. */
.sam-date{ text-align:center; padding:0 10px 3px; line-height:1.35; overflow:hidden;
  transition:max-height .25s ease, opacity .2s ease, padding .25s ease; max-height:24px; }
.sam-date.empty{ display:none; }
.sam-date #samDateRun{ display:inline-block; white-space:nowrap;
  color:#f0c33c; font-size:11px; font-weight:600; letter-spacing:.2px; }
/* the top bar folds upward over the date as well, for the sake of the text */
body.div-collapsed .sam-date{ max-height:0 !important; opacity:0 !important;
  padding-top:0 !important; padding-bottom:0 !important; }
.sam-date:empty{ display:none; }
/* the portion read this coming Sabbath, in the book and portion lists */
.week-mark{ margin-inline-start:auto; color:#8a6a12; background:#fdf3d0; border:1px solid #e2c96a;
  direction:rtl;
  border-radius:6px; padding:1px 7px; font-size:12px; font-weight:800; white-space:nowrap; }
.listbtn.is-week{ border-color:#e2c96a; box-shadow:inset 0 0 0 1px #f0c33c33; }
/* the SECOND portion of a Sabbath that reads two together carries the same badge,
   in the same colour, behind a "+": it is read this week as much as the first is,
   and the "+" is what says it is the one that comes after */

/* the badge and, beside it, the way into פירוש הפרשה. In the two-script lists
   the pair takes a line of its own, as the badge alone used to. */
.week-row{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-inline-start:auto;
  min-width:0; }
.week-row .week-mark{ margin-inline-start:0; white-space:normal; }
.listbtn.twoscripts .week-row{ flex-basis:100%; }
.listbtn.twoscripts .week-row .week-mark{ flex:0 1 auto; }
.week-interp-btn{ display:inline-flex; align-items:center; background:var(--navy); color:#fff;
  border-radius:999px; padding:3px 12px; font-size:12.5px; font-weight:700; line-height:1.5;
  white-space:nowrap; cursor:pointer; direction:rtl; }
.week-interp-btn:hover{ background:var(--accent); }
.week-interp-btn:focus-visible{ outline:2px solid var(--active); outline-offset:2px; }
.week-banner .week-interp-btn{ margin-inline-start:8px; vertical-align:middle; }
/* and while reading inside it, above the play bar */
.week-banner{ margin:0 0 6px; text-align:center; color:#8a6a12; background:#fdf3d0;
  border:1px solid #e2c96a; border-radius:8px; padding:4px 10px; font-size:13.5px; font-weight:700; }

/* ── the hourglass shown while the app waits on data ────────────────────────
   Centred over everything, and deliberately not a spinner: an hourglass that
   actually drains says "this is taking a moment" the way a spinner cannot. It
   is raised only after 220ms of waiting (see busyStart), so a fast answer never
   makes the screen flash. */
.hourglass{ position:fixed; inset:0; z-index:9200; display:none;
  align-items:center; justify-content:center; pointer-events:none; }
.hourglass.on{ display:flex; animation:hgIn .18s ease-out both; }
@keyframes hgIn{ from{ opacity:0; } to{ opacity:1; } }
.hourglass svg{ filter:drop-shadow(0 6px 18px rgba(0,0,0,.45)); }
.hg-frame{ fill:none; stroke:#f0c33c; stroke-width:2.4; stroke-linecap:round; stroke-linejoin:round; }
.hg-sand rect{ fill:#f0c33c; }
/* the top bulb empties, the bottom fills, and the whole glass turns over between
   runs — one 2.4s cycle, in step */
.hg-top{ transform-box:fill-box; transform-origin:bottom; animation:hgTop 2.4s linear infinite; }
.hg-bot{ transform-box:fill-box; transform-origin:bottom; animation:hgBot 2.4s linear infinite; }
.hg-drip{ animation:hgDrip 2.4s linear infinite; }
.hourglass svg{ animation:hgFlip 2.4s ease-in-out infinite; }
@keyframes hgTop{ 0%{ transform:scaleY(1); } 88%,100%{ transform:scaleY(0); } }
@keyframes hgBot{ 0%{ transform:scaleY(0); } 88%,100%{ transform:scaleY(1); } }
@keyframes hgDrip{ 0%,88%{ opacity:.9; } 92%,100%{ opacity:0; } }
@keyframes hgFlip{ 0%,86%{ transform:rotate(0deg); } 100%{ transform:rotate(180deg); } }
@media (prefers-reduced-motion:reduce){
  .hg-top,.hg-bot,.hg-drip,.hourglass svg{ animation:none; }
  .hg-top{ transform:scaleY(.45); } .hg-bot{ transform:scaleY(.55); }
}

/* ── the weekly social post, in the admin panel ───────────────────────────── */
.soc-week{ font-size:15px; margin:8px 0 6px; color:var(--navy); }
.soc-preview{ display:flex; gap:10px; align-items:flex-start; margin-bottom:8px; }
.soc-preview img{ width:120px; border-radius:8px; border:1px solid var(--line); }
.soc-text{ flex:1 1 0; min-width:0; white-space:pre-wrap; font-family:inherit; font-size:13px;
           background:#fafafa; border:1px solid var(--line); border-radius:8px; padding:8px;
           max-height:220px; overflow:auto; margin:0; }
.soc-btns{ display:flex; gap:6px; margin-bottom:10px; }
.soc-acc{ border:1px solid var(--line); border-radius:8px; padding:8px; margin-bottom:7px; background:#fff; }
.soc-acc-top{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.soc-state{ font-size:12px; color:#8a6a12; background:#fdf3d0; border:1px solid #e2c96a;
            border-radius:999px; padding:0 8px; }
.soc-state.on{ color:#2f4a33; background:#e9f3ea; border-color:#8fbf98; }
.soc-arm{ margin-inline-start:auto; font-size:13px; display:flex; align-items:center; gap:5px; }
.soc-note{ font-size:12px; color:var(--muted); margin:4px 0 6px; }
/* ── פיוטי השומרונים בתעתיק הגייה (בן-חיים) ─────────────────────────────────
   The reader prints the three columns the book itself prints; each can be
   switched off from the header, so one can read the Aramaic alone, or set the
   transcription against it. Layout mirrors the piyyutim unit's tree/detail. */
.dara-body{ display:flex; gap:12px; height:calc(100% - 108px); overflow:hidden; }
.dara-tree{ flex:0 0 280px; overflow:auto; padding:6px 4px; border-inline-start:1px solid var(--line,#d8cfc0); }
.dara-main{ flex:1; overflow:auto; padding:6px 12px; }
.dara-head h3{ margin:.2em 0 .3em; }
.dara-use{ font-size:.95em; opacity:.85; }
.dara-src{ font-size:.9em; opacity:.7; margin-top:2px; }
.dara-pages{ font-size:.85em; opacity:.55; margin:2px 0 10px; }
.dara-tbl{ width:100%; border-collapse:collapse; }
.dara-tbl td{ vertical-align:top; padding:3px 8px; border-bottom:1px dotted rgba(0,0,0,.08); }
.dara-n{ width:2.6em; text-align:start; opacity:.45; font-size:.85em; white-space:nowrap; }
.dara-a{ font-size:1.12em; line-height:1.9; direction:rtl; }
.dara-h{ direction:rtl; opacity:.9; }
.dara-t{ direction:ltr; text-align:left; font-family:"Times New Roman",serif; opacity:.85; white-space:nowrap; }
.dara-main.no-a .dara-a, .dara-main.no-h .dara-h, .dara-main.no-t .dara-t{ display:none; }
.dara-cols{ display:flex; gap:4px; margin-inline-start:auto; }
.dara-col{ font-size:.8em; padding:2px 8px; border-radius:10px; border:1px solid var(--line,#c9bda8);
           background:transparent; cursor:pointer; opacity:.5; }
.dara-col.on{ opacity:1; background:rgba(120,90,50,.12); }
.dara-vars{ margin:14px 0 30px; font-size:.9em; }
.dara-vars summary{ cursor:pointer; opacity:.75; }
.dara-var{ padding:2px 0; direction:rtl; }
.dara-pron{ font-family:"Times New Roman",serif; direction:ltr; unicode-bidi:isolate; opacity:.8; }
.dara-pop-more{ margin-top:6px; font-size:.85em; opacity:.8; max-height:150px; overflow:auto; }
.dara-pop-freq{ opacity:.6; margin-bottom:3px; }
.dara-pop-ref{ padding:1px 0; direction:rtl; }
@media (max-width:760px){
  .dara-tree{ flex:0 0 100%; }
  .dara-main{ display:none; }
  .dara-body.piy-detail-open .dara-tree{ display:none; }
  .dara-body.piy-detail-open .dara-main{ display:block; }
  .dara-t{ white-space:normal; }
}

.soc-f{ width:100%; box-sizing:border-box; font-family:inherit; font-size:13px; padding:5px 7px;
        border:1px solid var(--line); border-radius:6px; margin-bottom:5px; }
.soc-hist{ font-size:12.5px; color:var(--muted); margin-top:8px; }

/* ── ניקוד הספר המודפס ────────────────────────────────────────────────────────
   The marks are drawn in the Samaritan face itself, as mark keys written after
   each letter. The range is held to letters and keys so the stops and the word
   divider keep falling to the reader's own font — in this face the colon has no
   advance width and would land on the letter beside it. */
@font-face{
  font-family:'SamNikud';
  src:url('fonts/Sam_font_Nikud.ttf') format('truetype');
  font-display:swap;
  unicode-range:U+05D0-05EA, U+0030-0039, U+0041-005A, U+E000-E3FF;
}
.samchar.nik{ font-family:'SamNikud','Samaritan',serif; }
.vtext.nik{ line-height:2.2; }        /* the marks sit above the letters */
.bm-nav.nik-nav{ font-size:.78em; letter-spacing:0; padding:0 .45em; width:auto; }

/* ── the navigation bar, a size down ─────────────────────────────────────────
   Arrows 48→42, the round buttons 42→37, and every mark inside them to match.
   It floats over the text it serves, so it should ask for as little of the page
   as it can and still be hit with a thumb — 37px is still above the 34 a finger
   needs. These come last in the file, over the several earlier rules that have
   been setting these same sizes. */
.nav-arrow{ width:42px; height:42px; }
.nav-arrow.nav-haslabel{ width:auto; height:42px; padding:0 11px; max-width:40%; }
.nav-arrow .nav-chevron{ width:19px; height:19px; }
.round{ width:37px; height:37px; }
.round .zoomi{ width:18px; height:18px; }
.nav-back .tbi{ width:18px; height:18px; }
#navbar{ gap:2px; padding:3px; }

/* The reading pane hands the browser the up-and-down and keeps the sideways for
   the app: without this the browser claims a horizontal drag as a scroll within
   a few pixels, cancels the pointer, and the swipe that turns the page is never
   seen. Vertical scrolling is untouched. */
#content{ touch-action:pan-y; }

/* ── the five applications behind one line ───────────────────────────────── */
/* A panel standing against the drawer, not a fold inside it: the drawer keeps
   its own length and the five applications arrive beside it. Which side is read
   off the drawer at open time (see app.js) — the app turns LTR for English, and
   a hard-coded side would be wrong the day the drawer follows. On a phone, where
   the drawer is 82% of the screen and nothing fits beside it, .over-drawer lays
   it over the drawer instead, with its own way back. */
.menu-sub{ position:fixed; z-index:62; background:var(--cream); direction:rtl;
  box-shadow:-4px 0 20px rgba(0,0,0,.22); overflow-y:auto; overscroll-behavior:contain;
  animation:subIn .16s ease-out; }
.menu-sub.over-drawer{ box-shadow:0 0 24px rgba(0,0,0,.3); }
@keyframes subIn{ from{ opacity:0; transform:translateX(10px); } to{ opacity:1; transform:none; } }
.menu-sub.hidden{ display:none; }
.menu-sub .menu-item{ font-size:.96em; }
.menu-sub-head{ display:flex; align-items:center; gap:10px; width:100%; position:sticky; top:0; z-index:1;
  padding:16px 18px; border:0; border-bottom:1px solid rgba(26,56,115,.12);
  background:var(--navy); color:#fff; font-family:inherit; font-size:17px;
  font-weight:700; text-align:start; cursor:pointer; }
.menu-sub-head .msb-arrow{ font-size:20px; opacity:.85; }
.menu-group .mi-chev{ margin-inline-start:auto; font-size:17px; opacity:.6;
  transition:transform .18s ease; }
.menu-group[aria-expanded="true"] .mi-chev{ transform:rotate(-90deg); }

/* ── the library as shelves ──────────────────────────────────────────────────
   Books stand with their spines out on a mahogany plank, their names written
   down the spine. The first touch draws one off the shelf and turns it to face
   the reader — the same cover as before, title across the front — and only the
   second opens it. Both faces live in the one button, back to back, and the
   turn is a rotation of the pair; nothing is rebuilt mid-animation, so the
   motion cannot stutter on a slow phone. */
#libGrid{ display:block; }
.shelf{ margin:0 0 26px; }
.shelf-name{ padding:0 4px 7px; font-size:14px; font-weight:700; color:#5b4636;
  letter-spacing:.02em; }
.shelf-books{ display:flex; flex-wrap:wrap; align-items:flex-end; gap:7px;
  min-height:132px; padding:0 10px; }
/* the plank: three browns and a lit top edge, so it reads as a board seen
   slightly from above rather than as a brown stripe */
.shelf-plank{ height:15px; border-radius:2px 2px 4px 4px;
  background:linear-gradient(#a46a43 0 2px, #7b4a2b 2px 7px, #5d3720 7px 100%);
  box-shadow:0 2px 0 rgba(60,32,16,.45), 0 7px 12px -4px rgba(60,32,16,.5); }

/* the sideways-and-down gesture on a book belongs to the book, not to the
   scrolling of the page behind it */
.lib-spine{ touch-action:none; position:relative; flex:0 0 auto; width:38px; height:124px; padding:0;
  border:0; background:none; font:inherit; cursor:pointer;
  transform-style:preserve-3d; transition:transform .34s cubic-bezier(.3,.8,.4,1);
  transform-origin:50% 100%; }
.lib-spine .spine-face, .lib-spine .cover-face{
  position:absolute; inset:0; display:flex; align-items:center; justify-content:center;
  backface-visibility:hidden; border-radius:2px 4px 4px 2px; overflow:hidden; }
.lib-spine .spine-face{
  background:linear-gradient(90deg, var(--bk-dark) 0 3px, var(--bk) 3px 86%, var(--bk-lite) 86% 100%);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.18), 0 2px 5px rgba(50,30,15,.4); }
/* the name runs down the spine, the way it is printed on a book */
.spine-title{ writing-mode:vertical-rl; text-orientation:mixed; transform:rotate(180deg);
  max-height:108px; overflow:hidden; font-size:12.5px; font-weight:600; line-height:1.1;
  color:#fff6e9; text-shadow:0 1px 2px rgba(0,0,0,.45); white-space:nowrap; }
.lib-spine:hover{ transform:translateY(-6px); }

/* drawn out: it comes forward, grows to a cover and turns its face over */
.lib-spine .cover-face{ transform:rotateY(180deg); --cover-w:116px;
  background:radial-gradient(116% 84% at 50% 32%, var(--ck-lite), var(--ck) 58%, var(--ck-dark));
  box-shadow:inset 0 0 0 1px rgba(232,205,142,.18), 0 10px 20px -6px rgba(50,30,15,.6); }
.lib-spine.pulled{ width:116px; height:150px; transform:translateY(-10px) rotateY(180deg); z-index:2; }
.lib-spine.pulled .spine-title{ opacity:0; }
.lib-spine.pulled + .lib-spine{ margin-inline-start:4px; }
.lib-spine .lib-book-title{ padding:0 9px; font-size:13.5px; font-weight:700; line-height:1.25;
  text-align:center; color:#fff6e9; text-shadow:0 1px 2px rgba(0,0,0,.45); }

@media (prefers-reduced-motion: reduce){
  .lib-spine{ transition:none; }
}
@media (max-width:420px){
  .lib-spine{ width:34px; height:112px; }
  .lib-spine.pulled{ width:104px; height:138px; }
  .lib-spine .cover-face{ --cover-w:104px; }
  .spine-title{ max-height:98px; font-size:11.5px; }
}

/* ── הגדרות נגישות ───────────────────────────────────────────────────────────
   The inversion is a filter over the app rather than a second palette. The
   app's colours are written in hundreds of places — the stylesheet, the units,
   markup built at run time — and a dark theme that had to find them all would
   always be missing some, on the one screen nobody thought to open. A filter
   misses none. hue-rotate puts the hues back the right way round after the
   invert, so the navy stays a navy and does not become mustard.

   What a filter gets wrong is pictures, which would come back as negatives, so
   every image is turned a second time and lands as itself. The parchment behind
   the text is a background-image rather than an <img>, so it is dimmed instead:
   inverted it would be a black field, which is what is wanted anyway. */
body.a11y-invert{ filter:invert(1) hue-rotate(180deg); background:#000; }
body.a11y-invert img,
body.a11y-invert video,
body.a11y-invert .no-invert{ filter:invert(1) hue-rotate(180deg); }
/* the written leaf behind the reading pane: left at full strength under an
   inversion it glares, so it is taken down to a whisper */
body.a11y-invert #content{ background-blend-mode:luminosity; }
body.a11y-invert #app{ background-color:#f2f2f2; }

/* A window of its own, on white, over the app: the panel was taking the app's
   own background and the inversion switch was lost in it. */
#a11yModal{ background:rgba(16,26,56,.5); }
.a11y-card{ max-width:460px; background:#fff; color:#141414;
  border-radius:14px; padding:18px 20px 16px; box-shadow:0 18px 40px rgba(0,0,0,.35); }
.a11y-card .modal-head{ margin:0 0 6px; font-size:19px; font-weight:700; color:#141414; }
.a11y-card .modal-foot{ display:flex; align-items:center; justify-content:space-between;
  gap:12px; margin-top:16px; }

.a11y-row{ padding:14px 2px; border-bottom:1px solid var(--line); }
.a11y-row:last-of-type{ border-bottom:0; }
.a11y-label{ display:block; font-size:16px; font-weight:700; color:var(--dark); }
.a11y-hint{ display:block; margin-top:3px; font-size:13px; color:var(--muted); line-height:1.5; }
.a11y-size{ display:flex; align-items:center; gap:10px; margin-top:10px; }
.a11y-size input[type=range]{ flex:1; }
.a11y-step{ flex:0 0 auto; width:40px; height:40px; border:1px solid var(--line);
  border-radius:9px; background:#fff; color:var(--dark); font-size:21px; cursor:pointer; }
.a11y-step:active{ background:#eceff7; }
.a11y-preview{ margin-top:12px; padding:10px 12px; border:1px solid var(--line);
  border-radius:9px; background:#fffdf8; line-height:1.7; }
.a11y-switch{ display:flex; align-items:center; justify-content:space-between; gap:14px;
  cursor:pointer; }
.a11y-switch input{ flex:0 0 auto; width:24px; height:24px; }
.a11y-plain{ border:0; background:none; color:var(--accent); font-family:inherit;
  font-size:15px; cursor:pointer; }
.a11y-done{ min-width:96px; padding:10px 18px; border:0; border-radius:9px;
  background:var(--navy); color:#fff; font-family:inherit; font-size:16px; cursor:pointer; }

/* ── the two hints on a book just drawn off the shelf ────────────────────────
   They say the two things the book cannot: that a second tap opens it, and that
   a pull downwards puts it back. Four seconds, then they fade and leave the
   cover to be read. They sit outside the book so they do not cover its title,
   and they take no pointer events so they can never swallow the tap they are
   describing. */
/* The pulled book is turned a half-turn on its Y axis to show its cover; a hint
   riding on it inherited that turn and came out as mirror writing. It is turned
   back, and since that is a transform of its own it carries the centring too. */
/* No lozenge behind it: the words stand on the shelf's own ground, in its own
   ink, and leave almost at once — they are a nudge, not a label. */
.lib-hint{ position:absolute; left:50%; transform:translateX(50%) rotateY(180deg);
  font-size:11.5px; line-height:1.3; font-weight:600; white-space:nowrap;
  color:#4a3524; pointer-events:none; opacity:1; transition:opacity .45s ease; }
.lib-hint-open{ top:-22px; }
.lib-hint-back{ bottom:-22px; }
.lib-hint.gone{ opacity:0; }
/* and the book shows the gesture rather than only naming it: it dips, as a
   finger pulling it down would take it, twice, and then holds still */
.lib-spine.pulled.demo{ animation:libDemo 1.5s ease-in-out 2; }
@keyframes libDemo{
  0%,100%{ transform:translateY(-10px) rotateY(180deg); }
  38%    { transform:translateY(16px)  rotateY(180deg); }
  60%    { transform:translateY(-10px) rotateY(180deg); } }
@media (prefers-reduced-motion: reduce){ .lib-spine.pulled.demo{ animation:none; } }
/* the arrow of the "put it back" hint, nodding downwards while it is up */
.lib-hint-back::after{ content:' ↓'; display:inline-block;
  animation:libNod 1.1s ease-in-out infinite; }
@keyframes libNod{ 0%,100%{ transform:translateY(-1px); } 50%{ transform:translateY(3px); } }
@media (prefers-reduced-motion: reduce){ .lib-hint-back::after{ animation:none; } }

/* ── הקודם · הבא at the foot of a chapter in every library unit ───────────── */
.rd-chnav{ display:flex; gap:10px; margin:26px 2px 8px; padding-top:14px;
  border-top:1px solid var(--line); }
.rd-chbtn{ flex:1 1 0; padding:12px 10px; border:1px solid var(--line); border-radius:10px;
  background:#fffdf8; color:var(--navy); font-family:inherit; font-size:15px;
  font-weight:600; cursor:pointer; }
.rd-chbtn:hover:not(:disabled){ background:#f3f0e6; }
.rd-chbtn:disabled{ opacity:.35; cursor:default; }

/* A Hebrew quotation inside Arabic commentary is set in the Samaritan face like
   any other quotation. The Arabic block names its own font on the container, so
   the quotation's span must name the Samaritan one at least as specifically, or
   it would inherit the Arabic and the whole point would be lost. */
.interp-panel .itext.iar .samchar2,
.interp-panel .iasatir-text.iar .samchar2{ font-family:'SamComment'; }

/* ── the book's own opening, on the cover it shows when drawn ────────────────
   A book that has one grows to carry it; one that does not stays the size it
   was, so a shelf of books that say nothing about themselves looks exactly as
   it did. */
/* the author's name, set under the title as it is on a binding: smaller, a
   little apart, and in the same ink */
.lib-spine.pulled .cover-face{ flex-direction:column; justify-content:center; }

/* ── the inversion switch, last so it is not undone by the plain checkbox
   rule written for it earlier in this file ─────────────────────────────── */
/* the switch is a switch, not a checkbox lost against a tinted card */
.a11y-switch input{ appearance:none; -webkit-appearance:none; position:relative;
  width:52px; height:30px; border-radius:15px; background:#cfd4e2; cursor:pointer;
  transition:background .18s ease; }
.a11y-switch input::after{ content:''; position:absolute; top:3px; inset-inline-start:3px;
  width:24px; height:24px; border-radius:50%; background:#fff;
  box-shadow:0 1px 3px rgba(0,0,0,.35); transition:inset-inline-start .18s ease; }
.a11y-switch input:checked{ background:var(--navy); }
.a11y-switch input:checked::after{ inset-inline-start:25px; }

/* ── the tools behind three dots ─────────────────────────────────────────────
   One mark on the path line instead of five, in the place the five held: three
   dots and, on the reading page, a play sign right beside them, both black
   (the owner's design, 2026-11-28). The icon stays in the left corner and the
   menu swells out of it sideways, like a balloon, over the line rather than
   pushing it. The cluster is laid left-to-right for that; the row inside keeps
   its own right-to-left order. */
.bm-navs{ direction:ltr; }
.tools-nav{ position:relative; z-index:7; display:inline-flex; align-items:center;
  direction:ltr; gap:3px; height:32px; padding:0 6px; border-radius:9px; color:#000; }
.tools-dots{ display:block; width:4px; height:4px; border-radius:50%;
  background:currentColor; box-shadow:0 -7px 0 currentColor, 0 7px 0 currentColor; }
.tools-play{ display:none; width:15px; height:18px; }
.tools-nav.with-play .tools-play{ display:block; }
.tools-nav.on{ background:rgba(0,0,0,.1); color:#000; }
.tools-row{ display:inline-flex; align-items:center; gap:4px; direction:rtl;
  margin-left:9px; transform-origin:left center;
  animation:toolsBalloon .46s cubic-bezier(.25,.8,.35,1) both; }
.tools-row.hidden{ display:none; }
@keyframes toolsBalloon{
  0%  { opacity:0; transform:scale(.08,.35); }
  48% { opacity:1; transform:scale(1.07,1.08); }
  70% { transform:scale(.965,.975); }
  86% { transform:scale(1.018,1.012); }
  100%{ opacity:1; transform:none; }
}
/* with motion turned down on the device it still opens sideways, without the swell */
@media (prefers-reduced-motion: reduce){
  .tools-row{ animation:toolsUnfold .22s ease-out both; }
  @keyframes toolsUnfold{ from{ opacity:0; transform:scaleX(.35); } to{ opacity:1; transform:none; } }
}

/* ── הפיוט בכתב שומרוני ──────────────────────────────────────────────────────
   The Aramaic column in the Samaritan hand, its word-divider a dot at the middle
   of the line rather than a space. The dot keeps the reader's own font: the
   Samaritan face has no middle dot and would draw nothing in its place. */
.dara-sam.on{ background:var(--active); color:#fff; }
.dara-a .samchar2{ font-family:'SamComment'; font-size:1.12em; line-height:1.9; }
.dara-a .wsep{ padding:0 .22em; color:#8a7a55; font-family:'Hebrew',sans-serif; }

/* ── חלון המילה בפיוטים ──────────────────────────────────────────────────────
   It holds several sources now, so it is a small panel rather than a line: a
   heading, the meaning, the dictionary's senses under their root with the verses
   it cites, the Arabic, and the lines the word is sung in. It scrolls rather
   than growing past the screen. */
#daraWordPop{ max-width:340px; max-height:60vh; overflow-y:auto; }
.dara-pop-head{ font-size:17px; }
.dara-pop-gloss{ margin:4px 0 2px; color:var(--dark); }
.dara-pop-sec{ margin-top:10px; padding-top:8px; border-top:1px solid var(--line); }
.dara-pop-sec h5{ margin:0 0 5px; font-size:12px; font-weight:700; color:var(--muted);
  letter-spacing:.02em; }
.dara-pop-root{ margin-bottom:7px; }
.dara-pop-root > b{ color:var(--accent); }
.dara-pop-sense{ font-size:13.5px; line-height:1.5; }
.dara-pop-vs{ display:flex; flex-wrap:wrap; gap:4px; margin-top:4px; }
.dara-pop-v{ padding:2px 7px; border:1px solid var(--line); border-radius:9px;
  background:#fffdf8; color:var(--navy); font-family:inherit; font-size:12px; cursor:pointer; }
.dara-pop-v:hover{ background:#eef2fb; }
.dara-pop-ar{ font-family:'Amiri','Noto Naskh Arabic',serif; font-size:16px; }

/* a citation our own text cannot be opened at: printed, not offered */
.dara-pop-v.dead{ background:transparent; border-color:#d8d2c4; color:#7a7366; cursor:default; }

/* ── הסרגל הנפתח הוא חלון, לא שורה ────────────────────────────────────────────
   Opened over the path line with nothing behind it, the tools read as part of
   the breadcrumb and the breadcrumb read as part of the tools. The row now
   carries its own ground — a panel on the app's own parchment, bordered and
   lifted — so what it covers is covered, and where it ends is plain. */
.tools-row{ background:#fff; border:1px solid rgba(26,42,74,.22);
  border-radius:999px; padding:4px 13px; gap:6px; box-shadow:0 3px 10px rgba(16,26,56,.22);
  position:relative; z-index:6; }
/* the balloon's little tail, pointing back at the icon it came out of */
.tools-row::before{ content:''; position:absolute; left:-6px; top:50%; width:10px; height:10px;
  margin-top:-5px; background:#fff; border-left:1px solid rgba(26,42,74,.22);
  border-bottom:1px solid rgba(26,42,74,.22); transform:rotate(45deg); }
/* a little more room per sign, and a little more sign — enough that a thumb
   lands on one and not between two, not so much that the row becomes a bar */
.tools-row .bm-nav{ padding:0 6px; font-size:26px; }
.tools-row .bm-nav.print-nav{ font-size:18px; }
.tools-row .bm-nav.pron-nav{ font-size:21px; }
/* "ללא ניקוד" is words, not a sign: it is set as text, not at the icons' size */
.tools-row .bm-nav.nik-nav{ font-size:15px; line-height:1.15; white-space:nowrap; }
@media (max-width:420px){
  .tools-row .bm-nav.nik-nav{ font-size:12px; white-space:normal; max-width:3.8em; padding:0 2px; }
}
/* on a narrow phone the balloon draws its signs closer, so all of it fits */
@media (max-width:380px){
  .tools-row{ gap:3px; padding:4px 9px; }
  .tools-row .bm-nav{ padding:0 4px; font-size:24px; }
  .tools-row .bm-nav.print-nav{ font-size:17px; }
  .tools-row .bm-nav.pron-nav{ font-size:20px; }
}

/* the play sign, drawn rather than lettered so it reads the same on every font */
.rdbar-nav svg{ width:21px; height:21px; display:block; }
.rdbar-nav.on{ background:var(--active); border-radius:7px; color:#fff; }

/* the reading bar, kept until it is asked for */
.reading-bar.rdbar-off{ display:none; }

/* ── מספר הפסוק ──────────────────────────────────────────────────────────────
   It was a filled tile beside every verse, and a column of tiles down the page
   reads as a column of buttons competing with the text they number. The number
   is enough: it keeps its place and its tap, and loses the ground under it. The
   chosen verse still fills, because that is the one thing the colour was for. */
.vrow .num{ min-width:22px; height:22px; background:transparent; color:#5f6b8f;
  font-size:12.5px; padding:1px 2px; margin-top:7px; }
.vrow .num.active{ background:var(--accent); color:#fff; min-width:24px; padding:1px 5px; }

/* ── חיפוש במילון המילים ─────────────────────────────────────────────────────
   A glossary is looked into, not read through, so it opens with a line to type
   into; the count beside it says how much of the list the typing has left. */
.tm-wfind{ display:flex; align-items:center; gap:8px; padding:4px 2px 9px; }
.tm-wfind-in{ flex:1; min-width:0; font-family:inherit; font-size:15px; padding:8px 11px;
  border:1px solid var(--line); border-radius:9px; background:#fff; color:var(--dark); }
.tm-wfind-in:focus{ outline:2px solid var(--active); outline-offset:1px; }
.tm-wfind-n{ flex:0 0 auto; color:var(--muted); font-size:13px; }
.tm-wtbl tr.hidden{ display:none; }

/* ── one chooser instead of six ──────────────────────────────────────────────
   body.ux2 hides the six panel buttons and shows the one that replaces them.
   ?ux=0 puts the old bar back, so the two can be held side by side and so a
   reader who finds the new bar wrong has somewhere to stand. */
body.ux2 #interpBtn, body.ux2 #commentaryBtn, body.ux2 #compareBtn,
body.ux2 #variantsBtn, body.ux2 #samSrcBtn, body.ux2 #translateBtn{ display:none; }
body:not(.ux2) #sideBtn{ display:none; }

/* The bar carried 12.5px labels under a 20px verse, which told the reader the
   buttons mattered nearly as much as the Torah. Fewer of them leaves room to
   say otherwise. */
body.ux2 #toolbar .tb{ font-size:14px; }

/* ── the bar itself: one colour, five equal items, an icon over a short label.
   The six coloured blocks each shouted in a colour of their own; now the bar is
   the header's navy and only the ACTIVE item says anything — a short gold bar
   under it, the gold of the date line above. The inline background that
   syncToolbar() still paints is overruled here rather than in the script, so
   ?ux=0 keeps the old bar untouched. */
body.ux2 #toolbar{ padding:0 4px 2px; gap:0; border-top:1px solid rgba(255,255,255,.08); }
body.ux2 .tb-rows{ gap:0; }
body.ux2 .tb-row{ gap:0; }
body.ux2 .tb-row2{ display:none; }
body.ux2 #toolbar .tb{ background:transparent !important; border-radius:8px; padding:7px 2px 7px;
  min-height:56px; display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:4px; font-size:11.5px; line-height:1.2; color:#cfd6e6; position:relative; white-space:nowrap; }
body.ux2 #toolbar .tb .tbi, body.ux2 #toolbar .tb .ux-ico{ width:22px; height:22px; }
body.ux2 #toolbar .tb .tb-label{ display:block; }
body.ux2 #toolbar .tb.font-btn .font-ab{ font-size:15px; line-height:22px; height:22px; display:block;
  letter-spacing:.02em; overflow:visible; }
body.ux2 #toolbar .tb.font-btn .font-ab .sam-let{ font-size:1.05em; }
body.ux2 #toolbar .tb:disabled{ opacity:.38; }
body.ux2 #toolbar .tb:not(:disabled):active{ background:rgba(255,255,255,.08) !important; }
body.ux2 #toolbar .tb.on{ color:#fff; }
body.ux2 #toolbar .tb.on::after{ content:''; position:absolute; bottom:3px; left:50%; transform:translateX(-50%);
  width:18px; height:3px; border-radius:2px; background:#e9c46a; }
body.ux2 #searchBtn::before{ display:none; }
/* the hides need to outrank the display:flex above (an id and three classes) */
body.ux2 #toolbar #shareBtn, body.ux2 #toolbar .tb.hidden,
body.ux2 #toolbar #interpBtn, body.ux2 #toolbar #commentaryBtn, body.ux2 #toolbar #compareBtn,
body.ux2 #toolbar #variantsBtn, body.ux2 #toolbar #samSrcBtn, body.ux2 #toolbar #translateBtn{ display:none; }
body.ux2 #toolbar .tb .tb-label.ux-no{ display:none; }
/* the blind's handle: a thin line, no shutter */
body.ux2 .tb-handle{ height:12px; }
body.ux2 #toolbar.folded .tb-handle{ height:28px; }
body.ux2 .tb-grip{ width:36px; height:4px; border-radius:2px; background:rgba(255,255,255,.35); box-shadow:none; }
body.ux2 .tb-grip::after{ display:none; }
body.ux2 .tb-handle:hover .tb-grip{ background:rgba(255,255,255,.6); }
/* labels that belong to one bar only */
body:not(.ux2) .tb-label.ux-only{ display:none; }
body.ux2 .tb-label.ux-only{ display:block; }
body:not(.ux2) #searchBtn .ux-ico, body:not(.ux2) #dictBtn .ux-ico, body:not(.ux2) #sideBtn .ux-ico{ display:none; }
/* share moved off the bar into the tools row behind the three dots */
body:not(.ux2) #shareNav{ display:none; }
.share-nav{ color:#218c66; }
.share-nav svg{ width:18px; height:18px; display:block; }

/* ── the sheet that one button opens ─────────────────────────────────────── */
.sheet{ position:fixed; inset:0; z-index:50; background:rgba(16,26,56,.45);
  display:flex; align-items:flex-end; justify-content:center; }
.sheet.hidden{ display:none; }
.sheet-card{ width:100%; max-width:520px; background:#fffdf8; border-radius:16px 16px 0 0;
  padding:14px 16px 20px; box-shadow:0 -6px 24px rgba(0,0,0,.25); max-height:76vh; overflow:auto; }
.sheet-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; }
.sheet-title{ font-size:16px; font-weight:700; color:#1c1a17; }
.sheet-x{ width:34px; height:34px; border:1px solid #cec3ae; border-radius:9px;
  background:#fffdf8; color:#1c1a17; font-size:19px; cursor:pointer; }
.sheet-rows{ display:flex; flex-direction:column; gap:6px; }
.sheet-row{ display:flex; align-items:center; justify-content:space-between; gap:10px;
  width:100%; padding:13px 14px; font-size:16px; text-align:start; cursor:pointer;
  border:1px solid #e0d8c6; border-radius:10px; background:#fff; color:#1c1a17; }
.sheet-row:hover{ background:#f6f1e6; }
.sheet-count{ min-width:26px; padding:1px 8px; border-radius:11px; font-size:13px;
  background:#eee6d6; color:#5b5346; text-align:center; }
/* what the chapter does NOT have is said once, quietly, instead of being six
   buttons that each open onto a message saying so */
.sheet-none{ margin-top:12px; font-size:13px; color:#8a8172; line-height:1.6; }

/* ── the commentary's two places: a sub-choice inside the sheet ─────────── */
.sheet-row.sheet-open{ border-bottom-left-radius:0; border-bottom-right-radius:0; background:#f6f1e6; }
.sheet-sub{ display:flex; flex-direction:column; gap:0; margin-top:-6px; border:1px solid #e0d8c6;
  border-top:0; border-radius:0 0 10px 10px; background:#fffdf8; overflow:hidden; }
.sheet-sub-row{ display:flex; align-items:center; justify-content:flex-start; gap:10px; width:100%;
  padding:11px 14px 11px 12px; font-size:15px; text-align:start; cursor:pointer; border:0;
  border-top:1px solid #efe9db; background:transparent; color:#1c1a17; }
.sheet-sub-row:hover{ background:#f6f1e6; }
.sheet-sub-row .sheet-check{ width:20px; text-align:center; color:#1a3873; font-weight:700; visibility:hidden; }
.sheet-sub-row.sel .sheet-check{ visibility:visible; }
.sheet-sub-row.sel{ font-weight:700; }
.sheet-where{ padding:8px 14px 4px; font-size:12.5px; color:#8a8172; }
/* the row says, quietly, which of the two places is currently chosen */
.sheet-row .sheet-mode{ font-size:12.5px; color:#8a8172; margin-inline-start:auto; }

/* ── commentary beneath each verse ───────────────────────────────────────────
   The verse keeps its row; its commentary follows it in a quiet cream block set
   in from the number column, the way the pronunciation line does. The scripture
   is set bold so the eye tells the two apart at a glance. */
.interp-inline .vrow .vtext{ font-weight:700; }
.interp-inline .ihead-wrap{ margin:4px 2px 8px; }
.iinline{ direction:rtl; margin:-2px 42px 12px 2px; padding:8px 11px 9px; background:var(--cream);
  border-inline-start:3px solid rgba(26,56,115,.45); border-radius:8px; position:relative; }
.iinline .itext{ line-height:1.75; direction:rtl; text-align:justify; text-align-last:right;
  overflow-wrap:break-word; word-break:break-word; white-space:pre-wrap; font-weight:400; }
.iinline .itext .samchar2{ font-family:'SamComment'; }
.iinline .itext.iar{ font-family:'Noto Naskh Arabic','Amiri','Times New Roman',serif; direction:rtl; }
.sam .interp-inline .vrow .vtext{ font-weight:700; }

/* the Jewish commentators beneath each verse: same frame, their own header row */
.comm-inline .shead{ display:flex; align-items:center; gap:6px; margin:4px 2px 2px; }
.comm-inline .shead .stitle{ flex:1; text-align:center; font-weight:700; color:var(--navy); font-size:17px; }
.comm-inline .shead .ihead-btn{ flex:0 0 auto; }
.comm-inline > .note{ margin:0 2px 8px; }
/* the Masoretic verse set between the Samaritan verse and the commentator */
.imt{ direction:rtl; margin:-2px 42px 6px 2px; padding:6px 11px 7px; border-radius:8px;
  background:rgba(60,120,120,.07); border-inline-start:3px solid rgba(60,120,120,.5); }
.imt-lead{ font-size:12.5px; font-weight:700; color:#2f6060; margin-bottom:2px; }
.imt-text{ line-height:1.7; text-align:right; color:var(--dark); font-weight:400; }
.imt-none{ font-size:13px; color:#8a8172; }
.iinline + .imt, .imt + .iinline{ margin-top:0; }
/* the switch line at the foot of the sheet's sub-choice: a switch, not a choice */
/* the sub-menus that choose the commentator and the source: the label takes the
   room, the count sits at the end as it does on the row above, and a line that
   cannot be chosen yet says so instead of looking broken. */
.sheet-sub-label{ flex:1 1 auto; }
.sheet-sub-count{ min-width:22px; padding:0 7px; border-radius:10px; font-size:12px;
  line-height:19px; text-align:center; background:#efe8d8; color:#6b6355; }
.sheet-sub-note{ font-size:12px; color:#a49a87; }
.sheet-sub-row.off{ color:#a49a87; cursor:default; }
.sheet-sub-row.off:hover{ background:none; }
.sheet-sub-row.off .sheet-check{ visibility:hidden; }
.sheet-sub-toggle{ border-top:1px dashed #d9d0bb; font-size:14px; color:#5b5346; }
.sheet-sub-toggle.sel{ font-weight:400; color:#1c1a17; }

/* the reciter picker, switched off while the other readings are corrected:
   it keeps its place and its width so the bar does not shift, but reads as
   inert — and it is still clickable, so a tap can say why */
.reading-witness.rd-wit-off{ background:#eceae4; color:#8a8172; border-color:#ddd7c9;
  cursor:default; text-align:center; }
.reading-witness.rd-wit-off:active{ background:#e4e1d9; }
/* the verse's Arabic translation, set under the verse in Arabic mode — the same
   frame as the Masoretic verse under a Jewish commentator, in its own colour */
.imt.iartr{ background:rgba(90,80,140,.07); border-inline-start-color:rgba(90,80,140,.5); }
.imt.iartr .imt-lead{ color:#55497f; }
.imt-text.iar{ font-family:'Noto Naskh Arabic','Amiri','Times New Roman',serif;
  direction:rtl; text-align:right; }

/* ── the line that was chosen draws in, and lights ───────────────────────────
   A tick alone asks the eye to look for it. The chosen line is set in from
   both sides and tinted, so which one is on reads from the shape of the block
   before a single word is read. */
.sheet-sub-row.sel{ width:auto; margin-inline:10px; border-radius:8px;
  background:#eef3fb; border-top-color:transparent;
  box-shadow:inset 0 0 0 1px rgba(26,56,115,.22); }
.sheet-sub-row.sel:hover{ background:#e6edf9; }
.sheet-sub-toggle.sel{ background:#f3efe2; box-shadow:inset 0 0 0 1px rgba(138,129,114,.3); }

/* ── and a lit button in the bar carries its own light ───────────────────────
   The gold bar under the active item says WHICH, but from across the screen the
   bar still read as five identical items. The lit one now sits in a faint well
   of its own with a soft glow, so "something is on, and it is this" is legible
   at a glance — and pressing it again puts it out. */
body.ux2 #toolbar .tb.on{ background:rgba(233,196,106,.14) !important;
  box-shadow:inset 0 0 0 1px rgba(233,196,106,.35), 0 0 12px rgba(233,196,106,.22);
  border-radius:9px; }
body.ux2 #toolbar .tb.on .tbi, body.ux2 #toolbar .tb.on .ux-ico{ filter:drop-shadow(0 0 4px rgba(233,196,106,.55)); }
body.ux2 #toolbar .tb.on::after{ width:22px; height:3px; box-shadow:0 0 7px rgba(233,196,106,.7); }
body.ux2 #toolbar .tb.on:active{ background:rgba(233,196,106,.22) !important; }


/* ---- מילון המילים בכתב השומרוני -------------------------------------------
 * כל מילה נושאת קו תחתון שאומר «אפשר לגעת בי», ובכתב השומרוני הקווים של שתי
 * מילות שכנות נוגעים זה בזה ונקראים כקו אחד — ואז המשפט נראה כמילה אחת
 * ארוכה. מעט אוויר משני צדי כל מילה מפריד ביניהם; גודל הטקסט מוקטן בנקודה
 * אחת ב-JS, מפני ששם הוא נקבע.
 */
.vtext.vsam .dw{ padding:0 .07em; }
.vtext.vsam .dw.on{ text-decoration:none; position:relative; }
.vtext.vsam .dw.on::after{ content:''; position:absolute; left:.04em; right:.04em;
  bottom:-.16em; height:1.5px; border-radius:1px; background:rgba(46,97,184,.5); }
.vtext.vsam .dw.on:hover::after{ background:rgba(46,97,184,.8); }
.vtext.vsam .dw.sel::after{ display:none; }
.vtext.vsam .wsep{ padding:0 .04em; }

/* the word index says what the word means, not only that it exists */
.dict-wgloss{ display:block; font-size:12.5px; color:#5b5346; line-height:1.35;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.dict-war{ display:block; font-size:12.5px; color:#55497f; line-height:1.4;
  font-family:'Noto Naskh Arabic','Amiri','Times New Roman',serif;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.dict-wcell{ text-align:start; }

/* the Hebrew word an occurrence renders, beside its place */
.tal-loc .occ-he{ font-style:normal; color:#55497f; margin-inline-start:.35em;
  font-size:.92em; opacity:.9; }

/* ── admin to-do list (משימות לביצוע או להשלמה) ── */
.tk-bar{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:8px; font-size:.9em; }
.tk-bar .admin-btn{ margin-inline-start:auto; }
.tk-row{ border:1px solid var(--line); border-radius:8px; padding:7px 9px; margin-bottom:6px; background:#fff;
         border-inline-start:5px solid #c9a24a; }
.tk-row.tk-doing{ border-inline-start-color:#1f6f78; }
.tk-row.tk-done{ border-inline-start-color:#3a6b34; opacity:.65; }
.tk-row.tk-late{ background:#fff3f0; }
.tk-title{ width:100%; box-sizing:border-box; font:inherit; font-weight:600; border:1px solid transparent;
           border-radius:5px; padding:3px 5px; background:transparent; }
.tk-title:focus{ border-color:var(--line); background:#fff; }
.tk-fields{ display:flex; flex-wrap:wrap; gap:6px 10px; align-items:flex-end; margin-top:4px; font-size:.8em; }
.tk-fields label{ display:flex; flex-direction:column; gap:1px; }
.tk-fields select,.tk-fields input{ font:inherit; padding:2px 4px; }
.tk-note{ width:9em; }
.tk-del{ margin-inline-start:auto; padding:3px 8px; }


/* ── units shown in a frame: the bar is the app's, the page below it is theirs ──
   The calendar, the family tree and the manuscripts are whole apps of their own,
   shown here inside a frame. Their close button used to be laid ON the embedded
   page at top:10px left:12px — and every one of those apps keeps its own control
   in exactly that corner: the calendar's hamburger is fixed at top:10 left:10,
   42x42, and the family tree's "🔧 מנהל" sits at left:16 top:14. Ours covered
   theirs almost to the pixel.
   The button stands in a bar of its own now and the frame begins beneath it, so
   nothing of the embedded page is ever under it — not today, and not when those
   apps move their own buttons tomorrow. The wrapper stays position:fixed and is
   still raised and lowered by `style.display` block/none, which is what the Back
   key looks for (closeTopLayer in app.js). */
/* ── and then the bar itself went, 2026-11-18 ──
   A bar of 48px is six per cent of a telephone's screen, and under it each of
   these apps has a header of its own — two strips of chrome before any of the
   thing itself. So the button comes back onto the page, but in the ONE corner
   that is safe: the far TOP-RIGHT, in physical pixels and not in the writing
   direction, because every one of these apps keeps its own control at the
   top-left — the calendar's ☰, the family tree's 🔧, the tour's zoom and its
   languages. Opposite is opposite in every language.
   And it is no longer a ✕ but an arrow pointing right: in a right-to-left app
   that is "back", and back is what it does — to the main menu it came from. */
.unit-wrap{ position:fixed; inset:0; z-index:4000; background:#f4f1ea; }
/* The height is stated, not left to `bottom:0` — an iframe is a REPLACED element,
   and an absolutely positioned replaced box with height:auto takes its intrinsic
   height, which for an iframe is the browser's default 150px; `bottom` is then
   ignored and the unit came out 150 pixels tall at the top of the page. */
.unit-wrap > iframe{ position:absolute; inset:0;
                     width:100%; height:100%; border:0; display:block; }
/* `.unit-wrap >` and not `.unit-x` alone: hub.js also puts `.hub-x` on this
   button — the make the main menu gives all its close buttons — and the two
   would otherwise tie and the last one written would win. */
.unit-wrap > .unit-x{ position:absolute; top:8px; right:8px; z-index:4001;
         width:42px; height:42px; display:flex; align-items:center;
         justify-content:center; padding:0; border-radius:50%;
         border:1px solid var(--navy); background:#fff; color:var(--navy);
         cursor:pointer; box-shadow:0 2px 12px rgba(0,0,0,.45); }
.unit-wrap > .unit-x{ font-family:inherit; font-size:24px; line-height:1; }
.unit-wrap > .unit-x:hover{ background:var(--navy); color:#fff; }
/* the way back to the Torah lives in the hamburger, not over the unit */
.unit-wrap .unit-totorah{ display:none; }
/* an app of our own carries the arrow in its own header instead */
.unit-wrap.back-in > .unit-x{ display:none; }
/* the family tree is not ours to change: its top-right holds "מנהל", so the
   arrow goes to its empty corner, the top-left */
.unit-wrap.back-left > .unit-x{ right:auto; left:8px; }


/* ── הקראת הספר ──
   The control floats in a corner of the reader, and the section being spoken is
   marked so the eye can follow the voice. */
.modal-box.book-reader{ position:relative; }
/* a corner of its own, clear of the bar: in the bar it was the fifth button in a
   row of five and went unseen. Floating, it is also within reach mid-chapter —
   the voice can be stopped without going back up. */
.rd-aloud{ position:absolute; inset-inline-end:16px; bottom:84px; z-index:4;
           display:flex; gap:8px; align-items:center; }
.rd-aloud.hidden{ display:none; }
.rd-speak{ flex:0 0 auto; border:1px solid var(--navy); background:var(--navy); color:#fff;
           width:48px; height:48px; border-radius:50%; padding:0; font:inherit; font-size:20px;
           line-height:1; cursor:pointer; display:flex; align-items:center; justify-content:center;
           box-shadow:0 3px 12px rgba(10,20,45,.34); }
.rd-speak:hover{ background:var(--accent); border-color:var(--accent); }
.rd-speak.hidden{ display:none; }
#rdSpeakStop{ width:42px; height:42px; font-size:16px; background:#8a2e2e; border-color:#8a2e2e; }
#rdSpeakStop:hover{ background:#a83c3c; border-color:#a83c3c; }
/* what was tried and what the device owns — so a silence can be reported, not guessed */
.rd-diag{ margin-top:14px; padding-top:8px; border-top:1px solid rgba(26,56,115,.18);
          color:var(--muted); font-size:12.5px; line-height:1.6; word-break:break-word; }
#rdBody .tm-sec.rd-reading{ background:#fff6d8; border-radius:7px;
                            box-shadow:0 0 0 2px #e3c66a inset; }


/* ── הספרייה: תצוגת הכריכות ──────────────────────────────────────────────────
   The other way to look at the same shelves. Every book faces the reader in
   the house binding — a deep ground of its own colour inside a double gold
   rule — grouped by subject under the group's name; the plank and the spines
   are gone, and one tap opens a book instead of two. The ground is the same
   hue the shelf gives that book's spine, taken down dark, so a book is
   recognisably the same book in both views. */
.lib-view{ flex:0 0 auto; border:1px solid var(--navy); background:#fff; color:var(--navy);
  border-radius:8px; padding:7px 12px; font:inherit; font-size:13.5px; font-weight:700;
  cursor:pointer; white-space:nowrap; }
.lib-view:hover{ background:var(--navy); color:#fff; }

/* ── הספרייה: פריסת הכריכות ──────────────────────────────────────────────────
   The books lie face up on a table, grouped by subject with the group's name
   over it, and each wears the house binding. The spread is sized to the page
   (see libFitCovers): the gaps and the lettering follow the cover's width, so a
   small screen gets small books with air around them rather than a crush.
   With a width of its own it stretches, and max-width still centres it. */
#libGrid.as-covers{ width:100%; }
.lib-grid.as-covers .shelf{ margin-bottom:calc(var(--cover-w, 132px) * .20); }
.lib-grid.as-covers .shelf:last-child{ margin-bottom:0; }
/* the subject's name over its books: a line of letters between two hairlines,
   the way a chapter is headed in a printed book */
.lib-grid.as-covers .shelf-name{ display:flex; align-items:center; gap:10px;
  padding:0 2px calc(var(--cover-w, 132px) * .10);
  font-size:clamp(11px, calc(var(--cover-w, 132px) * .092), 15px);
  font-weight:700; letter-spacing:.07em; color:#6d5336; white-space:nowrap; }
.lib-grid.as-covers .shelf-name::before,
.lib-grid.as-covers .shelf-name::after{ content:''; flex:1 1 auto; height:1px;
  background:linear-gradient(90deg, rgba(109,83,54,0), rgba(109,83,54,.42)); }
.lib-grid.as-covers .shelf-name::after{ transform:scaleX(-1); }
/* auto-FIT, not auto-fill: a group of two must sit in the middle of the table,
   not at one end of eight empty tracks */
.cover-row{ display:grid; justify-content:center;
  grid-template-columns:repeat(auto-fit, var(--cover-w, 132px));
  gap:var(--cover-gy, 16px) var(--cover-gx, 13px);
  padding:2px 6px 4px; }
/* no scrollbar while the fit is being measured */
.lib-grid.as-covers.fit{ overflow:hidden; }
/* A grid of sixteen cannot always fill both dimensions exactly: once the width
   is settled the rows are as tall as they are, and what is left over is spread
   between the groups rather than banked at the bottom. */
#libGrid.as-covers.fit{ display:flex; flex-direction:column; justify-content:space-evenly; }

/* ── the binding itself ──────────────────────────────────────────────────────
   A deep ground under a double gold rule with a lozenge on each corner, the
   house's name across the head, and the title in the middle. The same plate
   serves the spread and the book drawn off the shelf, so they cannot drift. */
.lib-cover{ position:relative; display:block; width:100%; aspect-ratio:3/4;
  padding:0; border:0; cursor:pointer; font:inherit; overflow:hidden;
  border-radius:3px 7px 7px 3px;
  background:radial-gradient(116% 84% at 50% 32%, var(--ck-lite,#1b3b30), var(--ck,#132b23) 58%, var(--ck-dark,#0c1c17));
  box-shadow:0 6px 14px -6px rgba(40,24,10,.5), inset 0 0 0 1px rgba(232,205,142,.18);
  transition:transform .16s, box-shadow .16s; }
html[dir="ltr"] .lib-cover{ border-radius:7px 3px 3px 7px; }
.lib-cover:hover{ transform:translateY(-3px);
  box-shadow:0 12px 22px -6px rgba(40,24,10,.6), inset 0 0 0 1px rgba(232,205,142,.34); }
/* the binding edge, so a cover still reads as a bound book and not as a tile */
.lib-cover::before{ content:''; position:absolute; inset-block:0; inset-inline-start:0;
  width:7%; background:linear-gradient(90deg, rgba(0,0,0,.34), rgba(0,0,0,.05));
  border-inline-end:1px solid rgba(232,205,142,.22); pointer-events:none; z-index:1; }

/* the drawn frame */
.cover-art{ position:absolute; inset-block:4.5%; inset-inline:8.5% 4.5%;
  width:auto; height:auto; pointer-events:none; }
.cover-art .ca-rule1, .cover-art .ca-rule2{ fill:none; stroke:#dcbd80; }
.cover-art .ca-rule1{ stroke-width:1.8; opacity:.82; }
.cover-art .ca-rule2{ stroke-width:1; opacity:.58; }
.cover-art .ca-knot path{ fill:#e8cd8e; opacity:.85; }

/* the house's name at the head, tracked, between two hairlines with a lozenge */
.cover-head{ position:absolute; inset-inline:15% 10%; top:11.5%;
  display:flex; align-items:center; justify-content:center; gap:11px;
  pointer-events:none; }
.cover-head i{ flex:1 1 auto; height:1px; position:relative;
  background:rgba(232,205,142,.42); }
.cover-head i::after{ content:''; position:absolute; top:-2.5px; width:6px; height:6px;
  background:#e8cd8e; opacity:.9; transform:rotate(45deg); }
.cover-head i:first-child::after{ inset-inline-end:-8px; }
.cover-head i:last-child::after{ inset-inline-start:-8px; }
.cover-head .ch-br{ flex:0 0 auto; color:#e8cd8e; font-weight:600;
  font-size:clamp(7px, calc(var(--cover-w, 132px) * .062), 12px);
  letter-spacing:.34em; padding-inline-start:.34em; }

/* title block */
.cv .cover-text{ position:absolute; inset-inline:14% 9%; top:50%;
  transform:translateY(-50%); display:flex; flex-direction:column;
  align-items:center; justify-content:center; text-align:center; }
.cv .lib-book-title{ padding:0 2px; border:0; color:#f0d79b;
  font-size:clamp(10.5px, calc(var(--cover-w, 132px) * .112), 23px); font-weight:700;
  line-height:1.28; text-shadow:0 1px 3px rgba(0,0,0,.5);
  display:-webkit-box; -webkit-line-clamp:4; -webkit-box-orient:vertical; overflow:hidden; }
.cv .cover-alt{ margin-top:.45em; color:rgba(232,205,142,.82);
  font-size:clamp(8px, calc(var(--cover-w, 132px) * .082), 17px); line-height:1.35;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.cv .cover-kind{ margin-top:.9em; color:rgba(240,226,194,.72);
  font-size:clamp(7.5px, calc(var(--cover-w, 132px) * .061), 12.5px); line-height:1.3; }
.cv .cover-by{ margin-top:1.1em; color:#f0e2c2; line-height:1.35;
  font-size:clamp(8px, calc(var(--cover-w, 132px) * .07), 14px); font-weight:700; }
.cv .cover-by i{ display:block; margin-bottom:.35em; font-style:normal;
  font-weight:400; letter-spacing:.14em; color:rgba(240,226,194,.6);
  font-size:.78em; }
/* the six small rings at the foot, where a printed book keeps its device */
.cover-dots{ position:absolute; inset-inline:15% 10%; bottom:8.5%;
  display:flex; align-items:center; justify-content:center; gap:.5em;
  font-size:clamp(7px, calc(var(--cover-w, 132px) * .05), 11px); pointer-events:none; }
.cover-dots i{ width:.55em; height:.55em; border-radius:50%;
  border:1px solid rgba(232,205,142,.72); }

/* ── how much of the cover is shown ──────────────────────────────────────────
   A cover seventy pixels wide cannot carry six lines of type legibly, so the
   plate is written out by degrees: the small one keeps the frame and the title,
   the middle one adds the house's name and the author, and only the large one
   carries the whole binding. The thresholds are the cover's own width. */
.lib-grid.sz-s .cover-head .ch-br,
.lib-grid.sz-s .cover-alt, .lib-grid.sz-s .cover-kind,
.lib-grid.sz-s .cover-by, .lib-grid.sz-s .cover-dots{ display:none; }
.lib-grid.sz-s .cover-head{ gap:7px; }
.lib-grid.sz-m .cover-alt{ display:none; }
.lib-grid.sz-m .cover-kind{ margin-top:.7em; }
.lib-grid.sz-m .cover-dots{ gap:.42em; }

@media (prefers-reduced-motion: reduce){ .lib-cover{ transition:none; } }

/* the app's own answer for a word, when it stands at the head of the page
   because the dictionary's entries say something else (see dictAppSearch) */
.dict-said-top{ border-inline-start:3px solid var(--accent); padding-inline-start:9px;
  background:rgba(233,196,106,.12); border-radius:0 7px 7px 0; font-size:15.5px; line-height:1.6; }

/* ── גיבוי מקומי (מנהל) ── */
.modal-box.backup-box{ max-width:440px; width:92%; max-height:92vh; }
.bk-intro{ text-align:start; padding:0; font-size:14px; }
.bk-all{ display:flex; gap:14px; justify-content:flex-start; }
.bk-list{ display:flex; flex-direction:column; border:1px solid #e3e7f0; border-radius:10px; padding:2px 4px;
          overflow-y:auto; min-height:120px; flex:1 1 auto; }   /* the list scrolls; the keys under it stay in view */
.bk-row{ display:flex; align-items:center; gap:10px; padding:7px 8px; border-radius:8px; cursor:pointer; font-size:15px; flex:0 0 auto; }
.bk-row:hover{ background:#f3f6fc; }
.bk-row input{ width:20px; height:20px; flex:0 0 auto; margin:0; accent-color:var(--navy); }
.bk-name{ flex:1 1 auto; font-weight:600; color:var(--navy); }
.bk-size{ flex:0 0 auto; font-size:12.5px; color:var(--muted); }
.bk-size bdi{ direction:ltr; }
.bk-code{ display:flex; align-items:center; gap:8px; font-size:14px; cursor:pointer; }
.bk-code input{ width:18px; height:18px; margin:0; accent-color:var(--navy); }
.bk-total{ font-size:14px; color:var(--navy); font-weight:600; min-height:1.2em; }
.bk-log{ font-size:12.5px; color:var(--muted); line-height:1.6; border-top:1px solid #e3e7f0; padding-top:8px; }
.bk-log b{ color:var(--navy); font-weight:600; }

/* ── the store's offer on a telephone ── */
.store-offer{ display:flex; flex-direction:column; align-items:center; gap:8px; text-align:center; }
.store-offer svg{ width:58px; height:58px; }
.store-offer p{ margin:0; line-height:1.55; }

/* ── פירוש הפרשה — the commentary on the portion of the week, as one page ──────
   A page to read down: a title that says what it is, the portions it covers,
   then for each portion an introduction and its chapters, and under every verse
   what the verse screen shows under it. The commentary column itself is the
   verse screen's own (.interp-panel …), so the two read alike. */
.psh{ max-width:860px; margin:0 auto; padding:2px 4px 28px; color:var(--dark); }
.psh-head{ display:flex; align-items:flex-start; flex-wrap:wrap; gap:10px 12px; padding:14px 14px 12px;
  border-radius:12px; background:linear-gradient(180deg,#fdf6dc,#f7ecc4); border:1px solid #e2c96a; }
.psh-head-main{ flex:1 1 240px; min-width:0; }
.psh-title{ margin:0; font-size:clamp(27px, 6.6vw, 42px); line-height:1.15; font-weight:800;
  color:var(--navy); letter-spacing:0; text-wrap:balance; }
.psh-sub{ margin-top:7px; font-size:clamp(17px, 4.3vw, 23px); line-height:1.35; color:#5c4216; font-weight:700; }
.psh-sub-lead{ font-weight:600; color:#8a6a12; }
.psh-plus{ color:#8a6a12; padding:0 3px; }
.psh-date{ margin-top:5px; font-size:13.5px; color:#6b6252; }
.psh-share{ flex:0 0 auto; display:inline-flex; align-items:center; gap:7px; background:var(--share);
  color:#fff; border:0; border-radius:999px; padding:9px 16px; font-family:inherit; font-size:15px;
  font-weight:700; cursor:pointer; line-height:1.2; }
.psh-share:hover{ filter:brightness(1.08); }
.psh-share svg{ flex:0 0 auto; }

/* the switches stay in reach while the page is read down */
.psh-tools{ position:sticky; top:-6px; z-index:5; display:flex; flex-wrap:wrap; align-items:center;
  gap:8px; padding:9px 4px 8px; margin:6px 0 2px; background:rgba(255,255,255,.95);
  border-bottom:1px solid var(--line); }
.psh-seg{ display:inline-flex; flex-wrap:wrap; gap:4px; }
.psh-zoom{ margin-inline-start:auto; }
.psh-tools .ihead-btn{ font-size:13.5px; padding:5px 12px; }
.psh-tools .ihead-btn:disabled{ opacity:.4; cursor:default; }

.psh-pname{ margin:18px 0 9px; font-size:clamp(20px, 5vw, 24px); line-height:1.3; color:var(--navy);
  font-weight:800; border-bottom:2px solid #e2c96a; padding-bottom:5px; }
/* the portion's picture: whole, never cropped, and never taller than leaves the
   introduction in sight beneath it */
.psh-pic{ margin:0 0 11px; text-align:center; }
.psh-pic img{ display:block; margin:0 auto; max-width:100%; width:auto; height:auto; max-height:min(62vh, 520px);
  border-radius:12px; border:1px solid #e2c96a; background:#f4ecd3; }
.psh-pic-cap{ margin-top:6px; font-size:14px; line-height:1.5; color:#5c4216; }
.psh-pic-what{ display:block; font-weight:700; }
.psh-pic-cap small{ display:block; font-size:12px; color:#7a7263; }
.psh-pic-cap a{ color:inherit; text-decoration:underline; }
.psh-intro{ background:var(--cream); border:1px solid rgba(26,56,115,.25); border-radius:12px;
  padding:12px 14px; }
.psh-h{ margin:0 0 7px; font-size:17px; color:var(--navy); font-weight:800; }
.psh-intro-text{ margin:0 0 9px; line-height:1.8; text-align:justify; }
.psh-intro-text.iar{ font-family:'Noto Naskh Arabic','Amiri','Times New Roman',serif; line-height:2.05; }
.psh-intro-text .samchar2{ font-family:'SamComment'; }
.psh-intro-facts{ margin:0 0 6px; line-height:1.7; font-size:15.5px; color:#3a3a4a; }
.psh-outline{ margin-top:11px; }
.psh-outline-lead{ font-size:13px; font-weight:700; color:var(--navy); margin-bottom:5px; }
.psh-outline-list{ display:grid; grid-template-columns:repeat(auto-fill, minmax(200px, 1fr)); gap:5px; }
.psh-outline-item{ display:flex; align-items:baseline; gap:7px; text-align:start; background:#fff;
  border:1px solid var(--line); border-radius:8px; padding:6px 9px; font-family:inherit;
  font-size:14.5px; color:var(--dark); cursor:pointer; min-width:0; }
.psh-outline-item:hover{ background:#eef1fb; }
.psh-outline-item b{ color:var(--navy); min-width:1.7em; }
.psh-oi-open{ flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.psh-outline-item small{ color:var(--muted); font-size:12px; direction:ltr; unicode-bidi:isolate; }

.psh-ch{ margin-top:22px; }
.psh-chhead{ display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 10px; margin:0 0 4px;
  padding:7px 10px; background:#e9edf8; border-radius:8px; font-size:17px; color:var(--navy);
  scroll-margin-top:calc(var(--psh-bar, 46px) + 4px); }
.psh-chnum{ font-weight:800; }
.psh-chopen{ font-weight:600; }
.psh-chref{ font-size:13px; color:var(--muted); font-weight:400; }
.psh-chread{ margin-inline-start:auto; background:none; border:0; color:var(--accent);
  font-family:inherit; font-size:13px; cursor:pointer; padding:2px 4px; white-space:nowrap; }
.psh-chread:hover{ text-decoration:underline; }

.psh-verse{ padding:11px 2px 13px; border-bottom:1px solid rgba(26,56,115,.13); scroll-margin-top:calc(var(--psh-bar, 46px) + 4px); }
.psh-verse:last-child{ border-bottom:0; }
/* the sentence a shared text stopped at, shown for a while to the reader who
   followed its link (pshJump) */
::highlight(psh-here){ background-color:rgba(147,232,170,.6); color:inherit; }
.psh-landed{ animation:pshLanded 4s ease-out 1; border-radius:6px; }
@keyframes pshLanded{ 0%, 55%{ background-color:rgba(147,232,170,.5); } 100%{ background-color:transparent; } }
.psh-vline{ display:flex; align-items:baseline; gap:8px; }
.psh-vnum{ flex:0 0 auto; min-width:28px; text-align:center; background:#c2cbef; color:var(--navy);
  border-radius:6px; font-size:13px; line-height:1.6; padding:1px 4px; }
.psh-vtext{ flex:1; min-width:0; line-height:1.75; font-weight:700; direction:rtl; text-align:right; }
.psh-sam .psh-vtext{ font-weight:400; line-height:1.9; }
.psh-vtext .samchar{ font-family:'Samaritan'; }
.psh-vtrans{ margin-top:4px; margin-inline-start:36px; color:#44506a; line-height:1.6; }
.psh-vtrans.iar{ font-family:'Noto Naskh Arabic','Amiri','Times New Roman',serif; line-height:1.95;
  color:#2f6060; direction:rtl; }
/* a point of text: set in the week's own gold, so that it is plainly a note ON
   the text and not part of the commentary beneath it */
.psh-point{ display:flex; flex-wrap:wrap; align-items:baseline; gap:2px 14px; margin-top:7px;
  margin-inline-start:36px; padding:5px 10px; background:#fdf3d0; border:1px solid #e2c96a;
  border-radius:8px; font-size:14px; line-height:1.7; }
.psh-point-lead{ font-weight:800; color:#8a6a12; font-size:12.5px; }
.psh-rd{ display:inline-flex; flex-wrap:wrap; align-items:baseline; gap:5px; }
.psh-rd-who{ color:#6b4d1e; font-size:12.5px; font-weight:700; }
.psh-rd-who::after{ content:':'; }
.psh-rd-text{ font-weight:700; color:var(--dark); direction:rtl; unicode-bidi:isolate; }
.psh-rd-none{ color:var(--muted); }
.psh-interp{ margin-top:7px; margin-inline-start:36px; }
.psh-share-note{ font-size:12.5px; color:var(--muted); text-align:center; line-height:1.5; }
.psh-share-modal .modal-box{ max-height:92vh; overflow-y:auto; }
.psh-share-modal .share-opt{ padding:11px; font-size:16px; }
.psh-fb-say{ font-size:15.5px; line-height:1.65; color:var(--ink, #222); text-align:start; margin:2px 4px 14px; }
.psh-fb-say p{ margin:0 0 10px; }
.psh-fb-say .psh-fb-step{ font-weight:700; margin-bottom:0; }
@media (max-width:520px){
  .psh-vtrans, .psh-point, .psh-interp{ margin-inline-start:0; }
  .psh-head{ padding:12px 11px 11px; }
}

/* ── שכבת "סוגיות הלכתיות" בקורא הספרייה (מרכז המצוות וההלכה) ───────────────
   One button at the head of a chapter that has marked passages; when it is on,
   each marked passage carries the names it is linked to. Violet-dashed names
   were found by rule, not by an editor. */
.hk-lay-bar{display:flex;flex-wrap:wrap;gap:6px 8px;align-items:center;margin:0 0 10px}
.hk-lay-btn{font:inherit;font-size:14px;border:1px solid #b08a2e;background:#fffaf0;color:#5a4410;border-radius:999px;padding:4px 12px;cursor:pointer}
.hk-lay-btn i{font-style:normal;font-size:12px;background:#b08a2e;color:#fff;border-radius:999px;padding:0 7px;margin-inline-start:4px}
.hk-lay-btn[aria-pressed="true"]{background:#b08a2e;color:#fff}
.hk-lay-btn[aria-pressed="true"] i{background:#fff;color:#5a4410}
.hk-lay-chips{display:flex;flex-wrap:wrap;gap:5px;margin:4px 0 6px}
.hk-lay-chip{font:inherit;font-size:13px;border:1px solid #b08a2e;background:#fff;color:#5a4410;border-radius:6px;padding:2px 9px;cursor:pointer;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.hk-lay-chip.auto{border:1px dashed #7a5bb5;color:#4b3585}
.tm-sec.hk-lay{border-inline-start:3px solid #b08a2e;padding-inline-start:8px}
