/* Tefilabook. Follows the owner's interface design: warm paper, burgundy accent, a book on wide screens.
   Layout: header with the menu (wide) or bottom tabs (phone); one view; everything mirrors for Hebrew. */
:root {
  --page: #EDE8E0; --bg: #F6F4EE; --pan: #FFFCF5; --ln: #DDD5C3; --tx: #2B2521; --mu: #6E665B;
  --ac: #5E2A35; --ac-ink: #FFF6E8; --gold: #94733D; --sand: #EDE5D3; --sand-ln: #DCCFB4;
  --sel: #EBDDDA; --sel-ln: #B39494; --seg: #E8E4D9; --hero: #4A1F28; --hero-ink: #FFF6E8; --hero-btn: #F4E3C4;
  --shd: 0 1px 2px rgba(60,40,20,.05); --lsh: rgba(60,40,20,.28);
  --ui: 'Open Sans', 'Noto Sans Hebrew', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --disp: Tinos, 'Noto Sans Hebrew', 'Times New Roman', serif;
  --heb: 'Frank Ruhl Libre', 'SBL Hebrew', 'Times New Roman', serif;
  --lat: Tinos, Georgia, 'Times New Roman', serif;
}
#app.night {
  --page: #05070D; --bg: #0B1020; --pan: #131B33; --ln: #26335A; --tx: #E9EDF9; --mu: #93A0C0;
  --ac: #F2C66D; --ac-ink: #0B1020; --gold: #6FE3FF; --sand: #172143; --sand-ln: #2B3A6B;
  --sel: rgba(242,198,109,.16); --sel-ln: #F2C66D; --seg: #1A2444; --hero: #1B2550; --hero-ink: #E9EDF9; --hero-btn: #F2C66D;
  --shd: none; --lsh: rgba(0,0,0,.55);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; overscroll-behavior: none; }
