/* Document pages use the available viewport; long reference details open separately. */
body[data-sheet=documents]>header{padding:6px 0 3px!important}
body[data-sheet=documents]>header .wrap{gap:2px 8px}
body[data-sheet=documents]>header h1{font-size:1.25rem;margin:0}
body[data-sheet=documents]>header .company-name{font-size:.7rem;margin:2px 0 0;line-height:1.1}
body[data-sheet=documents] #files-home{min-height:40px;height:40px;width:40px;padding:7px}
body[data-sheet=documents] #file-workspace{display:flex;flex-direction:column;overflow:hidden;padding:0 10px 6px!important}
body[data-sheet=documents] #sheet-documents{display:flex;flex:1;min-height:0}
body[data-sheet=documents] .sheet-local-hint{display:none}
body[data-sheet=documents] #library-status{flex:none;font-size:12px;line-height:1.2;margin:0;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden}
body[data-sheet=documents] #library-status:empty{display:none}
#document-set-setup{display:flex;flex-direction:column;flex:1;min-height:0;margin:0}
#document-page-steps{flex:none;gap:4px;margin:3px 0 4px}
#document-page-steps button{min-height:48px;padding:3px 2px;font-size:12px;line-height:1.05;gap:2px}
#document-page-steps button>span{font-size:14px}
#document-page-context{flex:none;margin:2px 0 5px;font-size:13px;line-height:1.15;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}
.document-page{flex:1;min-height:0;display:flex;flex-direction:column}
.document-page.panel{flex:0 1 auto;margin:0;padding:10px}
.document-page>h3{flex:none;font-size:16px;line-height:1.15;margin:0 0 7px}
.document-choices{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;flex:none;margin-bottom:2px}
.document-choices label{display:block;font-size:13px;font-weight:700;line-height:1.15;margin:0 0 4px}
.document-choices select{min-height:42px;height:42px;padding:7px 8px;font-size:16px}
.document-page .document-input{position:relative;display:grid;grid-template-columns:minmax(0,1fr) auto 40px;align-items:center;gap:3px 6px;padding:8px;margin:6px 0 0;flex:none}
.document-page .document-input>label{grid-column:1;grid-row:1;font-size:14px;line-height:1.1;margin:0;font-weight:700}
.document-page .document-input>input[type=file]{position:absolute;width:1px;height:1px;min-height:0;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
.document-page .document-source-choose{grid-column:2;grid-row:1;min-height:40px;padding:7px 9px;margin:0;font-size:14px;line-height:1.1;border-radius:9px}
.document-page .document-source-info{grid-column:3;grid-row:1;width:40px;min-width:40px;min-height:40px;padding:4px;margin:0;font-size:20px;border-radius:9px}
.document-page .document-input>p[id$="-state"]{grid-column:1/-1;margin:0;font-size:12px;line-height:1.2;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;min-width:0}
.document-page .document-input>p.hint,.document-page .document-input>button[id$="-download"],.document-page .booking-source-preview,.document-page .booking-source-details{display:none}
#document-amendments-slot{display:block;margin:0}
#document-amendments-slot>label{margin:0 0 6px;font-size:14px}
#document-amendments{height:44px;min-height:44px;padding:8px;font-size:16px}
#document-amendments-slot>p.hint{display:block;font-size:13px;line-height:1.25;margin:6px 0 0}
#document-page-3{justify-content:center}
#document-page-3>h3{margin-bottom:12px}
#document-tt-info{font-size:14px;line-height:1.3;margin:8px 0}
#document-page-3 #document-set-begin{min-height:44px;margin-top:8px;font-size:14px}
.document-page-footer{flex:none;margin-top:auto;padding-top:5px}
#document-set-status,#document-set-error{font-size:12px;line-height:1.2;margin:0 0 3px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
#document-set-status.document-status-ok{display:none}
.document-page-nav{padding:3px 0 0;gap:6px;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr)}
.document-page-nav button{min-height:44px;padding:8px 10px;font-size:15px;line-height:1.1}
#document-more-info{font-size:13px;font-weight:600;min-width:80px}
#document-more-info.has-notes{background:#f4ead0;border-color:#d0b779;color:#67511d}
#document-page-4{gap:6px}
#document-page-4>h3{margin:0}
#lc-document-board{flex:1;min-height:0;display:flex;flex-direction:column;gap:6px;padding:8px;margin:0;border-radius:12px}
#lc-document-board-status{flex:none;font-size:12px;line-height:1.15;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#lc-document-grid{flex:1;min-height:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-flow:row;gap:7px}
#lc-document-grid button{min-height:0;height:100%;padding:7px 5px;gap:4px;border-radius:12px}
#lc-document-grid .lc-doc-name{font-size:15px;line-height:1.1}
#lc-document-grid .lc-doc-count{font-size:12px;line-height:1.1}
#lc-document-grid .lc-doc-icon{height:22px;width:19px}
.document-tile-pager{flex:none;height:32px;display:grid;grid-template-columns:40px 1fr 40px;align-items:center;gap:8px;text-align:center;font-size:12px}
.document-tile-pager button{min-height:32px;height:32px;padding:2px 8px;font-size:20px;margin:0;border-radius:8px}
#document-open-library{flex:none;min-height:40px;margin:0;padding:6px 10px;font-size:14px}
#document-set-workspace{flex:1;min-height:0;padding:10px;margin:0}
#document-set-workspace h2,#document-set-workspace h3{font-size:16px;margin:0 0 6px}
#document-set-workspace p{font-size:13px;line-height:1.2;margin:5px 0}
#document-set-workspace button{font-size:14px;min-height:42px;padding:7px;margin-top:6px}
#document-set-workspace>h2,#document-workspace-status,.packing-sales-panel>p:not(#packing-sales-status){display:none}
#packing-sales-status{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.document-detail-dialog{width:min(650px,calc(100% - 24px));max-height:90dvh;overflow:auto;border:1px solid #b5c8bc;border-radius:18px;padding:20px;background:#fff;color:#163d2d;font:inherit}
.document-detail-dialog::backdrop{background:#10281dcc}
.document-detail-dialog h2{font-size:1.25rem;margin:5px 0 14px}
.document-detail-dialog p{overflow-wrap:anywhere;white-space:pre-line}
.document-detail-dialog>button{display:block;width:100%;min-height:44px;margin-top:10px}
.document-detail-dialog .dialog-home-nav{margin-bottom:12px}
#document-source-content img{display:block;max-width:100%;max-height:260px;object-fit:contain;margin:10px auto}
@media(max-height:650px){
 body[data-sheet=documents]>header{padding:3px 0 2px!important}
 body[data-sheet=documents]>header .company-name{font-size:11px;margin:0}
 #document-page-steps button{min-height:44px;font-size:11px}
 #document-page-context{margin-bottom:3px;font-size:12px}
 .document-page.panel{padding:8px}
 .document-page>h3{margin-bottom:5px;font-size:15px}
 .document-page .document-input{padding:6px;margin-top:5px}
 .document-page .document-input>label{font-size:13px}
 .document-page .document-input>p[id$="-state"]{font-size:11px}
 #lc-document-grid .lc-doc-name{font-size:14px}
}
