.max-file-preview-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.max-file-preview-card {
  display: grid;
  gap: 4px;
  min-width: 140px;
  max-width: 260px;
  padding: 12px 16px;
  text-align: left;
  border: 1px solid var(--ui-line);
  border-radius: 12px;
  background: var(--ui-surface);
  color: var(--ui-text);
  cursor: pointer;
}
.max-file-preview-card strong {
  font-size: 13px;
  color: var(--ui-accent);
}
.max-file-preview-card span {
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.max-file-preview-dialog {
  width: min(860px, calc(100vw - 28px));
  max-height: 85dvh;
  padding: 0;
  border: 1px solid var(--ui-line);
  border-radius: 16px;
  background: var(--ui-surface, white);
  color: var(--ui-text, #172b30);
}
.max-file-preview-dialog::backdrop {
  background: #0008;
}
.max-file-preview-dialog header {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: var(--ui-surface, white);
  border-bottom: 1px solid var(--ui-line);
}
.max-file-preview-dialog h2 {
  margin: 0;
  font-size: 16px;
  overflow-wrap: anywhere;
}
.max-file-preview-dialog header button {
  min-width: 52px;
  min-height: 40px;
  flex-shrink: 0;
  border: 0;
  border-radius: 8px;
  background: var(--ui-surface-soft);
  color: inherit;
  cursor: pointer;
}
.max-file-preview-body {
  padding: 16px;
}
.max-file-preview-body pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 14px/1.7 var(--font-ui, sans-serif);
}
.max-file-preview-body figure {
  margin: 0 0 20px;
}
.max-file-preview-body img {
  display: block;
  width: 100%;
  height: auto;
}
.max-file-preview-body figcaption {
  padding: 8px;
  text-align: center;
  font-size: 12px;
  color: var(--ui-muted);
}
.max-file-page-controls {
  position: sticky;
  top: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 0 12px;
  background: var(--ui-surface, white);
}
.max-file-page-controls button {
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid var(--ui-line);
  border-radius: 6px;
  background: var(--ui-surface-soft);
  color: inherit;
  cursor: pointer;
}
.max-file-page-controls input {
  width: 70px;
  min-height: 36px;
  color: inherit;
  background: var(--ui-input);
  border: 1px solid var(--ui-line);
  border-radius: 6px;
  text-align: center;
}
.max-file-page-controls span {
  font-size: 12px;
  color: var(--ui-muted);
}
