:root {
  --ink: #2b1d0e;
  --ink-soft: #5b4a36;
  --ink-faint: #8a7a66;
  --paper: #f3e7cf;
  --paper-2: #ead9b8;
  --paper-edge: #d9c39b;
  --accent: #7a2e12;
  --accent-2: #b5651d;
  --gold: #b8892b;
  --panel: #fbf6ec;
  --panel-edge: #e2d3b6;
  --bar: rgba(43, 29, 14, 0.94);
  --bar-ink: #f3e7cf;
  --shadow: 0 10px 30px rgba(40, 25, 5, 0.25);
  --font-ar: "Amiri", "Noto Naskh Arabic", "Traditional Arabic", serif;
  --font-en: "Crimson Pro", "Georgia", serif;
  --font-ui: "Cairo", "Segoe UI", system-ui, sans-serif;
  --fs: 1.25rem;
  --bg-image: none;
}
body.night {
  --ink: #e8dcc4;
  --ink-soft: #c9b998;
  --ink-faint: #9b8c72;
  --paper: #1e1812;
  --paper-2: #26201a;
  --paper-edge: #3a3025;
  --accent: #e0a458;
  --accent-2: #d08a3a;
  --gold: #d6b45a;
  --panel: #171310;
  --panel-edge: #332a20;
  --bar: rgba(12, 9, 6, 0.95);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-ui);
  color: var(--ink);
  background: #1a120a;
  overflow: hidden;
}

/* ---------- Top bar ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 30; height: 60px;
  display: flex; align-items: center; gap: 14px; padding: 0 16px;
  background: var(--bar); color: var(--bar-ink);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 230, 180, 0.15);
  transition: transform .45s cubic-bezier(.4,0,.2,1), opacity .35s;
}
.brand { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.brand .cross { color: var(--gold); font-size: 22px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text b { font-family: var(--font-en); font-size: 17px; letter-spacing: .3px; }
.brand-text small { font-family: var(--font-ar); font-size: 13px; opacity: .85; }
.nav { display: flex; align-items: center; gap: 6px; }
.tools { margin-inline-start: auto; display: flex; align-items: center; gap: 6px; }
.select {
  appearance: none; background: rgba(255,255,255,.08); color: var(--bar-ink);
  border: 1px solid rgba(255,230,180,.25); border-radius: 8px; padding: 6px 10px;
  font-family: var(--font-ui); font-size: 14px; max-width: 190px;
}
.select option { color: #222; }
.select-ch { width: 74px; }
.icon-btn {
  background: rgba(255,255,255,.07); color: var(--bar-ink); border: 1px solid rgba(255,230,180,.2);
  border-radius: 8px; height: 36px; min-width: 36px; padding: 0 10px; cursor: pointer;
  font-family: var(--font-ui); font-size: 15px; display: inline-flex; align-items: center; gap: 6px;
  transition: background .2s, transform .1s;
}
.icon-btn:hover { background: rgba(255,255,255,.16); }
.icon-btn:active { transform: translateY(1px); }
.icon-btn.accent { background: rgba(184,137,43,.18); border-color: rgba(214,180,90,.45); }
.icon-btn.accent:hover { background: rgba(184,137,43,.32); }
.icon-btn[aria-pressed="true"] { background: var(--gold); color: #2b1d0e; }
.icon-btn .lbl { font-size: 13px; }
.seg { display: inline-flex; background: rgba(255,255,255,.07); border: 1px solid rgba(255,230,180,.2); border-radius: 8px; overflow: hidden; }
.seg button { background: transparent; border: 0; color: inherit; padding: 7px 10px; cursor: pointer; font-family: var(--font-ui); font-size: 13px; }
.seg button.active { background: var(--gold); color: #2b1d0e; font-weight: 600; }
.seg.small { background: rgba(0,0,0,.06); border-color: var(--panel-edge); color: var(--ink); }
.seg.small button.active { background: var(--accent); color: #fff; }

.banner { position: fixed; top: var(--topbar-h, 60px); inset-inline: 0; z-index: 25; background: #b5651d; color: #fff; padding: 8px 16px; font-size: 14px; text-align: center; }
.hidden { display: none !important; }

/* ---------- Layout ---------- */
.layout { position: fixed; inset: var(--top, 60px) 0 0 0; display: grid; grid-template-columns: 1fr 0; transition: grid-template-columns .4s cubic-bezier(.4,0,.2,1), inset .45s cubic-bezier(.4,0,.2,1); }
.layout.panel-open { grid-template-columns: 1fr minmax(380px, 42%); }
.reader { overflow-y: auto; overscroll-behavior: contain; scroll-behavior: smooth; position: relative;
  background:
    var(--bg-image) center / cover fixed,
    radial-gradient(ellipse at 50% 0%, rgba(255,245,220,.55), transparent 60%),
    radial-gradient(ellipse at 50% 100%, rgba(120,80,30,.35), transparent 60%),
    linear-gradient(180deg, var(--paper) 0%, var(--paper-2) 100%);
}
.reader::before { /* paper grain */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .35; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.35 0 0 0 0 0.25 0 0 0 0 0.1 0 0 0 .18 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body.night .reader::before { opacity: .2; }
body.has-bg .reader::before { display: none; }
body.has-bg .reader { background: var(--bg-image) center / cover no-repeat fixed, var(--paper); }
.page { position: relative; max-width: 860px; margin: 0 auto; padding: 34px 28px 120px; transition: padding .45s cubic-bezier(.4,0,.2,1), max-width .45s; }

.chapter-head { text-align: center; margin: 6px 0 26px; }
.chapter-head .book-ar { font-family: var(--font-ar); font-size: calc(var(--fs) * 1.9); color: var(--accent); line-height: 1.3; }
.chapter-head .book-en { font-family: var(--font-en); font-size: calc(var(--fs) * 1.25); color: var(--ink-soft); letter-spacing: 1px; text-transform: uppercase; }
.chapter-head .ornament { color: var(--gold); letter-spacing: 6px; margin-top: 6px; font-size: 14px; }

.verses { display: flex; flex-direction: column; gap: 2px; }
.verse { position: relative; display: grid; gap: 14px; padding: 7px 10px; border-radius: 8px; cursor: pointer; transition: background .2s; scroll-margin-top: 80px; }
.verse:hover { background: rgba(120,80,30,.08); }
.verse.active { background: rgba(184,137,43,.22); box-shadow: inset 3px 0 0 var(--accent); }
.verse .n { color: var(--accent-2); font-size: .7em; font-weight: 700; vertical-align: super; margin-inline-end: 6px; font-family: var(--font-ui); }
.verse .ar { font-family: var(--font-ar); font-size: var(--fs); line-height: var(--lh-ar, 1.95); direction: rtl; text-align: right; }
.verse .en { font-family: var(--font-en); font-size: calc(var(--fs) * .96); line-height: var(--lh-en, 1.7); direction: ltr; text-align: left; color: var(--ink); }
.lang-ar .verse .en, .lang-ar .chapter-head .book-en { display: none; }
.lang-en .verse .ar, .lang-en .chapter-head .book-ar { display: none; }
.lang-en .verse .en { font-size: calc(var(--fs) * 1.05); line-height: var(--lh-en, 1.8); }

.chapter-foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 44px; flex-wrap: wrap; }
.ghost { background: transparent; border: 1px solid var(--paper-edge); color: var(--ink-soft); border-radius: 8px; padding: 8px 14px; cursor: pointer; font-family: var(--font-ui); font-size: 14px; }
.ghost:hover { background: rgba(120,80,30,.08); }
.ghost.accent { color: var(--accent); border-color: var(--accent); }

