#pv-panel.preview-expanded {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    border-radius: 0;
    box-sizing: border-box;
    padding: 16px;
    background: var(--site-surface, #fff);
}
#pv-panel.preview-expanded > .pv-controls {
    flex-shrink: 0;
    max-height: 44%;
    overflow: auto;
}
#pv-panel.preview-expanded #pv-viewer-shell {
    flex: 1;
    height: auto;
    min-height: 0;
}
.pv-preview-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    flex-shrink: 0;
}
#pv-file-name {
    flex: 1;
    min-width: 0;
    margin: 0;
    overflow-wrap: anywhere;
}
#pv-status {
    flex-shrink: 0;
}
#pv-viewer-shell {
    height: 72vh;
    min-height: 360px;
    overflow: auto;
    scrollbar-gutter: stable;
    background: var(--site-surface-muted, #f1f5f9);
    border: 1px solid var(--site-border, #dbe3ee);
    margin-top: 16px;
    border-radius: 10px;
}
#pv-canvas-wrap {
    width: max-content;
    min-width: 100%;
    padding: 16px;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
}
#pv-page-surface {
    position: relative;
    flex: none;
    box-shadow: 0 2px 8px #0002;
    background: white;
}
#pv-canvas {
    display: block;
}
.pv-text-layer {
    position: absolute;
    inset: 0;
    overflow: hidden;
    line-height: 1;
    text-align: initial;
    opacity: 1;
    user-select: text;
    transform-origin: 0 0;
    -webkit-text-size-adjust: none;
    text-size-adjust: none;
    forced-color-adjust: none;
    --scale-factor: 1;
}
.pv-text-layer :is(span, br) {
    color: transparent;
    position: absolute;
    white-space: pre;
    cursor: text;
    transform-origin: 0 0;
}
.pv-text-layer span.markedContent {
    top: 0;
    height: 0;
}
.pv-text-layer ::selection {
    background: rgba(36, 99, 235, 0.32);
}
.pv-text-layer .pv-text-match {
    background: rgba(255, 200, 0, 0.32);
    border-radius: 2px;
}
.pv-search-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}
.pv-search-row input {
    flex: 1;
    min-width: 160px;
}
.pv-result-list {
    display: grid;
    gap: 8px;
    max-height: 220px;
    overflow: auto;
    margin-top: 10px;
}
.pv-result-list button {
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
}
.pv-result-list small {
    display: block;
    font-weight: 400;
    margin-top: 4px;
    color: var(--site-muted, #64748b);
}
.pv-outline {
    margin-top: 12px;
}
.pv-outline summary {
    cursor: pointer;
    font-weight: 600;
}
.pv-outline ul {
    padding: 8px 0;
    list-style: none;
    max-height: 240px;
    overflow: auto;
}
.pv-outline button {
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
    width: 100%;
    padding: 8px;
    border-radius: 6px;
    color: var(--site-text, #1e293b);
}
.pv-outline button:hover {
    background: var(--site-surface-muted, #f1f5f9);
}
.pv-controls .tool-select {
    appearance: none;
    min-height: 46px;
    padding-right: 28px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-position: right 8px center;
    background-repeat: no-repeat;
}
.pv-page-control {
    display: flex;
    gap: 6px;
    align-items: center;
}
.pv-page-control label {
    margin: 0;
}
.pv-controls .tool-row {
    gap: 8px;
    align-items: center;
}
.pv-controls .tool-secondary-button {
    min-height: 46px;
}
.pv-zoom-control {
    display: flex;
    align-items: center;
    gap: 6px;
}
.pv-zoom-control select {
    width: 145px;
}
.pv-page-control input {
    width: 76px;
}
@media (max-width: 600px) {
    #pv-panel {
        padding: 12px;
    }
    #pv-canvas-wrap {
        padding: 10px;
    }
    #pv-viewer-shell {
        min-height: 300px;
        height: 65vh;
    }
    .pv-controls .tool-row {
        gap: 6px;
    }
    .pv-search-row input {
        flex-basis: 100%;
    }
    .pv-zoom-control select {
        width: 140px;
    }
    .pv-result-list {
        max-height: 180px;
    }
}
#pv-page-surface {
    overflow: hidden;
}
.pv-text-layer[data-main-rotation="90"] {
    transform: rotate(90deg) translateY(-100%);
}
.pv-text-layer[data-main-rotation="180"] {
    transform: rotate(180deg) translate(-100%, -100%);
}
.pv-text-layer[data-main-rotation="270"] {
    transform: rotate(270deg) translateX(-100%);
}
