.page-heading p { margin-bottom: 0; }
.muted { color: var(--muted); font-size: .9rem; }
.panel { background: white; border: 1px solid var(--border); border-radius: 8px; padding: 24px; margin-bottom: 20px; }
.workspace { display: grid; grid-template-columns: 320px minmax(0,1fr); gap: 20px; padding-bottom: 32px; }
h2 { font-size: 1.15rem; margin-bottom: 16px; }
label { display: block; margin: 14px 0 8px; }
input[type=file], input[type=text], input[type=date], select { width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 6px; font: inherit; }
input[type=range] { width: 100%; }
button { cursor: pointer; font: inherit; font-weight: 600; min-height: 44px; padding: 10px 14px; border: 1px solid var(--accent); border-radius: 6px; background: var(--accent); color: white; }
button.secondary, .modes button[aria-pressed=false] { background: white; color: var(--ink); border-color: var(--border); }
button:disabled { opacity: .45; cursor: default; }
button:focus-visible, input:focus-visible, #page:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }
.signature-panel > button { width: 100%; margin-top: 12px; }
.modes, .page-controls { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.modes button { flex: 1; }
#signature, #typed { width: 100%; height: auto; border: 1px dashed var(--border); border-radius: 6px; background: #fafbfc; }
#signature { touch-action: none; cursor: crosshair; }
#clear { margin-top: 8px; }
#page { position: relative; width: 100%; margin-top: 20px; background: #eef0f3; cursor: crosshair; }
#pdf { display: block; width: 100%; height: auto; }
#overlays { position: absolute; inset: 0; pointer-events: none; }
#overlays .placed-signature { position: absolute; display: block; padding: 0; min-height: 0; border: 0; border-radius: 0; background: transparent; cursor: grab; pointer-events: auto; touch-action: none; user-select: none; }
#overlays .placed-signature img { display: block; width: 100%; height: 100%; pointer-events: none; }
#overlays .placed-signature:hover { outline: 1px dashed var(--accent); }
#overlays .placed-signature.selected, #overlays .placed-signature:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#overlays .placed-signature.dragging { cursor: grabbing; }
#fileName { overflow-wrap: anywhere; }
#status { min-height: 24px; }
#status.error { color: #a32222; }
[hidden] { display: none !important; }
@media(max-width: 800px) { .workspace { grid-template-columns: 1fr; } .panel { padding: 18px; } }

.date-controls { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 20px 0 8px; margin: 20px 0 8px; }
.date-controls h3 { font-size: 1.05rem; }
.date-controls button { width: 100%; }
input[type=date], select { min-width: 0; background: white; color: var(--ink); }
