.spv-viewer {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin: 1em 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Toolbar — larger, centered contents. */
.spv-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    padding: 12px 18px;
    background: #f4f5f7;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
    margin-bottom: 16px;
    box-sizing: border-box;
}

/* When JS pins the toolbar to the top of the viewport. */
.spv-toolbar-fixed {
    position: fixed;
    top: 0;
    z-index: 9999;
    border-radius: 0 0 8px 8px;
    border-top: none;
    margin: 0;
}

/* Placeholder keeps page height stable when toolbar goes fixed. */
.spv-toolbar-placeholder {
    display: none;
}

.spv-zoom { display: flex; align-items: center; gap: 8px; }

.spv-zoom button {
    width: 38px; height: 38px;
    font-size: 20px; font-weight: 500;
    line-height: 1;
    background: #fff;
    border: 1px solid #cbd0d8;
    border-radius: 6px;
    cursor: pointer;
    color: #1f2937;
}
.spv-zoom button:hover:not(:disabled) { background: #eef1f5; }
.spv-zoom button:disabled { opacity: 0.4; cursor: not-allowed; }

.spv-zoom-level {
    font-size: 15px; color: #374151;
    min-width: 50px; text-align: center;
    font-weight: 500;
}

.spv-jumps { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }

.spv-jump {
    padding: 9px 16px;
    font-size: 15px;
    background: #fff;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    cursor: pointer;
    color: #1f2937;
    white-space: nowrap;
    font-weight: 500;
}
.spv-jump:hover { background: #eef1f5; border-color: #a5b1c2; }

.spv-zoom + .spv-jumps {
    border-left: 1px solid #d0d5dd;
    padding-left: 14px;
}

/* Scrollable pages area — vertical follows page, horizontal on this container. */
.spv-pages {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
}

.spv-page-wrap {
    display: block;
    width: max-content;
    margin: 0 auto 14px;
    scroll-margin-top: 80px;
}

.spv-page {
    display: block;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
    background: #fff;
}

.spv-loading { padding: 20px; color: #555; font-size: 14px; text-align: center; }
.spv-error   { color: #b91c1c; }
