/* ==========================================================================
   Marathi E-Paper — public site + viewer
   ========================================================================== */

:root {
    --brand: #b3141b;
    --brand-dark: #8e0f15;
    --brand-soft: #fbe9ea;
    --ink: #1f1f1f;
    --ink-muted: #5f6368;
    --line: #dcdcdc;
    --page-bg: #ececec;
    --surface: #ffffff;
    --stage-bg: #dedede;
    --stage-bg-full: #262626;
    --radius: 4px;
    --font-ui: "Noto Sans Devanagari", "Mangal", "Nirmala UI", system-ui, sans-serif;
    --viewer-h: max(440px, calc(100vh - 150px));
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--page-bg);
    color: var(--ink);
    font-family: var(--font-ui);
    font-size: 16px;
    line-height: 1.55;
}

a {
    color: var(--brand);
}

button {
    font: inherit;
    color: inherit;
}

svg {
    fill: currentColor;
}

/* ---------- Site frame ---------- */

.site {
    max-width: 1200px;
    margin: 12px auto;
    background: var(--surface);
    border-top: 5px solid var(--brand);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.18);
}

.masthead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px;
}

.brand {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    text-decoration: none;
    color: var(--brand);
    min-width: 0;
}

.brand-logo {
    display: block;
    width: auto;
    height: 84px;
    max-width: 100%;
}

.brand-tag {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--surface);
    background: var(--brand);
    padding: 1px 10px;
    border-radius: 999px;
    white-space: nowrap;
}

.masthead-date {
    color: var(--ink-muted);
    font-size: 0.95rem;
    white-space: nowrap;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    background: var(--brand);
}

.site-nav a {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    padding: 9px 18px;
}

.site-nav a:hover,
.site-nav a.is-active {
    background: var(--brand-dark);
}

.site-content {
    padding: 16px;
    min-height: 60vh;
}

.site-footer {
    background: #222;
    color: #eee;
    text-align: center;
    font-size: 0.9rem;
    padding: 14px 16px;
}

/* ---------- Edition bar ---------- */

.edition-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px 20px;
    border-bottom: 1px dotted #b5b5b5;
    margin-bottom: 14px;
}

.edition-info {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 16px;
}

.edition-title {
    margin: 0 0 -1px;
    padding-bottom: 8px;
    border-bottom: 4px solid var(--brand);
    font-size: 1.3rem;
    font-weight: 700;
}

.edition-date {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--ink-muted);
    font-weight: 500;
}

.edition-info .date-picker {
    align-self: center;
    margin-bottom: 6px;
}

.edition-date svg {
    width: 18px;
    height: 18px;
    color: var(--brand);
}

.page-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding-bottom: 8px;
}

.page-list-item {
    min-width: 34px;
    height: 34px;
    padding: 0 6px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    cursor: pointer;
    font-weight: 600;
}

.page-list-item:hover {
    border-color: var(--brand);
    color: var(--brand);
}

.page-list-item.is-active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

/* ---------- Layout: thumbnails + viewer ---------- */

.epaper-body {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.thumbs {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: calc(var(--viewer-h) + 110px);
    overflow-y: auto;
    padding-right: 4px;
}

.thumb {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    text-align: center;
}

.thumb-frame {
    display: block;
    padding: 4px;
    border: 3px solid rgba(0, 0, 0, 0.08);
    background: var(--surface);
    transition: border-color 0.15s;
}

.thumb:hover .thumb-frame {
    border-color: #bbb;
}

.thumb.is-active .thumb-frame {
    border-color: var(--brand);
}

.thumb-frame canvas,
.thumb-placeholder {
    display: block;
    width: 100%;
}

.thumb-placeholder {
    aspect-ratio: 1 / 1.55;
    background: linear-gradient(90deg, #f0f0f0, #e6e6e6, #f0f0f0);
}

.thumb-label {
    display: block;
    margin-top: 3px;
    font-size: 0.85rem;
    font-weight: 600;
}

.thumb.is-active .thumb-label {
    color: var(--brand);
}

/* ---------- Viewer ---------- */

.viewer {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line);
    background: var(--surface);
    min-width: 0;
}

.viewer-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 8px;
    border-bottom: 1px solid var(--line);
    background: #f7f7f7;
}

