/**
 * fanazki - Gallery Stylesheet
 *
 * Responsive dark theme with CSS variables. Features:
 * - Flex-based stable grid masonry layout
 * - Lightbox viewer with fullscreen support
 * - Slideshow autoplay controls
 * - Admin panel and action buttons
 * - Folder card grid with selection checkboxes
 * - Mobile-first responsive breakpoints
 */

/* ──── RESET & DESIGN TOKENS ──── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #0a0a0a;
    --bg-surface: #141414;
    --bg-elevated: #1e1e1e;
    --text: #f0f0f0;
    --text-muted: #888;
    --accent: #e0e0e0;
    --accent-hover: #fff;
    --border: #2a2a2a;
    --error: #e74c3c;
    --success: #2ecc71;
    --info: #3498db;
    --radius: 8px;
    --radius-lg: 12px;
    --transition: 0.2s ease;
    --nav-height: 56px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

html { font-size: 16px; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }

/* ──── NAVIGATION BAR ──── */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
}

.nav-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
}

.nav-links { display: flex; align-items: center; gap: 16px; }

.nav-link {
    font-size: 0.875rem;
    color: var(--text-muted);
    transition: color var(--transition);
}
.nav-link:hover { color: var(--text); }

.nav-link--primary {
    background: var(--accent);
    color: var(--bg);
    padding: 6px 14px;
    border-radius: var(--radius);
    font-weight: 500;
}
.nav-link--primary:hover { background: var(--accent-hover); color: var(--bg); }

.nav-user {
    font-size: 0.875rem;
    color: var(--text-muted);
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

/* ──── MAIN CONTENT AREA ──── */
.main {
    padding-top: calc(var(--nav-height) + 24px);
    max-width: 1400px;
    margin: 0 auto;
    padding-left: 24px;
    padding-right: 24px;
    padding-bottom: 48px;
}

/* ──── TOAST NOTIFICATIONS ──── */
.flash-container {
    position: fixed;
    top: calc(var(--nav-height) + 12px);
    right: 24px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.flash {
    padding: 12px 20px;
    border-radius: var(--radius);
    font-size: 0.875rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    animation: flashIn 0.3s ease, flashOut 0.3s ease 4s forwards;
}
.flash--error { border-color: var(--error); color: var(--error); }
.flash--success { border-color: var(--success); color: var(--success); }
.flash--info { border-color: var(--info); color: var(--info); }

@keyframes flashIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes flashOut { to { opacity: 0; transform: translateY(-10px); } }

/* ──── GALLERY HEADER & CONTROLS ──── */
.gallery-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.gallery-title {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.gallery-controls { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ──── CONTROL GROUPS ──── */
/* Each group bundles related controls inside a subtle bordered card so
   the Models / Media / Action sections read as visually distinct. */
.control-group {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    flex-wrap: wrap;
}

.control-group__label {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    padding-right: 8px;
    margin-right: 2px;
    border-right: 1px solid var(--border);
    white-space: nowrap;
    line-height: 1.6;
}

.control-group__select {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-family: var(--font);
    cursor: pointer;
    transition: all var(--transition);
}
.control-group__select:hover:not(:disabled) { border-color: var(--accent); color: var(--text); }
.control-group__select:disabled { opacity: 0.55; cursor: not-allowed; }

/* Media-type checkbox + label combo */
.media-type-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 4px;
    color: var(--text-muted);
    font-size: 0.78rem;
    cursor: pointer;
    user-select: none;
    transition: color var(--transition);
}
.media-type-toggle:hover { color: var(--text); }
.media-type-toggle input[type="checkbox"] { width: 16px; height: 16px; border-radius: 3px; }
.media-type-toggle input[type="checkbox"]:checked::after { font-size: 11px; }

.mode-btn {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 6px 14px;
    border-radius: var(--radius);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font);
}
.mode-btn:hover { border-color: var(--accent); color: var(--text); }
.mode-btn.active {
    background: var(--accent);
    color: var(--bg);
    border-color: var(--accent);
}
.mode-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    border-color: var(--border);
    color: var(--text-muted);
}
.mode-btn:disabled:hover { border-color: var(--border); color: var(--text-muted); }

/* ──── GALLERY GRID (Masonry via Flex Columns) ──── */
.gallery-grid {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.gallery-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.gallery-item {
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    background: var(--bg-surface);
    cursor: pointer;
    transition: transform var(--transition);
}
.gallery-item:hover { transform: scale(1.01); }

.gallery-item img,
.gallery-item video {
    width: 100%;
    display: block;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

/* Re-enable pointer events on the container for clicks */
.gallery-item { pointer-events: auto; }

.gallery-item .media-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    /* Transparent overlay blocks direct interaction with the image */
}

.media-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    z-index: 3;
}

/* ──── LIGHTBOX VIEWER ──── */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 5000;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}
.lightbox.active { display: flex; }

