.mystuff-app {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #1e1e2e;
    color: #cdd6f4;
    font-size: 12px;
    font-family: "Segoe UI", system-ui, sans-serif;
}

/* ── Toolbar ── */
.mystuff-toolbar {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 6px 8px;
    background: #1e1e2e;
    border-bottom: 1px solid #313244;
    flex-shrink: 0;
}

.mystuff-btn {
    width: 30px;
    height: 28px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    color: #a6adc8;
    cursor: pointer;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.mystuff-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.06);
    color: #cdd6f4;
}

.mystuff-btn:active:not(:disabled) {
    background: rgba(255, 255, 255, 0.12);
}

.mystuff-btn:disabled {
    color: #45475a;
    cursor: default;
}

.mystuff-toolbar-sep {
    width: 1px;
    height: 18px;
    background: #313244;
    margin: 0 4px;
    flex-shrink: 0;
}

.mystuff-view-btn {
    font-size: 16px;
    margin-left: 4px;
}

/* ── Breadcrumb ── */
.mystuff-breadcrumb {
    flex: 1;
    background: #181825;
    border: 1px solid #313244;
    border-radius: 4px;
    padding: 4px 10px;
    color: #a6adc8;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 2px;
    overflow: hidden;
    white-space: nowrap;
    margin: 0 6px;
    min-width: 0;
    transition: border-color 0.15s;
}

.mystuff-breadcrumb:hover {
    border-color: #45475a;
}

.mystuff-crumb {
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
    color: #89b4fa;
    transition: background 0.12s, color 0.12s;
}

.mystuff-crumb:hover {
    background: rgba(137, 180, 250, 0.12);
    color: #b4d0fb;
}

.mystuff-crumb:last-child {
    color: #cdd6f4;
    font-weight: 500;
}

.mystuff-crumb-sep {
    color: #585b70;
    margin: 0 1px;
    font-size: 11px;
    user-select: none;
}

/* ── Search / filter bar ── */
.mystuff-search-box {
    display: flex;
    align-items: center;
    background: #181825;
    border: 1px solid #313244;
    border-radius: 4px;
    padding: 0 8px;
    gap: 4px;
    flex-shrink: 0;
    transition: border-color 0.15s;
    width: 150px;
}

.mystuff-search-box:focus-within {
    border-color: #89b4fa;
}

.mystuff-search-icon {
    color: #585b70;
    font-size: 11px;
    flex-shrink: 0;
    pointer-events: none;
}

.mystuff-search-input {
    background: transparent;
    border: none;
    outline: none;
    color: #cdd6f4;
    font-size: 11px;
    padding: 5px 0;
    width: 100%;
    font-family: inherit;
}

.mystuff-search-input::placeholder {
    color: #585b70;
}

/* ── Main layout ── */
.mystuff-main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ── Sidebar ── */
.mystuff-sidebar {
    width: 170px;
    border-right: 1px solid #313244;
    overflow-y: auto;
    padding: 6px 0;
    flex-shrink: 0;
    background: #181825;
}

.mystuff-sidebar-label {
    padding: 6px 14px 4px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #585b70;
    font-weight: 600;
    user-select: none;
}

.mystuff-dir-item {
    padding: 5px 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-radius: 0;
    border-left: 2px solid transparent;
    transition: background 0.12s, border-color 0.12s;
    font-size: 12px;
}

.mystuff-dir-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.mystuff-dir-item.active {
    background: rgba(137, 180, 250, 0.08);
    border-left-color: #89b4fa;
    color: #cdd6f4;
}

.mystuff-dir-icon {
    font-size: 14px;
    flex-shrink: 0;
}

/* ── File area ── */
.mystuff-files {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    position: relative;
}

/* ── Icon view ── */
.mystuff-icon-view {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 2px;
    padding: 4px;
}

.mystuff-file-item {
    width: 88px;
    padding: 10px 6px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: default;
    border-radius: 4px;
    border: 1px solid transparent;
    transition: background 0.1s, border-color 0.1s;
    position: relative;
}

.mystuff-file-item:hover {
    background: rgba(205, 214, 244, 0.04);
    border-color: rgba(205, 214, 244, 0.06);
}

.mystuff-file-item.mystuff-selected {
    background: rgba(137, 180, 250, 0.12);
    border-color: rgba(137, 180, 250, 0.25);
}

.mystuff-file-item.mystuff-selected:hover {
    background: rgba(137, 180, 250, 0.16);
}

.mystuff-file-icon {
    font-size: 32px;
    margin-bottom: 6px;
    line-height: 1;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}

