:root{
  --bg:#f1f5f9;--card:#fff;--ink:#0f172a;--muted:#64748b;--line:#cbd5e1;
  --primary:#0f766e;--primary-dark:#115e59;--secondary:#1e3a8a;--danger:#b91c1c;
  --shadow:0 12px 30px rgba(15,23,42,.08);--radius:18px;
}
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:var(--bg);color:var(--ink);font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
button,input,textarea,select{font:inherit}button{cursor:pointer}.topbar{position:sticky;top:0;z-index:30;display:flex;justify-content:space-between;gap:14px;align-items:center;padding:12px max(16px,calc((100vw - 1180px)/2));background:rgba(15,23,42,.96);color:#fff;box-shadow:0 3px 18px rgba(15,23,42,.18)}
.brand{display:flex;align-items:center;gap:10px}.brand-mark{display:grid;place-items:center;width:38px;height:38px;border-radius:10px;background:#fff;color:#0f766e;font-weight:900}.brand strong{display:block;letter-spacing:.06em}.brand small{display:block;color:#cbd5e1;font-size:11px}.badge{font-size:12px;padding:7px 10px;border-radius:999px;background:#334155;color:#e2e8f0}.badge.ok{background:#14532d}.badge.warn{background:#78350f}.badge.bad{background:#7f1d1d}
.app-shell{max-width:1180px;margin:0 auto;padding:18px 14px 100px}.tabs{display:flex;gap:8px;overflow:auto;padding:4px 0 14px}.tab{border:1px solid var(--line);background:#fff;padding:10px 16px;border-radius:999px;color:#334155;font-weight:700;white-space:nowrap}.tab.active{background:var(--ink);color:#fff;border-color:var(--ink)}.tab-panel{display:none}.tab-panel.active{display:block}
.hero-card,.card{background:var(--card);border:1px solid #e2e8f0;border-radius:var(--radius);box-shadow:var(--shadow)}.hero-card{display:flex;justify-content:space-between;align-items:center;gap:18px;padding:22px;margin-bottom:16px;background:linear-gradient(135deg,#ecfeff,#fff)}.hero-card h1{margin:3px 0 6px;font-size:clamp(24px,4vw,36px);line-height:1.1}.hero-card p{margin:0;color:#475569;max-width:760px}.eyebrow{font-size:12px!important;font-weight:900;letter-spacing:.12em;color:#0f766e!important}.link-button{text-decoration:none;color:#0f766e;border:1px solid #99f6e4;background:#f0fdfa;padding:10px 13px;border-radius:12px;font-weight:800;white-space:nowrap}
.card{padding:20px;margin-bottom:16px}.section-title{display:flex;gap:12px;align-items:flex-start;margin-bottom:18px}.section-title>span{display:grid;place-items:center;min-width:34px;height:34px;border-radius:10px;background:#0f172a;color:#fff;font-weight:900}.section-title h2{margin:0 0 3px;font-size:19px}.section-title p{margin:0;color:var(--muted);font-size:13px}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.form-grid .wide{grid-column:1/-1}label{display:flex;flex-direction:column;gap:6px;font-size:13px;font-weight:800;color:#334155}input,textarea,select{width:100%;border:1px solid #cbd5e1;border-radius:11px;padding:11px 12px;background:#fff;color:#0f172a;outline:none;transition:.15s}textarea{resize:vertical;line-height:1.45}input:focus,textarea:focus,select:focus{border-color:#0f766e;box-shadow:0 0 0 3px rgba(13,148,136,.12)}
.actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:16px}button.primary,button.secondary,button.ghost,.small{border:0;border-radius:11px;padding:11px 15px;font-weight:850}button.primary{background:var(--primary);color:#fff}button.primary:hover{background:var(--primary-dark)}button.secondary{background:#1e3a8a;color:#fff}button.ghost{background:#e2e8f0;color:#0f172a}.small{padding:7px 9px;background:#f1f5f9;color:#475569;font-size:12px}.message{margin-top:14px;padding:12px 14px;border-radius:12px;background:#eff6ff;color:#1e3a8a;font-weight:700;font-size:13px}.message.error{background:#fef2f2;color:#991b1b}.message.success{background:#f0fdf4;color:#166534}
.steps-editor{display:grid;gap:12px}.step-card{border:1px solid #e2e8f0;border-radius:14px;padding:14px;background:#fafafa}.step-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}.step-num{display:inline-grid;place-items:center;width:30px;height:30px;border-radius:9px;background:#e2e8f0;font-weight:900}.step-grid{display:grid;grid-template-columns:1fr 1.15fr 1.5fr .72fr;gap:10px}.step-grid textarea{min-height:108px}.step-grid label{font-size:12px}
.signature-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.signature-card{border:1px solid #e2e8f0;border-radius:14px;padding:12px}.signature-card h3{margin:0 0 9px;text-align:center;font-size:14px}.signature-card canvas{display:block;width:100%;height:130px;border:1px dashed #94a3b8;border-radius:10px;background:#fff;touch-action:none}.sig-actions{display:flex;justify-content:flex-end;margin:7px 0}.signature-card label{margin-top:7px}.signature-card strong{display:block;text-align:center;margin-top:10px;font-size:12px}
.sticky-actions{position:sticky;bottom:12px;z-index:20;display:flex;justify-content:flex-end;gap:10px;padding:10px;background:rgba(255,255,255,.92);backdrop-filter:blur(12px);border:1px solid #e2e8f0;border-radius:16px;box-shadow:0 8px 30px rgba(15,23,42,.15)}.history-list{display:grid;gap:10px;margin-top:16px}.history-item{border:1px solid #e2e8f0;border-radius:13px;padding:13px;display:flex;justify-content:space-between;gap:12px;align-items:center}.history-item h3{margin:0 0 4px;font-size:15px}.history-item p{margin:0;color:#64748b;font-size:12px}.history-item .history-actions{display:flex;gap:7px;flex-wrap:wrap;justify-content:flex-end}.empty{padding:30px;text-align:center;color:#64748b;border:1px dashed #cbd5e1;border-radius:12px}.info-box{margin-top:16px;background:#f8fafc;border:1px solid #e2e8f0;border-radius:12px;padding:14px;color:#475569;font-size:13px}.info-box p{margin:5px 0 0}.info-box code{background:#e2e8f0;padding:2px 5px;border-radius:5px}
.preview-overlay{position:fixed;inset:0;background:#475569;z-index:100;overflow:auto} .preview-toolbar{position:sticky;top:0;z-index:2;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 14px;background:#0f172a;color:#fff}.preview-toolbar span{font-weight:900}.preview-toolbar-actions{display:flex;gap:8px;align-items:center}.preview-toolbar-actions .ghost{background:#334155;color:#fff}.preview-mount{padding:16px;display:grid;gap:18px;justify-content:center;overflow:auto}.review-mount{max-width:900px;margin:0 auto;padding:16px 14px 120px}.review-summary,.review-step,.review-end{background:#fff;border:1px solid #e2e8f0;border-radius:16px;box-shadow:0 6px 22px rgba(15,23,42,.12)}.review-summary{padding:18px;margin-bottom:14px}.review-summary h2{margin:0 0 14px;font-size:20px}.review-summary-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.review-summary-grid>div,.review-description{background:#f8fafc;border:1px solid #e2e8f0;border-radius:11px;padding:10px}.review-summary-grid span,.review-description span{display:block;color:#64748b;font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.04em;margin-bottom:3px}.review-summary-grid strong{font-size:14px}.review-description{margin-top:10px}.review-description p{margin:4px 0 0;line-height:1.5}.review-note{margin:12px 0 0;color:#166534;background:#f0fdf4;border-radius:10px;padding:10px;font-size:13px;font-weight:700}.review-steps{display:grid;gap:12px}.review-step{padding:14px}.review-step-head{display:flex;align-items:center;gap:10px;padding-bottom:11px;margin-bottom:12px;border-bottom:1px solid #e2e8f0}.review-number{display:grid;place-items:center;flex:0 0 38px;height:38px;border-radius:11px;background:#0f766e;color:#fff;font-size:18px;font-weight:900}.review-step-head strong{display:block;font-size:17px}.review-step-head small{display:block;color:#64748b;margin-top:2px}.review-fields{display:grid;grid-template-columns:1fr 1fr;gap:10px}.review-fields label:nth-child(3){grid-column:1/-1}.review-fields textarea{min-height:84px;background:#fff;font-size:15px;line-height:1.5}.review-end{margin-top:14px;padding:14px;text-align:center;color:#334155}.field-help{font-size:12px;color:#64748b;font-weight:600;line-height:1.4}.print-area{display:none}
.jsea-page{width:297mm;height:210mm;background:#fff;color:#000;font-family:Arial,Helvetica,sans-serif;font-size:8.2pt;position:relative;padding:4.5mm;box-shadow:0 8px 28px rgba(0,0,0,.28);overflow:hidden}.jsea-border{height:100%;border:.35mm solid #111;display:flex;flex-direction:column}.jsea-header{height:20mm;display:grid;grid-template-columns:25mm 1fr;border-bottom:.3mm solid #111}.jsea-logo{display:flex;align-items:center;justify-content:center;border-right:.3mm solid #111;padding:2mm}.jsea-logo img{max-width:19mm;max-height:15mm}.jsea-title-wrap{display:grid;grid-template-rows:1fr 5.5mm}.jsea-title{display:flex;align-items:center;justify-content:center;font-size:12pt;font-weight:700}.jsea-docline{display:flex;justify-content:space-between;align-items:end;padding:0 2mm 1.2mm;font-size:6.8pt}.jsea-meta{height:24mm;padding:2.2mm;display:grid;grid-template-columns:1fr 1fr;gap:1mm 18mm}.meta-row{display:grid;grid-template-columns:28mm 3mm 1fr;align-items:start}.meta-row .v{font-weight:500}.jsea-table{width:100%;border-collapse:collapse;table-layout:fixed}.jsea-table th,.jsea-table td{border:.25mm solid #111;padding:1.6mm;vertical-align:top;white-space:pre-wrap;overflow-wrap:anywhere}.jsea-table th{height:7mm;background:#eee;text-align:center;font-weight:700}.jsea-table .c-no{width:10mm;text-align:center}.jsea-table .c-activity{width:56mm}.jsea-table .c-hazard{width:70mm}.jsea-table .c-control{width:118mm}.jsea-table .c-pic{width:38mm;text-align:center}.jsea-table tbody tr{height:36.4mm}.jsea-table td{font-size:7.3pt;line-height:1.25}.page-footer{position:absolute;right:7mm;bottom:5.5mm;font-size:6.5pt}.continued-header{height:14mm;display:grid;grid-template-columns:1fr auto 1fr;align-items:end;padding:0 2mm 1.3mm;border-bottom:.3mm solid #111}.continued-header strong{font-size:10pt;align-self:center}.continued-header span:last-child{text-align:right}.page2 .jsea-table tbody tr{height:31.5mm}.approval-wrap{display:grid;grid-template-columns:115mm 1fr;height:39mm;border-top:.3mm solid #111;margin-top:3.3mm}.notes-box{padding:1.7mm;border-right:.3mm solid #111;white-space:pre-wrap}.approvals{display:grid;grid-template-columns:repeat(3,1fr)}.approval{display:grid;grid-template-rows:6mm 19mm 8mm 6mm;border-right:.25mm solid #111}.approval:last-child{border-right:0}.approval>*{border-bottom:.25mm solid #111}.approval>*:last-child{border-bottom:0}.approval-title,.approval-role{display:flex;align-items:center;justify-content:center;font-weight:700;text-align:center}.approval-sign{display:flex;align-items:center;justify-content:center;overflow:hidden}.approval-sign img{max-height:18mm;max-width:95%}.approval-meta{padding:1mm;font-size:6.5pt;line-height:1.25}.approval-role{font-size:7pt}.print-disclaimer{position:absolute;left:7mm;bottom:5.5mm;font-size:5.7pt;color:#555}
@media(max-width:820px){.hero-card{align-items:flex-start;flex-direction:column}.form-grid{grid-template-columns:1fr}.form-grid .wide{grid-column:auto}.step-grid{grid-template-columns:1fr}.signature-grid{grid-template-columns:1fr}.sticky-actions{justify-content:stretch}.sticky-actions button{flex:1}.history-item{align-items:flex-start;flex-direction:column}.history-item .history-actions{justify-content:flex-start}.topbar{padding:10px 12px}.badge{max-width:46vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.preview-toolbar{align-items:center;padding:9px 8px}.preview-toolbar>span{font-size:14px}.preview-toolbar button{padding:9px 10px;font-size:12px}.preview-toolbar-actions{gap:5px}.review-mount{padding:10px 8px 120px}.review-summary{padding:13px}.review-summary-grid{grid-template-columns:1fr}.review-step{padding:11px}.review-fields{grid-template-columns:1fr}.review-fields label:nth-child(3){grid-column:auto}.review-fields textarea{font-size:16px;min-height:92px}.preview-mount{display:block;padding:8px;overflow:auto}.preview-mount .jsea-page{zoom:.32;margin:0 auto 12px}}
@media print{
  @page{size:A4 landscape;margin:0}
  body{background:#fff}.no-print{display:none!important}.print-area{display:block!important}.jsea-page{box-shadow:none;margin:0;width:297mm;height:210mm;page-break-after:always}.jsea-page:last-child{page-break-after:auto}
}
.checkbox-line{flex-direction:row;align-items:center;gap:10px;padding:10px 12px;border:1px solid #dbeafe;border-radius:11px;background:#eff6ff;font-weight:700}.checkbox-line input{width:auto;transform:scale(1.15)}
.step-actions{margin-top:0;margin-bottom:12px}
.continuation-page .jsea-table tbody tr{height:43mm}
.final-page .jsea-table tbody tr{height:31.5mm}