body { font-family: var(--ui); color: var(--tx); background: #EDE8E0; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
svg { flex: none; }
:focus-visible { outline: 2px solid var(--ac); outline-offset: 2px; }
[hidden] { display: none !important; }

#app { height: 100%; display: flex; flex-direction: column; background: var(--bg); color: var(--tx); transition: background .3s, color .3s;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left); }
#top { flex: none; min-height: 3.75rem; display: flex; align-items: center; gap: .75rem; padding: 0 1rem; border-bottom: 1px solid var(--ln); background: var(--pan); }
.brand { display: flex; align-items: center; gap: .55rem; min-height: 44px; border: 0; background: none; padding: 0; font-family: var(--disp); font-weight: 700; font-size: 1.45rem; color: var(--ac); direction: ltr; }
.mark { width: 2rem; height: 2rem; border-radius: .5rem; background: var(--ac); color: var(--ac-ink); display: flex; align-items: center; justify-content: center; }
.topnav { display: none; align-self: stretch; gap: .25rem; margin-inline-start: 1rem; }
.topnav button { border: 0; background: none; padding: 0 1rem; color: var(--mu); font-size: 1rem; border-bottom: 3px solid transparent; border-top: 3px solid transparent; }
.topnav button.act { color: var(--ac); font-weight: 700; border-bottom-color: var(--ac); }
.grow { flex: 1; }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--seg); border: 1px solid var(--ln); max-width: 100%; }
.seg button { min-height: 34px; padding: 0 .85rem; border: 0; border-radius: 8px; background: transparent; color: var(--mu); font-size: .85rem; white-space: nowrap; }
.seg button.on { background: var(--pan); color: var(--ac); font-weight: 700; box-shadow: 0 0 0 1px var(--ln); }
.seg.big button { min-height: 40px; padding: 0 1.2rem; font-size: .9rem; }
.icon { width: 44px; height: 44px; border: 0; border-radius: 10px; background: none; color: var(--mu); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.icon.box { border: 1px solid var(--ln); background: var(--pan); color: var(--tx); }
.icon.on { color: var(--ac); border-color: var(--sel-ln); background: var(--sel); }

#view { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; outline: none; }
#view.fixed { overflow: hidden; display: flex; flex-direction: column; }
.wrap { max-width: 76rem; margin: 0 auto; padding: 1.25rem 1rem 2rem; display: flex; flex-direction: column; gap: 1.1rem; animation: vin .35s cubic-bezier(.2,.8,.2,1); }
.wrap.narrow { max-width: 54rem; }
@keyframes vin { from { opacity: 0; transform: translateY(10px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .wrap { animation: none; } }

#tabs { flex: none; display: flex; padding: .3rem .5rem calc(.3rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--ln); background: var(--pan); }
.nv { flex: 1; min-width: 0; height: 3.3rem; border: 0; background: none; color: var(--mu); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: .75rem; white-space: nowrap; }
.nv span { width: 3rem; height: 1.6rem; border-radius: 999px; display: flex; align-items: center; justify-content: center; }
.nv.act { color: var(--ac); font-weight: 700; }
.nv.act span { background: var(--sel); }

.h1 { font-family: var(--disp); font-weight: 300; font-size: 2.6rem; line-height: 1.15; }
.h2 { font-family: var(--disp); font-weight: 300; font-size: 1.75rem; line-height: 1.2; }
html[dir="ltr"] .h1, html[dir="ltr"] .h2 { font-weight: 400; }
.lab { font-weight: 700; font-size: .9rem; color: var(--gold); }
.mut { color: var(--mu); font-size: .88rem; }
.link { border: 0; background: none; padding: .4rem 0; color: var(--ac); font-weight: 700; font-size: .88rem; }
.sb { display: flex; justify-content: space-between; align-items: baseline; gap: .75rem; flex-wrap: wrap; }
.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: .75rem; min-width: 0; }
.split { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); align-items: start; }
.panel { padding: 1.1rem 1.25rem; border: 1px solid var(--ln); border-radius: 16px; background: var(--pan); box-shadow: var(--shd); display: flex; flex-direction: column; gap: .9rem; min-width: 0; }
.sand { background: var(--sand); border-color: var(--sand-ln); }
.chips { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); }
.chip { min-height: 44px; padding: .35rem .8rem; border: 1px solid var(--ln); border-radius: 8px; background: var(--pan); box-shadow: var(--shd); display: flex; align-items: center; justify-content: space-between; gap: .5rem; text-align: start; font-weight: 700; font-size: .9rem; min-width: 0; }
.chip small { font-weight: 400; color: var(--mu); font-size: .78rem; }
.chip .chev { color: var(--gold); display: flex; }
html[dir="rtl"] .flip { transform: scaleX(-1); }
.chip.on, .pill.on { background: var(--sel); border-color: var(--sel-ln); color: var(--ac); }
.pills { display: flex; gap: .5rem; flex-wrap: wrap; }
.pill { min-height: 42px; padding: 0 1.2rem; border: 1px solid var(--ln); border-radius: 10px; background: var(--pan); font-weight: 600; font-size: .92rem; color: var(--mu); }
.cta { min-height: 46px; padding: 0 1.2rem; border: 0; border-radius: 9px; background: var(--ac); color: var(--ac-ink); font-weight: 700; font-size: .95rem; display: inline-flex; align-items: center; justify-content: center; gap: .6rem; }
.cta[disabled] { background: var(--seg); color: var(--mu); cursor: default; }
.ghost { min-height: 46px; padding: 0 1.2rem; border: 1px solid var(--ln); border-radius: 9px; background: var(--pan); font-weight: 700; font-size: .9rem; color: var(--ac); display: inline-flex; align-items: center; justify-content: center; gap: .5rem; }
.ghost[disabled] { color: var(--mu); opacity: .5; cursor: default; }
.inp { width: 100%; min-height: 3.2rem; padding: 0 1rem; border: 1px solid var(--ln); border-radius: 10px; background: var(--bg); font-family: var(--disp); font-size: 1.6rem; }
.search { display: flex; align-items: center; gap: .6rem; min-height: 44px; padding: 0 .9rem; border: 1px solid var(--ln); border-radius: 10px; background: var(--bg); color: var(--mu); }
.search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: .92rem; }
.note { color: var(--mu); font-size: .82rem; }
.err { color: #A3261F; }
.nums { display: grid; grid-template-columns: repeat(auto-fill, minmax(3.3rem, 1fr)); gap: .4rem; }
.num { min-height: 46px; border: 1px solid var(--ln); border-radius: 8px; background: var(--pan); display: flex; flex-direction: column; align-items: center; justify-content: center; font-family: var(--heb); font-weight: 700; font-size: 1.05rem; line-height: 1.1; }
.num small { font-family: var(--ui); font-weight: 400; font-size: .66rem; color: var(--mu); }
.num.on { background: var(--sel); border-color: var(--sel-ln); color: var(--ac); }

/* Home */
.hero { position: relative; overflow: hidden; min-height: 13rem; padding: 1.4rem 1.5rem; border-radius: 16px; background: var(--hero); color: var(--hero-ink); display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: .35rem; }
.hero .tag { display: flex; align-items: center; gap: .4rem; font-weight: 700; font-size: .85rem; color: var(--hero-btn); }
.hero .name { font-family: var(--disp); font-weight: 400; font-size: 2.8rem; line-height: 1.1; }
.hero .sub { opacity: .85; }
.hero .cta { margin-top: .5rem; background: var(--hero-btn); color: #2B2521; }
.hero .art { position: absolute; inset-block: -8%; inset-inline-end: -2%; height: 116%; width: auto; opacity: .95; pointer-events: none; }
.hero > :not(.art) { position: relative; z-index: 1; }
.soon { position: relative; overflow: hidden; align-items: flex-start; justify-content: center; gap: .3rem; text-align: start; width: 100%; }
.soon .art { position: absolute; inset-inline-end: .9rem; bottom: .7rem; width: 5.6rem; height: auto; color: var(--gold); opacity: .8; }
.soon > :not(.art) { position: relative; }
.shelf { display: grid; gap: .75rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bookcard { padding: 0; overflow: hidden; border: 1px solid var(--ln); border-radius: 12px; background: var(--pan); box-shadow: var(--shd); display: flex; flex-direction: column; text-align: start; }
.bookcard .cover { height: 5rem; display: flex; align-items: center; justify-content: center; }
.bookcard .cover svg { height: 4.2rem; width: auto; transform: rotate(-6deg); }
.bookcard .meta { padding: .4rem .6rem .6rem; display: flex; flex-direction: column; }
.bookcard b { font-family: var(--disp); font-weight: 400; font-size: 1.35rem; line-height: 1.2; }
.quick { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }
.qrow { min-height: 4.2rem; padding: .7rem .9rem; border: 1px solid var(--sand-ln); border-radius: 12px; background: var(--sand); display: flex; align-items: center; gap: .8rem; text-align: start; }
.qrow .ic { width: 2.6rem; height: 2.6rem; border-radius: 8px; background: var(--sel); color: var(--ac); display: flex; align-items: center; justify-content: center; }
.qrow span.t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.qrow b { font-size: 1rem; }
.qrow small { color: var(--mu); font-size: .8rem; }

/* Side card with a book cover */
.pick { align-items: flex-start; }
.pick .cover svg { height: 5.5rem; width: auto; transform: rotate(-5deg); }
.pick .name { font-family: var(--disp); font-weight: 300; font-size: 2.4rem; line-height: 1.15; }
html[dir="ltr"] .pick .name { font-weight: 400; }

/* Calendar */
.g7 { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .4rem; }
.wk { text-align: center; font-weight: 700; font-size: .85rem; color: var(--mu); padding-bottom: .2rem; }
.cday { position: relative; min-height: 3.6rem; border: 1px solid transparent; border-radius: 8px; background: var(--sand); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem; font-size: 1.1rem; line-height: 1.1; padding: 0; }
.cday span { font-size: .7rem; color: var(--mu); }
.cday.hol::before { content: ''; position: absolute; top: .4rem; inset-inline-start: .45rem; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); }
.cday.today { background: var(--sel); border-color: var(--ac); font-weight: 700; color: var(--ac); }
.cday.pick { border-color: var(--sel-ln); }
.cday.blank { visibility: hidden; }
.rw { display: flex; justify-content: space-between; align-items: center; gap: .75rem; min-height: 3rem; padding: .3rem 0; border-bottom: 1px solid var(--ln); }
.rw:last-of-type { border-bottom: 0; }
.rw b { font-size: .95rem; }
.rw span { color: var(--mu); font-size: .85rem; text-align: end; }
.rw .time { font-family: var(--disp); font-weight: 700; font-size: 1.25rem; color: var(--ac); }

/* Settings rows */
.set { padding: .4rem 1.25rem; gap: 0; }
.srow { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding: 1rem 0; border-bottom: 1px solid var(--ln); }
.srow:last-child { border-bottom: 0; }
.srow > span { display: flex; flex-direction: column; gap: .2rem; min-width: 0; flex: 1 1 14rem; }
.srow b { font-size: 1.1rem; }
.srow small { color: var(--mu); font-size: .85rem; }

/* Gematria */
.bigval { font-family: var(--disp); font-size: 4.2rem; line-height: 1; color: var(--ac); }
.hit { font-family: var(--heb); font-size: 1.2rem; line-height: 1.6; direction: rtl; text-align: right; }
.hit mark { background: var(--sel); color: var(--ac); border-radius: 4px; padding: 0 .1em; }
.res { padding: .8rem 1rem; border: 1px solid var(--ln); border-radius: 10px; background: var(--pan); display: flex; flex-direction: column; gap: .35rem; text-align: start; width: 100%; }

/* Reader */
.reader { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; width: 100%; max-width: 80rem; margin: 0 auto; }
.crumbs { flex: none; display: flex; align-items: center; gap: .4rem; padding: .7rem 1rem 0; color: var(--ac); font-size: .95rem; }
.crumbs button { border: 0; background: none; padding: .3rem 0; color: var(--ac); min-height: 36px; }
.crumbs button:last-child { font-weight: 700; }
.rbar { flex: none; display: flex; align-items: center; gap: .5rem; padding: .4rem 1rem .5rem; }
.stage { flex: 1; min-height: 0; position: relative; perspective: 2400px; padding: 0 1rem; touch-action: pan-y; user-select: none; -webkit-user-select: none; direction: ltr; }
.spread { height: 100%; display: grid; grid-template-columns: minmax(0, 1fr); position: relative; direction: ltr; }
.spread.two { grid-template-columns: minmax(0, 1fr) var(--gut, 2px) minmax(0, 1fr); }
.gutter { background: var(--sand-ln); }
@media (horizontal-viewport-segments: 2) {
  .spread.two { --gut: calc(env(viewport-segment-left 1 0, 0px) - env(viewport-segment-right 0 0, 0px)); }
  .gutter { background: var(--page); }
}
.slot { position: relative; min-width: 0; min-height: 0; }
.page { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--pan); border: 1px solid var(--sand-ln); overflow: hidden; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.spread.two .slot[data-s="L"] .page { border-radius: 14px 0 0 14px; border-right: 0; }
.spread.two .slot[data-s="R"] .page { border-radius: 0 14px 14px 0; border-left: 0; }
.slot[data-s="S"] .page, .leaf .page { border-radius: 14px; }
.phead { flex: none; display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; margin: 1rem 1.4rem 0; padding-bottom: .5rem; border-bottom: 1px solid var(--ln); font-size: .85rem; color: var(--gold); }
.phead b { font-weight: 700; }
.pbody { flex: 1; min-height: 0; padding: .8rem 1.4rem 0; overflow: hidden; }
.pbody.long { overflow-y: auto; }
.pfoot { flex: none; height: 1.9rem; padding: 0 1.4rem; display: flex; justify-content: space-between; align-items: center; color: var(--mu); font-size: .72rem; }
.ptitle { font-family: var(--disp); font-weight: 300; font-size: 1.9rem; line-height: 1.25; margin-bottom: .7rem; }
.ptitle.en { font-weight: 400; }
.heb { font-family: var(--heb); font-size: 1.5rem; line-height: 1.5; direction: rtl; text-align: right; }
.txt { font-family: var(--lat); font-size: 1.28rem; line-height: 1.38; direction: ltr; text-align: left; }
.heb .v, .txt .v { display: block; margin-bottom: .5em; }
.sub.txt { font-size: 1.05rem; color: var(--mu); }
.sub.heb { font-size: 1.2rem; color: var(--mu); }
.vb { padding-bottom: .55rem; margin-bottom: .55rem; border-bottom: 1px solid var(--ln); }
.vb .v { margin-bottom: .2em; }
.vn { font-family: var(--disp); font-weight: 400; margin-inline-end: .7em; color: var(--tx); }
.txt .vn { font-size: 1em; vertical-align: baseline; }
.sect { display: block; margin: .3em 0 .3em; font-family: var(--ui); font-weight: 700; font-size: .78em; color: var(--gold); }
.w { border-radius: 5px; padding: 0 .06em; cursor: pointer; transition: background .15s, color .15s; }
.w.pk { background: var(--sel); color: var(--ac); box-shadow: 0 0 0 1px var(--sel-ln); }
.leaf { position: absolute; z-index: 5; transform-style: preserve-3d; pointer-events: none; }
.leaf .page { box-shadow: 0 0 34px var(--lsh); }
.leaf .back { transform: rotateY(180deg); }
.leaf .shade { position: absolute; inset: 0; background: #000; opacity: 0; }
.measure { position: absolute; left: -9999px; top: 0; visibility: hidden; }
.measure .page { position: relative; inset: auto; }
.pager { flex: none; display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .7rem 1rem calc(.7rem + env(safe-area-inset-bottom)); }
.pager .mut { text-align: center; flex: 1; }
.load { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 2rem; color: var(--mu); }
.gchip { position: absolute; z-index: 6; left: 1.4rem; right: 1.4rem; bottom: 4.6rem; display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .55rem .9rem; border: 1px solid var(--ac); border-radius: 12px; background: var(--pan); box-shadow: 0 8px 30px var(--lsh); }
.gchip .val { font-family: var(--disp); font-weight: 700; font-size: 1.7rem; color: var(--ac); }
.gchip .sel { font-family: var(--heb); font-size: 1.15rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: rtl; }
.fsbar { display: none; }
#app.full #top, #app.full #tabs, #app.full .crumbs, #app.full .rbar, #app.full .pager { display: none; }
#app.full .stage { padding: .6rem .6rem 0; }
#app.full .fsbar { flex: none; display: flex; justify-content: center; gap: .4rem; padding: .35rem .5rem calc(.4rem + env(safe-area-inset-bottom)); opacity: .6; transition: opacity .2s; }
#app.full .fsbar:hover, #app.full .fsbar:focus-within { opacity: 1; }
.fsbar .ghost { min-height: 36px; padding: 0 .8rem; font-size: .8rem; }
#app.full .gchip { bottom: 3.4rem; }

/* Sheets */
.sheet-bg { position: fixed; inset: 0; z-index: 50; background: rgba(30,20,15,.45); display: flex; align-items: flex-end; justify-content: center; animation: fade .2s; }
.sheet { width: min(100%, 30rem); max-height: 82%; overflow-y: auto; padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom)); border-radius: 18px 18px 0 0; background: var(--pan); border: 1px solid var(--ln); border-bottom: 0; display: flex; flex-direction: column; gap: .75rem; animation: up .25s cubic-bezier(.2,.8,.2,1); }
.sheet-h { display: flex; justify-content: space-between; align-items: center; gap: 1rem; font-family: var(--disp); font-size: 1.4rem; }
.list { border: 1px solid var(--ln); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.li { min-height: 3.1rem; width: 100%; padding: .55rem 1rem; border: 0; border-bottom: 1px solid var(--ln); background: var(--pan); display: flex; align-items: center; justify-content: space-between; gap: 1rem; text-align: start; font-size: .95rem; font-weight: 600; }
.li:last-child { border-bottom: 0; }
.li > span:first-child { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.li small { color: var(--mu); font-size: .78rem; font-weight: 400; }
.li .chk { color: var(--ac); font-weight: 700; min-width: 1.2rem; text-align: center; }
.sheet .nums { max-height: 44vh; overflow-y: auto; padding: 2px; }
select.pill { appearance: none; -webkit-appearance: none; width: 100%; color: var(--tx); text-align: start; }

@media (min-width: 720px) {
  #top { padding: 0 2rem; min-height: 4.6rem; }
  .brand { font-size: 1.9rem; }
  .mark { width: 2.3rem; height: 2.3rem; }
  .topnav { display: flex; }
  #tabs { display: none; }
  .wrap { padding: 1.5rem 2rem 2.5rem; }
  .split { grid-template-columns: minmax(0, 2.1fr) minmax(16rem, 1fr); }
  .home-top { display: grid; gap: 1rem; grid-template-columns: minmax(0, 2.1fr) minmax(16rem, 1fr); }
  .bookcard { flex-direction: row; align-items: stretch; min-height: 6.5rem; }
  .bookcard .cover { width: 6rem; height: auto; }
  .bookcard .meta { flex: 1; justify-content: center; padding: .6rem 1.1rem; }
  .bookcard b { font-size: 1.9rem; font-weight: 300; }
  .stage { padding: 0 2rem; }
  .crumbs, .rbar { padding-left: 2rem; padding-right: 2rem; }
  .pager { padding-left: 2rem; padding-right: 2rem; }
  .sheet-bg { align-items: center; }
  .sheet { border-radius: 18px; border-bottom: 1px solid var(--ln); }
  .phead { margin: 1.1rem 1.9rem 0; } .pbody { padding: .9rem 1.9rem 0; } .pfoot { padding: 0 1.9rem; }
}
@media (max-width: 719px) {
  .h1 { font-size: 2rem; }
  .hero .name { font-size: 2.2rem; }
  .hero .art { opacity: .5; }
  .seg button { padding: 0 .6rem; }
  #top { gap: .35rem; padding: 0 .6rem; }
  .brand { font-size: 1.2rem; gap: .4rem; }
  .brand .mark { width: 1.8rem; height: 1.8rem; }
  .icon { width: 38px; }
  .rbar { flex-wrap: wrap; }
}
.rbar .crumbs { padding: 0; min-width: 0; }
.crumbs button { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html[dir="ltr"] .flipl { transform: scaleX(-1); }
.pager { direction: inherit; }
.shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) { .shelf { grid-template-columns: repeat(4, minmax(0, 1fr)); } .bookcard b { font-size: 1.5rem; } .bookcard .cover { width: 4.6rem; } .bookcard .meta { padding: .6rem .8rem; } }
/* Full screen: a solid Exit button on top, and the bottom strip fully visible. */
html, body { height: 100dvh; }
.fstop { display: none; }
#app.full .fstop { flex: none; display: flex; align-items: center; gap: .6rem; padding: .5rem .6rem 0; }
.fstop .cta, .fstop .ghost { min-height: 40px; padding: 0 .9rem; font-size: .85rem; white-space: nowrap; }
.fsname { flex: 1; min-width: 0; text-align: center; font-family: var(--disp); font-size: 1.1rem; color: var(--mu); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#app.full .fsbar { opacity: 1; }
#app.full .fsbar .ghost { min-height: 40px; }
.stage { -webkit-touch-callout: none; }
/* Torah codes table */
.cgrid { display: grid; gap: 2px; direction: rtl; font-family: var(--heb); font-size: 1.15rem; line-height: 1; }
.cgrid span, .cgrid i { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border: 1.5px solid transparent; color: var(--mu); }
.cgrid .on { border-color: var(--ac); border-radius: 50%; background: var(--sel); color: var(--ac); font-weight: 700; }
.cgrid .on2 { border-color: var(--gold); border-radius: 3px; color: var(--tx); font-weight: 700; }
.cgrid .on.on2 { border-radius: 30%; }
.cgrid-key { width: 1.1rem; height: 1.1rem; border: 1.5px solid var(--ac); border-radius: 50%; background: var(--sel); }
.cgrid-key.on2 { border-color: var(--gold); border-radius: 3px; background: none; }
@media (max-width: 719px) { .cgrid { font-size: 1rem; gap: 1px; } }
.tick { flex: none; width: 1.2rem; height: 1.2rem; border-radius: 5px; border: 1.5px solid var(--sel-ln); display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; color: var(--ac-ink); }
.tick.on { background: var(--ac); border-color: var(--ac); }
.search input::-webkit-search-cancel-button { display: none; }
.cverse { font-size: 1.6rem; line-height: 1.75; color: var(--tx); }
.cverse mark { background: var(--sel); color: var(--ac); font-weight: 700; border-radius: 50%; padding: 0 .12em; box-shadow: 0 0 0 1.5px var(--ac); }
.soon { align-items: stretch; gap: .5rem; }
.soonb { position: relative; border: 0; background: none; padding: 0; text-align: start; display: flex; flex-direction: column; gap: .15rem; width: 100%; }
.soonb .rw { border-bottom: 0; min-height: 2.1rem; padding: 0; }
.soonb .rw > span:first-child { color: var(--tx); font-size: .95rem; text-align: start; }
.soon .art { opacity: .28; width: 4.6rem; }
.stepper { display: inline-flex; align-items: center; gap: .6rem; }
.stepper .icon { width: 48px; height: 48px; font-size: 26px; line-height: 1; }
.stepper .icon[disabled] { opacity: .35; cursor: default; }
.stepper b { min-width: 3.2rem; text-align: center; font-family: var(--disp); font-size: 28px; color: var(--ac); }
/* Reading text follows the chosen size; 16 is the base. */
:root { --fs: 1; }
.heb { font-size: calc(1.5rem * var(--fs)); }
.txt { font-size: calc(1.28rem * var(--fs)); }
.sub.txt { font-size: calc(1.05rem * var(--fs)); }
.sub.heb { font-size: calc(1.2rem * var(--fs)); }
.ptitle { font-size: calc(1.9rem * min(var(--fs), 1.6)); }
.hit { font-size: calc(1.2rem * var(--fs)); }
.cverse { font-size: calc(1.6rem * var(--fs)); }
.res .txt { font-size: calc(1.05rem * var(--fs)) !important; }
/* Civil day number in each calendar cell: bold and easy to read. */
.cday span { font-weight: 700; font-size: .82rem; color: var(--tx); }
.cday.today span { color: var(--ac); }
.cday.holsel { background: var(--ac); color: var(--ac-ink); border-color: var(--ac); font-weight: 700; }
.cday.holsel span { color: var(--ac-ink); }
.cday.holsel.hol::before { background: var(--ac-ink); }
.cday.holsel.today { box-shadow: 0 0 0 2px var(--gold) inset; }
.cday.pick { border-color: var(--ac); border-width: 2px; }
input.pill { min-height: 42px; }
/* Rashi under a verse */
.rashi { display: block; margin: .35em 0 .6em; padding-inline-start: .7em; border-inline-start: 3px solid var(--sand-ln); font-family: var(--heb); font-size: calc(1.02rem * var(--fs)); line-height: 1.55; color: var(--mu); direction: rtl; text-align: right; font-weight: 400; }
.rashi .rlab { display: block; font-family: var(--ui); font-size: .72rem; color: var(--gold); letter-spacing: 0; }
.rashi .rline { display: block; margin-bottom: .25em; }
.rashi .rline b { color: var(--tx); }
/* Rashi text in the full text colour, day and night, so it is easy to read. */
.rashi { color: var(--tx); border-inline-start-color: var(--gold); }
.rashi .rline b { color: var(--ac); }
.rashi .rlab { font-size: .78rem; font-weight: 700; }
