/* The attachment viewer. Colours come from the product's own variables, so it
   looks like the application it sits in rather than like a bolted-on window. */
.av-overlay {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(9, 12, 16, .62);
  display: flex; align-items: center; justify-content: center; padding: 28px;
}
.av-frame {
  background: var(--n0, #fff); color: var(--n500, #172b4d);
  border-radius: 10px; box-shadow: 0 18px 48px rgba(9, 12, 16, .35);
  width: min(1100px, 100%); height: min(860px, 100%);
  display: flex; flex-direction: column; overflow: hidden;
  /* draggable from the corner, and the size is kept per account */
  resize: both; min-width: 380px; min-height: 240px;
  max-width: 100%; max-height: 100%;
}
.av-head {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--n30, #dfe1e6);
  background: var(--n10, #f7f8f9); flex: none;
}
.av-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.av-size { color: var(--n300, #6b778c); font-size: 12px; flex: none; }
.av-spacer { flex: 1; }
.av-download, .av-open {
  text-decoration: none; font-size: 13px; padding: 5px 12px; border-radius: 6px;
  border: 1px solid var(--n40, #c1c7d0); color: inherit; flex: none;
}
.av-download:hover, .av-open:hover { background: var(--n20, #ebecf0); }
.av-close {
  border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer;
  color: var(--n300, #6b778c); padding: 0 4px; flex: none;
}
.av-close:hover { color: var(--n500, #172b4d); }
.av-body { flex: 1; overflow: auto; background: var(--n20, #ebecf0); }
.av-loading, .av-fail { padding: 40px; text-align: center; color: var(--n300, #6b778c); }

.av-image { display: block; max-width: 100%; max-height: 100%; margin: auto; }
.av-media { display: block; width: 100%; max-height: 100%; background: #000; }
.av-frame-doc { width: 100%; height: 100%; border: 0; background: var(--n0, #fff); }
.av-text {
  margin: 0; padding: 18px 22px; background: var(--n0, #fff);
  font: 12.5px/1.6 ui-monospace, Menlo, Consolas, monospace;
  white-space: pre-wrap; word-break: break-word; min-height: 100%;
}
.av-doc, .av-sheet { background: var(--n0, #fff); min-height: 100%; padding: 18px 22px; }
.av-note {
  margin: 0 0 16px; padding: 8px 12px; border-radius: 6px;
  background: var(--n20, #ebecf0); color: var(--n300, #6b778c); font-size: 12.5px;
}
.av-doc-body { max-width: 820px; }
.av-doc-body img { max-width: 100%; }
.av-doc-body table, .av-sheet-body table { border-collapse: collapse; width: auto; }
.av-doc-body td, .av-doc-body th,
.av-sheet-body td, .av-sheet-body th {
  border: 1px solid var(--n30, #dfe1e6); padding: 4px 8px; font-size: 13px;
}
.av-sheet-body { overflow: auto; }
.av-tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.av-tab {
  border: 1px solid var(--n40, #c1c7d0); background: var(--n0, #fff);
  padding: 4px 12px; border-radius: 6px; cursor: pointer; font-size: 13px;
}
.av-tab.active { background: var(--blue, #0052cc); color: #fff; border-color: transparent; }

/* A worksheet keeps its own look: the widths come from the file, the rest from
   the cells. The grid lines are the viewer's, because a spreadsheet without
   them is hard to read whatever the file says. */
.av-grid { border-collapse: collapse; table-layout: fixed; background: var(--n0, #fff); }
.av-grid td {
  border: 1px solid var(--n30, #dfe1e6); padding: 3px 6px; font-size: 13px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  vertical-align: top;
}
/* docx-preview brings its own page styling; it only needs room around it */
.av-doc-body .docx-wrapper { background: var(--n20, #ebecf0); padding: 16px 0; }
.av-doc-body section.docx { box-shadow: 0 2px 10px rgba(9, 12, 16, .18); margin-bottom: 16px; }
