body.dark {
    min-height: 100vh;
    margin: 0;
    background: #202923;
    color: #f4f2ec;
    font-family: Arial, sans-serif;
}

#pdf-workspace {
    width: min(1500px, calc(100% - 40px));
    margin: clamp(24px, 5vh, 56px) auto;
}

#pdf-editor-card {
    overflow: hidden;
    padding: clamp(10px, 2vw, 24px);
    border: 1px solid #354139;
    border-radius: 26px;
    background: linear-gradient(145deg, #29362f, #1d2621);
    box-shadow: 0 24px 70px rgb(0 0 0 / 24%);
}

#suite-header {
    position: sticky;
    z-index: 5;
    top: 0;
    display: flex;
    min-height: 64px;
    align-items: center;
    justify-content: space-between;
    padding: 8px clamp(12px, 3vw, 32px);
    border-bottom: 1px solid #354139;
    background: rgb(27 37 31 / 95%);
    backdrop-filter: blur(14px);
}

.suite-brand {
    display: flex;
    align-items: center;
    color: #f4f2ec;
    gap: 9px;
    text-decoration: none;
}

.suite-mark {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 12px;
    background: #c9f1dc;
    color: #37785e;
    font-size: 22px;
}

.suite-brand strong,
.suite-brand small {
    display: block;
}

.suite-brand strong {
    font-size: 13px;
    letter-spacing: -.04em;
}

.suite-brand small {
    margin-top: 2px;
    color: #aebbb1;
    font-size: 10px;
}

#suite-header nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

#suite-header nav a {
    padding: 8px 10px;
    border-radius: 9px;
    color: #c3cec5;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
}

#suite-header nav a:hover,
#suite-header nav a.current {
    background: #2b4034;
    color: #c9f1dc;
}

#load-section {
    padding: 10px 10px 16px;
    border-bottom: 1px solid #354139;
}

#nav-section {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 16px 10px;
    border-bottom: 1px solid #354139;
    gap: 8px;
}

#main-layout {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px 10px 10px;
}

#left-side {
    min-width: 0;
    flex: 1;
}

#viewer {
    border: 1px solid #444;
    padding: 10px;
    border-radius: 16px;
    background: #111;
    max-height: 80vh;
    overflow: auto;
}

#imageWrapper {
    position: relative;
    width: 100%;
}

#pageImage {
    display: block;
    max-width: 100%;
    height: auto;
}

#pageImage.selecting {
    cursor: crosshair;
    touch-action: none;
}

#selectionBox {
    position: absolute;
    z-index: 1;
    box-sizing: border-box;
    border: 2px solid #c9f1dc;
    outline: 1px solid #fff;
    box-shadow: 0 0 0 3px #111;
    background: transparent;
    pointer-events: none;
}

#selectionBox[hidden] {
    display: none;
}

#alignmentPrompt,
#paymentPrompt {
    margin: 10px;
    padding: 12px;
    border: 1px solid #777;
    border-radius: 12px;
    background: #181818;
}

#paymentPrompt {
    border-color: #b28b35;
}

.page-thumb {
    width: 150px;
    margin: 5px;
    border: 2px solid transparent;
    cursor: pointer;
}

.thumbnail-card {
    padding: 4px;
    border: 1px solid #444;
    border-radius: 10px;
    background: #181818;
}

.thumbnail-card[draggable="true"] {
    cursor: grab;
}

.thumbnail-card[draggable="true"]:active {
    cursor: grabbing;
}

.thumbnail-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.thumbnail-controls span {
    margin-right: auto;
}

.thumbnail-controls button {
    padding: 4px 8px;
}

.page-thumb.active {
    border-color: #c9f1dc;
}

#thumbnails {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

#controls {
    width: 300px;
    background: #111;
    padding: 20px;
    border: 1px solid #444;
    border-radius: 16px;
}

#ad-container {
    margin-top: 24px;
    padding-top: 12px;
    border-top: 1px solid #444;
    overflow: hidden;
}

#ad-container p {
    margin: 0 0 8px;
    color: #aaa;
    font-size: 0.75rem;
    text-align: center;
    text-transform: uppercase;
}

.slider-row {
    margin-bottom: 15px;
}

button {
    background: #333;
    color: #eee;
    border: 1px solid #555;
    border-radius: 10px;
    padding: 8px 12px;
    cursor: pointer;
}

button:hover {
    background: #444;
}
#site-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    text-align: center;
    font-size: 0.9rem;
    gap: 10px;
}

#rasterizationNotice {
    max-width: 600px;
    padding: 10px;
    border-left: 3px solid #b28b35;
    background: #181818;
    color: #ddd;
    font-size: 0.9rem;
}

#site-footer a {
    color: #c9f1dc;
}

@media (max-width: 760px) {
    #pdf-workspace {
        width: calc(100% - 20px);
        margin: 16px auto;
    }

    #pdf-editor-card {
        padding: 8px;
        border-radius: 20px;
    }

    #main-layout {
        flex-direction: column;
        padding: 14px 4px 4px;
    }

    #left-side,
    #controls {
        width: 100%;
    }
}

@media (max-width: 600px) {
    #suite-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 7px;
    }

    #suite-header nav {
        width: 100%;
        overflow-x: auto;
    }

    #suite-header nav a {
        padding: 7px 8px;
        white-space: nowrap;
    }
}
