/* ============================================================
   Linear.app inspired theme for FileHost
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Core surfaces */
    --bg: #0d0d0f;
    --card: #141416;
    --card-elevated: #1a1a1e;
    --card2: #111113;
    --card3: #0f0f11;

    /* Borders */
    --border: #232326;
    --border-hover: #2e2e33;
    --border-strong: #3a3a40;

    /* Text */
    --text: #eeeef0;
    --text-secondary: #8a8f98;
    --muted: #6b6f76;

    /* Accents (Linear-ish indigo/violet) */
    --accent: #5e6ad2;
    --accent-hover: #7b85e0;
    --accent-soft: rgba(94, 106, 210, 0.12);

    --ok: #3dd68c;
    --ok-soft: rgba(61, 214, 140, 0.12);
    --danger: #eb5757;
    --danger-soft: rgba(235, 87, 87, 0.12);

    /* Radius & shadows */
    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 14px;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 4px 24px rgba(0, 0, 0, 0.45);

    /* Transitions */
    --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 14px;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* ========== Header (Linear-style sticky + blur) ========== */
header {
    background: rgba(13, 13, 15, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 200;
    margin-bottom: 2rem;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    height: 56px;
    padding: 0 1.25rem;
}

.logo {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.01em;
}

.logo img {
    border-radius: 5px;
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    margin-left: 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.15s var(--ease);
}

nav a:hover {
    color: var(--text);
}

/* ========== Cards ========== */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    max-width: 1200px;
    margin: 0 auto 2rem;
    box-shadow: var(--shadow);
}

h1 {
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 1.25rem;
    color: var(--text);
}

h2 {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 1.5rem 0 0.75rem;
    letter-spacing: -0.01em;
}

.muted {
    color: var(--muted);
    font-size: 0.85rem;
}

.meta {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.mono {
    font-family: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace;
    font-size: 0.8rem;
}

hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1.75rem 0;
}

/* ========== Forms ========== */
.form label {
    display: block;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form input[type="text"],
.form input[type="username"],
.form input[type="password"],
.form input[type="number"],
.form input[type="file"],
.form select,
.form textarea {
    display: block;
    width: 100%;
    padding: 0.65rem 0.9rem;
    margin-top: 0.35rem;
    background: var(--card2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.form input:focus,
.form select:focus,
.form textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.form input::placeholder {
    color: var(--muted);
}

/* ========== Buttons ========== */
.form button,
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    transition: all 0.15s var(--ease);
    line-height: 1.2;
}

.form button:hover,
.btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.btn.small,
button.small {
    padding: 0.3rem 0.65rem;
    font-size: 0.8rem;
    height: 28px;
}

button.btn {
    appearance: none;
    -webkit-appearance: none;
}

button.danger,
.danger {
    background: var(--danger);
}

button.danger:hover,
.danger:hover {
    background: #f06b6b;
}

.purple-btn {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 550;
    cursor: pointer;
    margin-top: 0.75rem;
    transition: all 0.15s var(--ease);
}

.purple-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.purple-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.check {
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
    font-weight: 400 !important;
    color: var(--text) !important;
}

.check input {
    width: auto !important;
    margin: 0;
    accent-color: var(--accent);
}

.inline {
    display: inline;
}

/* ========== Alerts ========== */
.alert {
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
    border: 1px solid transparent;
}

.alert.error {
    background: var(--danger-soft);
    color: #fca5a5;
    border-color: rgba(235, 87, 87, 0.25);
}

.alert.success {
    background: var(--ok-soft);
    color: #86efac;
    border-color: rgba(61, 214, 140, 0.25);
}

/* ========== Tables ========== */
.table-wrap {
    overflow-x: auto;
    overflow-y: visible;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    overflow: visible;
}

tbody tr {
    position: relative;
}

tbody tr:hover {
    z-index: 70;
}

th,
td {
    text-align: left;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border);
}

th {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--card2);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.015);
}

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.user,
.nametags,
a.filename,
a.user,
.mono a {
    color: #a5b4fc;
    font-weight: 500;
    text-decoration: none;
}

.user:hover,
.nametags:hover,
a.filename:hover,
a.user:hover,
.mono a:hover {
    color: #c7d2fe;
}

.filename {
    color: #a5b4fc;
    font-weight: 500;
}

/* ========== Page-specific ========== */
.gallery-page .container,
.user-page .container {
    max-width: 1200px;
}

.admin-page .container {
    max-width: 1400px;
}

