/* Chitas and Rambam. Phone first; wider screens and print further down. */
@font-face { font-family: "Frank Ruhl Libre"; src: url(fonts/FrankRuhlLibre-400.woff2) format("woff2"); font-weight: 400; font-display: block; }
@font-face { font-family: "Frank Ruhl Libre"; src: url(fonts/FrankRuhlLibre-500.woff2) format("woff2"); font-weight: 500; font-display: block; }
@font-face { font-family: "Frank Ruhl Libre"; src: url(fonts/FrankRuhlLibre-700.woff2) format("woff2"); font-weight: 700; font-display: block; }
@font-face { font-family: "Noto Serif Hebrew"; src: url(fonts/NotoSerifHebrew-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Noto Rashi Hebrew"; src: url(fonts/NotoRashiHebrew-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Seferlines Serif"; src: url(fonts/SeferlinesSerif-Caption-400.woff2) format("woff2"); font-weight: 400; font-display: block; }
@font-face { font-family: "Seferlines Serif"; src: url(fonts/SeferlinesSerif-Caption-600.woff2) format("woff2"); font-weight: 600; font-display: block; }
@font-face { font-family: "Seferlines Serif Text"; src: url(fonts/SeferlinesSerif-Text-400.woff2) format("woff2"); font-weight: 400; font-display: block; }
@font-face { font-family: "Seferlines Serif Text"; src: url(fonts/SeferlinesSerif-Text-600.woff2) format("woff2"); font-weight: 600; font-display: block; }
@font-face { font-family: "Seferlines Serif Text"; src: url(fonts/SeferlinesSerif-Italic-400.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: block; }

:root {
  --scale: 1;
  --he: "Frank Ruhl Libre", "Taamey Frank CLM", "SBL Hebrew", "Times New Roman", serif;
  --rashi-font: var(--he);
  --mikra: "Noto Serif Hebrew", "Taamey Frank CLM", "SBL Hebrew", serif;
  --en: "Seferlines Serif", Georgia, "Times New Roman", serif;
  --en-text: "Seferlines Serif Text", Georgia, "Times New Roman", serif;

  /* paper and ink: warm off-white, near-black (15:1), gloss 7:1, secondary 5.6:1; one accent, used only for verse and halachah numbers */
  --bg: #f6f1e7; --ink: #1f1b16; --gloss: #544e46; --muted: #675f54; --faint: #857d70; --rule: #e3dccd; --rule-strong: #cbc2b0;
  --accent: #8a2c1c; --accent-soft: #efe4da; --press: #ede6d8;

  --he-size: calc(1.5rem * var(--scale));
  --en-size: calc(0.83rem * var(--scale));
  --rashi-he: calc(1.14rem * var(--scale));
  --rashi-en: calc(0.95rem * var(--scale));
  --rambam-he: calc(1.38rem * var(--scale));
  --chunk-min: 4.6rem;
  --measure: 40rem;
  --pad: 1.15rem;
  --head-h: 6rem;
}
html[data-theme="dark"] {
  --bg: #181715; --ink: #ddd5c6; --gloss: #aaa192; --muted: #9b9284; --faint: #7a7366; --rule: #2c2a26; --rule-strong: #3e3a33;
  --accent: #d09a84; --accent-soft: #2a211d; --press: #22201d;
}
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    --bg: #181715; --ink: #ddd5c6; --gloss: #aaa192; --muted: #9b9284; --faint: #7a7366; --rule: #2c2a26; --rule-strong: #3e3a33;
    --accent: #d09a84; --accent-soft: #2a211d; --press: #22201d;
  }
}
html[data-rashifont="script"] { --rashi-font: "Noto Rashi Hebrew", var(--he); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: var(--head-h); }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--en); font-size: 1rem; line-height: 1.5;
  font-kerning: normal; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[lang="he"] { font-family: var(--he); }
.skip { position: absolute; left: -999px; top: 0; background: var(--bg); padding: .6rem 1rem; z-index: 30; }
.skip:focus { left: .5rem; }