/* Autoplay countdown bar — thin accent-coloured strip at the very bottom
   of the lightbox that fills from 0 to 100% during each slide's wait. */
.lightbox-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 0;
    background: var(--accent);
    opacity: 0;
    pointer-events: none;
    z-index: 5002;
}

/* Fullscreen mode: fill the entire screen */
.lightbox:fullscreen,
.lightbox:-webkit-full-screen {
    position: relative;
    width: 100vw;
    height: 100vh;
    background: #000;
}

.lightbox-media {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
}

/* Video needs pointer-events for native controls to work */
video.lightbox-media {
    z-index: 1;
    pointer-events: auto;
    cursor: default;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 24px;
    background: none;
    border: none;
    color: var(--text);
    font-size: 2rem;
    cursor: pointer;
    z-index: 5001;
    line-height: 1;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text);
    font-size: 2rem;
    padding: 16px;
    cursor: pointer;
    border-radius: var(--radius);
    transition: background var(--transition);
    z-index: 5001;
}
.lightbox-nav:hover { background: rgba(255, 255, 255, 0.2); }
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }

/* ──── LOADING & EMPTY STATES ──── */
.loading-spinner {
    text-align: center;
    padding: 48px;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.gallery-empty {
    text-align: center;
    padding: 80px 24px;
    color: var(--text-muted);
}
.gallery-empty h2 { font-size: 1.25rem; margin-bottom: 8px; color: var(--text); }

/* ──── AUTHENTICATION FORMS ──── */
.auth-container {
    max-width: 400px;
    margin: 60px auto;
}

.auth-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
}

.auth-card h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 24px;
    text-align: center;
}

.form-group { margin-bottom: 16px; }

.form-group label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.form-group input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.95rem;
    font-family: var(--font);
    transition: border-color var(--transition);
}
.form-group input:focus {
    outline: none;
    border-color: var(--accent);
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    font-family: var(--font);
    transition: all var(--transition);
}

.btn--primary {
    width: 100%;
    background: var(--accent);
    color: var(--bg);
    margin-top: 8px;
}
.btn--primary:hover { background: var(--accent-hover); }

.btn--danger { background: var(--error); color: #fff; }
.btn--danger:hover { opacity: 0.9; }

.auth-footer {
    text-align: center;
    margin-top: 16px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ──── ADMIN PANEL ──── */
.admin-header {
    margin-bottom: 32px;
}
.admin-header h1 {
    font-size: 1.75rem;
    font-weight: 600;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
}
.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 4px;
}
.stat-card .stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 48px;
    text-align: center;
    transition: border-color var(--transition);
    cursor: pointer;
}
.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--accent);
}

.media-table {
    width: 100%;
    border-collapse: collapse;
}
.media-table th, .media-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
}
.media-table th {
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

/* ──── MODELS OVERVIEW TABLE ──── */
.models-table {
    width: 100%;
    border-collapse: collapse;
}
.models-table th, .models-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
}
.models-table th {
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    text-align: left;
    background: var(--bg-surface);
}
.models-table th.num, .models-table td.num { text-align: right; }
.models-table .model-row {
    cursor: pointer;
    transition: background var(--transition);
}
.models-table .model-row:hover { background: var(--bg-surface); }
.models-table .model-cover {
    width: 56px;
    padding: 6px 14px;
}
.models-table .model-cover img {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: var(--radius);
    display: block;
}
.models-table .cover-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    background: var(--bg-elevated);
    color: var(--text-muted);
    font-size: 1.1rem;
}
.models-table .model-name {
    font-weight: 500;
    color: var(--text);
}
.models-table .model-arrow { color: var(--text-muted); }

/* Public / hidden toggle in the model overview row */
.visibility-toggle {
    background: rgba(170, 170, 170, 0.15);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-family: var(--font);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
}
.visibility-toggle:hover { border-color: var(--accent); color: var(--text); }
.visibility-toggle:disabled { opacity: 0.5; cursor: wait; }
.visibility-toggle--public {
    background: rgba(108, 206, 108, 0.18);
    color: #6cce6c;
    border-color: rgba(108, 206, 108, 0.4);
}
.visibility-toggle--public:hover {
    border-color: rgba(108, 206, 108, 0.7);
    color: #8eda8e;
}