/* ========== Tabs ========== */
.tabs {
    display: flex;
    gap: 0.35rem;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.75rem;
}

.tabs a {
    padding: 0.4rem 0.9rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.15s var(--ease);
}

.tabs a:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
}

.tabs a.active {
    background: var(--accent-soft);
    color: #a5b4fc;
}

/* ========== Pager ========== */
.pager {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
    width: 100%;
}

.pager-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    background: var(--card-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s var(--ease);
}

.pager-btn:hover:not(.disabled) {
    background: var(--card);
    border-color: var(--border-hover);
    color: #fff;
}

.pager-btn.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

.pager-info {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.pager-info .current {
    color: var(--text);
    font-weight: 600;
}

.pager a {
    color: var(--accent);
}

/* ========== Login / Not-found ========== */
.login-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.25rem;
    max-width: 400px;
    margin: 8rem auto;
    box-shadow: var(--shadow-lg);
}

.album-not-found-card,
.file-not-found-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    max-width: 420px;
    margin: 12rem auto;
    text-align: center;
    box-shadow: var(--shadow);
}

.reg-closed {
    background: var(--accent-soft);
    color: #a5b4fc;
    padding: 0.9rem 1rem;
    border-radius: var(--radius-sm);
    text-align: center;
    margin-bottom: 1.5rem;
    font-weight: 500;
    border: 1px solid rgba(94, 106, 210, 0.25);
}

/* ========== Thumbnails / Grid ========== */
.thumb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    gap: 1.1rem;
    margin-top: 1.25rem;
}

.thumb-item {
    display: flex;
    flex-direction: column;
    background: var(--card2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    color: var(--text);
    transition: transform 0.18s var(--ease), border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.thumb-item:hover {
    transform: translateY(-3px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow);
}

.thumb-preview {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    background: #0a0a0c;
    overflow: hidden;
}

.thumb-preview .no-thumb {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0a0a0c;
    color: var(--muted);
    font-weight: 600;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.thumb-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s var(--ease);
}

.thumb-item:hover .thumb-preview img {
    transform: scale(1.03);
}

.type-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
}

.type-icon.video {
    background: rgba(94, 106, 210, 0.9);
}

.type-icon.image {
    background: rgba(59, 130, 246, 0.9);
}

.type-icon.file {
    background: rgba(100, 116, 139, 0.9);
}

.thumb-name {
    display: block;
    padding: 0.5rem 0.65rem 0.1rem;
    font-size: 0.78rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text);
    text-align: center;
    letter-spacing: -0.01em;
}

.thumb-size {
    display: block;
    padding: 0 0.65rem 0.55rem;
    font-size: 0.72rem;
    color: var(--muted);
    text-align: center;
}

.thumb-meta {
    display: block;
    padding: 0 0.5rem 0.5rem;
    font-size: 0.75rem;
    color: var(--muted);
    text-align: center;
}

.list-thumb {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 6px;
    background: #0a0a0c;
    display: block;
    cursor: zoom-in;
}

.thumb-cell {
    width: 68px;
    padding: 0.4rem !important;
    position: relative;
    overflow: visible;
    z-index: 1;
}

.thumb-cell a {
    display: inline-block;
    position: relative;
    line-height: 0;
}

/* Enlarged preview to the RIGHT of the small thumb */
.list-thumb-zoom {
    display: none;
    position: absolute;
    left: calc(100% + 14px);
    top: 50%;
    transform: translateY(-50%);
    width: 200px;
    height: 260px;
    object-fit: cover;
    border-radius: 10px;
    background: #0a0a0c;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.08);
    z-index: 90;
    pointer-events: none;
}

.thumb-cell:hover {
    z-index: 80;
}

.thumb-cell:hover .list-thumb-zoom {
    display: block;
}

.no-thumb-sm {
    display: inline-flex;
    width: 56px;
    height: 40px;
    align-items: center;
    justify-content: center;
    background: #0a0a0c;
    border-radius: 6px;
    font-size: 0.7rem;
    color: var(--muted);
    text-transform: uppercase;
    font-weight: 600;
}

