/* Mobile-first card layout for file listings. It prevents the narrow filename column seen in the video. */
.files-panel .table-wrap .file-name > span { min-width: 0; flex: 1 1 auto; }
.files-panel .table-wrap .file-name > svg { flex: 0 0 auto; }
.files-panel .table-wrap .file-name b { overflow-wrap: break-word; word-break: normal; white-space: normal; unicode-bidi: plaintext; line-height: 1.55; }
.files-panel .table-wrap td { overflow-wrap: break-word; }
.files-panel .table-wrap .actions { align-items: center; flex-wrap: wrap; }
.files-panel .table-wrap .actions .preview-action,
.files-panel .table-wrap .actions .download-action { display: inline-flex; align-items: center; justify-content: center; gap: 7px; color: var(--accent); border: 1px solid var(--line); background: var(--raised); min-height: 36px; border-radius: 8px; padding: 7px 10px; text-decoration: none; cursor: pointer; }
.files-panel .table-wrap .actions .preview-action:hover,
.files-panel .table-wrap .actions .download-action:hover { color: var(--ink); background: var(--soft); border-color: var(--accent); }
.files-panel .table-wrap .actions .delete-action { border: 1px solid var(--line); min-height: 36px; padding: 7px; }
.files-panel .table-wrap .actions .action-caption { font-weight: 600; font-size: 12px; line-height: 1.25; white-space: nowrap; }
.files-panel .table-wrap .actions :is(a,button):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.files-panel .table-wrap .actions svg { flex: 0 0 auto; }
@media (min-width: 801px) {
  .files-panel .table-wrap table { min-width: 920px; }
  .files-panel .table-wrap td:first-child { min-width: 225px; max-width: 380px; }
}
@media (max-width: 800px) {
  .files-panel .table-wrap { overflow-x: hidden; }
  .files-panel .table-wrap table { display: block; min-width: 0; width: 100%; border-collapse: separate; }
  .files-panel .table-wrap thead { display: none; }
  .files-panel .table-wrap tbody { display: grid; grid-template-columns: minmax(0,1fr); gap: 12px; width: 100%; padding: 12px; }
  .files-panel .table-wrap tbody tr { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px 16px; padding: 15px; min-width: 0; background: var(--raised); border: 1px solid var(--line); border-radius: 12px; }
  .files-panel .table-wrap tbody td { display: flex; flex-direction: column; gap: 3px; min-width: 0; max-width: 100%; padding: 0; border: 0; white-space: normal; text-align: start; font-size: 13px; line-height: 1.45; }
  .files-panel .table-wrap tbody tr:hover td { background: transparent; }
  .files-panel .table-wrap tbody td::before { display: block; content: attr(data-label); font-size: 11px; color: var(--muted); font-weight: 650; line-height: 1.35; white-space: normal; }
  .files-panel .table-wrap tbody td:first-child { grid-column: 1/-1; border-bottom: 1px solid var(--line); padding-bottom: 11px; font-size: 14px; }
  .files-panel .table-wrap tbody td:first-child::before { display: none; }
  .files-panel .table-wrap .file-name { max-width: 100%; width: 100%; min-width: 0; gap: 10px; align-items: flex-start; }
  .files-panel .table-wrap .file-name b { display: block; font-size: 14px; line-height: 1.55; font-weight: 600; }
  .files-panel .table-wrap tbody td:last-child { grid-column: 1/-1; padding-top: 10px; border-top: 1px solid var(--line); }
  .files-panel .table-wrap .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 3px; }
  .files-panel .table-wrap .actions :is(button,a) { min-height: 40px; padding: 9px 11px; }
  .files-panel .table-wrap .actions .action-caption { font-size: 13px; }
  .files-panel .table-wrap tbody td:nth-child(5) span[dir=ltr] { unicode-bidi: isolate; }
}
@media (max-width: 380px) {
  .files-panel .table-wrap tbody { padding: 9px; gap: 10px; }
  .files-panel .table-wrap tbody tr { padding: 12px; column-gap: 10px; }
}
/* The preview viewer stays inside the application and is usable on phones. */
.safety-preview-overlay { z-index: 45; padding: 12px; }
.safety-preview-modal { width: min(1030px, 100%); height: min(91dvh, 960px); max-height: 96dvh; padding: 16px; display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow: hidden; }
.safety-preview-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.safety-preview-title { min-width: 0; flex: 1; }
.safety-preview-title h2 { font-size: 19px; line-height: 1.3; margin: 0 0 6px; }
.safety-preview-title p { display: block; width: 100%; max-height: 3.4em; overflow-y: auto; overflow-wrap: anywhere; line-height: 1.4; font-size: 13px; color: var(--ink); text-align: start; unicode-bidi: plaintext; }
.safety-preview-close { color: var(--ink); border-radius: 8px; border: 1px solid var(--line); background: var(--raised); flex: 0 0 auto; font-size: 24px; line-height: 1; width: 36px; height: 36px; display: grid; place-items: center; }
.safety-preview-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.safety-preview-surface { background: #f5f7fb; border: 1px solid var(--line); border-radius: 10px; flex: 1 1 auto; min-height: 110px; overflow: auto; display: grid; place-items: center; }
.safety-preview-surface iframe { width: 100%; height: 100%; min-height: 100%; border: none; background: #fff; }
.safety-preview-surface img { width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; }
.safety-preview-hint { font-size: 12px !important; line-height: 1.45; }
.safety-preview-unavailable { border: 1px dashed var(--line); background: var(--raised); color: var(--ink); padding: 22px; border-radius: 10px; line-height: 1.65; }
.safety-preview-footer { margin: 0; padding-top: 12px; gap: 8px; flex-wrap: wrap; }
.safety-preview-footer a,.safety-preview-footer button { display: inline-flex; min-height: 39px; align-items: center; justify-content: center; border-radius: 8px; text-decoration: none; padding: 9px 13px; cursor: pointer; font-size: 13px; font-weight: 600; }
.safety-preview-footer a.primary { color: #fff; }
.safety-preview-footer a.secondary { color: var(--ink); border: 1px solid var(--line); }
@media (max-width: 800px) {
 .safety-preview-overlay { padding: 8px; }
 .safety-preview-modal { width: 100%; height: min(94dvh, 850px); max-height: 96dvh; padding: 12px; border-radius: 12px; }
 .safety-preview-surface { min-height: 0; }
 .safety-preview-footer { justify-content: flex-start; }
 .safety-preview-footer a,.safety-preview-footer button { font-size: 12px; padding: 9px 10px; }
}
@media (prefers-reduced-motion: reduce) { .safety-preview-modal { animation: none; } }
