.text-disclosure { margin: 10px 0; min-width: 0; }
.text-disclosure > summary { display: block; list-style: none; cursor: pointer; min-height: 48px; }
.text-disclosure > summary::-webkit-details-marker { display: none; }
.text-excerpt { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; white-space: pre-wrap; overflow-wrap: anywhere; }
.text-toggle { display: flex; align-items: center; gap: 6px; min-height: 48px; width: max-content; color: var(--accent); font-size: 13px; font-weight: 600; }
.text-toggle svg { width: 16px; height: 16px; }
.text-toggle .when-open { display: none; }
.text-disclosure[open] .text-excerpt, .text-disclosure[open] .when-closed { display: none; }
.text-disclosure[open] .when-open { display: inline; }
.text-disclosure[open] .text-toggle svg { transform: rotate(180deg); }
.text-full { min-width: 0; }
.text-full > p, .detail-records .record-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.text-collapse { color: var(--accent); min-height: 48px; margin-top: 8px; }
.customer-picker { min-width: 0; }
.customer-picker > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 12px; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; list-style: none; }
.customer-picker > summary::-webkit-details-marker { display: none; }
.customer-picker > summary small { color: var(--accent); }
.customer-picker > select { margin-top: 8px; }
.upload-kind-help { display: block; color: var(--muted); margin-top: 8px; font-size: 12px; line-height: 1.6; }
.file-list button > span { min-width: 0; }
.file-list .file-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.media-viewer-backdrop { padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
.dialog.media-viewer { width: min(1120px, 100%); height: min(860px, calc(100dvh - 24px)); max-height: calc(100dvh - 24px); min-width: 0; padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.media-viewer > header { flex: 0 0 auto; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; margin: 0; padding: 12px 16px; }
.media-viewer > header h2 { min-width: 0; margin: 0; font-size: 14px; line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-viewer > header button { flex-shrink: 0; min-height: 48px; min-width: 48px; }
.media-body { flex: 1 1 auto; min-height: 0; min-width: 0; display: grid; overflow: auto; background: var(--page); }
.media-viewport { min-height: 0; min-width: 0; height: 100%; width: 100%; display: flex; align-items: center; justify-content: center; overflow: hidden; touch-action: none; }
.media-viewport img { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; user-select: none; -webkit-user-select: none; -webkit-user-drag: none; }
.media-state { align-self: center; justify-self: center; padding: 24px; text-align: center; overflow-wrap: anywhere; }
.media-audio { align-self: center; min-width: 0; padding: 24px; text-align: center; overflow-wrap: anywhere; }
.media-audio > svg { width: 40px; height: 40px; color: var(--accent); }
.media-audio audio { width: min(600px, 100%); }
.media-viewer > footer.media-toolbar { flex: 0 0 auto; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0; padding: 10px 16px; border-top: 1px solid var(--line); background: var(--paper, #fff); }
.media-viewer [hidden] { display: none !important; }
.media-zoom-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.media-zoom-controls button, .media-download { min-width: 48px; min-height: 48px; }
.media-zoom-controls output { color: var(--muted); font-size: 12px; min-width: 44px; }
.media-download { display: inline-flex; align-items: center; padding: 0 8px; }
@media (max-width: 600px) {
  .media-viewer > header { gap: 8px; padding: 8px; }
  .media-viewer > header button { padding: 8px; }
  .media-viewer > footer.media-toolbar { padding: 8px; }
}
