body {
  --nav-item-padding: calc(8px * var(--density-modifier)) 8px calc(8px * var(--density-modifier)) 24px;
  --nav-indentation-guide-width: 0px;

  --ribbon-width: var(--header-height);
  --ribbon-background: transparent;
  --ribbon-background-collapsed: var(--ribbon-background);
}

body:not(.is-mobile) {
  --ribbon-padding: var(--header-height) 0 0 16px;
}

body.is-mobile {
  --nav-item-padding: calc(12px * var(--density-modifier)) 24px;
  --nav-item-children-margin-start: 12px;
}

@keyframes workspaceLeafIn {
  from {
    opacity: 0;
    transform: scale(0.95);
    filter: blur(4px);
  }
}

.sidebar-toggle-icon-inner {
  transition: var(--anim-duration-moderate) var(--anim-motion-baseline);
}
.sidebar-toggle-button .clickable-icon:hover .sidebar-toggle-icon-inner {
  width: 24%;
}
.workspace.is-left-sidedock-open .sidebar-toggle-button.mod-left .clickable-icon:hover .sidebar-toggle-icon-inner,
.workspace.is-right-sidedock-open .sidebar-toggle-button.mod-right .clickable-icon:hover .sidebar-toggle-icon-inner {
  width: revert-layer;
}

// File navigation
body:not(.nav-item-subtle, .nav-item-strong) {
  --nav-item-background-hover: transparent;
  --nav-item-background-active: transparent;
  --nav-item-weight-active: calc(var(--font-weight) + var(--bold-modifier));

  &:not(.is-mobile) {
    --nav-item-weight-hover: var(--font-medium);
  }

  .tree-item-self:not(:hover) .tree-item-inner {
    transition: var(--anim-duration-moderate), font-weight 0s;
  }

  .nav-files-container .tree-item-self.is-active::before {
    content: "";
    position: absolute;
    margin-left: -12px;
    width: 4px;
    height: 4px;
    border-radius: var(--button-radius);
    background-color: var(--nav-item-color-active);
  }
}
body.nav-item-strong {
  --nav-item-background-active: var(--interactive-accent);
  --nav-item-color-active: var(--text-on-accent);
}
body.full-item-name {
  --nav-item-white-space: none;
}
body.bold-folders .nav-folder-title {
  --nav-item-weight: calc(var(--font-weight) + var(--bold-modifier));
  --nav-item-weight-hover: calc(var(--font-weight) + var(--bold-modifier));
}

// File explorer
.tree-item-self,
.tree-item-inner {
  align-items: center;
}

// Panel actions style
.nav-header {
  display: flex;
  justify-content: center;
  flex-direction: column;
  align-items: center;
}
.nav-header .nav-buttons-container {
  flex-wrap: nowrap;
}
.nav-header .search-input-container {
  margin: 8px 0;
  width: 100%;
}
.nav-action-button,
.nav-action-button[aria-disabled="true"] {
  position: relative;
  height: 100%;
}

// Ribbon
.workspace-ribbon.mod-left {
  contain: content;
  margin-top: 0;
  border-right: none;
  z-index: 11;
  transition: var(--anim-duration-moderate) var(--anim-motion-baseline);
}
.workspace-ribbon.mod-left:before {
  content: none;
}
.workspace-ribbon.mod-left .sidebar-toggle-button {
  position: relative;
}
body.hover-ribbon .workspace-ribbon.mod-left:not(:hover) {
  --ribbon-width: 0;
}

.workspace-ribbon .sidebar-toggle-button {
  display: flex;
  height: var(--header-height);
  padding: 8px;
  width: unset;
}
body:not(.mod-macos) .workspace-ribbon .sidebar-toggle-button {
  height: fit-content;
  padding: 0;
}

// Desktop sidedock

body:not(.is-mobile) .mod-sidedock {
  & > .workspace-leaf-resize-handle:not(:hover) {
    border-color: transparent;
  }

  .workspace-leaf {
    transition: var(--anim-duration-moderate);
  }

  // Sidedock padding
  .workspace-leaf-content > .node-insert-event,
  .workspace-leaf-content > .view-content {
    padding: 0 16px;

    > div:not(.nav-header, .nav-buttons-container) {
      padding: 0;
    }
  }
}