/* ──── BULK-EDIT TOOLBAR ──── */
.bulk-toolbar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    margin-bottom: 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    flex-wrap: wrap;
}
.bulk-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-right: 4px;
}
.bulk-sep {
    width: 1px;
    height: 22px;
    background: var(--border);
    margin: 0 4px;
}
.bulk-btn {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 6px 12px;
    border-radius: var(--radius);
    font-size: 0.8rem;
    cursor: pointer;
    font-family: var(--font);
    transition: all var(--transition);
}
.bulk-btn:hover:not(:disabled) { border-color: var(--accent); }
.bulk-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.bulk-btn--premium:not(:disabled) { color: #f6c343; border-color: rgba(246,195,67,0.4); }
.bulk-btn--fake:not(:disabled)    { color: #c8a2ff; border-color: rgba(200,162,255,0.4); }
.bulk-btn--cover:not(:disabled)   { color: #6cd0ff; border-color: rgba(108,208,255,0.4); }
.bulk-btn--delete:not(:disabled)  { color: #ff8080; border-color: rgba(255,128,128,0.4); }

/* ──── BULK-EDIT THUMBNAIL GRID ──── */
/* Matches the outer gallery's folder-card sizing — uniform, cropped
   thumbnails ~220px × 160px. Reuses the same /api/media/<id>/thumbnail
   URLs the rest of the app fetches, so the browser cache is shared. */
.bulk-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}
.bulk-tile {
    position: relative;
    background: var(--bg-elevated);
    border: 2px solid transparent;
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: border-color var(--transition), transform var(--transition);
}
.bulk-tile:hover { transform: scale(1.02); }
.bulk-tile img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}
@media (max-width: 768px) {
    .bulk-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
    .bulk-tile img { height: 120px; }
}
.bulk-tile.selected {
    border-color: var(--accent);
}
.bulk-tile.selected::after {
    content: "✓";
    position: absolute;
    top: 6px;
    left: 6px;
    width: 22px;
    height: 22px;
    line-height: 22px;
    text-align: center;
    border-radius: 50%;
    background: var(--accent);
    color: var(--bg);
    font-weight: 900;
    font-size: 13px;
}

/* Tile badges (kind, cover, type) */
.tile-badge {
    position: absolute;
    z-index: 2;
    padding: 2px 6px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: 4px;
    background: rgba(0,0,0,0.65);
    color: #fff;
}
.tile-badge--premium { top: 6px; right: 6px; background: rgba(246,195,67,0.9); color: #1a1a1a; }
.tile-badge--fake    { top: 6px; right: 6px; background: rgba(200,162,255,0.9); color: #1a1a1a; }
.tile-badge--cover   { bottom: 6px; left: 6px; background: rgba(108,208,255,0.9); color: #1a1a1a; padding: 2px 8px; font-size: 0.85rem; }
.tile-badge--type    { bottom: 6px; right: 6px; }
.bulk-tile.is-cover  { box-shadow: 0 0 0 2px rgba(108,208,255,0.55) inset; }

/* "View full size" button on each bulk-edit tile. Sits top-right and only
   becomes visible on hover so it doesn't clutter the dense grid. */
.tile-view-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 3;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 0.12s ease, transform 0.12s ease, background 0.12s ease;
}
.bulk-tile:hover .tile-view-btn,
.bulk-tile:focus-within .tile-view-btn {
    opacity: 1;
    transform: scale(1);
}
.tile-view-btn:hover { background: rgba(0, 0, 0, 0.85); }

/* When a tile already has a premium / fake badge in the top-right, push the
   view button left so they don't overlap. */
.bulk-tile .tile-badge--premium + .tile-view-btn,
.bulk-tile .tile-badge--fake + .tile-view-btn { right: 44px; }

/* ──── FULL-SIZE VIEWER MODAL (admin manage media) ──── */
.tile-view-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 6000;
    padding: 24px;
}
.tile-view-body {
    max-width: 96vw;
    max-height: 92vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tile-view-body img,
.tile-view-body video {
    max-width: 96vw;
    max-height: 92vh;
    width: auto;
    height: auto;
    display: block;
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.6);
}
.tile-view-close {
    position: absolute;
    top: 18px;
    right: 22px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    z-index: 6001;
}
.tile-view-close:hover { background: rgba(0, 0, 0, 0.85); }

/* Filename label at the top of the viewer modal — same style the lightbox
   shows for admins, just in a different location. */
.tile-view-name {
    position: absolute;
    top: 22px;
    left: 24px;
    right: 70px;
    color: #ddd;
    font-family: var(--font-mono, ui-monospace, monospace);
    font-size: 0.82rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    z-index: 6001;
}

/* ──── KEYBOARD-SHORTCUTS HELP OVERLAY ──── */
/* Toggled by '?'. Sits above the lightbox but below the age gate. */
.kbd-help {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 7000;
    padding: 24px;
}
.kbd-help__panel {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    max-width: 420px;
    width: 100%;
    color: var(--text);
    position: relative;
}
.kbd-help__close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: 0;
    color: var(--text-muted);
    font-size: 1.6rem;
    cursor: pointer;
    line-height: 1;
}
.kbd-help__close:hover { color: var(--text); }
.kbd-help__title {
    margin: 0 0 18px;
    font-size: 1.15rem;
    font-weight: 600;
}
.kbd-help__group { margin-bottom: 16px; }
.kbd-help__group:last-child { margin-bottom: 0; }
.kbd-help__group-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.kbd-help__row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
    font-size: 0.88rem;
    color: var(--text);
}
.kbd-help__keys {
    flex: 0 0 90px;
    display: inline-flex;
    gap: 4px;
}
.kbd-help kbd {
    display: inline-block;
    padding: 2px 8px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: var(--font-mono, ui-monospace, monospace);
    font-size: 0.78rem;
    color: var(--text);
    box-shadow: 0 1px 0 var(--border);
}

/* ──── AGE GATE ──── */
/* Sits above every other modal (lightbox z-5000, popup modals z-6000, this
   z-9000). Inline display:flex from JS keeps it visible even if this CSS
   doesn't load. */
.age-gate {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9000;
    padding: 24px;
}
.age-gate__panel,
.age-gate__goodbye {
    max-width: 460px;
    width: 100%;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 28px;
    text-align: center;
    color: var(--text);
}
.age-gate__title {
    font-size: 1.35rem;
    font-weight: 600;
    margin: 0 0 14px;
}
.age-gate__copy {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.55;
    margin: 0 0 8px;
}
.age-gate__copy strong { color: var(--text); }
.age-gate__buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 22px;
}
.age-gate__btn {
    padding: 12px 18px;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 500;
    font-family: var(--font);
    cursor: pointer;
    transition: all var(--transition);
    border: 1px solid var(--border);
}
.age-gate__btn--enter {
    background: var(--accent);
    color: var(--bg);
    border-color: var(--accent);
}
.age-gate__btn--enter:hover { background: var(--accent-hover); }
.age-gate__btn--leave {
    background: transparent;
    color: var(--text-muted);
}
.age-gate__btn--leave:hover { color: var(--text); border-color: var(--accent); }
.age-gate__leave-link {
    color: var(--accent);
    text-decoration: none;
}
.age-gate__leave-link:hover { text-decoration: underline; }

