.private-documents { min-width: 0; }
.private-documents-scope { color: #626c79; font-size: .875rem; line-height: 1.55; max-width: 76ch; }
.private-documents-status { line-height: 1.5; overflow-wrap: anywhere; }
.private-document-destination { font-weight: 600; overflow-wrap: anywhere; }
.private-document-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1rem 0; }
.private-document-list { list-style: none; padding: 0; margin: 1rem 0; }
.private-document-list li { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 0; border-top: 1px solid #e3e6ec; }
.private-document-list li div { min-width: 0; overflow-wrap: anywhere; }
.private-document-list span { display: block; color: #626c79; font-size: .85rem; margin-top: .3rem; }
.private-document-upload { border-top: 1px solid #e3e6ec; padding-top: 1rem; max-width: 42rem; }
.private-document-upload > label { display: grid; gap: .5rem; margin: .75rem 0; }
.private-document-upload input[type=file], .private-document-upload select { max-width: 100%; box-sizing: border-box; }
.private-document-upload > p { font-size: .875rem; color: #626c79; }
.private-document-confirmation { padding: 1rem; background: #f3f5f8; border-radius: .45rem; margin: .75rem 0; overflow-wrap: anywhere; }
.private-document-ack { display: flex; align-items: flex-start; gap: .6rem; line-height: 1.5; margin: 1rem 0; }
.private-document-ack input { width: auto; flex: 0 0 auto; margin-top: .25rem; }
.private-document-warning { border-left: 3px solid #946319; padding-left: .8rem; line-height: 1.5; }
.private-document-receipt { overflow-wrap: anywhere; font-size: .85rem; margin-bottom: 1rem; }
.private-documents button:disabled { opacity: .55; cursor: not-allowed; }
@media (max-width: 600px) {
  .private-document-list li { align-items: flex-start; flex-direction: column; gap: .65rem; }
  .private-document-actions button, .private-document-confirmation button { width: 100%; }
  .private-document-upload input[type=file] { width: 100%; }
}
@media print { .private-documents { display: none; } }
/* Match the existing AfterHour workspace; previews stay inside the application. */
.document-open { border: 0; padding: .25rem 0; background: none; color: #153c4e; font: inherit; font-weight: 650; text-align: left; cursor: pointer; text-decoration: underline; text-underline-offset: .2em; overflow-wrap: anywhere; }
.document-open:hover { color: #087a86; }
.document-open:focus-visible, .record-attachment button:focus-visible { outline: 3px solid #5db7c4; outline-offset: 3px; }
.record-attachment { display: flex; flex-direction: column; align-items: flex-start; gap: .5rem; min-width: 10rem; max-width: 24rem; }
.legacy-document { font-size: .8rem; color: #65717a; overflow-wrap: anywhere; }
.private-document-list { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,280px),1fr)); gap: .8rem; }
.private-document-list li { display: flex; flex-wrap: wrap; align-content: flex-start; justify-content: flex-start; padding: 1rem; border: 1px solid #dce4e8; border-radius: .65rem; background: #fff; }
.private-document-list li > div { flex-basis: 100%; }
.private-document-list li > .field-action { font-size: .85rem; }
.private-document-upload { max-width: 100%; border: 1px dashed #bacbd1; border-radius: .65rem; padding: 1rem; background: #f8fafb; }
.private-document-confirmation { background: #eef4f6; }
.private-document-destination { color: #63727b; font-size: .85rem; font-weight: 500; }
.private-documents-status:empty { display: none; }
.document-viewer, .document-upload-dialog, .save-recovery-dialog { border: 1px solid #d9e1e5; border-radius: .85rem; padding: 0; box-shadow: 0 24px 90px #10293655; color: #233744; background: #fff; }
.document-viewer { width: min(1180px,94vw); height: min(900px,92dvh); max-width: 94vw; max-height: 92dvh; }
.document-viewer::backdrop, .document-upload-dialog::backdrop, .save-recovery-dialog::backdrop { background: #102631b3; }
.document-viewer > header, .document-upload-dialog > header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid #e1e7ea; }
.document-viewer h2, .document-upload-dialog h2 { font-size: 1rem; margin: 0; overflow-wrap: anywhere; }
.document-viewer header button, .document-upload-dialog header button { flex-shrink: 0; border: 1px solid #c7d4da; border-radius: .4rem; background: #f6f9fa; padding: .6rem .9rem; font: inherit; cursor: pointer; }
.document-viewer-body { height: calc(100% - 76px); display: flex; align-items: center; justify-content: center; padding: 1rem; box-sizing: border-box; background: #eaf0f3; }
.document-viewer-body img { width: 100%; height: 100%; object-fit: contain; }
.document-viewer-body iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.document-upload-dialog { width: min(760px,92vw); max-height: 90dvh; }
.document-upload-dialog [data-upload-content] { padding: 1.25rem; }
.cloud-status-card { max-width: 520px; margin: 10vh auto; padding: 2rem; border: 1px solid #dce4e8; border-radius: .85rem; background: #fff; box-shadow: 0 12px 45px #243c4810; }
.cloud-status-brand { display: flex; gap: .8rem; align-items: center; margin-bottom: 1.8rem; font-size: 1.25rem; font-weight: 700; }
.cloud-status-brand img { width: 48px; height: 48px; object-fit: contain; }
.cloud-status-card h1 { font-size: 1.5rem; }
.cloud-status-card p { color: #556873; line-height: 1.6; }
.cloud-status-actions { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 1.5rem; }
.save-recovery-dialog { max-width: min(520px,92vw); padding: 1.5rem; }
.save-recovery-dialog p { line-height: 1.6; }
@media(max-width:600px){
 .document-viewer { width: 98vw; height: 96dvh; max-width: 98vw; max-height: 96dvh; border-radius: .5rem; }
 .document-viewer > header { padding: .7rem; }
 .document-viewer-body { padding: .4rem; }
 .cloud-status-card { margin: 5vh 1rem; padding: 1.4rem; }
}
.document-viewer, .document-upload-dialog, .save-recovery-dialog { font-family: Arial, Helvetica, sans-serif; }
.pdf-preview { display: flex; flex-direction: column; justify-content: flex-start; padding: 0; }
.pdf-controls { width: 100%; display: flex; align-items: center; justify-content: center; gap: .7rem; padding: .6rem; background: #f6f8fa; box-sizing: border-box; }
.pdf-controls button { padding: .45rem .7rem; border: 1px solid #c7d4da; border-radius: .3rem; background: #fff; font: inherit; cursor: pointer; }
.pdf-controls button:disabled { opacity: .45; cursor: default; }
.pdf-page { overflow: auto; width: 100%; flex: 1; text-align: center; padding: 1rem; box-sizing: border-box; }
.pdf-page canvas { background: #fff; box-shadow: 0 2px 12px #243c4830; }
.pdf-readable-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.save-recovery-dialog button { min-height: 44px; padding: .65rem 1rem; font: inherit; border: 1px solid #c7d4da; border-radius: .4rem; background: #f4f7f8; color: #243c48; cursor: pointer; }
.save-recovery-dialog .field-create-button { background: var(--company-accent); border-color: var(--company-accent); color: #fff; }
.save-recovery-dialog button:disabled { opacity: .55; }
.document-viewer { overflow: hidden; }

/* Reuse the workspace typography and actions on standalone states/dialogs. */
.cloud-status-card, .document-upload-dialog { font: 14px/1.5 Arial, Helvetica, sans-serif; color: #171a1f; }
.cloud-status-card *, .document-upload-dialog * { box-sizing: border-box; }
.cloud-status-card a, .document-upload-dialog a { text-decoration: none; }
.cloud-status-card .field-create-button, .document-upload-dialog .field-create-button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 16px; border: 0; border-radius: 4px; background: var(--company-accent); color: #fff; font: 600 13px/1.5 Arial,Helvetica,sans-serif; cursor: pointer; }
.cloud-status-card .field-action, .document-upload-dialog .field-action { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 14px; border: 1px solid #d8dee3; border-radius: 4px; background: #fff; color: #171a1f; font: 600 12px/1.5 Arial,Helvetica,sans-serif; cursor: pointer; }
.cloud-status-card :is(a,button):focus-visible, .document-upload-dialog :is(a,button,input):focus-visible { outline: 3px solid var(--company-accent); outline-offset: 4px; }
.cloud-status-brand small { display: block; font-size: 12px; font-weight: 400; color: #5f6670; }
.private-document-upload { border: 0; background: none; padding: 0; margin: 1rem 0 1.2rem; }
.private-document-upload > .field-create-button { display: inline-flex; }
.private-document-upload > p { margin: .55rem 0; }
.private-document-list { grid-template-columns: repeat(auto-fill,minmax(min(100%,260px),1fr)); align-items: start; }
.private-document-list li { display: flex; flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: .35rem; padding: .9rem; }
.document-card { display: flex; align-items: flex-start; gap: .8rem; width: 100%; padding: .3rem; border: 0; border-radius: 4px; background: none; text-align: left; color: #171a1f; font: inherit; cursor: pointer; }
.document-card:hover { background: #f5f7f8; }
.document-card:focus-visible, .document-download:focus-visible { outline: 3px solid var(--company-accent); outline-offset: 3px; }
.private-document-list .document-file-badge { display: flex; flex: 0 0 42px; height: 52px; align-items: center; justify-content: center; margin: 0; border: 1px solid #d8dee3; border-radius: 5px; background: #f5f7f8; color: var(--company-accent); font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.private-document-list .document-card-text { display: grid; min-width: 0; margin: 0; gap: .25rem; color: #171a1f; }
.document-card-text strong { font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.document-card-text small { font-size: 12px; color: #5f6670; }
.private-document-list .document-view-hint { margin: .25rem 0 0; color: var(--company-accent); font-size: 12px; font-weight: 600; }
.document-download { align-self: flex-end; min-height: 32px; padding: .3rem .4rem; border: 0; background: none; color: #5f6670; font: 12px/1.4 Arial,Helvetica,sans-serif; text-decoration: underline; text-underline-offset: .2em; cursor: pointer; }
.private-document-list .document-empty { grid-column: 1 / -1; color: #5f6670; border-style: dashed; font-size: 13px; }

.pdf-preview{overflow:auto;display:block}.pdf-pages{width:100%}.pdf-pages .pdf-page{overflow:visible;flex:none;padding:12px;min-width:100%}.pdf-controls{position:sticky;top:0;z-index:1;background:#fff}.drawing-thumbnail{display:block;width:110px;height:auto;max-height:150px;object-fit:contain;margin-bottom:6px}.drawing-thumbnail-button{display:inline-flex;flex-direction:column;align-items:flex-start;gap:6px}
.document-upload-dialog .upload-project-context{margin:12px 20px 3px;font-weight:600}.document-upload-dialog .upload-sign-context{margin:0 20px 10px;font-size:13px;color:#526175}.document-upload-dialog .private-document-destination{display:none}.document-upload-dialog .private-document-list{grid-template-columns:1fr;max-height:42vh;overflow:auto;margin-top:8px}.document-upload-dialog .private-document-list>li{display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:8px}.document-upload-dialog .document-card{min-width:0}.document-upload-dialog .drawing-thumbnail{width:55px;max-height:78px;flex-shrink:0;margin:0}.document-upload-dialog .private-document-upload{border-top:1px solid #dce3e9;padding-top:12px;margin-top:12px}.document-viewer header h2{flex:1}.document-viewer header{gap:8px}.document-viewer header button{white-space:nowrap}@media(max-width:600px){.document-upload-dialog .private-document-list>li{grid-template-columns:1fr 1fr}.document-upload-dialog .document-card{grid-column:1/-1}}

.private-document-upload{border:2px dashed #b6c7dc;border-radius:8px;padding:14px}.private-document-upload.drag-over{background:#eaf2ff;border-color:#245c9f}.private-document-list [draggable=true]{cursor:grab}.document-folder{margin-bottom:12px}.buyout-row{display:grid;gap:8px;padding:12px;border-bottom:1px solid #d5dfec}
