/* Thumbnail grid, dropzone overlay, and the shortcuts panel. */

.gallery {
    flex: none;
    width: 380px;
    min-width: 220px;
    max-width: 70vw;
    overflow-y: auto;
    padding: 14px 14px 14px 9px;
    scrollbar-width: thin;
    scrollbar-color: #2c3244 transparent;
}

.gallery::-webkit-scrollbar { width: 9px; }
.gallery::-webkit-scrollbar-thumb { background: #2c3244; border-radius: 9px; }

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 11px;
}

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color .15s, transform .15s;
}

.card:hover { border-color: #39415a; transform: translateY(-2px); }

.card.active {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent), 0 0 22px var(--accent-soft);
}

.thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #0a0c11;
    display: block;
}

.thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.thumb .dur {
    position: absolute;
    right: 5px;
    bottom: 5px;
    padding: 1px 6px;
    border-radius: 5px;
    background: rgba(0, 0, 0, .78);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

.card-body { padding: 8px 9px 9px; }

.card-title {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.card-sub { color: var(--muted); font-size: 11px; margin-top: 3px; }

.gallery-empty {
    color: var(--muted);
    text-align: center;
    padding: 40px 10px;
    font-size: 13px;
}

.gallery-empty.hidden { display: none; }

/* ---------- Dropzone ---------- */

.dropzone {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(11, 13, 18, .88);
    z-index: 50;
}

.dropzone.show { display: flex; }

.dropzone-inner {
    padding: 46px 62px;
    border: 2px dashed var(--accent);
    border-radius: 16px;
    font-size: 17px;
    color: var(--text);
}

/* ---------- Shortcuts panel ---------- */

.shortcuts {
    position: fixed;
    inset: 0;
    margin: auto;
    width: min(400px, 90vw);
    height: fit-content;
    padding: 20px 24px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .6);
    z-index: 60;
}

.shortcuts[hidden] { display: none; }
.shortcuts h2 { margin: 0 0 14px; font-size: 15px; }
.shortcuts ul { margin: 0; padding: 0; list-style: none; }

.shortcuts li {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 0;
    border-bottom: 1px solid var(--line);
    font-size: 13px;
}

.shortcuts li:last-child { border-bottom: 0; }
.shortcuts li span { margin-left: auto; color: var(--muted); }
