:root {
  --accent: #00a651;
  --accent-dark: #007a3c;
  --bg: #0a0a0a;
  --surface: #121212;
  --surface-2: #1a1a1a;
  --surface-3: #222222;
  --border: #2a2a2a;
  --text: #ffffff;
  --text-muted: #888;
  --text-dim: #444;
  --radius: 10px;
  --shadow: 0 8px 32px rgba(0,0,0,0.5);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #444; }

.hidden { display: none !important; }
.screen { min-height: 100vh; }

/* ─── Login ──────────────────────────────────────────── */

#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 20% 60%, rgba(0,166,81,.07) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 40%, rgba(0,166,81,.05) 0%, transparent 55%),
    linear-gradient(160deg, #0a0a0f 0%, #0d0d14 60%, #0a0a0a 100%);
  position: relative;
  overflow: hidden;
}

#login-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    90deg, transparent, transparent 120px,
    rgba(255,255,255,.015) 120px, rgba(255,255,255,.015) 121px
  );
  pointer-events: none;
}

.login-box {
  background: rgba(255,255,255,.03);
  padding: 3rem 2.5rem;
  border-radius: 20px;
  text-align: center;
  backdrop-filter: blur(12px);
  border: 1px solid rgba(0,166,81,.25);
  width: min(400px, 90vw);
  box-shadow: 0 0 60px rgba(0,166,81,.05), var(--shadow);
  position: relative;
}

.login-icon {
  font-size: 3.5rem;
  margin-bottom: .75rem;
  display: block;
  filter: drop-shadow(0 4px 16px rgba(0,166,81,.5));
}

.login-box h1 {
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -.02em;
  margin-bottom: .3rem;
}

.login-subtitle {
  color: var(--accent);
  font-size: .85rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 2rem;
}

.login-box input {
  width: 100%;
  padding: .9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text);
  font-size: 1rem;
  margin-bottom: .9rem;
  transition: border-color .2s;
}

.login-box input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,166,81,.15);
}

.login-box button {
  width: 100%;
  padding: .9rem;
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  color: #000;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, transform .1s;
  letter-spacing: .02em;
}

.login-box button:hover  { background: var(--accent-dark); }
.login-box button:active { transform: scale(.98); }

.error {
  color: #ff6b6b;
  margin-top: .75rem;
  font-size: .85rem;
  min-height: 1.2em;
}

/* ─── Header ─────────────────────────────────────────── */

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .9rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
  gap: 1rem;
}

.header-brand { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }

.header-brand h1 {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.year-badge {
  background: var(--accent);
  color: #000;
  padding: .05rem .45rem;
  border-radius: 5px;
  font-size: .65em;
  font-weight: 800;
  vertical-align: middle;
  letter-spacing: .02em;
}

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

.header-actions { display: flex; gap: .6rem; flex-shrink: 0; }

.upload-btn, #logout-btn {
  padding: .6rem 1rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: .85rem;
  transition: all .2s;
  white-space: nowrap;
  min-height: 40px;
  display: flex;
  align-items: center;
  font-weight: 500;
}

.upload-btn { background: var(--accent); color: #000; border: none; font-weight: 600; }
.upload-btn:hover { background: var(--accent-dark); }

#logout-btn { background: transparent; border: 1px solid var(--border); color: var(--text-muted); }
#logout-btn:hover { border-color: #555; color: var(--text); }

/* ─── Filter bar ─────────────────────────────────────── */

.filter-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: .5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.filter-top { display: flex; align-items: center; gap: .5rem; }

.filter-tabs { display: flex; gap: .3rem; }

.filter-tab {
  padding: .35rem 1rem;
  border-radius: 20px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: .82rem;
  font-weight: 500;
  transition: all .2s;
  min-height: 32px;
}

.filter-tab.active { background: var(--accent); color: #000; font-weight: 700; border-color: var(--accent); }
.filter-tab:not(.active):hover { border-color: var(--border); color: var(--text); background: var(--surface-2); }

/* Label filter chips row */
.label-filter-bar {
  display: flex;
  gap: .35rem;
  flex-wrap: wrap;
  padding-bottom: .1rem;
}

.label-filter-bar:empty { display: none; }

.label-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .25rem .7rem;
  border-radius: 20px;
  border: 1px solid;
  cursor: pointer;
  font-size: .75rem;
  font-weight: 600;
  transition: all .15s;
  white-space: nowrap;
}

.label-filter-chip .chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* active state applied inline via JS */

/* ─── Upload progress ────────────────────────────────── */

#upload-progress {
  padding: .6rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.progress-bar { height: 3px; background: var(--surface-3); border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); width: 0%; transition: width .3s ease; }