/* ---------- masthead ---------- */
.masthead { position: sticky; top: 0; z-index: 10; background: var(--bg); border-bottom: 1px solid var(--rule); padding-top: env(safe-area-inset-top); }
.bar { display: grid; grid-template-columns: 2.75rem 1fr 2.75rem; align-items: center; max-width: 52rem; margin: 0 auto; padding: 0 .25rem; height: 3.25rem; }
.brand { grid-column: 1; justify-self: center; display: flex; align-items: center; height: 2.75rem; text-decoration: none; color: inherit; }
.brand img { display: block; }
.brand .dark { display: none; }
html[data-theme="dark"] .brand .light { display: none; }
html[data-theme="dark"] .brand .dark { display: block; }
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] .brand .light { display: none; }
  html[data-theme="auto"] .brand .dark { display: block; }
}
.brand-mark img { width: 1.75rem; height: 1.75rem; }
.brand-lockup { display: none; }
@media (min-width: 40rem) {
  .bar { grid-template-columns: 12.25rem 1fr 2.75rem; padding: 0 .6rem 0 .5rem; }
  .brand { justify-self: start; }
  .brand-mark { display: none; }
  .brand-lockup { display: block; }
  .brand-lockup img { height: 2rem; width: auto; }
}
@media (min-width: 60rem) {
  .bar { grid-template-columns: 14rem 1fr 2.75rem; }
  .brand-lockup img { height: 2.25rem; }
}
.daypick { grid-column: 2; display: flex; align-items: center; justify-content: center; min-width: 0; }
.nav-btn { width: 2.75rem; height: 2.75rem; display: grid; place-items: center; color: var(--ink); flex: none; border-radius: 2px; }
.nav-btn svg { width: 1.35rem; height: 1.35rem; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.nav-btn:disabled { color: var(--rule-strong); }
.nav-btn:not(:disabled):active, .date-btn:active { background: var(--press); }
.aa { grid-column: 3; font-family: var(--en-text); font-size: 1.05rem; letter-spacing: .01em; }
.date-btn { flex: 1 1 auto; min-width: 0; height: 2.75rem; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.15; padding: 0 .25rem; border-radius: 2px; }
.date-en { font-size: .9rem; font-weight: 600; letter-spacing: .005em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.date-he { font-size: .92rem; color: var(--muted); }

.tabs { display: flex; justify-content: center; gap: 0; max-width: 52rem; margin: 0 auto; }
.tab { flex: 1 1 0; max-width: 12rem; height: 2.75rem; display: flex; align-items: center; justify-content: center; gap: .45rem; color: var(--muted);
  position: relative; font-size: .88rem; }
.tab-he { font-size: 1.12rem; font-weight: 500; }
.tab[aria-pressed="true"] { color: var(--ink); }
@media (max-width: 479px) {
  .tab { flex-direction: column; gap: 0; height: 3rem; line-height: 1.1; font-size: .76rem; }
  .tab-he { font-size: 1.05rem; }
}
.tab[aria-pressed="true"]::after { content: ""; position: absolute; left: 30%; right: 30%; bottom: -1px; height: 1px; background: var(--ink); }
/* how far through this text: a hairline under the masthead */
.progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--faint); transform-origin: left; transform: scaleX(0); pointer-events: none; }
@media (max-width: 359px) { .today-pre { display: none; } }

/* ---------- page ---------- */
main { display: block; max-width: calc(var(--measure) + 2 * var(--pad)); margin: 0 auto; padding: 0 var(--pad) 2rem; min-height: 100vh; outline: none; }
html:not(.ready) main { visibility: hidden; }
html[data-tab="chumash"] .part.rambam, html[data-tab="rambam"] .part.chumash,
html[data-tab="tanya"] .part.chumash, html[data-tab="tanya"] .part.rambam,
html[data-tab="chumash"] .part.tanya, html[data-tab="rambam"] .part.tanya { display: none; }
html:not([data-tab="shnayim"]) .part.shnayim, html[data-tab="shnayim"] .part.chumash, html[data-tab="shnayim"] .part.tanya,
html[data-tab="shnayim"] .part.rambam, html[data-tab="shnayim"] .daynav, html[data-tab="shnayim"] .away { display: none; }

.away { margin: 1rem 0 0; font-size: .85rem; color: var(--muted); text-align: center; }
.linkish { color: var(--accent); text-decoration: underline; text-underline-offset: .18em; text-decoration-thickness: 1px; min-height: 2.75rem; padding: 0 .25rem; }

