html, body {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.explorer {
  flex: 1;
  min-height: 60vh;
}

/* drop overlay */
.drop-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--bs-primary-rgb), 0.08);
  border: 2px dashed var(--bs-primary);
  border-radius: var(--bs-border-radius);
  pointer-events: none;
}

.drop-overlay-inner {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--bs-primary);
}

/* icon view */
.icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.75rem;
}

.file-tile {
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  padding: 0.75rem 0.5rem;
  text-align: center;
  cursor: pointer;
  user-select: none;
  background: var(--bs-body-bg);
  transition: background-color 0.1s, border-color 0.1s;
}

.file-tile:hover {
  background: var(--bs-tertiary-bg);
  border-color: var(--bs-primary);
}

.file-tile.selected {
  background: rgba(var(--bs-primary-rgb), 0.12);
  border-color: var(--bs-primary);
}

.file-tile-icon {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.file-tile-icon svg {
  width: 40px;
  height: 40px;
}

.file-tile-thumb {
  max-height: 48px;
  max-width: 90%;
  border-radius: 2px;
}

.kind-text { color: var(--bs-primary); }
.kind-image { color: var(--bs-info); }
.kind-pdf { color: var(--bs-danger); }
.kind-other { color: var(--bs-secondary-color); }

.file-tile-name {
  font-weight: 600;
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-tile-meta {
  font-size: 0.72rem;
  color: var(--bs-secondary-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-tile-expiry {
  color: var(--bs-tertiary-color);
}

/* details view */
.file-row {
  cursor: pointer;
  user-select: none;
}

.file-row.selected {
  --bs-table-bg: rgba(var(--bs-primary-rgb), 0.12);
}

th.sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.sort-ind {
  margin-left: 0.25rem;
  font-size: 0.7em;
}

.file-row-name {
  max-width: 28rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-row-icon {
  display: inline-block;
  margin-right: 0.5rem;
  vertical-align: -0.2rem;
}

.file-row-icon svg {
  width: 16px;
  height: 16px;
}

/* navbar theme toggle: collapse the wrapper span's line box so the icon centers */
#btn-theme {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#theme-icon {
  display: flex;
}

/* context menu */
.context-menu {
  position: fixed;
  z-index: 2000;
  min-width: 11rem;
}

/* editor & previews */
#monaco-container {
  height: 70vh;
  width: 100%;
}

.preview-body {
  background: var(--bs-tertiary-bg);
}

.preview-img {
  max-width: 100%;
  max-height: 75vh;
}

.preview-pdf {
  width: 100%;
  height: 75vh;
  border: 0;
}
