#musicbrowser {
  font-size: 16px;
}

#lightshowbrowser {
  font-size: 16px;
}

.fb-dragimage {
  width: 300px;
  height: 150px;
  top: -500px;
  background: blue;
  position: fixed;
}

.fb-splitter {
  width: 4px;
  background: var(--border-strong);
  border: 0;
  border-radius: 2px;
  cursor: col-resize;
  margin-left: 1px;
  margin-right: 1px;
  touch-action: none;
  transition: background-color .15s;
}

.fb-splitter:hover {
  background: var(--accent);
}

.fb-splitterflag {
  position: fixed;
  width: 40px;
  height: 64px;
  top: 50%;
  background: var(--elev);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-1);
  cursor: col-resize;
  touch-action: none;
}

@media(hover: hover) {
  .fb-splitterflag {
    visibility: hidden;
  }
}

.fb-selection-rect {
  position: absolute;
  background-color: var(--accent-soft);
  border: 1px solid var(--accent);
}

.fb-tree {
  overflow-y:auto;
  flex-grow: 1;
  padding-left: 30px;
  margin-top: 4px;
  margin-bottom: 0;
}

.fb-tree ul {
  padding-left: 20px; /* indent of each tree level */
}

.fb-tree li {
  display: block; /* remove bullet point from list */
  position: relative;
}

details summary::-webkit-details-marker {
  display:none;
}

.fb-tree summary {
  display: block; /* delete the default triangle expander */
  cursor: pointer;
  width: max-content;
  padding: 4px 10px;
  margin-left: 2px;
  color: var(--text);
  font-weight: 600;
  border-radius: var(--r-pill);
  transition: background-color .15s, color .15s;
}

.fb-tree summary:hover {
  color: var(--text);
  background: var(--hover);
}

/* The expander sits left of the summary box. A click there has offsetX < 0,
   which only opens or closes the folder; keep it outside the box. */
.fb-tree summary::before {
  content: '';
  top: 4px;
  left: -20px;
  width: 19px;
  height: 19px;
  display: block;
  position: absolute;
  background: radial-gradient(circle, var(--icon-off) 3px, transparent 3.5px);
  border-radius: 50%;
  border-color: transparent;
  transition: background-color .15s;
}

.fb-tree summary:has(+ ul:not(:empty))::before {
  background: var(--text-3);
  -webkit-mask: var(--i-chev-right) center/14px no-repeat;
  mask: var(--i-chev-right) center/14px no-repeat;
  border-color: transparent;
}

.fb-tree details[open] > summary:has(+ ul:not(:empty))::before {
  background: var(--accent);
  transform: rotate(90deg);
}

summary.fb-droptarget,
.fb-direntry.fb-droptarget,
.fb-fileentry.fb-droptarget {
  color: var(--on-ok);
  background: var(--ok);
  border-radius: 50vh;
  box-shadow: 0 0 0 2px var(--ok);
}

summary.fb-droptarget.fb-selected,
.fb-direntry.fb-droptarget.fb-selected,
.fb-fileentry.fb-droptarget.fb-selected {
  color: var(--on-ok);
  background: var(--ok);
  border-radius: 50vh;
  box-shadow: 0 0 0 30px var(--ok-soft);
  clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%, 0 50%)
}

.fb-fileslist.fb-droptarget {
  box-shadow: inset 0 0 0 3px var(--ok);
  background: var(--ok-soft);
}

.fb-treediv > ul.fb-droptarget,
details > ul.fb-droptarget {
  box-shadow: inset 0 0 0 3px var(--ok);
  background: var(--ok-soft);
}

.fb-treerootpath {
  position: relative;
  padding: 0 2px 0 2px;
  font-weight: bold;
  font-size: larger;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  white-space: nowrap;
  min-height: 25px;
  max-height: 25px;
  margin: auto 5px auto 5px;
}

.fb-diskinfo-outer {
  position: absolute;
  right: -4px;
  bottom: 0;
  width: 26px;
  height: 26px;
  background: var(--surface-2);
}

.fb-diskinfo-inner {
  position: absolute;
  left: 4px;
  top: 4px;
  width: 16px;
  height: 16px;
  border: 1px solid;
  border-color: var(--text-3);
  border-radius: 50%;
  font-weight: 600;
  font-size: 11px;
  line-height: 16px;
  color: var(--text-3);
  text-align: center;
  cursor: help;
  transition: background-color .15s, color .15s, border-color .15s;
}

.fb-diskinfo-inner::before {
  content: 'i';
}

.fb-diskinfo-outer:hover .fb-diskinfo-inner {
  color: var(--on-accent);
  background: var(--accent);
  border-color: var(--accent);
}