.ctrl-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ctrl {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 38px;
    height: 38px;
    padding: 0 8px;
    border: 1px solid #c9c9c9;
    border-radius: var(--radius);
    background: var(--surface);
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.ctrl svg {
    width: 22px;
    height: 22px;
}

.ctrl:hover:not(:disabled) {
    border-color: var(--brand);
    color: var(--brand);
}

a.ctrl {
    color: var(--ink);
    text-decoration: none;
}

.ctrl:disabled {
    opacity: 0.4;
    cursor: default;
}

.zoom-level {
    min-width: 68px;
    font-variant-numeric: tabular-nums;
}

.ctrl-fullscreen {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.ctrl-fullscreen:hover:not(:disabled) {
    background: var(--brand-dark);
    color: #fff;
}

.ctrl-fullscreen .icon-exit,
.viewer.is-fullscreen .ctrl-fullscreen .icon-enter {
    display: none;
}

.viewer.is-fullscreen .ctrl-fullscreen .icon-exit {
    display: block;
}

.page-indicator {
    font-weight: 600;
    white-space: nowrap;
    padding: 0 4px;
}

.viewer-stage {
    position: relative;
    height: var(--viewer-h);
    overflow: auto;
    padding: 12px;
    background: var(--stage-bg);
    touch-action: pan-x pan-y;
    -webkit-overflow-scrolling: touch;
    outline: none;
}

.viewer-stage:focus-visible {
    box-shadow: inset 0 0 0 3px rgba(179, 20, 27, 0.4);
}

.viewer-stage.is-pannable {
    cursor: grab;
}

.viewer-stage.is-panning {
    cursor: grabbing;
    user-select: none;
}

.viewer-sheet {
    position: relative;
    margin: 0 auto;
    background: var(--surface);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
    transform-origin: 0 0;
}

.viewer-sheet canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.viewer-status {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--ink-muted);
    font-weight: 600;
    text-align: center;
    padding: 20px;
    pointer-events: none;
}

.viewer-status[hidden] {
    display: none;
}

.viewer-status.is-error {
    color: var(--brand);
}

.viewer-status.is-error .spinner {
    display: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 0, 0, 0.12);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.viewer-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px;
    border-top: 1px solid var(--line);
    background: #f7f7f7;
}

.pager-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 40px;
    padding: 0 14px;
    border: 0;
    border-radius: var(--radius);
    background: var(--brand);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

.pager-btn svg {
    width: 20px;
    height: 20px;
}

.pager-btn:hover:not(:disabled) {
    background: var(--brand-dark);
}

.pager-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

/* ---------- Fullscreen ---------- */

.viewer:fullscreen,
.viewer.is-pseudo-fullscreen {
    width: 100%;
    height: 100%;
    border: 0;
    background: var(--stage-bg-full);
}

.viewer.is-pseudo-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 1000;
    height: 100vh;
    height: 100dvh;
}

.viewer.is-fullscreen .viewer-stage {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    background: var(--stage-bg-full);
}

.viewer.is-fullscreen .viewer-status {
    color: #ddd;
}

body.has-pseudo-fullscreen {
    overflow: hidden;
}

/* ---------- Date calendar ("जुने अंक") ---------- */

.date-picker {
    position: relative;
    display: inline-block;
}

.date-picker-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 12px;
    border: 0;
    border-radius: var(--radius);
    background: var(--brand);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
}

.date-picker-btn:hover,
.date-picker-btn[aria-expanded="true"] {
    background: var(--brand-dark);
}

