.mafb-wrap{width:100%;background:var(--mafb-bg,#171717);color:#fff;border-radius:10px;overflow:hidden;box-shadow:0 10px 35px rgba(0,0,0,.25);font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif}
.mafb-toolbar{height:48px;display:flex;align-items:center;gap:5px;padding:5px 8px;background:#0d0d0d;border-bottom:1px solid #333;position:relative;z-index:30}
.mafb-toolbar button,.mafb-tool-link{height:36px;min-width:36px;padding:0 10px;border:0;border-radius:6px;background:#222;color:#fff;cursor:pointer;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;font-size:15px}.mafb-toolbar button:hover,.mafb-tool-link:hover{background:#333}
.mafb-spacer{flex:1}.mafb-page-counter{display:flex;align-items:center;gap:4px;font-size:13px;white-space:nowrap}.mafb-page-counter input{width:48px;height:30px;border:1px solid #555;border-radius:5px;background:#222;color:#fff;text-align:center}
.mafb-body{display:flex;height:var(--mafb-height,78vh);min-height:520px;position:relative}.mafb-stage{flex:1;min-width:0;display:flex;align-items:center;justify-content:center;overflow:hidden;position:relative;padding:18px;background:radial-gradient(circle,rgba(255,255,255,.07),transparent 58%)}
.mafb-book{width:min(100%,1200px);height:100%;min-height:400px;display:flex;align-items:center;justify-content:center;transition:transform .2s;transform-origin:center}.mafb-page{background:#fff;overflow:hidden}.mafb-page img{display:block;width:100%;height:100%;object-fit:contain;background:#fff}
.mafb-loader{position:absolute;z-index:20;top:50%;left:50%;transform:translate(-50%,-50%);display:flex;flex-direction:column;gap:12px;align-items:center;font-size:15px;opacity:.9}.mafb-spinner{width:30px;height:30px;border:3px solid #555;border-top-color:#fff;border-radius:50%;animation:mafbspin .8s linear infinite}@keyframes mafbspin{to{transform:rotate(360deg)}}
.mafb-error{position:absolute;z-index:25;top:50%;left:50%;transform:translate(-50%,-50%);width:min(90%,650px);padding:20px;background:#491818;border:1px solid #a44;border-radius:8px;text-align:center;line-height:1.5}
.mafb-sidebar{width:280px;background:#111;overflow:auto;border-right:1px solid #333;z-index:40}.mafb-thumbs-panel{border-right:0;border-left:1px solid #333}.mafb-panel-title{padding:14px;font-weight:700;border-bottom:1px solid #333;position:sticky;top:0;background:#111;z-index:2}
.mafb-toc-item{width:100%;padding:11px 13px;background:none;border:0;border-bottom:1px solid #292929;color:#eee;display:flex;justify-content:space-between;text-align:left;cursor:pointer}.mafb-toc-item:hover{background:#222}.mafb-toc-item b{opacity:.6}
.mafb-thumb{width:100%;background:#151515;border:0;border-bottom:1px solid #292929;color:#aaa;padding:7px;cursor:pointer}.mafb-thumb img{width:100%;display:block;background:#fff}.mafb-thumb span{display:block;padding-top:4px}
@media(max-width:700px){.mafb-toolbar{gap:3px;height:46px;padding:4px}.mafb-toolbar button,.mafb-tool-link{min-width:32px;height:34px;padding:0 7px}.mafb-body{height:72vh;min-height:480px}.mafb-stage{padding:5px}.mafb-sidebar{position:absolute;top:0;bottom:0;width:82%}.mafb-toc-panel{left:0}.mafb-thumbs-panel{right:0}.mafb-book{width:100%;height:100%}}
@media print{.mafb-toolbar,.mafb-sidebar{display:none!important}.mafb-wrap,.mafb-body,.mafb-stage{height:auto!important;background:#fff!important}.mafb-page{break-after:page}}

/* Article reading zoom */
.mafb-stage.mafb-zoomed{cursor:grab;touch-action:none;overflow:hidden}
.mafb-stage.mafb-panning{cursor:grabbing}
.mafb-zoom-label{min-width:52px!important;font-variant-numeric:tabular-nums}
.mafb-stage.mafb-zoomed .mafb-book{will-change:transform}
@media(max-width:700px){
  .mafb-stage.mafb-zoomed{overflow:hidden}
  .mafb-stage.mafb-zoomed .mafb-book{max-width:none}
}


/* v1.4 Professional accessibility and reading-mode refinements */
.mafb-wrap button:focus-visible,
.mafb-wrap a:focus-visible,
.mafb-wrap input:focus-visible{
  outline:2px solid currentColor;
  outline-offset:2px;
}
.mafb-stage.mafb-zoomed .mafb-book{
  user-select:none;
  -webkit-user-select:none;
  touch-action:none;
}
.mafb-stage.mafb-zoomed .mafb-page{
  cursor:grab;
}
.mafb-stage.mafb-panning .mafb-page{
  cursor:grabbing;
}
.mafb-toolbar button[disabled],
.mafb-toolbar a[aria-disabled="true"]{
  opacity:.45;
  cursor:not-allowed;
}
.mafb-panel-title{
  display:flex;
  align-items:center;
  justify-content:space-between;
}
.mafb-panel-close{
  border:0;
  background:transparent;
  color:inherit;
  font-size:22px;
  line-height:1;
  cursor:pointer;
  padding:2px 6px;
}
@media (prefers-reduced-motion:reduce){
  .mafb-book{transition:none!important}
  .mafb-spinner{animation:none}
}


/* v1.5 Premium magazine UI */
.mafb-wrap{--mafb-accent:#fff;--mafb-radius:8px}
.mafb-toolbar{border-radius:var(--mafb-radius) var(--mafb-radius) 0 0}
.mafb-toolbar button,.mafb-tool-link{color:var(--mafb-accent)}
.mafb-toolbar-minimal .mafb-toolbar button,.mafb-toolbar-minimal .mafb-tool-link{font-size:13px}
.mafb-overlay-panel{position:absolute;z-index:20;top:12px;right:12px;width:min(360px,calc(100% - 24px));max-height:calc(100% - 24px);overflow:auto;background:inherit;border:1px solid rgba(255,255,255,.18);border-radius:var(--mafb-radius);padding:14px;box-shadow:0 12px 40px rgba(0,0,0,.35);backdrop-filter:blur(8px)}
.mafb-overlay-panel [data-search-input]{width:100%;box-sizing:border-box;padding:9px 10px;margin:8px 0 10px;border-radius:6px;border:1px solid rgba(255,255,255,.25);background:rgba(255,255,255,.08);color:inherit}
.mafb-search-result,.mafb-bookmark-go{width:100%;display:flex;justify-content:space-between;gap:12px;text-align:left;padding:9px;border:0;border-bottom:1px solid rgba(255,255,255,.1);background:transparent;color:inherit;cursor:pointer}
.mafb-search-result:hover,.mafb-bookmark-go:hover{background:rgba(255,255,255,.08)}
.mafb-bookmark-item{display:flex;border-bottom:1px solid rgba(255,255,255,.1)}
.mafb-bookmark-go{flex:1}.mafb-bookmark-remove{border:0;background:transparent;color:inherit;padding:0 8px;cursor:pointer}
.mafb-empty{padding:12px;opacity:.7;font-size:13px}

.mafb-block-notice,.mafb-gutenberg-placeholder{padding:18px;border:1px dashed #8c8f94;background:#f6f7f7;border-radius:6px}
