.reader-header-actions > #readerBgmButton[hidden] {display:none !important;}
.reader-header-actions > #readerBgmButton {font-size:21px;flex-shrink:0;}
.reader-header-actions > #readerBgmButton > span {display:inline-block;transform-origin:center;}
.reader-header-actions > #readerBgmButton.is-on {color:var(--theme-accent,var(--theme-text));background:var(--theme-surface-soft);}
.reader-header-actions > #readerBgmButton.is-on > span {animation:reader-bgm-spin 8s linear infinite;}
@keyframes reader-bgm-spin {to {transform:rotate(360deg);}}
@media(prefers-reduced-motion:reduce) {
  .reader-header-actions > #readerBgmButton.is-on > span {animation:none;}
}
.reader-header-actions > #readerBgmButton.is-loading {opacity:.6;}
.reader-bgm-engine {position:fixed;left:-10000px;top:0;width:1px;height:1px;opacity:0;pointer-events:none;overflow:hidden;}
.reader-bgm-notice {position:fixed;z-index:10090;bottom:calc(24px + env(safe-area-inset-bottom,0px));left:50%;transform:translateX(-50%);box-sizing:border-box;width:max-content;max-width:calc(100vw - 32px);padding:12px 16px;border:1px solid var(--theme-line);border-radius:12px;background:var(--theme-surface-strong,#fff);color:var(--theme-text,#222);font-size:13px;box-shadow:0 4px 24px #0002;}
.reader-bgm-notice[hidden] {display:none;}
@media(max-width:640px) {
  .reader.reader-compact .reader-header-actions > #readerBgmButton {width:38px !important;min-width:38px !important;max-width:38px !important;height:38px !important;min-height:38px !important;max-height:38px !important;flex:0 0 38px !important;padding:0 !important;}
}
@media(max-width:360px) {
  .reader.reader-compact .reader-header-actions > #readerBgmButton {width:34px !important;min-width:34px !important;max-width:34px !important;height:34px !important;min-height:34px !important;max-height:34px !important;flex-basis:34px !important;}
}

/* iOS/iPadOS: start with a reachable player over the reader, but do not
   resize the reader. After PLAYING, users may cover the intact iframe beneath
   the opaque reader panel. Background playback remains Safari-dependent. */
.reader-bgm-engine--ios {
  position:fixed;z-index:10040;left:50%;right:auto;top:50%;bottom:auto;
  transform:translate(-50%,-50%);box-sizing:border-box;
  width:216px;height:auto;padding:7px;
  opacity:1;pointer-events:auto;overflow:visible;
  border:1px solid var(--theme-line,#dedbd8);border-radius:11px;
  background:var(--theme-surface-strong,#fff);color:var(--theme-text,#222);
  box-shadow:0 3px 14px #0002;font-size:11px;line-height:1.3;
}
.reader-bgm-panel-head {display:flex;align-items:center;justify-content:space-between;gap:4px;min-height:27px;margin-bottom:4px;}
.reader-bgm-panel-head strong {font-size:11px;white-space:nowrap;flex:1;}
.reader-bgm-panel-head button {border:1px solid var(--theme-line,#ddd);border-radius:6px;padding:4px 7px;background:var(--theme-surface-soft,#f5f5f5);color:inherit;font:inherit;cursor:pointer;}
.reader-bgm-panel-head button:disabled {opacity:.45;cursor:default;}
.reader-bgm-panel-head button:focus-visible {outline:2px solid var(--theme-accent,currentColor);outline-offset:2px;}
.reader-bgm-engine--ios iframe {
  display:block;box-sizing:border-box;width:200px;height:200px;min-width:200px;min-height:200px;
  border:0;border-radius:5px;background:#000;
}
.reader-bgm-panel-foot {display:flex;align-items:flex-start;gap:6px;min-height:24px;padding-top:5px;}
.reader-bgm-panel-hint {margin:0;min-width:0;flex:1;font-size:10px;line-height:1.25;overflow-wrap:anywhere;}
.reader-bgm-panel-foot > a {flex-shrink:0;font-size:10px;color:inherit;text-underline-offset:2px;white-space:nowrap;}
/* Behind the opaque reader sheet, not display:none/visibility:hidden/1px.
   readerOverlay occupies z-index:50; player stays in the viewport at 200px. */
.reader-bgm-engine--ios.reader-bgm-engine--covered {
  z-index:49;pointer-events:none;box-shadow:none;
}