.part-head { text-align: center; padding: 2rem 0 1.5rem; border-bottom: 1px solid var(--rule); margin-bottom: .5rem; }
.dayline { margin: 0 0 1.35rem; display: flex; flex-direction: column; gap: .1rem; }
.dl-he { font-size: 1rem; color: var(--muted); }
.dl-en { font-size: .88rem; color: var(--muted); font-style: italic; font-family: var(--en-text); }
.kicker-he { margin: 0 0 .2rem; font-size: 1.02rem; color: var(--muted); }
.title { margin: 0; font-weight: 700; font-size: calc(2.15rem * var(--scale)); line-height: 1.15; letter-spacing: 0; }
.subtitle { margin: .35rem 0 0; font-size: calc(1.25rem * var(--scale)); color: var(--muted); font-weight: 400; }
.en-title { margin: .7rem auto 0; font-size: .95rem; color: var(--ink); max-width: 30rem; font-family: var(--en-text); }
.jump { display: flex; justify-content: center; gap: .25rem; margin-top: 1rem; direction: rtl; flex-wrap: wrap; }
.jump a { min-height: 2.75rem; min-width: 2.75rem; padding: 0 .75rem; display: inline-flex; align-items: center; font-size: 1.05rem; color: var(--ink);
  text-decoration: underline; text-decoration-color: var(--rule-strong); text-underline-offset: .3em; text-decoration-thickness: 1px; }
.jump a:hover { text-decoration-color: var(--accent); }

