/* Shared reading typography for Chumash, Mishnah and Bavli. */
@import url('https://fonts.googleapis.com/css2?family=Frank+Ruhl+Libre:wght@400;500;600&display=swap');
body :is(.interlinear-words,.interlinear){display:flex;flex-wrap:wrap;direction:rtl;gap:10px 13px;align-items:flex-start;justify-content:flex-start}
body :is(.interlinear-word,.word){display:flex;flex-direction:column;position:relative;min-width:0;max-width:155px;text-align:center}
body :is(.interlinear-hebrew,.word .he){font:500 31px/1.28 'Frank Ruhl Libre','Times New Roman',serif;color:#211c15;margin:0;white-space:normal}
body :is(.interlinear-english,.word .en){font:15px/1.2 Georgia,'Times New Roman',serif;direction:ltr;unicode-bidi:isolate;color:#514633;position:relative;width:auto;min-width:0;max-width:none;margin:0;text-wrap:balance}
body :is(.interlinear-word,.word):not(:last-child) :is(.interlinear-english,.en)::after{content:'‹';position:absolute;left:-12px;top:-1px;color:#9c8968;font:21px/1 Georgia,serif;pointer-events:none}
body .interlinear-direction{display:none}
body .reader-page .interlinear-text,body .reader-page .daf-segment .interlinear-text{padding:8px 0 10px;border:0;background:transparent;border-radius:0}
body .reader-page .reader-title{padding:12px 0 10px;margin-bottom:12px}
body .reader-title>span,body .folio-title h1{font:600 40px/1.1 'Frank Ruhl Libre','Times New Roman',serif}
body .reader-title h1,body .folio-title #reading-title{font:21px/1.2 Georgia,serif;margin:5px 0}
body .reader-page .reader-controls{padding:10px 0;margin-bottom:12px;gap:12px}
body .reader-page .reader-controls select{min-height:36px;padding:7px 10px;font:14px Georgia,serif}
body .reader-page .study-layout{padding-top:12px;gap:24px}
body .reader-page .daf-segment{margin-bottom:12px}
body .reader-page .daf-segment-heading{padding-top:8px;margin:8px 0 5px;border-top:1px solid #b8aa9080}
body .reader-page .daf-segment-heading h2{font:12px Georgia,serif;color:#796c55}
body .reader-page .study-small,body .reader-page .edition-note{font-size:11px;line-height:1.45}
body .study-corpora{display:flex;justify-content:center;gap:0;margin:10px 0 14px}
body .study-corpora a{padding:6px 18px;border:1px solid #99886d;border-radius:0;font:14px Georgia,serif;color:#625541;text-decoration:none}
body .study-corpora a+a{border-left:0}
body .study-corpora [aria-current]{background:#2d261c;color:#faf4e7}
@media(max-width:700px){body :is(.interlinear-hebrew,.word .he){font-size:28px}body :is(.interlinear-english,.word .en){font-size:14px}body :is(.interlinear-word,.word){max-width:125px}body :is(.interlinear-words,.interlinear){row-gap:9px}body .reader-title>span,body .folio-title h1{font-size:34px}body .reader-title h1,body .folio-title #reading-title{font-size:18px}}

/* Shared folio shell for Chumash, Nevi'im, Ketuvim, Mishnah, and Bavli.
   Keep selectors scoped and more specific than the legacy reader styles. */
:root {
  --reader-ink: #241f18;
  --reader-muted: #74644c;
  --reader-rule: #b8aa90;
  --reader-paper: #f6f0e2;
  --reader-control: #fbf6ea;
  --reader-width: 1200px;
}
body .reader-masthead {
  box-sizing: border-box; display: flex; align-items: center; justify-content: space-between;
  max-width: none; width: 100%; height: 78px; margin: 0;
  padding: 0 max(24px, calc((100% - var(--reader-width)) / 2));
  border-bottom: 3px double #6d604b; background: var(--reader-paper);
  color: var(--reader-ink);
}
body .reader-brand {
  display: flex; align-items: center; gap: 18px; color: var(--reader-ink);
  font: 27px/1 Georgia, serif; text-decoration: none;
}
body .reader-brand-subtitle { display: block; margin-top: 6px; font: 9px/1 Georgia, serif; letter-spacing: 3px; }
body .reader-brand-hebrew { font: 30px 'Frank Ruhl Libre', serif; padding-left: 18px; border-left: 1px solid var(--reader-rule); }
body .reader-masthead nav { display: flex; align-items: center; gap: 24px; padding: 0; }
body .reader-masthead nav a { display: flex; align-items: center; min-height: 44px; color: #625541; font: 14px Georgia, serif; text-decoration: none; }
body .reader-masthead nav a:hover { text-decoration: underline; }
body .reader-page:has(.study-layout), body .bible-reader-heading, body.bible-reader > main {
  box-sizing: border-box; width: calc(100% - 48px); max-width: var(--reader-width);
  margin-inline: auto; padding-inline: 0;
}
body .reader-page:has(.study-layout), body .bible-reader-heading { padding-top: 18px; }
body .reader-utility { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 36px; }
body .reader-utility .breadcrumbs { margin: 0; color: var(--reader-muted); font: 12px/1.4 Georgia, serif; }
body .reader-print-link { display: inline-flex; align-items: center; min-height: 44px; color: #73552b; font: 13px Georgia, serif; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
body .study-corpora { display: flex; flex-wrap: wrap; justify-content: center; gap: 0; padding: 0; margin: 10px 0 16px; }
body .study-corpora a { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 6px 20px; box-sizing: border-box; }
body .study-corpora a:hover { background: #e9dfcc; color: var(--reader-ink); }
body .study-corpora a[aria-current] { background: #2d261c; color: #faf4e7; }
body .reader-page .reader-title, body .folio-title {
  position: relative; display: flex; flex-direction: column; align-items: center;
  gap: 0; padding: 14px 48px; margin: 0;
  border-block: 4px double #514432; color: var(--reader-ink); text-align: center;
}
body .reader-title > div { display: flex; flex-direction: column; align-items: center; }
body .reader-title > span, body .folio-title h1 { order: -1; margin: 0; font: 600 40px/1.1 'Frank Ruhl Libre', Georgia, serif; color: var(--reader-ink); }
body .reader-title .eyebrow, body .folio-title .eyebrow { display: block; margin: 7px 0 4px; font: 10px/1.4 Georgia, serif; letter-spacing: 1.5px; text-transform: uppercase; color: var(--reader-muted); }
body .reader-title h1, body .folio-title #reading-title { margin: 4px 0 0; font: 21px/1.2 Georgia, serif; letter-spacing: 0; color: var(--reader-ink); }
body .reader-title::before, body .reader-title::after, body .folio-title::before, body .folio-title::after { top: 50%; transform: translateY(-50%); font: 24px/1 Georgia, serif; }
body .reader-title::before, body .folio-title::before { left: 20px; }
body .reader-title::after, body .folio-title::after { right: 20px; }
body .reader-controls, body .reader-page .reader-controls {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: flex-start;
  gap: 12px; padding: 14px 0; margin: 0 0 12px;
  border: 0; border-bottom: 1px solid var(--reader-rule); border-radius: 0; background: transparent;
}
body .reader-controls > label { display: flex; flex-direction: column; gap: 5px; flex: 0 1 auto; font: 12px/1.3 Georgia, serif; text-transform: none; letter-spacing: 0; color: #65563e; }
body .reader-controls select, body .reader-page .reader-controls select {
  box-sizing: border-box; width: 100%; min-width: 100px; max-width: 260px; min-height: 44px;
  padding: 8px 28px 8px 10px; border: 1px solid #ad9c7f; border-radius: 0;
  background: var(--reader-control); color: var(--reader-ink); font: 14px Georgia, serif;
}
body .reader-controls .language-control { display: flex; align-self: flex-end; margin-left: auto; border: 1px solid #ad9c7f; border-radius: 0; }
body .reader-controls .language-control button { min-height: 42px; padding: 8px 14px; font: 13px Georgia, serif; }
body .reader-page .study-layout { grid-template-columns: minmax(0,1fr) 240px; gap: 24px; padding-top: 12px; }
body .reader-page .study-text { min-width: 0; padding-left: 0; border-left: 0; }
body.bible-reader > main { max-width: 936px; }
body.bible-reader { padding-bottom: calc(90px + env(safe-area-inset-bottom)); }
body.bible-reader .status {
  position: fixed; inset: auto 0 0; min-height: 64px; z-index: 40;
  border: 0; border-top: 3px double #8c795a; padding: 12px 24px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
  background: #eee4d1; color: #3e3220; gap: 12px; font: 12px/1.4 Georgia, serif;
}
body.bible-reader .status progress { appearance: none; border: 0; border-radius: 0; height: 4px; background: #d6c8ab; }
body.bible-reader .status progress::-webkit-progress-bar { background: #d6c8ab; }
body.bible-reader .status progress::-webkit-progress-value { background: #77603d; }
body.bible-reader .status progress::-moz-progress-bar { background: #77603d; }
body.bible-reader .reading-tools { justify-content: space-between; border: 0; padding: 0 0 12px; }
body.bible-reader .reading-tools button, body .continuous-next button { min-height: 44px; border: 1px solid #ad9c7f; border-radius: 0; background: var(--reader-control); font: 13px Georgia, serif; color: #52432d; }
body .reading-unit:first-child > .reading-boundary { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); }
body .reading-unit + .reading-unit { border-color: var(--reader-rule); }
body .reading-unit h3, body .reader-page .daf-segment-heading h2 { font: 12px/1.4 Georgia, serif; color: var(--reader-muted); }
body .bible-reader-heading + main .hebrew { font: 500 31px/1.55 'Frank Ruhl Libre', Georgia, serif; }
body :is(.interlinear-word,.word):not(:last-child) :is(.interlinear-english,.en)::after { direction: ltr; }
body .reader-page .reader-status { padding: 10px 0; }
body .reader-page .bookmark { border-color: var(--reader-rule); border-radius: 0; color: #65563e; font-family: Georgia, serif; }
body .continuous-unit.is-continuation .reader-utility { display: none; }
body .reader-skip-link { position: absolute; left: 12px; top: -100px; z-index: 100; padding: 12px; background: var(--reader-paper); }
body .reader-skip-link:focus { top: 8px; }
@media (max-width: 700px) {
  body .reader-masthead { height: 68px; padding-inline: 16px; }
  body .reader-masthead nav { gap: 16px; }
  body .reader-brand { font-size: 24px; gap: 12px; }
  body .reader-brand-hebrew { font-size: 26px; padding-left: 12px; }
  body .reader-page:has(.study-layout), body .bible-reader-heading, body.bible-reader > main { width: calc(100% - 32px); }
  body .reader-page:has(.study-layout), body .bible-reader-heading { padding-top: 10px; }
  body .reader-utility { gap: 8px; }
  body .reader-utility .breadcrumbs { font-size: 11px; }
  body .study-corpora a { flex: 1 1 0; min-width: 0; padding: 6px 5px; font-size: 12px; }
  body .reader-page .reader-title, body .folio-title { padding: 12px 36px; }
  body .reader-title > span, body .folio-title h1 { font-size: 34px; }
  body .reader-title h1, body .folio-title #reading-title { font-size: 18px; }
  body .reader-controls > label, body .reader-controls > label:first-child, body .reader-controls > label:not(:first-child) { flex: 1 1 28%; min-width: 0; }
  body .reader-controls select, body .reader-page .reader-controls select { min-width: 0; max-width: none; }
  body .reader-controls .language-control { margin-left: 0; }
  body .reader-page .study-layout { grid-template-columns: minmax(0,1fr); }
  body .reader-page .study-figures-toggle { top: auto; bottom: calc(116px + env(safe-area-inset-bottom)); }
  body .reader-page .study-figures { top: 80px; bottom: calc(170px + env(safe-area-inset-bottom)); }
  body.bible-reader .status { padding-inline: 16px; gap: 6px 10px; font-size: 11px; }
  body.bible-reader .status #status { flex-basis: 100%; text-align: center; }
  body .bible-reader-heading + main .hebrew { font-size: 28px; }
}
@media (max-width: 360px) {
  body .reader-brand-hebrew { display: none; }
  body .study-corpora a { font-size: 11px; }
}
@media print {
  body .reader-masthead, body .reader-utility, body .reader-skip-link, body .study-corpora, body.bible-reader .status { display: none; }
  body.bible-reader { padding: 0; }
  body .reader-page:has(.study-layout), body .bible-reader-heading, body.bible-reader > main { width: 100%; max-width: none; padding: 0; }
}

@font-face{font-family:'Torah Folio Display';src:url('/brand/fonts/TorahFolio-Display.woff2?v=2') format('woff2');font-weight:400;font-style:normal;font-display:swap}

/* Torah.Study: one domain wordmark with a Hebrew publisher's seal. */
body a.torah-logo{display:inline-flex;align-items:center;gap:11px;min-height:49px;color:#2c2419;text-decoration:none;white-space:nowrap;flex-shrink:0}
body .torah-logo-mark{display:block;width:42px;height:49px;flex-shrink:0;object-fit:contain}
body .torah-logo-wordmark{font:400 34px/1.15 'Torah Folio Display',Georgia,serif;letter-spacing:normal;font-kerning:normal;font-synthesis:none;padding-bottom:4px;border-bottom:1px solid #79623d66}
body .about-page>h1{font-family:'Torah Folio Display',Georgia,serif;font-weight:400;letter-spacing:normal;font-kerning:normal;font-synthesis:none}
body .torah-logo-dot{color:#000}
body .torah-logo-study{font-style:normal;font-weight:400}
body a.torah-logo:hover{color:#79623d}
body a.torah-logo:focus-visible{outline:2px solid #79623d;outline-offset:5px}
body .footer-top>a.torah-logo{font-size:inherit;color:#2c2419;gap:11px}
@media(max-width:700px){
 body a.torah-logo{gap:7px;min-height:44px}
 body .torah-logo-mark{width:32px;height:38px}
 body .torah-logo-wordmark{font-size:28px}
}
@media(max-width:420px){body .reader-masthead nav{gap:12px}body .reader-masthead nav a{font-size:12px}}

/* Compact masthead: the linked invitation sits beneath the domain wordmark. */
body .reader-masthead{display:flex;justify-content:space-between;gap:16px;height:104px}
body .reader-brand-lockup{display:flex;flex-direction:column;align-items:flex-start}
body .reader-motto{display:flex;flex-direction:row-reverse;align-items:start;justify-content:center;gap:15px;align-self:stretch;margin:0 0 0 53px;min-height:38px;color:#241f18;text-decoration:none}
body .reader-motto .motto-pair{display:flex;flex-direction:column;align-items:center;position:relative}
body .reader-motto .motto-he{font:600 20px/1.05 'Frank Ruhl Libre',Georgia,serif}
body .reader-motto .motto-en{position:relative;font:11px/1.3 Georgia,serif;color:inherit}
body .reader-motto .motto-pair:first-child .motto-en::after{content:'‹';position:absolute;left:-11px;top:-2px;font:16px/1 Georgia,serif}
body .reader-motto:focus-visible{outline:2px solid #79623d;outline-offset:3px}
body .reader-motto:hover{text-decoration:underline;text-underline-offset:3px}
body .reader-masthead nav .reader-print-icon{display:grid;place-items:center;width:44px;height:44px;color:#74644c}
body .reader-masthead nav .reader-print-icon:hover{color:#241f18;background:#e9dfcc}
@media(max-width:700px){body .reader-masthead{height:96px;min-height:96px;padding-block:4px}body .reader-motto{margin-left:39px;margin-top:0}body .reader-motto .motto-he{font-size:18px}}
@media print{body .reader-masthead{display:none}}

/* Shared frame and control sizes across all three readers. */
body .reader-page .reader-title,body .folio-title{box-sizing:border-box;min-height:136px;justify-content:center}
body .reader-controls select,body .reader-page .reader-controls select{height:44px;min-height:44px}
body .reader-controls .language-control{box-sizing:border-box;height:44px}
body .reader-controls .language-control button{box-sizing:border-box;height:42px;min-height:42px}
body .developer-label{font:11px/1.3 Georgia,serif;color:#74644c;border:1px solid #b8aa90;padding:5px 8px}
.public-site .developer-label,.public-site .preparation-dock,.public-site body.bible-reader .status{display:none!important}
.public-site body,.public-site body.bible-reader{padding-bottom:env(safe-area-inset-bottom)}
@media(max-width:700px){
 .public-site body .reader-page .study-figures-toggle{bottom:calc(16px + env(safe-area-inset-bottom))}
 .public-site body .reader-page .study-figures{bottom:calc(70px + env(safe-area-inset-bottom))}
 body .developer-label{max-width:70px;text-align:center;font-size:10px}
}

/* All reading entry points share the same width and header stack. */
body .reader-page{box-sizing:border-box;width:calc(100% - 48px);max-width:var(--reader-width);margin-inline:auto;padding:18px 0 24px}
body .reader-utility{min-height:36px}
body .reader-page .reader-title,body .folio-title{min-height:160px}
body .reader-title .reader-calendar-date{margin:5px 0 0;font:12px/1.3 Georgia,serif;color:var(--reader-muted);letter-spacing:0;text-transform:none}
body .reader-page .reader-controls .language-control{width:auto}
@media(max-width:700px){
 body .reader-page,body .reader-page:has(.study-layout){width:calc(100% - 32px);padding-top:10px}
 body .reader-page .reader-controls .language-control{flex:1 0 100%;width:100%;margin:0}
 body .reader-page .reader-controls .language-control button{flex:1;padding-inline:6px}
 body .reader-page .reader-controls select{padding-left:8px;padding-right:22px;font-size:13px}
 body .reader-title .reader-calendar-date{font-size:11px}
}

/* Three source selectors form one consistent row; formats have their own row. */
body .reader-page .reader-controls{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
body .reader-page .reader-controls>label{min-width:0;width:100%}
body .reader-page .reader-controls select{width:100%;min-width:0;max-width:none;text-overflow:ellipsis}
body .reader-page .reader-controls .language-control{grid-column:1/-1;justify-self:stretch;width:100%;margin:0}
body .reader-page .reader-controls .language-control button{flex:1}

/* Reading preferences affect source text and glosses, not the page furniture. */
:root{--reader-text-scale:1;--reader-english-scale:1;--reader-layout-scale:1;--reader-word-spacing:1;--reader-line-spacing:1;--reader-he-size:2.2143rem;--reader-en-size:1.0714rem}
body.bible-reader{--reader-he-size:1.9375rem;--reader-en-size:.9375rem}
body .reader-text-settings{grid-column:1/-1;display:block;flex-basis:100%;width:100%;min-width:0;font:13px/1.4 Georgia,serif;color:var(--reader-muted)}
body .reader-text-settings>summary{display:flex;align-items:center;justify-content:flex-end;gap:10px;list-style:none;min-height:44px;width:fit-content;margin-left:auto;padding:4px 2px;box-sizing:border-box;cursor:pointer;color:var(--reader-ink)}
body .reader-text-settings>summary::-webkit-details-marker{display:none}
body .reader-text-settings>summary::after{content:'';width:6px;height:6px;flex:none;border-right:1px solid currentColor;border-bottom:1px solid currentColor;transform:translateY(-2px) rotate(45deg);margin:0 3px}
body .reader-text-settings[open]>summary::after{transform:translateY(2px) rotate(225deg)}
body .reader-text-settings[data-modified="true"]>summary{font-weight:600;text-decoration:underline;text-underline-offset:4px}
body .reader-settings-panel{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 32px;border-top:1px solid var(--reader-rule);padding:16px 0 4px;max-width:720px;margin-left:auto;box-sizing:border-box}
body .reader-setting{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 12px;align-items:center;min-width:0;margin:0;color:var(--reader-ink);font:13px/1.4 Georgia,serif}
body .reader-setting-label{min-width:0}
body .reader-setting-value{font-variant-numeric:tabular-nums;text-align:right;min-width:4ch;color:var(--reader-muted)}
body .reader-setting-control{grid-column:1/-1;display:flex;align-items:center;width:100%;min-width:0;direction:ltr}
body .reader-setting-control input{display:block;width:100%;min-width:0;min-height:36px;margin:0;padding:0;accent-color:var(--reader-ink);cursor:pointer;box-sizing:border-box}
body .reader-text-settings button{min-height:44px;padding:8px 14px;border:1px solid var(--reader-rule);background:var(--reader-control);color:var(--reader-ink);font:13px/1.3 Georgia,serif;cursor:pointer}
body .reader-settings-reset{grid-column:1/-1;justify-self:end}
body .reader-text-settings button:disabled{opacity:.45;cursor:default}
body .reader-text-settings :is(summary,button,input):focus-visible{outline:2px solid #79623d;outline-offset:3px}
body .reader-page .reader-status{justify-content:flex-end}
body :is(.interlinear-hebrew,.word .he){font-size:calc(var(--reader-he-size)*var(--reader-text-scale));overflow-wrap:anywhere}
body :is(.interlinear-english,.word .en){font-size:calc(var(--reader-en-size)*var(--reader-english-scale));line-height:max(1.08,calc(1.2*var(--reader-line-spacing)));overflow-wrap:anywhere}
body :is(.interlinear-word,.word){max-width:min(100%,calc(155px*var(--reader-layout-scale)))}
body :is(.interlinear-words,.interlinear){--reader-column-gap:max(calc(5px*var(--reader-english-scale)),calc(13px*var(--reader-layout-scale)*var(--reader-word-spacing)));column-gap:var(--reader-column-gap);row-gap:calc(10px*var(--reader-layout-scale)*var(--reader-line-spacing))}
body :is(.interlinear-word,.word):not(:last-child) :is(.interlinear-english,.en)::after{left:calc(-1*var(--reader-column-gap));width:var(--reader-column-gap);text-align:center;font-size:clamp(calc(13px*var(--reader-english-scale)),calc(21px*var(--reader-english-scale)*var(--reader-word-spacing)),calc(21px*var(--reader-english-scale)))}
body .reader-page .hebrew-text,body .bible-reader-heading+main .hebrew{font-size:calc(var(--reader-he-size)*var(--reader-text-scale));line-height:max(1.35,calc(1.65*var(--reader-line-spacing)));overflow-wrap:anywhere;word-spacing:calc((var(--reader-word-spacing) - 1)*.15em)}
body .reader-page .english-text{font-size:calc(1.2143rem*var(--reader-english-scale));line-height:max(1.25,calc(1.8*var(--reader-line-spacing)));overflow-wrap:anywhere;word-spacing:calc((var(--reader-word-spacing) - 1)*.15em)}
/* Compact spacing retains only the room needed for the reading arrows. */
body .reader-page .interlinear-text,body .reader-page .daf-segment .interlinear-text{padding-block:calc(8px*var(--reader-line-spacing)) calc(10px*var(--reader-line-spacing))}
body .reader-page .daf-segment{margin-bottom:calc(12px*var(--reader-line-spacing))}
body.bible-reader #passages article{padding-block:calc(10px*var(--reader-line-spacing))}
/* Remove the fixed space above a passage when line spacing is at its minimum. */
:root{--reader-block-spacing:min(1,var(--reader-line-spacing))}
body .reader-page .reader-controls{padding-bottom:calc(10px*var(--reader-block-spacing));margin-bottom:calc(12px*var(--reader-block-spacing))}
body .reader-page .study-layout{padding-top:calc(12px*var(--reader-block-spacing))}
body .reader-page .reader-status{padding-block:calc(10px*var(--reader-block-spacing))}
body .reader-page .daf-segment-heading{padding-top:calc(8px*var(--reader-block-spacing));margin-top:calc(8px*var(--reader-block-spacing));margin-bottom:calc(5px*var(--reader-block-spacing))}
body .reader-page .hebrew-text{margin-top:calc(15px*var(--reader-block-spacing))}
body .reader-page .english-text{margin-top:calc(20px*var(--reader-block-spacing))}
body .reader-page .daf-segment .hebrew-text{padding-block:calc(20px*var(--reader-block-spacing))}
body .reader-page .text-columns>section{padding-top:calc(32px*var(--reader-block-spacing))}
body .reader-page .weekly-aliyah{margin-block:calc(32px*var(--reader-block-spacing))}
body .reader-page .weekly-aliyah>h2{padding-bottom:calc(12px*var(--reader-block-spacing))}
body .reader-page .weekly-aliyah>h2 small{margin-top:calc(8px*var(--reader-block-spacing))}
body .bavli-niqqud-control{margin-top:calc(-8px*var(--reader-block-spacing));margin-bottom:calc(16px*var(--reader-block-spacing))}
body .reader-page .nach-reading-links{margin-bottom:calc(20px*var(--reader-block-spacing))}
body.bible-reader #passages{padding-top:calc(8px*var(--reader-block-spacing))}
body.bible-reader .reading-unit article>:is(h2,h3){margin-top:0;margin-bottom:calc(5px*var(--reader-block-spacing))}
body.bible-reader .reading-unit+.reading-unit{margin-top:calc(30px*var(--reader-block-spacing));padding-top:calc(12px*var(--reader-block-spacing))}
body.bible-reader .reading-unit:not(:first-child)>.reading-boundary{padding-block:calc(12px*var(--reader-block-spacing)) calc(18px*var(--reader-block-spacing));margin-bottom:calc(5px*var(--reader-block-spacing))}
body.bible-reader .chumash-source :is(.hebrew,.english-text){margin-top:calc(4px*var(--reader-block-spacing))}
@media(max-width:700px){
 :root{--reader-he-size:2rem;--reader-en-size:1rem}
 body.bible-reader{--reader-he-size:1.75rem;--reader-en-size:.875rem}
 body .reader-page :is(.interlinear-text,.hebrew-text,.english-text),body.bible-reader #passages{box-sizing:border-box;width:100%;max-width:var(--reader-visible-width,100%)}
 body .reader-settings-panel{gap:12px 24px}
}
@media(max-width:480px){body .reader-settings-panel{grid-template-columns:minmax(0,1fr);gap:10px}body .reader-setting-control input{min-height:44px}}
@media(max-width:600px){body .reader-page .text-columns>section{padding-top:calc(25px*var(--reader-block-spacing))}}
@media print{body .reader-text-settings{display:none}}

/* Narrow phones: wrap footer links instead of widening the reading page. */
@media(max-width:700px){
 body .footer-top{display:flex;flex-wrap:wrap;gap:14px 20px;align-items:center}
 body .footer-top>p{flex-basis:100%;min-width:0}
 body .footer-top>a{max-width:100%;white-space:normal;overflow-wrap:anywhere}
 body .reader-page .text-columns{grid-template-columns:minmax(0,1fr)}
 body .reader-page .text-columns>section{min-width:0}
 body .nach-reading-links{display:flex;flex-wrap:wrap;gap:12px;justify-content:space-between}
 body .nach-reading-links a{min-height:44px;display:inline-flex;align-items:center}
}

/* Keep each Chumash chapter:verse readable in chapter and weekly readers. */
body :is(.reading-unit,.weekly-reader) .chumash-verse-reference{display:inline-block;font-size:max(14px,calc(16px*var(--reader-layout-scale,1)));font-weight:600;line-height:1.4;color:var(--reader-ink,#241f18);direction:ltr;unicode-bidi:isolate;text-decoration:none}
body :is(.reading-unit,.weekly-reader) .chumash-verse-reference:hover{text-decoration:underline}

/* Let every reader use the window, with the same small gutter on both sides. */
@media screen{
 body .reader-page,body .reader-page:has(.study-layout),
 body .bible-reader-heading,body.bible-reader > main{
  box-sizing:border-box;width:calc(100% - 32px);max-width:none;
  margin-inline:auto;padding-inline:0;
 }
 body:has(.reader-page) .reader-masthead,body.bible-reader .reader-masthead{padding-inline:16px}
}

/* Passage numbers share the first text row instead of adding a heading row. */
body .reader-page .daf-segment,
body.bible-reader #passages .reading-unit article:has(> .chumash-source){
 display:grid;grid-template-columns:64px minmax(0,1fr);column-gap:12px;
 align-items:start;direction:ltr;border-top:1px solid #b8aa9080;padding-top:0;
}
body .reader-page .daf-segment > :not(.daf-segment-heading),
body.bible-reader #passages .reading-unit article > :not(h3){grid-column:2;min-width:0}
body .reader-page .daf-segment > .daf-segment-heading,
body.bible-reader #passages .reading-unit article:has(> .chumash-source) > h3{
 grid-column:1;grid-row:1;display:block;align-self:start;
 margin:0;padding:4px 0 0;border:0;min-width:0;text-align:left;
}
body .reader-page .daf-segment-heading :is(h2,h3),
body :is(.reading-unit,.weekly-reader) .chumash-verse-reference,
body.bible-reader #passages .reading-unit article > h3{
 margin:0;font:13px/1.35 Georgia,serif;color:var(--reader-muted,#796c55);
}
body .passage-number{display:block;unicode-bidi:isolate;overflow-wrap:anywhere}
body .passage-number[lang="he"]{font-size:11px;text-align:left}
body .reader-page .daf-segment > :is(.interlinear-text,.hebrew-text,.english-text,.chumash-source,.text-columns),
body .reader-page .daf-segment > .chumash-source > :is(.interlinear-text,.hebrew-text,.english-text),
body.bible-reader #passages .reading-unit article > .chumash-source > :is(.hebrew,.english-text){margin-top:0;padding-top:0}
body.bible-reader #passages .reading-unit article:has(> .chumash-source){padding-top:0}
body .mishnah-reader .daf-segment .text-columns > section{padding-top:0}
/* Continuing Mishnayot have their address beside the text, not a second title. */
.continuous-unit.is-continuation .mishnah-reader .reader-title{display:none}
@media(max-width:700px){
 body .reader-page .daf-segment,
 body.bible-reader #passages .reading-unit article:has(> .chumash-source){grid-template-columns:48px minmax(0,1fr);column-gap:8px}
}

/* Keep all reader actions reachable when the brand and controls exceed one row. */
@media(max-width:700px){body .reader-masthead{height:auto;flex-wrap:wrap;row-gap:4px;padding-block:8px}body .reader-masthead nav{max-width:100%;flex-wrap:wrap;justify-content:flex-end;margin-inline-start:auto}}
