:root {
    --watermark-width: 140px;
    --watermark-height: 180px;
    --watermark-opacity: 1;
    /* adjust to 0.1 - 0.25 */
    --sig-default-w: 280px;
    --sig-default-h: 70px;
    --base-left-font: 20px;
    --base-right-font: 09px;
}

* {
    box-sizing: border-box
}

body {
    font-family: Inter, Arial, Helvetica, sans-serif;
    margin: 0;
    background: #f3f6fb;
    color: #111
}

.app {
    display: flex;
    min-height: 100vh
}

.preview {
    flex: 1;
    padding: 18px
}

.preview header h1 {
    margin: 0;
    font-size: 18px
}

.controls-top {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 12px 0
}

.pages {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 76vh;
    overflow: auto;
    padding: 6px;
    border: 1px solid #eee;
    background: #fff
}

.pageWrapper {
    position: relative;
    border: 1px solid #ddd;
    padding: 6px;
    background: #fafafa;
    margin: 0 auto;
    width: max-content
}

.pageWrapper.active {
    outline: 4px solid rgba(13, 110, 253, 0.08);
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.04) inset
}

.overlay {
    position: absolute;
    left: 6px;
    top: 6px;
    pointer-events: auto;
    overflow: hidden
}

.pdfCanvas {
    display: block;
    max-width: 100%
}

/* signature block - transparent, resizable, confined */
.sigBlock {
    position: absolute;
    left: 0;
    top: 0;
    background: transparent;
    padding: 0px;
    display: flex;
    gap: 2px;
    align-items: center;
    cursor: move;
    min-width: 120px;
    min-height: 150px;
    user-select: none;
    resize: both;
    overflow: auto;
    border-radius: 2px;
    position: relative;
}



/* Ensure signature text is above watermark */
.sigBlock>* {
    position: relative;
    z-index: 1;
}

/* LEFT SECTION */
.sigLeft {
    font-size: var(--base-left-font);
    font-weight: 400;
    line-height: 0.95;
    color: #000;
    white-space: nowrap;
}

/* RIGHT SECTION */
.sigRight {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    font-size: var(--base-right-font);
    line-height: 0.9;
    color: #000;
    margin-left: 2px;
}

/* Reduce spacing between all lines */
.sigRight .line1,
.sigRight .line2,
.sigRight .line3,
.sigRight .line4 {
    line-height: 0.85;
    margin-top: 1px !important;
}

.sigRight .line2 {
    margin-top: 1px !important;
}

.sigRight .line3 {
    margin-top: 1px !important;
}

.sigRight .line4 {
    margin-top: 1px !important;
}

/* Sidebar */
.sidebar {
    width: 320px;
    padding: 18px;
    border-left: 1px solid #e6e9ef;
    background: #fff
}

.sidebar h2 {
    margin-top: 0
}

.sidebar label {
    display: block;
    margin: 8px 0;
    font-size: 13px
}

.sidebar input[type="number"],
.sidebar input[type="text"],
.sidebar input[type="range"] {
    width: 100%;
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 6px
}

.sidebar .sidebar-row {
    display: flex;
    gap: 8px;
    margin-top: 10px
}

button {
    padding: 8px 10px;
    border-radius: 6px;
    border: none;
    background: #0b5ed7;
    color: #fff;
    cursor: pointer
}

button.muted {
    background: #e9ecef;
    color: #333
}

.help {
    font-size: 12px;
    color: #666;
    margin-top: 8px
}

.fontScaleDisplay {
    margin-top: 6px;
    font-size: 13px;
    color: #333
}