.date-picker-btn svg {
    width: 18px;
    height: 18px;
}

.date-picker-pop {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 50;
    width: 300px;
    max-width: calc(100vw - 16px);
    padding: 10px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-top: 4px solid var(--brand);
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.date-picker-pop[hidden] {
    display: none;
}

.dp-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.dp-title {
    font-weight: 700;
}

.dp-nav {
    width: 34px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
}

.dp-nav:hover:not(:disabled) {
    border-color: var(--brand);
    color: var(--brand);
}

.dp-nav:disabled {
    opacity: 0.35;
    cursor: default;
}

.dp-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
    text-align: center;
}

.dp-weekday {
    padding: 2px 0 4px;
    color: var(--ink-muted);
    font-size: 0.75rem;
    font-weight: 600;
}

.dp-day {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    border-radius: 4px;
    color: #b0b0b0;
    font-size: 0.95rem;
    text-decoration: none;
}

.dp-day.is-available {
    background: var(--brand-soft);
    color: var(--brand-dark);
    font-weight: 700;
}

.dp-day.is-available:hover,
.dp-day.is-available:focus-visible {
    background: var(--brand);
    color: #fff;
    outline: none;
}

.dp-day.is-today {
    box-shadow: inset 0 0 0 2px #9a9a9a;
}

.dp-day.is-selected {
    background: var(--brand);
    color: #fff;
}

.dp-help {
    margin: 8px 0 0;
    color: var(--ink-muted);
    font-size: 0.8rem;
    line-height: 1.4;
}

.old-issue-notice {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 4px 12px;
    margin: -4px 0 12px;
    padding: 8px 12px;
    background: #fff8e1;
    border-left: 4px solid #e0a800;
    font-weight: 600;
}

.old-issue-notice a {
    font-weight: 700;
}

.empty-state-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
    text-align: left;
}

.empty-state-link {
    font-weight: 700;
}

/* ---------- Article hotspots ---------- */

.article-layer {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.article-hotspot {
    position: absolute;
    padding: 0;
    border: 2px solid transparent;
    background: transparent;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s;
}

.article-hotspot:hover,
.article-hotspot:focus-visible {
    border-color: var(--brand);
    background: rgba(179, 20, 27, 0.08);
    outline: none;
}

.viewer-stage.is-panning .article-hotspot {
    cursor: grabbing;
}

/* Touch screens have no hover: show a faint outline so readers know they can tap. */
@media (hover: none) {
    .article-hotspot {
        border: 1px dashed rgba(179, 20, 27, 0.35);
    }
}

.article-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0;
    padding: 6px 10px;
    border-top: 1px solid var(--line);
    background: var(--brand-soft);
    color: var(--brand-dark);
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
}

.article-hint[hidden] {
    display: none;
}

.article-hint svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

/* ---------- Clip (✂) ---------- */

/* Also beats .ctrl:hover, which "sticks" after a tap on touch screens. */
.ctrl-clip[aria-pressed="true"],
.ctrl-clip[aria-pressed="true"]:hover:not(:disabled) {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.clip-layer {
    position: absolute;
    inset: 0;
    z-index: 2;
    overflow: hidden; /* keeps the dimming shadow inside the page */
    cursor: crosshair;
    touch-action: pan-x pan-y;
    user-select: none;
}

.clip-layer[hidden],
.viewer.is-clipping .article-layer {
    display: none;
}

.clip-box {
    position: absolute;
    border: 2px dashed #fff;
    outline: 2px solid var(--brand);
    /* Dim everything outside the box. */
    box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.5);
    cursor: move;
    touch-action: none;
}

.clip-handle {
    position: absolute;
    width: 22px;
    height: 22px;
    background: #fff;
    border: 3px solid var(--brand);
    border-radius: 50%;
    touch-action: none;
}