/* ========== Upload ========== */
.drop-zone {
    border: 1.5px dashed var(--border-strong) !important;
    background: var(--card2) !important;
    border-radius: var(--radius-lg) !important;
    transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.drop-zone:hover {
    border-color: var(--accent) !important;
    background: rgba(94, 106, 210, 0.04) !important;
}

.upload-header {
    margin-bottom: 1.25rem;
}

.limits-box {
    background: var(--card2);
    border: 1px solid var(--border);
    padding: 1rem 1.15rem;
    border-radius: var(--radius);
    margin: 1rem 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* ========== Album header boxes ========== */
.album-header {
    display: flex;
    gap: 0.65rem;
    margin-bottom: 1.5rem;
}

.album-box {
    background: var(--card2);
    border: 1px solid var(--border);
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    transition: border-color 0.15s var(--ease);
}

.album-title-box {
    flex: 2.2;
    white-space: normal;
    word-break: break-word;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.album-box:not(.album-title-box) {
    flex: 1;
}

.album-box.selected {
    border-color: var(--ok) !important;
    background: var(--ok-soft) !important;
    box-shadow: 0 0 0 1px var(--ok);
}

/* ========== Sort bar (Linear-style pills) ========== */
.sort-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin: -0.25rem 0 1.5rem;
}

.sort-label {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 500;
    margin-right: 0.35rem;
}

.sort-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.8rem;
    background: var(--card2);
    border: 1px solid var(--border);
    border-radius: 9999px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s var(--ease);
}

.sort-btn:hover {
    border-color: var(--border-hover);
    color: var(--text);
    background: var(--card-elevated);
}

.sort-btn.selected {
    border-color: var(--ok);
    background: var(--ok-soft);
    color: #4ade80;
    box-shadow: 0 0 0 1px var(--ok);
}

.sort-arrow {
    font-size: 0.85rem;
    line-height: 1;
    color: #4ade80;
}

.sort-btn.sort-clear {
    background: var(--danger-soft);
    border-color: rgba(235, 87, 87, 0.35);
    color: #fca5a5;
}

.sort-btn.sort-clear:hover {
    background: rgba(235, 87, 87, 0.2);
    border-color: var(--danger);
    color: #fecaca;
}

/* ========== Modals ========== */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--card);
    border: 1px solid var(--border);
    padding: 1.75rem;
    border-radius: var(--radius-lg);
    width: min(92%, 440px);
    box-shadow: var(--shadow-lg);
}

.modal-content h2 {
    margin-top: 0;
    font-size: 1.15rem;
}

.modal-content p {
    color: var(--text-secondary);
    line-height: 1.55;
    font-size: 0.9rem;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

/* ========== Plyr ========== */
.plyr--fullscreen .plyr__video-wrapper video,
.plyr:fullscreen video {
    object-fit: contain !important;
    max-height: none !important;
    width: 100% !important;
    height: 100% !important;
}

/* ========== Footer ========== */
footer {
    margin: 3rem 0 2rem;
    text-align: center;
    color: var(--muted);
    font-size: 0.8rem;
}

footer a {
    color: var(--text-secondary);
    text-decoration: none;
}

footer a:hover {
    color: var(--text);
}

/* ========== Bulk bar ========== */
.bulk-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    background: var(--card-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    margin: 0.75rem 0;
}

.bulk-bar #bulkCount {
    font-weight: 600;
    margin-right: 0.5rem;
    color: #a5b4fc;
}

/* ========== Sort links in tables ========== */
.sort-link {
    color: inherit;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.15s var(--ease);
}

.sort-link:hover {
    color: var(--accent-hover);
}

.sort-link.selected {
    color: #a5b4fc;
    font-weight: 600;
}

/* ========== Ad containers ========== */
div[data-banner-id] {
    display: flex;
    justify-content: center;
    margin: 1rem 0;
    min-height: 0;
    overflow: hidden;
}

/* ========== Mobile ========== */
@media (max-width: 640px) {
    .album-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .album-box,
    .album-title-box {
        flex: none;
        width: 100%;
    }

    .thumb-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 0.85rem;
    }

    header .container {
        height: auto;
        padding: 0.85rem 1rem;
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    nav a {
        margin-left: 0.85rem;
        font-size: 0.85rem;
    }

    .card {
        padding: 1.25rem;
        margin-bottom: 1.5rem;
    }

    .container {
        padding: 0 1rem;
    }
}

/* ========== File page album pills ========== */
.file-albums {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
    margin: 0 0 1.5rem;
    padding: 0.9rem 1.1rem;
    background: var(--card2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.file-albums-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--muted);
    margin-right: 0.25rem;
    white-space: nowrap;
}

.file-albums-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.album-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.3rem 0.75rem 0.3rem 0.85rem;
    background: var(--card-elevated);
    border: 1px solid var(--border);
    border-radius: 9999px;
    text-decoration: none;
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.15s var(--ease);
}

.album-pill:hover {
    border-color: var(--border-hover);
    background: var(--card);
    transform: translateY(-1px);
}

