/* "Ask the book" chat (bot.js), 21.11.2026. Uses the book's colour tokens, so both skins and dark settings follow. */
.bot-fab{position:fixed; inset-inline-end:16px; bottom:calc(16px + env(safe-area-inset-bottom,0px)); z-index:70; display:flex; align-items:center; gap:.45rem;
  font:inherit; font-size:.95rem; font-weight:600; padding:.65rem 1rem; border-radius:999px; border:0; cursor:pointer;
  background:var(--accent,#2f5fb3); color:#fff; box-shadow:0 4px 14px rgba(0,0,0,.18)}
.bot-fab:hover{filter:brightness(1.07)} .bot-fab:focus-visible{outline:3px solid var(--ink,#222); outline-offset:2px}
.bot-fab.on{display:none}
.bot-panel{position:fixed; inset-inline-end:16px; bottom:calc(16px + env(safe-area-inset-bottom,0px)); z-index:75; width:min(26rem, calc(100vw - 32px));
  height:min(36rem, calc(100vh - 90px)); display:flex; flex-direction:column; background:var(--sheet,#fff); color:var(--ink,#222);
  border:1px solid var(--rule,#ddd); border-radius:14px; box-shadow:0 10px 34px rgba(0,0,0,.22); overflow:hidden; font-size:.95rem; line-height:1.55}
.bot-panel[hidden]{display:none}
.bot-h{display:flex; align-items:center; gap:.5rem; padding:.6rem .8rem; border-bottom:1px solid var(--rule,#ddd); background:var(--accent-soft,#eef3fb)}
.bot-h b{margin-inline-end:auto; font-family:var(--f-display,inherit); white-space:nowrap}
.bot-adm{font-size:.72rem; color:var(--ink-2,#555); border:1px solid var(--rule,#ccc); border-radius:6px; padding:0 .35rem; white-space:nowrap}
.bot-fx{unicode-bidi:isolate; direction:ltr; white-space:nowrap} .bot-fx.long{white-space:normal}
.bot-h button{white-space:nowrap; font:inherit; font-size:.85rem; background:none; border:1px solid var(--rule,#ccc); border-radius:8px; padding:.15rem .55rem; cursor:pointer; color:inherit}
.bot-h .bot-x{font-size:1.25rem; line-height:1; border:0; padding:.1rem .4rem}
.bot-log{flex:1; overflow-y:auto; padding:.8rem; display:flex; flex-direction:column; gap:.6rem; overscroll-behavior:contain}
.bot-m{max-width:92%; padding:.5rem .75rem; border-radius:12px; overflow-wrap:anywhere}
.bot-m p{margin:.25rem 0} .bot-m ul,.bot-m ol{margin:.25rem 0; padding-inline-start:1.3rem}
.bot-q{align-self:flex-end; background:var(--accent,#2f5fb3); color:#fff; border-end-end-radius:4px}
.bot-a{align-self:flex-start; background:var(--paper,#f6f6f4); border:1px solid var(--rule,#e2e2e2); border-end-start-radius:4px}
.bot-cite{display:inline-block; min-width:1.25em; padding:0 .3em; margin-inline-start:.15em; font-size:.75em; line-height:1.5; vertical-align:super;
  text-align:center; border-radius:6px; background:var(--accent-soft,#e3ebf8); color:var(--accent,#2f5fb3); text-decoration:none; font-weight:700}
.bot-src{margin-top:.5rem; padding-top:.4rem; border-top:1px dashed var(--rule,#ccc); font-size:.85rem}
.bot-src ol{margin:.2rem 0; padding-inline-start:1.4rem} .bot-src li{margin:.15rem 0}
.bot-src a{color:var(--accent,#2f5fb3)} .bot-lab{white-space:nowrap}
.bot-wait{color:var(--ink-2,#666); animation:botp 1.2s ease-in-out infinite}
@keyframes botp{50%{opacity:.45}}
@media (prefers-reduced-motion:reduce){.bot-wait{animation:none}}
.bot-rate{display:flex; gap:.3rem; margin-top:.3rem; font-size:.85rem; color:var(--ink-2,#666)}
.bot-rate button{background:none; border:1px solid var(--rule,#ccc); border-radius:8px; cursor:pointer; padding:0 .4rem; font-size:.95rem}
.bot-f{display:flex; gap:.4rem; padding:.6rem .8rem 0; border-top:1px solid var(--rule,#ddd)}
.bot-f textarea{flex:1; font:inherit; font-size:16px; resize:none; padding:.45rem .6rem; border:1px solid var(--rule,#ccc); border-radius:10px; background:var(--sheet,#fff); color:inherit; min-width:0}
.bot-send{font:inherit; font-weight:600; border:0; border-radius:10px; padding:0 .9rem; background:var(--accent,#2f5fb3); color:#fff; cursor:pointer}
.bot-f.busy .bot-send{opacity:.5; cursor:wait}
.bot-note{margin:.35rem .8rem .55rem; font-size:.75rem; color:var(--ink-2,#666); line-height:1.4}
.bot-left{white-space:nowrap}
@media (max-width:520px){
  .bot-panel{inset:auto 0 0 0; width:100%; height:min(85vh, calc(100vh - 40px)); border-radius:14px 14px 0 0}
  .bot-fab span{display:none} .bot-fab{padding:.8rem}
}
@media print{.bot-fab,.bot-panel{display:none !important}}
.bot-lv{display:flex; align-items:center; gap:.3rem; padding:.4rem .8rem; border-bottom:1px solid var(--rule,#ddd); font-size:.82rem; color:var(--ink-2,#555); flex-wrap:wrap}
.bot-lv span{margin-inline-end:.2rem}
.bot-lv button,.bot-more button{font:inherit; font-size:.8rem; padding:.1rem .6rem; border-radius:999px; border:1px solid var(--rule,#ccc); background:var(--sheet,#fff); color:var(--ink,#222); cursor:pointer; white-space:nowrap}
.bot-lv button[aria-pressed="true"]{background:var(--accent,#2f5fb3); border-color:var(--accent,#2f5fb3); color:#fff; font-weight:700}
.bot-more{display:flex; flex-wrap:wrap; align-items:center; gap:.3rem; margin-top:.45rem; font-size:.8rem; color:var(--ink-2,#666)}
.bot-more button{color:var(--accent,#2f5fb3); border-color:var(--accent,#2f5fb3)}
.bot-qlv{display:block; font-size:.72rem; opacity:.85}
.bot-listen{display:inline-flex; align-items:center; gap:.3rem; margin-top:.45rem; font:inherit; font-size:.85rem; font-weight:600; padding:.2rem .75rem; border-radius:999px;
  border:1.5px solid var(--accent,#2f5fb3); background:var(--sheet,#fff); color:var(--accent,#2f5fb3); cursor:pointer}
.bot-listen.on{background:var(--accent,#2f5fb3); color:#fff}
.bot-listen.wait{opacity:.6; cursor:progress}
.bot-lrow{display:flex; flex-wrap:wrap; align-items:center; gap:.5rem; margin-top:.45rem}
.bot-lrow .bot-listen{margin-top:0}
.bot-sayrep{font:inherit; font-size:.75rem; background:none; border:0; padding:0; color:var(--ink-2,#666); text-decoration:underline; cursor:pointer}
.bot-sayf{display:flex; flex-wrap:wrap; gap:.3rem; width:100%; font-size:.8rem}
.bot-sayf input{flex:1 1 8rem; min-width:0; font:inherit; font-size:16px; padding:.25rem .45rem; border:1px solid var(--rule,#ccc); border-radius:8px; background:var(--sheet,#fff); color:inherit}
.bot-sayf button{font:inherit; font-size:.8rem; border:0; border-radius:8px; padding:.25rem .7rem; background:var(--accent,#2f5fb3); color:#fff; cursor:pointer}
.bot-mic{display:flex; align-items:center; justify-content:center; border:1px solid var(--rule,#ccc); border-radius:10px; padding:0 .6rem; background:var(--sheet,#fff); color:var(--accent,#2f5fb3); cursor:pointer}
.bot-mic[hidden]{display:none}
.bot-mic.on{background:#c62828; border-color:#c62828; color:#fff; animation:botp 1.2s ease-in-out infinite}
.bot-mic:disabled{opacity:.5; cursor:wait}
@media (prefers-reduced-motion:reduce){.bot-mic.on{animation:none}}
.bot-mic .bot-stop,.bot-mic.on svg:first-child{display:none} .bot-mic.on .bot-stop{display:block}
.bot-vwhy{flex-basis:100%; font-size:.72rem; color:var(--ink-2,#666); overflow-wrap:anywhere}