.clip-handle-nw { top: -12px; left: -12px; cursor: nwse-resize; }
.clip-handle-ne { top: -12px; right: -12px; cursor: nesw-resize; }
.clip-handle-sw { bottom: -12px; left: -12px; cursor: nesw-resize; }
.clip-handle-se { bottom: -12px; right: -12px; cursor: nwse-resize; }

.clip-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
    padding: 8px 10px;
    border-bottom: 1px solid var(--line);
    background: var(--brand-soft);
}

.clip-bar[hidden] {
    display: none;
}

.clip-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    color: var(--brand-dark);
    font-size: 0.9rem;
    font-weight: 600;
}

.clip-hint svg {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
}

.clip-actions {
    display: flex;
    gap: 8px;
}

.viewer.is-fullscreen .clip-bar {
    background: #3a3a3a;
    border-color: #555;
}

.viewer.is-fullscreen .clip-hint {
    color: #fff;
}

@media (max-width: 767.98px) {
    .clip-actions {
        width: 100%;
    }

    .clip-actions > * {
        flex: 1 1 0;
        justify-content: center;
    }
}

/* ---------- Article popup ---------- */

.article-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.article-modal[hidden] {
    display: none;
}

.article-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
}

.article-dialog {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(960px, 100%);
    max-height: 100%;
    background: var(--surface);
    border-top: 5px solid var(--brand);
    border-radius: 6px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
    overflow: hidden;
}

.article-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
}

.article-heading {
    min-width: 0;
}

.article-title {
    margin: 0;
    font-size: 1.2rem;
    line-height: 1.35;
}

.article-meta {
    margin: 2px 0 0;
    color: var(--ink-muted);
    font-size: 0.9rem;
}

.article-tools {
    display: flex;
    gap: 6px;
    flex: 0 0 auto;
}

.article-close {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.article-close:hover:not(:disabled) {
    background: var(--brand-dark);
    color: #fff;
}

.article-body {
    position: relative;
    flex: 1 1 auto;
    min-height: 200px;
    overflow: auto;
    padding: 16px;
    background: #f3f3f3;
    outline: none;
}

.article-part {
    margin: 0;
}

.article-part canvas {
    display: block;
    margin: 0 auto;
    max-width: none;
    background: #fff;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.2);
}

.article-continued {
    margin: 18px 0 10px;
    padding: 6px 10px;
    border-left: 4px solid var(--brand);
    background: var(--brand-soft);
    color: var(--brand-dark);
    font-weight: 700;
}

/* Admin-editable message above/below the article (e.g. advertising space). */
.article-note {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 90px;
    margin: 0 auto;
    padding: 16px 20px;
    max-width: 100%;
    border: 2px dashed #9a9a9a;
    background: var(--surface);
    color: var(--ink);
    font-size: clamp(1.05rem, 2.6vw, 1.5rem);
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
}

.article-note-top {
    margin-bottom: 16px;
}

.article-note-bottom {
    margin-top: 16px;
}

a.article-note:hover {
    border-color: var(--brand);
    color: var(--brand);
}

.article-loading {
    background: rgba(243, 243, 243, 0.7);
}

.article-share {
    padding: 10px 14px;
    border-top: 1px solid var(--line);
}

/* ---------- Share bar (page + article popup) ---------- */

.share-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
}

.share-label {
    font-weight: 600;
    color: var(--ink-muted);
}

.share-networks,
.share-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.share-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: #fff;
    transition: transform 0.12s, filter 0.12s;
}

.share-icon svg {
    width: 20px;
    height: 20px;
}

.share-icon:hover,
.share-icon:focus-visible {
    filter: brightness(0.9);
    transform: translateY(-1px);
}

