html, body {
    overflow: hidden;
    width: 100%;
    height: var(--pdf-viewport-height, 100dvh);
    min-height: var(--pdf-viewport-height, 100dvh);
    margin: 0;
    padding: 0;
}
body {
    width: 100%;
    height: var(--pdf-viewport-height, 100dvh);
    min-height: var(--pdf-viewport-height, 100dvh);
}

:root {
    --pdf-current-list-width: clamp(320px, calc(var(--pdf-viewport-width, 100vw) / 3), 640px);
}

#pdf-container {
    position: fixed;
    top: calc(var(--backend-shell-height, 32px) + var(--backend-bar-height, 6px));
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: calc(var(--pdf-viewport-height, 100dvh) - var(--backend-shell-height, 32px) - var(--backend-bar-height, 6px));
    margin: 0;
    padding: 0;
    overflow: hidden;
    box-sizing: border-box;
    display: grid;
    place-items: center;
    transition: right 0.22s ease;
}

#pdf-stage {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    overflow: hidden;
}

#pdf-render {
    border: none;
    display: block;
    width: 100%;
    height: 100%;
}

#html-render {
    display: none;
    border: none;
    position: absolute;
    inset: 0 auto auto 0;
    background: transparent;
    transform-origin: top left;
}

body.pdf-current-list-open #pdf-container {
    right: var(--pdf-current-list-width);
    width: auto;
}

#pdf-current-list-edge {
    position: fixed;
    top: calc(var(--backend-shell-height, 32px) + var(--backend-bar-height, 6px));
    right: 0;
    bottom: 0;
    width: 28px;
    z-index: 2550;
    background: transparent;
    touch-action: none;
}

body.pdf-current-list-open #pdf-current-list-edge {
    width: 28px;
    pointer-events: none;
}

#pdf-current-list-sheet {
    position: fixed;
    top: calc(var(--backend-shell-height, 32px) + var(--backend-bar-height, 6px));
    right: 0;
    bottom: 0;
    width: var(--pdf-current-list-width);
    z-index: 2540;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
    background: #f7f7f7;
    border-left: 1px solid #cfcfcf;
    transform: translateX(100%);
    transition: transform 0.22s ease;
    will-change: transform;
}

body.pdf-current-list-open #pdf-current-list-sheet {
    transform: translateX(0);
}

#pdf-current-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    -webkit-overflow-scrolling: touch;
}

.pdf-current-list-item {
    display: block;
    width: 100%;
    margin: 0 0 5px;
    padding: 5px 0;
    border: none;
    border-radius: 0;
    background: transparent;
    color: #0f172a;
    font-family: Arial, sans-serif;
    font-size: 26px;
    line-height: 1.5;
    text-align: left;
    cursor: pointer;
    box-sizing: border-box;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.pdf-current-list-item.selected {
    background-color: green;
    color: #ffffff;
}

.pdf-current-list-item.pending-selection {
    background-color: red;
    color: #ffffff;
}

.pdf-current-list-item.current {
    font-weight: 700;
}