.progress-text { display: block; margin-top: .4rem; font-size: .8rem; color: var(--text-muted); }

/* ─── Gallery grid ───────────────────────────────────── */

#gallery-screen { position: relative; min-height: calc(100vh - 120px); }

#gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 3px;
  padding: 3px;
}

/* Skeleton */
.media-item.skeleton { background: var(--surface-2); cursor: default; overflow: hidden; }
.media-item.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.05) 50%, transparent 100%);
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
  from { transform: translateX(-100%); }
  to   { transform: translateX(100%); }
}

/* Media tiles */
.media-item {
  aspect-ratio: 1;
  position: relative;
  cursor: pointer;
  overflow: hidden;
  background: var(--surface-2);
  animation: fadeUp .35s ease both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: scale(.97); }
  to   { opacity: 1; transform: scale(1); }
}

.media-item img,
.media-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}

.media-item:hover img,
.media-item:hover video { transform: scale(1.06); }

/* Video play icon */
.media-item.video::before {
  content: '▶';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  color: rgba(255,255,255,.9);
  text-shadow: 0 2px 12px rgba(0,0,0,.6);
  pointer-events: none;
  z-index: 2;
  transition: opacity .2s;
}

.media-item.video:hover::before { opacity: 0; }

/* Label overlay on thumbnails */
/* Pending-deletion flag (visible to admins only) */
.pending-deletion-flag {
  position: absolute;
  top: .35rem;
  right: .35rem;
  background: rgba(220, 38, 38, .85);
  color: #fff;
  font-size: .6rem;
  font-weight: 700;
  padding: .15rem .4rem;
  border-radius: 4px;
  letter-spacing: .03em;
  z-index: 3;
  pointer-events: none;
  backdrop-filter: blur(4px);
}

/* Dim the thumbnail so the flag stands out */
.media-item.pending-deletion img,
.media-item.pending-deletion video {
  opacity: .45;
}

/* Lightbox notice bar for pending-deletion items */
.pending-deletion-notice {
  background: rgba(220, 38, 38, .18);
  border: 1px solid rgba(220, 38, 38, .4);
  color: #fca5a5;
  font-size: .78rem;
  padding: .4rem .8rem;
  border-radius: 8px;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
}

.item-labels {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: .35rem .4rem;
  background: linear-gradient(transparent, rgba(0,0,0,.8));
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
  opacity: 0;
  transition: opacity .2s;
  pointer-events: none;
  z-index: 2;
}

.media-item:hover .item-labels { opacity: 1; }

/* Always show on touch screens */
@media (hover: none) {
  .item-labels { opacity: 1; }
}

.item-label-chip {
  font-size: .6rem;
  padding: .1rem .35rem;
  border-radius: 8px;
  color: #000;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
}

/* ─── Empty state ────────────────────────────────────── */

#empty-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5rem 2rem;
  gap: 1rem;
  color: var(--text-muted);
}

.empty-icon { font-size: 3rem; opacity: .4; }
#empty-message p { font-size: 1rem; }

/* ─── Drag overlay ───────────────────────────────────── */

#drag-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,166,81,.08);
  border: 2px dashed var(--accent);
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  margin: 6px;
  pointer-events: none;
}

