/* Mirrors the two-toolbar, single-page reading room of Bazi Wuxin, v0.6.95. */
.mds-book-store.mds-preview-reader {box-sizing:border-box; max-width:1280px; margin:0 auto; padding:26px 18px 58px; color:#233047; background:#faf6ef; border-radius:24px}
.mds-preview-reader *{box-sizing:border-box}
.mds-reader-top{display:flex;align-items:start;gap:22px;margin-bottom:18px}
.mds-reader-top>.mds-preview-back{display:inline-flex;flex:0 0 auto;align-items:center;border:1px solid #e3d5c5;border-radius:999px;background:#fff;padding:11px 16px;color:#8e3752!important;text-decoration:none!important;font-weight:750;box-shadow:0 4px 12px #35271d0a}
.mds-reader-top>div{min-width:0;flex:1}
.mds-reader-kicker{display:block;color:#8e3752;font-size:12px;font-weight:800;letter-spacing:.12em;margin-bottom:5px}
.mds-reader-top h1{font-size:clamp(25px,3.2vw,38px);line-height:1.18;margin:0 0 7px;color:#19263d}
.mds-reader-top p{margin:0;color:#6b7280;font-size:15px}
.mds-reader{border:1px solid #e0d9cf;border-radius:18px;overflow:hidden;background:#eff0ec;box-shadow:0 14px 34px rgba(32,34,33,.08)}
.mds-reader-toolbar{min-height:58px;display:flex;justify-content:center;align-items:center;gap:9px;padding:9px 13px;background:#fff;border-bottom:1px solid #e0e2df}
.mds-reader-toolbar--bottom{border-bottom:0;border-top:1px solid #e0e2df}
.mds-reader-toolbar button{display:inline-flex!important;align-items:center!important;justify-content:center!important;width:39px!important;height:39px!important;min-width:39px!important;min-height:39px!important;line-height:1!important;border-radius:10px!important;border:1px solid #d5d6d4!important;padding:0!important;margin:0!important;color:#273343!important;font-size:20px!important;font-weight:650!important;background:#fff!important;cursor:pointer!important;box-shadow:none!important}
.mds-reader-toolbar button:hover:not(:disabled){background:#f7edf0!important;border-color:#bf9dae!important}
.mds-reader-toolbar button:disabled{opacity:.35;cursor:default!important}
.mds-reader-page-number{display:flex;align-items:center;gap:7px;white-space:nowrap;color:#343b45;font-size:14px}
.mds-reader-page-number input[type=number]{width:64px!important;height:39px!important;min-height:39px!important;padding:4px!important;margin:0!important;text-align:center!important;border:1px solid #d5d6d4!important;background:#fff!important;border-radius:8px!important;color:#1d2735!important;font-size:15px!important;box-shadow:none!important}
.mds-reader-page-number input[type=number]::-webkit-inner-spin-button,.mds-reader-page-number input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
.mds-reader-page-number input[type=number]{-moz-appearance:textfield;appearance:textfield}
.mds-reader-zoom{min-width:46px;font-size:13px;text-align:center;font-weight:750;color:#3b4758}
.mds-reader-divider{width:1px;height:28px;background:#dcdedc;margin:0 6px}
.mds-reader-stage{position:relative;min-height:65vh;display:flex;align-items:flex-start;justify-content:center;padding:24px 15px;overflow:auto;background:#e9ecea}
.mds-reader-stage img,.mds-reader-stage canvas{display:block;max-width:none;margin:0 auto;box-shadow:0 5px 22px #0000002c;background:#fff}
.mds-reader-stage .mds-reader-image{max-width:none;height:auto;object-fit:contain}
.mds-reader-loading{margin:64px auto;padding:15px 20px;background:white;color:#344355;border:1px solid #e3e4e1;border-radius:12px;text-align:center;box-shadow:0 4px 15px #00000012}
.mds-reader-loading[hidden]{display:none!important}
.mds-reader-foot{margin:0!important;padding:14px 18px!important;text-align:center;font-size:13px!important;line-height:1.6!important;color:#656b73!important;background:#fff}
.mds-reader-foot a{color:#8e3752!important;font-weight:700!important;text-decoration:underline!important}
.mds-reader:fullscreen{border:0;border-radius:0;display:flex;flex-direction:column}
.mds-reader:fullscreen .mds-reader-stage{flex:1;min-height:0}
@media(max-width:760px){.mds-book-store.mds-preview-reader{padding:18px 12px 40px;border-radius:15px}.mds-reader-top{flex-direction:column;gap:12px}.mds-reader-toolbar{gap:5px;flex-wrap:wrap}.mds-reader-toolbar button{width:35px!important;min-width:35px!important;height:35px!important;min-height:35px!important}.mds-reader-divider{display:none}.mds-reader-stage{padding:14px 8px;min-height:55vh}.mds-reader-page-number input[type=number]{height:35px!important;min-height:35px!important}}


/* 1.0.8 — четыре защитных маркера, как в библиотеке Ба-цзы.
 * В режиме Imagick они наносятся на сервере прямо на изображение,
 * а при резервном PDF.js — визуальным слоем поверх canvas. */
.mds-reader-stage .mds-reader-paper{
    position:relative;
    display:block;
    flex:0 0 auto;
    width:100%;
    margin:0 auto;
    line-height:0;
    box-shadow:0 5px 22px rgba(0,0,0,.17);
    background:#fff;
}
.mds-reader-stage .mds-reader-paper > img,
.mds-reader-stage .mds-reader-paper > canvas{
    margin:0;
    box-shadow:none;
}
.mds-reader-watermarks{
    position:absolute;
    inset:0;
    z-index:3;
    overflow:hidden;
    pointer-events:none;
    user-select:none;
    -webkit-user-select:none;
    -webkit-touch-callout:none;
}
.mds-reader-watermarks span{
    position:absolute;
    display:block;
    width:85%;
    text-align:center;
    left:50%;
    font-size:clamp(13px,1.7vw,24px);
    font-family:Arial,sans-serif;
    font-weight:600;
    color:rgba(45,55,52,.16);
    white-space:nowrap;
    line-height:1.2;
    transform:translate(-50%,-50%) rotate(-22deg);
}
.mds-reader-watermarks span:nth-child(1){top:22%;left:32%}
.mds-reader-watermarks span:nth-child(2){top:42%;left:68%}
.mds-reader-watermarks span:nth-child(3){top:62%;left:32%}
.mds-reader-watermarks span:nth-child(4){top:82%;left:68%}
.mds-reader-watermarks small{
    position:absolute;
    bottom:10px;
    left:10px;
    right:10px;
    display:block;
    font-family:Arial,sans-serif;
    font-size:clamp(10px,1.1vw,15px);
    color:rgba(30,40,38,.3);
    text-align:center;
    line-height:1.3;
}
/* В защищённом режиме уже видны серверные маркеры: не удваиваем их. */
.mds-reader[data-secure="1"] .mds-reader-watermarks{display:none}
.mds-preview-reader .mds-reader,
.mds-preview-reader .mds-reader *{
    -webkit-user-select:none;
    user-select:none;
    -webkit-touch-callout:none;
}
.mds-preview-reader .mds-reader input{
    -webkit-user-select:text;
    user-select:text;
}
.mds-reader-stage img,
.mds-reader-stage canvas{
    -webkit-user-drag:none;
    user-drag:none;
}
@media print{
    .mds-preview-reader .mds-reader-stage,
    .mds-preview-reader .mds-reader-paper,
    .mds-preview-reader .mds-reader-paper img,
    .mds-preview-reader .mds-reader-paper canvas{
        display:none!important;
        visibility:hidden!important;
    }
    .mds-preview-reader .mds-reader-stage:after{
        content:"Печать ознакомительного фрагмента недоступна";
        display:block!important;
        color:#273343;
        background:#fff;
        padding:24px;
        font-size:16px;
    }
}

/* v1.0.11 — keep the previous page visible while the next page downloads. */
.mds-preview-reader .mds-reader-stage{position:relative;}
.mds-preview-reader .mds-reader-loading{
    position:absolute;top:14px;left:50%;transform:translateX(-50%);z-index:6;
    margin:0;max-width:calc(100% - 30px);white-space:normal;pointer-events:none;
    box-shadow:0 7px 24px rgba(0,0,0,.13);
}
