body {
    font-family: Arial, sans-serif;
    margin: 20px;
}

#sidebar {
    float: left;
    width: 320px;
    padding: 20px;
    background: #f0f0f0;
}

#canvas-container {
    margin-left: 160px;
    border: 1px solid #ccc;
}

#editor-canvas {
    border: 1px solid #000;
    cursor: crosshair;
}

/* Static size from JSON: 11in x 22.25in @ 72dpi */
button {
    margin: 10px 0;
    padding: 10px;
    background: #007bff;
    color: white;
    border: none;
    cursor: pointer;
}

button:hover {
    background: #0056b3;
}


/* style.css */

/* Label above the top scrollbar */
#desk-scroll-label {
    width: 100%;
    text-align: center;
    font-size: 0.65rem;
    color: #adb5bd;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 2px 0 1px;
    background-color: #f8f9fa;
    user-select: none;
}

/* Top mirror scrollbar — sits just above the desk, always visible */
#desk-scroll-top {
    width: 100%;
    overflow-x: scroll;
    overflow-y: hidden;
    height: 16px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    /* scrollbar-width intentionally omitted: Chrome 121+ gives it priority over
       ::-webkit-scrollbar rules, reverting to overlay (hover-only) behavior */
}

#desk-scroll-phantom {
    height: 1px;
}

/* Force classic always-visible scrollbar in WebKit/Blink (Chrome, Safari, Edge) */
#desk-scroll-top::-webkit-scrollbar {
    height: 10px;
    display: block;
}
#desk-scroll-top::-webkit-scrollbar-track {
    background: #e9ecef;
    border-radius: 4px;
}
#desk-scroll-top::-webkit-scrollbar-thumb {
    background: #adb5bd;
    border-radius: 4px;
    min-width: 40px;
}
#desk-scroll-top::-webkit-scrollbar-thumb:hover {
    background: #6c757d;
}

/* Main Container */
#virtual-desk {
    width: 100%;
    height: calc(100vh - 154px); /* 120 + 16px scroller + ~18px label */
    overflow: auto;
    /* Allows 2D scrolling */
    background-color: #f8f9fa;
    padding: 20px;
    box-sizing: border-box;
}

/* Section Row Container */
.section-row {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    /* CRITICAL: No wrapping */
    align-items: flex-start;
    gap: 28px;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px dashed #dee2e6;
    /* Visual separator between sections */
    width: max-content;
    /* Ensure row grows with content */
}

/* Facing-page spread: two page cards visually joined */
.spread-group {
    display: flex;
    flex-direction: row;
    gap: 3px;
    position: relative;
}

/* Subtle center-gutter line between spread pages */
.spread-group::after {
    content: '';
    position: absolute;
    left: calc(50% - 1px);
    top: 32px;
    bottom: 32px;
    width: 2px;
    background: rgba(0, 0, 0, 0.07);
    pointer-events: none;
}

/* Folio side indicator badge (L / R / F / B) */
.folio-side-badge {
    font-size: 0.6rem;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 3px;
    min-width: 16px;
    text-align: center;
    flex-shrink: 0;
    letter-spacing: 0.03em;
    line-height: 1.4;
}

.side-left,
.side-right {
    background-color: #dee2e6;
    color: #495057;
}

.side-front,
.side-back {
    background-color: #343a40;
    color: #ffffff;
}

/* Sticky Section Label */
.section-header {
    position: sticky;
    left: 0;
    z-index: 100;
    /* Stay on top of scrolling content */
    margin-right: 10px;
    padding-top: 10px;
}

.section-badge {
    background-color: #343a40;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: bold;
    box-shadow: 4px 0 10px rgba(0, 0, 0, 0.1);
    /* Shadow to show depth over scrolling cards */
}

/* Page Card Fixed Dimensions */
.page-card {
    flex: 0 0 auto;
    /* Prevent shrinking */
    background: white;
    border: 1px solid #ced4da;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border-radius: 4px;
    /* Width is determined by the canvas size + padding */
}

.card-header {
    background-color: #e9ecef;
    border-bottom: 1px solid #ced4da;
}

/* Compact controls for the footer */
.page-controls {
    display: flex;
    gap: 5px;
    justify-content: space-between;
}

#btnFetchAds {
    min-width: 135px;
}
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}
input.form-control.form-control-sm.page-setting-input.flex-grow-1 {
    max-width: 90px;
}