#drag-overlay:not(.hidden) { pointer-events: all; }

.drag-message {
  font-size: 1.4rem;
  color: var(--accent);
  font-weight: 600;
  background: rgba(0,0,0,.6);
  padding: 1rem 2rem;
  border-radius: 12px;
  pointer-events: none;
}

/* ─── Lightbox ───────────────────────────────────────── */

#lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 3.5rem;
  overflow: hidden;
}

#lightbox-blur-bg {
  position: absolute;
  inset: -20px;
  background-size: cover;
  background-position: center;
  filter: blur(40px) brightness(.12) saturate(1.5);
  transform: scale(1.1);
  background-color: #000;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: rgba(0,0,0,.55);
  border: 1px solid rgba(255,255,255,.12);
  color: var(--text);
  font-size: 1.4rem;
  cursor: pointer;
  opacity: .85;
  transition: opacity .2s, background .2s, transform .15s;
  z-index: 10;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  user-select: none;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover { opacity: 1; background: rgba(0,0,0,.85); }

.lightbox-prev:hover { transform: translateY(-50%) scale(1.08); }
.lightbox-next:hover { transform: translateY(-50%) scale(1.08); }

.lightbox-close { top: 1rem; right: 1rem; font-size: 1.3rem; }
.lightbox-prev  { left: 1.25rem; top: 50%; transform: translateY(-50%); }
.lightbox-next  { right: 1.25rem; top: 50%; transform: translateY(-50%); }

/* Wide invisible tap strip behind each arrow — easier to hit on touch screens */
.lightbox-prev::before,
.lightbox-next::before {
  content: '';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 120px;
  border-radius: inherit;
}

#lightbox-counter {
  position: absolute;
  top: 1rem;
  left: 1rem;
  color: rgba(255,255,255,.65);
  font-size: .78rem;
  font-weight: 600;
  background: rgba(0,0,0,.55);
  padding: .3rem .75rem;
  border-radius: 20px;
  letter-spacing: .04em;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,.08);
  z-index: 10;
}

.lightbox-content {
  position: relative;
  z-index: 2;
  max-width: 92vw;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

#lightbox-img {
  max-width: 92vw;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
}

#lightbox-video {
  max-width: 92vw;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
}

/* Stacked bottom: labels then footer */
.lightbox-bottom {
  position: relative;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .55rem;
  width: min(92vw, 560px);
  padding-bottom: 1rem;
  z-index: 3;
}

/* Label section */
#lightbox-label-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .45rem;
  width: 100%;
}

#lightbox-label-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  justify-content: center;
}

#lightbox-label-chips:empty { display: none; }

/* Label chip (shared between lightbox and grid overlay) */
.label-chip {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .25rem .7rem;
  border-radius: 20px;
  border: 1px solid;
  font-size: .75rem;
  font-weight: 600;
  white-space: nowrap;
}

.label-chip .label-remove {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: .85rem;
  line-height: 1;
  padding: 0 0 0 .1rem;
  opacity: .7;
  transition: opacity .15s;
}

.label-chip .label-remove:hover { opacity: 1; }

/* Admin label input */
#label-input-row {
  display: flex;
  align-items: center;
  gap: .4rem;
  background: rgba(0,0,0,.6);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 20px;
  padding: .3rem .3rem .3rem .9rem;
  backdrop-filter: blur(6px);
}

#label-input {
  background: none;
  border: none;
  color: var(--text);
  font-size: .82rem;
  outline: none;
  width: 150px;
  min-width: 0;
}

#label-input::placeholder { color: rgba(255,255,255,.35); }

.label-add-btn {
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1;
  transition: background .15s;
}

.label-add-btn:hover { background: var(--accent-dark); }

/* Footer pill */
.lightbox-footer {
  display: flex;
  align-items: center;
  gap: .6rem;
  background: rgba(0,0,0,.75);
  padding: .55rem 1rem;
  border-radius: 30px;
  max-width: 100%;
  flex-wrap: wrap;
  justify-content: center;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.08);
}

