.epaper-shell{
    margin:28px 0 42px;
    background:#fff;
    border:1px solid var(--border);
    border-radius:22px;
    padding:22px;
}

body:has(.epaper-shell) main.container > .breaking-bar{
    display:none;
}

body:has(.epaper-shell) .top-strip{
    font-size:12px;
    padding:5px 0;
}

body:has(.epaper-shell) .brand-header{
    padding:12px 0;
}

body:has(.epaper-shell) .brand-icon{
    width:48px;
    height:48px;
    border-radius:14px;
    font-size:22px;
}

body:has(.epaper-shell) .brand-name{
    font-size:30px;
}

body:has(.epaper-shell) .tagline{
    font-size:12px;
    margin-top:2px;
}

body:has(.epaper-shell) .header-btn{
    min-height:40px;
    padding:8px 18px;
}

body:has(.epaper-shell) .user-menu-toggle{
    min-height:42px;
}

body:has(.epaper-shell) .user-avatar{
    width:32px;
    height:32px;
}

body:has(.epaper-shell) .main-menu a{
    padding:9px 12px;
    font-size:15px;
}

.epaper-toolbar{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:14px;
    flex-wrap:nowrap;
    padding-bottom:12px;
    border-bottom:1px solid var(--border);
}

.reader-back,
.reader-select,
.reader-tool,
.reader-calendar,
.crop-actions,
.mobile-pagebar{
    display:none;
}

.epaper-kicker{
    color:var(--red);
    font-weight:900;
    margin:0 0 2px;
    text-transform:uppercase;
    letter-spacing:0;
}

.epaper-toolbar h1{
    color:var(--navy);
    font-size:24px;
    font-weight:900;
    line-height:1.2;
    margin:0;
    white-space:nowrap;
}

.epaper-date{
    color:var(--muted);
    margin:4px 0 0;
    font-size:14px;
    white-space:nowrap;
}

.epaper-title-block{
    flex:0 1 auto;
    min-width:260px;
}

.epaper-actions{
    display:flex;
    align-items:center;
    gap:10px;
    flex-wrap:nowrap;
    flex:0 0 auto;
}

.epaper-action{
    border:1px solid var(--border);
    background:#f8fafc;
    color:var(--navy);
    border-radius:999px;
    padding:10px 16px;
    font-weight:900;
    white-space:nowrap;
}

.desktop-epaper-controls{
    display:flex;
    align-items:center;
    gap:10px;
    flex:1 1 auto;
    min-width:0;
    justify-content:flex-end;
}

.desktop-control{
    display:flex;
    align-items:center;
    gap:7px;
    min-width:0;
    margin:0;
    color:var(--muted);
    font-size:13px;
    font-weight:900;
}

.desktop-control select,
.desktop-control input{
    height:42px;
    border:1px solid var(--border);
    background:#f8fafc;
    border-radius:999px;
    padding:0 14px;
    color:var(--navy);
    font-weight:900;
    max-width:220px;
}

.desktop-control input{
    max-width:150px;
}

.share-action{
    cursor:pointer;
}

.share-action svg{
    width:25px;
    height:25px;
    fill:currentColor;
}

.reader-tool svg{
    width:25px;
    height:25px;
    fill:currentColor;
}

.reader-tool.is-active,
.zoom-btn.is-active{
    background:#ef4444;
    color:#fff;
}

.whatsapp-action{
    background:#16a34a;
    border-color:#16a34a;
    color:#fff;
}

.edition-strip{
    display:none;
    gap:10px;
    overflow-x:auto;
    padding:12px 0 4px;
}

.edition-pill{
    flex:0 0 auto;
    min-width:150px;
    border:1px solid var(--border);
    border-radius:12px;
    padding:8px 12px;
    background:#f8fafc;
    color:var(--navy);
}

.edition-pill span,
.edition-pill small{
    display:block;
}

.edition-pill small{
    color:var(--muted);
    margin-top:3px;
}

.edition-pill.is-active{
    background:var(--navy);
    color:#fff;
    border-color:var(--navy);
}

.edition-pill.is-active small{
    color:#dbeafe;
}

.date-wise-editions{
    display:flex;
    flex-direction:column;
    gap:9px;
    margin:12px 0 14px;
    padding:12px;
    border:1px solid var(--border);
    border-radius:14px;
    background:#f8fafc;
}

.date-edition-group{
    display:flex;
    align-items:center;
    gap:12px;
    flex-wrap:wrap;
}

.date-edition-group strong{
    flex:0 0 92px;
    color:var(--navy);
    font-size:14px;
    font-weight:900;
}

.date-edition-links{
    display:flex;
    align-items:center;
    gap:8px;
    flex-wrap:wrap;
    min-width:0;
}