/* Bulk-toolbar source-filter form / select */
.bulk-src-form {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}
.bulk-src-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.bulk-src-select {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 6px 10px;
    border-radius: var(--radius);
    font-size: 0.8rem;
    font-family: var(--font);
    cursor: pointer;
}
.bulk-src-select:hover { border-color: var(--accent); }

/* ──── BREADCRUMB NAVIGATION ──── */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.breadcrumb-item { color: var(--text-muted); }
.breadcrumb-item.active { color: var(--text); }
.breadcrumb-item.clickable { cursor: pointer; transition: color var(--transition); }
.breadcrumb-item.clickable:hover { color: var(--accent-hover); }

.breadcrumb-sep { color: var(--text-muted); margin: 0 2px; font-weight: 400; }

/* ──── CONTROL ELEMENTS ──── */
.control-separator {
    width: 1px;
    height: 20px;
    background: var(--border);
    margin: 0 4px;
}

/* Select All / Deselect All button */
.select-all-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 6px 12px;
    border-radius: var(--radius);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font);
    white-space: nowrap;
}
.select-all-btn:hover { border-color: var(--accent); color: var(--text); }

/* ──── FOLDER BROWSING GRID ──── */
.folder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.folder-card {
    position: relative;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: transform var(--transition), border-color var(--transition);
}
.folder-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
}

/* ──── UNIVERSAL CHECKBOX STYLE ──── */
input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;

    position: relative;
    flex-shrink: 0;
    vertical-align: middle;

    width: 18px;
    height: 18px;
    cursor: pointer;

    background: #ffffff;
    border: 2px solid #ffffff;
    border-radius: 4px;

    box-shadow: 0 0 0 1px rgba(0,0,0,0.6);

    transition: all 0.15s ease;
    opacity: 1;
}

input[type="checkbox"]:hover {
    transform: scale(1.08);
    box-shadow: 0 0 0 2px #3498db;
}

input[type="checkbox"]:checked {
    background: #ffffff;
    border-color: #3498db;
    box-shadow: 0 0 0 2px #3498db;
}

input[type="checkbox"]:checked::after {
    content: "✓";
    color: #1e6fff;
    font-size: 13px;
    font-weight: 900;

    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -55%);
}

/* ──── FOLDER CARD CHECKBOX (size + positioning overrides) ──── */
input[type="checkbox"].folder-checkbox {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    width: 22px;
    height: 22px;
    border-radius: 5px;
}

input[type="checkbox"].folder-checkbox:checked::after {
    font-size: 16px;
}

/* Badge on Random button showing selection count */
.random-selection-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 8px;
    background: var(--accent);
    color: var(--bg);
    vertical-align: middle;
    line-height: 1.3;
}

.folder-cover {
    width: 100%;
    height: 160px;
    background-size: cover;
    background-position: center;
    background-color: var(--bg-elevated);
}

.folder-cover--empty {
    display: flex;
    align-items: center;
    justify-content: center;
}

.folder-icon { font-size: 3rem; opacity: 0.4; }

.folder-info {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.folder-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    text-transform: capitalize;
}