.fb-diskinfo {
  visibility: hidden;
  position: fixed;
  margin-top: 20px;
  height: 20px;
  width: auto;
  z-index: 1;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-2);
  padding: 5px 8px 3px 8px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  background: var(--elev);
}

.fb-diskinfo-outer:hover .fb-diskinfo {
  visibility: visible;
}

.fb-treerootpath:has(.fb-treerootpathsinglelabel) {
  padding: 2px;
  min-height: 21px;
  max-height: 21px;
}

.fb-dirpath {
  padding: 2px 6px;
  font-weight: bold;
  font-size: larger;
  color: var(--text-3);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  white-space: nowrap;
  min-height: 21px;
  max-height: 21px;
}

.fb-crumb {
  color: var(--accent);
  text-decoration: none;
  cursor: pointer;
  display: inline-block;
}

.fb-crumb:hover {
  text-decoration: underline;
}

.fb-dirpath a:not(.fb-crumb) {
  color: var(--text);
  font-weight: 600;
}

.fb-crumb.fb-droptarget {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

/* entries hold only the name text; the icons are pseudo-elements */
.fb-fileentry {
  cursor: pointer;
  padding: 4px 10px;
  width: max-content;
  margin-left: 1px;
  color: var(--text);
  border-radius: var(--r-pill);
  transition: background-color .15s, color .15s;
}

.fb-direntry::before,
.fb-fileentry::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 8px;
  vertical-align: -3px;
}

.fb-direntry::before {
  background-color: var(--accent);
  -webkit-mask: var(--i-folder) center/contain no-repeat;
  mask: var(--i-folder) center/contain no-repeat;
}

.fb-fileentry::before {
  background-color: var(--text-3);
  -webkit-mask: var(--i-music) center/contain no-repeat;
  mask: var(--i-music) center/contain no-repeat;
}

.fb-fileentry:hover:not([contenteditable="true"]) {
  color: var(--text);
  background: var(--hover);
  border-radius: 50vh;
}

.fb-fileentry.fb-selected {
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-radius: var(--r-sm);
}

.fb-fileentry.fb-selected:hover:not([contenteditable="true"]) {
  color: var(--on-accent);
  background: var(--accent);
  border-radius: 50vh;
  box-shadow: 0 0 0 30px var(--accent-soft);
  clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%, 0 50%)
}

.fb-direntry {
  cursor: pointer;
  padding: 4px 10px;
  font-weight: 600;
  width: max-content;
  margin-left: 1px;
  color: var(--text);
  border-radius: var(--r-pill);
  transition: background-color .15s, color .15s;
}

.fb-direntry:hover:not([contenteditable="true"]) {
  color: var(--text);
  background: var(--hover);
  border-radius: 50vh;
  border-color: transparent;
}

.fb-direntry.fb-selected {
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-radius: var(--r-sm);
}

.fb-direntry.fb-selected:hover:not([contenteditable="true"]) {
  color: var(--on-accent);
  background: var(--accent);
  border-radius: 50vh;
  box-shadow: 0 0 0 30px var(--accent-soft);
  clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%, 0 50%)
}

/* icon follows the text colour on the solid accent background */
.fb-direntry.fb-selected:hover:not([contenteditable="true"])::before,
.fb-fileentry.fb-selected:hover:not([contenteditable="true"])::before {
  background-color: currentColor;
}

.fb-direntry[contenteditable="true"],
.fb-fileentry[contenteditable="true"] {
  outline: 2px solid var(--accent);
  background: var(--surface-2);
  border-radius: var(--r-sm);
}

.fb-treediv {
  display: flex;
  flex-direction: column;
  float: left;
  background: var(--surface-2);
  min-width: 15%;
  max-width: 85%;
  width: 30%;
  height: 100%;
  overflow-y:auto;
  user-select: none;
}

.fb-filesdiv {
  flex: 1;
  display: flex;
  flex-direction: column;
  float: left;
  background: var(--surface);
  height: 100%;
  margin-left: 2px;
  overflow-x:auto;
  user-select: none;
}

.fb-fileslist {
  position: relative;
  height: 100%;
  margin-top: 4px;
  overflow-y:auto;
  flex-grow: 1;
}

/* room at the end so the last rows scroll clear of the floating button bar */
.fb-fileslist::after {
  content: "";
  display: block;
  height: 88px;
}

