* { box-sizing: border-box; }

html, body {
    margin: 0;
    height: 100%;
    font-family: system-ui, sans-serif;
    font-size: 14px;
    color: #222;
    background: #f4f4f4;
}

body { display: flex; }

#panel {
    width: 280px;
    flex-shrink: 0;
    overflow: hidden;
    padding: 10px 12px;
    background: #fff;
    border-right: 1px solid #ddd;
}

h1 { font-size: 17px; margin: 0 0 8px; }

fieldset {
    border: 1px solid #ddd;
    border-radius: 6px;
    margin: 0 0 8px;
    padding: 4px 10px 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

input, select, button { min-width: 0; font: inherit; }

legend { font-weight: 600; padding: 0 4px; }

label { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
label:has(input[type=radio]), label:has(input[type=checkbox]) { justify-content: flex-start; }

input[type=number], select { width: 90px; }
input[type=file] { max-width: 100%; }

small, #pdfInfo { color: #777; font-size: 12px; }

button {
    padding: 6px;
    border: 0;
    border-radius: 4px;
    background: #2b6cb0;
    color: #fff;
    cursor: pointer;
}
button.secondary { background: #e2e2e2; color: #222; }

#viewport { flex: 1; min-width: 0; position: relative; overflow: hidden; }
#viewport canvas { position: absolute; inset: 0; display: block; }

#updating {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.45);
    pointer-events: none;
}
#updating[hidden] { display: none; }
#updating span {
    padding: 10px 18px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-weight: 600;
}