.album-pill-title {
    letter-spacing: -0.01em;
}

.album-pill-count {
    font-size: 0.75rem;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.06);
    padding: 0.1rem 0.45rem;
    border-radius: 9999px;
    font-weight: 500;
}

/* Special treatment for the two main home albums */
.album-pill-special {
    background: var(--accent-soft);
    border-color: rgba(94, 106, 210, 0.35);
    color: #c7d2fe;
}

.album-pill-special:hover {
    background: rgba(94, 106, 210, 0.18);
    border-color: var(--accent);
    color: #e0e7ff;
}

.album-pill-special .album-pill-count {
    background: rgba(94, 106, 210, 0.2);
    color: #a5b4fc;
}

/* ========== Upload page ========== */
.upload-card {
    max-width: 720px;
}

.upload-header {
    margin-bottom: 1.5rem;
}

.upload-header h1 {
    margin-bottom: 0.35rem;
}

.drop-zone {
    border: 1.5px dashed var(--border-strong) !important;
    background: var(--card2) !important;
    border-radius: var(--radius-lg) !important;
    padding: 2.5rem 1.5rem !important;
    text-align: center;
    cursor: pointer;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
    margin: 1.25rem 0;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--accent) !important;
    background: rgba(94, 106, 210, 0.05) !important;
}

.drop-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
}

.drop-icon {
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.drop-text {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text);
}

.drop-hint {
    font-size: 0.85rem;
    color: var(--muted);
}

.upload-preview {
    width: 100%;
    margin-top: 1rem !important;
}

/* Album options */
.album-options {
    background: var(--card2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.15rem;
    margin: 1.25rem 0;
}

.album-options-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.9rem;
    color: var(--text);
}

.album-option {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    padding: 0.55rem 0.4rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s var(--ease);
}

.album-option:hover {
    background: rgba(255, 255, 255, 0.03);
}

.album-option input[type="radio"],
.album-option input[type="checkbox"] {
    margin-top: 0.15rem;
    accent-color: var(--accent);
}

.album-option-label {
    font-size: 0.9rem;
    color: var(--text);
}

.album-option-extra {
    margin: 0.4rem 0 0.6rem 1.9rem;
}

.album-option-extra input,
.album-option-extra select {
    width: 100%;
    max-width: 340px;
    padding: 0.55rem 0.8rem;
    background: var(--card);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
}

.album-option-extra input:focus,
.album-option-extra select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.album-options-subtitle {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--muted);
    margin: 0.85rem 0 0.5rem;
}

.album-multi-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--card);
}

.album-check {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.4rem 0.75rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    margin: 0;
    transition: background 0.12s var(--ease);
}

.album-check:last-child {
    border-bottom: none;
}

.album-check:hover {
    background: rgba(255, 255, 255, 0.03);
}

.album-check-input {
    flex-shrink: 0;
    accent-color: var(--accent);
    width: auto !important;
    margin: 0;
}

.album-check-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.album-check-meta {
    flex-shrink: 0;
    font-size: 0.78rem;
    color: var(--muted);
    margin-left: auto;
}

/* Actions */
.upload-actions {
    display: flex;
    gap: 0.85rem;
    margin-top: 1.5rem;
}

.upload-actions .purple-btn {
    flex: 1;
    max-width: 280px;
    margin-top: 0;
}

.clear-btn {
    padding: 0.75rem 1.4rem !important;
}

/* Success state (the JS-generated boxes) */
.success-list {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.success-list h3 {
    font-size: 1.05rem;
    margin-bottom: 1rem;
}

/* ========== Toolbar (Gallery / Albums) ========== */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    gap: 1rem;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.toolbar-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin: 0;
}

.toolbar-select {
    appearance: none;
    background: var(--card2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.35rem 1.8rem 0.35rem 0.7rem;
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a8f98' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.55rem center;
    transition: border-color 0.15s var(--ease);
}

.toolbar-select:hover {
    border-color: var(--border-hover);
}

.toolbar-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.toolbar-right {
    display: flex;
    align-items: center;
}

.toolbar-total {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--muted);
    background: var(--card2);
    border: 1px solid var(--border);
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
}

/* ========== Search ========== */
.search-form {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
    max-width: 320px;
    margin: 0;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    color: var(--muted);
    pointer-events: none;
    flex-shrink: 0;
}