#lightbox-caption {
  color: #aaa;
  font-size: .78rem;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lightbox-actions { display: flex; gap: .45rem; align-items: center; }

.action-btn {
  background: rgba(255,255,255,.12);
  border: none;
  color: var(--text);
  padding: .35rem .85rem;
  border-radius: 20px;
  cursor: pointer;
  font-size: .78rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: background .2s;
  min-height: 30px;
}

.action-btn:hover { background: rgba(255,255,255,.22); }

.delete-btn {
  background: rgba(255,71,87,.2);
  border: 1px solid rgba(255,71,87,.3);
  color: #ff6b7a;
  padding: .35rem .85rem;
  border-radius: 20px;
  cursor: pointer;
  font-size: .78rem;
  transition: all .2s;
  min-height: 30px;
}

.delete-btn:hover { background: #ff4757; border-color: #ff4757; color: #fff; }

.delete-btn.confirming {
  background: rgba(255,140,0,.25);
  border-color: rgba(255,140,0,.5);
  color: #ffaa33;
  animation: pulse .7s infinite alternate;
}

@keyframes pulse { from { opacity: 1; } to { opacity: .65; } }

/* ─── Toasts ─────────────────────────────────────────── */

#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  pointer-events: none;
}

.toast {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: .7rem 1.1rem;
  border-radius: var(--radius);
  font-size: .85rem;
  opacity: 0;
  transform: translateX(16px);
  transition: opacity .25s ease, transform .25s ease;
  max-width: 280px;
  box-shadow: var(--shadow);
  line-height: 1.4;
}