.mystuff-file-name {
    font-size: 11px;
    word-break: break-word;
    line-height: 1.3;
    max-width: 80px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mystuff-file-item.mystuff-selected .mystuff-file-name {
    background: rgba(137, 180, 250, 0.2);
    border-radius: 2px;
    padding: 0 3px;
}

/* ── Tooltip ── */
.mystuff-tooltip {
    position: fixed;
    background: #1e1e2e;
    border: 1px solid #45475a;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 11px;
    color: #a6adc8;
    pointer-events: none;
    z-index: 9999;
    max-width: 260px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    line-height: 1.5;
    white-space: pre-line;
}

.mystuff-tooltip-name {
    color: #cdd6f4;
    font-weight: 500;
    margin-bottom: 2px;
}

.mystuff-tooltip-detail {
    color: #7f849c;
    font-size: 10px;
}

/* ── Detail view ── */
.mystuff-detail-view {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
}

.mystuff-detail-header {
    display: flex;
    padding: 6px 12px;
    border-bottom: 1px solid #313244;
    font-size: 11px;
    color: #7f849c;
    font-weight: 600;
    position: sticky;
    top: 0;
    background: #1e1e2e;
    z-index: 1;
    user-select: none;
}

.mystuff-detail-header span {
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: background 0.12s, color 0.12s;
}

.mystuff-detail-header span:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #a6adc8;
}

.mystuff-sort-arrow {
    font-size: 8px;
    color: #89b4fa;
    line-height: 1;
}

.mystuff-detail-row {
    display: flex;
    padding: 4px 12px;
    cursor: default;
    border: 1px solid transparent;
    border-radius: 0;
    transition: background 0.08s;
    align-items: center;
    min-height: 26px;
}

.mystuff-detail-row:nth-child(even) {
    background: rgba(255, 255, 255, 0.015);
}

.mystuff-detail-row:hover {
    background: rgba(205, 214, 244, 0.04);
}

.mystuff-detail-row.mystuff-selected {
    background: rgba(137, 180, 250, 0.12);
    border-color: rgba(137, 180, 250, 0.25);
}

.mystuff-detail-row.mystuff-selected:hover {
    background: rgba(137, 180, 250, 0.16);
}

.mystuff-col-name {
    flex: 3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mystuff-col-type {
    flex: 1.5;
    color: #7f849c;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
}

.mystuff-col-size {
    flex: 1;
    color: #7f849c;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

.mystuff-detail-icon {
    font-size: 16px;
    flex-shrink: 0;
    line-height: 1;
}

/* ── States ── */
.mystuff-empty {
    padding: 60px 30px 30px;
    color: #585b70;
    text-align: center;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.mystuff-empty-icon {
    font-size: 40px;
    opacity: 0.4;
}

.mystuff-empty-text {
    font-size: 13px;
    line-height: 1.5;
}

.mystuff-empty-sub {
    font-size: 11px;
    color: #45475a;
    font-style: italic;
}

.mystuff-error {
    padding: 20px;
    color: #f38ba8;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mystuff-loading {
    padding: 40px 20px;
    color: #585b70;
    text-align: center;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.mystuff-loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #313244;
    border-top-color: #89b4fa;
    border-radius: 50%;
    animation: mystuff-spin 0.8s linear infinite;
}

@keyframes mystuff-spin {
    to { transform: rotate(360deg); }
}

/* ── Status bar ── */
.mystuff-statusbar {
    padding: 4px 12px;
    background: #181825;
    border-top: 1px solid #313244;
    color: #7f849c;
    font-size: 10px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 16px;
}

.mystuff-status-left {
    flex: 1;
}

.mystuff-status-right {
    color: #585b70;
    font-size: 10px;
}

/* ── Scrollbar ── */
.mystuff-sidebar::-webkit-scrollbar,
.mystuff-files::-webkit-scrollbar {
    width: 6px;
}

.mystuff-sidebar::-webkit-scrollbar-track,
.mystuff-files::-webkit-scrollbar-track {
    background: transparent;
}

.mystuff-sidebar::-webkit-scrollbar-thumb,
.mystuff-files::-webkit-scrollbar-thumb {
    background: #313244;
    border-radius: 3px;
}

.mystuff-sidebar::-webkit-scrollbar-thumb:hover,
.mystuff-files::-webkit-scrollbar-thumb:hover {
    background: #45475a;
}

/* ── Transition for file list ── */
.mystuff-files.mystuff-loading-state {
    opacity: 0.5;
    pointer-events: none;
}

/* ── Selection highlight for keyboard nav ── */
.mystuff-file-item:focus,
.mystuff-detail-row:focus {
    outline: 1px solid rgba(137, 180, 250, 0.4);
    outline-offset: -1px;
}
