.library-controls {
  display: grid;
  grid-template-columns: minmax(240px, 1.5fr) minmax(190px, 1fr) auto auto;
  gap: 12px;
  align-items: end;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(34, 211, 238, .24);
  border-radius: 12px;
  background: rgba(4, 15, 25, .58);
}

.library-controls label {
  color: #c1cbe0;
  font-size: 11px;
  font-weight: 700;
}

.library-controls input,
.library-controls select {
  width: 100%;
  margin-top: 6px;
  padding: 10px 11px;
  border: 1px solid #303c55;
  border-radius: 9px;
  outline: none;
  background: #0b1220;
  color: #f4f7ff;
}

.library-controls input:focus,
.library-controls select:focus {
  border-color: var(--accent2);
}

.library-collapse-actions {
  display: flex;
  gap: 7px;
}

.library-count {
  align-self: center;
  color: #8ce9f7;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.library-drag-help {
  margin: 10px 2px 0;
  color: #91a7bd;
  font-size: 11px;
}

.library-drag-help strong,
.library-drag-help span {
  color: #8ce9f7;
}

.widget-folder {
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid rgba(79, 107, 139, .5);
  border-radius: 13px;
  background: rgba(4, 13, 23, .5);
}

.widget-folder .widget-folder {
  margin-top: 10px;
  margin-left: 18px;
  border-color: rgba(79, 107, 139, .38);
  background: rgba(9, 20, 34, .72);
}

.widget-folder-header {
  display: flex;
  align-items: center;
  padding-left: 8px;
  background: linear-gradient(90deg, rgba(34, 211, 238, .1), rgba(139, 92, 246, .06));
}

.widget-folder-toggle {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 9px;
  padding: 11px 13px;
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: left;
}

.widget-folder-header:hover {
  background: linear-gradient(90deg, rgba(34, 211, 238, .16), rgba(139, 92, 246, .1));
}

.folder-drag-handle,
.folder-drag-placeholder {
  display: inline-grid;
  width: 26px;
  height: 30px;
  flex: 0 0 26px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 7px;
  color: #6f849b;
  font-size: 18px;
  line-height: 1;
  user-select: none;
}

.folder-drag-handle {
  cursor: grab;
}

.folder-drag-handle:hover,
.folder-drag-handle:focus-visible {
  border-color: rgba(34, 211, 238, .4);
  outline: none;
  background: rgba(34, 211, 238, .1);
  color: #8ce9f7;
}

.folder-drag-handle:active {
  cursor: grabbing;
}

.folder-chevron,
.widget-chevron {
  display: inline-grid;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  place-items: center;
  border-radius: 6px;
  background: rgba(34, 211, 238, .12);
  color: #8ce9f7;
  font-size: 18px;
  line-height: 1;
}

.folder-count {
  margin-left: auto;
  color: #8fa3ba;
  font-size: 11px;
}

.folder-drop-label {
  display: none;
  margin-left: auto;
  color: #a7f3d0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.widget-folder.is-drop-target {
  border-color: #34d399;
  box-shadow: 0 0 0 2px rgba(52, 211, 153, .2), 0 12px 30px rgba(0, 0, 0, .2);
}

.widget-folder.is-drop-target > .widget-folder-header {
  background: linear-gradient(90deg, rgba(52, 211, 153, .22), rgba(34, 211, 238, .12));
}

.widget-folder.is-drop-target > .widget-folder-header .folder-count {
  display: none;
}

.widget-folder.is-drop-target > .widget-folder-header .folder-drop-label {
  display: block;
}

.widget-folder-body {
  padding: 0 12px 12px;
}

.widget-folder-body[hidden],
.widget-body[hidden] {
  display: none;
}

.widget-folder-body > .widget {
  margin-top: 12px;
}

.widget-top {
  min-height: 38px;
}

.widget-drag-handle {
  display: inline-grid;
  width: 28px;
  height: 32px;
  flex: 0 0 28px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 7px;
  color: #6f849b;
  font-size: 20px;
  line-height: 1;
  cursor: grab;
  user-select: none;
}

.widget-drag-handle:hover,
.widget-drag-handle:focus-visible {
  border-color: rgba(34, 211, 238, .4);
  outline: none;
  background: rgba(34, 211, 238, .1);
  color: #8ce9f7;
}

.widget-drag-handle:active {
  cursor: grabbing;
}

.widget.is-dragging {
  opacity: .35;
}

.widget-folder.folder-is-dragging {
  opacity: .42;
}

.widget.drop-before {
  box-shadow: inset 0 3px 0 #22d3ee, 0 0 0 1px rgba(34, 211, 238, .25);
}

.widget.drop-after {
  box-shadow: inset 0 -3px 0 #22d3ee, 0 0 0 1px rgba(34, 211, 238, .25);
}

#panel.is-organizing .widget-folder-toggle {
  outline: 1px dashed rgba(34, 211, 238, .28);
  outline-offset: -4px;
}

.widget-toggle {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 9px;
  padding: 4px 6px 4px 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.widget-toggle:hover {
  border-color: transparent;
  background: transparent;
}

.widget-heading {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 10px;
}

.widget-label {
  min-width: 0;
}

.widget-summary {
  display: none;
  min-width: 0;
  overflow: hidden;
  color: #8194ab;
  font-size: 11px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.widget.is-collapsed {
  padding-top: 9px;
  padding-bottom: 9px;
}

.widget.is-collapsed .widget-summary {
  display: block;
}

.widget.is-collapsed .widget-scope {
  opacity: .75;
}

@media (max-width: 900px) {
  .library-controls {
    grid-template-columns: 1fr 1fr;
  }

  .library-count {
    justify-self: end;
  }
}

@media (max-width: 620px) {
  .library-controls {
    grid-template-columns: 1fr;
  }

  .library-count {
    justify-self: start;
  }

  .widget-heading {
    display: block;
  }

  .widget-summary {
    margin-top: 3px;
  }
}