.date-edition-links a{
    display:inline-flex;
    align-items:center;
    min-height:34px;
    max-width:260px;
    border:1px solid var(--border);
    border-radius:999px;
    padding:7px 12px;
    background:#fff;
    color:var(--navy);
    font-size:13px;
    font-weight:900;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.date-edition-links a.is-active{
    background:var(--navy);
    border-color:var(--navy);
    color:#fff;
}

.reader-layout{
    display:grid;
    grid-template-columns:128px minmax(0,1fr);
    gap:18px;
    align-items:start;
}

.page-rail{
    display:flex;
    flex-direction:column;
    gap:12px;
    max-height:76vh;
    overflow:auto;
    padding-right:4px;
}

.page-thumb{
    border:2px solid transparent;
    background:#f8fafc;
    border-radius:12px;
    padding:7px;
    text-align:left;
    color:var(--navy);
    font-weight:900;
}

.page-thumb img{
    width:100%;
    aspect-ratio:3 / 4;
    object-fit:cover;
    border-radius:8px;
    border:1px solid var(--border);
    background:#fff;
}

.page-thumb span{
    display:block;
    margin-top:6px;
    font-size:13px;
}

.page-thumb.is-active{
    border-color:var(--red);
    background:#fff5f5;
}

.reader-stage{
    min-width:0;
    background:#f1f5f9;
    border:1px solid var(--border);
    border-radius:18px;
    overflow:hidden;
}

.stage-topbar,
.stage-bottombar{
    display:flex;
    align-items:center;
    justify-content:center;
    gap:14px;
    padding:12px;
    background:#fff;
    border-bottom:1px solid var(--border);
}

.stage-bottombar{
    border-top:1px solid var(--border);
    border-bottom:0;
}

.stage-topbar strong,
.stage-topbar span{
    display:block;
    text-align:center;
}

.stage-topbar strong{
    color:var(--navy);
    font-size:16px;
}

.stage-topbar span{
    color:var(--muted);
    font-size:13px;
}

.reader-icon,
.zoom-btn{
    width:38px;
    height:38px;
    border:1px solid var(--border);
    background:#fff;
    color:var(--navy);
    border-radius:10px;
    font-size:22px;
    line-height:1;
    font-weight:900;
    display:inline-flex;
    align-items:center;
    justify-content:center;
}

.zoom-btn{
    width:auto;
    min-width:38px;
    font-size:14px;
    padding:0 12px;
}

.zoom-range{
    width:min(320px, 45vw);
}

.page-frame{
    position:relative;
    height:auto;
    min-height:0;
    overflow:visible;
    display:flex;
    align-items:flex-start;
    justify-content:center;
    padding:12px;
    background:#eef2f7;
}

.page-frame img{
    display:block;
    width:100%;
    height:auto;
    max-width:100%;
    max-height:none;
    object-fit:contain;
    background:#fff;
    box-shadow:0 18px 35px rgba(15,23,42,.15);
    transform-origin:top center;
}

.crop-box{
    display:none;
    position:absolute;
    border:2px solid #ef4444;
    background:rgba(239,68,68,.14);
    box-shadow:0 0 0 9999px rgba(15,23,42,.35);
    z-index:8;
    pointer-events:none;
}

.reader-stage.is-cropping .page-frame{
    cursor:crosshair;
    touch-action:none;
}

.reader-stage.is-cropping .crop-box.is-visible{
    display:block;
}

.crop-actions{
    position:fixed;
    left:50%;
    bottom:72px;
    transform:translateX(-50%);
    z-index:30;
    gap:10px;
    padding:8px;
    background:#111827;
    border:1px solid rgba(255,255,255,.16);
    border-radius:999px;
    box-shadow:0 18px 40px rgba(0,0,0,.28);
}

.crop-actions.is-open{
    display:flex;
}

.crop-actions button{
    border:0;
    border-radius:999px;
    padding:9px 14px;
    background:#f8fafc;
    color:#111827;
    font-weight:900;
}

.crop-actions button[data-crop-save]{
    background:var(--red);
    color:#fff;
}

.empty-epaper{
    text-align:center;
    padding:56px 16px;
}

.empty-epaper h2{
    color:var(--navy);
    font-weight:900;
    margin-bottom:18px;
}

@media(max-height:850px) and (min-width:769px){
    .page-frame{
        min-height:0;
    }
}

@media(max-width:768px){
    body:has(.epaper-shell) .top-strip,
    body:has(.epaper-shell) .brand-header,
    body:has(.epaper-shell) .main-menu,
    body:has(.epaper-shell) main.container > .breaking-bar,
    body:has(.epaper-shell) .footer{
        display:none;
    }

    body:has(.epaper-shell){
        background:#111827;
    }

    body:has(.epaper-shell) main.container{
        max-width:none;
        width:100%;
        padding:0;
        margin:0;
    }

    .epaper-shell{
        min-height:100vh;
        margin:0;
        border:0;
        border-radius:0;
        padding:0;
        background:#111827;
    }

    .epaper-toolbar{
        position:fixed;
        top:0;
        left:0;
        right:0;
        z-index:20;
        align-items:center;
        flex-direction:row;
        justify-content:space-between;
        gap:6px;
        background:#111827;
        border:0;
        padding:7px 8px;
        min-height:52px;
        box-shadow:0 1px 0 rgba(255,255,255,.08);
    }

    .epaper-title-block,
    .desktop-epaper-controls,
    .epaper-actions,
    .stage-topbar,
    .stage-bottombar,
    .date-wise-editions,
    .edition-strip{
        display:none;
    }

    .reader-back,
    .reader-select,
    .reader-tool{
        display:inline-flex;
        align-items:center;
        justify-content:center;
        color:#fff;
        flex:0 0 auto;
    }

    .is-hidden-mobile{
        display:none !important;
    }

    .reader-back{
        width:30px;
        height:38px;
        font-size:40px;
        font-weight:400;
        line-height:1;
    }

    .reader-select{
        min-height:38px;
        border-radius:6px;
        background:#eef2f7;
        color:#475569;
        padding:0 9px;
        max-width:172px;
        font-size:17px;
        font-weight:700;
        box-shadow:inset 0 0 0 1px rgba(15,23,42,.25);
    }

    .city-chip{
        gap:4px;
        flex:1 1 auto;
        min-width:128px;
    }

    .city-chip select{
        width:100%;
        min-width:0;
        border:0;
        background:transparent;
        color:#475569;
        font:inherit;
        font-weight:700;
        outline:0;
        appearance:none;
        overflow:hidden;
        text-overflow:ellipsis;
        white-space:nowrap;
    }

    .chip-icon{
        color:#dc2626;
    }

    .section-chip{
        max-width:86px;
        background:transparent;
        color:#fff;
        box-shadow:none;
        gap:4px;
        font-size:18px;
    }

    .chip-caret{
        color:#86efac;
        font-size:14px;
    }

    .reader-tool{
        width:32px;
        height:38px;
        border:0;
        background:transparent;
        color:#fff;
        font-size:26px;
        font-weight:800;
        padding:0;
    }

    .reader-date-picker{
        width:32px;
        height:34px;
        border:2px solid #e5e7eb;
        border-radius:4px;
        font-size:17px;
        line-height:1;
        position:relative;
        overflow:hidden;
    }

    .reader-date-picker::before{
        content:"";
        position:absolute;
        top:4px;
        left:5px;
        right:5px;
        height:3px;
        background:#e5e7eb;
    }

    .reader-date-picker span{
        position:relative;
        z-index:1;
    }

    .reader-date-picker .reader-calendar{
        display:block;
        position:absolute;
        inset:0;
        width:100%;
        height:100%;
        opacity:0;
        pointer-events:auto;
        z-index:2;
    }

    .epaper-toolbar h1{
        font-size:25px;
    }

    .reader-layout{
        grid-template-columns:1fr;
        gap:0;
    }

    .page-rail{
        display:none;
        position:fixed;
        left:0;
        right:0;
        bottom:58px;
        z-index:19;
        flex-direction:row;
        max-height:none;
        overflow-x:auto;
        gap:10px;
        padding:10px;
        background:rgba(17,24,39,.96);
        box-shadow:0 -8px 24px rgba(0,0,0,.28);
    }

    .page-rail.is-open{
        display:flex;
    }

    .page-thumb{
        width:74px;
        flex:0 0 74px;
        padding:4px;
        background:#fff;
        border-radius:8px;
    }

    .page-thumb span{
        font-size:11px;
        text-align:center;
    }

    .reader-stage{
        border:0;
        border-radius:0;
        background:#fff;
        margin-top:52px;
        min-height:calc(100vh - 106px);
    }

    .page-frame{
        height:calc(100vh - 106px);
        padding:0;
        background:#f8fafc;
        overflow:auto;
        align-items:flex-start;
        justify-content:center;
    }

    .page-frame img{
        display:block;
        width:100%;
        height:auto;
        max-width:100%;
        max-height:none;
        object-fit:contain;
        box-shadow:none;
        background:#fff;
    }

    .mobile-pagebar{
        position:fixed;
        left:0;
        right:0;
        bottom:0;
        z-index:20;
        display:flex;
        align-items:center;
        justify-content:space-between;
        gap:10px;
        min-height:54px;
        padding:8px 10px;
        background:#2b2728;
        color:#fff;
        box-shadow:0 -1px 0 rgba(255,255,255,.08);
    }

    .all-pages-btn,
    .mobile-pager button{
        border:0;
        background:transparent;
        color:#fff;
        font-weight:800;
    }

    .all-pages-btn{
        display:inline-flex;
        align-items:center;
        gap:8px;
        font-size:16px;
        padding:8px 0;
    }

    .all-pages-btn span{
        width:24px;
        height:24px;
        border:2px solid #e5e7eb;
        border-radius:4px;
        display:inline-flex;
        align-items:center;
        justify-content:center;
        font-size:14px;
    }

    .mobile-pager{
        display:flex;
        align-items:center;
        gap:16px;
        font-size:18px;
    }

    .mobile-pager button{
        font-size:44px;
        line-height:1;
        padding:0 4px;
    }

    .mobile-pager strong{
        min-width:58px;
        text-align:center;
        font-size:19px;
    }
}
