dialog{padding:0;border:1px solid #dce4ef;border-radius:12px;width:min(540px,calc(100vw - 28px));max-height:90vh;color:var(--ink)}dialog.wide{width:min(820px,calc(100vw - 28px))}dialog::backdrop{background:#101e36a6;backdrop-filter:blur(2px)}fieldset{border:0;padding:0;margin:0;min-width:0}fieldset:disabled{opacity:.8}.form-error{color:#b03131;font-size:13px;margin:14px 0;white-space:pre-wrap}.error{background:#8b2626}.button-link{display:inline-block;text-decoration:none;border:1px solid var(--line);padding:8px 12px;border-radius:7px;color:var(--blue);background:white;font-size:13px;font-weight:600}button:disabled{opacity:.45;cursor:not-allowed}.auth{max-width:480px;margin:8vh auto;padding:20px}.auth-brand{font-size:22px;font-weight:700;margin-bottom:24px}.auth .card{padding:30px}.auth .card h1{font-size:24px}.auth .field{margin:18px 0}.auth .actions{margin-top:20px}.auth .actions [data-action="close"]{display:none}.public-page{max-width:1200px;margin:30px auto;padding:20px}.public-page .paper{max-width:720px;box-shadow:none}.document-frame{width:100%;height:680px;border:0;background:#e9edf3;border-radius:6px}.document-image{max-width:100%;max-height:650px;object-fit:contain;display:block;margin:auto}#signature-pad{width:100%;height:auto;background:#fcfdff;border:1px dashed #9eb1ce;border-radius:8px;touch-action:none}.line-editor{display:grid;grid-template-columns:minmax(100px,2fr) 60px 90px 85px 32px;gap:8px;align-items:end;margin:12px 0 18px}.line-editor label{font-size:11px;color:var(--muted)}.line-editor input{width:100%;padding:7px 6px}.line-editor button{padding:7px 3px}.scan-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-top:20px}.scan-page{border:1px solid var(--line);padding:10px;border-radius:8px;min-width:0}.scan-page img{width:100%;height:220px;object-fit:contain;background:#f2f4f7}.scan-page small{display:block;margin:8px 0}.scan-page button{padding:5px 7px;font-size:11px}.scan-edit-image{max-width:100%;height:280px;object-fit:contain;display:block;margin:0 auto 20px}.button-link input[type="file"]{display:block;border:0;padding:8px 0;font-size:12px;width:100%}pre{background:#f3f6fa;padding:15px;overflow:auto}input[type="checkbox"]{width:16px;height:16px;accent-color:var(--blue)}hr{border:0;border-top:1px solid var(--line);margin:20px 0}.field{font-size:12px;color:var(--muted);font-weight:600}.field input,.field select,.field textarea{font-size:14px;color:var(--ink);font-weight:400}.paper .billhead .mini,.paper .billto,.paper .terms{overflow-wrap:anywhere;white-space:pre-wrap}.paper .total div{gap:15px}.paper table{table-layout:fixed}.paper td:first-child,.paper th:first-child{width:50%;overflow-wrap:anywhere}.paper td:not(:first-child){font-variant-numeric:tabular-nums}.paper.compact{min-height:500px}.panel-body>form>.actions{margin-top:18px}.review-banner button{border:0;padding:0;background:transparent;font-size:12px;font-weight:400}.topbar>[data-action="menu"]{display:none}.stat-num{overflow-wrap:anywhere}.field select[multiple]{min-height:190px}.public-page .paper{margin:auto}footer{line-height:1.5}
@media(max-width:800px){.line-editor{grid-template-columns:1fr 1fr 1fr}.line-editor>label:first-child{grid-column:1/-1}.line-editor>button{grid-column:3}.document-frame{height:550px}.topbar>[data-action="menu"]{display:block}.scan-grid{grid-template-columns:1fr}.auth{margin:3vh auto}.public-page{margin:0;padding:16px}.paper td,.paper th{font-size:9px;padding:8px 4px}.formrow{min-width:0}}
@media print{dialog,.sidebar,.topbar,.review-banner,.editor-panel,footer,.pagehead{display:none!important}.workspace{padding:0}.public-page>.card{break-after:page}.paper{box-shadow:none;min-height:0}.paper .total,.paper .terms{break-inside:avoid}thead{display:table-header-group}tr{break-inside:avoid}}
