* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', sans-serif;
    background: #f0f1f5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Reader header ── */
.rdr-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 36px;
    background: white;
    border-bottom: 1px solid #e2e4ea;
}

.rdr-logo img { display: block; }

.rdr-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #1a1f8f;
    color: white;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    padding: 10px 22px;
    transition: background .15s;
}
.rdr-back-btn:hover { background: #141880; }

/* ── Controls bar ── */
.rdr-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 16px;
    padding: 10px 24px;
    background: white;
    border-bottom: 1px solid #e2e4ea;
    overflow-x: auto;
}

/* view toggle */
.rdr-view-toggle {
    display: flex;
    border: 1px solid #d0d3e0;
}

.rdr-view-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    white-space: nowrap;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #1a1f8f;
    background: white;
    border: none;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.rdr-view-btn + .rdr-view-btn { border-left: 1px solid #d0d3e0; }
.rdr-view-active {
    background: #1a1f8f;
    color: white;
}

/* page input */
.rdr-page-ctrl {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #444;
}
.rdr-page-input {
    width: 52px;
    text-align: center;
    border: 1px solid #d0d3e0;
    padding: 6px 8px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: #1a1f8f;
    font-weight: 500;
    outline: none;
}
.rdr-page-input:focus { border-color: #1a1f8f; }
.rdr-page-total { color: #666; white-space: nowrap; }

/* zoom */
.rdr-zoom-ctrl {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid #d0d3e0;
}
.rdr-zoom-btn {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    background: white;
    color: #1a1f8f;
    border: none;
    cursor: pointer;
    transition: background .15s, color .15s;
    line-height: 1;
}
.rdr-zoom-btn:hover { background: #1a1f8f; color: white; }
.rdr-zoom-label {
    font-size: 13px;
    font-weight: 500;
    color: #444;
    min-width: 46px;
    text-align: center;
    border-left: 1px solid #d0d3e0;
    border-right: 1px solid #d0d3e0;
    padding: 0 4px;
    line-height: 36px;
}

/* download */
.rdr-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid #d0d3e0;
    padding: 8px 14px;
    white-space: nowrap;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #1a1f8f;
    text-decoration: none;
    background: white;
    transition: background .15s, color .15s;
}
.rdr-download-btn:hover { background: #1a1f8f; color: white; }
.rdr-download-btn:hover svg { stroke: white; }

/* ── Page viewer ── */
.rdr-main {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 40px 20px 20px;
    overflow-x: auto;
    position: relative;
}

.rdr-spread {
    display: flex;
    gap: 0;
    justify-content: center;
    visibility: hidden;
}

.rdr-spread canvas {
    display: block;
    background: white;
    box-shadow: 0 6px 36px rgba(26, 31, 143, .16);
}

#canvas-left  { box-shadow: -2px 6px 32px rgba(26,31,143,.14), 3px 0 8px rgba(0,0,0,.07); }
#canvas-right { box-shadow:  2px 6px 32px rgba(26,31,143,.14), -3px 0 8px rgba(0,0,0,.07); }

.rdr-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding-top: 80px;
    color: #888;
    font-size: 14px;
    position: absolute;
}

.rdr-spinner {
    width: 34px;
    height: 34px;
    border: 3px solid #e2e4ea;
    border-top-color: #1a1f8f;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Bottom navigation ── */
.rdr-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 16px 0 10px;
}

.rdr-nav-btn {
    width: 54px;
    height: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    border: 1px solid #d0d3e0;
    background: white;
    color: #444;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.rdr-nav-btn:hover { background: #e8e9f3; }
.rdr-nav-btn--active { background: #1a1f8f; color: white; border-color: #1a1f8f; }
.rdr-nav-btn--active:hover { background: #141880; }

.rdr-nav-label {
    font-size: 15px;
    font-weight: 500;
    color: #333;
    min-width: 110px;
    text-align: center;
    padding: 0 6px;
}

/* ── Thumbnail strip ── */
.rdr-thumbs-wrap {
    background: #e8e9f2;
    border-top: 1px solid #d0d3e0;
    padding: 16px 20px 14px;
    overflow-x: auto;
}

.rdr-thumbs {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    width: max-content;
    margin: 0 auto;
}

.rdr-thumb {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    opacity: .7;
    transition: opacity .15s;
    flex-shrink: 0;
}
.rdr-thumb:hover { opacity: 1; }
.rdr-thumb--active { opacity: 1; }

.rdr-thumb canvas {
    display: block;
    box-shadow: 0 2px 8px rgba(0,0,0,.18);
    border: 2px solid transparent;
    transition: border-color .15s;
}
.rdr-thumb--active canvas { border-color: #1a1f8f; }

.rdr-thumb-num {
    font-size: 11px;
    color: #555;
    font-weight: 500;
}
.rdr-thumb--active .rdr-thumb-num { color: #1a1f8f; font-weight: 700; }

@media (max-width: 640px) {
    .rdr-header, .rdr-controls { padding: 12px 16px; }
    .rdr-view-btn span, .rdr-download-btn span { display: none; }
}