/* ---------- Read mode: bar slides away, text moves up ---------- */
body.read .topbar { transform: translateY(-100%); opacity: 0; pointer-events: none; }
body.read .layout { inset: 0; grid-template-columns: 1fr 0; }
body.read .page { padding-top: 48px; max-width: 900px; }
body.read .banner { display: none; }
body.read .verse { padding: 9px 12px; }
body.read .exit-read { opacity: .55; pointer-events: auto; }
.exit-read { position: fixed; top: 14px; inset-inline-end: 16px; z-index: 40; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--paper-edge); background: var(--panel); color: var(--ink); font-size: 22px; cursor: pointer; opacity: 0; pointer-events: none; transition: opacity .3s; box-shadow: var(--shadow); }
.exit-read:hover { opacity: 1 !important; }

/* ---------- Side panel ---------- */
.panel { background: var(--panel); border-inline-start: 1px solid var(--panel-edge); display: flex; flex-direction: column; min-width: 0; overflow: hidden; box-shadow: -12px 0 30px rgba(40,25,5,.12); }
.panel-tabs { display: flex; align-items: center; gap: 4px; padding: 8px 10px; border-bottom: 1px solid var(--panel-edge); background: var(--panel); }
.ptab { display: inline-flex; align-items: center; gap: 6px; background: transparent; border: 1px solid transparent; color: var(--ink-soft); border-radius: 8px; padding: 8px 12px; cursor: pointer; font-family: var(--font-ui); font-size: 14px; }
.ptab.active { background: rgba(122,46,18,.1); color: var(--accent); border-color: rgba(122,46,18,.25); font-weight: 600; }
.panel-tabs .close { margin-inline-start: auto; background: transparent; color: var(--ink-soft); border-color: var(--panel-edge); }
.panel-body { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.explain-bar { display: flex; justify-content: space-between; gap: 8px; padding: 10px 12px 6px; flex-wrap: wrap; }
.explain-sub { padding: 0 16px 6px; font-size: 13px; color: var(--ink-faint); display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.explain-sub a { color: var(--accent); }
.explain-content { flex: 1; overflow-y: auto; padding: 6px 20px 40px; font-family: var(--font-ar); font-size: calc(var(--fs) * .92); line-height: 1.95; direction: rtl; text-align: right; }
.explain-content[dir="ltr"] { font-family: var(--font-en); direction: ltr; text-align: left; line-height: 1.7; font-size: calc(var(--fs) * .95); }
.explain-content h3 { font-family: inherit; color: var(--accent); font-size: 1.15em; margin: 1.3em 0 .4em; border-bottom: 1px dashed var(--panel-edge); padding-bottom: .2em; }
.explain-content p { margin: 0 0 .75em; }
.explain-content b { color: var(--ink); }
.explain-content sup { font-size: .7em; color: var(--accent-2); }
.explain-content .muted { color: var(--ink-faint); font-family: var(--font-ui); font-size: .85em; }
.explain-content .streaming::after { content: "▍"; color: var(--accent); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: 0; } }
.explain-content .cta { display: inline-block; margin-top: 8px; background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: 8px 14px; cursor: pointer; font-family: var(--font-ui); }
.explain-content .srcline { font-family: var(--font-ui); font-size: .78em; color: var(--ink-faint); margin-top: 24px; border-top: 1px solid var(--panel-edge); padding-top: 8px; }

/* ---------- Chat ---------- */
.chat { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.chat-intro { text-align: center; color: var(--ink-soft); padding: 18px 8px; }
.chat-intro .scale { font-size: 42px; color: var(--gold); }
.chat-intro h3 { margin: 6px 0; color: var(--accent); font-family: var(--font-ar); font-size: 1.4em; }
.chat-intro p { font-size: 14px; line-height: 1.7; max-width: 420px; margin: 0 auto 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.chip { background: rgba(122,46,18,.08); color: var(--accent); border: 1px solid rgba(122,46,18,.25); border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer; font-family: var(--font-ui); }
.chip:hover { background: rgba(122,46,18,.16); }
.msg { max-width: 94%; padding: 10px 14px; border-radius: 14px; line-height: 1.75; font-size: 15px; white-space: pre-wrap; word-wrap: break-word; }
.msg.user { align-self: flex-start; background: var(--accent); color: #fff; border-end-start-radius: 4px; }
.msg.bot { align-self: flex-end; background: rgba(120,80,30,.08); border: 1px solid var(--panel-edge); border-end-end-radius: 4px; font-family: var(--font-ar); font-size: calc(var(--fs) * .85); }
.msg.bot[dir="ltr"] { font-family: var(--font-en); font-size: calc(var(--fs) * .9); }
.msg.bot b { color: var(--accent); }
.msg.bot h3, .msg.bot h4 { margin: .6em 0 .2em; color: var(--accent); font-size: 1.05em; }
.msg.bot ul, .msg.bot ol { margin: .2em 0 .4em; padding-inline-start: 1.3em; }
.msg.bot li { margin: .15em 0; }
.msg.bot .cite { color: var(--accent-2); font-size: .85em; }
.msg.bot.streaming::after { content: "▍"; color: var(--accent); animation: blink 1s infinite; }
.msg .srcs { margin-top: 8px; font-family: var(--font-ui); font-size: 12px; color: var(--ink-faint); display: flex; flex-wrap: wrap; gap: 4px; }
.msg .srcs span { background: rgba(0,0,0,.05); border-radius: 6px; padding: 2px 7px; cursor: pointer; }
.msg .srcs span:hover { background: rgba(122,46,18,.12); color: var(--accent); }
.msg.err { align-self: center; background: #fde8e0; color: #7a2e12; font-size: 13px; }
body.night .msg.err { background: #3a1d12; color: #f0b9a2; }
.ask-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--panel-edge); background: var(--panel); }
.ask-form textarea { flex: 1; resize: none; border: 1px solid var(--panel-edge); border-radius: 12px; padding: 10px 12px; font-family: var(--font-ui); font-size: 15px; background: rgba(255,255,255,.5); color: var(--ink); max-height: 140px; }
body.night .ask-form textarea { background: rgba(255,255,255,.05); }
.send { width: 44px; border: 0; border-radius: 12px; background: var(--accent); color: #fff; font-size: 18px; cursor: pointer; }
.send:disabled { opacity: .5; cursor: default; }

/* ---------- Verse popover ---------- */
.verse-pop { position: fixed; z-index: 50; display: flex; gap: 6px; background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 10px; padding: 6px; box-shadow: var(--shadow); }
.verse-pop button { background: transparent; border: 0; color: var(--ink); cursor: pointer; font-family: var(--font-ui); font-size: 13px; padding: 6px 10px; border-radius: 6px; }
.verse-pop button:hover { background: rgba(122,46,18,.1); color: var(--accent); }

/* ---------- Mobile ---------- */
@media (max-width: 900px) {
  .topbar { height: auto; flex-wrap: wrap; padding: 8px 10px; gap: 8px; }
  .brand-text small { display: none; }
  .tools { margin-inline-start: 0; width: 100%; justify-content: flex-start; flex-wrap: wrap; }
  .icon-btn .lbl { display: none; }
  .layout { grid-template-columns: 1fr; grid-template-rows: 1fr 0; }
  .layout.panel-open { grid-template-columns: 1fr; grid-template-rows: 1fr 62%; }
  .panel { border-inline-start: 0; border-top: 1px solid var(--panel-edge); }
  .page { padding: 20px 16px 100px; }
  body.read .layout { inset: 0; }
}

/* ---------- Verse explanation & helper notes ---------- */
.verse-quote { margin: 4px 0 14px; padding: 10px 14px; border-inline-start: 3px solid var(--gold); background: rgba(184,137,43,.10); border-radius: 6px; font-style: normal; }
.verse-quote .n { color: var(--accent-2); font-weight: 700; font-size: .8em; margin-inline-end: 4px; }
.verse-pop button.primary { background: var(--accent); color: #fff; }
.verse-pop button.primary:hover { background: var(--accent-2); color: #fff; }
.engine-note { font-size: 12px; color: var(--ink-faint); margin-top: 12px; }

/* Chat under each explanation */
.ex-chat { margin-top: 22px; padding: 14px 14px 10px; border: 1px solid var(--panel-edge); border-radius: 14px; background: rgba(120,80,30,.05); font-family: var(--font-ui); }
.explain-content .ex-chat-title { margin: 0 0 2px; color: var(--accent); font-size: 1em; font-family: var(--font-ui); }
.explain-content .ex-chat-hint { margin: 0 0 10px; color: var(--ink-faint); font-size: .8em; line-height: 1.6; }
.ex-thread { display: flex; flex-direction: column; gap: 10px; }
.ex-thread:not(:empty) { margin-bottom: 10px; }
.ex-thread .msg p { margin: 0; }
.ex-form { display: flex; gap: 8px; }
.ex-form textarea { flex: 1; resize: none; border: 1px solid var(--panel-edge); border-radius: 12px; padding: 9px 12px; font-family: var(--font-ui); font-size: 15px; background: rgba(255,255,255,.6); color: var(--ink); max-height: 140px; }
body.night .ex-form textarea { background: rgba(255,255,255,.05); }
.ex-form .send { flex: none; height: 42px; }
.ex-form .send:disabled, .ask-form .send:disabled { opacity: .5; cursor: default; }
#authorSeg { flex-wrap: wrap; }

/* ---------- Voice: "I read", "I listen", the Sage ---------- */
.icon-btn.on { background: var(--gold); color: #2b1d0e; border-color: var(--gold); }
.verse.speaking { background: rgba(233,196,106,.30); box-shadow: inset 4px 0 0 var(--gold); border-radius: 10px; transition: background .4s; }
[dir="rtl"] .verse.speaking { box-shadow: inset -4px 0 0 var(--gold); }
.explain-content .speaking { background: rgba(233,196,106,.25); border-radius: 8px; transition: background .4s; }
.play-bar { position: fixed; z-index: 60; left: 0; right: 0; margin: 0 auto; width: fit-content; bottom: max(14px, env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 4px; padding: 6px 10px; border-radius: 999px; background: rgba(43,29,14,.94); color: #f3e3bd; box-shadow: 0 8px 28px rgba(0,0,0,.35); font-family: var(--font-ui); max-width: calc(100vw - 24px); flex-wrap: wrap; justify-content: center; }
.play-bar:not(.mode-listen) .listen-only { display: none; }
.pb-mode { font-size: 13px; padding: 0 8px; white-space: nowrap; }
.pb-btn { min-width: 36px; height: 36px; border: 0; border-radius: 999px; background: rgba(255,255,255,.08); color: inherit; font-size: 15px; cursor: pointer; }
.pb-btn:hover { background: rgba(255,255,255,.18); }
.pb-btn.main { background: var(--gold); color: #2b1d0e; font-weight: 700; min-width: 44px; height: 40px; }
.pb-btn.on { background: #b3261e; color: #fff; animation: micPulse 1.4s infinite; }
.pb-btn.off { opacity: .45; }
.pb-speed { font-size: 13px; min-width: 38px; text-align: center; }
.sage-dock { position: fixed; z-index: 61; inset-inline-end: 16px; bottom: 76px; display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 8px; max-width: min(380px, calc(100vw - 32px)); background: var(--panel); border: 1px solid var(--panel-edge); border-radius: 18px; box-shadow: 0 10px 30px rgba(0,0,0,.25); font-family: var(--font-ui); color: var(--ink); }
.sage-pic { width: 64px; height: 64px; flex: none; }
.sage-text { display: flex; flex-direction: column; gap: 2px; font-size: 13px; min-width: 0; }
.sage-text b { color: var(--accent); font-size: 14px; }
.sage-heard { color: var(--ink-faint); font-size: 12px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.sage-intro { width: 96px; height: 96px; margin: 0 auto; }
.sage-svg { width: 100%; height: 100%; overflow: visible; }
.sage-svg .sage-aura { opacity: .55; transform-origin: 60px 58px; transform-box: view-box; }
.sage-svg .sage-head { transform-origin: 60px 70px; transform-box: view-box; animation: sageIdle 5s ease-in-out infinite; }
.sage-svg .sage-mouth { transform-origin: 60px 55px; transform-box: view-box; }
.listening .sage-aura { animation: auraPulse 1.6s ease-in-out infinite; }
.listening .sage-head { animation: sageListen 2.4s ease-in-out infinite; }
.thinking .sage-aura { animation: auraThink 1s ease-in-out infinite; }
.speaking .sage-aura { opacity: .9; }
.speaking .sage-head { animation: sageNod 1.6s ease-in-out infinite; }
.speaking .sage-mouth { animation: talk .26s ease-in-out infinite alternate; }
@keyframes auraPulse { 0%,100% { transform: scale(.85); opacity: .35; } 50% { transform: scale(1.05); opacity: .8; } }
@keyframes auraThink { 0%,100% { opacity: .4; } 50% { opacity: .95; } }
@keyframes sageIdle { 0%,100% { transform: rotate(0); } 50% { transform: rotate(1.2deg); } }
@keyframes sageListen { 0%,100% { transform: rotate(0); } 50% { transform: rotate(-4deg); } }
@keyframes sageNod { 0%,100% { transform: rotate(0) translateY(0); } 50% { transform: rotate(1.5deg) translateY(1px); } }
@keyframes talk { from { transform: scaleY(.7); } to { transform: scaleY(2.6); } }
@keyframes micPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(179,38,30,.5); } 50% { box-shadow: 0 0 0 7px rgba(179,38,30,0); } }
.talk-btn { margin: 4px auto 12px; display: inline-flex; gap: 6px; align-items: center; border: 0; border-radius: 999px; padding: 10px 18px; background: var(--accent); color: #fff; font-family: var(--font-ui); font-size: 15px; cursor: pointer; }
.talk-btn.on { background: #b3261e; animation: micPulse 1.4s infinite; }
.mic { flex: none; width: 44px; border: 1px solid var(--panel-edge); border-radius: 12px; background: transparent; font-size: 18px; cursor: pointer; }
.ex-form .mic { height: 42px; }
.mic.on { background: #b3261e; border-color: #b3261e; animation: micPulse 1.4s infinite; }
.ex-listen { border: 1px solid var(--panel-edge); background: transparent; color: var(--accent); border-radius: 999px; padding: 3px 10px; font-family: var(--font-ui); font-size: 12px; cursor: pointer; margin-inline: 8px; }
.ex-listen:hover { background: rgba(122,46,18,.08); }
.msg-say { display: inline-block; margin-top: 6px; border: 0; background: transparent; cursor: pointer; font-size: 15px; opacity: .7; }
.msg-say:hover { opacity: 1; }
.toast { position: fixed; z-index: 70; left: 50%; top: calc(var(--top, 70px) + 12px); transform: translateX(-50%); background: rgba(43,29,14,.95); color: #f3e3bd; padding: 10px 16px; border-radius: 12px; font-family: var(--font-ui); font-size: 14px; max-width: calc(100vw - 32px); text-align: center; box-shadow: 0 8px 24px rgba(0,0,0,.3); }
body.read .play-bar, body.read .sage-dock { opacity: .92; }
.reader { scroll-padding-bottom: 90px; }

/* Night background: near-black brown with a faint gold diamond lattice (the user's reference picture) */
body.night .reader, body.night.has-bg .reader {
  background-color: #140f0a;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'%3E%3Cpath d='M14 1 L27 14 L14 27 L1 14 Z' fill='none' stroke='%23a9813f' stroke-opacity='.3' stroke-width='1'/%3E%3Ccircle cx='14' cy='14' r='1.1' fill='%23c79a4a' fill-opacity='.28'/%3E%3Ccircle cx='0' cy='0' r='1.1' fill='%23c79a4a' fill-opacity='.2'/%3E%3Ccircle cx='28' cy='0' r='1.1' fill='%23c79a4a' fill-opacity='.2'/%3E%3Ccircle cx='0' cy='28' r='1.1' fill='%23c79a4a' fill-opacity='.2'/%3E%3Ccircle cx='28' cy='28' r='1.1' fill='%23c79a4a' fill-opacity='.2'/%3E%3C/svg%3E"),
    radial-gradient(ellipse at 50% 30%, rgba(60,40,20,.35), rgba(0,0,0,0) 70%);
  background-size: 28px 28px, 100% 100%;
  background-attachment: fixed, fixed;
  background-repeat: repeat, no-repeat;
  background-position: 0 0, center;
}
body.night .reader::before { display: none; }

/* ---------- Pages: menu, Agpeya, search, saved, plan, settings ---------- */
.menu-btn { font-size: 20px; min-width: 40px; }
.drawer { position: fixed; z-index: 80; top: 0; bottom: 0; inset-inline-start: 0; width: min(300px, 84vw); background: var(--panel); border-inline-end: 1px solid var(--panel-edge); box-shadow: var(--shadow); transform: translateX(-105%); transition: transform .3s cubic-bezier(.4,0,.2,1); display: flex; flex-direction: column; font-family: var(--font-ui); }
[dir="rtl"] .drawer { transform: translateX(105%); }
body.drawer-open .drawer { transform: none; }
.drawer-shade { position: fixed; inset: 0; z-index: 79; background: rgba(0,0,0,.35); opacity: 0; pointer-events: none; transition: opacity .3s; }
body.drawer-open .drawer-shade { opacity: 1; pointer-events: auto; }
.drawer-head { padding: 18px 18px 12px; font-size: 18px; color: var(--accent); border-bottom: 1px solid var(--panel-edge); }
.drawer-head .cross { color: var(--gold); }
.drawer-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 18px; border: 0; background: transparent; color: var(--ink); font-family: var(--font-ui); font-size: 16px; cursor: pointer; text-align: start; }
.drawer-item:hover { background: rgba(122,46,18,.07); }
.drawer-item.active { background: rgba(184,137,43,.18); color: var(--accent); font-weight: 600; }
.di-ico { width: 24px; text-align: center; color: var(--gold); font-size: 18px; }
.page-view { position: fixed; z-index: 20; inset: var(--top, 60px) 0 0 0; display: flex; flex-direction: column; background: linear-gradient(180deg, var(--paper) 0%, var(--paper-2) 100%); color: var(--ink); font-family: var(--font-ui); }
body.night .page-view { background-color: #140f0a; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'%3E%3Cpath d='M14 1 L27 14 L14 27 L1 14 Z' fill='none' stroke='%23a9813f' stroke-opacity='.3' stroke-width='1'/%3E%3Ccircle cx='14' cy='14' r='1.1' fill='%23c79a4a' fill-opacity='.28'/%3E%3C/svg%3E"); background-size: 28px 28px; }
body.read .page-view { inset: 0; }
.pv-head { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--paper-edge); }
.pv-head h2 { margin: 0; font-size: 20px; color: var(--accent); font-family: var(--font-ar); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-back { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--paper-edge); background: transparent; color: var(--ink); font-size: 22px; cursor: pointer; }
[dir="rtl"] .pv-back { transform: scaleX(-1); }
.pv-tools .select { max-width: 46vw; }
.pv-body { flex: 1; overflow-y: auto; scroll-behavior: smooth; padding-bottom: 110px; }
.pv-inner { max-width: 860px; margin: 0 auto; padding: 18px 20px; }
.pv-inner h3 { color: var(--accent); margin: 22px 0 10px; font-size: 18px; }
.pv-inner h4 { margin: 18px 0 8px; color: var(--ink-soft); font-size: 15px; }
.pv-sub { color: var(--ink-faint); margin: 4px 0 14px; line-height: 1.7; }
.hour-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.hour-card { display: flex; flex-direction: column; gap: 6px; text-align: start; padding: 16px; border-radius: 14px; border: 1px solid var(--paper-edge); background: rgba(255,255,255,.35); color: var(--ink); cursor: pointer; font-family: var(--font-ui); }
body.night .hour-card { background: rgba(255,255,255,.04); }
.hour-card:hover { border-color: var(--gold); }
.hour-card b { font-family: var(--font-ar); font-size: 19px; color: var(--accent); font-weight: 400; }
.hour-card small { color: var(--ink-faint); font-size: 12px; line-height: 1.6; }
.hour-card.now { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(184,137,43,.35); }
.badge { align-self: flex-start; background: var(--gold); color: #2b1d0e; border-radius: 999px; padding: 1px 9px; font-size: 11px; font-weight: 700; }
.agpeya-text { max-width: 860px; margin: 0 auto; padding: 18px 26px 40px; font-family: var(--font-ar); font-size: var(--fs); line-height: var(--lh-ar, 1.95); text-align: justify; }
.agpeya-text[dir="ltr"] { font-family: var(--font-en); line-height: var(--lh-en, 1.7); }
.agpeya-text h3 { color: var(--accent); font-size: 1.15em; margin: 1.4em 0 .4em; text-align: center; border-bottom: 1px dashed var(--paper-edge); padding-bottom: .25em; }
.agpeya-text p { margin: 0 0 .7em; }
.agpeya-text b { color: var(--accent-2); font-weight: 400; }
.agpeya-text .speaking { background: rgba(233,196,106,.28); border-radius: 8px; }
.agpeya-text .srcline { font-family: var(--font-ui); font-size: 12px; color: var(--ink-faint); text-align: center; }
.srch-form { display: flex; gap: 8px; }
.srch-form input { flex: 1; font-size: 17px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--paper-edge); background: rgba(255,255,255,.6); color: var(--ink); font-family: var(--font-ui); }
body.night .srch-form input { background: rgba(255,255,255,.06); }
.primary { background: var(--accent); color: #fff; border: 0; border-radius: 12px; padding: 0 18px; font-size: 18px; cursor: pointer; font-family: var(--font-ui); }
.srch-opts { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.srch-res { display: flex; flex-direction: column; gap: 8px; }
.srch-item { display: flex; flex-direction: column; gap: 4px; text-align: start; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--paper-edge); background: rgba(255,255,255,.3); color: var(--ink); cursor: pointer; }
body.night .srch-item { background: rgba(255,255,255,.04); }
.srch-item .ref { color: var(--accent); font-family: var(--font-ui); font-size: 13px; font-weight: 600; }
.srch-item .txt { font-family: var(--font-ar); font-size: 18px; line-height: 1.8; }
.srch-item[dir="ltr"] .txt { font-family: var(--font-en); }
mark { background: rgba(233,196,106,.55); color: inherit; border-radius: 3px; padding: 0 2px; }
.saved-item { position: relative; padding: 10px 40px 10px 14px; border-radius: 10px; border: 1px solid var(--paper-edge); margin-bottom: 8px; background: rgba(255,255,255,.3); }
[dir="rtl"] .saved-item { padding: 10px 14px 10px 40px; }
body.night .saved-item { background: rgba(255,255,255,.04); }
.saved-item .ref { border: 0; background: none; color: var(--accent); font-weight: 600; cursor: pointer; padding: 0; font-family: var(--font-ui); font-size: 14px; }
.saved-item .txt { font-family: var(--font-ar); font-size: 17px; line-height: 1.8; margin-top: 4px; }
.saved-item .txt[dir="ltr"] { font-family: var(--font-en); }
.saved-item .note-txt { margin-top: 6px; color: var(--ink-soft); font-size: 14px; white-space: pre-wrap; }
.saved-item .rm { position: absolute; top: 8px; inset-inline-end: 8px; border: 0; background: transparent; color: var(--ink-faint); font-size: 20px; cursor: pointer; }
.progress { height: 10px; border-radius: 999px; background: rgba(0,0,0,.08); overflow: hidden; }
.progress div { height: 100%; background: var(--gold); }
.plan-day { padding: 10px 14px; border-radius: 10px; border: 1px solid var(--paper-edge); margin-bottom: 8px; }
.plan-day.today { border-color: var(--gold); background: rgba(233,196,106,.12); }
.plan-day.done { opacity: .6; }
.plan-day label { font-weight: 600; cursor: pointer; }
.plan-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.plan-links button { border: 1px solid var(--paper-edge); background: transparent; border-radius: 999px; padding: 4px 12px; cursor: pointer; color: var(--accent); font-family: var(--font-ui); }
.settings section { border-bottom: 1px solid var(--paper-edge); padding-bottom: 10px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 9px 0; flex-wrap: wrap; }
.set-label { font-weight: 600; color: var(--ink-soft); }
.set-ctl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.range { display: flex; align-items: center; gap: 10px; }
.range input { width: min(260px, 50vw); accent-color: var(--accent); }
.range output { min-width: 48px; font-variant-numeric: tabular-nums; color: var(--accent); }
.font-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.font-card { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--paper-edge); background: transparent; color: var(--ink); cursor: pointer; text-align: center; }
.font-card .sample { font-size: 20px; line-height: 1.6; }
.font-card small { color: var(--ink-faint); font-family: var(--font-ui); }
.font-card.active { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(122,46,18,.25); background: rgba(184,137,43,.12); }
.file-btn { display: inline-block; cursor: pointer; }
.muted { color: var(--ink-faint); }
.dialog { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; padding: 16px; }
.dialog-box { width: min(520px, 100%); background: var(--panel); color: var(--ink); border-radius: 16px; padding: 18px; box-shadow: var(--shadow); font-family: var(--font-ui); }
.dialog-box h3 { margin: 0 0 12px; color: var(--accent); }
.note-ta { width: 100%; box-sizing: border-box; border: 1px solid var(--panel-edge); border-radius: 10px; padding: 10px; font-family: var(--font-ui); font-size: 15px; background: rgba(255,255,255,.6); color: var(--ink); resize: vertical; }
body.night .note-ta { background: rgba(255,255,255,.05); }
.dialog-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; flex-wrap: wrap; }
.dialog-actions button { border: 1px solid var(--panel-edge); background: transparent; color: var(--ink); border-radius: 10px; padding: 8px 16px; cursor: pointer; font-family: var(--font-ui); }
.dialog-actions .primary { background: var(--accent); color: #fff; border-color: var(--accent); font-size: 15px; }
.dialog-actions .danger { color: #b3261e; border-color: #e3a49f; }
.pop-colors { display: inline-flex; align-items: center; gap: 4px; padding-inline-start: 4px; border-inline-start: 1px solid var(--panel-edge); }
.verse-pop .hl-dot { width: 20px; height: 20px; padding: 0; border-radius: 50%; border: 2px solid transparent; }
.hl-dot.gold { background: #f2d27a; } .hl-dot.green { background: #a9d8a4; } .hl-dot.blue { background: #a9c9ec; } .hl-dot.rose { background: #f0b4b4; }
.verse-pop .hl-dot.none { width: auto; background: transparent; font-size: 13px; padding: 0 4px; }
.verse-pop .hl-dot.on { border-color: var(--ink); }
#popMark.on { color: var(--gold); }
.verse.hl-gold, .saved-item.hl-gold { background: rgba(242,210,122,.38); }
.verse.hl-green, .saved-item.hl-green { background: rgba(169,216,164,.38); }
.verse.hl-blue, .saved-item.hl-blue { background: rgba(169,201,236,.38); }
.verse.hl-rose, .saved-item.hl-rose { background: rgba(240,180,180,.38); }
body.night .verse.hl-gold { background: rgba(242,210,122,.16); } body.night .verse.hl-green { background: rgba(169,216,164,.14); }
body.night .verse.hl-blue { background: rgba(169,201,236,.14); } body.night .verse.hl-rose { background: rgba(240,180,180,.14); }
.verse.bm::after { content: "★"; position: absolute; top: 4px; inset-inline-end: -14px; color: var(--gold); font-size: 13px; }
.note-ico { position: absolute; bottom: 4px; inset-inline-end: -16px; border: 0; background: transparent; color: var(--accent-2); cursor: pointer; font-size: 14px; }
.verse.flash { animation: flash 2.2s ease-out; }
@keyframes flash { 0%, 30% { background: rgba(233,196,106,.6); } 100% { background: transparent; } }
body.no-nums .verse .n { display: none; }
body.no-bgpic.has-bg:not(.night) .reader { background: linear-gradient(180deg, var(--paper) 0%, var(--paper-2) 100%); }
.explain-content { line-height: var(--lh-ar, 1.95); }
.explain-content[dir="ltr"] { line-height: var(--lh-en, 1.7); }

/* ---------- Daily readings (Katameros) and Synaxarium ---------- */
.kt-datebar { display: flex; align-items: center; gap: 10px; justify-content: center; margin: 4px 0 8px; }
.kt-nav { font-size: 26px; line-height: 1; padding: 6px 14px; min-width: 46px; }
.kt-dates { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; font-family: var(--font-ui); min-width: 0; }
.kt-dates b { color: var(--accent); font-size: 17px; font-weight: 600; }
.kt-dates span { color: var(--ink-soft); font-size: 14px; }
.kt-pick { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; margin-bottom: 6px; }
.kt-pick input[type="date"] { font-family: var(--font-ui); font-size: 14px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--paper-edge); background: rgba(255,255,255,.5); color: var(--ink); }
body.night .kt-pick input[type="date"] { background: rgba(255,255,255,.06); color-scheme: dark; }
.kt-body { font-family: var(--font-ar); font-size: var(--fs); line-height: var(--lh-ar, 1.95); padding: 4px 6px 10px; }
.kt-body[dir="ltr"] { font-family: var(--font-en); line-height: var(--lh-en, 1.7); }
.pv-inner .kt-body h2.kt-day { color: var(--accent); font-size: 1.2em; text-align: center; margin: .6em 0 .5em; font-weight: 700; }
.pv-inner .kt-body h3.kt-svc { font-size: 1.15em; text-align: center; margin: 1.1em 0 .3em; padding-bottom: .25em; border-bottom: 1px dashed var(--paper-edge); }
.pv-inner .kt-body h4.kt-title { color: var(--accent); font-size: 1em; margin: 1.1em 0 .2em; }
.kt-body .kt-note { color: var(--accent-2, var(--accent)); opacity: .9; margin: .25em 0 .5em; font-size: .9em; }
.kt-body[dir="ltr"] .kt-note { font-style: italic; }
.kt-body p { margin: 0 0 .6em; }
.kt-approx { text-align: center; }
.kt-reading { margin: .4em 0 .6em; padding: .4em .8em .5em; border-radius: 12px; border: 1px solid var(--paper-edge); background: rgba(255,255,255,.28); }
body.night .kt-reading { background: rgba(255,255,255,.03); }
.kt-ref { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; padding: 2px 0; margin-bottom: 2px; color: var(--accent); font-family: var(--font-ui); font-size: 15px; font-weight: 700; cursor: pointer; }
.kt-ref:hover:not([disabled]) { text-decoration: underline; }
.kt-ref[disabled] { cursor: default; }
.kt-go { font-size: 13px; color: var(--gold); }
.kt-ch { display: block; font-family: var(--font-ui); font-size: 12px; color: var(--ink-faint); margin: .4em 0 .1em; }
.kt-body .kt-v { margin: 0 0 .3em; }
.kt-v sup { color: var(--gold); font-family: var(--font-ui); font-size: .62em; margin-inline-end: 5px; }
.kt-body .speaking { background: rgba(233,196,106,.28); border-radius: 8px; }
.kt-more { text-align: center; margin: 14px 0 4px; }
.kt-page .srcline { font-family: var(--font-ui); font-size: 12px; color: var(--ink-faint); text-align: center; }
.syn-toc { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.syn-toc button { font-family: var(--font-ui); font-size: 13px; text-align: start; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--paper-edge); background: rgba(255,255,255,.3); color: var(--accent); cursor: pointer; }
body.night .syn-toc button { background: rgba(255,255,255,.04); }
.syn-saint { margin-top: 1.2em; }
.pv-inner .syn-saint h3 { font-size: 1.1em; margin: 0 0 .4em; padding-bottom: .2em; border-bottom: 1px dashed var(--paper-edge); }
.syn-saint p { text-align: justify; }
@media (max-width: 560px) {
  .kt-dates b { font-size: 15px; }
  .pv-inner .kt-body h2.kt-day { font-size: 1.05em; }
  .kt-body .kt-note { font-size: .85em; }
  .kt-nav { padding: 6px 10px; min-width: 40px; }
  .kt-reading { padding: .35em .6em .45em; }
}

/* ---------- Listen button in a page's header ---------- */
.pv-listen { flex: none; width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--fill, rgba(118,118,128,.14)); color: var(--tint, var(--accent)); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.pv-listen.on { background: var(--tint, var(--accent)); color: var(--row, #fff); }
.pv-listen:active { opacity: .6; }
.pv-tools { display: flex; align-items: center; gap: 8px; }

/* ---------- Ask the pastors ---------- */
.pst-page { display: flex; flex-direction: column; min-height: 100%; padding-bottom: 0; }
.pst-authors { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.pst-authors::-webkit-scrollbar { display: none; }
.pst-authors button { flex: none; border: 0; border-radius: 999px; padding: 7px 14px; background: var(--fill, rgba(118,118,128,.14)); color: var(--chrome-ink, var(--ink)); font-family: var(--font-ui); font-size: 13px; cursor: pointer; white-space: nowrap; }
.pst-authors button.active { background: var(--tint, var(--accent)); color: var(--row, #fff); font-weight: 600; }
.pst-chat { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 6px 0 14px; }
.pst-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 8vh auto 0; max-width: 520px; width: 100%; }
.pst-cross { font-size: 44px; color: var(--gold); line-height: 1; margin-bottom: 8px; }
.pst-ex { width: 100%; text-align: start; border: .5px solid var(--hairline, var(--paper-edge)); background: var(--row, rgba(255,255,255,.4)); color: var(--chrome-ink, var(--ink)); border-radius: 14px; padding: 12px 14px; font-family: var(--font-ui); font-size: 15px; cursor: pointer; }
.pst-ex:active { opacity: .6; }
.pst-msg { max-width: 88%; padding: 10px 14px; border-radius: 18px; line-height: 1.75; font-size: calc(var(--fs) * .82); overflow-wrap: anywhere; }
.pst-msg[dir="rtl"] { font-family: var(--font-ar); }
.pst-msg[dir="ltr"] { font-family: var(--font-en); }
.pst-msg.user { align-self: flex-end; background: var(--tint, var(--accent)); color: #fff; border-end-end-radius: 6px; font-family: var(--font-ui); font-size: 15px; white-space: pre-wrap; }
.pst-msg.bot { align-self: flex-start; background: var(--row, rgba(255,255,255,.5)); color: var(--chrome-ink, var(--ink)); border-end-start-radius: 6px; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.pst-msg.bot p { margin: 0 0 .6em; }
.pst-msg.bot strong, .pst-msg.bot b { color: var(--accent); }
.pst-msg.err { background: #f8e1d8; color: #7a2e12; }
body.night .pst-msg.err { background: #3a1d12; color: #f0b9a2; }
.pst-srcs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pst-src { border: 0; border-radius: 999px; padding: 5px 11px; background: var(--fill, rgba(118,118,128,.14)); color: var(--tint, var(--accent)); font-family: var(--font-ui); font-size: 12px; cursor: pointer; }
.pst-dots { display: inline-flex; gap: 4px; padding: 4px 0; }
.pst-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--label-2, var(--ink-faint)); animation: pstDot 1.2s infinite ease-in-out; }
.pst-dots i:nth-child(2) { animation-delay: .15s; } .pst-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes pstDot { 0%, 80%, 100% { opacity: .25; transform: scale(.8); } 40% { opacity: 1; transform: scale(1); } }
.pst-form { position: sticky; bottom: calc(8px + var(--safe-b, 0px)); display: flex; align-items: flex-end; gap: 8px; padding: 8px; margin: 0 -4px 8px; border-radius: 24px; background: var(--chrome, var(--panel)); border: .5px solid var(--hairline, var(--paper-edge)); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); box-shadow: 0 6px 20px rgba(0,0,0,.12); }
.pst-form textarea { flex: 1; resize: none; border: 0; outline: 0; background: transparent; color: var(--chrome-ink, var(--ink)); font-family: var(--font-ui); font-size: 16px; line-height: 1.45; padding: 7px 8px; max-height: 160px; }
.pst-form .primary { width: 38px; height: 38px; padding: 0; border-radius: 50%; flex: none; font-size: 24px; line-height: 1; background: var(--tint, var(--accent)); }

/* ---------- Phone navigation: floating tab bar ---------- */
body.nav-float .tabbar { inset: auto 12px calc(10px + var(--safe-b)) 12px; height: 60px; padding: 0 6px; max-width: 560px; margin: 0 auto; border-radius: 24px; border: .5px solid var(--hairline); border-top: .5px solid var(--hairline); box-shadow: 0 10px 30px rgba(0,0,0,.22), 0 1px 3px rgba(0,0,0,.08); }
body.nav-float .layout { bottom: 0 !important; }
body.nav-float .page-view { bottom: 0 !important; }
body.nav-float { --tab-total: calc(74px + var(--safe-b)); }
body.nav-float .pst-form { bottom: calc(82px + var(--safe-b)); }

/* ---------- Phone navigation: slide menu opened by a floating button ---------- */
.nav-fab { display: none; }
@media (max-width: 1023px) {
  body.nav-menu { --tab-total: 0px; }
  body.nav-menu .tabbar { display: none; }
  body.nav-menu #drawer.drawer { display: flex !important; padding-top: var(--safe-t, 0px); background: var(--group-bg, var(--panel)); color: var(--chrome-ink, var(--ink)); }
  body.nav-menu #drawerShade.drawer-shade { display: block !important; }
  body.nav-menu .nav-fab { display: inline-flex; align-items: center; justify-content: center; position: fixed; z-index: 50; bottom: calc(18px + var(--safe-b, 0px)); inset-inline-end: 18px; width: 56px; height: 56px; border-radius: 50%; border: .5px solid var(--hairline); background: var(--chrome); color: var(--tint); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); box-shadow: 0 8px 24px rgba(0,0,0,.25); cursor: pointer; transition: opacity .25s, transform .25s; }
  body.nav-menu .nav-fab:active { transform: scale(.92); }
  body.nav-menu.has-player .nav-fab { bottom: calc(90px + var(--safe-b, 0px)); }
  body.nav-menu.read .nav-fab, body.nav-menu:has(.layout.panel-open) .nav-fab { opacity: 0; pointer-events: none; }
  body.nav-menu .pst-form { bottom: calc(8px + var(--safe-b, 0px)); margin-inline-end: 64px; }
}
.drawer[dir="rtl"] { transform: translateX(105%); }
body.drawer-open .drawer[dir="rtl"] { transform: none; }
.drawer .drawer-item { min-height: 48px; }
.drawer .drawer-item.active { background: var(--fill, rgba(184,137,43,.18)); color: var(--tint, var(--accent)); }
body.night .drawer .drawer-item { color: var(--chrome-ink, var(--ink)); }

/* ---------- Night background: the gold lattice, very slightly blurred ---------- */
body.night .reader, body.night.has-bg .reader { background-image: radial-gradient(ellipse at 50% 30%, rgba(60,40,20,.35), rgba(0,0,0,0) 70%); background-size: 100% 100%; background-repeat: no-repeat; }
body.night .page-view { background-image: none; }
body.night .reader::before, body.night .page-view::before {
  content: ""; display: block; position: fixed; inset: -6px; pointer-events: none; z-index: 0; opacity: 1; mix-blend-mode: normal;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'%3E%3Cpath d='M14 1 L27 14 L14 27 L1 14 Z' fill='none' stroke='%23a9813f' stroke-opacity='.3' stroke-width='1'/%3E%3Ccircle cx='14' cy='14' r='1.1' fill='%23c79a4a' fill-opacity='.28'/%3E%3Ccircle cx='0' cy='0' r='1.1' fill='%23c79a4a' fill-opacity='.2'/%3E%3Ccircle cx='28' cy='0' r='1.1' fill='%23c79a4a' fill-opacity='.2'/%3E%3Ccircle cx='0' cy='28' r='1.1' fill='%23c79a4a' fill-opacity='.2'/%3E%3Ccircle cx='28' cy='28' r='1.1' fill='%23c79a4a' fill-opacity='.2'/%3E%3C/svg%3E");
  background-size: 28px 28px; filter: blur(.8px);
}
body.night .page-view > * { position: relative; z-index: 1; }
.pst-caret { display: inline-block; width: .5em; height: 1.05em; margin-inline-start: 2px; vertical-align: -0.15em; border-radius: 2px; background: var(--tint, var(--accent)); animation: pstCaret 1s steps(1) infinite; }
@keyframes pstCaret { 50% { opacity: 0; } }

/* ---------- Ask the pastors: header icons, composer above the bar, history ---------- */
.pv-icon { flex: none; width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--fill, rgba(118,118,128,.14)); color: var(--tint, var(--accent)); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.pv-icon.on { background: var(--tint, var(--accent)); color: var(--row, #fff); }
.pv-icon:active { opacity: .6; }
body[data-page="pastors"] .pv-body { padding-bottom: 0; }
.pst-page { min-height: 100%; box-sizing: border-box; padding-bottom: 0; }
.pst-chat { padding-bottom: 18px; }
.pst-form { bottom: calc(var(--tab-total, 0px) + 10px) !important; margin-bottom: calc(var(--tab-total, 0px) + 10px); }
.pst-form .primary:disabled { opacity: .35; cursor: default; }
.pst-form .primary svg { display: block; }
.pst-hist { padding-bottom: 24px; }
.pst-hq { width: 100%; box-sizing: border-box; margin: 2px 0 6px; padding: 9px 14px; border-radius: 12px; border: 0; background: var(--fill, rgba(118,118,128,.14)); color: var(--chrome-ink, var(--ink)); font-family: var(--font-ui); font-size: 16px; outline: 0; }
.pst-hgroup { margin-bottom: 14px; }
.pst-hrow { display: flex; align-items: stretch; position: relative; }
.pst-hrow + .pst-hrow::before { content: ""; position: absolute; top: 0; inset-inline-start: 16px; inset-inline-end: 0; border-top: .5px solid var(--hairline); }
.pst-hopen { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 11px 16px; border: 0; background: transparent; color: var(--chrome-ink, var(--ink)); text-align: start; font-family: var(--font-ui); cursor: pointer; }
.pst-hopen:active { background: var(--fill); }
.pst-hopen .q { font-size: 16px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; width: 100%; }
.pst-hopen small { font-size: 12px; color: var(--label-2, var(--ink-faint)); }
.pst-hdel { flex: none; width: 46px; border: 0; background: transparent; color: var(--label-2, var(--ink-faint)); font-size: 22px; cursor: pointer; }
.pst-hdel:active { color: #d93a2b; }
.pst-none { text-align: center; margin-top: 12vh; }
.pst-clear { text-align: center; margin-top: 6px; }
.pst-clear .ghost { color: #d93a2b; border-color: rgba(217,58,43,.35); }
@media (max-width: 1023px) { body.nav-menu .pst-form { margin-inline-end: 66px; } }

/* ---------- Pickers inside the pages (the old .select was made for the old dark top bar) ---------- */
.pv-inner .select, .pg-pickers .select, .pv-tools .select {
  appearance: none; -webkit-appearance: none; max-width: 100%; min-width: 0; height: 36px; padding: 0 30px 0 12px; border: 0; border-radius: 10px;
  background: var(--fill, rgba(118,118,128,.14)) 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.5l5 5 5-5' fill='none' stroke='%23999' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 11px center;
  color: var(--chrome-ink, var(--ink)); font-family: var(--font-ui); font-size: 15px; cursor: pointer; text-overflow: ellipsis;
}
[dir="rtl"] .pv-inner .select, [dir="rtl"] .pg-pickers .select, .page-view[dir="rtl"] .select { padding: 0 12px 0 30px; background-position: left 11px center; }
.pv-inner .select option, .pg-pickers .select option { color: #222; background: #fff; }
.kt-pick .select { flex: 1 1 160px; max-width: 320px; }
.kt-pick #synD { flex: 0 0 76px; }
.kt-pick input[type="date"] { height: 36px; border: 0; border-radius: 10px; background: var(--fill, rgba(118,118,128,.14)); color: var(--chrome-ink, var(--ink)); }
.kt-pick .ghost { height: 36px; padding: 0 14px; }
.pg-pickers { display: flex; justify-content: center; padding: 12px 16px 0; max-width: 860px; margin: 0 auto; }
.pg-pickers .select { width: 100%; max-width: 420px; }
.pv-tools { flex: none; }
.pv-head h2 { min-width: 0; }
.pv-inner .kt-body h2.kt-day { line-height: 1.35; margin: .5em 0 .2em; }
.pv-inner .kt-body h3.kt-svc { line-height: 1.3; margin-top: .9em; }
.pv-inner .kt-body h4.kt-title { line-height: 1.35; }
.pv-inner .syn-saint h3 { line-height: 1.4; }
@media (max-width: 600px) {
  .syn-saint p { text-align: start; }
  .kt-body .kt-note { line-height: 1.6; }
  .pv-inner .syn-saint h3 { font-size: 1.02em; }
}
@media (max-width: 600px) { .agpeya-text { text-align: start; } }
/* the player's mic (talk while listening) only on the Bible tab */
body.in-page #pbMic { display: none !important; }

/* ---------- SoundCloud's own small player, above the play bar while one of its recordings plays ---------- */
.sc-dock { position: fixed; z-index: 59; inset-inline: 8px; bottom: calc(var(--tab-total, 0px) + 80px); max-width: 560px; margin: 0 auto; padding: 8px 10px; border-radius: 14px;
  background: var(--chrome, var(--panel)); border: .5px solid var(--hairline, var(--panel-edge)); box-shadow: 0 6px 24px rgba(0,0,0,.18);
  -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px);
  opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .25s, transform .25s; }
.sc-dock.on { opacity: 1; transform: none; pointer-events: auto; }
.sc-dock iframe { display: block; width: 100%; height: 20px; border: 0; }
body.read .sc-dock { bottom: calc(var(--safe-b, 0px) + 80px); }

/* ---------- Synaxarium: recording the day aloud ---------- */
.syn-rec { display: flex; justify-content: center; margin: 2px 0 6px; }
.syn-rec-btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 18px; border: 0; border-radius: 999px; background: var(--fill, rgba(118,118,128,.14)); color: var(--tint, var(--accent)); font-family: var(--font-ui); font-size: 15px; font-weight: 600; cursor: pointer; }
.syn-rec-btn:active { opacity: .6; }
.syn-rec-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; font-family: var(--font-ui); }
.syn-rec-have { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--label-2, var(--ink-soft)); }
.syn-rec-have i { width: 8px; height: 8px; border-radius: 50%; background: #34c759; }
.syn-rec-row .ghost { height: 34px; padding: 0 14px; }
.syn-rec-del { color: #d93a2b !important; border-color: rgba(217,58,43,.35) !important; }
.rec-bar { position: fixed; z-index: 62; inset-inline: 10px; bottom: calc(var(--tab-total, 0px) + 12px); max-width: 600px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 18px; background: var(--chrome, var(--panel)); border: .5px solid var(--hairline, var(--panel-edge)); box-shadow: 0 10px 30px rgba(0,0,0,.25);
  -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px); font-family: var(--font-ui); color: var(--chrome-ink, var(--ink)); }
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: #d93a2b; flex: none; animation: recBlink 1.2s infinite; }
.rec-dot.paused { animation: none; opacity: .4; }
@keyframes recBlink { 50% { opacity: .25; } }
.rec-time { font-variant-numeric: tabular-nums; font-size: 16px; font-weight: 600; min-width: 48px; }
.rec-bar .rec-next { flex: 1; min-width: 120px; height: 44px; font-size: 17px; font-weight: 700; border-radius: 14px; }
.rec-bar .ghost { height: 38px; }
.rec-bar audio { width: 100%; height: 40px; }
.rec-acts { display: flex; gap: 8px; width: 100%; }
.rec-acts .primary { flex: 1; height: 42px; border-radius: 12px; font-size: 16px; }
.rec-acts .ghost { height: 42px; }
.pv-inner .rec-cur { background: rgba(233,196,106,.30); box-shadow: inset 4px 0 0 var(--gold); border-radius: 8px; transition: background .3s; }
[dir="rtl"] .pv-inner .rec-cur { box-shadow: inset -4px 0 0 var(--gold); }
body[data-page="synax"] .pv-body { scroll-padding-bottom: 160px; }

/* ---------- the word being read ---------- */
.speaking .w { transition: background-color .12s, color .12s; border-radius: 4px; }
.speaking .w.w-now { background: rgba(233,196,106,.55); color: var(--ink); box-shadow: 0 0 0 2px rgba(233,196,106,.55); }
body.night .speaking .w.w-now { background: rgba(214,180,90,.38); color: #fff4dc; box-shadow: 0 0 0 2px rgba(214,180,90,.38); }