.folder-count {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.root-media-note {
    grid-column: 1 / -1;
    text-align: center;
    padding: 12px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ──── SLIDESHOW AUTOPLAY CONTROLS ──── */
.slideshow-controls {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 5001;
}

.slideshow-btn {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text);
    padding: 8px 20px;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    font-family: var(--font);
    transition: all var(--transition);
}
.slideshow-btn:hover { background: rgba(255, 255, 255, 0.2); }
.slideshow-btn.active {
    background: var(--accent);
    color: var(--bg);
    border-color: var(--accent);
}

.slideshow-speed {
    display: flex;
    gap: 4px;
    align-items: center;
}

.speed-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-muted);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    cursor: pointer;
    font-family: var(--font);
    transition: all var(--transition);
}
.speed-btn:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.3); }
.speed-btn.active {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text);
    border-color: var(--accent);
}

/* ──── LIGHTBOX COUNTER & INFO ──── */
.lightbox-counter {
    position: absolute;
    bottom: 24px;
    right: 24px;
    color: var(--text-muted);
    font-size: 0.8rem;
    z-index: 5001;
    font-variant-numeric: tabular-nums;
}

/* ──── FULLSCREEN TOGGLE BUTTON ──── */
.lightbox-fullscreen {
    position: absolute;
    top: 20px;
    left: 24px;
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 5001;
    line-height: 1;
    opacity: 0.7;
    transition: opacity var(--transition);
}
.lightbox-fullscreen:hover { opacity: 1; }
.lightbox-fullscreen.active { color: var(--accent); opacity: 1; }


/* ──── LIGHTBOX ACTION ROW ──── */
/* Bottom-left toolbar with per-role buttons (Premium/Fake/Delete for admin,
   Share for vip+admin, Report for everyone). Each button is hidden via inline
   style when the role doesn't grant it; the row itself shows whenever any
   button inside is visible. */
.lightbox-actions {
    position: absolute;
    bottom: 24px;
    left: 24px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    z-index: 5001;
}
.admin-btn {
    padding: 8px 18px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all var(--transition);
    backdrop-filter: blur(4px);
    background: rgba(0, 0, 0, 0.4);
    font-family: var(--font);
}
.admin-btn:disabled { opacity: 0.5; cursor: wait; }
.admin-btn--premium {
    background: rgba(234, 179, 8, 0.25);
    border-color: rgba(234, 179, 8, 0.4);
}
.admin-btn--premium:hover { background: rgba(234, 179, 8, 0.4); }
.admin-btn--premium.active {
    background: rgba(234, 179, 8, 0.45);
    border-color: rgba(234, 179, 8, 0.7);
}
.admin-btn--fake {
    background: rgba(59, 130, 246, 0.25);
    border-color: rgba(59, 130, 246, 0.4);
}
.admin-btn--fake:hover { background: rgba(59, 130, 246, 0.4); }
.admin-btn--fake.active {
    background: rgba(59, 130, 246, 0.45);
    border-color: rgba(59, 130, 246, 0.7);
}
.admin-btn--delete {
    background: rgba(220, 60, 60, 0.25);
    border-color: rgba(220, 60, 60, 0.4);
}
.admin-btn--delete:hover { background: rgba(220, 60, 60, 0.45); }
/* Report — same red palette as Delete but wears the warning symbol so users
   can tell them apart at a glance. Visible to everyone. */
.admin-btn--report {
    background: rgba(220, 60, 60, 0.25);
    border-color: rgba(220, 60, 60, 0.5);
    color: #ff9090;
}
.admin-btn--report:hover {
    background: rgba(220, 60, 60, 0.45);
    color: #ffb0b0;
}
/* Share — clean monochrome (black + white) so it doesn't compete with the
   coloured action buttons. vip / admin only. */
.admin-btn--share {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.35);
    color: #fff;
}
.admin-btn--share:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.55);
}

/* ──── RANDOM LIMIT SELECTOR ──── */
.random-limit-wrap {
    display: flex;
    align-items: center;
}
.random-limit-select {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 6px 10px;
    border-radius: var(--radius);
    font-size: 0.8rem;
    font-family: var(--font);
    cursor: pointer;
    transition: all var(--transition);
}
.random-limit-select:hover { border-color: var(--accent); color: var(--text); }
.random-limit-select:focus { outline: none; border-color: var(--accent); }

/* ──── LIGHTBOX LOADING & ERROR STATES ──── */
.lightbox-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 255, 255, 0.15);
    border-top-color: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    animation: lb-spin 0.7s linear infinite;
}
@keyframes lb-spin { to { transform: rotate(360deg); } }

.lightbox-error {
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 40px;
    text-align: center;
}

/* Smooth image transitions */
#lightbox-media {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    min-height: 60px;
}
#lightbox-media img.lightbox-media,
#lightbox-media video.lightbox-media {
    animation: lb-fadein 0.15s ease;
}
@keyframes lb-fadein { from { opacity: 0; } to { opacity: 1; } }

