:root { --bg:#f5f0e6; --panel:#fcf9f2; --panel-2:#eae1cf; --border:#d8cbb4; --text:#302f29; --muted:#6e6454; --gold:#976b32; --gold-bright:#795125; --danger:#9b342b; --ok:#536b4b; --radius:6px; }
html { color-scheme:light; }
.bible-nav { display:flex; flex-wrap:wrap; gap:10px; margin-top:16px; }
.prayer-language-control { display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px; margin:16px 0; font:13px/1.6 system-ui,sans-serif; color:var(--text); }
.prayer-language-control select { min-height:44px; max-width:100%; padding:8px 12px; border:1px solid var(--border); background:var(--panel); color:var(--text); font:inherit; }
.prayer-version-label { font-weight:600; color:var(--text); }
.prayer-version-source,.prayer-version-notice { font:13px/1.7 system-ui,sans-serif; color:var(--muted); overflow-wrap:anywhere; }
.prayer-version-source a { color:var(--accent); }
@media print { .prayer-language-control { display:none!important; } }
.bible-nav select { min-width:0; max-width:100%; flex:1; padding:12px; background:var(--panel); color:var(--text); border:1px solid var(--border); font:14px Georgia,serif; }
.bible-verse { border-bottom:1px solid var(--border); padding:18px 0; }
.bible-verse p { font:18px/1.9 Georgia,serif; margin:0 0 12px; }
.bible-verse sup { color:var(--gold); font-size:11px; }
body { background:radial-gradient(ellipse at 15% 10%,#fff9e9a0,transparent 60%),repeating-linear-gradient(0deg,#78603b04 0 1px,transparent 1px 4px),var(--bg); font-family:Georgia,'Times New Roman',serif; }
body::before { content:''; position:fixed; inset:0; border-top:3px solid #803f32; pointer-events:none; z-index:30; }
button,input,textarea { font:inherit; }
button,a,input,textarea { -webkit-tap-highlight-color:transparent; }
button,a { transition:color .2s,background .2s,border-color .2s,box-shadow .2s,transform .2s; }
button:not(:disabled):active { transform:translateY(1px); }
button:disabled { cursor:wait; }
:focus-visible { outline:2px solid #885d2e; outline-offset:5px; }
::selection { background:#853e31; color:#fff6df; }
html:not([lang="en"]) .tabs button,html:not([lang="en"]) .tabs a { letter-spacing:.5px; }
@media (min-width:801px) and (max-width:1600px) { header:has(.language-control) { gap:10px; } header:has(.language-control) .tabs { gap:3px; } header:has(.language-control) .tabs button,header:has(.language-control) .tabs a { font-size:10px; letter-spacing:.5px; } }
header { padding:18px max(28px,calc((100vw - 1200px)/2)); background:#f5f0e6f2; backdrop-filter:blur(16px); border-bottom:1px solid var(--border); gap:28px; flex-shrink:0; }
.brand { color:#352e25; font-size:27px; letter-spacing:-.8px; text-decoration:none; }
.brand .cross,.brand>span { color:#8a3c2f; }
.brand small { font:10px/1.8 Arial,sans-serif; letter-spacing:1.6px; color:var(--muted); padding-left:27px; }
.tabs { gap:28px; flex:0 1 auto; min-width:0; flex-wrap:nowrap; overflow-x:auto; }
.tabs .forum-link,.tabs .section-link { font:11px/1.7 Arial,sans-serif; text-transform:uppercase; letter-spacing:2px; padding:12px 4px; color:var(--muted); text-decoration:none; white-space:nowrap; position:relative; flex:0 0 auto; }
.tabs a:hover,.tabs a[aria-current="page"] { color:#79372c; }
.tabs a[aria-current="page"] { font-weight:600; }
.tabs a[aria-current="page"]::after { content:''; position:absolute; bottom:0; left:0; right:0; height:2px; background:#79372c; }
.tabs button { font:11px/1.7 Arial,sans-serif; text-transform:uppercase; letter-spacing:2px; border-radius:0; padding:12px 4px; position:relative; flex:0 0 auto; white-space:nowrap; }
@media (min-width:801px) and (max-width:1400px) {
  header { gap:14px; }
  .tabs { gap:12px; }
  .tabs button,.tabs .section-link,.tabs .forum-link { font-size:10px; letter-spacing:1px; }
}
@media (max-width:1180px) {
  .brand small { display:none; }
  .tabs { gap:12px; }
  header { gap:14px; }
}
@media (max-width:800px) {
  header { flex-wrap:wrap; row-gap:0; }
  #newChat,.account-btn { margin-left:auto; }
}
.tabs button.active,.tabs button:hover { background:transparent; color:#79372c; }
.tabs button::after { content:''; position:absolute; bottom:0; left:0; right:0; height:2px; background:#79372c; transform:scaleX(0); transition:transform .35s; }
.tabs button.active::after { transform:scaleX(1); }
.ghost,header a.back { border-radius:5px; border-color:#c7b797; color:#64533a; padding:10px 15px; font:12px/1.6 Arial,sans-serif; letter-spacing:.3px; min-height:44px; }
.ghost:hover,header a.back:hover { color:#79372c; background:#fff8e4; }
body:not(.legal-page) { min-height:100svh; height:auto; isolation:isolate; }
body:not(.legal-page) main { flex-shrink:0; }
#tab-ask .chat { flex:none; overflow:visible; }
main,section,.welcome-copy,.bubble { min-width:0; }
.bubble,.passage { overflow-wrap:anywhere; }
main :is(h1,h2,h3) { overflow-wrap:anywhere; }
button,input,textarea,select { touch-action:manipulation; }
main { max-width:1200px; }
section { padding:24px 36px 6px; position:relative; }
.chat { padding:0 0 24px; scrollbar-width:thin; scrollbar-color:#b9a27b transparent; }
.welcome { display:grid; grid-template-columns:1.35fr .8fr; gap:70px; align-items:center; padding:32px 0 22px; position:relative; z-index:0; }
/* Keep the home canvas and body on the same solid base. Layered body
   gradients can paint differently on the canvas and leave a visible seam. */
html:has(#tab-ask.active),html body:has(#tab-ask.active) { background:var(--bg); }
body:has(#tab-ask.active)::after {
  content:''; position:fixed; inset:0; z-index:-1;
  background:var(--home-bg, url('/theotokos.jpg')) no-repeat center / cover;
  opacity:.065; pointer-events:none;
}
.eyebrow { display:flex; gap:12px; align-items:center; font:10px/1.6 Arial,sans-serif; text-transform:uppercase; letter-spacing:2px; color:#8a4a32; }
.eyebrow::before { content:''; width:30px; height:1px; background:currentColor; }
.welcome h1 { font-size:clamp(40px,4.7vw,64px); line-height:1.13; letter-spacing:-2px; font-weight:400; color:#342e25; margin:20px 0; max-width:660px; }
.welcome h1 em { color:#833d30; font-weight:400; }
.welcome p { font-size:17px; line-height:1.8; max-width:470px; margin-bottom:22px; }
.welcome .chapter-label { font:10px Arial,sans-serif; text-transform:uppercase; letter-spacing:1.6px; padding:24px 0 12px; }
.chips { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.chips .chip,.chips .chip > span { min-width:0; overflow-wrap:anywhere; }
.chip { display:flex; justify-content:space-between; align-items:center; text-align:left; gap:12px; border:1px solid var(--border); border-radius:5px; background:#fcf9f2b3; padding:14px; font:14px/1.5 Georgia,serif; color:#534b3b; }
.chip small { display:block; font:9px/1.6 Arial,sans-serif; letter-spacing:1px; color:#76644e; margin-bottom:5px; }
.chip::after { content:'↗'; color:#956b3d; transition:transform .3s; }
.chip:hover { color:#853d30; background:#fffaf0; border-color:#ac8a62; box-shadow:0 3px 12px #735a2010; }
.chip:hover::after { transform:translate(3px,-3px); }
.illumination { margin:0; position:relative; z-index:1; text-align:center; align-self:center; }
.illumination::before { content:''; position:absolute; inset:12% 5%; border-radius:50%; background:#c6a26930; filter:blur(35px); animation:candlelight 8s ease-in-out infinite alternate; }
.church-door { position:relative; width:100%; max-width:310px; aspect-ratio:384/520; box-sizing:border-box; margin:auto; overflow:hidden; border:5px solid #937044; border-radius:50% 50% 3px 3px / 36% 36% 3px 3px; background:#b99a50; box-shadow:0 0 0 2px #c5a773,0 0 0 6px #685035,0 20px 40px #64431d25; animation:reveal-icon 1.5s cubic-bezier(.2,.6,.2,1) both; }
.church-door::before { content:''; position:absolute; left:0; right:0; top:0; height:10%; z-index:1; pointer-events:none; background:linear-gradient(to bottom,#b99a50 0%,rgba(185,154,80,.96) 46%,rgba(185,154,80,.55) 74%,rgba(185,154,80,0) 100%); }
.church-door::after { content:''; position:absolute; inset:0; z-index:2; border:2px solid #c1a16b; border-radius:inherit; box-shadow:inset 0 0 12px #130c0960; pointer-events:none; }
.illumination img { display:block; width:100%; height:100%; object-fit:cover; object-position:center top; transform:scale(1.14); }
.illumination figcaption { font:10px/1.8 Arial,sans-serif; letter-spacing:1.6px; text-transform:uppercase; color:#796748; margin-top:24px; }
.welcome-copy { position:relative; z-index:1; animation:manuscript-enter .9s both; }
.welcome .chips { animation:manuscript-enter 1.2s .15s both; }
.msg { animation:manuscript-enter .4s both; }
.msg .who { font:11px/1.7 Arial,sans-serif; letter-spacing:1.4px; margin:10px 0; }
.msg.user .bubble { border:1px solid #c5b79b; background:#e5dbc8; color:#423829; border-radius:3px; padding:16px 22px; }
.msg.bot .bubble { border:1px solid var(--border); border-left:3px solid #9f7842; background:#fcf9f2; border-radius:5px; padding:24px 28px; font-size:17px; line-height:1.85; }
.msg.bot .bubble.error { color:#87362a; }
.bubble blockquote { background:#e9dec9; color:#62513a; padding:14px 20px; }
.bubble .md-h { font-size:22px; }
.bubble code,.bubble pre { background:#e9e0ce; }
.composer { background:#fffcf5; padding:8px; border:1px solid #bfa984; border-radius:8px; box-shadow:0 6px 24px #735a2010; align-items:center; flex-shrink:0; }
.composer:focus-within { border-color:#906936; box-shadow:0 0 0 3px #a37c4110; }
.composer textarea { border:0; border-radius:0; background:transparent; min-width:0; padding:10px 12px; font:15px/1.6 Georgia,serif; }
.composer textarea:focus { outline:none; }
.composer button,.findrow button,#legalAccept { background:#77392e; color:#fff3d9; border:1px solid #653027; border-radius:5px; padding:13px 24px; font:12px/1.6 Arial,sans-serif; letter-spacing:.7px; }
.composer button:hover,.findrow button:hover,#legalAccept:hover:not(:disabled) { background:#542a24; }
.hint { display:flex; justify-content:space-between; gap:12px; font:11px/1.7 Arial,sans-serif; padding:10px 2px 7px; text-align:left; }
.tabhead { padding:26px 0; border-bottom:1px solid var(--border); margin-bottom:26px; }
.tabhead h2 { color:#382e24; font-size:44px; font-weight:400; letter-spacing:-1px; margin:14px 0; }
.tabhead p { font:16px/1.8 Georgia,serif; max-width:570px; }
body:has(#tab-bible.active) { height:auto; min-height:100svh; }
body:has(#tab-bible.active) main { flex:1 0 auto; max-width:1000px; }
#tab-bible { flex:none; padding-bottom:48px; }
#tab-bible .tabhead { padding:12px 0 18px; margin-bottom:20px; }
#tab-bible .tabhead h2 { font-size:clamp(30px,4vw,44px); }
#bibleResult { flex:none; overflow:visible; padding:24px 0 0; }
#bibleResult .passage { padding:clamp(20px,4vw,48px); }
#bibleResult .body,#bibleResult .bible-verse p { font-size:var(--reading-size,20px); line-height:1.95; }
#bibleResult .bible-verse { padding:22px 0; }
.findrow input { min-width:0; border-radius:2px; background:#f7f1e5; }
.passage { border-radius:6px; padding:32px; background:#fcf9f2; }
.passage .ref { font-size:28px; }
.passage .trans { font:10px Arial,sans-serif; letter-spacing:1.5px; text-transform:uppercase; padding:10px 0 24px; border-bottom:1px solid var(--border); margin-bottom:24px; }
.passage .body { font:19px/2 Georgia,serif; }
.empty { padding:65px 20px; font:italic 18px/1.8 Georgia,serif; }
.prayer-layout { display:grid; grid-template-columns:minmax(0,290px) minmax(0,1fr); gap:32px; align-items:start; }
.prayer-topics { display:flex; flex-direction:column; gap:2px; max-height:70vh; overflow-y:auto; padding-right:6px; }
.prayer-topic {
  display:grid; grid-template-columns:minmax(0,1fr) auto; grid-template-areas:'label count' 'book book';
  gap:2px 10px; text-align:left; padding:11px 13px; border:1px solid transparent; border-radius:3px;
  background:none; cursor:pointer; color:var(--text);
}
.prayer-topic:hover { background:#f7f1e5; }
.prayer-topic.active { background:#f7f1e5; border-color:var(--border); }
.prayer-topic-label { grid-area:label; font:15px/1.45 Georgia,serif; }
.prayer-topic-count { grid-area:count; font:11px/1.6 Arial,sans-serif; color:var(--muted); }
.prayer-topic-book { grid-area:book; font:9px/1.5 Arial,sans-serif; letter-spacing:1.1px; text-transform:uppercase; color:var(--muted); }
.prayer-pane { display:grid; grid-template-columns:minmax(0,240px) minmax(0,1fr); gap:28px; align-items:start; }
.prayer-list { display:flex; flex-direction:column; gap:1px; max-height:70vh; overflow-y:auto; }
.prayer-item {
  display:flex; flex-direction:column; gap:3px; text-align:left; padding:9px 11px; border:0; border-left:2px solid transparent;
  background:none; cursor:pointer; color:var(--text); font:14px/1.5 Georgia,serif;
}
.prayer-item:hover { background:#f7f1e5; }
.prayer-item.active { background:#f7f1e5; border-left-color:#976b32; }
.prayer-item-flag { font:9px/1.5 Arial,sans-serif; letter-spacing:1.1px; text-transform:uppercase; color:#5b3aa6; }
.prayer-text { background:#fcf9f2; border:1px solid var(--border); border-radius:4px; padding:clamp(20px,3.5vw,40px); }
.prayer-text .prayer-title { color:#382e24; font:26px/1.35 Georgia,serif; font-weight:400; margin:12px 0 4px; }
.ornament-rule.small { margin:0 0 18px; }
.prayer-body { font:var(--reading-size,20px)/1.95 Georgia,serif; }
.prayer-body + .prayer-lang-note { margin:26px 0 0; }
.prayer-body ~ .prayer-body { margin-top:0; }
.prayer-lang-note { font:10px/1.6 Arial,sans-serif; letter-spacing:2px; text-transform:uppercase; color:#8a4a32; border-top:1px solid var(--border); padding-top:20px; }
.prayer-line { margin:0 0 .55em; }
.prayer-line:last-child { margin-bottom:0; }
.prayer-note { font:13px/1.8 Georgia,serif; color:var(--muted); margin-top:26px; max-width:640px; }
@media (max-width:860px) {
  .prayer-layout { grid-template-columns:minmax(0,1fr); }
  .prayer-topics { flex-direction:row; overflow-x:auto; max-height:none; padding-bottom:8px; }
  .prayer-topic { min-width:210px; }
  .prayer-pane { grid-template-columns:minmax(0,1fr); }
  .prayer-list,.prayer-topics { max-height:none; }
}
.legal-backdrop { background:#1e241c99; backdrop-filter:blur(10px); }
.legal-modal { background:#f2ead9; border:1px solid #b69a64; border-top:4px solid #7b392b; border-radius:3px; padding:32px; box-shadow:0 30px 100px #0005; animation:manuscript-enter .5s both; }
.legal-modal h2 { color:#663c28; font-size:26px; font-weight:400; }
.legal-sub,.legal-points { color:#5e5443; }
.legal-check { background:#e9dfcb; border-radius:2px; }
.legal-check a { color:#78382b; }
.explain-modal {
  position:relative; overflow:hidden; max-width:640px; width:100%; max-height:85vh;
  display:flex; flex-direction:column;
  background:#f2ead9; border:1px solid #b69a64; border-top:4px solid #7b392b;
  border-radius:3px; box-shadow:0 30px 100px #0005;
  animation:manuscript-enter .5s both;
}
.explain-modal::before {
  content:''; position:absolute; inset:0;
  background:var(--home-bg, url('/theotokos.jpg')) no-repeat center/cover;
  opacity:.13; pointer-events:none;
}
.explain-head { position:relative; padding:30px 30px 16px; border-bottom:1px solid var(--border); background:linear-gradient(#f2ead9d9,#f2ead9b3); }
.explain-ref { font:400 30px/1.25 Georgia,serif; letter-spacing:-.5px; color:#382e24; margin:10px 0 0; }
.explain-body { position:relative; flex:1 1 auto; min-height:0; overflow-y:auto; }
.explain-body.bubble { background:transparent; padding:20px 30px; font:17px/1.85 Georgia,serif; color:#302f29; }
.explain-body.bubble blockquote { background:#e9dec9; color:#62513a; }
.explain-sources { position:relative; margin:0; padding:4px 30px 0; font:10px/1.8 Arial,sans-serif; letter-spacing:1.2px; text-transform:uppercase; color:#7a6a4e; }
.explain-sources[hidden] { display:none; }
.explain-actions { position:relative; display:flex; justify-content:flex-end; padding:14px 30px 26px; }
.explain-err { color:#87362a; }
.crisis { background:#f5e1d6; color:#683629; border-color:#b18471; border-radius:2px; }
footer { background:#f5f0e6b3; border-color:var(--border); font:11px/1.8 Arial,sans-serif; padding:12px 28px; gap:5px 18px; flex-shrink:0; }
footer>span:nth-child(3) { max-width:620px; }
.footer-glyph { text-align:center; color:#976b32; font-size:18px; }
footer .discord-link { display:inline-flex; align-items:center; justify-content:center; gap:9px; min-height:44px; padding:9px 14px; border:1px solid #653027; background:#77392e; color:#fff3d9; font:11px/1.6 Arial,sans-serif; letter-spacing:.8px; text-transform:uppercase; text-decoration:none; flex-shrink:0; touch-action:manipulation; }
footer .discord-link:hover { background:#542a24; color:#fff3d9; text-decoration:none; }
footer .discord-link:focus-visible { outline:2px solid #885d2e; outline-offset:4px; }
.discord-link svg { flex-shrink:0; }
.discord-arrow { font-size:16px; line-height:1; }
/* Shared by every page footer that offers the installable app. */
#installHelp { box-sizing:border-box; max-width:min(440px,calc(100vw - 32px)); background:var(--panel); color:var(--text); border:1px solid var(--gold); padding:24px; }
#installHelp::backdrop { background:rgba(0,0,0,.6); }
.install-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid #653027;
  background: #77392e;
  color: #fff3d9;
  font: 11px/1.6 Arial, sans-serif;
  letter-spacing: .8px;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.install-btn:hover { background: #542a24; color: #fff3d9; text-decoration: none; }
.install-btn:focus-visible { outline: 2px solid #885d2e; outline-offset: 4px; }
.install-btn svg { flex-shrink: 0; }
@media (max-width: 480px) {
  .install-btn { padding: 10px 12px; font-size: 10px; }
  .install-btn span { display: inline; }
}
.ornament-rule { display:flex; align-items:center; gap:13px; color:#976b32; margin:4px 0 0; }
.ornament-rule span { font-size:15px; line-height:1; }
.ornament-rule i { font:8px/1.8 Arial,sans-serif; font-style:normal; letter-spacing:3.5px; color:#8a4a32; }
.ornament-rule::before,.ornament-rule::after { content:''; flex:1; height:1px; background:linear-gradient(90deg,transparent,#a37c4170); }
.ornament-rule::after { background:linear-gradient(90deg,#a37c4170,transparent); }
.legal-modal #legalTitle::before { content:'✝ '; color:#8a3c2f; }
.passage { position:relative; }
.passage::before,.passage::after { content:'☦'; position:absolute; font-size:15px; color:#a37c41; opacity:.45; }
.passage::before { top:9px; left:12px; }
.passage::after { bottom:9px; right:12px; }
.tabhead { position:relative; }
.tabhead::after { content:'☦'; position:absolute; right:2px; top:24px; font-size:30px; color:#a37c41; opacity:.35; }
#status { letter-spacing:.4px; font-size:10px; }
.legal-page main { max-width:850px; padding:60px 38px 90px; }
.legal-page h1 { color:#503926; font-size:clamp(36px,5vw,54px); font-weight:400; margin:0 0 16px; }
.legal-page h2 { color:#733c2a; font-size:23px; margin-top:38px; font-weight:400; }
.legal-page p,.legal-page li { color:#514938; font:16px/1.9 Georgia,serif; }
.legal-page .meta { font:10px/1.8 Arial,sans-serif; letter-spacing:.6px; }
.legal-page .notice { background:#e8ddc6; color:#51412d; border-radius:2px; padding:22px; margin:30px 0; }
.legal-page code { background:#e6dbc6; }
.legal-page table { font:12px/1.6 Arial,sans-serif; overflow-wrap:anywhere; }
.legal-page th,.legal-page td { padding:10px 8px; }
@keyframes manuscript-enter { from { opacity:0; transform:translateY(14px); } to { opacity:1; transform:none; } }
@keyframes reveal-icon { from { opacity:0; transform:translateY(15px); } to { opacity:1; transform:none; } }
@keyframes candlelight { from { opacity:.3; transform:scale(.92); } to { opacity:1; transform:scale(1.08); } }
@media(min-width:1000px) and (min-height:850px) { .welcome { padding-top:48px; padding-bottom:40px; } .church-door { max-width:330px; } }
@media(max-width:760px) {
  header { padding:16px 22px; gap:12px; flex-wrap:wrap; }
  .brand { font-size:24px; } .brand small { font-size:9px; letter-spacing:1.3px; }
  .tabs { gap:26px; } section { padding:18px 22px 4px; }
  .welcome { gap:16px; grid-template-columns:1fr; padding:12px 0 20px; position:relative; }
  .welcome-copy { position:relative; z-index:1; } .welcome h1 { font-size:46px; max-width:460px; padding-right:0; }
  .illumination { position:absolute; top:0; right:-5px; width:135px; opacity:.14; pointer-events:none; }
  .church-door { border-width:3px; }
  .illumination figcaption { display:none; } .welcome p { max-width:90%; }
  .msg.bot .bubble { padding:18px; font-size:16px; } .composer button { padding:12px 16px; }
  .hint { font-size:10px; } footer { padding:10px 22px; font-size:10px; }
  .legal-page main { padding:36px 22px; } .legal-modal { padding:24px; }
  .passage { padding:22px; } .passage .body { font-size:17px; } .tabhead h2 { font-size:36px; }
  body:has(#tab-ask.active)::after { opacity:.08; }
  .explain-modal { max-height:92vh; }
  .explain-head { padding:22px 20px 14px; }
  .explain-ref { font-size:24px; }
  .explain-body.bubble { padding:16px 20px; font-size:16px; }
  .explain-sources { padding:4px 20px 0; }
  .explain-actions { padding:12px 20px 20px; }
}
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { animation:none!important; transition:none!important; scroll-behavior:auto!important; } }
@media(max-width:760px) {
  input,select,.composer textarea { font-size:16px; }
  .ghost,.tabs button,.composer button,.findrow button,.bible-nav select { min-height:44px; }
  .welcome h1 { font-size:clamp(34px,9vw,46px); }
  .bible-nav select { flex:1 1 calc(50% - 10px); }
  .legal-actions { flex-wrap:wrap; }
  footer { padding-bottom:max(10px,env(safe-area-inset-bottom)); }
}
@media(max-height:600px) {
  body:not(.legal-page) { height:auto; min-height:100dvh; }
  body:not(.legal-page) main { flex:1 0 auto; }
  /* Keep replies in document flow; a fixed height with visible overflow lets
     long conversations spill over the composer in short desktop windows. */
  #tab-ask .chat { flex:none; height:auto; }
  .legal-backdrop { padding:10px; }
  .legal-modal,.explain-modal { max-height:calc(100dvh - 20px); }
}
@media(pointer:coarse) {
  input,select,.composer textarea { font-size:16px; }
  .ghost,.tabs button,.composer button,.findrow button,.bible-nav select { min-height:44px; }
}

body:has(.welcome) { height:auto; min-height:100dvh; }
body:has(.welcome) main { flex:1 0 auto; }
#tab-ask:has(.welcome) .chat { overflow:visible; flex:none; height:auto; min-height:0; }
@media(min-width:761px) {
  #tab-ask .chat:has(.msg):not(:has(.welcome)) {
    height:clamp(180px,calc(100dvh - 300px),720px);
    overflow-y:auto;
    overflow-anchor:none;
    overscroll-behavior-y:contain;
    scrollbar-gutter:stable;
    scroll-behavior:auto;
  }
}
[hidden] { display:none!important; }
button:disabled { cursor:not-allowed; opacity:.5; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; border:0; }
.skip-link { position:fixed; top:10px; left:12px; z-index:100; padding:12px 20px; background:var(--panel); color:var(--text); transform:translateY(-160%); }
.skip-link:focus { transform:none; }
.noscript-note { padding:16px; background:var(--panel); text-align:center; }
.dialog-open { overflow:hidden; }
.legal-modal,.explain-modal { border-radius:8px; max-height:calc(100dvh - 40px); }
.legal-check { align-items:flex-start; }
.legal-check input { flex-shrink:0; width:18px; height:18px; }
.legal-modal:focus-visible,main:focus { outline:none; }
.welcome-links { display:flex; align-items:center; flex-wrap:wrap; gap:12px 22px; }
.primary-link { display:inline-flex; align-items:center; gap:24px; background:#77392e; color:#fff3d9; border:1px solid #653027; padding:13px 18px; border-radius:5px; font:12px/1.6 Arial,sans-serif; cursor:pointer; min-height:46px; }
.primary-link:hover { background:#542a24; }
.text-link { background:transparent; border:0; border-radius:3px; color:#79372c; font:12px/1.6 Arial,sans-serif; padding:8px 0; cursor:pointer; text-underline-offset:4px; min-height:36px; }
.text-link:hover { text-decoration:underline; }
.source-note { display:flex; gap:8px; align-items:center; font:11px/1.7 Arial,sans-serif; color:#6e6454; margin-top:16px; }
.source-note span { color:#9a773d; }
.conversation-head { display:flex; align-items:center; justify-content:space-between; gap:12px; border-bottom:1px solid var(--border); padding:0 0 14px; margin-bottom:12px; font:10px/1.6 Arial,sans-serif; letter-spacing:1px; color:var(--muted); }
.conversation-head span:last-child { letter-spacing:0; }
.message-actions { display:flex; justify-content:flex-end; }
.message-actions .text-link { color:var(--muted); font-size:11px; padding:5px 8px; }
.pending-label { font:13px/1.7 Arial,sans-serif; color:var(--muted); margin-left:12px; }
.app-notice { display:flex; align-items:center; justify-content:space-between; gap:12px; background:#f5e1d6; color:#683629; border:1px solid #b18471; border-radius:5px; padding:10px 14px; margin-bottom:10px; font:13px/1.6 Arial,sans-serif; }
.app-notice button { border:0; color:inherit; background:transparent; min-width:32px; min-height:36px; cursor:pointer; font-size:22px; }
.jump-latest { position:absolute; bottom:112px; left:50%; transform:translateX(-50%); z-index:3; background:var(--panel); box-shadow:0 3px 14px #302f2920; }
.jump-latest:active { transform:translateX(-50%)!important; }
.reader-toolbar { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:16px 0 0; font:12px/1.6 Arial,sans-serif; color:var(--muted); }
.reader-size { display:flex; gap:4px; }
.reader-size button { width:44px; height:44px; border:1px solid var(--border); background:var(--panel); color:var(--text); border-radius:4px; cursor:pointer; }
.reader-size button:hover { border-color:var(--gold); }
.reader-pagination { display:flex; justify-content:space-between; gap:12px; margin-top:20px; }
.bible-nav .ghost { margin-left:0; }
.bible-verse:last-child { border-bottom:0; }
.bible-verse sup { display:inline-block; min-width:18px; font:11px Arial,sans-serif; }
.bible-verse .ghost { background:transparent; border-color:transparent; font-size:11px; padding:6px 10px; }
.bible-verse .ghost:hover,.bible-verse .ghost:focus-visible { background:#f0e7d7; border-color:var(--border); }
.explain-actions { gap:12px; }
.legal-page main { width:100%; }
.legal-page table { width:100%; border-collapse:collapse; }
@media(min-width:761px) { #tab-ask:has(.conversation-head:not([hidden])) { max-width:920px; width:100%; margin:0 auto; } }
@media(max-width:760px) {
  .welcome { gap:0; }
  .welcome p { max-width:100%; font-size:16px; }
  .welcome .chapter-label { padding-top:24px; }
  .welcome-links { gap:8px 16px; }
  .source-note { font-size:10px; }
  .illumination { width:120px; top:40px; right:0; opacity:.09; }
  .tabs { gap:24px; }
  .tabs button,.tabs .section-link,.tabs .forum-link { font-size:10px; letter-spacing:1.3px; }
  .bible-nav .ghost { flex:1; }
  .conversation-head span:last-child { display:none; }
  .legal-page header { flex-wrap:wrap; }
  .legal-page table { display:block; overflow-x:auto; }
}
@media(max-width:480px) {
  .tabs { gap:12px; overflow-x:auto; scrollbar-width:none; }
  .tabs::-webkit-scrollbar { display:none; }
  .tabs button,.tabs .section-link,.tabs .forum-link { font-size:9px; letter-spacing:.5px; min-height:44px; display:inline-flex; align-items:center; }
}
@media(max-width:420px) {
  header { padding:14px 16px 8px; }
  section { padding:16px 16px 4px; }
  .brand { font-size:22px; }
  .brand small { font-size:8px; }
  #newChat { padding:8px 10px; font-size:11px; }
  .welcome h1 { font-size:38px; letter-spacing:-1.3px; }
  .chip { padding:11px; font-size:13px; }
  .chip small { font-size:9px; letter-spacing:.6px; }
  .composer { gap:3px; }
  .composer textarea { padding:8px; }
  .composer button { padding:12px; }
  .legal-backdrop { padding:12px; }
  .legal-modal { padding:22px 18px; }
  .legal-modal h2 { font-size:23px; }
  .legal-modal,.explain-modal { max-height:calc(100dvh - 24px); }
  .reader-toolbar { font-size:11px; }
}
@media(pointer:coarse) { .text-link { min-height:44px; } }
@media print {
  header,footer,.composer,.hint,.findrow,.bible-nav,.reader-toolbar,.reader-pagination,.explain-verse,.message-actions,.legal-backdrop { display:none!important; }
  body,body:not(.legal-page) { height:auto; background:white; }
  body::before,body::after { display:none!important; }
  .chat { overflow:visible; }
  .passage,.bubble { background:white!important; box-shadow:none!important; }
}
.bible-edition-control{display:flex;align-items:center;flex-wrap:wrap;gap:8px 16px;margin:16px 0}.bible-edition-control select{min-width:0;max-width:100%;flex:1 1 240px;padding:10px;background:var(--panel);color:var(--text);border:1px solid var(--border);border-radius:8px}.bible-source-note{padding:12px;border:1px solid var(--border);border-radius:8px}.bible-source-note p{overflow-wrap:anywhere}