.search-input {
    width: 100%;
    padding: 0.45rem 2rem 0.45rem 2.25rem;
    background: var(--card2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 9999px;
    font-size: 0.85rem;
    font-family: inherit;
    transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.search-input::placeholder {
    color: var(--muted);
}

.search-input:hover {
    border-color: var(--border-hover);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.search-clear {
    position: absolute;
    right: 0.55rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    color: var(--muted);
    text-decoration: none;
    font-size: 1.1rem;
    line-height: 1;
    transition: color 0.15s var(--ease), background 0.15s var(--ease);
}

.search-clear:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.08);
}

.admin-list-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.admin-list-header h2 {
    margin: 0;
}

.toolbar {
    gap: 0.85rem;
    flex-wrap: wrap;
}

@media (max-width: 640px) {
    .search-form {
        max-width: none;
        width: 100%;
        order: 3;
    }

    .admin-list-header {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-list-header .search-form {
        max-width: none;
    }
}

/* Modern admin role select */
.admin-select {
    appearance: none;
    -webkit-appearance: none;
    background: var(--card2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.35rem 1.9rem 0.35rem 0.7rem;
    font-size: 0.8rem;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a8f98' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.55rem center;
    transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
    min-width: 90px;
}

.admin-select:hover {
    border-color: var(--border-hover);
}

.admin-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.admin-select option {
    background: var(--card);
    color: var(--text);
}

/* ========== File prev/next navigation ========== */
.file-nav {
    display: flex;
    gap: 0.5rem;
    margin: 0.5rem 0 0.35rem;
}

.file-nav-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    background: var(--card-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    text-align: center;
    transition: all 0.15s var(--ease);
    line-height: 1.2;
}

a.file-nav-btn:hover {
    background: var(--card);
    border-color: var(--border-hover);
    color: #fff;
    transform: translateY(-1px);
}

.file-nav-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

@media (max-width: 480px) {
    .file-nav {
        flex-direction: column;
    }
}

/* ========== Tags ========== */
.file-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 0 0 1.25rem;
    padding: 0.75rem 1rem;
    background: var(--card2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.tag-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.7rem;
    border-radius: 9999px;
    font-size: 0.78rem;
    font-weight: 550;
    text-decoration: none;
    transition: all 0.15s var(--ease);
    letter-spacing: -0.01em;
}

.tag-pill.tag-platform {
    background: rgba(94, 106, 210, 0.15);
    border: 1px solid rgba(94, 106, 210, 0.35);
    color: #a5b4fc;
}

.tag-pill.tag-platform:hover {
    background: rgba(94, 106, 210, 0.28);
    border-color: var(--accent);
    color: #e0e7ff;
    transform: translateY(-1px);
}

.tag-pill.tag-descriptive {
    background: rgba(61, 214, 140, 0.12);
    border: 1px solid rgba(61, 214, 140, 0.3);
    color: #86efac;
}

.tag-pill.tag-descriptive:hover {
    background: rgba(61, 214, 140, 0.22);
    border-color: var(--ok);
    color: #bbf7d0;
    transform: translateY(-1px);
}

/* Consistent thumbnail aspect ratio (portrait-friendly, same box for all) */
.thumb-preview {
    aspect-ratio: 3 / 4;
}

.thumb-preview img {
    object-fit: cover;
    width: 100%;
    height: 100%;
}

/* Tag input chips on upload/edit */
.tag-input-wrap {
    margin-top: 0.5rem;
}

.tag-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.5rem;
}

.tag-suggestion {
    padding: 0.2rem 0.55rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text-secondary);
    transition: all 0.12s var(--ease);
}

.tag-suggestion:hover,
.tag-suggestion.active {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: #a5b4fc;
}

.tag-suggestion.desc:hover,
.tag-suggestion.desc.active {
    background: var(--ok-soft);
    border-color: var(--ok);
    color: #86efac;
}

.selected-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.5rem;
    min-height: 1.5rem;
}

.selected-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.5rem 0.2rem 0.65rem;
    border-radius: 9999px;
    font-size: 0.78rem;
    font-weight: 500;
}

.selected-tag.platform {
    background: rgba(94, 106, 210, 0.18);
    color: #a5b4fc;
}

.selected-tag.desc {
    background: rgba(61, 214, 140, 0.15);
    color: #86efac;
}

.selected-tag button {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0;
    opacity: 0.7;
}

.selected-tag button:hover {
    opacity: 1;
}

@media (max-width: 640px) {
    .thumb-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }

    .file-tags {
        padding: 0.6rem 0.75rem;
    }
}

.duration-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    letter-spacing: 0.02em;
    backdrop-filter: blur(4px);
}