:root{
  --blue:#2563eb;--blue-dark:#1d4ed8;--blue-soft:#eff6ff;--ink:#172033;
  --muted:#68758a;--line:#dce3ec;--line-strong:#cbd5e1;--bg:#f4f7fb;
  --card:#ffffff;--danger:#dc2626;--shadow:0 12px 34px rgba(15,23,42,.08);
}
*{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,"Segoe UI",Roboto,Arial,sans-serif}
button,input,select,textarea{font:inherit}
button{cursor:pointer}
.appbar{position:sticky;top:0;z-index:30;background:#fff;border-top:5px solid var(--blue);border-bottom:1px solid #e8edf3}
.appbar__inner{max-width:1600px;margin:auto;height:76px;padding:0 32px;display:flex;align-items:center;justify-content:space-between}
.brand{display:flex;align-items:center;gap:14px;color:var(--ink);font-weight:800;font-size:22px;text-decoration:none}
.brand__icon{width:44px;height:44px;border-radius:12px;display:grid;place-items:center;background:linear-gradient(135deg,#3b82f6,#1d4ed8);color:#fff;box-shadow:0 8px 18px rgba(37,99,235,.28)}
.help-button{display:flex;align-items:center;gap:9px;border:0;background:transparent;color:var(--blue);font-weight:700;padding:10px 12px;border-radius:10px}
.help-button:hover{background:var(--blue-soft)}
.help-button span{width:22px;height:22px;border:2px solid currentColor;border-radius:50%;display:grid;place-items:center;font-size:13px}
.page{max-width:1600px;margin:auto;padding:18px 32px 32px}
.workspace{display:grid;grid-template-columns:minmax(510px,.98fr) minmax(620px,1.02fr);gap:28px;align-items:start}
.card{background:var(--card);border:1px solid #e4e9f0;border-radius:18px;box-shadow:var(--shadow);overflow:hidden}
.editor-card{position:sticky;top:96px}
.card__body{padding:30px}
.step-title-row{display:flex;justify-content:space-between;gap:18px;align-items:flex-start;margin-bottom:22px}
.eyebrow{margin:0 0 4px;color:var(--blue);font-size:12px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}
.step-title-row h1{font-size:24px;line-height:1.2;margin:0}
.autosave-status{font-size:12px;color:#18794e;background:#ecfdf3;border:1px solid #bbf7d0;border-radius:999px;padding:6px 10px;white-space:nowrap}
.stepper{display:grid;grid-template-columns:repeat(4,1fr);position:relative;margin:0 10px 26px}
.stepper::before{content:"";position:absolute;height:3px;left:8%;right:8%;top:16px;background:#dce3ec;z-index:0}
.step{position:relative;z-index:1;text-align:center;border:0;background:transparent;color:#475569;padding:0 4px}
.step__dot{width:34px;height:34px;border-radius:50%;margin:0 auto 9px;display:grid;place-items:center;background:#e7ecf3;color:#475569;border:4px solid #fff;box-shadow:0 0 0 1px #d7dee8;font-weight:800}
.step__label{font-size:13px;font-weight:700;white-space:nowrap}
.step.active .step__dot,.step.done .step__dot{background:var(--blue);color:#fff;box-shadow:0 0 0 1px var(--blue)}
.step.active{color:var(--blue)}
.step.done::after{content:"";position:absolute;height:3px;left:58%;right:-42%;top:16px;background:var(--blue);z-index:-1}
.guide{border:0;background:#f3f6fa;border-radius:12px;margin-bottom:26px;overflow:hidden}
.guide summary{list-style:none;display:flex;align-items:center;gap:11px;padding:15px 17px;font-weight:750;cursor:pointer}
.guide summary::-webkit-details-marker{display:none}
.guide__icon{color:var(--blue);font-size:20px}.guide__chevron{margin-left:auto;transition:.2s}.guide[open] .guide__chevron{transform:rotate(180deg)}
.guide__content{padding:0 17px 16px;color:var(--muted);font-size:14px;line-height:1.65}
.section-heading{display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line);padding-bottom:12px;margin-bottom:18px}
.section-heading h2{margin:0;font-size:20px}.section-heading p{margin:0;color:var(--muted);font-size:12px}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px 18px}
.field{min-width:0}.field--full{grid-column:1/-1}
.field label{display:block;margin-bottom:7px;color:#344256;font-size:13px;font-weight:750}
.field__hint{font-size:11px;color:var(--muted);margin-top:6px}
.control{width:100%;border:1px solid var(--line-strong);border-radius:10px;background:#fff;color:var(--ink);padding:11px 13px;outline:none;transition:.18s}
.control:hover{border-color:#aab6c5}.control:focus{border-color:var(--blue);box-shadow:0 0 0 3px rgba(37,99,235,.12)}
textarea.control{min-height:118px;resize:vertical;line-height:1.55}
.upload-box{display:block;border:2px dashed #cbd5e1;border-radius:12px;padding:22px 18px;text-align:center;background:#fbfdff;transition:.2s;cursor:pointer}
.upload-box:hover,.upload-box.drag{border-color:var(--blue);background:var(--blue-soft)}
.upload-box input{display:none}.upload-box__icon{font-size:34px;color:var(--blue);display:block;margin-bottom:8px}.upload-box strong{display:block;font-size:14px}.upload-box small{display:block;margin-top:5px;color:var(--muted)}
.form-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:26px;padding-top:20px;border-top:1px solid var(--line)}
.form-actions__right{display:flex;gap:10px}
.button{border:0;border-radius:10px;padding:11px 16px;font-weight:800;transition:.18s}
.button:disabled{opacity:.45;cursor:not-allowed}.button--primary{background:var(--blue);color:#fff;box-shadow:0 6px 14px rgba(37,99,235,.22)}.button--primary:hover{background:var(--blue-dark);transform:translateY(-1px)}
.button--soft{background:#eaf2ff;color:var(--blue-dark)}.button--soft:hover{background:#dbeafe}.button--ghost{background:#eef2f6;color:#475569}.button--ghost:hover{background:#e2e8f0}.button--compact{padding:9px 13px;font-size:13px}
.preview-card{min-height:calc(100vh - 128px)}
.preview-header{height:76px;padding:0 24px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line);gap:16px}
.preview-header__title{display:flex;align-items:center;gap:12px}.preview-header__icon{width:34px;height:34px;border-radius:9px;background:var(--blue);color:#fff;display:grid;place-items:center}.preview-header h2{font-size:19px;margin:0}.preview-header p{font-size:12px;margin:3px 0 0;color:var(--muted)}.preview-header__actions{display:flex;gap:8px;align-items:center}
.icon-button{width:38px;height:38px;border:1px solid var(--line);border-radius:10px;background:#fff;color:#475569;font-size:19px}.icon-button:hover{background:#f8fafc}
.viewer-shell{margin:16px;border:1px solid #d8e0ea;border-radius:13px;overflow:hidden;background:#fff}
.viewer-toolbar{height:52px;padding:0 14px;background:#2e343c;color:#fff;display:flex;align-items:center;justify-content:space-between;font-size:13px}
.viewer-toolbar__group{display:flex;align-items:center;gap:9px}.toolbar-btn{width:32px;height:32px;border:0;background:transparent;color:inherit;border-radius:7px;font-size:17px}.toolbar-btn:hover{background:rgba(255,255,255,.12)}.page-count{min-width:54px;text-align:center}
.viewer-stage{height:calc(100vh - 280px);min-height:640px;overflow:auto;background:#e9edf2;padding:22px;display:flex;align-items:flex-start;justify-content:center}
.paper{--zoom:1;width:210mm;min-height:297mm;background:#fff;color:#111;font-family:"Times New Roman",serif;font-size:11.4px;line-height:1.42;padding:15mm 14mm;box-shadow:0 7px 28px rgba(15,23,42,.18);transform:scale(var(--zoom));transform-origin:top center;margin-bottom:calc((var(--zoom) - 1) * 297mm)}
.doc-title{text-align:center;font-weight:700;font-size:14px;margin-bottom:18px;line-height:1.5}.paper h3{font-size:12.5px;margin:18px 0 7px}.paper table{width:100%;border-collapse:collapse;margin-bottom:10px}.paper td{border:1px solid #111;padding:5px 6px;vertical-align:top}.paper td:first-child{width:34%}.pre{white-space:pre-wrap}.kop{height:94px;display:flex;align-items:center;justify-content:center;border-bottom:3px double #111;margin-bottom:14px;overflow:hidden}.kop img{max-width:100%;max-height:90px;object-fit:contain}.signature{display:flex;justify-content:space-between;margin-top:46px}.signature>div{width:42%}.sign-space{height:70px}.doc-muted{color:#555}
.viewer-footer{height:52px;padding:0 16px;border-top:1px solid var(--line);display:flex;align-items:center;gap:9px;color:#64748b;font-size:13px}.page-chip{min-width:44px;padding:6px 10px;border:1px solid var(--line);border-radius:8px;text-align:center;background:#fff}.viewer-footer__zoom{margin-left:auto;display:flex;align-items:center;gap:8px}.viewer-footer input[type=range]{width:160px;accent-color:var(--blue)}.toolbar-btn--light{color:#475569}.toolbar-btn--light:hover{background:#eef2f7}
.modal-backdrop{position:fixed;inset:0;background:rgba(15,23,42,.52);z-index:80;display:grid;place-items:center;padding:18px}.modal-backdrop[hidden]{display:none}.modal{width:min(520px,100%);background:#fff;border-radius:16px;padding:28px;position:relative;box-shadow:0 30px 80px rgba(15,23,42,.3)}.modal h2{margin-top:0}.modal li{margin:10px 0;line-height:1.55}.modal__close{position:absolute;right:14px;top:12px;width:34px;height:34px;border:0;border-radius:8px;background:#eef2f7;font-size:22px}
@media(max-width:1180px){.workspace{grid-template-columns:1fr}.editor-card{position:static}.preview-card{min-height:auto}.viewer-stage{height:760px}}
@media(max-width:720px){.appbar__inner,.page{padding-left:14px;padding-right:14px}.brand{font-size:18px}.help-button{font-size:0}.help-button span{font-size:13px}.card__body{padding:20px}.stepper{margin-left:0;margin-right:0}.step__label{font-size:10px;white-space:normal}.form-grid{grid-template-columns:1fr}.field--full{grid-column:auto}.form-actions{align-items:stretch;flex-direction:column}.form-actions__right{display:grid;grid-template-columns:1fr 1fr}.preview-header{height:auto;padding:16px;align-items:flex-start}.preview-header__actions{flex-direction:column;align-items:stretch}.viewer-shell{margin:8px}.viewer-stage{padding:10px;justify-content:flex-start}.paper{width:210mm}.viewer-footer input[type=range]{width:90px}.autosave-status{display:none}}
@media print{body{background:#fff}.appbar,.editor-card,.preview-header,.viewer-toolbar,.viewer-footer{display:none!important}.page,.workspace,.preview-card,.viewer-shell,.viewer-stage{display:block!important;margin:0!important;padding:0!important;border:0!important;box-shadow:none!important;background:#fff!important;height:auto!important;min-height:0!important;overflow:visible!important}.paper{transform:none!important;margin:0!important;box-shadow:none!important;width:210mm;min-height:297mm;padding:15mm 14mm;page-break-after:auto}}

/* v3.6: status field wajib/opsional dan validasi */
.field-label{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:7px}
.field-label__main{display:flex!important;align-items:center;justify-content:space-between;gap:10px;width:100%;margin:0!important}
.field-label__text{display:inline-flex;align-items:center;gap:4px}
.required-star{color:#dc2626;font-weight:900}
.req-badge{display:inline-flex;align-items:center;border-radius:999px;padding:3px 8px;font-size:10px;font-weight:800;line-height:1;white-space:nowrap}
.req-badge--required{color:#b42318;background:#fff1f0;border:1px solid #fecaca}
.req-badge--optional{color:#475569;background:#f1f5f9;border:1px solid #e2e8f0}
.requirement-legend{display:flex;align-items:center;gap:12px;color:#64748b;font-size:11px;font-weight:700;white-space:nowrap}
.requirement-legend span{display:flex;align-items:center;gap:5px}
.legend-dot{width:8px;height:8px;border-radius:50%;display:inline-block}
.legend-dot--required{background:#dc2626}.legend-dot--optional{background:#94a3b8}
.validation-box{display:flex;flex-direction:column;gap:3px;margin:-2px 0 18px;padding:12px 14px;border-radius:10px;font-size:12px;line-height:1.45}
.validation-box--ok{color:#166534;background:#f0fdf4;border:1px solid #bbf7d0}
.validation-box--warning{color:#9a3412;background:#fff7ed;border:1px solid #fed7aa}
.control.invalid{border-color:#dc2626!important;box-shadow:0 0 0 3px rgba(220,38,38,.10)!important;background:#fffafa}
.field-error{margin-top:6px;color:#b42318;font-size:11px;font-weight:700}
.ai-panel__copy{min-width:0}.ai-panel__actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;justify-content:flex-end}
.control--compact{width:auto;min-width:210px;padding:9px 10px;font-size:12px}
@media(max-width:720px){.section-heading{align-items:flex-start;gap:10px}.requirement-legend{flex-direction:column;align-items:flex-end;gap:5px}.ai-panel__actions{width:100%;justify-content:stretch}.control--compact{width:100%;min-width:0}.ai-panel__actions .button{width:100%}}