/* ──── LANDING PAGE ──── */
.landing { display: flex; flex-direction: column; align-items: center; padding: 80px 20px 60px; }
.landing-hero { text-align: center; margin-bottom: 60px; }
.landing-title { font-size: 3rem; font-weight: 700; letter-spacing: -0.03em; color: var(--text); margin-bottom: 8px; }
.landing-subtitle { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 32px; }
.landing-cta {
    display: inline-block; padding: 12px 36px; border-radius: var(--radius);
    background: var(--text); color: var(--bg); font-weight: 600; font-size: 0.95rem;
    text-decoration: none; transition: opacity var(--transition);
}
.landing-cta:hover { opacity: 0.85; }
.landing-content { max-width: 720px; width: 100%; }
.landing-placeholder { text-align: center; color: var(--text-muted); font-size: 0.9rem; padding: 40px 20px; border: 1px dashed var(--border); border-radius: var(--radius-lg); }
.landing-placeholder code { background: var(--bg-elevated); padding: 2px 6px; border-radius: 4px; font-size: 0.85rem; }

/* ──── RESPONSIVE MOBILE BREAKPOINTS ──── */
@media (max-width: 768px) {
    .gallery-grid { gap: 8px; }
    .main { padding-left: 12px; padding-right: 12px; }
    .gallery-header { flex-direction: column; align-items: stretch; }
    .gallery-controls { gap: 8px; }
    .control-group { width: 100%; justify-content: flex-start; }
    .control-group__label { font-size: 0.6rem; }
    .folder-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
    .folder-cover { height: 120px; }
    .slideshow-controls { bottom: 16px; flex-direction: column; gap: 8px; }
}

/* ──── ADMIN: TRAFFIC PAGE ──── */
.stat-card--warn { border-color: var(--error); }
.stat-card--warn .stat-value { color: var(--error); }

.traffic-chart-wrap {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    margin-bottom: 16px;
}
.traffic-chart-title {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}
.traffic-chart {
    width: 100%;
    height: 60px;
    display: block;
}
.traffic-chart rect { fill: var(--accent); }

.traffic-tops {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.traffic-top-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px;
}
.traffic-top-title {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}
.traffic-top-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.traffic-top-list li {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border);
}
.traffic-top-list li:last-child { border-bottom: 0; }
.traffic-top-list li a {
    color: var(--text);
    text-decoration: none;
    font-family: var(--font-mono, ui-monospace, monospace);
}
.traffic-top-list li a:hover { color: var(--accent); }
.traffic-top-list li span { color: var(--text-muted); }
.traffic-empty { color: var(--text-muted); font-size: 0.85rem; padding: 8px 0; }

.traffic-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    margin-bottom: 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.8rem;
}
.traffic-filters-label {
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    margin-right: 4px;
}
.traffic-filters-hint { color: var(--text-muted); font-style: italic; }
.traffic-filters-quick { margin-left: auto; display: inline-flex; gap: 8px; }
.traffic-filters-quick a {
    color: var(--text-muted);
    text-decoration: none;
    padding: 2px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.75rem;
}
.traffic-filters-quick a:hover { color: var(--text); border-color: var(--accent); }
.filter-chip {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text);
}
.filter-chip a { color: var(--text-muted); text-decoration: none; margin-left: 4px; }
.filter-chip a:hover { color: var(--error); }

