.documents-ficha-entry { margin-bottom: 12px; }
.staff-documents .documents-tabs { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.staff-documents .documents-tabs [aria-pressed="true"] { border-color: var(--accent); background: var(--pale); color: var(--accent); }
.staff-documents .documents-panel { border-top: 3px solid var(--accent); }
.staff-documents .documents-panel .table-wrap, .staff-documents #documents-note-form { margin-top: 10px; }
.staff-documents .documents-status { margin-block: 7px; }
.staff-documents .documents-status:empty { display: none; }
.staff-documents .documents-upload { margin-top: 10px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 6px; background: #f4f8fb; }
.staff-documents .documents-upload summary { width: fit-content; color: var(--accent); font-weight: 700; cursor: pointer; }
.staff-documents .documents-upload .form { margin-top: 9px; }
.staff-documents .documents-fields { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 8px; align-items: end; }
.staff-documents .documents-fields input { max-width: 100%; }
.staff-documents .table-wrap th, .staff-documents .table-wrap td, .staff-documents .table-wrap .btn { overflow-wrap: anywhere; }
.staff-documents .table-wrap .btn.text { min-height: 25px; padding: 2px 0; text-align: left; white-space: normal; }
.staff-documents .documents-questionnaire { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 6px; background: #f4f8fb; }
.staff-documents .documents-questionnaire dl { display: grid; gap: 8px; margin-bottom: 0; }
.staff-documents .documents-questionnaire dl div { padding-top: 7px; border-top: 1px solid var(--line); }
.staff-documents .documents-questionnaire dt { font-size: .86rem; font-weight: 700; }
.staff-documents .documents-questionnaire dd { margin: 3px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.staff-documents .documents-note-body { margin: 0 0 3px; white-space: pre-wrap; }
@media (max-width: 550px) { .staff-documents .documents-fields { grid-template-columns: 1fr; } }

/* Communications record composition; the broader application's view stays intact. */
body[data-application-profile="communications"] #workspace .staff-documents[data-record-layout="communications"] { max-width: 1200px; }
body[data-application-profile="communications"] #workspace .staff-documents #documents-return { margin: -8px 0 16px; }
body[data-application-profile="communications"] #workspace .staff-documents .section-head { margin-bottom: 20px; }
body[data-application-profile="communications"] #workspace .staff-documents #documents-context { margin-top: 8px; }
body[data-application-profile="communications"] #workspace .staff-documents .documents-tabs { gap: 4px; margin: 0 0 20px; padding: 4px; width: fit-content; max-width: 100%; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
body[data-application-profile="communications"] #workspace .staff-documents .documents-tabs .btn { display: inline-flex; align-items: center; margin: 0; border-color: transparent; background: transparent; }
body[data-application-profile="communications"] #workspace .staff-documents .documents-tabs [aria-pressed="true"] { background: var(--pale); color: var(--accent); }
body[data-application-profile="communications"] #workspace .documents-tab-count { font-size: .75rem; font-weight: 500; font-variant-numeric: tabular-nums; }
body[data-application-profile="communications"] #workspace .staff-documents .documents-panel { padding: 24px; border-top: 1px solid var(--line); }
body[data-application-profile="communications"] #workspace .staff-documents .documents-panel h2 { margin: 0; }
body[data-application-profile="communications"] #workspace .staff-documents #documents-files { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 16px; }
body[data-application-profile="communications"] #workspace .staff-documents #documents-files > :is(.table-wrap, .platform-pagination, .documents-status) { grid-column: 1 / -1; margin: 0; }
body[data-application-profile="communications"] #workspace .staff-documents .documents-upload { margin: -6px 0 0; padding: 0; border: 0; background: transparent; }
body[data-application-profile="communications"] #workspace .staff-documents .documents-upload summary { min-height: 44px; padding: 10px 14px; border: 1px solid var(--accent); border-radius: var(--ui-control-radius); color: var(--accent); font-size: .875rem; line-height: 1.5; }
body[data-application-profile="communications"] #workspace .staff-documents .documents-upload summary:hover { background: var(--pale); }
body[data-application-profile="communications"] #workspace .staff-documents .documents-upload[open] { grid-column: 1 / -1; }
body[data-application-profile="communications"] #workspace .staff-documents .documents-upload[open] summary { width: fit-content; }
body[data-application-profile="communications"] #workspace .staff-documents .documents-upload .form { margin: 16px 0 0; padding: 20px; background: var(--bg); border-radius: 10px; }
body[data-application-profile="communications"] #workspace .staff-documents .documents-fields { grid-template-columns: minmax(0, 1fr); }
body[data-application-profile="communications"] #workspace .staff-documents .documents-fields input { width: 100%; min-width: 0; }
body[data-application-profile="communications"] #workspace .staff-documents .documents-file-download { display: inline-flex; min-height: 44px; max-width: 46ch; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
body[data-application-profile="communications"] #workspace .staff-documents #documents-notes { display: grid; grid-template-columns: minmax(240px, .85fr) minmax(0, 1.4fr); gap: 20px 32px; }
body[data-application-profile="communications"] #workspace .staff-documents #documents-notes > h2 { grid-column: 1 / -1; }
body[data-application-profile="communications"] #workspace .staff-documents #documents-note-form { grid-column: 1; grid-row: 2; margin: 0; }
body[data-application-profile="communications"] #workspace .staff-documents #documents-note-form textarea { min-height: 160px; }
body[data-application-profile="communications"] #workspace .staff-documents #documents-notes-rows { grid-column: 2; grid-row: 2 / 4; margin: 0; gap: 0; }
body[data-application-profile="communications"] #workspace .staff-documents #documents-note-form[hidden] ~ #documents-notes-rows { grid-column: 1 / -1; grid-row: auto; }
body[data-application-profile="communications"] #workspace .staff-documents #documents-notes-rows li { padding: 0 0 20px; margin: 0 0 20px; white-space: normal; }
body[data-application-profile="communications"] #workspace .staff-documents #documents-notes-rows li:last-child { margin-bottom: 0; border-bottom: 0; }
body[data-application-profile="communications"] #workspace .documents-note-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 8px; font-size: .8rem; }
body[data-application-profile="communications"] #workspace .documents-note-meta time { color: var(--muted); font-size: .75rem; font-variant-numeric: tabular-nums; }
body[data-application-profile="communications"] #workspace .staff-documents .documents-note-body { max-width: 70ch; margin: 0; line-height: 1.65; overflow-wrap: anywhere; }
body[data-application-profile="communications"] #workspace .staff-documents #documents-note-status { grid-column: 1; grid-row: 3; margin: 0; }
body[data-application-profile="communications"] #workspace .staff-documents #documents-notes > .platform-pagination { grid-column: 1 / -1; margin: 0; }
body[data-application-profile="communications"] #workspace .staff-documents .documents-retry { margin: 0 0 20px; }
@media (max-width: 800px) {
  body[data-application-profile="communications"] #workspace .staff-documents .documents-panel { padding: 18px; }
  body[data-application-profile="communications"] #workspace .staff-documents #documents-notes { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  body[data-application-profile="communications"] #workspace .staff-documents #documents-notes > :is(#documents-note-form, #documents-note-status, #documents-notes-rows) { grid-column: 1; grid-row: auto; }
}
@media (max-width: 550px) {
  body[data-application-profile="communications"] #workspace .staff-documents #documents-files { grid-template-columns: minmax(0, 1fr); }
  body[data-application-profile="communications"] #workspace .staff-documents .documents-tabs { width: 100%; }
  body[data-application-profile="communications"] #workspace .staff-documents .documents-tabs .btn { flex: 1; justify-content: center; }
  body[data-application-profile="communications"] #workspace .staff-documents .documents-upload { margin: 0; }
  body[data-application-profile="communications"] #workspace .staff-documents .documents-panel { padding: 16px; }
  body[data-application-profile="communications"] #workspace .staff-documents .documents-upload .form { padding: 12px; }
  body[data-application-profile="communications"] #workspace .staff-documents .documents-tabs .btn { padding-inline: 8px; }
  body[data-application-profile="communications"] #workspace .staff-documents .platform-pagination > p { flex-basis: 100%; margin: 0 0 4px; }
}
