:root {
  --surface: #ffffff;
  --surface-muted: #f3f3f3;
  --border: #e2e2e2;
  --border-strong: #d0d0d0;
  --text: #202020;
  --muted: #666666;
  --hover: #f0f0f0;
  --selected: #dceeff;
  --selected-border: #9fcdf4;

  font-family:
    "Segoe UI Variable",
    "Segoe UI",
    Arial,
    sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  min-width: 760px;
  overflow: hidden;
  color: var(--text);
  background: #dddddd;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: default;
}

img,
svg {
  user-select: none;
}

.explorer {
  height: 100vh;
  display: grid;
  grid-template-rows:
    34px
    42px
    48px
    minmax(0, 1fr)
    30px;

  background: var(--surface);
  border: 1px solid #bfbfbf;
}

/*
  TITLE BAR
*/

.titlebar {
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-size: 12px;
  user-select: none;
}

.titlebar-icon {
  width: 18px;
  height: 18px;
  margin-right: 8px;
}

.external-icon {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  pointer-events: none;
}

/*
  TABS
*/

.tabbar {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 10px;
  background: var(--surface-muted);
  border-bottom: 1px solid var(--border);
}

.tab {
  min-width: 180px;
  max-width: 280px;
  height: 35px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 14px;
  overflow: hidden;
  border: 0;
  border-radius: 8px 8px 0 0;
  background: transparent;
  text-align: left;
}

.tab:hover {
  background: #e9e9e9;
}

.tab.active {
  background: var(--surface);
}

.tab-icon,
.nav-icon {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
}

.tab-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/*
  TOOLBAR
*/

.toolbar {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
}

.toolbar > button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 5px;
  background: transparent;
}

.toolbar > button:hover:not(:disabled) {
  background: var(--hover);
}

.toolbar > button:disabled {
  opacity: 0.32;
}

.toolbar-icon {
  width: 18px;
  height: 18px;
}

/*
  BREADCRUMBS
*/

.breadcrumbs {
  min-width: 190px;
  height: 34px;
  flex: 1;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 0 6px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
}

.crumb {
  height: 27px;
  display: inline-flex;
  align-items: center;
  padding: 0 6px;
  white-space: nowrap;
  border: 0;
  border-radius: 4px;
  background: transparent;
}

.crumb:hover {
  background: var(--hover);
}

.crumb-separator {
  color: #888888;
}

/*
  VIEW MENU
*/

.view-menu-container {
  position: relative;
  flex: 0 0 auto;
}

.view-menu-button {
  height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  white-space: nowrap;
}

.view-menu-button:hover,
.view-menu-button[aria-expanded="true"] {
  background: var(--hover);
}

.view-menu-main-icon {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  flex: 0 0 20px;
}

.view-menu-main-icon svg {
  width: 20px;
  height: 20px;
  display: block;
}

.view-menu-arrow {
  width: 12px;
  height: 12px;
  display: grid;
  place-items: center;
  flex: 0 0 12px;
}

.view-menu-arrow svg {
  width: 12px;
  height: 12px;
  display: block;
}

.view-dropdown {
  min-width: 194px;
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  z-index: 100;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.16),
    0 2px 5px rgba(0, 0, 0, 0.10);
}

.view-dropdown[hidden] {
  display: none;
}

.view-dropdown-item {
  width: 100%;
  height: 36px;
  display: grid;
  grid-template-columns:
    22px
    minmax(0, 1fr)
    18px;

  align-items: center;
  gap: 8px;
  padding: 0 9px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  text-align: left;
}

.view-dropdown-item:hover,
.view-dropdown-item:focus-visible {
  outline: 0;
  background: var(--hover);
}

.view-dropdown-item-icon {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
}

.view-dropdown-item-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.view-dropdown-check {
  width: 16px;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
}

.view-dropdown-item:not(.active)
.view-dropdown-check {
  visibility: hidden;
}

/*
  SEARCH
*/

.search {
  width: min(290px, 30vw);
  height: 34px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
}

.search-icon {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
}

.search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
}

/*
  WORKSPACE
*/

.workspace {
  min-height: 0;
  display: grid;
  grid-template-columns:
    240px
    minmax(0, 1fr);
}

.sidebar {
  overflow: auto;
  padding: 8px;
  border-right: 1px solid var(--border);
}

