*{box-sizing:border-box}body,html{margin:0;padding:0}body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,sans-serif;background:#f3f4f6;color:#111;-webkit-font-smoothing:antialiased}a{color:#2563eb}.page-wrap{min-height:100vh;padding:40px 16px;display:flex;flex-direction:column;align-items:center}.doc{background:#fff;max-width:780px;width:100%;padding:72px 72px 56px;margin:0 auto;box-shadow:0 4px 24px rgba(0,0,0,.08);border-radius:4px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica Neue,Helvetica,Arial,sans-serif;font-size:15px;line-height:1.65;color:#1a1a1a}.doc h1{font-size:26px;margin:0 0 24px;font-weight:700;letter-spacing:-.01em}.doc h2{font-size:17px;margin:28px 0 8px;font-weight:700}.doc p{white-space:pre-wrap}.doc p,.doc ul{margin:0 0 14px}.doc ul{padding-left:22px}.doc li{margin:4px 0}.name-token{background:#fff8dc;border-bottom:1.5px dotted #d4a017;padding:0 2px;border-radius:2px}.signature-row{display:flex;gap:48px;margin-top:64px;border-top:1px solid #e5e7eb;padding-top:48px}@media (max-width:800px){.signature-row{flex-direction:column;gap:56px}}.sig-block{flex:1 1;font-family:-apple-system,Segoe UI,sans-serif;font-size:13px;min-width:0}.sig-block .label{font-weight:600;margin-bottom:14px;color:#444;text-transform:uppercase;letter-spacing:.06em;font-size:11px}.sig-block .name-line{font-size:20px;font-weight:600;margin-bottom:6px;color:#111}.sig-block .date-line{font-size:14px;color:#555;margin-top:12px}.sig-box{background:#fafafa;border:1.5px dashed #b0b0b0;border-radius:8px;height:240px;display:flex;align-items:center;justify-content:center;position:relative;overflow:hidden;margin-top:8px}.sig-box.empty:before{content:"Draw your signature here";position:absolute;color:#b8b8b8;font-style:italic;font-size:14px;font-family:-apple-system,sans-serif;pointer-events:none}.sig-box img{max-height:220px;max-width:95%;object-fit:contain}.sig-box canvas{width:100%;height:100%;display:block;cursor:crosshair;touch-action:none}.sig-box.max-pre{background:#fff;border:1px solid #eee;height:240px}.sig-box.max-pre img{max-height:200px}.sig-tools{display:flex;gap:10px;margin-top:10px;flex-wrap:wrap}.sig-tools button,.sig-tools label{font-size:13px;padding:8px 14px;border:1px solid #d1d5db;background:#fff;border-radius:5px;cursor:pointer;color:#374151;font-family:-apple-system,sans-serif}.sig-tools button:hover,.sig-tools label:hover{background:#f3f4f6}input[type=date],input[type=password],input[type=text],textarea{font-family:inherit;font-size:14px;padding:10px 12px;border:1px solid #d1d5db;border-radius:6px;background:#fff;width:100%;color:#111}input[type=date]:focus,input[type=text]:focus,textarea:focus{outline:none;border-color:#2563eb;box-shadow:0 0 0 3px rgba(37,99,235,.15)}.input-row{margin-bottom:6px}.input-row .field-label{font-size:11px;text-transform:uppercase;letter-spacing:.04em;color:#6b7280;font-weight:600;margin-bottom:4px}.sig-block .name-input{font-family:inherit;font-size:20px;font-weight:600;padding:12px 14px;border:1.5px solid #d1d5db;border-radius:6px;background:#fff;width:100%;color:#111}.sig-block .name-input:focus{outline:none;border-color:#111;box-shadow:0 0 0 3px rgba(0,0,0,.06)}.submit-bar{max-width:780px;width:100%;margin:24px auto 0;display:flex;justify-content:flex-end;gap:12px}.btn-primary{background:#111;color:#fff;border:none;padding:14px 28px;border-radius:6px;font-size:15px;font-weight:600;cursor:pointer;font-family:-apple-system,sans-serif}.btn-primary:hover{background:#333}.btn-primary:disabled{background:#9ca3af;cursor:not-allowed}.admin-card{background:#fff;max-width:780px;width:100%;margin:0 auto;padding:40px;border-radius:8px;box-shadow:0 4px 24px rgba(0,0,0,.08);font-family:-apple-system,sans-serif}.admin-card h1{font-size:22px;margin:0 0 24px}.admin-card label{display:block;font-weight:600;font-size:13px;margin:16px 0 6px;color:#374151}.admin-card textarea{min-height:320px;font-family:ui-monospace,SF Mono,Menlo,monospace;font-size:13px}.admin-card .result{margin-top:20px;padding:16px;background:#f0fdf4;border:1px solid #86efac;border-radius:6px;word-break:break-all}.admin-card .result a{font-weight:600}.admin-card .error{margin-top:16px;color:#b91c1c;font-size:14px}.admin-shell{max-width:780px;width:100%;margin:0 auto;display:flex;flex-direction:column;gap:16px}.admin-topbar{display:flex;justify-content:space-between;align-items:center;padding:0 4px}.admin-topbar .brand{font-weight:700;color:#111}.link-btn{background:none;border:none;color:#6b7280;cursor:pointer;font-size:13px;font-family:inherit;padding:6px 10px}.link-btn:hover{color:#111}.hint{font-weight:400;color:#6b7280;font-size:12px}.hint code{background:#f3f4f6;padding:1px 5px;border-radius:3px;font-size:11px}.ghost-btn{font-size:13px;padding:7px 14px;border:1px solid #d1d5db;background:#fff;border-radius:5px;cursor:pointer;color:#374151;font-family:inherit;text-decoration:none;display:inline-block}.ghost-btn:hover{background:#f9fafb}.ghost-btn.danger{color:#b91c1c;border-color:#fecaca}.ghost-btn.danger:hover{background:#fef2f2}.btn-danger{background:#dc2626;color:#fff;border:none;padding:10px 18px;border-radius:5px;font-size:14px;font-weight:600;cursor:pointer;font-family:inherit}.btn-danger:hover{background:#b91c1c}.btn-danger:disabled{background:#9ca3af;cursor:not-allowed}.doc-list{display:flex;flex-direction:column;gap:6px}.doc-row{display:flex;justify-content:space-between;align-items:center;padding:12px 14px;border:1px solid #f0f0f0;border-radius:6px;gap:16px}.doc-row:hover{background:#fafafa}.doc-row-main{flex:1 1;min-width:0}.doc-row-title{font-weight:600;font-size:14px;margin-bottom:4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.doc-row-meta{font-size:12px;color:#555;display:flex;align-items:center;gap:6px;flex-wrap:wrap}.doc-row-meta .dot{color:#d1d5db}.doc-row-actions{display:flex;gap:6px;flex-shrink:0}.badge{display:inline-block;padding:2px 8px;border-radius:4px;font-size:11px;font-weight:600;letter-spacing:.02em}.badge-signed{background:#d1fae5;color:#065f46}.badge-pending{background:#fef3c7;color:#92400e}.modal-overlay{position:fixed;inset:0;background:rgba(0,0,0,.5);display:flex;align-items:center;justify-content:center;z-index:100;padding:20px}.modal{background:#fff;max-width:440px;width:100%;padding:28px;border-radius:10px;box-shadow:0 20px 60px rgba(0,0,0,.3);max-height:90vh;overflow-y:auto}.modal-wide{max-width:720px}.modal textarea{font-family:ui-monospace,SF Mono,Menlo,monospace;font-size:13px}.modal input[type=text]{margin-bottom:4px}.ghost-btn:disabled{opacity:.5;cursor:not-allowed}.modal h2{margin:0 0 16px;font-size:18px}.modal p{margin:0 0 12px;color:#444;font-size:14px;line-height:1.5}.modal label{display:block;margin:16px 0 6px;font-size:13px;color:#374151;font-weight:600}.modal label code{background:#f3f4f6;padding:1px 6px;border-radius:3px;font-size:12px}.modal input{width:100%}.modal-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:20px}.signed-wrap{max-width:900px;margin:32px auto;padding:0 16px;display:flex;flex-direction:column;gap:16px}.signed-header{background:#fff;padding:24px 28px;border-radius:8px;box-shadow:0 4px 24px rgba(0,0,0,.06);display:flex;justify-content:space-between;align-items:center;gap:16px}.signed-header h1{margin:4px 0 6px;font-size:22px}.signed-status{display:inline-block;background:#d1fae5;color:#065f46;padding:3px 10px;border-radius:4px;font-size:11px;font-weight:700;letter-spacing:.06em}.signed-meta{color:#555;font-size:14px}.signed-pdf-frame{background:#525659;border-radius:8px;overflow:hidden;height:80vh;min-height:600px;box-shadow:0 4px 24px rgba(0,0,0,.1)}@media (max-width:700px){.signed-header{flex-direction:column;align-items:stretch}.signed-pdf-frame{height:70vh}}.gate-card{background:#fff;max-width:360px;width:100%;margin:100px auto 0;padding:36px 32px;border-radius:8px;box-shadow:0 4px 24px rgba(0,0,0,.08);font-family:-apple-system,sans-serif;display:flex;flex-direction:column;gap:12px}.gate-card .error{color:#b91c1c;font-size:13px;text-align:center}.success-card{max-width:600px;margin:80px auto;background:#fff;padding:48px;border-radius:8px;text-align:center;font-family:-apple-system,sans-serif;box-shadow:0 4px 24px rgba(0,0,0,.08)}.success-card h1{color:#059669;margin:0 0 12px}.success-card p{color:#555;line-height:1.6}.success-card a{display:inline-block;margin-top:20px}