.toast.show     { opacity: 1; transform: translateX(0); }
.toast.success  { border-left: 3px solid #4caf50; }
.toast.error    { border-left: 3px solid #f44336; }
.toast.info     { border-left: 3px solid var(--accent); }

/* ─── Responsive ─────────────────────────────────────── */

@media (max-width: 900px) {
  #gallery-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

@media (max-width: 600px) {
  #gallery-grid { grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 2px; }

  header { padding: .7rem 1rem; }
  .header-brand h1 { font-size: 1rem; }
  .upload-btn, #logout-btn { padding: .55rem .8rem; font-size: .8rem; }

  .lightbox-prev, .lightbox-next { width: 40px; height: 40px; font-size: 1.1rem; }
  .lightbox-prev  { left: .4rem; }
  .lightbox-next  { right: .4rem; }
  #lightbox-caption { max-width: 110px; }

  .lightbox-bottom { bottom: .75rem; }

  #label-input { width: 110px; }

  #toast-container { bottom: 1rem; right: 1rem; left: 1rem; }
  .toast { max-width: 100%; }
}

@media (max-width: 400px) {
  #gallery-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ─── Comment panel ──────────────────────────────────── */

#comment-panel {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, 600px);
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-radius: 20px 20px 0 0;
  z-index: 110;
  display: flex;
  flex-direction: column;
  max-height: 65vh;
  box-shadow: 0 -8px 32px rgba(0,0,0,.5);
  animation: slideUpPanel .25s ease;
}

@keyframes slideUpPanel {
  from { transform: translateX(-50%) translateY(100%); }
  to   { transform: translateX(-50%) translateY(0); }
}

.comment-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .9rem 1.25rem .7rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.comment-panel-header h3 {
  font-size: .95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.comment-panel-count {
  font-size: .75rem;
  font-weight: 500;
  color: var(--text-muted);
}

/* Comment list */
.comment-list {
  overflow-y: auto;
  flex: 1;
  padding: .5rem 0;
}

.comment-list:empty::after {
  content: 'Nog geen reacties — wees de eerste!';
  display: block;
  text-align: center;
  color: var(--text-dim);
  font-size: .85rem;
  padding: 2rem 1rem;
}

.comment-item {
  display: flex;
  gap: .75rem;
  padding: .65rem 1.25rem;
  transition: background .15s;
}

.comment-item:hover { background: rgba(255,255,255,.03); }

.comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.comment-body { flex: 1; min-width: 0; }

.comment-meta {
  display: flex;
  align-items: baseline;
  gap: .5rem;
  margin-bottom: .2rem;
}

.comment-author {
  font-size: .82rem;
  font-weight: 700;
  color: var(--text);
}

.comment-time {
  font-size: .72rem;
  color: var(--text-muted);
}

.comment-text {
  font-size: .85rem;
  color: rgba(255,255,255,.85);
  line-height: 1.45;
  word-break: break-word;
}

.comment-delete {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: .8rem;
  padding: .15rem .3rem;
  border-radius: 4px;
  transition: color .15s, background .15s;
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: .1rem;
}

.comment-delete:hover { color: #ff6b7a; background: rgba(255,71,87,.1); }

/* Add comment form */
.comment-form {
  border-top: 1px solid var(--border);
  padding: .75rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  flex-shrink: 0;
  background: var(--surface);
}

#comment-author {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: .82rem;
  padding: .45rem .75rem;
  outline: none;
  transition: border-color .15s;
  width: 100%;
}

#comment-author:focus { border-color: var(--accent); }

.comment-input-row {
  display: flex;
  gap: .5rem;
  align-items: flex-end;
}

#comment-text {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: .85rem;
  padding: .5rem .75rem;
  outline: none;
  resize: none;
  font-family: inherit;
  line-height: 1.4;
  transition: border-color .15s;
  max-height: 100px;
  overflow-y: auto;
}

#comment-text:focus { border-color: var(--accent); }

.comment-submit {
  padding: .5rem 1rem;
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  color: #000;
  font-weight: 700;
  font-size: .82rem;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
  align-self: flex-end;
  min-height: 36px;
}

.comment-submit:hover    { background: var(--accent-dark); }
.comment-submit:disabled { opacity: .5; cursor: default; }

@media (max-width: 600px) {
  #comment-panel { width: 100%; border-radius: 16px 16px 0 0; }
  .comment-form  { padding: .65rem 1rem; }
  .comment-item  { padding: .6rem 1rem; }
}

/* ─── Delete-request panel (same shape as comment panel) */

#dr-panel {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, 600px);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 16px 16px 0 0;
  z-index: 200;
  box-shadow: 0 -8px 32px rgba(0,0,0,.5);
  animation: slideUpPanel .25s ease;
}

.dr-subtitle {
  margin: 0;
  padding: .1rem 1.25rem .6rem;
  font-size: .8rem;
  color: var(--text-muted);
}

.request-btn { color: #f59e0b; }
.request-btn.requested { color: var(--text-muted); cursor: default; }

/* ─── Requests admin header button + badge ────────────── */

.requests-btn {
  position: relative;
  padding: .6rem 1rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: .85rem;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  white-space: nowrap;
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: .4rem;
  transition: all .2s;
  font-weight: 500;
}
.requests-btn:hover { border-color: #f59e0b; color: #f59e0b; }

.requests-badge {
  background: #f59e0b;
  color: #000;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 700;
  padding: .1rem .45rem;
  min-width: 18px;
  text-align: center;
  line-height: 1.4;
}

/* ─── Admin delete-requests review modal ─────────────── */

.requests-list {
  overflow-y: auto;
  max-height: calc(88vh - 80px);
  padding: .5rem 0;
}

.request-entry {
  display: flex;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}
.request-entry:last-child { border-bottom: none; }

.request-thumb {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface);
  border: 1px solid var(--border);
}

.request-info { flex: 1; min-width: 0; }

.request-filename {
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: .4rem;
}

.request-row {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  padding: .4rem .6rem;
  background: rgba(255,255,255,.04);
  border-radius: 8px;
  margin-bottom: .4rem;
  font-size: .82rem;
}

.request-meta { color: var(--text-muted); }
.request-reason { color: var(--text); font-style: italic; }

.request-actions {
  display: flex;
  gap: .5rem;
  margin-top: .6rem;
  flex-wrap: wrap;
}

.btn-approve {
  padding: .35rem .8rem;
  border-radius: 8px;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: #dc2626;
  color: #fff;
  transition: background .2s;
}
.btn-approve:hover { background: #b91c1c; }

.btn-dismiss {
  padding: .35rem .8rem;
  border-radius: 8px;
  font-size: .8rem;
  cursor: pointer;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  transition: all .2s;
}
.btn-dismiss:hover { border-color: #555; color: var(--text); }

.requests-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  font-size: .9rem;
}

@media (max-width: 600px) {
  #dr-panel { width: 100%; border-radius: 16px 16px 0 0; }
}

/* ─── Upload staging modal ───────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  backdrop-filter: blur(6px);
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn .2s ease;
}

.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: min(620px, 100%);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,.65);
  animation: slideUp .22s ease;
}

@keyframes slideUp {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-header h2 { font-size: 1rem; font-weight: 700; }

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: .2rem .4rem;
  border-radius: 6px;
  transition: color .15s, background .15s;
}
.modal-close:hover { color: var(--text); background: var(--surface-3); }

/* Shared "label all" row */
.modal-shared {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .65rem 1.5rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.modal-shared-label {
  font-size: .72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
}

.modal-chip-row { display: flex; gap: .3rem; flex-wrap: wrap; }

/* Per-file list */
#upload-file-list {
  overflow-y: auto;
  flex: 1;
}

.upload-file-item {
  display: flex;
  gap: 1rem;
  padding: .9rem 1.5rem;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
  transition: background .15s;
}

.upload-file-item:last-child { border-bottom: none; }
.upload-file-item:hover { background: rgba(255,255,255,.02); }

/* Thumbnail */
.upload-thumb {
  width: 76px;
  height: 76px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface-3);
  display: block;
}

.upload-thumb-placeholder {
  width: 76px;
  height: 76px;
  border-radius: 8px;
  background: var(--surface-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  flex-shrink: 0;
}

/* File info column */
.upload-file-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .3rem;
}

.upload-filename {
  font-size: .85rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-filesize {
  font-size: .72rem;
  color: var(--text-muted);
}

.upload-chips {
  display: flex;
  gap: .3rem;
  flex-wrap: wrap;
  min-height: 1rem;
}

/* Compact label input used inside the modal */
.mini-label-form {
  display: flex;
  align-items: center;
  gap: .3rem;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: .2rem .2rem .2rem .65rem;
  width: fit-content;
  transition: border-color .15s;
}

.mini-label-form:focus-within { border-color: var(--accent); }

.mini-label-input {
  background: none;
  border: none;
  color: var(--text);
  font-size: .78rem;
  outline: none;
  width: 130px;
  min-width: 0;
}

.mini-label-input::placeholder { color: rgba(255,255,255,.28); }

/* Modal footer */
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: .65rem;
  padding: .9rem 1.5rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--surface);
}

.btn-secondary {
  padding: .55rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: .88rem;
  transition: all .15s;
}
.btn-secondary:hover { color: var(--text); border-color: #555; }

.btn-primary {
  padding: .55rem 1.3rem;
  border-radius: var(--radius);
  border: none;
  background: var(--accent);
  color: #000;
  cursor: pointer;
  font-size: .88rem;
  font-weight: 700;
  transition: background .15s, transform .1s;
}
.btn-primary:hover  { background: var(--accent-dark); }
.btn-primary:active { transform: scale(.97); }

/* Mobile modal */
@media (max-width: 600px) {
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal-box {
    border-radius: 16px 16px 0 0;
    max-height: 92vh;
    width: 100%;
  }
  .upload-file-item { padding: .75rem 1rem; }
  .upload-thumb, .upload-thumb-placeholder { width: 60px; height: 60px; }
  .mini-label-input { width: 100px; }
}
