.document-toolbar h2 { margin: 0; }
.document-toolbar .section-head p { margin: 8px 0 0; }
.document-app-link { font-size: .8125rem; white-space: nowrap; }
.document-filters { display: grid; grid-template-columns: minmax(0,1.4fr) repeat(3,minmax(0,1fr)); gap: 14px; }
.document-filters label { margin-bottom: 0; min-width: 0; }
.document-filters input, .document-filters select { width: 100%; min-width: 0; }
.document-result-count { margin: 0 0 12px; }
.family-document-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(340px,100%),1fr)); gap: 14px; margin-bottom: 16px; }
.family-document-card { display: flex; align-items: flex-start; min-width: 0; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.document-card-icon { display: grid; place-items: center; flex: 0 0 36px; width: 36px; height: 40px; background: #fbf2f7; color: var(--accent); border-radius: 9px; }
.document-card-icon svg { width: 20px; height: 20px; }
.document-card-content { min-width: 0; flex: 1; }
.document-card-content h2 { font-size: .9375rem; line-height: 1.5; overflow-wrap: anywhere; margin: 0 0 8px; }
.document-tags, .document-card-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.document-folder { font-size: .75rem; overflow-wrap: anywhere; margin: 10px 0; }
.document-card-actions { margin-top: 14px; }
.document-card-actions button, .document-card-actions a { font-size: .75rem; }
.document-open { display: inline-flex; align-items: center; min-height: 36px; padding: 8px 10px; color: var(--accent); border: 1px solid var(--line); border-radius: 9px; text-decoration: none; }
.document-remove { color: var(--muted); }
.document-access-note { padding: 12px; margin-bottom: 0; background: #fbf2f7; border-radius: 10px; line-height: 1.6; }
.document-empty { grid-column: 1 / -1; margin-bottom: 0; }
.document-help h2 { font-size: .9375rem; }
.document-help p { max-width: 75ch; line-height: 1.6; }
.document-file-search { display: flex; align-items: flex-end; gap: 10px; margin-bottom: 12px; }
.document-file-search label { flex: 1; min-width: 0; margin: 0; }
.document-file-search button { flex-shrink: 0; }
.document-choices { max-height: min(360px,44dvh); overflow: auto; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 10px; }
.document-choice { display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 12px; min-height: 48px; border-bottom: 1px solid var(--line); cursor: pointer; }
.document-choice:last-child { border: 0; }
.document-choice input { appearance: auto; flex: 0 0 20px; width: 20px; height: 20px; min-height: 20px; padding: 0; margin: 0; accent-color: var(--accent); }
.document-choice span { min-width: 0; overflow-wrap: anywhere; line-height: 1.5; }
.document-choice small { display: block; color: var(--muted); }
.document-choices > .empty { padding: 14px; margin: 0; }
#more-document-choices { margin-bottom: 14px; }
#all-family-documents { margin-top: 16px; }
@media (max-width: 900px) { .document-filters { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (min-width: 901px) {
 .document-filters { gap: 10px; }
 .document-toolbar .section-head p { margin-top: 4px; font-size: .75rem; }
 .family-document-grid { grid-template-columns: repeat(auto-fit,minmax(min(300px,100%),1fr)); gap: 10px; margin-bottom: 10px; }
 .family-document-card { padding: 12px; gap: 10px; border-radius: 10px; }
 .document-card-content h2 { font-size: .8125rem; margin-bottom: 6px; }
 .document-card-icon { width: 30px; height: 34px; flex-basis: 30px; }
 .document-tags, .document-card-actions { gap: 6px; }
 .document-card-actions { margin-top: 10px; }
 .document-open { min-height: 30px; padding: 5px 8px; }
 .document-folder { margin-block: 7px; }
}
@media (min-width: 901px) and (pointer: coarse) { .document-open { min-height: 44px; } }
@media (max-width: 640px) {
 .document-filters { grid-template-columns: minmax(0,1fr); gap: 12px; }
 .document-toolbar .section-head { align-items: flex-start; }
 .document-toolbar .section-head p { display: none; }
 .family-document-grid { grid-template-columns: minmax(0,1fr); }
 .family-document-card { padding: 14px; gap: 10px; }
 .document-card-icon { flex-basis: 28px; width: 28px; height: 34px; }
 .document-card-actions button, .document-card-actions a, .document-app-link { min-height: 44px; }
 .document-choice { min-height: 52px; }
}