.traffic-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.traffic-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}
.traffic-table th, .traffic-table td {
    padding: 6px 10px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.traffic-table th {
    background: var(--bg-surface);
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.65rem;
    letter-spacing: 0.06em;
}
.traffic-table tbody tr:hover { background: var(--bg-surface); }
.traffic-table .mono { font-family: var(--font-mono, ui-monospace, monospace); }
.traffic-table .path-cell { max-width: 360px; overflow: hidden; text-overflow: ellipsis; }
.traffic-table .muted { color: var(--text-muted); }
.traffic-table a { color: var(--text); text-decoration: none; }
.traffic-table a:hover { color: var(--accent); text-decoration: underline; }

.status-2xx { color: #6cce6c; }
.status-3xx { color: #6cd0ff; }
.status-4xx { color: #f6c343; }
.status-5xx { color: #ff6c6c; }

/* Bot / human pill in the traffic table */
.bot-pill {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-decoration: none;
}
.bot-pill--human { background: rgba(108, 206, 108, 0.18); color: #6cce6c; }
.bot-pill--bot   { background: rgba(255, 140, 140, 0.18); color: #ff8c8c; }
.traffic-row--bot { background: rgba(255, 60, 60, 0.04); }
.traffic-row--bot td { color: var(--text-muted); }

/* Muted variant of the stat card — used for bot counts so they read as
   "noise" relative to the human cards beside them. */
.stat-card--muted { opacity: 0.65; }
.stat-card--muted .stat-value { color: var(--text-muted); }

/* Bots-only top-N panel — visually distinct from human panels so
   the operator can see at a glance which numbers are noise. */
.traffic-top-card--bots { border-left: 2px solid rgba(255, 140, 140, 0.45); }
.traffic-top-card--bots .traffic-top-title { color: #ff8c8c; }
.traffic-top-sub {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-left: 6px;
    font-weight: 400;
}

/* "Showing humans / bots / all" chip in the filter row */
.filter-chip--who { font-weight: 600; }
.filter-chip--who-humans { color: #6cce6c; border-color: rgba(108, 206, 108, 0.45); }
.filter-chip--who-bots { color: #ff8c8c; border-color: rgba(255, 140, 140, 0.45); }
.filter-chip--who-all { color: var(--text-muted); }
.traffic-filters-quick a.active {
    color: var(--text);
    background: var(--bg-elevated);
    border-color: var(--accent);
}

/* Rows / Visitors view toggle above the filter chips */
.traffic-view-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0 12px 0;
    flex-wrap: wrap;
}
.traffic-view-pill {
    padding: 4px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-decoration: none;
}
.traffic-view-pill:hover { color: var(--text); border-color: var(--accent); }
.traffic-view-pill.active {
    background: var(--bg-elevated);
    color: var(--text);
    border-color: var(--accent);
    font-weight: 600;
}
.traffic-view-hint {
    margin-left: 8px;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-style: italic;
}

/* ──── CHAT ROOM ──── */
.chat-room {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--nav-height) - 140px);
    min-height: 360px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-surface);
    overflow: hidden;
}
.chat-log {
    flex: 1;
    overflow-y: auto;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.chat-empty { color: var(--text-muted); font-size: 0.85rem; text-align: center; padding: 20px; }
.chat-msg {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 12px;
    position: relative;
}
.chat-msg-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.chat-msg-author { color: var(--text); font-weight: 600; font-size: 0.8rem; }
.chat-msg-time { font-size: 0.7rem; }
.chat-msg-del {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1;
}
.chat-msg-del:hover { color: var(--error); }
.chat-msg-body { white-space: pre-wrap; word-break: break-word; font-size: 0.9rem; }
.chat-form {
    display: flex;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.2);
}
.chat-input {
    flex: 1;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 12px;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.9rem;
}
.chat-input:focus { outline: none; border-color: var(--accent); }
.chat-send { width: auto; padding: 8px 18px; }
.chat-locked {
    padding: 12px;
    border-top: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
}

/* ──── HOME PAGE: ABOUT / TAKEDOWN ──── */
.landing-about {
    max-width: 720px;
    margin: 0 auto;
    text-align: left;
    color: var(--text);
    line-height: 1.65;
}
.landing-about h2 {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 28px 0 8px;
    color: var(--text);
}
.landing-about h2:first-child { margin-top: 0; }
.landing-about p { color: var(--text-muted); margin-bottom: 12px; }
.landing-about a { color: var(--accent); text-decoration: none; }
.landing-about a:hover { text-decoration: underline; }
.landing-list {
    color: var(--text-muted);
    margin: 0 0 12px 18px;
    padding: 0;
}
.landing-list li { margin-bottom: 6px; }

/* Share modal — read-only fields with inline copy button */
.share-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.share-row .report-modal__input {
    flex: 1;
    font-family: var(--font-mono, ui-monospace, monospace);
    font-size: 0.78rem;
}
.share-row .report-modal__btn {
    flex-shrink: 0;
    padding: 6px 14px;
    font-size: 0.78rem;
}

/* ──── REPORT MODAL ──── */
.report-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    display: none;
    align-items: center;
    justify-content: center;
    /* Must sit above .lightbox (5000) so the popup appears over the open
       image, not behind it. */
    z-index: 6000;
    padding: 16px;
}
.report-modal.active { display: flex; }

.report-modal__panel {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 480px;
    width: 100%;
    position: relative;
    color: var(--text);
}
.report-modal__close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: 0;
    color: var(--text-muted);
    font-size: 1.6rem;
    cursor: pointer;
    line-height: 1;
}
.report-modal__close:hover { color: var(--text); }

.report-modal__panel h2 {
    margin: 0 0 8px;
    font-size: 1.15rem;
    font-weight: 600;
}
.report-modal__hint {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin: 0 0 16px;
    line-height: 1.5;
}
.report-modal__label {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 12px 0 4px;
}
.report-modal__label .muted { text-transform: none; letter-spacing: 0; font-style: italic; }
.report-modal__input {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    padding: 8px 10px;
    font-family: var(--font);
    font-size: 0.9rem;
    box-sizing: border-box;
}
.report-modal__input:focus { outline: none; border-color: var(--accent); }
textarea.report-modal__input { resize: vertical; min-height: 90px; }

.report-modal__actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 16px;
}
.report-modal__btn {
    padding: 8px 18px;
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 0.85rem;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text);
    transition: all var(--transition);
}
.report-modal__btn:hover:not(:disabled) { border-color: var(--accent); }
.report-modal__btn:disabled { opacity: 0.5; cursor: not-allowed; }
.report-modal__btn--submit {
    background: rgba(255, 200, 60, 0.2);
    border-color: rgba(255, 200, 60, 0.5);
    color: #ffd255;
    font-weight: 500;
}
.report-modal__btn--submit:hover:not(:disabled) {
    background: rgba(255, 200, 60, 0.35);
    border-color: rgba(255, 200, 60, 0.8);
}
.report-modal__feedback {
    margin-top: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
    min-height: 18px;
}
.report-modal__feedback--error { color: var(--error); }
.report-modal__feedback--success { color: #6cce6c; }

/* ──── DASHBOARD: PENDING-REPORTS BADGE ──── */
.dashboard-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 8px;
    border-radius: 10px;
    background: var(--error);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.4;
    vertical-align: middle;
}

/* ──── ADMIN: REPORTS PAGE ──── */
.reports-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.reports-tab {
    padding: 8px 14px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    border-bottom: 2px solid transparent;
    transition: all var(--transition);
}
.reports-tab:hover { color: var(--text); }
.reports-tab--active {
    color: var(--text);
    border-bottom-color: var(--accent);
}
.reports-tab-count {
    display: inline-block;
    padding: 0 6px;
    margin-left: 4px;
    border-radius: 8px;
    background: var(--bg-elevated);
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.reports-list { display: flex; flex-direction: column; gap: 12px; }

.report-card {
    display: flex;
    gap: 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px;
}
.report-card--pending { border-left: 3px solid #f6c343; }
.report-card--handled { opacity: 0.85; }
.report-card--dismissed { opacity: 0.65; }

.report-thumb {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
}
.report-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.report-thumb--missing {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-align: center;
    padding: 8px;
}

.report-body { flex: 1; min-width: 0; }
.report-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.78rem;
}
.report-date { color: var(--text-muted); }
.report-status {
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
}
.report-status--pending { background: rgba(246,195,67,0.2); color: #f6c343; }
.report-status--handled { background: rgba(108,206,108,0.2); color: #6cce6c; }
.report-status--dismissed { background: var(--bg-elevated); color: var(--text-muted); }

.report-chip {
    background: var(--bg-elevated);
    color: var(--text);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
}
.report-chip.mono { font-family: var(--font-mono, ui-monospace, monospace); }

.report-reason {
    color: var(--text);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 8px;
    white-space: pre-wrap;
    word-wrap: break-word;
}
.report-filename {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-bottom: 8px;
}
.report-filename code {
    background: var(--bg-elevated);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.78rem;
    word-break: break-all;
}
.report-handled {
    color: var(--text-muted);
    font-size: 0.78rem;
    margin-top: 4px;
}

.report-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}
.report-btn {
    padding: 6px 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: var(--radius);
    font-size: 0.8rem;
    cursor: pointer;
    font-family: var(--font);
    transition: all var(--transition);
}
.report-btn:hover:not(:disabled) { border-color: var(--accent); }
.report-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.report-btn--delete {
    color: #ff8080;
    border-color: rgba(255,128,128,0.4);
}
.report-btn--dismiss { color: var(--text-muted); }

/* Report thumbnail → clickable to open the in-page viewer */
.report-thumb-btn {
    display: block;
    position: relative;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    overflow: hidden;
    border-radius: var(--radius);
}
.report-thumb-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.report-thumb-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0);
    color: rgba(255, 255, 255, 0);
    font-size: 1.4rem;
    transition: background 0.15s, color 0.15s;
}
.report-thumb-btn:hover .report-thumb-overlay {
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
}

/* In-page viewer for reports — lighter than the full lightbox, but lets
   the admin act on a flagged image without leaving the notifications page. */
.notif-view-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 6500;
    padding: 24px;
    flex-direction: column;
    gap: 14px;
}
.notif-view-close {
    position: absolute;
    top: 18px;
    right: 22px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    z-index: 6501;
}
.notif-view-name {
    position: absolute;
    top: 22px;
    left: 24px;
    right: 70px;
    color: #ddd;
    font-family: var(--font-mono, ui-monospace, monospace);
    font-size: 0.82rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    z-index: 6501;
}
.notif-view-body {
    max-width: 90vw;
    max-height: 78vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.notif-view-body img,
.notif-view-body video {
    max-width: 90vw;
    max-height: 78vh;
    width: auto;
    height: auto;
    display: block;
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.6);
}
.notif-view-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}
.notif-view-feedback {
    color: var(--text-muted);
    font-size: 0.82rem;
    min-height: 18px;
    text-align: center;
}
.notif-view-feedback--success { color: #6cce6c; }
.notif-view-feedback--error { color: var(--error); }

/* ──── ACCOUNT: MY REQUESTS PAGE ──── */
.account-intro {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 20px;
    max-width: 640px;
}
.account-form {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    max-width: 640px;
}