.fb-playertitle {
  color: var(--text);
  font-weight: 600;
  height: 30px;
  padding: 10px 8px 6px 8px;
  white-space: nowrap;
  overflow: auto;
  text-align: left;
  scroll-behavior: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.fb-playertitle::-webkit-scrollbar {
  display: none;
}

.fb-player {
  position: absolute;
  width: 300px;
  height: 100px;
  left: 50%;
  top: 75%;
  background: var(--elev);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-2);
  padding: 10px;
  transform: translate(-50%, -50%);
}

.fb-dropinfo-holder {
  position: fixed;
  visibility:  hidden;
  z-index: 98;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  background: rgba(0,0,0,0);
}

.fb-dropinfo {
  width: 350px;
  width: min(350px, calc(100% - 20px));
  height: 150px;
  top: calc(100% / 2 - 75px);
  left: calc(100% / 2 - 177px);
  left: max(8px, calc(50% - 177px));
  border-radius: var(--r-lg);
  position: relative;
  visibility: inherit;
  background: var(--elev);
  color: var(--text);
  border: 1px solid var(--border);
  z-index: 99;
  padding: 1px;
  box-shadow: var(--shadow-2);
  user-select: none;
  outline: none !important;
}

.fb-dropinfo-line1 {
  position: absolute;
  top: 16px;
  left: 20px;
  font-weight: 600;
}

.fb-dropinfo-line2 {
  position: absolute;
  left: 20px;
  right: 20px;
  top: 40px;
  height: 30px;
  white-space: nowrap;
  overflow: auto;
  text-align: left;
  scroll-behavior: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.fb-dropinfo-line2::-webkit-scrollbar {
  display: none;
}

.fb-dropinfo-line3 {
  position: absolute;
  left: 20px;
  right: 60px;
  bottom: 5px;
  height: 30px;
  white-space: nowrap;
  overflow: auto;
  text-align: left;
  scroll-behavior: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.fb-dropinfo-line3::-webkit-scrollbar {
  display: none;
}

.fb-dropinfo-closebutton {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 20px;
  height: 20px;
  background: transparent;
  color: var(--text-3);
  text-align: center;
  cursor: pointer;
}

.fb-dropinfo-closebutton:hover {
  font-weight: bold;
  color: var(--text);
}

.fb-dropinfo-cancel {
  position: absolute;
  bottom: 8px;
  right: 8px;
}

button.fb-dropinfo-cancel:not(.flatbutton) {
  min-height: 32px;
  padding: 0 12px;
}

.fb-dropinfo-progress {
  position: absolute;
  left: 20px;
  width: calc(100% - 28px);
  top: 90px;
  accent-color: var(--accent);
}

/* longhands only, so the per-button background-image rules below survive */
.fb-barbutton {
  float: left;
  width: 48px;
  height: 48px;
  border: none;
  padding: 0;
  z-index: 3;
  display: none;
  border-radius: 50%;
  background-color: transparent;
  background-position: center;
  background-size: 26px;
  background-repeat: no-repeat;
  cursor: pointer;
  transition: background-color .15s;
}

.fb-barbutton:hover {
  background-color: var(--hover);
}

/* the bar icons are black SVGs */
@media (prefers-color-scheme: dark) {
  .fb-barbutton {
    filter: invert(1);
  }
  .fb-barbutton:hover {
    background-color: rgba(0, 0, 0, .14);
  }
}

.fb-barbutton.fb-visiblebarbutton {
  display: block;
}

.fb-trashbutton {
  background-image: url(icons/trash.svg);
}

.fb-pencilbutton {
  background-image: url(icons/pencil.svg);
}

.fb-uploadbutton {
  background-image: url(icons/upload.svg);
}

.fb-downloadbutton {
  background-image: url(icons/download.svg);
}

.fb-newfolderbutton {
  background-image: url(icons/newfolder.svg);
}

.fb-locksoundbutton {
  background-image: url(icons/locksound.svg);
}

.fb-buttonbar {
  position: fixed;
  right: 24px;
  bottom: 24px;
  height: 48px;
  padding: 0 8px 0 8px;
  background-color: var(--elev);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-2);
  z-index: 2;
  border-radius: var(--r-pill);
}

@media(hover: hover) {
  .uploadbutton {
    display: none;
  }
}

.fb-driveselector {
  font: 600 15px var(--font);
  color: var(--text);
  background: var(--surface);
  border-width: 1px;
  border-style: solid;
  border-color: var(--border-strong);
  border-radius: var(--r-sm);
  padding: 0 6px;
}

.fb-driveselector:focus {
  outline: none;
}

.fb-driveselector:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* touch screens: taller rows in the Files tab */
@media (pointer: coarse) {
  .fb-fileentry,
  .fb-direntry,
  .fb-tree summary {
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .fb-tree summary::before {
    top: 10px;
  }
}