/* pasuk and halachah */
.pasuk, .halacha { position: relative; padding: 1.1rem 0 1.15rem; border-bottom: 1px solid var(--rule); }
.pasuk:last-child, .perek .halacha:last-child { border-bottom: 0; }
.num { display: flex; justify-content: flex-start; align-items: baseline; gap: .5rem; flex-direction: row-reverse; margin-bottom: .2rem; line-height: 1; }
.num-he { font-size: 1.08rem; font-weight: 700; color: var(--accent); }
.num-en { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* interlinear lines: Hebrew chunk on top, English under it, as wide as the Hebrew */
.il { text-align: right; line-height: 1; }
.ch { display: inline-block; vertical-align: top; text-align: center; min-width: max(var(--chunk-min), calc(var(--en-size) * var(--lw, 0) * .54)); margin: 0 0 .95rem .62rem; }
.ch .h { display: block; white-space: nowrap; font-family: var(--he); font-size: var(--he-size); line-height: 1.4; font-weight: 400; color: var(--ink); }
.ch .e { display: block; width: 0; min-width: 100%; margin-top: .12rem; font-family: var(--en); font-size: var(--en-size); line-height: 1.3; color: var(--gloss);
  hyphens: manual; overflow-wrap: normal; }
.rambam-il .ch .h, .tanya-il .ch .h { font-size: var(--rambam-he); }
.ch.long { display: block; min-width: 0; margin-left: 0; }
.ch.long .h { white-space: normal; line-height: 1.55; }
.ch.long .e { width: auto; text-align: left; margin-top: .25rem; }
.ch.cite .h { font-size: calc(var(--he-size) * .62); color: var(--muted); }
.rambam-il .ch.cite .h { font-size: calc(var(--rambam-he) * .66); }
.ch.cite .e { font-size: calc(var(--en-size) * .92); color: var(--muted); }

/* Rashi */
.rashi { margin: .75rem 0 0; padding: .45rem 1rem .1rem 0; border-right: 1px solid var(--rule-strong); }
.rashi + .rashi { margin-top: .5rem; }
.rashi-he { margin: 0; font-family: var(--rashi-font); font-size: var(--rashi-he); line-height: 1.62; text-align: right; }
.rashi-he .dh-he { font-weight: 700; font-family: var(--he); }
html[data-rashifont="script"] .rashi-he .dh-he { font-family: var(--he); }
.rashi-he .cite { font-size: .72em; color: var(--muted); }
.rashi-en { margin: .4rem 0 .5rem; font-family: var(--en-text); font-size: var(--rashi-en); line-height: 1.55; color: var(--ink); text-align: left; max-width: 36rem; margin-left: auto; }
.rashi-en .dh-en { font-style: italic; }
.r-il .ch .h { font-family: var(--rashi-font); font-size: var(--rashi-he); }
.r-il .ch.dh .h { font-weight: 700; font-family: var(--he); }
.r-il .ch .e { font-size: calc(var(--en-size) * .93); }
.r-il .ch { min-width: max(var(--chunk-min), calc(var(--en-size) * .95 * var(--lw, 0) * .54)); }
.r-il .ch.cite .h { font-size: calc(var(--rashi-he) * .7); }
.r-il { padding-top: .1rem; }
html[data-rashi="flow"] .r-inter, html[data-rashi="inter"] .r-flow { display: none; }
html[data-rambam="flow"] .m-inter, html[data-rambam="inter"] .m-flow,
html[data-tanya="flow"] .y-inter, html[data-tanya="inter"] .y-flow { display: none; }
.tseg:last-child { border-bottom: 0; }
.tseg .il { margin-top: 0; }
.rambam-he { margin: 0; font-family: var(--he); font-size: calc(var(--he-size) * .86); line-height: 1.7; text-align: right; }
.rambam-he .cite { font-size: .72em; color: var(--muted); }
.rambam-en { margin: .5rem 0 .2rem; font-family: var(--en-text); font-size: calc(var(--en-size) * 1.08); line-height: 1.6; color: var(--ink); text-align: left; max-width: 38rem; margin-left: auto; }

/* perek dividers */
.perek-mark { display: flex; align-items: baseline; justify-content: center; gap: .6rem; margin: 1.6rem 0 .3rem; color: var(--muted); font-size: 1.05rem; }
.perek-mark .pm-en { font-size: .85rem; font-style: italic; font-family: var(--en-text); }
.perek { padding-top: .5rem; }
.perek-head { margin: 1.6rem 0 .1rem; text-align: center; font-weight: 400; display: flex; flex-direction: column; align-items: center; gap: .1rem; }
.perek-head .ph-he { font-size: calc(1.55rem * var(--scale)); font-weight: 700; }
.perek-head .ph-en { font-size: .88rem; font-style: italic; font-family: var(--en-text); color: var(--muted); }
.perek-head::after { content: ""; width: 2.5rem; height: 1px; background: var(--rule-strong); margin-top: .6rem; }

.pending { margin: .2rem 0 .3rem; font-size: .82rem; color: var(--muted); font-style: italic; font-family: var(--en-text); text-align: left; }

.nhe { font-size: 1.05rem; color: var(--ink); }
.nhe-in { font-size: 1.05em; }

/* day navigation at the end */
.daynav { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin: 2.5rem 0 0; padding-top: 1.25rem; border-top: 1px solid var(--rule); }
.dn { display: flex; flex-direction: column; gap: .1rem; padding: .7rem .2rem; min-height: 3.5rem; text-align: left; }
.dn.next { text-align: right; grid-column: 2; }
.dn-l { font-size: .85rem; font-style: italic; font-family: var(--en-text); color: var(--muted); }
.dn-d { font-size: 1rem; color: var(--ink); }
.dn.prev .dn-d::before { content: "‹ "; color: var(--muted); }
.dn.next .dn-d::after { content: " ›"; color: var(--muted); }

.colophon { max-width: calc(var(--measure) + 2 * var(--pad)); margin: 0 auto; padding: 1.5rem var(--pad) calc(2.5rem + env(safe-area-inset-bottom)); font-size: .78rem; line-height: 1.5; color: var(--muted); border-top: 1px solid var(--rule); }
.colophon p { margin: 0 0 .5rem; }

/* ---------- sheets (date picker, settings) ---------- */
.sheet { border: 0; padding: 0 0 calc(1rem + env(safe-area-inset-bottom)); margin: auto 0 0; width: 100%; max-width: 100%; max-height: 88vh; background: var(--bg); color: var(--ink);
  border-top: 1px solid var(--rule-strong); box-shadow: 0 -1px 0 var(--rule), 0 -6px 18px rgba(30,22,12,.07); }
.sheet::backdrop { background: rgba(20, 17, 12, .38); }
.sheet[open] { animation: rise .18s ease-out; }
@keyframes rise { from { transform: translateY(12px); opacity: .6; } to { transform: none; opacity: 1; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: .4rem .35rem 0 var(--pad); }
.sheet-head h2 { margin: 0; font-size: 1.05rem; font-weight: 600; letter-spacing: .01em; }
.close { width: 2.75rem; height: 2.75rem; display: grid; place-items: center; }
.close svg { width: 1.2rem; height: 1.2rem; stroke: currentColor; stroke-width: 1.6; fill: none; stroke-linecap: round; }
.sheet-sub { margin: 0 var(--pad) .5rem; font-size: .82rem; color: var(--muted); }
.days { list-style: none; margin: 0; padding: 0; }
.day { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .6rem var(--pad); min-height: 3.6rem; text-align: left; border-top: 1px solid var(--rule); position: relative; }
.day[aria-current="date"] { background: var(--press); }
.day[aria-current="date"]::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--ink); }
.day-l, .day-r { display: flex; flex-direction: column; gap: .1rem; }
.day-r { align-items: flex-end; text-align: right; }
.day-name { font-size: 1rem; font-weight: 600; }
.today-tag { margin-left: .45rem; font-size: .85rem; font-weight: 400; font-style: italic; font-family: var(--en-text); color: var(--muted); }
.day-date, .day-rm { font-size: .8rem; color: var(--muted); }
.day-he { font-size: 1.05rem; }
.opt { padding: .7rem var(--pad); border-top: 1px solid var(--rule); }
.opt-l { display: block; font-size: .85rem; color: var(--muted); margin-bottom: .45rem; }
.seg { display: flex; border: 1px solid var(--rule-strong); border-radius: 3px; overflow: hidden; }
.seg button { flex: 1 1 0; min-height: 2.75rem; padding: .3rem .4rem; font-size: .88rem; line-height: 1.2; color: var(--ink); }
.seg button + button { border-left: 1px solid var(--rule-strong); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.seg button:disabled { color: var(--faint); }
.seg .size-now { font-variant-numeric: tabular-nums; color: var(--muted); cursor: default; }
.seg .size-now:disabled { color: var(--muted); }
.a-s { font-size: .85rem; } .a-l { font-size: 1.25rem; }
.opt-foot { margin: .2rem var(--pad) .2rem; font-size: .78rem; color: var(--muted); }

/* ---------- tablet ---------- */
@media (min-width: 700px) {
  :root { --he-size: calc(1.8rem * var(--scale)); --en-size: calc(.86rem * var(--scale)); --rashi-he: calc(1.35rem * var(--scale)); --rashi-en: calc(1.02rem * var(--scale));
          --rambam-he: calc(1.6rem * var(--scale)); --chunk-min: 5.4rem; --pad: 2rem; --measure: 44rem; }
  .bar { padding: 0 .75rem; }
  .date-btn { flex: 0 1 auto; min-width: 15rem; flex-direction: row; gap: .75rem; }
  .date-en { font-size: .95rem; }
  .date-he { font-size: 1rem; }
  .part-head { padding: 2.75rem 0 2rem; }
  .title { font-size: calc(2.7rem * var(--scale)); }
  .ch { margin-left: .85rem; margin-bottom: 1.05rem; }
  /* verse numbers sit in the right margin, like a printed Chumash */
  .pasuk, .halacha { padding-right: 3rem; }
  .num { position: absolute; right: 0; top: 1.45rem; flex-direction: column; align-items: center; gap: .3rem; width: 2.2rem; }
  .num-he { font-size: 1.2rem; }
  .sheet { width: 26rem; max-width: calc(100vw - 2rem); margin: auto; border: 1px solid var(--rule-strong); max-height: 80vh; box-shadow: 0 10px 28px rgba(30,22,12,.10); }
}
/* ---------- desktop ---------- */
@media (min-width: 1100px) {
  :root { --he-size: calc(2rem * var(--scale)); --en-size: calc(.9rem * var(--scale)); --rashi-he: calc(1.45rem * var(--scale)); --rashi-en: calc(1.06rem * var(--scale));
          --rambam-he: calc(1.8rem * var(--scale)); --chunk-min: 5.8rem; --measure: 50rem; }
  .pasuk, .halacha { padding-right: 3.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (hover: hover) {
  .nav-btn:not(:disabled):hover, .date-btn:hover, .tab:hover, .day:hover, .dn:hover, .close:hover { background: var(--press); }
  .seg button:not([aria-pressed="true"]):not(:disabled):hover { background: var(--press); }
}

/* ---------- print (US Letter) ---------- */
@page { size: Letter; margin: .6in .6in .7in; }
@media print {
  :root, html[data-theme] { --bg: #fff; --ink: #000; --gloss: #3d3a35; --muted: #55514a; --faint: #77736b; --rule: #d8d3c8; --rule-strong: #bdb6a8; --accent: #7a2618;
    --he-size: 17pt; --en-size: 7.6pt; --rashi-he: 12.5pt; --rashi-en: 9pt; --rambam-he: 15pt; --chunk-min: 50pt; --scale: 1; }
  html, body { background: #fff !important; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .masthead, .daynav, .away, .skip, .jump, dialog { display: none !important; }
  html[data-tab] .part.chumash, html[data-tab] .part.rambam, html[data-tab] .part.tanya { display: block !important; }
  main { max-width: none; padding: 0; min-height: 0; }
  .part.rambam, .part.tanya { break-before: page; }
  .part-head { padding: 0 0 12pt; }
  .title { font-size: 24pt; }
  .subtitle { font-size: 14pt; }
  .en-title { font-size: 10pt; }
    .dl-en { font-size: 7.5pt; }
  .pasuk, .halacha { padding: 7pt 26pt 8pt 0; break-inside: auto; }
  .num { position: absolute; right: 0; top: 9pt; flex-direction: column; align-items: center; gap: 2pt; width: 18pt; }
  .num-he { font-size: 11pt; }
  .num-en { font-size: 6pt; }
  .ch { break-inside: avoid; margin: 0 0 5pt 6pt; }
  .rashi { break-inside: avoid; padding-right: 8pt; }
  .rashi-en { font-size: 9pt; max-width: none; }
  .perek-head { break-after: avoid; margin-top: 12pt; }
  .perek-mark { break-after: avoid; }
  .colophon { border: 0; padding: 14pt 0 0; font-size: 7.5pt; break-inside: avoid; }
}
.colophon a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; text-decoration-color: var(--rule); }
.colophon a:hover { text-decoration-color: currentColor; }
@media screen { .colophon a { display: inline-block; padding: 13px 0; margin: -13px 0; } }

/* a quiet label where Rashi begins (once per run of Rashi comments) */
.rashi-label { display: flex; flex-direction: row-reverse; align-items: baseline; gap: .4rem; margin: 0 0 .3rem; line-height: 1; color: var(--muted); }
.rashi-label .rl-he { font-family: var(--he); font-size: .9rem; font-weight: 500; }
.rashi-label .rl-en { font-family: var(--en-text); font-style: italic; font-size: .8125rem; color: var(--gloss); }
@media print { .rashi-label { margin-bottom: 2pt; } .rashi-label .rl-he { font-size: 8.5pt; } .rashi-label .rl-en { font-size: 6.5pt; } }

/* ---------- Shnayim Mikra ---------- */
.sm-resume { margin: 1.1rem 0 0; display: flex; flex-direction: column; align-items: center; gap: 0; }
.sm-resume[hidden] { display: none; }
.sm-resume .linkish { font-family: var(--en-text); font-size: .98rem; }
.resume-at { font-size: .82rem; font-style: italic; font-family: var(--en-text); color: var(--muted); margin-top: -.35rem; }
.al-list { list-style: none; margin: 1.3rem auto 0; padding: 0; max-width: 24rem; border-top: 1px solid var(--rule); text-align: left; }
.al-list li { border-bottom: 1px solid var(--rule); }
.al-row { width: 100%; min-height: 2.9rem; display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: .75rem; padding: .2rem .35rem; text-align: left; }
.al-he { order: 3; font-size: 1.1rem; text-align: right; color: var(--ink); min-width: 4.2rem; }
.al-en { order: 1; display: flex; align-items: baseline; gap: .6rem; line-height: 1.25; flex-wrap: wrap; }
.al-name { font-family: var(--en-text); font-size: .95rem; color: var(--ink); }
.al-range { font-size: .78rem; color: var(--muted); }
.al-state { order: 2; justify-self: end; font-family: var(--en-text); font-style: italic; font-size: .8rem; color: var(--muted); }
.al-list li.done .al-name, .al-list li.done .al-he { color: var(--muted); }
.al-list li.done .al-state::before { content: ""; display: inline-block; width: .55rem; height: .3rem; border: solid currentColor; border-width: 0 0 1px 1px; transform: translateY(-.2rem) rotate(-45deg); margin-right: .4rem; }
.sm-tools { margin: .9rem 0 0; }
.sm-tools .linkish { font-family: var(--en-text); font-size: .85rem; color: var(--muted); text-decoration-color: var(--rule-strong); }
.aliyah-mark { display: flex; flex-direction: column; align-items: center; gap: .05rem; margin: 2.2rem 0 .2rem; padding-bottom: .7rem; border-bottom: 1px solid var(--rule-strong); }
.aliyah-mark .am-he { font-size: calc(1.4rem * var(--scale)); font-weight: 700; }
.aliyah-mark .am-en { font-size: .85rem; font-style: italic; font-family: var(--en-text); color: var(--muted); }
.sm-pasuk, .stoppable { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.sm-pasuk .num { margin-bottom: .35rem; }
.stop-btn { display: inline-flex; flex-direction: row-reverse; align-items: center; gap: .55rem; min-height: 2.75rem; min-width: 2.75rem; margin: -.8rem 0 -.6rem; padding: 0 0 0 .25rem; }
.stop-mark { display: none; font-family: var(--en-text); font-style: italic; font-size: .8rem; color: var(--accent); }
.sm-pasuk.stopped .stop-mark, .stoppable.stopped .stop-mark { display: inline; }
.sm-pasuk.stopped::before, .stoppable.stopped::before { content: ""; position: absolute; right: -.7rem; top: 1.1rem; bottom: 1.15rem; width: 2px; background: var(--accent); opacity: .55; }
.sm-il .ch .h, .sm-he { font-family: var(--mikra); }
.sm-il .ch .h { line-height: 1.55; }
.sm-he { margin: 0; font-size: calc(var(--he-size) * .92); line-height: 1.85; text-align: right; color: var(--ink); }
.sm-second { margin-top: .55rem; padding-top: .55rem; border-top: 1px dotted var(--rule-strong); }
html[data-smen="inter"] .sm-first .sm-plain, html[data-smen="off"] .sm-first .sm-il { display: none; }
.sm-il .ch { margin-bottom: .8rem; }
.sm-onk { margin: .65rem 0 0; font-family: var(--he); font-size: calc(var(--he-size) * .7); line-height: 1.8; color: var(--gloss); text-align: right; }
.onk-l { font-size: .78em; color: var(--muted); font-weight: 500; margin-left: .2rem; }
.sm-onk .var { font-size: .85em; color: var(--muted); }
.kri { font-size: .9em; color: var(--muted); }
.pet { font-family: var(--he); font-size: .75em; color: var(--muted); }
.al-end { display: flex; flex-direction: column; align-items: center; gap: 0; padding: 1.4rem 0 .6rem; }
.done-btn { min-height: 2.75rem; padding: 0 1.2rem; border: 1px solid var(--rule-strong); border-radius: 2px; font-family: var(--en-text); font-size: .95rem; color: var(--ink); }
.al-end.done .done-btn { border-color: transparent; color: var(--muted); font-style: italic; cursor: default; }
.al-end .undo { font-size: .82rem; color: var(--muted); }
.al-end .undo[hidden] { display: none; }
.sm-src { margin: 2rem 0 0; font-size: .8rem; color: var(--muted); font-style: italic; font-family: var(--en-text); text-align: center; }
@media (hover: hover) { .done-btn:not([aria-pressed="true"]):hover, .al-row:hover { background: var(--press); } }
@media (max-width: 380px) { .tab-en-x { display: none; } }
@media (min-width: 700px) {
  .stop-btn { flex-direction: column; gap: .3rem; margin: 0; padding: 0; min-height: 2.75rem; }
  .stop-mark { position: absolute; left: 0; top: -1.15rem; white-space: nowrap; font-size: .78rem; }
  .sm-pasuk.stopped::before, .stoppable.stopped::before { right: -.55rem; }
}
.tnum { position: static !important; width: auto !important; margin: 0; display: block; }
.tnum .stop-btn { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); margin: 0; padding: 0; }
.tseg.stopped .tnum .stop-btn, .tnum .stop-btn:focus-visible { position: static; width: auto; height: auto; overflow: visible; clip: auto; min-height: 2rem; margin: -.5rem 0 .1rem; }
.tnum .stop-mark { position: static !important; }
.day-resume { margin-top: .9rem; }
@media print { .part.shnayim { display: none !important; } .stop-mark, .day-resume { display: none !important; } .stopped::before { display: none !important; } }