// Animation
body .mod-sidedock {
  &:not(:active) {
    transition: var(--anim-duration-moderate) var(--anim-motion-baseline), background-color var(--anim-duration-fast) !important;
  }

  .workspace-tab-container {
    position: relative;
  }
  .workspace-leaf:not([style*="display: none"]) {
    animation: workspaceLeafIn var(--anim-duration-moderate) var(--anim-motion-baseline) forwards;
  }
}

// Vault switcher
body:not(.is-mobile) .workspace-split.mod-left-split {
  .workspace-sidedock-vault-profile {
    background-color: transparent;
    border-top: none;
    position: absolute;
    right: 0;
    bottom: 0;
    z-index: 1;
    align-items: unset;

    &::before {
      transition: var(--anim-duration-moderate) var(--anim-motion-baseline);
      content: "";
      position: absolute;
      left: 0;
      bottom: 0;
      width: 100%;
      height: 100%;
      z-index: -1;
      pointer-events: none;
      mask: linear-gradient(to top, hsl(0, 0%, 0%) 0%, hsla(0, 0%, 0%, 0.99) 18.4%, hsla(0, 0%, 0%, 0.963) 33.7%, hsla(0, 0%, 0%, 0.92) 46.4%, hsla(0, 0%, 0%, 0.864) 56.7%, hsla(0, 0%, 0%, 0.796) 64.8%, hsla(0, 0%, 0%, 0.72) 71.2%, hsla(0, 0%, 0%, 0.637) 76.1%, hsla(0, 0%, 0%, 0.55) 79.9%, hsla(0, 0%, 0%, 0.46) 82.8%, hsla(0, 0%, 0%, 0.37) 85.2%, hsla(0, 0%, 0%, 0.283) 87.3%, hsla(0, 0%, 0%, 0.2) 89.6%, hsla(0, 0%, 0%, 0.124) 92.3%, hsla(0, 0%, 0%, 0.056) 95.6%, hsla(0, 0%, 0%, 0) 100%);
      background-color: var(--background-primary);
    }
  }
  .workspace-drawer-vault-actions .clickable-icon:first-child {
    display: none;
  }

  .workspace-leaf-content > .node-insert-event,
  .workspace-leaf-content > .view-content {
    padding-bottom: 48px;
  }
}
body:not(.is-mobile, .hide-vault-switcher-off) .mod-sidedock.mod-left-split {
  .workspace-sidedock-vault-profile:not(:hover) {
    pointer-events: none;

    .workspace-drawer-vault-switcher:not(.has-active-menu) {
      opacity: 0;
      filter: blur(4px);
      pointer-events: none;
      transform: scale(0.95);
    }
    &:not(:hover)::before {
      opacity: 0;
    }
  }

  .workspace-drawer-vault-switcher,
  .workspace-drawer-vault-actions .clickable-icon {
    transition: var(--anim-duration-moderate) var(--anim-motion-baseline);
    pointer-events: visible;
  }
}

// Desktop sidedock: Style Settings
body.large-new-note .mod-sidedock .workspace-leaf-content[data-type="file-explorer"] {
  .nav-header .nav-action-button:first-child {
    flex: 1;
    box-shadow: inset 0 0 0 1px var(--background-modifier-border);
  }

  .nav-header .nav-action-button:first-child::after {
    content: attr(aria-label);
    font-size: var(--font-ui-smaller);
    color: var(--icon-color);
    white-space: nowrap;
    margin-left: 8px;
  }
}

// Mobile drawer
body.is-mobile .workspace-drawer {
  .workspace-drawer-header-name-text {
    font-family: var(--h1-font);
  }
  .workspace-drawer-active-tab-header {
    padding-inline-start: 0;
    padding-inline-end: 0;
    background-color: transparent;
    margin: 0 20px;
  }
  .workspace-drawer-active-tab-chevron {
    margin-inline-start: 0;
  }
  .workspace-drawer-active-tab-header select {
    width: 100%;
  }
}

// Tablet drawer
body.is-tablet .workspace-drawer {
  padding-top: calc(var(--safe-area-inset-top) + 16px);
}
body.is-tablet .workspace-drawer:not(.is-pinned) {
  margin: var(--safe-area-inset-top) 16px var(--safe-area-inset-bottom);
  padding-top: 16px;
  border-radius: var(--mobile-sidebar-radius);
}