.sidebar-heading {
  padding: 15px 10px 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.nav-item {
  width: 100%;
  height: 34px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 10px;
  overflow: hidden;
  border: 0;
  border-radius: 5px;
  background: transparent;
  text-align: left;
}

.nav-item:hover {
  background: var(--hover);
}

.nav-item.active {
  background: #e5f2fc;
}

.nav-item span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content {
  min-width: 0;
  min-height: 0;
  position: relative;
  display: flex;
  flex-direction: column;
}

/*
  DETAILS HEADINGS
*/

.column-headings {
  height: 31px;
  display: grid;
  grid-template-columns:
    minmax(260px, 1fr)
    180px
    190px;

  border-bottom: 1px solid var(--border);
}

.column-headings[hidden] {
  display: none;
}

.column-headings button {
  display: flex;
  align-items: center;
  padding: 0 11px;
  border: 0;
  border-right: 1px solid var(--border);
  background: var(--surface);
  font-size: 12px;
  text-align: left;
}

.column-headings button:hover {
  background: var(--hover);
}

.sort-mark {
  margin-left: 6px;
  font-size: 9px;
}

/*
  FILE LIST
*/

.file-list {
  min-height: 0;
  flex: 1;
  overflow: auto;
  outline: 0;
}

/*
  DETAILS VIEW
*/

.file-list.details-view {
  display: block;
}

.details-row {
  min-width: 650px;
  height: 35px;
  display: grid;
  grid-template-columns:
    minmax(260px, 1fr)
    180px
    190px;

  align-items: center;
  margin: 1px 4px;
  border: 1px solid transparent;
  border-radius: 4px;
  user-select: none;
}

.details-row:hover {
  background: var(--hover);
}

.details-row.selected {
  border-color: var(--selected-border);
  background: var(--selected);
}

.file-cell {
  overflow: hidden;
  padding: 0 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.name-cell {
  display: flex;
  align-items: center;
  gap: 9px;
}

.file-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
}

/*
  SMALL AND LARGE ICON VIEWS
*/

.file-list.small-images-view,
.file-list.large-images-view {
  display: grid;
  align-content: start;
}

.file-list.small-images-view {
  grid-template-columns:
    repeat(
      auto-fill,
      minmax(180px, 1fr)
    );

  gap: 12px;
  padding: 12px;
}

.file-list.large-images-view {
  grid-template-columns:
    repeat(
      auto-fill,
      minmax(330px, 1fr)
    );

  gap: 18px;
  padding: 18px;
}

.image-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--surface);
  user-select: none;
}

.image-card:hover {
  border-color: var(--border-strong);
  background: var(--hover);
}

.image-card.selected {
  border-color: var(--selected-border);
  background: var(--selected);
}

.small-images-view .image-card {
  min-height: 170px;
}

.large-images-view .image-card {
  min-height: 300px;
}

.thumbnail-frame {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  margin: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fafafa;
}

.small-images-view .thumbnail-frame {
  height: 112px;
}

.large-images-view .thumbnail-frame {
  height: 240px;
}

/*
  Cloud Explorer V7 orientation handling.

  Every thumbnail receives the entire available frame and is fitted with
  object-fit: contain. Portrait images are therefore fitted by height and
  landscape images are fitted by width without cropping.
*/

.thumbnail-image {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center center;
}

.thumbnail-image.orientation-portrait,
.thumbnail-image.orientation-landscape,
.thumbnail-image.orientation-unknown {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
}

.endpoint-illustration {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  background: #fafafa;
}

.endpoint-illustration .external-icon {
  width: 72px;
  height: 72px;
}

.large-images-view
.endpoint-illustration
.external-icon {
  width: 112px;
  height: 112px;
}

.image-card-name {
  padding: 2px 10px 4px;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.large-images-view .image-card-name {
  padding-top: 5px;
  font-size: 14px;
}

.image-card-type {
  padding: 0 10px 10px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/*
  SHORTCUT ICON
*/

.shortcut-icon {
  width: 100%;
  height: 100%;
  position: relative;
  display: inline-block;
}

.shortcut-overlay {
  width: 12px;
  height: 12px;
  position: absolute;
  left: -4px;
  bottom: -4px;
}

.endpoint-illustration .shortcut-overlay {
  width: 24px;
  height: 24px;
  left: 2px;
  bottom: 2px;
}

.large-images-view
.endpoint-illustration
.shortcut-overlay {
  width: 32px;
  height: 32px;
}

/*
  EMPTY STATE
*/

.empty-state {
  position: absolute;
  inset: 31px 0 0;
  place-content: center;
  text-align: center;
  color: var(--muted);
  pointer-events: none;
}

.content.image-view-active .empty-state {
  inset: 0;
}

.empty-state:not([hidden]) {
  display: grid;
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto;
}

.empty-state h2 {
  margin: 9px 0 4px;
  color: var(--text);
  font-size: 18px;
  font-weight: 500;
}

.empty-state p {
  margin: 0;
  font-size: 13px;
}

/*
  STATUS BAR
*/

.statusbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px;
  border-top: 1px solid var(--border);
  font-size: 12px;
}

.status-spacer {
  flex: 1;
}

.view-button {
  width: 30px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 4px;
  background: transparent;
}

.view-button:hover,
.view-button.active {
  background: var(--hover);
}

.view-button.active {
  box-shadow:
    inset 0 0 0 1px var(--border-strong);
}

.view-button img {
  width: 17px;
  height: 17px;
}

.configuration-error {
  margin: 20px;
  padding: 18px;
  border: 1px solid #d13438;
  border-radius: 8px;
  color: #7a1013;
  background: #fde7e9;
  white-space: pre-wrap;
}

@media (max-width: 980px) {
  .workspace {
    grid-template-columns:
      190px
      minmax(0, 1fr);
  }

  .search {
    width: 210px;
  }

  .view-menu-button {
    padding: 0 7px;
  }

  .view-menu-button-label {
    display: none;
  }

  .column-headings,
  .details-row {
    grid-template-columns:
      minmax(240px, 1fr)
      150px
      160px;
  }

  .file-list.large-images-view {
    grid-template-columns:
      repeat(
        auto-fill,
        minmax(260px, 1fr)
      );
  }
}