.share-whatsapp { background: #25d366; }
.share-facebook { background: #1877f2; }
.share-x { background: #000; }
.share-telegram { background: #229ed9; }
.share-linkedin { background: #0a66c2; }
.share-email { background: #6b6b6b; }

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid #c9c9c9;
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.share-btn[hidden] {
    display: none;
}

.share-btn svg {
    width: 18px;
    height: 18px;
}

.share-btn:hover {
    border-color: var(--brand);
    color: var(--brand);
}

.page-share {
    display: flex;
    justify-content: center;
    margin-top: 14px;
    padding: 12px;
    border: 1px solid var(--line);
    background: #f7f7f7;
}

body.has-article-modal {
    overflow: hidden;
}

@media (max-width: 767.98px) {
    .article-modal {
        padding: 0;
    }

    .article-dialog {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }

    .article-body {
        padding: 8px;
    }

    .article-title {
        font-size: 1.05rem;
    }

    .article-share {
        padding: 8px;
    }

    .share-bar {
        justify-content: center;
    }

    .share-label {
        display: none;
    }

    .share-networks {
        justify-content: center;
        width: 100%;
    }

    .share-tools {
        justify-content: center;
        width: 100%;
    }

    .share-tools .share-btn {
        flex: 1 1 auto;
        justify-content: center;
        padding: 0 8px;
        font-size: 0.85rem;
        white-space: nowrap;
    }

    .page-share {
        padding: 10px 8px;
    }
}

/* ---------- Misc ---------- */

.mobile-hint {
    display: none;
    margin: 8px 0 0;
    text-align: center;
    color: var(--ink-muted);
    font-size: 0.85rem;
}

.notice {
    padding: 12px;
    background: var(--brand-soft);
    border-left: 4px solid var(--brand);
}

.empty-state {
    max-width: 520px;
    margin: 60px auto;
    text-align: center;
    color: var(--ink-muted);
}

.empty-state > svg {
    width: 64px;
    height: 64px;
    color: var(--brand);
}

.empty-state h1 {
    color: var(--ink);
    font-size: 1.5rem;
    margin: 12px 0 6px;
}

.admin-preview-bar {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 16px;
    background: #fff4d6;
    border-bottom: 1px solid #e8d18f;
    font-size: 0.95rem;
}

/* ---------- Responsive ---------- */

@media (max-width: 991.98px) {
    .epaper-body {
        grid-template-columns: minmax(0, 1fr);
    }

    .thumbs {
        display: none;
    }
}

@media (max-width: 767.98px) {
    :root {
        --viewer-h: max(360px, calc(100svh - 190px));
    }

    .site {
        margin: 0;
        box-shadow: none;
    }

    .masthead {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
        padding: 10px 12px;
    }

    .brand {
        max-width: 100%;
    }

    .brand-logo {
        height: auto;
        width: min(260px, 72vw);
    }

    .brand-tag {
        font-size: 0.75rem;
        padding: 1px 8px;
    }

    .masthead-date {
        font-size: 0.85rem;
    }

    .site-nav a {
        padding: 8px 14px;
    }

    .site-content {
        padding: 10px 8px;
    }

    .edition-bar {
        margin-bottom: 10px;
    }

    .edition-title {
        font-size: 1.1rem;
    }

    .page-list {
        flex-wrap: nowrap;
        overflow-x: auto;
        max-width: 100%;
        scrollbar-width: thin;
    }

    .page-list-item {
        flex: 0 0 auto;
    }

    .viewer-controls {
        padding: 6px;
    }

    .ctrl-text {
        display: none;
    }

    .ctrl {
        min-width: 40px;
        height: 40px;
        padding: 0 6px;
    }

    .zoom-level {
        min-width: 58px;
    }

    .viewer-stage {
        padding: 6px;
    }

    .pager-btn {
        padding: 0 10px;
        font-size: 0.95rem;
    }
}

@media (max-width: 380px) {
    .viewer-controls .page-indicator {
        display: none;
    }
}

@media (hover: none) and (pointer: coarse) {
    .mobile-hint {
        display: block;
    }
}

@media (prefers-reduced-motion: reduce) {
    .spinner {
        animation-duration: 2s;
    }
}
