:root{
  --bg:#f5f7fb;--panel:#fff;--text:#172033;--muted:#687386;--line:#e3e8f0;--line2:#edf0f5;
  --navy:#193f72;--navy2:#102f57;--blue:#e9f1ff;--blue-text:#245ca6;--green:#19724b;--green-bg:#eaf7f0;
  --amber:#9a6514;--amber-bg:#fff7e5;--red:#b53a3a;--shadow:0 8px 26px rgba(22,34,51,.06);
  --radius:16px;--radius-sm:11px;
  font-family:Pretendard,"Noto Sans KR","Apple SD Gothic Neo","Malgun Gothic",system-ui,-apple-system,sans-serif;
}
*{box-sizing:border-box} body{margin:0;background:var(--bg);color:var(--text);font-size:14px;line-height:1.55}
button,input,select{font:inherit} button{cursor:pointer} input,select{width:100%;border:1px solid var(--line);border-radius:10px;background:#fff;color:var(--text);padding:10px 12px;outline:none;transition:.15s}
input:focus,select:focus{border-color:#8aa8d4;box-shadow:0 0 0 3px rgba(41,96,164,.10)} label{font-weight:700;font-size:13px;color:#39465a}.optional{font-weight:600;font-size:11px;color:#8290a4;background:#f0f3f7;padding:2px 6px;border-radius:5px}
.topbar{height:70px;background:rgba(255,255,255,.94);border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 28px;position:sticky;top:0;z-index:20;backdrop-filter:blur(14px)}
.brand-wrap{display:flex;align-items:center;gap:11px}.brand-icon{width:34px;height:34px;border-radius:10px;background:var(--navy);display:grid;place-items:center}.brand-icon svg{width:22px;height:22px;fill:none;stroke:#fff;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.brand-wrap h1{font-size:18px;margin:0;letter-spacing:-.3px}.brand-wrap p{font-size:11px;color:var(--muted);margin:1px 0 0}.version{font-size:10px;font-weight:800;color:#66758a;background:#f0f3f7;padding:3px 7px;border-radius:999px;margin-left:4px}.audience-badge{font-size:11px;font-weight:850;color:#1f4f86;background:#eaf2ff;border:1px solid #cbdcf3;padding:4px 8px;border-radius:999px;margin-left:4px}.top-actions{display:flex;gap:8px}
.btn{border:1px solid transparent;border-radius:10px;padding:9px 13px;font-weight:750;background:#fff;color:var(--text);transition:.15s;white-space:nowrap}.btn:hover{transform:translateY(-1px)}.btn.primary{background:var(--navy);color:#fff}.btn.dark{background:#17233a;color:#fff}.btn.ghost{border-color:var(--line);background:#fff}.btn.subtle{background:#f0f4fa;color:#2c4f7b}.btn.tiny{padding:6px 9px;border-radius:8px;font-size:12px;background:#eaf1fb;color:#255287}.btn.tiny.ghost{background:#fff;border-color:var(--line);color:#56647a}.btn.danger-outline{border-color:#eac1c1;color:var(--red);background:#fff}.full-btn{width:100%;margin-top:8px}.text-btn{border:0;background:none;padding:0;color:#3569a7;font-size:12px;font-weight:750}
.app-shell{max-width:1500px;margin:0 auto;padding:22px 24px 52px;display:grid;grid-template-columns:370px minmax(0,1fr);gap:20px}.sidebar{min-width:0}.sticky-panel{position:sticky;top:92px;max-height:calc(100vh - 112px);overflow:auto}.panel,.editor-card{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow)}.panel{padding:19px}.panel-head,.editor-head,.panel-subhead,.label-row{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.panel-head h2,.editor-head h2,.hero-note h2{margin:1px 0 0;font-size:18px;letter-spacing:-.3px}.panel-subhead h3{font-size:15px;margin:1px 0}.eyebrow{font-size:10px;font-weight:850;letter-spacing:.08em;text-transform:uppercase;color:#718097;margin:0}.save-state{font-size:10px;color:#8996a8;background:#f4f6f9;border-radius:999px;padding:4px 7px}.field-group{margin-top:16px}.field-group>label{display:block;margin-bottom:7px}.segmented{display:grid;grid-template-columns:repeat(3,1fr);gap:4px;background:#f1f4f8;padding:4px;border-radius:11px}.segmented.compact{grid-template-columns:1fr 1fr}.segmented button{border:0;background:transparent;border-radius:8px;padding:8px 4px;font-weight:750;color:#6e7b8f}.segmented button.active{background:#fff;color:var(--navy);box-shadow:0 1px 5px rgba(28,44,70,.10)}
.field-grid{display:grid;gap:11px;margin-top:13px}.field-grid.two{grid-template-columns:1fr 1fr}.field-grid .full{grid-column:1/-1}.field{display:flex;flex-direction:column;gap:5px}.field small{color:#8994a6;font-size:11px}.divider{height:1px;background:var(--line2);margin:18px 0}.save-option{margin-top:14px;border:1px solid var(--line);border-radius:11px;padding:10px;display:flex;gap:9px;align-items:flex-start;cursor:pointer}.save-option input{width:16px;height:16px;margin-top:2px}.save-option span{display:flex;flex-direction:column;gap:1px}.save-option strong{font-size:12px}.save-option small{font-size:10.5px;font-weight:500;color:#7b8798}
.workspace{min-width:0}.hero-note{display:flex;align-items:center;justify-content:space-between;gap:18px;background:linear-gradient(120deg,#fdfefe,#f4f8ff);border:1px solid #dfe7f3;border-radius:var(--radius);padding:18px 20px;margin-bottom:14px}.hero-note p:last-child{margin:5px 0 0;color:var(--muted);font-size:12px}.doc-cards{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-bottom:14px}.doc-card{position:relative;background:#fff;border:1px solid var(--line);border-radius:15px;padding:16px;min-height:210px;box-shadow:var(--shadow);display:flex;flex-direction:column}.doc-card:hover{border-color:#cfd9e8}.doc-select{position:absolute;right:13px;top:13px;display:flex;align-items:center;gap:4px;font-size:10px;color:#8290a3}.doc-select input{width:14px;height:14px}.doc-select label{font-size:10px;color:#8290a3}.doc-icon{width:32px;height:32px;border-radius:9px;background:#eef3fa;color:#315a8e;display:grid;place-items:center;font-weight:850;font-size:11px;margin-bottom:13px}.doc-title-row{display:flex;gap:7px;align-items:center}.doc-title-row h3{font-size:15px;margin:0}.pill{font-size:9px;font-weight:850;padding:3px 6px;border-radius:999px}.pill.blue{background:var(--blue);color:var(--blue-text)}.pill.gray{background:#f0f2f5;color:#7c8797}.doc-card>p{font-size:11.5px;color:var(--muted);min-height:40px;margin:7px 0}.status-line{font-size:11px;font-weight:700;color:#59677b;display:flex;gap:6px;align-items:center;margin:auto 0 11px}.dot{width:7px;height:7px;border-radius:50%}.dot.warn{background:#e4a73d}.dot.ok{background:#34a46c}.dot.muted{background:#aeb7c4}.card-actions{display:grid;grid-template-columns:1fr 1fr;gap:7px}.card-actions .btn{padding:7px;font-size:11px}
.editor-card{margin-top:14px;overflow:hidden}.editor-head{padding:17px 19px;border-bottom:1px solid var(--line2);align-items:center}.editor-body{padding:18px 19px}.icon-btn{border:1px solid var(--line);background:#fff;width:32px;height:32px;border-radius:9px;font-size:18px;color:#66758a}.editor-card.collapsed .editor-body{display:none}.info-banner{display:flex;align-items:flex-start;gap:10px;padding:10px 12px;border-radius:11px;margin-bottom:14px}.info-banner span{flex:0 0 auto;font-size:10px;font-weight:850;padding:3px 6px;border-radius:6px}.info-banner p{margin:0;font-size:11.5px}.info-banner.law{background:#edf4ff}.info-banner.law span{background:#d7e7ff;color:#245b99}.info-banner.warn{background:var(--amber-bg)}.info-banner.warn span{background:#ffebba;color:#8b5d0d}.info-banner.auto{background:#f1f6ff}.info-banner.auto span{background:#dce9fb;color:#38689d}.info-banner.secure{background:#edf8f2}.info-banner.secure span{background:#d8f0e3;color:#22724f}.form-row-three{display:grid;grid-template-columns:1fr 1fr 1.2fr;gap:12px}.locked-input{border:1px solid var(--line);border-radius:10px;padding:10px 11px;display:flex;align-items:center;justify-content:space-between;background:#f9fafc}.check-field{justify-content:flex-end}.confirm-chip{border:1px solid #f0d398;background:#fffaf0;border-radius:10px;padding:9px 10px;display:flex;align-items:center;gap:8px;font-size:11.5px;color:#715420}.confirm-chip input{width:15px;height:15px}.hidden{display:none!important}.editor-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:15px}.quick-bar{display:flex;align-items:center;gap:7px;flex-wrap:wrap;background:#f7f9fc;border:1px solid var(--line2);border-radius:11px;padding:9px 10px;margin-bottom:13px}.quick-bar>span{font-size:11px;font-weight:800;color:#66758a;margin-right:3px}
.pledge-list{display:grid;gap:8px}.pledge-row,.conflict-row,.safety-row{border:1px solid var(--line);border-radius:11px;padding:14px 16px}.pledge-row{display:grid;grid-template-columns:minmax(0,1fr) max-content;gap:20px;align-items:start}.pledge-copy{min-width:0}.pledge-row h4,.conflict-row h4,.safety-row h4{margin:0;font-size:12px}.pledge-row p,.conflict-row p,.safety-row p{font-size:11px;color:#657287;margin:4px 0 0}.pledge-row p{max-width:88ch;line-height:1.7;word-break:keep-all;overflow-wrap:break-word}.pledge-controls{min-width:170px;display:flex;flex-direction:column;align-items:flex-end}.choice-set{display:flex;gap:5px;flex-wrap:wrap}.pledge-controls .choice-set,.pledge-controls .extra-choice{justify-content:flex-end}.choice-btn{border:1px solid var(--line);background:#fff;border-radius:8px;padding:6px 9px;font-size:11px;font-weight:750;color:#607086}.choice-btn.active{background:#e9f1ff;border-color:#bfd3ee;color:#255b99}.choice-btn.active.na{background:#f0f2f5;border-color:#d8dde5;color:#687485}.extra-choice{padding-top:8px;margin-top:8px;border-top:1px dashed var(--line);display:flex;gap:6px}.conflict-box,.hazard-box{margin-top:16px;border:1px solid var(--line);border-radius:13px;padding:14px}.conflict-head{display:flex;justify-content:space-between;gap:15px;align-items:flex-start;margin-bottom:10px}.conflict-head h3,.hazard-box h3{font-size:14px;margin:0}.conflict-head p,.hazard-box>p{font-size:11px;color:var(--muted);margin:3px 0 0}.conflict-list{display:grid;gap:8px}.conflict-row{display:grid;grid-template-columns:36px minmax(0,1fr) auto;gap:9px;align-items:center}.conflict-num{width:28px;height:28px;border-radius:8px;background:#f1f4f8;display:grid;place-items:center;font-size:11px;font-weight:850;color:#647287}.auto-badge{font-size:9px;background:#edf2f8;color:#61738b;border-radius:5px;padding:2px 5px;margin-left:5px}
.safety-list{display:grid;gap:8px}.safety-row{display:grid;grid-template-columns:34px minmax(0,1fr) auto;gap:9px;align-items:center}.safety-row .num{width:26px;height:26px;border-radius:8px;background:#f1f4f8;display:grid;place-items:center;font-weight:850;font-size:11px}.hazard-list{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:11px}.hazard-item{border:1px solid var(--line);border-radius:10px;padding:10px;display:flex;justify-content:space-between;align-items:center;gap:8px;font-size:11.5px;font-weight:700}.signature-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:11px}.signature-slot{border:1px solid var(--line);border-radius:12px;padding:12px}.signature-slot h3{font-size:13px;margin:0}.signature-slot>p{font-size:10.5px;color:var(--muted);margin:3px 0 9px}.sig-preview{height:76px;border:1px dashed #cfd7e2;border-radius:10px;background:#fbfcfd;display:grid;place-items:center;overflow:hidden}.sig-preview span{font-size:10px;color:#9aa4b1}.sig-preview img{max-width:92%;max-height:68px;object-fit:contain}.sig-actions{display:flex;gap:5px;margin-top:8px;flex-wrap:wrap}.file-btn{display:inline-flex;align-items:center;cursor:pointer}.app-footer{padding:22px 5px 4px;color:#7a8797;display:flex;justify-content:space-between;gap:18px;font-size:10.5px}.app-footer>div:first-child{display:flex;gap:8px}.app-footer strong{color:#546275}
.preview-dialog,.sign-dialog,.help-dialog{border:0;padding:0;background:transparent}.preview-dialog::backdrop,.sign-dialog::backdrop,.help-dialog::backdrop{background:rgba(15,24,38,.48);backdrop-filter:blur(2px)}.preview-dialog{width:min(1180px,96vw);height:94vh;max-width:none;max-height:none}.preview-toolbar{height:58px;background:#fff;border-radius:14px 14px 0 0;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 14px}.preview-toolbar>div{display:flex;align-items:center;gap:9px}.preview-toolbar span{font-size:11px;color:var(--muted)}.preview-canvas{height:calc(94vh - 58px);overflow:auto;background:#e9edf3;padding:28px 12px}.preview-canvas .print-document{margin:0 auto 24px;box-shadow:0 7px 24px rgba(21,30,45,.13)}
.sign-dialog{width:min(760px,94vw)}.sign-modal,.help-content{background:#fff;border-radius:16px;padding:18px}.sign-modal-head,.help-head{display:flex;justify-content:space-between;align-items:center}.sign-modal-head h2,.help-head h2{font-size:18px;margin:2px 0}#signatureCanvas{display:block;width:100%;height:260px;border:1px solid var(--line);border-radius:12px;background:#fff;margin-top:13px;touch-action:none}.canvas-hint{font-size:11px;color:var(--muted);margin:5px 0}.sign-modal-actions{display:flex;justify-content:flex-end;gap:8px}.help-dialog{width:min(760px,94vw)}.help-grid{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin-top:15px}.help-grid article,.help-source{border:1px solid var(--line);border-radius:11px;padding:12px}.help-grid h3{font-size:12px;margin:0}.help-grid p,.help-source p{font-size:11px;color:var(--muted);margin:4px 0 0}.help-source{margin-top:9px}.help-source strong{font-size:12px}.help-actions{margin-top:12px;display:flex;justify-content:flex-end}#toast{position:fixed;left:50%;bottom:24px;transform:translate(-50%,18px);background:#18253a;color:#fff;padding:10px 14px;border-radius:10px;font-size:11.5px;opacity:0;pointer-events:none;transition:.2s;z-index:100}#toast.show{opacity:1;transform:translate(-50%,0)}
/* printable documents */
#printRoot{display:none}.print-document{width:210mm;min-height:297mm;background:#fff;color:#111;padding:16mm 14mm 14mm;font-family:"Malgun Gothic","Noto Sans KR",sans-serif;font-size:10.5pt;line-height:1.55;position:relative}.print-document h1{text-align:center;font-size:22pt;letter-spacing:.18em;margin:2mm 0 20mm}.print-document h2{text-align:center;font-size:18pt;margin:0 0 10mm}.doc-paragraphs{display:grid;gap:8mm}.doc-paragraph{display:grid;grid-template-columns:8mm 1fr;gap:1mm}.doc-paragraph .n{font-weight:500}.doc-date{text-align:center;margin:22mm 0 20mm}.manual-date{display:inline-flex;align-items:baseline;white-space:nowrap}.manual-date .date-slot{display:inline-block}.manual-date .date-slot.year{width:17mm}.manual-date .date-slot.month,.manual-date .date-slot.day{width:9mm}.doc-bottom{margin-top:auto;width:100%}.print-document.acceptance{display:flex;flex-direction:column}.acceptance .party-info{margin-top:auto;width:100%;font-size:11pt}.party-info .line{display:grid;grid-template-columns:38mm 5mm 1fr;min-height:8mm;align-items:center}.party-info .sig-img{width:20mm;height:15mm;object-fit:contain;vertical-align:middle;margin-left:2mm}.pledge-print{padding:12mm 10mm;font-size:8.6pt;line-height:1.35}.pledge-print h1{font-size:18pt;letter-spacing:0;margin:0 0 6mm}.pledge-meta{width:100%;border-collapse:collapse;margin-bottom:4mm}.pledge-meta td{border:1px solid #333;padding:2.2mm 2.5mm;height:8mm}.pledge-meta td.label{width:28mm;background:#f7f7f7;font-weight:700}.pledge-table{width:100%;border-collapse:collapse;table-layout:fixed}.pledge-table th,.pledge-table td{border:1px solid #333;padding:2mm 2.2mm;vertical-align:top}.pledge-table th{background:#f2f2f2;text-align:center}.pledge-table .num{width:9mm;text-align:center}.pledge-table .cat{width:27mm;text-align:center;font-weight:700;vertical-align:middle}.pledge-table .choices{width:35mm;text-align:center;vertical-align:middle;white-space:nowrap}.boxmark{font-family:Arial,sans-serif;margin:0 1.2mm}.conflict-sub{margin:1.5mm 0;padding-bottom:1.5mm;border-bottom:1px dotted #aaa}.conflict-sub:last-child{border:0}.pledge-footer{text-align:center;margin:7mm 0 4mm}.pledge-sign{text-align:right;margin:4mm 8mm 4mm 0}.pledge-sign img{width:18mm;height:14mm;object-fit:contain;vertical-align:middle}.recipient-line{text-align:center;font-size:11pt;font-weight:700;margin-top:6mm}.appendix-title{text-align:center;font-size:16pt;font-weight:800;margin:0 0 6mm}.appendix-list{padding-left:6mm}.appendix-list p{margin:0 0 3.5mm}.safety-print{padding:11mm 10mm;font-size:8.5pt;line-height:1.28}.safety-print h1{font-size:17pt;letter-spacing:0;margin:0 0 1.5mm}.safety-subtitle{text-align:center;margin-bottom:5mm}.safety-meta{margin-bottom:4mm}.safety-meta .mrow{display:flex;align-items:center;gap:3mm;min-height:7mm}.safety-meta .mrow strong{width:28mm}.safety-meta img{width:18mm;height:12mm;object-fit:contain}.safety-table{width:100%;border-collapse:collapse;table-layout:fixed}.safety-table th,.safety-table td{border:1px solid #333;padding:1.7mm;vertical-align:middle}.safety-table th{background:#f3f3f3;text-align:center}.safety-table .no{width:8mm;text-align:center}.safety-table .result{width:12mm;text-align:center}.hazard-print{width:100%;border-collapse:collapse;margin-top:-1px}.hazard-print td{border:1px solid #333;padding:1.5mm 2mm}.hazard-print td:last-child{width:24mm;text-align:center}.safety-pledge-title{text-align:center;font-size:13pt;font-weight:800;margin:7mm 0 4mm}.safety-pledge-text{border:1px solid #333;padding:5mm;min-height:30mm}.safety-sign{text-align:right;margin-top:6mm;line-height:2.1}.safety-sign img{width:20mm;height:15mm;object-fit:contain;vertical-align:middle}.page-break{break-before:page;page-break-before:always}

/* v0.1.2 layout refinements */
.pledge-row{grid-template-columns:minmax(0,1fr) 220px;gap:24px}
.pledge-controls{width:220px;min-width:0;max-width:100%}
.pledge-controls .choice-set{width:100%;justify-content:flex-end;flex-wrap:nowrap}
.pledge-controls .choice-btn{min-width:50px}
.pledge-controls .choice-btn[data-choice="na"],.conflict-row .choice-btn[data-choice="na"],.safety-row .choice-btn[data-choice="na"]{min-width:72px}
.conflict-row{grid-template-columns:36px minmax(0,1fr) 220px}
.conflict-row .choice-set,.safety-row .choice-set{justify-content:flex-end;flex-wrap:nowrap;max-width:100%}
.signature-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
#signatureCanvas{cursor:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath d='M4 27l2.2-7.1L22.6 3.5a3 3 0 0 1 4.2 0l1.7 1.7a3 3 0 0 1 0 4.2L12.1 25.8z' fill='%23ffffff' stroke='%231f2937' stroke-width='1.7'/%3E%3Cpath d='M6.2 19.9l5.9 5.9L4 27z' fill='%231f2937'/%3E%3Cpath d='M21 5.1l5.9 5.9' stroke='%231f2937' stroke-width='1.7'/%3E%3C/svg%3E") 4 27,crosshair}

/* Safety checklist print proportions: keep the content column dominant, as in the source Excel. */
.safety-table col.col-no{width:9%}.safety-table col.col-content{width:70%}.safety-table col.col-result{width:7%}
.safety-table .no,.safety-table .result{width:auto}
.safety-table td.check-content{line-height:1.34;text-align:left;word-break:keep-all;overflow-wrap:break-word}
.safety-meta .mrow{min-height:7.5mm}
.safety-meta .inspector-name{display:inline-block;min-width:30mm}
.safety-meta .inspector-sign-space{display:inline-flex;align-items:center;justify-content:center;width:20mm;height:12mm;margin-left:2mm}
.safety-meta .inspector-sign-space img{max-width:20mm;max-height:12mm}
.sign-mark{white-space:nowrap}
.safety-sign{margin-top:6mm;line-height:1.4;display:grid;gap:2mm;justify-content:end}
.safety-sign-row{display:grid;grid-template-columns:35mm 58mm 28mm auto;align-items:end;min-height:8mm;text-align:left}
.safety-sign-row:first-child{grid-template-columns:35mm 58mm}
.safety-sign-label{white-space:nowrap}
.handwrite-space{display:inline-block;min-width:58mm;min-height:7mm;padding:0 2mm}
.manager-space{min-width:58mm}
.signature-space{display:inline-flex;align-items:center;justify-content:center;width:28mm;height:14mm;margin-left:2mm}
.signature-space img{max-width:27mm;max-height:13mm}

/* Readable appendix layout, preserving the official wording while separating main clauses and notes. */
.appendix-page{padding:14mm 15mm 13mm;font-size:9.3pt;line-height:1.52}
.appendix-kicker{text-align:center;font-size:9pt;font-weight:800;color:#5a6575;letter-spacing:.05em;margin-top:1mm}
.appendix-page .appendix-title{font-size:18pt;margin:1mm 0 2mm}
.appendix-lead{text-align:center;color:#626c79;font-size:8.5pt;margin-bottom:7mm}
.appendix-list{padding:0}
.appendix-item{display:grid;grid-template-columns:8mm 1fr;gap:1.8mm;padding:3mm 1mm;border-top:1px solid #d9dde4;break-inside:avoid;page-break-inside:avoid}
.appendix-item:last-child{border-bottom:1px solid #d9dde4}
.appendix-num{width:7mm;height:auto;border:0;border-radius:0;display:block;padding-top:.1mm;font-size:9.2pt;font-weight:800;line-height:1.45;text-align:right}
.appendix-main{font-weight:650;word-break:keep-all}
.appendix-note{margin-top:1.5mm;padding:1.8mm 2.4mm;background:#f6f7f9;border-left:2px solid #aeb8c5;color:#505967;font-size:8.5pt;word-break:keep-all}
.appendix-subs{margin:2mm 0 0;padding-left:6mm;display:grid;gap:1mm}
.appendix-subs li{padding-left:1mm;font-size:8.6pt;word-break:keep-all}

@media(max-width:1100px){.doc-cards{grid-template-columns:1fr}.doc-card{min-height:auto}.form-row-three,.signature-grid{grid-template-columns:1fr 1fr}.pledge-row{grid-template-columns:1fr;gap:10px}.pledge-controls{min-width:0;width:100%;align-items:flex-start}.pledge-controls .choice-set,.pledge-controls .extra-choice{justify-content:flex-start}.conflict-row,.safety-row{grid-template-columns:34px minmax(0,1fr)}.conflict-row .choice-set,.safety-row .choice-set{grid-column:2}.app-shell{grid-template-columns:340px minmax(0,1fr)}}
@media(max-width:820px){.topbar{padding:0 15px}.brand-wrap p,.version{display:none}.app-shell{display:block;padding:14px 12px 40px}.sticky-panel{position:static;max-height:none}.workspace{margin-top:12px}.hero-note{align-items:flex-start;flex-direction:column}.hero-note .btn{width:100%}.form-row-three,.signature-grid,.help-grid{grid-template-columns:1fr}.hazard-list{grid-template-columns:1fr}.app-footer{flex-direction:column}.preview-dialog{width:100vw;height:100vh}.preview-canvas{height:calc(100vh - 58px);padding:14px 4px}.preview-canvas .print-document{transform-origin:top center;zoom:.48}.pledge-row{grid-template-columns:1fr}.top-actions .btn{padding:8px 10px}.brand-icon{width:30px;height:30px}.brand-wrap h1{font-size:16px}}
@media print{
  @page{size:A4;margin:0}
  body{background:#fff}.no-print,dialog{display:none!important}#printRoot{display:block!important}.print-document{box-shadow:none!important;margin:0!important;break-after:page;page-break-after:always}.print-document:last-child{break-after:auto;page-break-after:auto}
}


/* v0.1.3 - 행정정보 공동이용 사전동의서 */
.signature-grid{grid-template-columns:1fr}
.consent-summary-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin-top:12px}.consent-summary-grid>div{border:1px solid var(--line);border-radius:10px;padding:11px 12px;background:#fbfcfe}.consent-summary-grid span{display:block;font-size:10px;color:var(--muted);margin-bottom:3px}.consent-summary-grid strong{font-size:12px;overflow-wrap:anywhere}.consent-note{margin-top:10px;padding:10px 12px;border-radius:10px;background:#fff8e8;color:#725a22;font-size:11px;line-height:1.6}
.consent-print{font-family:'Malgun Gothic','Noto Sans KR',sans-serif;color:#111}.consent-print h1{text-align:center;font-size:24px;margin:10px 0 18px}.consent-form-no{font-size:10px;color:#333}.consent-help{font-size:9.5px;margin:0 0 8px;line-height:1.5}.consent-table{width:100%;border-collapse:collapse;font-size:10.5px;table-layout:fixed}.consent-table th,.consent-table td{border:1px solid #222;padding:8px 9px;vertical-align:middle}.consent-table th{width:29%;background:#f3f3f3;text-align:center;line-height:1.5}.consent-table td{line-height:1.55}.consent-info-list{display:flex;gap:18px;flex-wrap:wrap}.consent-body{font-size:10.5px;line-height:1.7;margin-top:12px;text-align:justify}.consent-note-print{font-size:9.5px;line-height:1.6;margin-top:6px}.consent-id-box{margin-top:12px;font-size:10.5px;line-height:1.8}.consent-id-line{display:flex;align-items:center;gap:10px;min-height:28px;margin-left:16px}.consent-id-line strong{font-weight:500}.resident-handwrite{letter-spacing:.08em;white-space:nowrap}.consent-id-line em{font-size:8.5px;color:#666;font-style:normal}.consent-id-guide{font-size:9.2px;margin:3px 0 0 16px}.consent-date{text-align:right;margin-top:22px;font-size:11px;min-height:20px}.consent-person{margin-top:16px;margin-left:auto;width:62%;font-size:10.5px;line-height:2.1}.consent-person>div{display:flex;align-items:center;gap:8px;min-height:26px}.consent-person strong{min-width:90px;font-weight:500}.consent-signature{display:inline-flex;width:72px;height:28px;align-items:center;justify-content:center}.consent-signature img{max-width:72px;max-height:28px}.handwrite-long{display:inline-block;min-width:150px;height:18px}.consent-recipient{margin-top:34px;font-size:12px;font-weight:700}
@media(max-width:760px){.consent-summary-grid{grid-template-columns:1fr}}


/* v0.1.4 - beginner readability, safer reset, one-page safety print */
body{font-size:15px}
label{font-size:14px}.field small{font-size:12px}.brand-wrap h1{font-size:19px}.brand-wrap p{font-size:12px}
.panel-head h2,.editor-head h2,.hero-note h2{font-size:19px}.panel-subhead h3{font-size:16px}
.btn{font-size:14px}.btn.tiny{font-size:13px}.text-btn{font-size:13px}
.doc-title-row h3{font-size:16px}.doc-card>p{font-size:12.5px;line-height:1.6}.status-line{font-size:12px}.card-actions .btn{font-size:12.5px}
.info-banner p{font-size:12.5px;line-height:1.6}.info-banner span{font-size:11px}.pledge-row h4,.conflict-row h4,.safety-row h4{font-size:13px}.pledge-row p,.conflict-row p,.safety-row p{font-size:12px}.choice-btn{font-size:12px;padding:7px 10px}.quick-bar>span{font-size:12px}.hazard-item{font-size:12.5px}
.save-option strong{font-size:13px}.save-option small{font-size:11.5px}.hero-note p:last-child{font-size:13px}
.safety-manager-row{display:grid;grid-template-columns:minmax(280px,520px);margin-bottom:14px}
.consent-birth-field{max-width:360px;margin:12px 0 2px}

/* Help: steps first, sources one item per line */
.help-dialog{width:min(820px,94vw)}.help-content{padding:22px}.help-steps{display:grid;grid-template-columns:repeat(4,1fr);gap:9px;margin-top:16px}.help-steps>div{border:1px solid var(--line);border-radius:12px;padding:12px;background:#fbfcfe;display:flex;gap:9px;align-items:flex-start}.help-steps>div>span{flex:0 0 25px;width:25px;height:25px;border-radius:8px;background:#eaf1fb;color:#255287;display:grid;place-items:center;font-size:12px;font-weight:850}.help-steps p{margin:0;font-size:12px;color:var(--muted);line-height:1.55}.help-steps p strong{display:block;color:var(--text);font-size:12.5px;margin-bottom:2px}.help-grid h3{font-size:13px}.help-grid p,.help-source p{font-size:12px;line-height:1.6}.help-source strong{font-size:13px}.help-source p{margin:7px 0 0;padding-top:7px;border-top:1px solid var(--line2)}.help-source .source-caution{color:#7a5b20;background:#fff8e8;border:0;border-radius:8px;padding:8px 10px;margin-top:9px}.source-note{line-height:1.6;text-align:right}

/* New-contract confirmation */
.confirm-dialog{border:0;padding:0;background:transparent;width:min(440px,92vw)}.confirm-dialog::backdrop{background:rgba(15,24,38,.48);backdrop-filter:blur(2px)}.confirm-content{background:#fff;border-radius:16px;padding:24px;box-shadow:0 18px 60px rgba(16,30,50,.24);text-align:center}.confirm-icon{width:44px;height:44px;border-radius:13px;background:#edf3fb;color:var(--navy);display:grid;place-items:center;font-size:23px;font-weight:800;margin:0 auto 12px}.confirm-content h2{font-size:19px;margin:0}.confirm-content>p{font-size:13px;color:var(--muted);line-height:1.65;margin:8px 0}.confirm-note{font-size:12px;color:#315d49;background:#edf8f2;border-radius:9px;padding:9px 10px;margin:12px 0 17px}.confirm-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}

/* Safety checklist: preserve readable text while fitting one A4 page */
.safety-print{padding:7mm 8mm 6mm;font-size:9pt;line-height:1.2;min-height:297mm}
.safety-print h1{font-size:16.5pt;margin:0 0 .8mm}.safety-subtitle{font-size:8.5pt;margin-bottom:2.5mm}
.safety-meta{margin-bottom:2.5mm}.safety-meta .mrow{min-height:5.5mm;gap:2mm}.safety-meta .mrow strong{width:25mm}.safety-meta .inspector-name{min-width:34mm}.safety-meta .manual-field{display:inline-block;min-width:34mm;height:4.5mm}
.safety-table th,.safety-table td{padding:.95mm 1.2mm}.safety-table td.check-content{line-height:1.24;font-size:8.9pt}.safety-table col.col-no{width:6%}.safety-table col.col-content{width:76%}.safety-table col.col-result{width:6%}
.hazard-print td{padding:.8mm 1.4mm;font-size:8.7pt;line-height:1.2}.hazard-print td:last-child{width:22mm}.safety-pledge-title{font-size:12.5pt;margin:3.2mm 0 2mm}.safety-pledge-text{padding:3mm 3.5mm;min-height:0;font-size:8.9pt;line-height:1.4}.safety-sign{width:118mm;margin:3mm 0 0 auto;display:grid;gap:1.3mm;line-height:1.2}.safety-sign-row{display:grid;grid-template-columns:36mm minmax(42mm,1fr) 28mm 14mm;align-items:center;min-height:8mm;text-align:left}.safety-sign-row:first-child{grid-template-columns:36mm 1fr}.safety-sign-label{font-weight:500}.handwrite-space{min-width:0;min-height:7mm;padding:0 1.5mm;display:flex;align-items:center}.manager-space{min-width:0}.signature-space{width:28mm;height:12mm;margin:0;display:flex;align-items:center;justify-content:center}.signature-space img{max-width:27mm;max-height:11mm;object-fit:contain}.safety-sign .sign-mark{align-self:center}

/* Pledge print: give the long wording more room without shrinking text */
.pledge-print{padding:11mm 9mm;font-size:8.9pt;line-height:1.36}.pledge-table .num{width:8mm}.pledge-table .cat{width:25mm}.pledge-table .choices{width:31mm}.pledge-table th,.pledge-table td{padding:1.8mm 2mm}.pledge-meta td.label{width:26mm}.boxmark{margin:0 .8mm}

/* Consent birth-date output */
.consent-person .handwrite-long.filled{display:none}

@media(max-width:900px){.help-steps{grid-template-columns:1fr 1fr}}
@media(max-width:600px){body{font-size:15px}.help-steps{grid-template-columns:1fr}.help-content{padding:17px}.confirm-content{padding:20px}.source-note{text-align:left}}

/* v0.1.5 - hazard detail forms, date input stability */
.hazard-head{display:flex;justify-content:space-between;align-items:flex-start;gap:14px}.hazard-head>div{min-width:0}.hazard-head h3{margin:0}.hazard-head p{font-size:12px;color:var(--muted);margin:4px 0 0;line-height:1.55}.hazard-item.selected{border-color:#bad0ee;background:#f7faff}.hazard-detail-list{display:grid;gap:12px;margin-top:12px}.hazard-detail-card{border:1px solid #cad7e8;border-radius:13px;background:#fbfdff;padding:14px}.hazard-detail-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:10px}.hazard-detail-head h3{font-size:14px;margin:5px 0 2px}.hazard-detail-head p{font-size:11.5px;color:var(--muted);margin:0}.hazard-question-list{display:grid;gap:7px}.hazard-question-row{display:grid;grid-template-columns:30px minmax(0,1fr) auto;gap:9px;align-items:center;border-top:1px solid #e4eaf2;padding:9px 0}.hazard-question-row:first-child{border-top:0}.hazard-question-row>.num{width:26px;height:26px;border-radius:8px;background:#edf2f8;display:grid;place-items:center;font-size:11px;font-weight:850}.hazard-question-copy{font-size:12px;line-height:1.55;word-break:keep-all;overflow-wrap:break-word}.hazard-detail-note{margin-top:10px;padding:9px 10px;border-radius:9px;background:#f5f7fa;color:#657287;font-size:11px;line-height:1.55}
#representativeBirth{font-variant-numeric:tabular-nums;letter-spacing:.01em}

.hazard-detail-print{padding:10mm 9mm 8mm;font-size:8.8pt;line-height:1.25}.hazard-detail-print h1{font-size:17pt;letter-spacing:0;margin:0 0 1.3mm}.hazard-detail-subtitle{text-align:center;font-size:8.7pt;margin-bottom:4mm}.hazard-detail-meta{display:grid;gap:1.5mm;margin-bottom:3mm}.hazard-detail-meta>div{display:flex;align-items:center;gap:3mm;min-height:6mm}.hazard-detail-meta strong{width:31mm}.hazard-detail-sign{display:inline-flex;width:24mm;height:10mm;align-items:center;justify-content:center}.hazard-detail-sign img{max-width:23mm;max-height:9mm}.hazard-detail-table th,.hazard-detail-table td{padding:1.15mm 1.35mm}.hazard-detail-table td.check-content{font-size:8.7pt;line-height:1.25}.hazard-detail-print-note{margin-top:2mm;font-size:8.4pt;line-height:1.35}

@media(max-width:820px){.hazard-head,.hazard-detail-head{flex-direction:column}.hazard-head .btn,.hazard-detail-head .btn{width:100%}.hazard-question-row{grid-template-columns:30px 1fr}.hazard-question-row .choice-set{grid-column:2;justify-content:flex-start}}


/* v0.1.7 - service-first defaults, balanced 2x2 document grid, print refinements */
.doc-cards{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.doc-card{min-height:196px}
.doc-card>p{min-height:32px}

/* Acceptance editor: keep the three controls on one visual baseline. */
.form-row-three{grid-template-columns:1fr 1fr 1.2fr;align-items:start}
.form-row-three>.field{gap:7px;justify-content:flex-start}
.form-row-three>.field>label{height:22px;display:flex;align-items:center}
.form-row-three .locked-input,
.form-row-three select,
.form-row-three .confirm-chip{height:58px;min-height:58px}
.form-row-three .locked-input{padding:0 14px}
.form-row-three select{padding-top:0;padding-bottom:0}
.form-row-three .confirm-chip{padding:0 14px}
.check-field{justify-content:flex-start}

/* Appendix notes: no gray shaded strips; keep notes readable but document-like. */
.appendix-note{margin-top:1.4mm;padding:0;background:transparent;border-left:0;color:#5a6472;font-size:8.5pt;line-height:1.5}

/* Safety print: move the whole composition down slightly to balance top/bottom white space. */
.safety-print{padding:11mm 8mm 4.5mm;font-size:9pt;line-height:1.2;min-height:297mm}
.safety-print h1{margin:0 0 1.2mm}
.safety-subtitle{margin-bottom:2.8mm}

@media(max-width:1100px){
  .doc-cards{grid-template-columns:1fr}
}


/* v0.2 — 실제 서류를 보면서 작성 */
.doc-cards{grid-template-columns:repeat(2,minmax(0,1fr))}
.editor-card{scroll-margin-top:88px}
.editor-card.doc-active{border-color:#cbd9ec;box-shadow:0 18px 44px rgba(25,63,114,.10)}
.editor-card.doc-hidden{display:none}
.workspace.doc-mode .hero-note,.workspace.doc-mode .doc-cards,.workspace.doc-mode .app-footer{display:none}
.doc-backbar{display:none;align-items:center;justify-content:space-between;gap:12px;margin:0 0 14px;padding:10px 12px;border:1px solid var(--line);border-radius:12px;background:#fff}
.workspace.doc-mode .doc-backbar{display:flex}
.doc-backbar .back-copy{display:flex;align-items:center;gap:10px;min-width:0}.doc-backbar .back-copy strong{font-size:15px}.doc-backbar .back-copy span{font-size:12px;color:var(--muted)}
.editor-split{display:grid;grid-template-columns:minmax(330px,42%) minmax(460px,58%);gap:18px;align-items:start}
.editor-input-pane{min-width:0}
.editor-preview-pane{min-width:0;border-left:1px solid var(--line);padding-left:18px}
.live-preview-shell{position:sticky;top:86px}
.live-preview-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}
.live-preview-head h3{margin:0;font-size:14px}.live-preview-head p{margin:2px 0 0;font-size:11px;color:var(--muted)}
.live-preview-stage{position:relative;overflow:auto;max-height:calc(100vh - 145px);padding:14px;border:1px solid #dce4ef;border-radius:14px;background:#eef2f7;box-shadow:inset 0 0 0 1px rgba(255,255,255,.55)}
.live-preview-stage .print-document{zoom:.66;margin:0 auto 18px!important;box-shadow:0 8px 25px rgba(31,45,67,.10)}
.live-preview-stage .page-break{break-before:auto}
.live-preview-empty{display:grid;place-items:center;min-height:320px;color:var(--muted);font-size:13px;text-align:center}
.live-highlight{outline:4px solid rgba(46,120,210,.20)!important;background-color:rgba(225,238,255,.72)!important;transition:outline-color .2s,background-color .2s}
.live-preview-stage [data-bind]{cursor:pointer}
.live-preview-stage [data-bind]:hover{outline:2px solid rgba(46,120,210,.16)}
.editor-actions{position:sticky;bottom:0;z-index:3;margin-top:18px;padding-top:12px;background:linear-gradient(to bottom,rgba(255,255,255,0),#fff 24%)}
.workspace.doc-mode .collapse-btn{display:none}
.doc-mode-tip{display:inline-flex;align-items:center;gap:6px;font-size:11px;font-weight:700;color:#416a9d;background:#edf4ff;padding:5px 8px;border-radius:999px}

@media(max-width:1180px){.editor-split{grid-template-columns:minmax(300px,46%) minmax(400px,54%)}.live-preview-stage .print-document{zoom:.58}}
@media(max-width:900px){.doc-cards{grid-template-columns:1fr}.editor-split{grid-template-columns:1fr}.editor-preview-pane{order:-1;border-left:0;padding-left:0;border-bottom:1px solid var(--line);padding-bottom:16px}.live-preview-shell{position:relative;top:auto}.live-preview-stage{max-height:46vh}.live-preview-stage .print-document{zoom:.52}.workspace.doc-mode .editor-card{margin-top:0}}
@media(max-width:560px){.live-preview-stage{padding:8px}.live-preview-stage .print-document{zoom:.43}.doc-backbar{align-items:flex-start;flex-direction:column}}

/* v0.2.1 — lighter main screen, compact input, accordion pledge editor */
.sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}

/* Main screen: keep document editors out of the way until one is opened. */
.workspace:not(.doc-mode) > .editor-card{display:none}
.workspace.doc-mode .doc-list{display:none}
.workspace.doc-mode .compact-hero{display:none}

/* Common information can collapse to a concise summary. */
.common-section{margin-top:12px;border:1px solid var(--line2);border-radius:12px;background:#fbfcfe;overflow:hidden}
.common-section>summary{list-style:none;cursor:pointer;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:11px 12px;background:#f8fafc;user-select:none}
.common-section>summary::-webkit-details-marker{display:none}
.common-section>summary>span:first-child{display:flex;flex-direction:column;min-width:0;gap:2px}.common-section>summary strong{font-size:13px;color:var(--ink)}.common-section>summary small{font-size:10.5px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:285px}
.common-section .summary-chevron{font-size:15px;color:#7d8ba0;transition:transform .18s}.common-section[open] .summary-chevron{transform:rotate(180deg)}
.common-section-body{padding:12px}.first-field{margin-top:0}.compact-fields{margin-top:10px}.compact-fields .field{gap:5px}.compact-fields .field label{font-size:11px}.compact-fields input,.compact-fields select{min-height:42px;padding:9px 10px}.compact-fields small{font-size:9.5px;line-height:1.4}

/* Stable text-date input with a separate calendar helper. */
.date-control{position:relative;display:flex;align-items:center}.date-control .date-text{width:100%;padding-right:42px;font-variant-numeric:tabular-nums;letter-spacing:.01em}.date-control .date-text.invalid{border-color:#d76d6d;background:#fffafa}.calendar-btn{position:absolute;right:4px;top:4px;width:34px;height:34px;border:0;border-radius:8px;background:transparent;color:#53657d;font-size:17px;cursor:pointer}.calendar-btn:hover{background:#edf3fb;color:#244f82}.native-date-picker{position:absolute;right:0;top:0;width:1px;height:1px;opacity:0;pointer-events:none}

/* Document chooser: compact list instead of large cards. */
.compact-hero{padding:15px 17px;margin-bottom:10px}.compact-hero h2{font-size:17px}.compact-hero p:last-child{font-size:11.5px}
.doc-list{display:grid;gap:7px;margin-bottom:14px}.doc-list-row{display:grid;grid-template-columns:24px 34px minmax(0,1fr) max-content 72px;align-items:center;gap:10px;padding:10px 12px;border:1px solid var(--line);border-radius:12px;background:#fff;box-shadow:0 4px 16px rgba(35,58,88,.035);transition:border-color .15s,box-shadow .15s}.doc-list-row:hover{border-color:#cdd9e9;box-shadow:0 7px 20px rgba(35,58,88,.06)}.doc-list-select{display:grid;place-items:center}.doc-list-select input{width:16px;height:16px;accent-color:#2c6fc0}.doc-list-num{font-size:11px;font-weight:850;color:#52729a}.doc-list-copy{min-width:0}.doc-list-title{display:flex;align-items:center;gap:7px}.doc-list-title h3{margin:0;font-size:14px;letter-spacing:-.15px}.doc-list-copy p{margin:3px 0 0;font-size:11px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.doc-list-row .status-line{margin:0;white-space:nowrap;font-size:10.5px}.doc-list-row>.btn{padding:7px 11px;font-size:11px}

/* Writing mode: more room for the actual A4 document. */
.editor-split{grid-template-columns:minmax(300px,40%) minmax(500px,60%);gap:16px}.editor-preview-pane{padding-left:16px}.live-preview-stage{padding:12px}.live-preview-stage .print-document{zoom:.69}
.workspace.doc-mode .form-row-three{grid-template-columns:1fr;gap:10px}.workspace.doc-mode .form-row-three>.field>label{height:auto}.workspace.doc-mode .form-row-three .locked-input,.workspace.doc-mode .form-row-three select,.workspace.doc-mode .form-row-three .confirm-chip{height:48px;min-height:48px}.workspace.doc-mode .info-banner{padding:8px 10px;margin-bottom:10px}.workspace.doc-mode .info-banner p{font-size:11.5px;line-height:1.5}.workspace.doc-mode .editor-head{padding:13px 16px}.workspace.doc-mode .editor-body{padding:14px 16px}

/* Pledge editor: four accordion groups, concise left-side prompts. */
.compact-quick{padding:7px 8px;margin-bottom:9px}.pledge-accordion{display:grid;gap:7px}.pledge-group{border:1px solid var(--line);border-radius:11px;background:#fff;overflow:hidden}.pledge-group>summary{list-style:none;cursor:pointer;display:flex;align-items:center;justify-content:space-between;gap:10px;padding:11px 12px;font-weight:800;color:var(--ink);background:#fbfcfe}.pledge-group>summary::-webkit-details-marker{display:none}.group-status{display:flex;align-items:center;gap:6px;font-size:10.5px;font-weight:700;color:#69788b;white-space:nowrap}.pledge-group-body{padding:5px 10px 9px;border-top:1px solid var(--line2)}
.compact-pledge-row{border:0;border-radius:0;padding:10px 2px;grid-template-columns:minmax(0,1fr) max-content;gap:12px;border-top:1px solid var(--line2)}.compact-pledge-row:first-child{border-top:0}.compact-pledge-row h4{font-size:12.5px}.compact-pledge-row p{font-size:11px;line-height:1.45;margin-top:3px;max-width:50ch}.compact-pledge-row .pledge-controls{width:auto;min-width:0}.compact-pledge-row .choice-btn{min-height:40px;padding:6px 9px}.compact-extra{padding-top:5px;margin-top:5px}.accordion-intro{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 2px}.accordion-intro p{margin:0;font-size:10.8px;color:var(--muted);line-height:1.5}.compact-conflict-list{gap:0}.compact-conflict-row{border:0;border-radius:0;padding:9px 2px;grid-template-columns:28px minmax(0,1fr) auto;border-top:1px solid var(--line2)}.compact-conflict-row:first-child{border-top:0}.compact-conflict-row .conflict-num{width:24px;height:24px;font-size:10px}.compact-conflict-row h4{font-size:11.3px;line-height:1.45;font-weight:700}.compact-conflict-row .choice-btn{min-height:38px;padding:5px 8px}.auto-badge{vertical-align:1px}

/* Safety editor: row form rather than card stack. */
.safety-list{gap:0;border:1px solid var(--line);border-radius:11px;overflow:hidden}.safety-row{border:0;border-radius:0;padding:9px 10px;grid-template-columns:28px minmax(0,1fr) auto;border-top:1px solid var(--line2)}.safety-row:first-child{border-top:0}.safety-row .num{width:23px;height:23px;font-size:10px}.safety-row h4{font-size:11.4px;line-height:1.45;font-weight:700}.safety-row .choice-btn{min-height:38px;padding:5px 8px}.hazard-box{padding:11px;margin-top:12px}.hazard-list{grid-template-columns:1fr;gap:5px}.hazard-item{padding:8px 9px;font-size:11.5px}.quick-bar{padding:7px 8px;margin-bottom:9px}

/* Keep the back bar concise. */
.doc-backbar{padding:8px 10px}.doc-mode-tip{font-size:10.5px}.doc-backbar .back-copy strong{font-size:14px}

@media(max-width:1180px){.editor-split{grid-template-columns:minmax(285px,43%) minmax(430px,57%)}.live-preview-stage .print-document{zoom:.60}.doc-list-row{grid-template-columns:24px 32px minmax(0,1fr) 72px}.doc-list-row .status-line{grid-column:3/4}.doc-list-row>.btn{grid-column:4;grid-row:1/3}}
@media(max-width:900px){.doc-list-row{grid-template-columns:24px 30px minmax(0,1fr) 64px}.doc-list-copy p{white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.doc-list-row .status-line{grid-column:3/4}.compact-pledge-row,.compact-conflict-row,.safety-row{grid-template-columns:28px minmax(0,1fr)}.compact-pledge-row .pledge-controls,.compact-conflict-row .choice-set,.safety-row .choice-set{grid-column:2;justify-content:flex-start}.accordion-intro{align-items:flex-start;flex-direction:column}.editor-preview-pane{order:-1}.live-preview-stage{max-height:44vh}}
@media(max-width:600px){.doc-list-row{grid-template-columns:22px 28px minmax(0,1fr)}.doc-list-row>.btn{grid-column:3;grid-row:auto;width:100%}.doc-list-row .status-line{grid-column:3}.compact-hero .btn{width:100%}.common-section>summary small{max-width:230px}.date-grid{grid-template-columns:1fr}.date-grid .full{grid-column:auto}}
input.invalid{border-color:#d76d6d!important;background:#fffafa!important}
@media(max-width:900px){
  .editor-split{grid-template-columns:1fr!important;display:grid}
  .editor-input-pane{min-width:0;overflow:visible}
  .editor-preview-pane{order:-1!important;border-left:0!important;padding-left:0!important;border-bottom:1px solid var(--line);padding-bottom:14px;margin-bottom:4px;min-width:0}
  .live-preview-shell{position:relative!important;top:auto!important;min-width:0}
  .live-preview-stage{width:100%;max-width:100%;overflow:auto;box-sizing:border-box}
  .live-preview-stage .print-document{zoom:.43!important}
}
@media(max-width:480px){.live-preview-stage .print-document{zoom:.39!important}}
@media(max-width:900px){
  .app-shell.document-focus .sidebar{display:none}
  .app-shell.document-focus .workspace{margin-top:0}
  .compact-pledge-row{grid-template-columns:1fr!important}
  .compact-pledge-row .pledge-controls{grid-column:1!important;align-items:flex-start;width:100%}
  .compact-pledge-row .pledge-controls .choice-set,.compact-pledge-row .pledge-controls .extra-choice{justify-content:flex-start}
  .compact-conflict-row,.safety-row{grid-template-columns:28px minmax(0,1fr)!important}
  .compact-conflict-row .choice-set,.safety-row .choice-set{grid-column:2!important;justify-content:flex-start}
}

/* v0.2.2 — 목록 자체가 작성 흐름이 되도록 전환 */
.app-shell{max-width:1720px;grid-template-columns:340px minmax(0,1fr)}
.inline-workbench{display:grid;grid-template-columns:minmax(560px,58%) minmax(430px,42%);gap:16px;align-items:start}
.inline-flow-column{min-width:0}
.inline-doc-section{margin:0 0 12px;scroll-margin-top:88px}
.inline-doc-section .doc-list-row{grid-template-columns:24px 34px minmax(0,1fr) max-content;border-radius:14px 14px 0 0;box-shadow:none;padding:10px 12px;background:#fff;cursor:default}
.inline-doc-section .doc-list-row .status-line{margin:0;white-space:nowrap}
.inline-doc-section .doc-list-row:hover{box-shadow:none}
.inline-doc-section .inline-editor{display:block!important;margin-top:-1px;border-radius:0 0 14px 14px;box-shadow:none;border-color:var(--line);overflow:visible}
.inline-doc-section .inline-editor .editor-head{display:none!important}
.inline-doc-section .inline-editor .editor-body{display:block!important;padding:12px 13px 14px}
.inline-doc-section .inline-editor .editor-actions{display:none!important}
.inline-doc-section.is-active>.doc-list-row{border-color:#b9cee9;background:#fbfdff}
.inline-doc-section.is-active>.inline-editor{border-color:#b9cee9;box-shadow:0 8px 24px rgba(39,82,135,.055)}
.inline-doc-section.is-active .doc-list-num{color:#235f9f}
.inline-doc-section[data-doc="acceptance"] .info-banner.law{margin-bottom:9px}
.inline-doc-section[data-doc="acceptance"] .info-banner.warn{margin-top:9px;margin-bottom:0}
.inline-doc-section[data-doc="acceptance"] .form-row-three{gap:8px}
.inline-doc-section[data-doc="consent"] .info-banner{margin-bottom:8px}
.inline-doc-section[data-doc="consent"] .consent-note{margin-bottom:0}
.inline-signature{display:block!important;margin-top:2px;box-shadow:none}
.inline-signature .editor-body{display:block!important}

.shared-preview-pane{min-width:0}
.shared-preview-shell{position:sticky;top:88px}
.shared-preview-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:8px;padding:11px 12px;border:1px solid var(--line);border-radius:13px;background:#fff}
.shared-preview-head h3{margin:1px 0 0;font-size:15px}.shared-preview-head p{margin:3px 0 0;font-size:10.5px;color:var(--muted)}
.shared-preview-actions{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}
.shared-preview-pane .live-preview-stage{max-height:calc(100vh - 162px);padding:12px;border-radius:14px}
.shared-preview-pane .live-preview-stage .print-document{zoom:.62;margin:0 auto 18px!important;box-shadow:0 8px 26px rgba(31,45,67,.11)}

.flow-printbar{position:sticky;bottom:10px;z-index:12;display:flex;align-items:center;justify-content:space-between;gap:12px;margin:14px 0;padding:9px 10px 9px 13px;border:1px solid #d6e0ee;border-radius:13px;background:rgba(255,255,255,.94);box-shadow:0 10px 30px rgba(32,51,80,.10);backdrop-filter:blur(12px)}
.flow-printbar>span{font-size:11.5px;font-weight:800;color:#586b83}.flow-printbar>div{display:flex;gap:7px}

/* 이전의 화면 전환형 작성 UX는 사용하지 않는다. */
.doc-backbar{display:none!important}.workspace.doc-mode .doc-list,.workspace.doc-mode .compact-hero{display:block}.workspace.doc-mode .hero-note{display:flex}.workspace.doc-mode .app-footer{display:flex}
.workspace:not(.doc-mode) > .editor-card{display:none}

@media(max-width:1280px){
  .app-shell{grid-template-columns:320px minmax(0,1fr)}
  .inline-workbench{grid-template-columns:minmax(500px,57%) minmax(390px,43%)}
  .shared-preview-pane .live-preview-stage .print-document{zoom:.55}
  .inline-doc-section .doc-list-row{grid-template-columns:22px 30px minmax(0,1fr)}
  .inline-doc-section .doc-list-row .status-line{grid-column:3}
}
@media(max-width:1020px){
  .inline-workbench{grid-template-columns:1fr}
  .shared-preview-pane{order:-1}
  .shared-preview-shell{position:relative;top:auto}
  .shared-preview-pane .live-preview-stage{max-height:48vh}
  .shared-preview-pane .live-preview-stage .print-document{zoom:.56}
}
@media(max-width:900px){
  .app-shell{grid-template-columns:1fr}
  .sticky-panel{position:relative;top:auto;max-height:none}
  .inline-doc-section .doc-list-row{grid-template-columns:22px 28px minmax(0,1fr)}
  .inline-doc-section .doc-list-row .status-line{grid-column:3}
  .shared-preview-actions{width:100%;justify-content:flex-start}
  .shared-preview-head{flex-wrap:wrap}
}
@media(max-width:600px){
  .inline-doc-section .doc-list-row{padding:9px 10px}
  .inline-doc-section .inline-editor .editor-body{padding:10px}
  .inline-doc-section[data-doc="acceptance"] .form-row-three{grid-template-columns:1fr}
  .flow-printbar{align-items:stretch;flex-direction:column;bottom:6px}.flow-printbar>div{display:grid;grid-template-columns:1fr 1fr}.flow-printbar .btn{width:100%}
  .shared-preview-pane .live-preview-stage .print-document{zoom:.43}
}

/* v0.2.3 — 왼쪽은 실제 서류, 오른쪽은 작성. */
.app-shell{max-width:1860px;grid-template-columns:330px minmax(0,1fr);gap:18px}.workspace{min-width:0}
.v023-workbench{display:grid;grid-template-columns:minmax(470px,44%) minmax(620px,56%);gap:18px;align-items:start}.v023-preview-pane{min-width:0;grid-column:1;position:sticky;top:88px;align-self:start;height:calc(100vh - 108px)}.v023-flow-column{min-width:0;grid-column:2}
.v023-preview-pane .shared-preview-shell{position:relative;top:auto;height:100%;display:flex;flex-direction:column}.v023-preview-pane .shared-preview-head{padding:10px 11px;margin-bottom:8px;border-radius:12px}.v023-preview-pane .shared-preview-head h3{font-size:16px}.v023-preview-pane .live-preview-stage{flex:1;min-height:0;max-height:none;padding:12px;background:#eef2f7}.v023-preview-pane .live-preview-stage .print-document{zoom:.64;margin:0 auto 18px!important}.preview-doc-select{width:auto;min-width:168px;height:35px;padding:5px 30px 5px 9px;border-radius:8px;font-size:11px;font-weight:750;color:#465a74;background:#fff}
.doc-choice-bar{margin-bottom:14px;padding:12px 13px;border:1px solid var(--line);border-radius:13px;background:#fff;box-shadow:0 4px 16px rgba(35,58,88,.035)}.doc-choice-head{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;margin-bottom:9px}.doc-choice-head>div{display:flex;flex-direction:column;gap:2px}.doc-choice-head strong{font-size:14px}.doc-choice-head>#selectedDocCount{font-size:10.5px;font-weight:800;color:#65758a}.doc-choice-list{display:grid;grid-template-columns:1fr 1fr;gap:6px}.doc-choice-chip{display:grid;grid-template-columns:20px 24px minmax(0,1fr);align-items:center;gap:7px;min-width:0;padding:8px 9px;border:1px solid var(--line2);border-radius:10px;background:#fafbfd;cursor:pointer;transition:.15s}.doc-choice-chip:hover{border-color:#ccd9e9;background:#f7faff}.doc-choice-chip.is-selected{border-color:#c9daee;background:#f5f9ff}.doc-choice-chip input{width:15px;height:15px;accent-color:#2c6fc0}.chip-num{font-size:10px;font-weight:850;color:#58789e}.chip-copy{min-width:0;display:flex;flex-direction:column;gap:1px}.chip-copy strong{font-size:11.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.chip-copy small{font-size:9.5px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.v023-doc-section{margin:0 0 28px;scroll-margin-top:92px;border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important}.v023-doc-section.doc-unselected{display:none!important}.v023-section-head{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:0 2px 10px;border-bottom:2px solid #dce5f0}.v023-title-wrap{display:flex;align-items:center;gap:10px;min-width:0}.v023-doc-num{display:grid;place-items:center;width:27px;height:27px;border-radius:8px;background:#edf3fa;color:#315e91;font-size:10px;font-weight:900;flex:0 0 auto}.v023-title-wrap h2{margin:0;font-size:17px;letter-spacing:-.25px}.v023-title-wrap p{margin:2px 0 0;font-size:10.5px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:48ch}.v023-status-slot .status-line{margin:0;font-size:10.5px;white-space:nowrap}.v023-doc-section>.inline-editor{display:block!important;margin:0;border:0!important;border-radius:0!important;box-shadow:none!important;background:transparent!important;overflow:visible}.v023-doc-section>.inline-editor>.editor-head{display:none!important}.v023-doc-section>.inline-editor>.editor-body{display:block!important;padding:14px 2px 0!important}.v023-doc-section.is-active .v023-section-head{border-bottom-color:#8fb2da}.v023-doc-section.is-active .v023-doc-num{background:#e3efff;color:#215d9f}
.v023-doc-section[data-doc="acceptance"] .form-row-three{grid-template-columns:1fr 1fr 1.15fr;gap:9px}.v023-doc-section[data-doc="acceptance"] .form-row-three>.field>label{min-height:20px;display:flex;align-items:end}.v023-doc-section[data-doc="acceptance"] .locked-input,.v023-doc-section[data-doc="acceptance"] select,.v023-doc-section[data-doc="acceptance"] .confirm-chip{height:46px;min-height:46px}.v023-doc-section[data-doc="acceptance"] .info-banner.law{margin-bottom:10px}.v023-doc-section[data-doc="acceptance"] .info-banner.warn{margin:9px 0 0}
.pledge-accordion{display:block!important}.pledge-flat-group{margin:0;border:0;background:#fff}.pledge-flat-group+.pledge-flat-group{margin-top:18px;padding-top:18px;border-top:1px solid #dfe6ef}.pledge-flat-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:0 0 8px;border-bottom:1px solid var(--line2)}.pledge-flat-head h3{margin:0;font-size:14px}.pledge-flat-head .group-status{font-size:10px}.pledge-flat-group .pledge-group-body{padding:0;border:0}.pledge-flat-group .compact-pledge-row{padding:11px 1px;border-top:1px solid var(--line2);grid-template-columns:minmax(0,1fr) max-content;gap:14px;background:#fff}.pledge-flat-group .compact-pledge-row:first-child{border-top:0}.pledge-flat-group .compact-pledge-row h4{font-size:12.5px}.pledge-flat-group .compact-pledge-row p{font-size:10.7px;line-height:1.42;max-width:58ch;color:#728095}.pledge-flat-group .pledge-controls{align-items:flex-end}.pledge-flat-group .choice-btn{min-height:40px;padding:6px 9px}.flat-group-tools{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:9px 1px;border-bottom:1px solid var(--line2)}.flat-group-tools p{margin:0;font-size:10.5px;color:var(--muted)}.flat-group-tools>div{display:flex;gap:5px;flex-wrap:wrap}.pledge-flat-group .compact-conflict-row{padding:9px 1px;border-top:1px solid var(--line2);grid-template-columns:26px minmax(0,1fr) auto}.pledge-flat-group .compact-conflict-row:first-child{border-top:0}.pledge-flat-group .compact-conflict-row h4{font-size:11.2px;font-weight:700}.pledge-flat-group .compact-conflict-row .choice-btn{min-height:38px;padding:5px 8px}
.v023-signature{margin:0 0 82px!important;border:1px solid var(--line)!important;border-radius:13px!important;box-shadow:none!important}.v023-signature .editor-head{display:flex!important;padding:12px 14px}.v023-signature .editor-body{padding:12px 14px!important}.v023-printbar{position:sticky;bottom:10px;z-index:14;margin:0 0 14px;padding:9px 10px 9px 12px;background:rgba(255,255,255,.96)}.v023-printbar .printbar-current{display:flex;flex-direction:column}.v023-printbar .printbar-current span{font-size:9.5px;color:#7b899c;font-weight:750}.v023-printbar .printbar-current strong{font-size:11.5px;color:#334b69}.v023-printbar>div:last-child{display:flex;gap:6px}.v023-printbar .btn{padding:8px 10px;font-size:11px}
.inline-workbench{display:none!important}.inline-flow-column{display:none!important}
@media(max-width:1450px){.app-shell{grid-template-columns:310px minmax(0,1fr);padding-left:18px;padding-right:18px}.v023-workbench{grid-template-columns:minmax(420px,43%) minmax(560px,57%);gap:14px}.v023-preview-pane .live-preview-stage .print-document{zoom:.57}.doc-choice-list{grid-template-columns:1fr}.chip-copy small{display:none}}
@media(max-width:1120px){.app-shell{grid-template-columns:290px minmax(0,1fr)}.v023-workbench{grid-template-columns:minmax(380px,42%) minmax(500px,58%)}.v023-preview-pane .live-preview-stage .print-document{zoom:.51}.v023-doc-section[data-doc="acceptance"] .form-row-three{grid-template-columns:1fr}}
@media(max-width:860px){.app-shell{grid-template-columns:1fr}.sticky-panel{position:relative;top:auto;max-height:none}.v023-workbench{grid-template-columns:1fr}.v023-preview-pane,.v023-flow-column{grid-column:1}.v023-preview-pane{order:-1;position:relative;top:auto;height:auto}.v023-preview-pane .shared-preview-shell{position:relative;top:auto;height:auto;display:block}.v023-preview-pane .live-preview-stage{max-height:42vh}.v023-preview-pane .live-preview-stage .print-document{zoom:.55}.doc-choice-list{grid-template-columns:1fr 1fr}.chip-copy small{display:block}}
@media(max-width:640px){.doc-choice-list{grid-template-columns:1fr}.chip-copy small{display:none}.shared-preview-head{align-items:flex-start;flex-direction:column}.shared-preview-actions{width:100%}.preview-doc-select{flex:1;min-width:0}.v023-preview-pane .live-preview-stage{max-height:38vh;padding:8px}.v023-preview-pane .live-preview-stage .print-document{zoom:.42}.v023-section-head{align-items:flex-start}.v023-title-wrap p{white-space:normal}.v023-status-slot{display:none}.pledge-flat-group .compact-pledge-row{grid-template-columns:1fr}.pledge-flat-group .pledge-controls{align-items:flex-start}.pledge-flat-group .compact-conflict-row{grid-template-columns:24px minmax(0,1fr)}.pledge-flat-group .compact-conflict-row .choice-set{grid-column:2}.flat-group-tools{align-items:flex-start;flex-direction:column}.v023-printbar{align-items:stretch;flex-direction:column}.v023-printbar>div:last-child{display:grid;grid-template-columns:1fr 1fr}.v023-printbar #flowPreviewAll{display:none}.v023-printbar .btn{width:100%}}

/* v0.2.3 출력 액션은 오른쪽에서 항상 접근 가능 */
@media(min-width:861px){.v023-printbar{position:fixed;right:24px;bottom:14px;width:clamp(590px,48vw,790px);z-index:30;box-shadow:0 12px 34px rgba(28,45,70,.16)}.v023-flow-column{padding-bottom:86px}}
@media(max-width:860px){.v023-printbar{position:sticky;bottom:8px}}


/* v0.2.4 — preview stays visible while the right writing column scrolls */
@media(min-width:861px){
  .v023-workbench{align-items:start}
  .v023-preview-pane{position:sticky;top:88px;align-self:start;height:calc(100vh - 108px);overflow:hidden}
  .v023-preview-pane .shared-preview-shell{position:relative;top:auto;height:100%;display:flex;flex-direction:column}
  .v023-preview-pane .live-preview-stage{flex:1;min-height:0;max-height:none;overflow:auto}
}
@media(max-width:860px){
  .v023-preview-pane{position:relative;top:auto;height:auto;overflow:visible}
  .v023-preview-pane .shared-preview-shell{height:auto;display:block}
}


/* v0.2.5 — quick actions are neutral; selected blue is reserved for actual choices */
.quick-bar .btn.tiny,
.flat-group-tools .btn.tiny,
.hazard-head .btn.tiny,
.hazard-detail-head .btn.tiny{
  background:#fff;
  border-color:var(--line);
  color:#4f5f74;
  box-shadow:none;
}
.quick-bar .btn.tiny:hover,
.flat-group-tools .btn.tiny:hover,
.hazard-head .btn.tiny:hover,
.hazard-detail-head .btn.tiny:hover{
  background:#f7faff;
  border-color:#c9d7e8;
  color:#315d91;
}
.quick-bar .btn.tiny:active,
.flat-group-tools .btn.tiny:active,
.hazard-head .btn.tiny:active,
.hazard-detail-head .btn.tiny:active{
  background:#eef4fc;
  transform:translateY(0);
}

/* Acceptance: pixel-aligned confirmation row */
.v023-doc-section[data-doc="acceptance"] .confirm-chip{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:10px;
  width:100%;
  padding:0 14px;
  line-height:1.2;
}
.v023-doc-section[data-doc="acceptance"] .confirm-chip input[type="checkbox"]{
  width:16px;
  height:16px;
  min-width:16px;
  margin:0;
  padding:0;
  flex:0 0 16px;
  align-self:center;
  vertical-align:middle;
}
.v023-doc-section[data-doc="acceptance"] .confirm-chip span{
  display:flex;
  align-items:center;
  flex:1 1 auto;
  min-height:100%;
  margin:0;
  padding:0;
  line-height:1.2;
  transform:translateY(-1px);
}


/* v0.2.6 — hazard applicability table: fixed grid and pixel-aligned O/X column */
.hazard-print{
  width:100%;
  border-collapse:collapse;
  table-layout:fixed;
  margin-top:-1px;
}
.hazard-print col.hazard-name-col{width:auto}
.hazard-print col.hazard-check-col{width:22mm}
.hazard-print th,
.hazard-print td{
  border:1px solid #333;
  box-sizing:border-box;
  vertical-align:middle;
}
.hazard-print th{
  padding:.8mm 1.4mm;
  background:#f3f3f3;
  font-weight:700;
  text-align:center;
  line-height:1.15;
}
.hazard-print th:first-child{text-align:left}
.hazard-check-head{
  display:flex;
  min-height:7.2mm;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:.25mm;
  white-space:nowrap;
}
.hazard-check-head>span{font-size:.92em;font-weight:600}
.hazard-print tbody tr:not(.hazard-note-row){height:6.4mm}
.hazard-print tbody tr:not(.hazard-note-row)>td{
  padding:.75mm 1.4mm;
  line-height:1.15;
}
.hazard-print tbody tr:not(.hazard-note-row)>td:first-child{
  text-align:left;
  white-space:nowrap;
}
.hazard-print tbody tr:not(.hazard-note-row)>td:last-child{
  width:22mm;
  padding:0;
  text-align:center;
  vertical-align:middle;
  font-family:Arial,"Malgun Gothic",sans-serif;
  font-size:10pt;
  line-height:1;
}
.hazard-note-row td{
  padding:.8mm 1.4mm;
  text-align:center;
  line-height:1.22;
}
