/* Isolated styling: original desktop images are untouched until selected options change. */
#bmv-open{border:1px solid #ff7417;background:#111;color:#ffb17a;border-radius:8px;padding:8px 13px;font-size:14px;line-height:1.25;cursor:pointer;margin:3px 6px;box-shadow:none;min-height:40px}
#bmv-open:hover,#bmv-open:focus-visible{outline:2px solid #ff7417;outline-offset:2px}
#bmv-panel[hidden],#bmv-shade[hidden],#bmv-zoom[hidden],#bmv-progress[hidden]{display:none!important}
#bmv-shade{position:fixed;inset:0;background:rgba(0,0,0,.62);z-index:99988}
#bmv-panel{position:fixed;right:0;top:0;bottom:0;z-index:99989;width:min(430px,100vw);overflow-y:auto;overscroll-behavior:contain;background:#101012;color:#eee;border-left:1px solid #3b3b3b;box-shadow:-10px 0 36px #0009;font:14px/1.45 Arial,sans-serif;scrollbar-color:#ff7417 #101012}
#bmv-panel *{box-sizing:border-box}
#bmv-panel button,#bmv-panel select,#bmv-panel input{font:inherit}
#bmv-panel button,#bmv-panel select{background:#202024;color:#f5f5f5;border:1px solid #4e4e55;border-radius:8px;padding:9px 12px;cursor:pointer;min-height:39px}
#bmv-panel button[aria-pressed=true],#bmv-panel button[aria-selected=true]{background:#ff7417;color:#17110c;border-color:#ff7417;font-weight:700}
#bmv-panel :focus-visible{outline:3px solid #ffa25b;outline-offset:2px}
#bmv-panel input[type=range],#bmv-panel input[type=checkbox]{accent-color:#ff7417}
#bmv-panel input[type=color]{height:36px;width:64px;background:transparent;border:0;padding:0;cursor:pointer}
.bmv-head{position:sticky;top:0;z-index:1;display:flex;justify-content:space-between;align-items:center;gap:12px;background:#101012;border-bottom:1px solid #37373b;padding:14px 16px}
.bmv-head h2{color:#fff;font:700 18px Arial,sans-serif;margin:0}
.bmv-tabs{display:flex;gap:5px;padding:10px;position:sticky;top:65px;background:#101012;z-index:1}
.bmv-tabs button{flex:1;padding:9px 5px!important;font-size:13px!important}
.bmv-pane{padding:10px 16px 20px}
.bmv-pane h3{font:700 15px Arial,sans-serif;color:#ff9a51;margin:16px 0 8px}
.bmv-row{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:9px 0;border-bottom:1px solid #28282c}
.bmv-row label{flex:1;cursor:pointer}
.bmv-row output{color:#ffb17a;min-width:52px;text-align:right}
.bmv-row input[type=range]{width:130px;max-width:43%}
.bmv-choices{display:flex;flex-wrap:wrap;gap:7px;margin:8px 0 12px}
.bmv-choices button{flex:1 1 auto}
.bmv-note{color:#b9b9be;font-size:12px;line-height:1.5;margin:6px 0 14px}
.bmv-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:13px}
.bmv-actions button{flex:1 1 auto}
#bmv-progress{position:fixed;bottom:0;left:0;width:100%;height:3px;pointer-events:none;background:#0003;z-index:99970}
#bmv-progress>i{display:block;height:100%;width:100%;background:#ff7417;transform-origin:left;transform:scaleX(0)}
#bmv-veil{position:fixed;inset:0;pointer-events:none;z-index:99960;background:rgba(0,0,0,var(--bmv-dim,0))}
#bmv-warm{position:fixed;inset:0;pointer-events:none;z-index:99959;background:rgba(255,139,38,var(--bmv-warm,0))}
#bmv-zoom{position:fixed;inset:0;z-index:99992;background:#000e;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:10px}
#bmv-zoom img{max-width:96vw;max-height:88vh;object-fit:contain;transform:scale(var(--bmv-zoom,1));transform-origin:center;cursor:zoom-in}
#bmv-zoom button{background:#ff7417;color:#111;border:0;border-radius:6px;padding:10px 18px}
body.bmv-active .reading-content .page-break{margin-top:var(--bmv-gap,0px)!important;margin-bottom:0!important;border-radius:var(--bmv-radius,0px);overflow:visible}
body.bmv-active .reading-content .page-break img,body.bmv-active .reading-content .msp-paged-img{border-radius:var(--bmv-radius,0px);filter:brightness(var(--bmv-bright,1)) contrast(var(--bmv-contrast,1)) saturate(var(--bmv-sat,1)) hue-rotate(var(--bmv-hue,0deg)) sepia(var(--bmv-sepia,0)) grayscale(var(--bmv-gray,0)) invert(var(--bmv-invert,0));}
body.bmv-active.bmv-width-fit .reading-content .page-break img{max-width:100%!important;width:100%!important;height:auto!important}
body.bmv-active.bmv-width-height .reading-content .page-break img{max-height:100vh!important;max-width:100%!important;width:auto!important;height:auto!important;margin:auto}
body.bmv-active.bmv-width-compact .reading-content .page-break img{max-width:min(700px,100%)!important;width:100%!important;height:auto!important;margin:auto}
body.bmv-active.bmv-width-original .reading-content .page-break img{width:auto!important;max-width:100%!important;height:auto!important;margin:auto}
body.bmv-active .reading-content .page-break{background:transparent}
body.bmv-active .reading-content{background:var(--bmv-bg,transparent)}
body.bmv-accessible #bmv-open{min-height:48px;font-size:17px}
body.bmv-low-motion *,body.bmv-low-motion *::before,body.bmv-low-motion *::after{animation-duration:.01ms!important;transition-duration:.01ms!important;scroll-behavior:auto!important}
body.bmv-hide-chrome .site-header,body.bmv-hide-chrome .c-sub-header-nav,body.bmv-hide-chrome .site-footer{display:none!important}
@media(max-width:767px){body.bmv-active .reading-content,body.bmv-active .reading-content .page-break{width:100%!important;max-width:100%!important;padding-left:0!important;padding-right:0!important}body.bmv-active .reading-content .page-break img,body.bmv-active .reading-content .msp-paged-img{display:block;max-width:100%!important;height:auto!important;margin:0 auto}#bmv-open{font-size:13px;padding:8px}#bmv-panel{width:100vw}}

.bmv-inline-nav{display:flex;justify-content:flex-end;align-items:center;padding:8px 12px;background:#101012;border-radius:8px;margin:8px auto;max-width:100%}

/* v1.2: ensure nav control is not hidden by select-box styles */
.wp-manga-nav #bmv-open,.entry-header #bmv-open{display:inline-flex!important;align-items:center;justify-content:center;visibility:visible!important;opacity:1!important;position:relative!important;z-index:5;float:none;flex:0 0 auto;white-space:nowrap;vertical-align:middle}
.wp-manga-nav .select-view:has(#bmv-open){display:flex;align-items:center;gap:8px;flex-wrap:wrap}
@media(max-width:767px){#bmv-open{white-space:normal;min-height:44px}}

/* v1.3: the settings button belongs inside the actual reading select row. */
body.reading-manga .wp-manga-nav .select-view #bmv-open,
body.reading-manga .entry-header #bmv-open {
 display:inline-flex!important; align-items:center!important; justify-content:center!important;
 background:#151515!important; color:#ffab68!important; border:1px solid #ff7417!important;
 visibility:visible!important; opacity:1!important; transform:none!important;
 position:relative!important; float:none!important; flex:0 0 auto!important;
 width:auto!important; height:auto!important; min-width:140px!important;
 margin:4px 8px!important; padding:9px 13px!important; z-index:20!important;
}
body.reading-manga .wp-manga-nav .select-view{flex-wrap:wrap!important;align-items:center!important}
@media(max-width:767px){body.reading-manga .wp-manga-nav .select-view #bmv-open{min-width:0!important;font-size:13px!important}}

/* v1.4: independent row, visible and accessible even when select-view is clipped. */
body.reading-manga .bmv-control-row{display:flex!important;justify-content:flex-end!important;align-items:center!important;position:relative!important;isolation:isolate!important;z-index:40!important;width:100%!important;min-height:48px!important;overflow:visible!important;padding:2px 0 8px!important;margin:0!important;background:transparent!important;visibility:visible!important;opacity:1!important}
body.reading-manga .bmv-control-row #bmv-open{display:inline-flex!important;position:relative!important;visibility:visible!important;opacity:1!important;align-items:center!important;justify-content:center!important;float:none!important;background:#181818!important;border:1px solid #ff7417!important;color:#ffb17a!important;font-weight:700!important;font-size:14px!important;line-height:1.3!important;min-height:40px!important;min-width:165px!important;width:auto!important;max-width:100%!important;padding:10px 15px!important;margin:0!important;transform:none!important;box-shadow:none!important;cursor:pointer!important;pointer-events:auto!important}
body.reading-manga .bmv-control-row #bmv-open:focus-visible{outline:3px solid #ff9a41!important;outline-offset:3px!important}
@media(max-width:767px){body.reading-manga .bmv-control-row{padding:8px 6px!important}body.reading-manga .bmv-control-row #bmv-open{font-size:14px!important;min-width:160px!important}}

/* v1.5: compact, ergonomic, black/orange control surface; retains v1.4 nav position. */
#bmv-panel{--bmv-accent:#ff7417;--bmv-line:#34343a;background:#0d0d0f;color:#f5f5f5;max-width:100%;font-size:14px;line-height:1.55;scrollbar-gutter:stable;}
#bmv-panel :is(button,select){transition:background-color .10s ease,border-color .10s ease;color:#f6f6f6}
#bmv-panel button:hover{border-color:var(--bmv-accent);background:#303035;color:#fff}
#bmv-panel button[aria-pressed=true],#bmv-panel button[aria-selected=true],#bmv-panel button[aria-pressed=true]:hover,#bmv-panel button[aria-selected=true]:hover{background:var(--bmv-accent);border-color:var(--bmv-accent);color:#15100b}
#bmv-panel :is(button,input,select):focus-visible{outline:3px solid #ffae6c;outline-offset:3px}
#bmv-panel .bmv-head{top:0;min-height:65px;padding:13px 18px;background:#101012;border-bottom:1px solid var(--bmv-line)}
#bmv-panel .bmv-head h2{font:700 17px/1.3 Arial,sans-serif;letter-spacing:-.2px}
#bmv-panel .bmv-head button{width:42px;height:42px;display:inline-grid;place-items:center;flex:none;padding:0;font-size:20px;border-color:#505057}
#bmv-panel .bmv-tabs{top:65px;padding:10px 12px 12px;border-bottom:1px solid #222227;background:#101012;gap:6px}
#bmv-panel .bmv-tabs button{min-width:0;min-height:43px;line-height:1.1;font-weight:600;padding:10px 3px!important}
#bmv-panel .bmv-pane{padding:12px 17px 28px}
#bmv-panel .bmv-pane h3{font:700 14px/1.4 Arial,sans-serif;margin:19px 0 10px;color:#ffa76d;letter-spacing:.2px}
#bmv-panel .bmv-choices{gap:7px;margin:5px 0 14px}
#bmv-panel .bmv-choices button{flex:1 1 108px;min-height:43px;padding:9px 10px;border-radius:9px;font-size:13px}
#bmv-panel .bmv-note{font-size:12px;color:#b6b6bb;line-height:1.55;margin:7px 0 13px}
#bmv-panel .bmv-row{min-height:54px;padding:12px 0;gap:14px}
#bmv-panel .bmv-row input[type=range]{width:142px;max-width:45%;cursor:pointer}
#bmv-panel .bmv-row output{font-size:12px;min-width:44px;font-variant-numeric:tabular-nums}
#bmv-panel .bmv-actions button{min-height:44px;flex:1 1 120px}
#bmv-panel .bmv-toggle-row{padding:0;border-bottom:1px solid #29292e}
#bmv-panel .bmv-switch-label{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:67px;padding:12px 0;cursor:pointer;margin:0;width:100%;color:#f0f0f2;font-weight:400}
#bmv-panel .bmv-switch-copy{display:flex;flex-direction:column;gap:4px;flex:1;min-width:0}
#bmv-panel .bmv-switch-title{font-size:14px;line-height:1.35;font-weight:600;color:#f5f5f5}
#bmv-panel .bmv-switch-help{font-size:12px;line-height:1.5;color:#aaaab2;font-weight:400}
#bmv-panel .bmv-switch-control{position:relative;display:block;flex:none;width:48px;height:28px}
#bmv-panel .bmv-switch-control input{appearance:none;-webkit-appearance:none;position:absolute;inset:0;z-index:2;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}
#bmv-panel .bmv-switch-track{position:absolute;inset:0;background:#4b4b52;border:1px solid #73737c;border-radius:20px;transition:background .1s ease,border-color .1s ease}
#bmv-panel .bmv-switch-track::after{content:'';position:absolute;left:3px;top:3px;width:20px;height:20px;border-radius:50%;background:#fff;transition:transform .1s ease;box-shadow:0 1px 3px #0006}
#bmv-panel .bmv-switch-control input:checked + .bmv-switch-track{background:#ff7417;border-color:#ff7417}
#bmv-panel .bmv-switch-control input:checked + .bmv-switch-track::after{transform:translateX(20px);background:#16100c}
#bmv-panel .bmv-switch-control input:focus-visible + .bmv-switch-track{outline:3px solid #ffae6c;outline-offset:3px}
#bmv-panel[hidden]{display:none!important}
@media(max-width:767px){#bmv-panel{width:100vw;border-left:0;padding-bottom:env(safe-area-inset-bottom)}#bmv-panel .bmv-tabs{gap:5px;padding:9px 10px}#bmv-panel .bmv-tabs button{font-size:12px!important}#bmv-panel .bmv-pane{padding:10px 14px 28px}#bmv-panel .bmv-choices button{min-height:46px}#bmv-panel .bmv-switch-label{min-height:72px}#bmv-panel .bmv-row input[type=range]{width:120px}}
@media(prefers-reduced-motion:reduce){#bmv-panel *,#bmv-panel *::before,#bmv-panel *::after{transition:none!important;animation:none!important}}

/* v1.6: image width controls must affect Madara's wrapping elements, not only IMG.
   Keep desktop original untouched. Limit all rules to actual manga reader UI. */
body.bmv-active.bmv-width-fit :is(.reading-content .page-break,.reading-content .read-container,.reading-content .msp-paged-read,.reading-content .msp-paged-container){width:100%!important;max-width:100%!important;box-sizing:border-box!important;}
body.bmv-active.bmv-width-fit :is(.reading-content .page-break img,.reading-content img.wp-manga-chapter-img,.reading-content img.msp-img,.reading-content img.msp-paged-img,.reading-content .msp-image-container img){display:block!important;width:100%!important;max-width:100%!important;height:auto!important;object-fit:contain!important;margin-left:auto!important;margin-right:auto!important;}
body.bmv-active.bmv-width-height :is(.reading-content .page-break img,.reading-content img.wp-manga-chapter-img,.reading-content img.msp-img,.reading-content img.msp-paged-img,.reading-content .msp-image-container img){display:block!important;width:auto!important;max-width:100%!important;max-height:100dvh!important;height:auto!important;object-fit:contain!important;margin-left:auto!important;margin-right:auto!important;}
body.bmv-active.bmv-width-compact :is(.reading-content .page-break img,.reading-content img.wp-manga-chapter-img,.reading-content img.msp-img,.reading-content img.msp-paged-img,.reading-content .msp-image-container img){display:block!important;width:100%!important;max-width:700px!important;height:auto!important;margin-left:auto!important;margin-right:auto!important;}
/* Mobile full bleed: undo Bootstrap gutters and Madara's fixed-width containers for the images only. */
@media (max-width:767px){
 body.bmv-active :is(.reading-content,.reading-content-wrap .reading-content,.c-blog-post .entry-content .entry-content_wrap .reading-content){position:relative!important;box-sizing:border-box!important;display:block!important;width:100vw!important;max-width:100vw!important;margin-left:calc(50% - 50vw)!important;margin-right:0!important;padding-left:0!important;padding-right:0!important;}
 body.bmv-active :is(.reading-content .read-container,.reading-content .page-break,.reading-content .msp-paged-read,.reading-content .msp-paged-container,.reading-content .msp-image-container,.reading-content .msp-img-wrapper){box-sizing:border-box!important;max-width:100%!important;width:100%!important;margin-left:0!important;margin-right:0!important;padding-left:0!important;padding-right:0!important;}
 body.bmv-active :is(.reading-content .page-break img,.reading-content img.wp-manga-chapter-img,.reading-content img.msp-img,.reading-content img.msp-paged-img,.reading-content .msp-image-container img){display:block!important;width:100%!important;max-width:100%!important;height:auto!important;margin-left:auto!important;margin-right:auto!important;border:0!important;}
 body.bmv-active.bmv-width-height :is(.reading-content .page-break img,.reading-content img.wp-manga-chapter-img,.reading-content img.msp-img,.reading-content img.msp-paged-img){width:auto!important;max-width:100%!important;max-height:100dvh!important;}
 html:has(body.bmv-active){overflow-x:clip;}
}
