/* Vivi Reader Tools */
.vrt-bar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px 16px;margin:0 0 20px;padding:10px 14px;border:1px solid #e5e7eb;border-radius:12px;background:#f8f9fb;font:600 13px/1.2 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;color:#555;letter-spacing:.03em}
.vrt-group{display:flex;align-items:center;gap:6px}
.vrt-bar .vrt-btn,.vrt-bar .vrt-btn:hover,.vrt-bar .vrt-btn:focus,.vrt-bar .vrt-btn:active{background:#fff!important;color:#222!important;border:1px solid #d6d9de!important;text-decoration:none!important}
.vrt-label{text-transform:uppercase;margin-right:4px}
.vrt-btn{min-width:34px;height:34px;padding:0 8px;border:1px solid #d6d9de;border-radius:8px;background:#fff;color:#222;font:700 14px/1 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;cursor:pointer;box-shadow:none;text-transform:none}
.vrt-bar .vrt-btn:hover{border-color:#999!important}
.vrt-btn:focus-visible{outline:2px solid #2563eb;outline-offset:2px}
.vrt-bar .vrt-t-sepia,.vrt-bar .vrt-t-sepia:hover,.vrt-bar .vrt-t-sepia:focus{background:#f6ecd4!important;color:#5b4636!important;border-color:#e6d3a8!important}
.vrt-bar .vrt-t-dark,.vrt-bar .vrt-t-dark:hover,.vrt-bar .vrt-t-dark:focus{background:#1f2430!important;color:#f1f1f1!important;border-color:#1f2430!important}
.vrt-bar .vrt-btn[aria-pressed="true"]{outline:2px solid #2563eb;outline-offset:1px}
.vrt-fs-value{min-width:44px;text-align:center;color:#222}

/* Font size: only once the reader has changed it */
html[data-vrt-fs] .vrt-content :is(p,li,blockquote,td,dd){font-size:var(--vrt-fs)!important;line-height:1.7!important}
html[data-vrt-fs] .vrt-content h2{font-size:calc(var(--vrt-fs)*1.4)!important;line-height:1.3!important}
html[data-vrt-fs] .vrt-content h3{font-size:calc(var(--vrt-fs)*1.2)!important;line-height:1.35!important}

/* Reading themes: tint the story box only, the rest of the site is untouched */
html[data-vrt-theme] .vrt-content{padding:20px 18px;border-radius:12px}
html[data-vrt-theme="sepia"] .vrt-content{background:#f6ecd4;color:#3f3226}
html[data-vrt-theme="dark"] .vrt-content{background:#1b1f27;color:#e6e6e6}
html[data-vrt-theme] .vrt-content :is(p,li,blockquote,h1,h2,h3,h4,h5,h6,strong,em,span,td,dd,dt,figcaption){color:inherit!important}
html[data-vrt-theme="sepia"] .vrt-content a{color:#8a4b12!important}
html[data-vrt-theme="dark"] .vrt-content a{color:#8ab4ff!important}

@media (max-width:480px){.vrt-bar{padding:8px 10px}.vrt-label{display:none}}

/* Chapter pages: next / previous */
.vrt-pager{display:flex;flex-direction:column;align-items:stretch;gap:10px;margin:28px 0;font-family:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif}
.vrt-pager .vrt-next{display:flex;flex-direction:column;gap:4px;padding:16px 20px;border-radius:12px;background:#2563eb!important;color:#fff!important;text-decoration:none!important;text-align:center;box-shadow:0 6px 18px rgba(37,99,235,.25)}
.vrt-pager .vrt-next:hover{background:#1d4ed8!important}
.vrt-next-label{font-size:13px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;opacity:.85}
.vrt-next-title{font-size:20px;font-weight:700;line-height:1.3}
.vrt-pager .vrt-prev{align-self:center;color:#555!important;font-size:15px;text-decoration:underline!important}
.vrt-pager-count{align-self:center;color:#888;font-size:13px}

/* Floating chapter button */
.vrt-fab{position:fixed;right:16px;bottom:calc(96px + env(safe-area-inset-bottom));z-index:99998;display:inline-flex;align-items:center;gap:8px;height:48px;padding:0 18px;border:0!important;border-radius:999px;background:rgba(37,99,235,.92)!important;color:#fff!important;font:700 16px/1 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;box-shadow:0 6px 20px rgba(0,0,0,.2);cursor:pointer}
.vrt-fab:hover,.vrt-fab:focus{background:#1d4ed8!important;color:#fff!important}
.vrt-fab:focus-visible{outline:3px solid #93c5fd;outline-offset:2px}

/* Chapter sheet */
.vrt-overlay{position:fixed;inset:0;z-index:99999;display:flex;align-items:flex-end;justify-content:center;background:rgba(0,0,0,.45)}
.vrt-overlay[hidden]{display:none}
.vrt-sheet{position:relative;width:100%;max-width:640px;max-height:80vh;display:flex;flex-direction:column;background:#fff;color:#1f2430;border-radius:20px 20px 0 0;box-shadow:0 -8px 30px rgba(0,0,0,.2);font-family:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;animation:vrt-up .22s ease-out;padding-bottom:env(safe-area-inset-bottom)}
@keyframes vrt-up{from{transform:translateY(40px);opacity:0}to{transform:none;opacity:1}}
.vrt-sheet-grip{align-self:center;width:44px;height:5px;margin:10px 0 4px;border-radius:3px;background:#d6d9de}
.vrt-sheet-head{display:flex;align-items:center;gap:12px;padding:8px 18px 12px}
.vrt-sheet-icon{flex:none;display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;border-radius:12px;background:#eef2ff;color:#2563eb}
.vrt-sheet-titles{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.vrt-sheet-title{font-size:17px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.vrt-sheet-sub{font-size:13px;color:#6b7280}
.vrt-overlay .vrt-sheet-close{flex:none;width:40px;height:40px;padding:0!important;border:0!important;border-radius:50%;background:#f1f2f4!important;color:#4b5563!important;font-size:26px;line-height:1;cursor:pointer}
.vrt-search{display:flex;align-items:center;gap:10px;margin:0 18px 10px;padding:0 14px;height:46px;border-radius:12px;background:#f3f4f6;color:#6b7280}
.vrt-search input{flex:1;min-width:0;height:100%;border:0!important;outline:0;background:transparent!important;box-shadow:none!important;color:#1f2430;font-size:16px;padding:0!important}
.vrt-sheet-list{list-style:none!important;margin:0!important;padding:4px 10px 16px!important;overflow-y:auto;border-top:1px solid #f0f1f3}
.vrt-sheet-list li{margin:0!important;padding:0!important}
.vrt-sheet-list li[hidden]{display:none}
.vrt-sheet-item{display:flex;align-items:center;gap:14px;padding:12px;border-radius:12px;color:#1f2430!important;text-decoration:none!important;font-size:17px;line-height:1.3}
.vrt-sheet-item:hover{background:#f5f7fb}
.vrt-num{flex:none;display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:50%;background:#eef2ff;color:#2563eb;font-size:13px;font-weight:700}
.vrt-sheet-item.vrt-active{background:#eef4ff;color:#2563eb!important;font-weight:600}
.vrt-sheet-item.vrt-active .vrt-num{background:#2563eb;color:#fff}
html.vrt-lock,html.vrt-lock body{overflow:hidden}
.vrt-content h2[id],.vrt-content h3[id]{scroll-margin-top:90px}
