/* MarkasIM PWA + mobile reader/player upgrade */
html.mk-pwa-mode .salesproof,
body.mk-pwa-mode .salesproof,
body.mk-pwa-mode [data-salesproof-rotator]{display:none!important;visibility:hidden!important;opacity:0!important;pointer-events:none!important}

body.mk-reader-page .page-wrap-premium{max-width:none;width:100%;padding-left:0;padding-right:0}
body.mk-reader-page .site-footer{display:none}
.msr-page.reader-upgraded{max-width:1280px;margin:18px auto 40px;padding:0 14px}
.msr-reader-head.reader-upgraded{background:linear-gradient(135deg,#fff7ed,#fff,#fdf2f8);border:1px solid #fee2e2}
.msr-reader-head.reader-upgraded span{color:#db2777}
.msr-reader-head.reader-upgraded h1{color:#11103a}
.msr-reader-card.reader-upgraded{background:#0b1026;overflow:hidden;position:relative}
.msr-reader-card--pdf{background:#f8fafc!important;padding:10px!important;display:block!important;min-height:70vh}
.msr-frame.msr-pdf-frame{display:block;width:100%;height:76vh;min-height:560px;border:0;border-radius:16px;background:#fff;overflow:auto;-webkit-overflow-scrolling:touch}
.msr-reader-note{margin-top:10px;color:#64748b;font-size:.9rem;line-height:1.55}
.msr-progress-note{display:inline-flex;align-items:center;gap:8px;background:#fff7ed;color:#9a3412;border:1px solid #fed7aa;padding:8px 10px;border-radius:999px;font-size:.86rem;font-weight:850}
.msr-media{width:100%;max-height:76vh;border-radius:16px;background:#000;outline:none}
.msr-audio{width:min(760px,100%)}
.msr-reader-actions .msr-btn.light{color:#7c2d12!important;border-color:#fed7aa;background:#fff7ed}

@media(max-width:768px){
  body.mk-reader-page .page-wrap{padding-top:0!important}
  .msr-page.reader-upgraded{margin:0 auto 28px;padding:0}
  .msr-reader-head.reader-upgraded{border-radius:0;margin-bottom:0;padding:14px 14px 12px;display:grid;gap:12px}
  .msr-reader-head.reader-upgraded h1{font-size:1.2rem;line-height:1.25;margin:4px 0;word-break:break-word}
  .msr-reader-head.reader-upgraded p{font-size:.88rem;line-height:1.45}
  .msr-reader-actions{gap:8px}.msr-reader-actions .msr-btn{padding:10px 12px;font-size:.86rem;flex:1 1 auto}
  .msr-reader-card.reader-upgraded{border-radius:0;padding:8px;min-height:calc(100dvh - 190px)}
  .msr-reader-card--pdf{padding:0!important;min-height:calc(100dvh - 180px)}
  .msr-frame.msr-pdf-frame{height:calc(100dvh - 178px)!important;min-height:480px;border-radius:0}
  .msr-media{max-height:calc(100dvh - 220px);border-radius:8px}
  .msr-complete-box{margin:10px;border-radius:14px}
}

/* PDF.js single-page reader: reliable on Android Chrome/PWA */
.msr-pdf-reader{width:100%;height:100%;display:flex;flex-direction:column;background:#eef2f7;min-height:70vh}
.msr-pdf-toolbar{position:sticky;top:0;z-index:12;display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:10px 12px;background:rgba(255,255,255,.97);border-bottom:1px solid #e2e8f0;box-shadow:0 7px 18px rgba(15,23,42,.06)}
.msr-pdf-tool,.msr-pdf-retry{appearance:none;border:1px solid #d7ddea!important;background:#fff!important;color:#1e293b!important;box-shadow:none!important;border-radius:10px!important;min-width:40px;min-height:38px;padding:8px 11px!important;font-weight:900;line-height:1;cursor:pointer}
.msr-pdf-tool:hover,.msr-pdf-retry:hover{transform:none!important;filter:none!important;background:#fff7ed!important;border-color:#fed7aa!important}
.msr-pdf-tool:disabled{opacity:.4;cursor:not-allowed}
.msr-pdf-tool.fit{min-width:52px}
.msr-pdf-pagebox{display:inline-flex;align-items:center;gap:6px;margin:0!important;font-size:.88rem;font-weight:800;color:#475569}
.msr-pdf-pagebox input{width:58px!important;min-width:58px!important;height:38px;padding:6px 8px!important;margin:0!important;border:1px solid #cbd5e1!important;border-radius:9px!important;text-align:center;box-shadow:none!important;background:#fff!important}
.msr-pdf-separator{width:1px;height:26px;background:#e2e8f0;margin:0 2px}
.msr-pdf-status{margin-left:auto;color:#64748b;font-size:.82rem;font-weight:750;white-space:nowrap}
.msr-pdf-stage{position:relative;flex:1;min-height:65vh;overflow:auto;-webkit-overflow-scrolling:touch;padding:16px 12px 28px;display:flex;align-items:flex-start;justify-content:center;overscroll-behavior:contain;background:#dce2ea}
.msr-pdf-canvas{display:block;background:#fff;box-shadow:0 8px 30px rgba(15,23,42,.20);max-width:none!important;height:auto}
.msr-pdf-loading,.msr-pdf-error{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;gap:12px;flex-direction:column;padding:24px;text-align:center;color:#475569;font-weight:850;background:#eef2f7;z-index:4}
.msr-pdf-loading[hidden],.msr-pdf-error[hidden]{display:none!important}
.msr-pdf-float{display:none!important;position:fixed!important;top:50%;transform:translateY(-50%)!important;z-index:40;width:44px!important;height:56px!important;min-width:44px!important;padding:0!important;border-radius:14px!important;border:1px solid rgba(255,255,255,.55)!important;background:rgba(15,23,42,.78)!important;color:#fff!important;box-shadow:0 12px 28px rgba(15,23,42,.22)!important;font-size:2rem!important;line-height:1!important;backdrop-filter:blur(8px)}
.msr-pdf-float.prev{left:8px}.msr-pdf-float.next{right:8px}

@media(max-width:768px){
  .msr-reader-card--pdf{height:calc(100vh - 150px);height:calc(100dvh - 150px);min-height:520px!important;overflow:hidden!important}
  .msr-pdf-reader{height:100%;min-height:0}
  .msr-pdf-toolbar{position:relative;top:auto;padding:8px;gap:6px;flex-wrap:nowrap;overflow-x:auto;-webkit-overflow-scrolling:touch;scrollbar-width:none}
  .msr-pdf-toolbar::-webkit-scrollbar{display:none}
  .msr-pdf-toolbar .msr-pdf-status{display:none}
  .msr-pdf-toolbar .msr-pdf-separator{flex:0 0 1px}
  .msr-pdf-tool{flex:0 0 auto;min-width:38px;min-height:36px;padding:7px 9px!important}
  .msr-pdf-pagebox{flex:0 0 auto;font-size:.8rem}
  .msr-pdf-pagebox input{width:50px!important;min-width:50px!important;height:36px}
  .msr-pdf-stage{min-height:0;height:auto;padding:10px 7px 30px;align-items:flex-start}
  .msr-pdf-float{display:flex!important;align-items:center;justify-content:center}
  .msr-pdf-float:disabled{display:none!important}
}

@media(max-width:420px){
  .msr-pdf-pagebox>span:first-child{display:none}
  .msr-pdf-tool.fit{min-width:45px}
}


/* v20260824c: smoother large Google Drive video playback */
.msr-video-smart{width:100%;display:grid;gap:12px}
.msr-video-primary,.msr-video-alternative{width:100%}
.msr-drive-video-frame{display:block;width:100%;aspect-ratio:16/9;min-height:360px;border:0;border-radius:16px;background:#000}
.msr-video-switch-row{display:flex;justify-content:flex-end;align-items:center;gap:10px}
.msr-video-switch{appearance:none;-webkit-appearance:none;cursor:pointer}
@media(max-width:760px){
  .msr-drive-video-frame{min-height:0;aspect-ratio:16/9;border-radius:12px}
  .msr-video-switch-row{justify-content:stretch}
  .msr-video-switch-row .msr-btn{width:100%;text-align:center;justify-content:center}
}
