html { font-size: 15px; position: relative; min-height: 100%; }
@media (min-width: 768px) { html { font-size: 16px; } }
body { background: #f6f7fb; }
.app-nav { background: linear-gradient(90deg, #1e3a8a, #2563eb); }
.hebrew { direction: rtl; unicode-bidi: isolate; font-family: "David", "Frank Ruhl Libre", "Times New Roman", serif; font-size: 1.1em; }
.card { border: 0; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.today-card { background: #fff; border-left: 5px solid #2563eb; }
.badge-birthday { background: #f59e0b; }
.badge-yahrzeit { background: #475569; }
.occ-row.is-soon { background: #fff8e6; }
.occ-row.is-today { background: #fde68a; }
.days-away { min-width: 5.5rem; }
.candle { font-size: 1.2rem; }
div.hebrew { text-align: left; }
.candle-time { background:#fff8e6; border-radius:.375rem; padding:.2rem .5rem; display:inline-block; }
.badge-anniversary { background: #db2777; }
.tehillim-said { border-left: 5px solid #16a34a; }
.tehillim-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(3rem, 1fr)); gap: .35rem; }
.tehillim-text { font-family: "SBL Hebrew", "Ezra SIL", "Taamey Frank CLM", "David", "Frank Ruhl Libre", "Times New Roman", serif; font-size: 1.6rem; line-height: 2; text-align: justify; }
.tehillim-chapter { font-size: 1.15em; font-weight: 700; border-bottom: 1px solid #e5e7eb; padding-bottom: .2rem; margin-bottom: .5rem; }
.tehillim-chapter-num { font-family: Segoe UI, Arial, sans-serif; font-size: .55em; font-weight: 400; color: #6b7280; margin-inline-start: .5rem; }
.tehillim-vnum { font-size: .5em; color: #2563eb; margin-inline-end: .2em; font-weight: 600; }
.tehillim-group { font-size: .8em; font-weight: 700; color: #1e3a8a; background: #eef2ff; border-radius: .375rem; padding: .3rem .7rem; margin: 1.5rem 0 .75rem; }
.tehillim-for { font-family: Segoe UI, Arial, sans-serif; font-size: .5em; color: #6b7280; margin: -.3rem 0 .4rem; text-align: right; }
.hkb-wrap { position: relative; }
.hkb-wrap > input, .hkb-wrap > textarea { padding-left: 2.4rem; }
.hkb-toggle { position: absolute; left: .35rem; top: 50%; transform: translateY(-50%); border: 0; background: transparent; font-size: 1.2rem; line-height: 1; color: #6b7280; padding: .2rem; cursor: pointer; }
.hkb-toggle:hover { color: #2563eb; }
.hkb { position: absolute; z-index: 1080; background: #f1f5f9; border: 1px solid #cbd5e1; border-radius: .5rem; box-shadow: 0 6px 20px rgba(0,0,0,.15); padding: .4rem; user-select: none; }
.hkb[hidden] { display: none; }
.hkb-row { display: flex; justify-content: center; gap: .25rem; margin: .25rem 0; }
.hkb-key { min-width: 2.3rem; height: 2.5rem; border: 1px solid #cbd5e1; border-radius: .35rem; background: #fff; font-family: "David", "Frank Ruhl Libre", "Times New Roman", serif; font-size: 1.3rem; cursor: pointer; }
.hkb-key:hover { background: #e0e7ff; }
.hkb-key:active { background: #c7d2fe; }
.hkb-wide { min-width: 9rem; font-family: Segoe UI, Arial, sans-serif; font-size: .95rem; }
.hkb-fn { min-width: 3rem; font-family: Segoe UI, Arial, sans-serif; font-size: 1.1rem; background: #e2e8f0; }
@media (max-width: 480px) { .hkb-key { min-width: 1.85rem; height: 2.3rem; font-size: 1.15rem; } .hkb-row { gap: .15rem; } }
/* Reading page: title, buttons and pager stay at the top while the text scrolls. */
.tehillim-sticky { position: sticky; top: var(--app-header-height, 0px); z-index: 1010; background: #f6f7fb; padding: .5rem .75rem; margin: -.5rem -.75rem .75rem; transition: box-shadow .15s; }
.tehillim-sticky.is-stuck { box-shadow: 0 2px 6px rgba(0,0,0,.12); }
.tehillim-sticky > .d-flex:first-child { margin-bottom: .4rem !important; }
@media (max-width: 576px) {
    .tehillim-sticky { padding: .35rem .75rem; }
    .tehillim-sticky .tehillim-title h2 { font-size: 1.05rem; }
    .tehillim-sticky .tehillim-title .small.text-muted { display: none; }
    .tehillim-sticky .btn-sm { padding: .15rem .45rem; font-size: .8rem; }
    .tehillim-sticky .form-select-sm { font-size: .8rem; padding-top: .15rem; padding-bottom: .15rem; }
    .tehillim-sticky > .d-flex:first-child { gap: .35rem !important; }
}
/* The blue menu bar stays at the top of every page; --app-header-height is kept up to date by site.js. */
.app-header { margin-bottom: 1.5rem; }
@media (max-width: 576px) {
    .app-nav { padding-top: .3rem; padding-bottom: .3rem; }
    .app-nav .navbar-brand { font-size: 1.05rem; padding-top: .1rem; padding-bottom: .1rem; }
    .app-nav .navbar-toggler { padding: .15rem .45rem; }
}
/* Vertical scrolling stays native; horizontal swipes go to the page-turn script. */
.tehillim-text { touch-action: pan-y pinch-zoom; will-change: transform; }
