#openFirstPage {margin-left:auto;white-space:nowrap;padding:9px 12px;cursor:pointer;}
#firstPageDialog {width:min(900px,94vw);max-width:94vw;max-height:90vh;overflow:auto;border:1px solid #d6dfe5;border-radius:16px;padding:24px;color:#233b4c;background:white;}
#firstPageDialog::backdrop {background:rgba(15,30,40,.55);}
#firstPageDialog .modal-head {display:flex;justify-content:space-between;align-items:flex-start;gap:16px;}
#firstPageDialog h2 {margin:5px 0 14px;}
#firstPageDialog label {display:block;margin:12px 0;font-weight:600;}
#firstPageDialog input:not([type=file]),#firstPageDialog textarea,#firstPageDialog select {display:block;box-sizing:border-box;width:100%;padding:10px;margin-top:6px;border:1px solid #ccd7df;border-radius:8px;font:inherit;color:inherit;background:white;}
#firstPageDialog textarea {resize:vertical;font-weight:400;}
#firstPageDialog fieldset {border:0;padding:0;margin:0;min-width:0;}
#firstPageDialog .muted {font-size:13px;line-height:1.5;color:#6f7e88;}
#firstPageDialog .actions,.fp-tools {display:flex;gap:8px;flex-wrap:wrap;align-items:center;}
#firstPageDialog .actions {justify-content:flex-end;margin-top:18px;}
#firstPageDialog button {cursor:pointer;}
#firstPageDialog button:disabled {opacity:.5;cursor:wait;}
#firstPageImages {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;}
.fp-image {border:1px solid #d9e1e5;border-radius:12px;padding:12px;min-width:0;}
.fp-image img {display:block;width:100%;height:180px;object-fit:contain;background:#f5f7f8;border-radius:8px;}
#firstPageMessage {font-size:14px;line-height:1.5;color:#31596e;}
#firstPagePreview[hidden] {display:none;}
@media(max-width:650px) {#firstPageDialog {padding:16px;}#firstPageImages {grid-template-columns:1fr;}.topbar {flex-wrap:wrap;gap:8px;}#openFirstPage {margin-left:0;}.fp-image img {height:150px;}}
