/* Rambam.si — a focused Hebrew study room, from phone to desk. */
:root {
  color-scheme:light;
  --ink:#173d51; --text:#203845; --muted:#536e80;
  --blue:#246f98; --blue-dark:#174f70; --sky:#eaf5fc; --sky-strong:#d8ecf8;
  --paper:#fff; --page:#f4f8fc; --surface:#edf5fa; --header:rgb(250 253 255 / 97%);
  --line:#d4e2ed; --line-strong:#a8c6d8; --selected:#edf7fd; --hover:#f2f8fc;
  --reading-size:1.4375rem; --header-height:80px;
  --sans:"Noto Sans Hebrew",Arial,sans-serif;
  --serif:"Noto Serif Hebrew","Frank Ruhl Libre","David","Times New Roman",serif;
  --shadow:0 10px 28px rgb(22 61 81 / 5%);
}
html[data-theme="dark"] {
  color-scheme:dark;
  --ink:#e2edf4; --text:#e0eaf0; --muted:#a2bacb;
  --blue:#91c9e9; --blue-dark:#aedaf2; --sky:#18374b; --sky-strong:#244b62;
  --paper:#142b3a; --page:#10222f; --surface:#193242; --header:rgb(15 34 47 / 97%);
  --line:#2f4c5f; --line-strong:#53798f; --selected:#1a3b50; --hover:#1c3749;
  --shadow:0 10px 28px rgb(0 0 0 / 12%);
}
* { box-sizing:border-box; }
[hidden],.hidden { display:none!important; }
html { scroll-behavior:smooth; scroll-padding-top:calc(var(--header-height) + 100px); }
body { margin:0; color:var(--ink); background:var(--page); font:1rem/1.7 var(--sans); }
button,input,select,textarea { font:inherit; color:inherit; }
button,a,input,select,textarea,summary { -webkit-tap-highlight-color:transparent; }
button,summary { cursor:pointer; }
button:disabled { cursor:default; opacity:.45; }
a { color:var(--blue); text-decoration:none; }
a:hover { color:var(--blue-dark); }
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,summary:focus-visible,[tabindex]:focus-visible { outline:3px solid #4f9dc6; outline-offset:3px; }
input[type="checkbox"],input[type="radio"] { accent-color:var(--blue); width:19px; height:19px; }
img,svg { max-width:100%; }
strong,b { font-weight:700; }
h1,h2,h3,h4,p { margin-top:0; }
h1,h2,h3,h4 { line-height:1.35; }
h1 { font:600 clamp(2rem,3vw,2.8rem)/1.3 var(--serif); margin-bottom:14px; }
h2 { font:600 1.7rem/1.4 var(--serif); margin-bottom:16px; }
h3 { font-size:1.08rem; font-weight:600; margin-bottom:12px; }
p { margin-bottom:16px; }
p:last-child { margin-bottom:0; }
hr { border:0; border-top:1px solid var(--line); margin:24px 0; }
mark { background:#ffe7a3; color:#233541; padding-inline:2px; border-radius:2px; }
::selection { background:#bddff3; color:#102f43; }
.skip-link { position:fixed; inset-block-start:-70px; inset-inline-start:20px; background:var(--ink); color:var(--paper); padding:10px 20px; border-radius:6px; z-index:100; }
.skip-link:focus { inset-block-start:12px; }

/* A compact masthead; the bottom bar owns navigation on small screens. */
.site-header { position:sticky; top:0; z-index:40; background:var(--header); border-bottom:1px solid var(--line); backdrop-filter:blur(12px); }
.header-inner { width:min(100%,1540px); min-height:var(--header-height); margin:auto; padding:12px 32px; display:flex; align-items:center; gap:24px; }
.brand { color:var(--ink); display:flex; align-items:center; gap:11px; flex:0 0 auto; }
.brand:hover { color:var(--blue); }
.brand-mark { width:40px; height:47px; border:1px solid var(--line-strong); border-radius:22px 22px 5px 5px; display:grid; place-items:center; position:relative; background:var(--sky); }
.brand-mark::after { content:""; position:absolute; bottom:5px; width:25px; border-bottom:1px solid var(--line-strong); }
.brand-mark span { font:31px var(--serif); padding-bottom:3px; }
.brand-copy { display:flex; flex-direction:column; gap:3px; }
.brand-name { font:600 27px/1.08 Georgia,serif; letter-spacing:-.7px; }
.brand-tagline { color:var(--muted); font-size:.875rem; line-height:1.3; }
.main-nav { display:flex; align-items:center; justify-content:center; gap:5px; margin-inline:auto; }
.nav-link { color:var(--muted); white-space:nowrap; display:inline-flex; align-items:center; min-height:44px; padding:8px 16px; border-radius:7px; font-size:.9375rem; transition:background .15s,color .15s; }
.nav-link:hover { background:var(--hover); color:var(--blue-dark); }
.nav-link.active,.nav-link[aria-current="page"] { background:var(--sky); color:var(--blue-dark); font-weight:700; }
.header-more { position:relative; flex:0 0 auto; }
.header-more>summary { display:flex; align-items:center; gap:8px; min-height:44px; padding:8px 12px; color:var(--muted); border:1px solid transparent; border-radius:7px; list-style:none; font-size:.9375rem; }
.header-more>summary::-webkit-details-marker { display:none; }
.header-more>summary:hover,.header-more[open]>summary { background:var(--surface); color:var(--ink); border-color:var(--line); }
.header-more[open]>summary svg { transform:rotate(180deg); }
.secondary-nav { position:absolute; inset-inline-end:0; top:calc(100% + 10px); width:230px; padding:8px; border:1px solid var(--line); border-radius:10px; background:var(--paper); box-shadow:0 14px 42px rgb(12 43 63 / 15%); }
.secondary-nav a { display:flex; align-items:center; min-height:46px; padding:10px 12px; border-radius:6px; font-size:.9375rem; color:var(--ink); }
.secondary-nav a:hover,.secondary-nav a[aria-current="page"] { background:var(--sky); }
.mobile-nav { display:none; }
.nav-count { display:inline-flex; align-items:center; justify-content:center; min-width:20px; height:20px; padding-inline:5px; margin-inline-start:4px; border-radius:10px; background:var(--sky-strong); color:var(--blue-dark); font-size:.8125rem; line-height:1; font-variant-numeric:tabular-nums; }
.nav-count:empty { display:none; }
#app { min-height:calc(100vh - 190px); }
#app:focus { outline:none; }
.page { width:min(100%,1400px); margin:auto; padding:36px 32px 60px; }
.page.reader-page,.page:has(.reader-grid) { max-width:1540px; padding-top:18px; }
.page-heading { display:block; margin-bottom:28px; }
.page-heading>h1:only-child { margin-bottom:0; }
.page-heading p { max-width:760px; }
.eyebrow { color:var(--blue); font-size:.875rem; font-weight:600; margin-bottom:10px; }
.muted { color:var(--muted); }
.lead { color:var(--muted); font-size:1.0625rem; line-height:1.85; max-width:740px; }

/* Shared controls and information. */
.input,.select,textarea { border:1px solid var(--line-strong); border-radius:7px; background-color:var(--paper); min-height:46px; padding:10px 14px; font-size:1rem; min-width:0; }
.input { width:100%; }
.input::placeholder,textarea::placeholder { color:var(--muted); opacity:.85; }
.input:hover,.select:hover,textarea:hover { border-color:var(--blue); }
.input:focus,.select:focus,textarea:focus { border-color:var(--blue); }
.select { appearance:none; padding-inline-end:38px; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%236f899a' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:left 13px center; }
textarea { width:100%; min-height:130px; resize:vertical; line-height:1.8; }
.button { display:inline-flex; align-items:center; justify-content:center; gap:7px; min-height:44px; padding:9px 18px; border:1px solid var(--line-strong); border-radius:7px; background:var(--paper); color:var(--blue-dark); font-size:.9375rem; font-weight:500; line-height:1.5; text-align:center; transition:background .15s,border-color .15s,color .15s; }
.button:hover { background:var(--sky); border-color:var(--blue); color:var(--blue-dark); }
.button.primary { background:#1d5b7e; border-color:#1d5b7e; color:#fff; }
.button.primary:hover { background:#174966; border-color:#174966; color:#fff; }
html[data-theme="dark"] .button.primary { background:#8bc5e6; border-color:#8bc5e6; color:#102b3d; }
.button.secondary { background:var(--sky); border-color:var(--line); }
.button.secondary:hover { background:var(--sky-strong); }
.button.ghost { border-color:transparent; background:transparent; }
.button.ghost:hover { background:var(--surface); }
.button.small { min-height:40px; padding:7px 11px; font-size:.875rem; }
.button[aria-pressed="true"] { background:var(--sky-strong); color:var(--blue-dark); border-color:var(--line-strong); }
.pill { display:inline-flex; align-items:center; gap:5px; border:1px solid var(--line); border-radius:30px; background:var(--sky); color:var(--blue-dark); font-size:.875rem; line-height:1.5; padding:4px 11px; white-space:nowrap; }
.notice { border:1px solid var(--line); border-inline-start:3px solid var(--line-strong); border-radius:7px; background:var(--sky); padding:15px 19px; font-size:.9375rem; line-height:1.8; margin:20px 0 28px; }
.notice a,.source-line a,.about-card a { text-decoration:underline; text-underline-offset:3px; }
.section-head { display:flex; align-items:baseline; justify-content:space-between; gap:16px; flex-wrap:wrap; margin:32px 0 18px; }
.section-head h2,.section-head p { margin:0; }
.toolbar-group,.source-actions { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.toolbar-group label { font-size:.875rem; color:var(--muted); }
.toolbar-group .select { min-height:44px; padding-block:8px; max-width:300px; font-size:.9375rem; }
.field-label { display:block; color:var(--muted); font-size:.875rem; font-weight:600; margin-bottom:6px; }
.check-row { display:flex; flex-wrap:wrap; align-items:center; gap:8px; font-size:.9375rem; }
.check-row label,.chapter-options label { display:inline-flex; align-items:center; gap:8px; cursor:pointer; min-height:40px; }
.chapter-options { display:flex; flex-wrap:wrap; align-items:center; gap:8px 16px; margin:12px 0; }
.chapter-options label { font-size:.9375rem; }
.source-actions { margin-top:17px; padding-top:14px; border-top:1px solid var(--line); }
.source-actions .button { font-size:.875rem; }

/* Opening the library should take seconds. */
.hero,.library-hero { display:grid; grid-template-columns:minmax(0,1.4fr) minmax(270px,.6fr); gap:36px; align-items:center; padding:30px 34px; background:var(--paper); border:1px solid var(--line); border-radius:14px; margin-bottom:24px; box-shadow:var(--shadow); }
.hero h1,.library-hero h1 { font-size:clamp(2.2rem,3.6vw,3.1rem); line-height:1.2; letter-spacing:-.5px; margin-bottom:15px; }
.hero-copy { min-width:0; }
.hero-copy .lead { max-width:650px; margin-bottom:18px; }
.hero-copy .button { margin-inline-end:6px; }
.hero-aside,.resume-card { background:var(--sky); border:1px solid var(--line); border-radius:10px; padding:23px 25px; min-width:0; }
.hero-aside h2,.resume-card h2 { font-size:1.5rem; margin-bottom:10px; }
.hero-aside .torah-text { font-size:1.35rem; }
.hero-aside p,.resume-card p { color:var(--muted); }
.hero-aside ul { padding-inline-start:23px; margin-bottom:0; }
.hero-aside li+li { margin-top:8px; }
.resume-card { display:flex; flex-direction:column; justify-content:center; gap:6px; }
.resume-card .button { margin-top:8px; align-self:flex-start; }
.home-search { display:block; margin-top:22px; max-width:740px; }
.home-search label { display:block; margin-bottom:7px; }
.home-search-row { display:flex; align-items:stretch; gap:8px; min-width:0; }
.home-search-row>.input { flex:1; min-width:0; }
.home-search-row>.button { flex:0 0 auto; margin:0; }
.home-search input { width:100%; min-height:50px; }
.home-search>.input { flex:1; }
.home-search .button { min-height:50px; flex:0 0 auto; }
.quick-start { display:flex; flex-wrap:wrap; gap:7px 12px; align-items:center; margin-top:16px; }
.quick-start>a,.quick-start>button { min-height:40px; }
.quick-start .button { margin:0; }
.quick-open { margin-top:17px; border:1px solid var(--line); border-radius:9px; background:var(--paper); }
.quick-open>summary { min-height:46px; padding:10px 15px; color:var(--blue-dark); font-size:.9375rem; }
.quick-open>form,.quick-open>.toolbar-group { display:flex; flex-wrap:wrap; gap:12px; align-items:end; padding:4px 16px 16px; }
.quick-open .field-label { flex:1; min-width:130px; }
.quick-open .select { width:100%; }
.reader-stepper { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:24px; padding-top:18px; border-top:1px solid var(--line); }
.stats { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:0; margin:20px 0 30px; padding:18px 0; border-block:1px solid var(--line); }
.stat { min-width:0; padding:2px 24px; border-inline-end:1px solid var(--line); }
.stat:last-child { border-inline-end:0; }
.stat-value { font-size:1.5rem; font-weight:600; color:var(--blue-dark); font-variant-numeric:tabular-nums; display:block; line-height:1.3; }
.stat-label { font-size:.875rem; color:var(--muted); display:block; margin-top:5px; }
.group-tabs { display:flex; gap:8px; overflow-x:auto; padding:1px 1px 12px; margin:0 0 12px; scrollbar-width:thin; scrollbar-color:var(--line-strong) transparent; }
.group-tabs>* { flex:0 0 auto; }
.group-tabs button,.group-tabs a,.group-tab { display:inline-flex; align-items:center; justify-content:center; min-height:44px; padding:9px 16px; border:1px solid var(--line); border-radius:24px; background:var(--paper); color:var(--muted); font-size:.9375rem; white-space:nowrap; }
.group-tabs button:hover,.group-tabs a:hover { border-color:var(--line-strong); color:var(--ink); }
.group-tabs .active,.group-tabs [aria-selected="true"],.group-tabs [aria-pressed="true"] { background:#1d5b7e; border-color:#1d5b7e; color:#fff; }
.book-groups,.library-book-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px; }
.book-group { border:1px solid var(--line); border-radius:10px; background:var(--paper); padding:21px 22px 14px; min-width:0; }
.book-group h2,.book-group h3,.book-group>summary { font:600 1.5rem/1.4 var(--serif); color:var(--ink); margin:0 0 10px; padding-bottom:12px; border-bottom:1px solid var(--line); }
.book-links { display:flex; flex-direction:column; gap:1px; }
.book-link { display:flex; justify-content:space-between; align-items:baseline; gap:12px; min-height:44px; color:var(--ink); border-radius:6px; margin-inline:-9px; padding:10px 9px; font-size:1rem; line-height:1.5; }
.book-link:hover { background:var(--sky); color:var(--blue-dark); }
.book-link:focus-visible { outline-offset:1px; }
.book-link>span:first-child { min-width:0; }
.book-meta { color:var(--muted); font-size:.875rem; flex:0 0 auto; white-space:nowrap; }
.collections-section { margin:30px 0; }
.collection-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
.collection-card { display:flex; flex-direction:column; position:relative; min-width:0; min-height:224px; padding:24px 25px 20px; border:1px solid var(--line); border-radius:11px; background:var(--paper); color:var(--ink); box-shadow:var(--shadow); transition:transform .15s,border-color .15s,background .15s; }
.collection-card:hover,.collection-card.active { border-color:var(--blue); background:var(--selected); }
.collection-card:hover { transform:translateY(-2px); }
.collection-number { color:var(--muted); font-size:.75rem; font-variant-numeric:tabular-nums; letter-spacing:.12em; margin-bottom:15px; }
.collection-card h3 { font:600 1.7rem/1.35 var(--serif); margin-bottom:9px; }
.collection-card p { color:var(--muted); font-size:.9375rem; line-height:1.7; margin-bottom:12px; }
.collection-coverage { display:block; color:var(--blue-dark); font-size:.875rem; line-height:1.65; }
.collection-open { display:block; font-size:.875rem; font-weight:600; color:var(--blue); margin-top:auto; padding-top:15px; }
.collection-heading .eyebrow { display:inline-block; margin-bottom:12px; }
.collection-heading + .stats { display:none; }
.library-listing { margin-block:30px; }
.library-book-grid:has(>.book-group:only-child) { grid-template-columns:minmax(0,1fr); }
.library-book-grid>.book-group:only-child .book-links { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); column-gap:35px; }
.source-figure { margin:22px 0; padding:14px; border:1px solid var(--line); border-radius:8px; background:#fff; text-align:center; break-inside:avoid; }
.source-figure img { display:block; height:auto; max-width:100%; max-height:650px; margin:auto; object-fit:contain; }
.source-figure figcaption { font: .875rem/1.6 var(--sans); color:#536e80; margin-top:10px; }
.focus-grid.source-only { grid-template-columns:minmax(0,1.6fr) minmax(260px,.7fr); }
.coverage-table-wrap { max-width:100%; overflow:auto; }
.coverage-table { width:100%; border-collapse:collapse; text-align:right; font-size:.9375rem; }
.coverage-table th,.coverage-table td { padding:14px 12px; border-bottom:1px solid var(--line); vertical-align:top; }
.coverage-table thead { background:var(--sky); }
.coverage-table th { font-weight:600; }
.coverage-table td p { margin:8px 0 0; }
.coverage-table tbody th { width:24%; min-width:130px; }
@media (max-width:1000px) { .collection-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:760px) { .focus-grid.source-only { grid-template-columns:minmax(0,1fr); } }
@media (max-width:560px) { .collection-grid { grid-template-columns:minmax(0,1fr); gap:12px; } .collection-card { min-height:0; padding:20px; } .collection-number { margin-bottom:8px; } .collection-card h3 { font-size:1.65rem; } .collection-open { padding-top:12px; } .collection-card p { margin-bottom:8px; } .coverage-table th,.coverage-table td { padding:12px 8px; } .book-link { align-items:flex-start; } .book-meta { font-size:.8rem; } }
@media (max-width:650px) { .library-book-grid>.book-group:only-child .book-links { grid-template-columns:minmax(0,1fr); } }

/* Reader: location, display choice, then the sources. */
.reader-toolbar { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px; padding:12px 0 17px; margin-bottom:4px; }
.reader-context-bar { position:sticky; top:var(--header-height); z-index:25; display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:10px 18px; padding:12px 0; margin-bottom:14px; background:var(--page); border-bottom:1px solid var(--line); }
.reader-context-bar strong { font-size:1rem; }
.reader-location { color:var(--ink); font-family:var(--sans); font-size:1.0625rem; font-weight:600; line-height:1.5; margin:0; }
#reader-body { min-width:0; scroll-margin-top:calc(var(--header-height) + 100px); }
.reader-context-bar p { margin:0; }
.reader-context-bar .muted { font-size:.875rem; }
.reader-context-bar .toolbar-group { gap:5px; }
.reader-controls { border:1px solid var(--line); border-radius:9px; background:var(--paper); margin-bottom:16px; }
.reader-controls>summary { min-height:48px; padding:11px 16px; font-size:.9375rem; color:var(--blue-dark); }
.reader-controls[open]>summary { border-bottom:1px solid var(--line); }
.reader-controls .reader-toolbar { padding:16px; margin:0; }
.reader-controls .toolbar-group { gap:10px; }
.reader-controls>div:not(.reader-toolbar) { padding:15px 16px; }
.reading-mode-tabs { display:flex; gap:5px; padding:5px; background:var(--surface); border:1px solid var(--line); border-radius:10px; margin:0 0 20px; width:max-content; max-width:100%; }
.reading-mode-tabs button { flex:1 0 auto; min-height:44px; min-width:135px; padding:9px 20px; background:transparent; border:1px solid transparent; border-radius:7px; color:var(--muted); font-size:.9375rem; white-space:nowrap; }
.reading-mode-tabs button:hover { color:var(--ink); }
.reading-mode-tabs .active,.reading-mode-tabs [aria-selected="true"],.reading-mode-tabs [aria-pressed="true"] { background:var(--paper); border-color:var(--line); box-shadow:0 2px 5px rgb(13 54 79 / 4%); color:var(--blue-dark); font-weight:600; }
.reader-mobile-tabs { display:none; }
.reader-grid { display:grid; grid-template-columns:160px minmax(0,1fr) minmax(300px,360px); grid-template-areas:"index reading commentary"; gap:20px; align-items:start; }
.reader-sidebar { grid-area:index; position:sticky; top:calc(var(--header-height) + 86px); padding:18px 13px; background:var(--surface); border:1px solid var(--line); border-radius:9px; max-height:calc(100dvh - var(--header-height) - 110px); overflow-y:auto; scrollbar-width:thin; }
.sidebar-title { font-size:.9375rem; font-weight:600; margin-bottom:12px; }
.chapter-list { display:flex; flex-wrap:wrap; gap:6px; }
.chapter-link { color:var(--muted); display:inline-flex; align-items:center; justify-content:center; min-width:40px; min-height:40px; padding:7px 9px; border:1px solid transparent; border-radius:6px; font-size:.9375rem; }
.chapter-link:hover { background:var(--paper); border-color:var(--line); }
.chapter-link.active,.chapter-link[aria-current="page"] { color:#fff; background:#1d5b7e; border-color:#1d5b7e; }
.reader-sidebar .muted { font-size:.875rem; }
.reader-sidebar .notice { margin-bottom:0; padding:12px; font-size:.875rem; }
.reading-pane { grid-area:reading; min-width:0; background:var(--paper); border:1px solid var(--line); border-radius:11px; overflow:hidden; box-shadow:var(--shadow); }
.reading-heading { padding:25px 28px 21px; border-bottom:1px solid var(--line); background:var(--paper); }
.reading-heading h1,.reading-heading h2 { margin-bottom:8px; font-family:var(--serif); }
.reading-heading h1 { font-size:2rem; }
.reading-heading .muted,.reading-heading p { font-size:.875rem; }
.reading-heading .field-label { margin:16px 0 0; }
.reading-heading .select { width:100%; }
.halakha { position:relative; padding:23px 28px 27px; border-bottom:1px solid var(--line); border-inline-start:3px solid transparent; scroll-margin-top:calc(var(--header-height) + 105px); transition:background .15s; }
.halakha:last-child { border-bottom:0; }
.halakha:hover { background:var(--hover); }
.halakha.selected { border-inline-start-color:#438ab1; background:var(--selected); }
.halakha[tabindex] { cursor:pointer; }
.halakha:focus-visible { outline-offset:-5px; }
.halakha-head { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:10px; margin-bottom:12px; }
.halakha-number { display:inline-flex; align-items:center; color:var(--blue); font-size:.875rem; font-weight:600; }
.halakha-head .toolbar-group { gap:4px; }
.torah-text { font:var(--reading-size)/1.95 var(--serif); color:var(--text); text-align:right; overflow-wrap:anywhere; }
.torah-text p { margin:0 0 16px; }
.torah-text p:last-child { margin-bottom:0; }
.torah-text b,.torah-text strong { font-weight:700; }
.torah-text i { font-style:normal; }
.commentary-pane { grid-area:commentary; position:sticky; top:calc(var(--header-height) + 86px); min-width:0; max-height:calc(100dvh - var(--header-height) - 110px); overflow-y:auto; scrollbar-width:thin; padding-inline-end:2px; }
.commentary-pane>h2 { font:600 1.25rem/1.4 var(--sans); margin:0 0 14px; }
.commentary-pane>h3 { margin-bottom:13px; }
.commentary-pane>.muted { font-size:.875rem; }
.commentary-card { background:var(--paper); border:1px solid var(--line); border-radius:9px; padding:22px 23px; margin-bottom:14px; min-width:0; }
.commentary-title { font:600 1.125rem/1.4 var(--sans); margin-bottom:13px; color:var(--blue-dark); }
.commentary-card>.section-head { margin:0 0 12px; align-items:center; gap:8px; }
.commentary-card>.section-head h3 { margin:0; }
.commentary-card>.section-head+.source-line { padding-top:0; margin-top:0; border-top:0; margin-bottom:14px; }
.commentary-card .torah-text { font-size:var(--reading-size); line-height:1.9; }
.commentary-card>p { font-size:.9375rem; }
.source-line { color:var(--muted); font-family:var(--sans); font-size:.875rem; line-height:1.75; margin-top:17px; padding-top:13px; border-top:1px solid var(--line); overflow-wrap:anywhere; }
.source-line summary { min-height:34px; }
.source-line p { margin-top:10px; }
.source-line a { color:var(--blue); }
.reading-pane>.source-line { margin:0; padding:16px 28px; background:var(--surface); }
.reader-grid.clean { grid-template-columns:minmax(0,900px); grid-template-areas:"reading"; justify-content:center; }
.reader-grid.clean .reader-sidebar,.reader-grid.clean .commentary-pane { display:none; }
.reader-grid.clean .halakha { padding-inline:42px; }
.focus-grid { display:grid; grid-template-columns:minmax(0,.92fr) minmax(0,1.08fr); gap:24px; align-items:start; }
.focus-grid>.reading-pane { grid-area:auto; }
.focus-original { position:sticky; top:calc(var(--header-height) + 90px); border:1px solid var(--line); border-radius:11px; background:var(--paper); overflow:hidden; min-width:0; box-shadow:var(--shadow); }
.focus-original>.torah-text { padding:24px 28px; }
.focus-original>.source-actions,.focus-original>.source-line { margin-inline:25px; margin-bottom:20px; }
.focus-original>.halakha { border-bottom:0; background:var(--selected); }
.focus-commentaries { min-width:0; }
.focus-commentaries>.section-head { margin:0 0 15px; min-height:42px; }
.focus-commentaries>.section-head h2 { margin:0; font-size:1.5rem; }
.focus-commentaries .reading-heading { border:1px solid var(--line); border-radius:10px; margin-bottom:14px; padding:21px 23px; }
.focus-commentaries .reading-heading h2 { font-size:1.5rem; }
.source-anchor { border:1px solid var(--line-strong); border-inline-start:3px solid var(--blue); border-radius:9px; background:var(--selected); padding:18px 22px; margin-bottom:18px; }
.source-anchor .eyebrow { margin-bottom:6px; }
.source-anchor .torah-text { font-size:calc(var(--reading-size) * .94); line-height:1.85; }
.source-anchor h2,.source-anchor h3 { margin-bottom:8px; }
.source-anchor p { margin-bottom:8px; }
.commentator-chips { display:flex; flex-wrap:wrap; gap:8px; margin:12px 0 18px; }
.comment-chip { display:inline-flex; align-items:center; gap:6px; min-height:42px; border:1px solid var(--line); background:var(--paper); color:var(--muted); border-radius:23px; padding:8px 14px; font-size:.9375rem; }
.comment-chip:hover { border-color:var(--line-strong); color:var(--blue-dark); }
.comment-chip.active,.comment-chip[aria-pressed="true"] { background:var(--sky-strong); color:var(--blue-dark); border-color:var(--line-strong); }
.compare-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:22px; align-items:start; }
.compare-column { min-width:0; border:1px solid var(--line); border-radius:11px; background:var(--paper); overflow:hidden; }
.compare-column>header,.compare-column>.compare-heading,.compare-column>.reading-heading { padding:20px 24px; background:var(--surface); border-bottom:1px solid var(--line); }
.compare-column>header h2,.compare-column>.compare-heading h2 { margin-bottom:10px; font-size:1.5rem; }
.compare-column .select { width:100%; max-width:none; }
.compare-column>.field-label { margin:0; padding:18px 24px; background:var(--surface); border-bottom:1px solid var(--line); }
.compare-column>.field-label .select { margin-top:7px; }
.compare-column>.commentary-card { border:0; border-radius:0; margin:0; padding:24px; }
.compare-column>.torah-text { padding:24px; }
.compare-column>.source-line,.compare-column>.source-actions { margin-inline:24px; margin-bottom:20px; }
.compare-empty { padding:30px 24px; text-align:center; color:var(--muted); }
.compare-empty p { margin-bottom:12px; }
.mobile-reader-stepper:not(.reader-stepper) { display:none; }
.chapter-source-anchor { display:none; }

/* Search, personal study, and the corpus explanation. */
.search-form { display:flex; align-items:end; flex-wrap:wrap; gap:12px; margin:24px 0; padding:22px; background:var(--paper); border:1px solid var(--line); border-radius:11px; }
.search-form>.input,.search-form>input,.search-form>label:first-child { flex:1 1 280px; }
.search-form label { display:block; }
.search-form .field-label { margin-bottom:0; }
.search-form .select { max-width:260px; }
.results { display:flex; flex-direction:column; gap:14px; margin-top:24px; }
.result-card,.saved-card { display:block; padding:23px 27px; background:var(--paper); border:1px solid var(--line); border-radius:9px; transition:border-color .15s; min-width:0; }
.result-card:hover { border-color:var(--blue); }
.result-card .section-head,.saved-card .section-head { margin:0 0 12px; gap:8px 16px; }
.result-ref { color:var(--blue-dark); font-size:1rem; font-weight:600; margin-bottom:8px; display:block; }
.result-snippet { font:1.25rem/1.85 var(--serif); color:var(--text); margin:0; }
.result-card .muted { font-size:.875rem; }
.result-open { display:block; margin-top:14px; color:var(--blue); font-size:.875rem; }
.results-pagination { display:flex; align-items:center; justify-content:center; gap:18px; padding:16px 0; color:var(--muted); font-size:.9375rem; }
.saved-card { margin-bottom:0; }
.saved-card .result-ref { margin-bottom:0; }
.saved-card p { margin-bottom:8px; }
.saved-card .button { flex-shrink:0; }
.about-grid,.commentator-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; }
.commentator-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
.about-card { background:var(--paper); border:1px solid var(--line); border-radius:10px; padding:27px 29px; min-width:0; }
.about-card h2 { font-size:1.6rem; padding-bottom:15px; border-bottom:1px solid var(--line); }
.about-card p,.about-card li { color:var(--muted); }
.about-card ul,.about-card ol { padding-inline-start:24px; margin-bottom:0; }
.about-card li+li { margin-top:10px; }
.about-card summary { min-height:44px; }
.commentator-grid .about-card { padding:24px; }
.commentator-grid .about-card h2 { font-size:1.5rem; }
.empty-state,.sheet-empty { background:var(--paper); border:1px dashed var(--line-strong); border-radius:10px; padding:36px 28px; text-align:center; color:var(--muted); line-height:1.8; }
.empty-state h2,.empty-state h3,.sheet-empty h2 { color:var(--ink); }
.empty-state .button,.sheet-empty .button { margin-top:10px; }
.empty-state .toolbar-group { justify-content:center; }
.commentary-pane .empty-state { padding:26px 21px; text-align:right; font-size:.9375rem; }
.sheet-page { max-width:1100px; }
.sheet-page .sheet-page { padding:0; max-width:none; width:100%; }
.sheet-heading { display:flex; flex-wrap:wrap; align-items:center; gap:16px; margin-bottom:20px; }
.sheet-heading>div { flex:1; min-width:0; }
.sheet-title-input { display:block; width:100%; min-height:58px; color:var(--ink); font:600 2rem/1.4 var(--serif); border:1px solid transparent; border-bottom-color:var(--line-strong); border-radius:0; background:transparent; padding:5px 0 11px; }
.sheet-title-input:hover,.sheet-title-input:focus { border-bottom-color:var(--blue); }
.sheet-tools { display:flex; flex-wrap:wrap; gap:9px; padding-bottom:20px; margin-bottom:18px; border-bottom:1px solid var(--line); }
.sheet-device-note { color:var(--muted); font-size:.875rem; line-height:1.75; margin:14px 0 22px; }
.sheet-list { display:flex; flex-direction:column; gap:20px; }
.sheet-card { background:var(--paper); border:1px solid var(--line); border-radius:11px; padding:24px 28px; box-shadow:var(--shadow); min-width:0; }
.sheet-card-head { display:flex; flex-wrap:wrap; align-items:start; gap:12px; border-bottom:1px solid var(--line); padding-bottom:16px; margin-bottom:18px; }
.sheet-source-number { display:inline-flex; align-items:center; justify-content:center; min-width:32px; min-height:32px; background:var(--sky); border:1px solid var(--line); border-radius:7px; color:var(--blue-dark); font-size:.875rem; font-variant-numeric:tabular-nums; }
.sheet-source-title { flex:1; min-width:160px; color:var(--blue-dark); font-size:1.1rem; font-weight:600; line-height:1.5; margin:0; }
.sheet-source-title h2 { font:600 1.125rem/1.5 var(--sans); margin:0; }
.sheet-source-title>.source-line { display:block; padding:0; margin-top:5px; border:0; font-weight:400; }
.sheet-source-title small { display:block; color:var(--muted); font-size:.875rem; font-weight:400; margin-top:5px; }
.sheet-order-actions { display:flex; flex-wrap:wrap; gap:5px; }
.sheet-quote { margin:0; }
.sheet-notes { margin-top:22px; background:var(--surface); border:1px solid var(--line); border-radius:8px; }
.sheet-notes>summary { min-height:46px; padding:11px 15px; font-weight:600; font-size:.9375rem; color:var(--blue-dark); }
.sheet-notes>.muted { font-size:.875rem; padding-inline:16px; margin:0 0 12px; }
.sheet-note-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; padding:5px 16px 17px; }
.sheet-note-grid textarea { min-height:110px; font-weight:400; }
.sheet-print-title,.sheet-note-print,.sheet-source-print,.sheet-print-only { display:none; }
.mobile-only { display:none; }
.loading { min-height:340px; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; color:var(--muted); gap:16px; }
.loading-ring { width:30px; height:30px; border:2px solid var(--line); border-top-color:var(--blue); border-radius:50%; animation:spin .8s linear infinite; }
@keyframes spin { to { transform:rotate(360deg); } }
.error { border:1px solid #b88585; border-inline-start:3px solid #a95757; background:var(--paper); color:var(--ink); padding:20px 24px; border-radius:7px; }
.error .button { margin-top:14px; }
.site-footer { border-top:1px solid var(--line); background:var(--surface); }
.footer-inner { max-width:1540px; margin:auto; padding:25px 32px; display:flex; align-items:center; justify-content:space-between; gap:16px 30px; color:var(--muted); font-size:.875rem; }
.footer-brand { font:600 17px Georgia,serif; color:var(--ink); display:inline-block; }
.footer-divider { padding-inline:9px; }
.footer-note span { padding-inline:6px; }
.footer-note a:hover { text-decoration:underline; text-underline-offset:4px; }
.toast { position:fixed; bottom:26px; left:50%; z-index:80; transform:translateX(-50%) translateY(12px); width:max-content; max-width:min(90vw,600px); padding:12px 22px; background:#163f57; color:#fff; border:1px solid #5e91af; border-radius:9px; box-shadow:0 8px 30px rgb(9 39 57 / 18%); opacity:0; pointer-events:none; transition:opacity .2s,transform .2s; text-align:center; font-size:.9375rem; }
.toast.show,.toast.visible,.toast:not(:empty) { opacity:1; transform:translateX(-50%) translateY(0); }

@media(min-width:1600px) {
  .reader-grid { grid-template-columns:175px minmax(0,1fr) 400px; gap:24px; }
}
@media(max-width:1150px) {
  .header-inner { padding-inline:24px; gap:18px; }
  .nav-link { padding-inline:11px; }
  .page { padding-inline:24px; }
  .hero,.library-hero { gap:24px; padding:28px; }
  .book-groups,.library-book-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .commentator-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .reader-grid { grid-template-columns:120px minmax(0,1fr) minmax(270px,310px); gap:15px; }
  .reader-sidebar { padding-inline:10px; }
  .halakha,.reading-heading { padding-inline:23px; }
  .commentary-card { padding:20px; }
}
@media(max-width:980px) {
  :root { --header-height:72px; }
  body { padding-bottom:calc(74px + env(safe-area-inset-bottom)); }
  .header-inner { justify-content:space-between; padding:11px 22px; }
  .brand-mark { width:35px; height:42px; }
  .brand-mark span { font-size:28px; }
  .brand-name { font-size:24px; }
  .main-nav { display:none; }
  .mobile-nav { position:fixed; z-index:50; inset-inline:0; bottom:0; display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); padding:7px 10px calc(7px + env(safe-area-inset-bottom)); border-top:1px solid var(--line); background:var(--header); backdrop-filter:blur(14px); box-shadow:0 -6px 20px rgb(21 58 80 / 3%); }
  .mobile-nav a { position:relative; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px; min-height:57px; min-width:0; color:var(--muted); border-radius:8px; font-size:.875rem; line-height:1.4; }
  .mobile-nav svg { width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round; }
  .mobile-nav a.active,.mobile-nav a[aria-current="page"] { background:var(--sky); color:var(--blue-dark); font-weight:600; }
  .mobile-nav a:hover { color:var(--blue); }
  .toast { bottom:calc(90px + env(safe-area-inset-bottom)); }
  .button.small { min-height:44px; }
  .hero,.library-hero { grid-template-columns:minmax(0,1fr); }
  .hero-aside,.resume-card { padding:20px 23px; }
  .reader-context-bar { padding-block:10px; gap:8px; }
  .reader-context-bar .button { min-height:44px; }
  .reader-grid { grid-template-columns:minmax(0,1fr); grid-template-areas:"index" "reading"; gap:15px; }
  .reader-sidebar { position:static; max-height:none; padding:12px 15px; }
  .reader-sidebar .eyebrow,.reader-sidebar>.muted,.reader-sidebar>.notice { display:none; }
  .sidebar-title { margin-bottom:9px; }
  .chapter-list { flex-wrap:nowrap; overflow-x:auto; padding-bottom:3px; scrollbar-width:thin; }
  .chapter-link { flex:0 0 auto; min-width:44px; min-height:44px; }
  .commentary-pane { position:static; max-height:none; overflow:visible; padding:0; }
  .reader-grid .commentary-pane { display:none; }
  .reader-grid.mobile-comments { grid-template-areas:"commentary"; }
  .reader-grid.mobile-comments .reading-pane,.reader-grid.mobile-comments .reader-sidebar { display:none; }
  .reader-grid.mobile-comments .commentary-pane { display:block; }
  .reader-grid.mobile-comments .chapter-source-anchor { display:block; }
  .reader-mobile-tabs { display:flex; gap:8px; margin:0 0 15px; }
  .reader-mobile-tabs .button { flex:1; min-width:0; white-space:normal; padding-block:10px; }
  .focus-grid { grid-template-columns:minmax(0,1fr); gap:20px; }
  .focus-original { position:static; }
  .focus-commentaries .reading-heading { padding:19px 22px; }
  .focus-original .torah-text,.source-anchor .torah-text,.commentary-card .torah-text,.torah-text { font-size:max(1.375rem,var(--reading-size)); }
  .compare-grid { grid-template-columns:minmax(0,1fr); gap:20px; }
  .compare-column>.reading-heading { padding:19px 22px; }
  .comment-chip { min-height:44px; }
  .reading-mode-tabs { width:100%; }
  .reading-mode-tabs button { min-width:0; flex:1 1 0; padding-inline:10px; }
  .mobile-reader-stepper { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:24px; padding-top:18px; border-top:1px solid var(--line); }
  .mobile-reader-stepper .button { min-height:48px; flex:1; }
  .footer-inner { flex-direction:column; align-items:start; gap:8px; }
}
@media(max-width:720px) {
  :root { --header-height:66px; }
  .header-inner { padding:10px 17px; gap:15px; }
  .brand { gap:9px; }
  .brand-mark { width:32px; height:39px; }
  .brand-mark::after { width:20px; }
  .brand-mark span { font-size:26px; }
  .brand-name { font-size:22px; }
  .brand-tagline { font-size:.875rem; }
  .header-more>summary { padding-inline:10px; }
  .page { padding:24px 17px 38px; }
  .page.reader-page,.page:has(.reader-grid) { padding:10px 13px 36px; }
  .page-heading { margin-bottom:22px; }
  .page-heading h1 { font-size:2rem; }
  .hero,.library-hero { border-radius:11px; padding:23px 22px; gap:20px; margin-bottom:20px; }
  .hero h1,.library-hero h1 { font-size:2.35rem; letter-spacing:-.3px; }
  .lead { font-size:1rem; }
  .hero-copy .lead { margin-bottom:16px; }
  .hero-aside,.resume-card { padding:18px 20px; }
  .hero-aside h2,.resume-card h2 { font-size:1.4rem; }
  .home-search { flex-wrap:wrap; gap:8px; margin-top:18px; }
  .home-search .button { padding-inline:15px; }
  .home-search input { font-size:1rem; }
  .quick-start { gap:7px; }
  .quick-start .button { font-size:.875rem; }
  .stats { grid-template-columns:repeat(2,minmax(0,1fr)); gap:17px 0; padding-block:17px; margin-block:20px 25px; }
  .stat { padding-inline:16px; }
  .stat:nth-child(2n) { border-inline-end:0; }
  .stat-value { font-size:1.35rem; }
  .stat-label { font-size:.875rem; }
  .group-tabs { margin-inline:-2px; padding-bottom:10px; }
  .group-tabs button,.group-tabs a { padding-inline:14px; font-size:.9375rem; }
  .book-groups,.library-book-grid { grid-template-columns:minmax(0,1fr); gap:14px; }
  .book-group { padding:19px 21px 13px; }
  .book-group h2,.book-group h3 { font-size:1.5rem; }
  .book-link { font-size:1rem; padding-block:12px; min-height:48px; }
  .section-head { margin-top:27px; }
  .section-head h2 { font-size:1.55rem; }
  .section-head>.field-label { width:100%; margin-top:4px; }
  .reader-context-bar { top:var(--header-height); margin-bottom:12px; }
  .reader-context-bar strong { font-size:.9375rem; }
  .reader-context-bar .muted { font-size:.875rem; }
  .reader-context-bar>.toolbar-group { min-width:0; }
  .reader-context-bar .toolbar-group:first-child { gap:4px 8px; }
  .reader-controls .reader-toolbar { padding:13px; align-items:stretch; gap:16px; }
  .reader-controls .toolbar-group { gap:8px; }
  .reader-controls .field-label { flex:1 1 40%; min-width:0; }
  .reader-controls .select { width:100%; max-width:none; }
  .reader-toolbar { gap:11px; }
  .reader-toolbar>.toolbar-group { max-width:100%; }
  .toolbar-group .select { max-width:100%; }
  .reading-mode-tabs { margin-bottom:15px; padding:4px; gap:3px; border-radius:9px; }
  .reading-mode-tabs button { font-size:.875rem; padding:10px 6px; }
  .reading-heading { padding:21px 21px 18px; }
  .reading-heading h1 { font-size:1.8rem; }
  .reading-heading h2 { font-size:1.45rem; }
  .halakha,.reader-grid.clean .halakha { padding:20px 19px 24px; }
  .halakha-head { gap:7px; margin-bottom:9px; }
  .halakha-head .toolbar-group { gap:2px; }
  .halakha-head .button { padding-inline:8px; font-size:.875rem; }
  .torah-text { line-height:1.95; }
  .reading-pane>.source-line { padding:15px 21px; }
  .commentary-card { padding:21px; }
  .commentary-card .torah-text { line-height:1.95; }
  .source-line { font-size:.875rem; }
  .source-line summary { min-height:40px; }
  .focus-original>.torah-text { padding:21px; }
  .focus-original>.source-actions,.focus-original>.source-line { margin-inline:20px; }
  .focus-commentaries .reading-heading { padding:19px 21px; }
  .source-anchor { padding:17px 20px; }
  .commentator-chips { flex-wrap:nowrap; overflow-x:auto; padding-bottom:8px; scrollbar-width:thin; margin-block:10px 12px; }
  .comment-chip { flex:0 0 auto; }
  .compare-column>.commentary-card,.compare-column>.torah-text { padding:21px; }
  .compare-column>header,.compare-column>.compare-heading,.compare-column>.reading-heading,.compare-column>.field-label { padding:18px 21px; }
  .compare-column>.source-line,.compare-column>.source-actions { margin-inline:21px; }
  .source-actions { gap:7px; }
  .source-actions .button { flex:1 1 auto; }
  .search-form { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); padding:18px; gap:14px 10px; margin-block:20px; }
  .search-form>label:first-child,.search-form>button { grid-column:1/-1; }
  .search-form .select { width:100%; max-width:none; }
  .search-form .button { min-height:48px; }
  .search-form>.field-label:nth-last-of-type(1) { grid-column:1/-1; }
  .result-card,.saved-card { padding:20px 21px; }
  .result-snippet { font-size:1.375rem; }
  .about-grid,.commentator-grid { grid-template-columns:minmax(0,1fr); gap:16px; }
  .about-card,.commentator-grid .about-card { padding:23px; }
  .empty-state,.sheet-empty { padding:28px 23px; }
  .notice { padding:14px 17px; }
  .sheet-page { padding-inline:15px; }
  .sheet-title-input { font-size:1.9rem; }
  .sheet-tools { gap:8px; }
  .sheet-tools .button { flex:1 1 auto; }
  .sheet-card { padding:20px; }
  .sheet-card-head { gap:10px; padding-bottom:14px; }
  .sheet-source-title { min-width:0; flex:1; font-size:1rem; }
  .sheet-order-actions { flex-basis:100%; justify-content:flex-end; }
  .sheet-order-actions .button { min-width:44px; }
  .sheet-note-grid { grid-template-columns:minmax(0,1fr); gap:13px; padding-inline:13px; }
  .sheet-note-grid textarea { font-size:1rem; min-height:105px; }
  .sheet-quote { font-size:max(1.375rem,var(--reading-size)); }
  .footer-inner { padding:22px 20px; font-size:.875rem; }
  .mobile-only { display:initial; }
}
@media(max-width:390px) {
  .page { padding-inline:13px; }
  .hero,.library-hero { padding:21px 18px; }
  .hero h1,.library-hero h1 { font-size:2.12rem; }
  .home-search-row { display:grid; grid-template-columns:minmax(0,1fr); }
  .home-search .button { min-height:46px; }
  .quick-start .button { flex:1; }
  .stat { padding-inline:12px; }
  .reader-page .button { padding-inline:10px; }
  .reading-mode-tabs button { padding-inline:4px; }
  .halakha,.reader-grid.clean .halakha { padding-inline:17px; }
  .halakha-head .toolbar-group { width:100%; justify-content:flex-end; }
}
@media screen and (max-width:720px) {
  .focus-original>.reading-heading { display:none; }
  .reader-context-bar { padding-block:8px; gap:6px; }
  .reader-context-bar>div { width:100%; }
  .reader-context-bar .eyebrow { display:none; }
  .reader-context-bar .toolbar-group { justify-content:space-between; }
  .reader-location { font-size:1rem; }
  .focus-original .halakha-head { flex-wrap:nowrap; margin-bottom:10px; }
  .focus-original .halakha-head .toolbar-group { width:auto; }
}
@media(prefers-reduced-motion:reduce) {
  html { scroll-behavior:auto; }
  *,*::before,*::after { animation:none!important; transition:none!important; }
}
@media print {
  @page { size:A4; margin:18mm; }
  html,body { background:#fff!important; color:#000!important; }
  body { font-size:11pt; padding-bottom:0; }
  .site-header,.site-footer,.skip-link,.mobile-nav,.reader-toolbar,.reader-context-bar,.reader-controls,.reader-mobile-tabs,.reader-sidebar,.reading-mode-tabs,.mobile-reader-stepper,.reader-stepper,.button,.toast,.mobile-only,.search-form,.source-actions,.commentator-chips,.chapter-source-anchor,.compare-column>.field-label,.results-pagination,noscript { display:none!important; }
  #app { min-height:0; }
  .page,.page.reader-page,.page:has(.reader-grid) { max-width:none; width:auto; padding:0; margin:0; }
  .reader-grid,.reader-grid.clean,.focus-grid,.compare-grid { display:block; }
  .reading-pane,.commentary-pane,.reader-grid.clean .commentary-pane,.focus-original,.focus-commentaries,.compare-column { display:block!important; position:static; overflow:visible; max-height:none; border:0; box-shadow:none; padding:0; background:#fff; }
  .reading-heading,.focus-commentaries .reading-heading { border:0; border-bottom:1px solid #777; padding:0 0 14pt; margin-bottom:8pt; background:#fff; }
  .halakha,.halakha.selected,.reader-grid.clean .halakha { background:#fff; border-inline:0; padding:11pt 0 13pt; border-bottom:1px solid #ccc; break-inside:avoid; }
  .halakha-head { margin-bottom:5pt; }
  .torah-text,.commentary-card .torah-text,.source-anchor .torah-text,.sheet-quote { font-size:13pt; line-height:1.8; color:#000; }
  .commentary-pane,.focus-commentaries,.compare-column { margin-top:20pt; }
  .commentary-card { border:0; border-top:1px solid #999; padding:12pt 0; margin-bottom:9pt; break-inside:avoid; }
  .commentary-title { font-size:12pt; color:#000; }
  .source-line { font-size:9pt; color:#333; }
  .source-line summary { min-height:0; }
  .notice,.source-anchor { border-color:#aaa; background:#fff; }
  a { color:#000; }
  .about-grid,.commentator-grid,.book-groups,.library-book-grid { display:block; }
  .about-card,.book-group,.result-card,.saved-card { border:0; border-bottom:1px solid #aaa; border-radius:0; box-shadow:none; padding:15pt 0; break-inside:avoid; }
  .hero,.library-hero { background:#fff; border:0; box-shadow:none; padding:0; }
  .sheet-heading label,.sheet-heading input,.sheet-heading .pill,.sheet-heading .eyebrow,.sheet-title-input,.sheet-tools,.sheet-device-note,.sheet-order-actions,.sheet-notes,.sheet-undo { display:none!important; }
  .sheet-heading { display:block; margin-bottom:0; }
  .sheet-print-title { display:block; font-size:22pt; margin:0 0 20pt; padding-bottom:12pt; border-bottom:1px solid #555; }
  .sheet-list { display:block; }
  .sheet-card { border:0; border-bottom:1px solid #aaa; border-radius:0; box-shadow:none; padding:15pt 0 18pt; margin:0; background:#fff; break-inside:auto; }
  .sheet-card-head { break-after:avoid; padding-bottom:8pt; margin-bottom:10pt; }
  .sheet-source-number { border:1px solid #aaa; background:#fff; color:#000; min-width:23pt; min-height:23pt; }
  .sheet-source-title { font-size:12pt; color:#000; }
  .sheet-card>.source-line { display:none; }
  .sheet-source-title h2 { font-size:12pt; }
  .sheet-source-title small { font-size:10pt; color:#333; }
  .sheet-notes { display:block; border:0; border-right:2px solid #aaa; border-radius:0; padding-right:12pt; margin-top:12pt; background:#fff; }
  .sheet-source-print { display:block; font-size:9pt; line-height:1.6; color:#333; margin-top:10pt; overflow-wrap:anywhere; }
  .sheet-print-only { display:block; margin-top:20pt; padding-top:10pt; border-top:1px solid #aaa; font-size:9pt; color:#333; }
  .sheet-note-grid { display:block; padding:0; }
  .sheet-note-grid .field-label { color:#222; break-inside:avoid; }
  .sheet-note-print h4 { font-size:11pt; margin:9pt 0 3pt; }
  .sheet-note-print section { break-inside:avoid; }
  .sheet-note-print p { margin:0; }
  .sheet-note-print { display:block; white-space:pre-wrap; color:#111; font-weight:400; font-size:11pt; margin:3pt 0 10pt; }
}

/* Seasonal learning entry. */
.hanukkah-entry{display:flex;align-items:center;justify-content:space-between;gap:24px;margin:0 0 28px;padding:25px 30px;background:var(--paper);border:1px solid var(--line-strong);border-inline-start:4px solid var(--blue);border-radius:12px}.hanukkah-entry h2{margin-bottom:5px}.hanukkah-entry p{margin-bottom:6px}.hanukkah-entry .eyebrow{margin-bottom:4px}.hanukkah-entry .button{flex:none}@media(max-width:700px){.hanukkah-entry{display:block;padding:22px}.hanukkah-entry .button{margin-top:12px}}

/* Daily learning sits beside the library entrance, following the learner's local date. */
@font-face{font-family:'Noto Serif Hebrew';src:url('/fonts/noto-serif-hebrew.woff') format('woff');font-weight:400;font-display:swap}
@font-face{font-family:'Noto Serif Hebrew';src:url('/fonts/noto-serif-hebrew-bold.woff') format('woff');font-weight:700;font-display:swap}
@font-face{font-family:'Noto Sans Hebrew';src:url('/fonts/noto-sans-hebrew.woff') format('woff');font-weight:400;font-display:swap}
@font-face{font-family:'Noto Sans Hebrew';src:url('/fonts/noto-sans-hebrew-bold.woff') format('woff');font-weight:700;font-display:swap}
.home-learning-rail{display:flex;flex-direction:column;gap:14px;min-width:0}
.daily-learning-card,.holiday-learning-card{display:block;padding:23px 24px;border:1px solid var(--line-strong);border-radius:10px;color:var(--ink);transition:border-color .15s,box-shadow .15s}
.daily-learning-card{background:var(--sky);border-inline-start:4px solid var(--blue)}
.holiday-learning-card{background:var(--paper)}
.daily-learning-card:hover,.holiday-learning-card:hover{border-color:var(--blue);box-shadow:0 3px 15px #163d5110;color:var(--ink)}
.home-learning-rail .eyebrow{display:block;font-size:.8125rem;margin-bottom:7px}
.home-learning-rail h2{font-size:1.5rem;margin:0 0 7px}
.daily-learning-card>strong{font:700 1.8rem/1.5 var(--serif);display:block;margin-bottom:7px}
.daily-learning-card>span:last-child,.holiday-learning-card>span:last-child{display:block;color:var(--muted);font-size:.875rem;line-height:1.75}
.home-resume-link{display:block;font-size:.875rem;line-height:1.75;padding:2px 7px}
#library-folio{margin-top:16px}
@media(max-width:760px){.library-hero{display:flex;flex-direction:column;padding:18px;gap:22px}.home-learning-rail{order:-1;width:100%;display:grid;grid-template-columns:1fr 1fr;gap:10px}.daily-learning-card,.holiday-learning-card{padding:16px 13px}.home-learning-rail h2{font-size:1.18rem;line-height:1.5}.daily-learning-card>strong{font-size:1.5rem}.home-learning-rail .eyebrow{font-size:.8125rem}.home-learning-rail> .home-resume-link{grid-column:1/-1}.daily-learning-card>span:last-child,.holiday-learning-card>span:last-child{font-size:.8125rem}.library-hero .hero-copy{width:100%}.library-hero h1{font-size:1.85rem;line-height:1.35}.library-hero h1 br{display:none}.library-hero .hero-copy>.eyebrow{display:none}.library-hero .hero-copy>.lead{font-size:.9375rem}.reading-mode-tabs{flex-wrap:wrap}.reading-mode-tabs .button{font-size:.875rem;padding:8px 12px}}

@media(max-width:420px){.home-learning-rail{grid-template-columns:1fr}.home-learning-rail .daily-learning-card,.home-learning-rail .holiday-learning-card{padding:16px 18px}.home-learning-rail h2{font-size:1.3rem}.home-learning-rail .daily-learning-card strong{font-size:1.55rem}.home-learning-rail .daily-learning-card>span:last-child,.home-learning-rail .holiday-learning-card>span:last-child{font-size:.85rem}.home-learning-rail .holiday-learning-card h2{margin-bottom:5px}}
