    .breadcrumb { margin-bottom: 15px; }
    .breadcrumb span { cursor: pointer; color: #0073e6; }
    .breadcrumb span:hover { text-decoration: underline; }
    .breadcrumb .divider { margin: 0 5px; color: #666; }

    .actions { margin-bottom: 15px; }
    .actions button {
      margin-right: 10px;
      padding: 6px 12px;
      border: none;
      border-radius: 5px;
      background: #0073e6;
      color: white;
      cursor: pointer;
      font-size: 14px;
    }
    .actions button:hover { background: #005bb5; }

/*
 * This is the correct CSS for a responsive grid layout.
 * It makes the #explorer container a grid and its children (.item)
 * will automatically wrap into new rows as needed.
 */
#explorer {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
}

/*
 * This styles the individual file/folder items.
 * The display property here is not for the container, but for the
 * item's internal content layout.
 */
.item {
    display: flex; /* This makes the icon, name, and buttons flex items within the item box */
    flex-direction: column;
    align-items: center;
    background: white;
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.15s ease;
    min-width: 0; /* Important for flex/grid children to allow shrinking */
}

.item .buttons {
  display: flex;
  gap: 4px;
  margin-top: 5px;
}

.item .icon { font-size: 40px; margin-bottom: 8px; }
.item:hover { transform: scale(1.05); }

/* Style the filename link and the folder name div */
.item a, 
.item div:nth-child(2) {
    width: 100%;            /* Fill the container width */
    text-align: center;
    white-space: nowrap;     /* Force text into a single line */
    overflow: hidden;        /* Hide the part that overflows */
    text-overflow: ellipsis; /* Add the "..." */
    display: block;          /* Ensure block-level behavior for truncation */
}

/* Optional: Show full name on hover */
.item a:hover, 
.item div:nth-child(2):hover {
    overflow: visible;
    white-space: normal;
    word-break: break-all;
    background: #fff;
    position: relative;
    z-index: 10;
}

.folder { color: #f4b400; }
.file { color: #4285f4; }

#file-explorer-section label {
    display: flex;
    align-items: center;
    font-weight: bold;
    margin-bottom: 10px;
}
