.page-tabs { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); max-width: 600px; }
.documents-intro { margin: 4px 0 24px; }
.documents-intro h1 { margin-top: 8px; font-size: clamp(25px, 5.8vw, 34px); }
.document-deadline { padding: 19px 20px; border: 1px solid #aed9ef; border-radius: 18px; background: #e6f5ff; }
.document-deadline > span { display: block; margin-bottom: 5px; color: #477c95; font-size: 12px; }
.document-deadline > strong { display: block; color: #225f7e; font-size: clamp(19px, 4.6vw, 26px); letter-spacing: -.02em; }
.document-deadline p { margin: 8px 0 0; font-size: 12px; line-height: 1.8; }
.viewer-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 24px; padding: 12px 16px; border: 1px solid #c5e3f0; border-radius: 15px; background: #f7fcff; }
.viewer-bar > div { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; min-width: 0; }
.viewer-bar strong { overflow-wrap: anywhere; font-size: 14px; }
.viewer-bar span { color: #638596; font-size: 12px; overflow-wrap: anywhere; }
#auth-timer { flex-basis: 100%; font-variant-numeric: tabular-nums; }
.viewer-bar button { flex: 0 0 auto; }
.viewer-bar .viewer-actions { flex: 0 0 auto; align-items: center; gap: 4px 14px; }
.profile-fields { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 16px; }
.profile-fields .field { min-width: 0; }
.profile-wide { grid-column: 1 / -1; }
.profile-consent { display: flex; align-items: flex-start; gap: 8px; margin-top: 10px; color: #638596; font-size: 12px; line-height: 1.7; }
.profile-consent input { flex: 0 0 auto; margin-top: 4px; accent-color: #5baad2; }
.profile-passwords { margin: 8px 0 18px; padding-top: 18px; border-top: 1px solid #d8eaf3; }
.profile-passwords h3 { margin: 0; font-size: 16px; }
#profile-form textarea { resize: vertical; }
.document-team-area { position: relative; isolation: isolate; }
.document-team-area.is-locked { max-height: 390px; overflow: hidden; padding: 5px; margin: -5px; border-radius: 18px; }
.document-team-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.document-team-card { min-height: 166px; justify-content: flex-start; }
.document-team-card:disabled { cursor: default; opacity: 1; }
.document-team-card.is-own-team { border-color: #7dbfdf; background: #f5fcff; box-shadow: 0 6px 22px #99c8dd24; }
.document-team-card .team-card-name { margin: 13px 0 18px; }
.document-team-card .team-card-hint { margin-top: 10px; }
.document-status { display: inline-flex; align-self: flex-start; align-items: center; margin-top: auto; padding: 5px 10px; border-radius: 8px; background: #edf2f5; color: #657d88; font-size: 12px; font-weight: 600; }
.document-status.status-submitted { color: #276e94; background: #d9f0ff; }
.document-status.status-revision { color: #8b6426; background: #fff0cf; }
.is-locked .document-team-grid { filter: blur(5px); opacity: .64; pointer-events: none; user-select: none; -webkit-user-select: none; }
.auth-gate { position: absolute; z-index: 2; inset: 0; display: flex; align-items: center; justify-content: center; padding: 18px; }
.auth-gate-card { width: 100%; max-width: 340px; padding: 26px 22px; border: 1px solid #c0e1f2; border-radius: 22px; background: #f8fcfffa; box-shadow: 0 10px 46px #4b9ac32e; text-align: center; }
.auth-gate-card p { margin: 12px 0 0; color: #638596; font-size: 12px; line-height: 1.8; }
.auth-gate-card .button { min-width: 170px; min-height: 48px; }
.document-overlay { padding: max(12px, env(safe-area-inset-top, 0px)) 12px max(12px, env(safe-area-inset-bottom, 0px)); }
.document-dialog-card { max-width: 650px; }
.document-overlay .team-dialog-card { max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); }
.document-overlay .dialog-top { padding-bottom: 3px; }
.document-overlay .dialog-content { padding-bottom: 26px; }
.document-overlay .field { margin-bottom: 16px; }
.document-overlay .button { min-height: 48px; }
.document-section { margin-top: 24px; padding-top: 20px; border-top: 1px solid #d8eaf3; }
.document-section h3 { margin: 0 0 12px; font-size: 16px; }
.document-section > p { font-size: 13px; line-height: 1.8; }
.document-members { display: grid; gap: 10px; }
.document-members .member-card { margin: 0; }
.document-members .member-card h3 { display: flex; align-items: center; gap: 7px; font-size: 14px; }
.leader-badge { padding: 2px 6px; border-radius: 5px; background: #e1f2fc; color: #377797; font-size: 10px; font-weight: 600; }
.member-details { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 5px 8px; margin: 10px 0 0; font-size: 12px; line-height: 1.7; }
.member-details dt { color: #6c8998; }
.member-details dd { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.document-link-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.document-link-row .button { flex: 1 1 160px; text-align: center; }
.submitted-details { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 8px; margin: 16px 0; padding: 15px; border-radius: 12px; background: #ebf7ff; font-size: 12px; line-height: 1.8; }
.submitted-details dt { color: #5b8195; }
.submitted-details dd { margin: 0; overflow-wrap: anywhere; }
.document-upload { margin-top: 18px; }
.document-upload .form-control { padding: 10px; font-size: 13px; }
.document-upload input::file-selector-button { min-height: 36px; padding: 6px 12px; margin-right: 10px; border: 0; border-radius: 8px; background: #e5f3fc; color: #3f7490; font: inherit; }
.document-upload .fine-print { margin: 8px 0 14px; }
.leader-form { display: flex; flex-wrap: wrap; gap: 10px; }
.leader-form label { width: 100%; }
.leader-form select { flex: 1 1 180px; }
.leader-form .button { flex: 0 0 auto; }
.document-notice { padding: 12px 15px; border: 1px solid #cce4f0; border-radius: 12px; background: #edf8ff; color: #4a7c95; font-size: 12px; line-height: 1.8; }
.admin-preview { margin: 0 0 24px; padding: 18px; border: 1px dashed #8bbdd7; border-radius: 16px; background: #e7f4fd; }
.admin-preview h2 { margin: 0 0 7px; color: #2d6787; font-size: 16px; }
.admin-preview p { margin: 0 0 16px; font-size: 12px; line-height: 1.8; }
.preview-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.preview-controls label { min-width: 0; font-size: 12px; }
.preview-controls select { margin-top: 6px; padding: 10px; font-size: 14px; }
.preview-controls > button { grid-column: 1 / -1; }
.preview-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px 15px; margin-top: 8px; }
.success-overlay { z-index: 110; }
.document-success-card { position: relative; width: 100%; max-width: 350px; padding: 32px 26px 26px; border: 1px solid #aad8f1; border-radius: 23px; background: #edf8ff; box-shadow: 0 20px 70px #2f709637; color: #2b6788; text-align: center; }
.document-success-card > .dialog-close { position: absolute; top: 5px; right: 5px; }
.success-mark { display: flex; width: 54px; height: 54px; margin: 0 auto 18px; justify-content: center; align-items: center; border-radius: 50%; background: #ccecff; color: #328ac0; font-size: 27px; }
.document-success-card h2 { margin: 0 0 12px; font-size: 21px; }
.document-success-card p { margin: 0 0 23px; font-size: 13px; line-height: 1.8; }
@media (min-width: 700px) {
    .profile-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .document-team-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
    .document-team-card { min-height: 180px; }
    .document-members { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .preview-controls { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .preview-controls > button { justify-self: end; min-width: 160px; }
    .auth-gate-card { padding: 32px 26px; }
}
@media (max-width: 360px) {
    .viewer-bar { flex-wrap: wrap; }
    .viewer-bar .viewer-actions { flex-basis: 100%; justify-content: flex-end; }
    .page-tabs a { font-size: 12px; }
    .document-team-grid { gap: 9px; }
    .document-team-card { min-height: 160px; padding: 13px; }
    .document-overlay .dialog-content { padding-left: 17px; padding-right: 17px; }
    .document-deadline { padding: 17px; }
}
@media (max-height: 650px) { .document-overlay { align-items: flex-start; } }
