#portal-signature-dialog{box-sizing:border-box;width:min(1000px,96vw);max-width:96vw;max-height:94dvh;border:1px solid var(--line,#676767);border-radius:16px;padding:0;background:var(--surface,#242424);color:var(--fg,#f4f0e9)}
#portal-signature-dialog::backdrop{background:rgb(0 0 0/.7)}
.portal-signature-head{position:sticky;top:0;z-index:2;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:20px;background:inherit;border-bottom:1px solid var(--line,#676767)}
.portal-signature-head h2{font:400 25px/1.3 Georgia,serif;overflow-wrap:anywhere;margin:4px 0}.portal-signature-head p{margin:0}
.portal-signature-body{padding:20px 20px calc(20px + env(safe-area-inset-bottom));min-width:0;line-height:1.6}.portal-signature-pages,.portal-signature-tools{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:12px 0}
.portal-signature-preview{display:block;width:100%;height:auto;object-fit:contain;background:#fff}.portal-signature-body button,.portal-signature-body a,#portal-signature-dialog header button{min-height:44px;box-sizing:border-box}
#portal-signature-form fieldset{border:0;padding:24px 0 0;min-width:0}#portal-signature-form legend{font:400 26px/1.4 Georgia,serif}#portal-signature-form label{display:grid;gap:8px}#portal-signature-form input[type=text]{font-size:16px;min-height:44px;width:100%;box-sizing:border-box}
.portal-signature-pad-wrap{position:relative;border:2px solid #777;background:#fff;border-radius:10px;overflow:hidden;margin:20px 0 10px}#portal-signature-pad{display:block;width:100%;height:auto;aspect-ratio:2.5;touch-action:none;cursor:crosshair}.portal-signature-pad-hint{position:absolute;inset:0;display:grid;place-items:center;pointer-events:none;color:#575757}.portal-signature-pad-hint[hidden]{display:none}
#portal-signature-form .portal-signature-consent{display:flex;align-items:flex-start;gap:12px;margin:24px 0;min-height:44px;cursor:pointer}.portal-signature-consent input{flex:0 0 22px;width:22px;height:22px;margin-top:3px}
.portal-signature-status{padding-top:16px;line-height:1.6}.portal-signature-status p{margin:5px 0}#portal-signature-dialog [role=alert]{scroll-margin-top:130px}#portal-signature-dialog :focus-visible{outline:3px solid var(--accent,#accb9e);outline-offset:3px}
@media(max-width:600px){#portal-signature-dialog{width:100%;max-width:100%;height:100dvh;max-height:100dvh;margin:0;border:0;border-radius:0}.portal-signature-head{padding:14px;gap:12px}.portal-signature-head h2{font-size:21px}.portal-signature-body{padding:16px 16px calc(16px + env(safe-area-inset-bottom))}.portal-signature-pages>span{flex-basis:100%;text-align:center;order:-1}.portal-signature-pages>a{flex-basis:100%;text-align:center}.portal-signature-pages>button,.portal-signature-tools>button{flex:1}.portal-signature-body button[type=submit]{width:100%}}

#portal-signature-dialog input[type=text]{background:var(--bg,#242424);color:var(--fg,#f4f0e9);border:1px solid var(--line,#676767);border-radius:8px;padding:10px 12px}#portal-signature-dialog .button.primary{background:var(--accent,#b2d1a3);color:var(--on-accent,#23321f);border-color:var(--accent,#b2d1a3)}
