/* AniOps: video gallery */

:root {
  --bg: #070707;
  --surface: #0f0f0f;
  --border: rgba(255, 255, 255, 0.06);
  --ink: #e8e8e8;
  --muted: #8a8a8a;
  --pink: #d87093;
  --pink-hover: #e088a6;
  --radius: 8px;
  --control-h: 34px;
  --page-max: 1000px;
  --page-pad: 24px;
}

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  background-color: var(--bg);
  color: var(--ink);
  font-family: "Outfit", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-weight: 400;
  line-height: 1.4;
  overflow-x: hidden;
}

body {
  display: flex;
  flex-direction: column;
}

::selection {
  background: rgba(216, 112, 147, 0.25);
}

/* ---------- top bar ---------- */

.topbar-inner {
  max-width: var(--page-max);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px var(--page-pad);
}

.brand {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.16em;
  color: #c8c8c8;
}

.upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  appearance: none;
  height: var(--control-h);
  border: 1px solid var(--border);
  background: var(--surface);
  color: #ffffff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}

.upload-btn:hover {
  border-color: var(--pink);
  color: var(--pink);
  box-shadow: 0 0 16px rgba(216, 112, 147, 0.08);
}

.upload-btn:active {
  transform: translateY(1px);
  box-shadow: none;
}

.upload-btn:focus-visible {
  border-color: var(--pink);
  box-shadow: 0 0 0 2px rgba(216, 112, 147, 0.15);
}

/* ---------- centered gallery wrapper ---------- */

.gallery-inner {
  max-width: var(--page-max);
  margin: 0 auto;
  width: 100%;
}

.gallery {
  flex: 1;
  padding: 26px var(--page-pad) 56px;
}

/* ---------- toolbar ---------- */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding-bottom: 12px;
}

.search-field {
  flex: 1 1 240px;
  min-width: 180px;
}

.search-field input {
  width: 100%;
  height: var(--control-h);
  background: var(--surface)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 24 24' fill='none' stroke='%238a8a8a' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.8-3.8'/%3E%3C/svg%3E")
    no-repeat 11px center;
  border: 1px solid var(--border);
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 0 12px 0 32px;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-field input::placeholder {
  color: var(--muted);
}

.search-field input:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 2px rgba(216, 112, 147, 0.12);
}

/* ---------- custom dropdowns (pop-out menus) ---------- */

.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: var(--control-h);
  background: var(--surface);
  border: 1px solid var(--border);
  color: #ffffff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 0 10px;
  border-radius: 8px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
}

.dropdown-trigger:hover {
  border-color: var(--pink);
}

.dropdown-trigger[aria-expanded="true"] {
  border-color: var(--pink);
  box-shadow: 0 0 16px rgba(216, 112, 147, 0.1);
}

.chevron {
  width: 0;
  height: 0;
  border-left: 3.5px solid transparent;
  border-right: 3.5px solid transparent;
  border-top: 4.5px solid var(--muted);
  transition: transform 0.2s ease;
}

.dropdown-trigger[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.55);
  display: none;
  z-index: 100;
  overflow: hidden;
  animation: dropdownFade 0.22s ease;
}

.dropdown-menu.open {
  display: block;
}

@keyframes dropdownFade {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown-option {
  padding: 8px 12px;
  color: var(--ink);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
  white-space: nowrap;
}

.dropdown-option:hover {
  background: rgba(216, 112, 147, 0.12);
  color: var(--pink);
}

.dropdown-option.active {
  color: var(--pink);
  font-weight: 500;
}

/* ---------- floating settings panel ---------- */

.settings-wrap {
  position: relative;
  margin-left: auto;
  width: fit-content;
}

.floating-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 240px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.55);
  z-index: 100;
  display: none;
  flex-direction: column;
  animation: panelSlide 0.22s ease;
}

@keyframes panelSlide {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.panel-handle {
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

.panel-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.panel-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.panel-label {
  font-size: 12px;
  color: var(--muted);
}

.panel-action {
  background: transparent;
  border: 1px solid rgba(216, 112, 147, 0.3);
  color: var(--pink);
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.panel-action:hover {
  background: var(--pink);
  color: #050505;
  border-color: var(--pink);
}

.panel-close {
  margin-top: 4px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 11.5px;
  cursor: pointer;
  padding: 6px 14px;
  text-align: left;
  border-radius: 4px;
  transition: color 0.2s ease, background 0.2s ease;
}

.panel-close:hover {
  color: var(--pink);
  background: rgba(216, 112, 147, 0.08);
}

.settings-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  appearance: none;
  width: var(--control-h);
  height: var(--control-h);
  border: 1px solid var(--border);
  background: var(--surface);
  color: #ffffff;
  font-size: 15px;
  padding: 0;
  border-radius: 8px;
  cursor: pointer;
  line-height: 1;
  transition: border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.settings-btn:hover {
  border-color: var(--pink);
  color: var(--pink);
  box-shadow: 0 0 16px rgba(216, 112, 147, 0.08);
}

/* ---------- grid ---------- */

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

.grid[data-layout="list"] {
  grid-template-columns: 1fr;
  gap: 12px;
}

.video-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  height: 100%;
}

.video-card:hover {
  border-color: rgba(216, 112, 147, 0.45);
  box-shadow: 0 0 24px rgba(216, 112, 147, 0.06);
}

.card-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0a0a0a;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.card-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55), transparent);
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.video-card:hover .card-thumb::after {
  opacity: 0.45;
}

.duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.65);
  color: #ffffff;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 3px;
  z-index: 2;
}

.play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 36px;
  height: 36px;
  background: var(--pink);
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transform: translate(-50%, -50%) scale(0.85);
  opacity: 0;
  z-index: 2;
  transition: transform 0.2s ease, opacity 0.2s ease;
  pointer-events: none;
}

.video-card:hover .play {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.card-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.title {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.meta {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* list layout */
.grid[data-layout="list"] .video-card {
  flex-direction: row;
  height: 108px;
}

.grid[data-layout="list"] .card-thumb {
  width: 150px;
  height: 100%;
  aspect-ratio: auto;
  flex-shrink: 0;
}

.grid[data-layout="list"] .card-body {
  padding: 10px 14px;
  flex: 1;
}

.grid[data-layout="list"] .title {
  font-size: 13px;
}

/* ---------- empty state ---------- */

.empty {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin-top: 64px;
}

/* ---------- modal ---------- */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  backdrop-filter: blur(4px);
}

.modal-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 1400px;
  max-height: 94vh;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  overflow-y: auto;
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 24px;
  background: none;
  border: none;
  color: #ffffff;
  font-size: 22px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.2s ease;
  z-index: 2;
}

.modal-close:hover {
  color: var(--pink);
}

/* ---------- custom video player ---------- */

.player {
  position: relative;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
}

.player video {
  display: block;
  width: 100%;
  height: auto;
  max-height: 84vh;
  cursor: pointer;
}

.player:fullscreen {
  border-radius: 0;
}

.player:fullscreen video {
  max-height: 100vh;
  height: 100vh;
  object-fit: contain;
}

.player-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 24px 14px 10px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.75), transparent);
  display: flex;
  flex-direction: column;
  gap: 8px;
  opacity: 1;
  transition: opacity 0.25s ease;
}

.player.hide-controls .player-controls {
  opacity: 0;
  pointer-events: none;
}

.player.hide-controls video {
  cursor: none;
}

/* timeline / scrubber */

.timeline {
  position: relative;
  height: 14px;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 2px;
  transition: height 0.15s ease;
}

.timeline:hover::before,
.timeline.seeking::before {
  height: 6px;
}

.timeline-fill {
  position: absolute;
  left: 0;
  height: 4px;
  width: 0%;
  background: var(--pink);
  border-radius: 2px;
  transition: height 0.15s ease;
  pointer-events: none;
}

.timeline:hover .timeline-fill,
.timeline.seeking .timeline-fill {
  height: 6px;
}

.timeline-knob {
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--pink);
  border-radius: 50%;
  transform: translateX(-50%) scale(0);
  transition: transform 0.15s ease;
  pointer-events: none;
  left: 0%;
  top: 50%;
  margin-top: -6px;
}

.timeline:hover .timeline-knob,
.timeline.seeking .timeline-knob {
  transform: translateX(-50%) scale(1);
}

/* control buttons row */

.controls-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ctrl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  border-radius: 6px;
  color: #ffffff;
  cursor: pointer;
  padding: 0;
  transition: color 0.18s ease, background 0.18s ease;
}

.ctrl-btn:hover {
  color: var(--pink);
  background: rgba(216, 112, 147, 0.12);
}

.ctrl-btn .icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
  display: none;
}

/* icon state swaps */

.player:not(.playing) .icon-play,
.player.playing .icon-pause,
.player:not(.muted) .icon-vol,
.player.muted .icon-muted,
.player:not(.fs) .icon-fs,
.player.fs .icon-fs-exit {
  display: block;
}

/* volume */

.volume-wrap {
  display: flex;
  align-items: center;
  gap: 2px;
}

.volume-slider {
  width: 72px;
  height: 4px;
  accent-color: var(--pink);
  cursor: pointer;
}

/* timestamps */

.time-label {
  font-size: 12px;
  color: #d8d8d8;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  user-select: none;
  padding-left: 4px;
}

.controls-spacer {
  flex: 1;
}

.modal-meta h1 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.modal-meta {
  font-size: 12px;
  color: var(--muted);
  padding: 0 4px;
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  :root {
    --page-pad: 20px;
  }
}

@media (max-width: 640px) {
  :root {
    --page-pad: 16px;
  }

  .topbar-inner {
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .gallery {
    padding-top: 20px;
    padding-bottom: 40px;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .search-field {
    min-width: auto;
    /* stacked toolbar: keep the field one row tall (flex-basis 240px would make it 240px tall) */
    flex: 0 0 auto;
  }

  .dropdown-trigger {
    width: 100%;
  }

  .settings-wrap {
    align-self: flex-end;
  }

  .floating-panel {
    width: min(240px, calc(100vw - 32px));
  }

  .modal {
    padding: 10px;
  }

  .modal-content {
    padding: 8px;
  }

  .volume-slider {
    width: 56px;
  }

  .modal-close {
    top: 12px;
    right: 16px;
  }
}

.hidden {
  display: none !important;
}

/* ---------- hover-to-preview ---------- */

.thumb-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  pointer-events: none;
}

/* ---------- multi-select ---------- */

.select-check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  appearance: none;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  color: #ffffff;
  cursor: pointer;
  padding: 0;
  line-height: 0;
  opacity: 0;
  z-index: 3;
  transition: opacity 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.select-check svg {
  display: block;
  width: 12px;
  height: 12px;
  fill: currentColor;
}

.video-card:hover .select-check,
.video-card.selected .select-check {
  opacity: 1;
}

.video-card.selected .select-check {
  background: var(--pink);
  border-color: var(--pink);
  color: #050505;
}

.video-card.selected {
  border-color: rgba(216, 112, 147, 0.65);
  box-shadow: 0 0 24px rgba(216, 112, 147, 0.1);
}

/* ---------- selection pill (bottom-center) ---------- */

.selection-pill {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 8px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.55);
  z-index: 70;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.selection-pill.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.pill-count {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  padding-right: 10px;
  border-right: 1px solid var(--border);
  white-space: nowrap;
}

.pill-btn {
  background: transparent;
  border: 1px solid rgba(216, 112, 147, 0.3);
  color: var(--pink);
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.pill-btn:hover {
  background: rgba(216, 112, 147, 0.12);
  border-color: var(--pink);
}

.pill-btn.pill-primary {
  background: var(--pink);
  border-color: var(--pink);
  color: #050505;
}

.pill-btn.pill-primary:hover {
  background: var(--pink-hover);
  border-color: var(--pink-hover);
}

/* player download icon is always visible (stateless button) */
.ctrl-btn .icon-dl {
  display: block;
}

@media (max-width: 640px) {
  .selection-pill {
    bottom: 14px;
    padding: 6px 8px 6px 12px;
    gap: 8px;
  }
}

/* ---------- upload modal ---------- */

.upload-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 460px;
  max-width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  animation: dropdownFade 0.22s ease;
}

.upload-head {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink);
}

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 26px 16px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.015);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
  outline: none;
}

.dropzone:hover,
.dropzone:focus-visible,
.dropzone.dragover {
  border-color: var(--pink);
  color: var(--pink);
  background: rgba(216, 112, 147, 0.06);
}

.dropzone.has-file {
  border-style: solid;
  border-color: rgba(216, 112, 147, 0.45);
  color: var(--ink);
}

.dropzone-icon {
  width: 22px;
  height: 22px;
  fill: currentColor;
  opacity: 0.8;
}

.field-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.field-label .optional {
  text-transform: none;
  letter-spacing: 0.02em;
  font-weight: 400;
  opacity: 0.7;
}

.text-input {
  width: 100%;
  height: var(--control-h);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  padding: 0 12px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.text-input::placeholder {
  color: var(--muted);
}

.text-input:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 2px rgba(216, 112, 147, 0.12);
}

/* category dropdown, full width inside the form */

.upload-cat {
  display: block;
}

.upload-cat .dropdown-trigger {
  width: 100%;
  justify-content: space-between;
}

.upload-cat .dropdown-menu {
  width: 100%;
}

/* actions row */

.upload-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.pill-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pill-btn.pill-primary:disabled:hover {
  background: var(--pink);
  border-color: var(--pink);
  color: #050505;
}

@media (max-width: 640px) {
  .upload-card {
    width: 100%;
    padding: 16px;
  }
}

/* ---------- quick-filter category row ---------- */

.quick-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
  margin-bottom: 24px;
}

.qfilter {
  appearance: none;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 4px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.qfilter:hover {
  border-color: var(--pink);
  color: var(--pink);
}

.qfilter.active {
  background: rgba(216, 112, 147, 0.12);
  border-color: var(--pink);
  color: var(--pink);
}

/* ---------- default volume setting ---------- */

.panel-volume {
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-slider {
  width: 108px;
  accent-color: var(--pink);
}

.panel-volume-value {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  min-width: 34px;
  text-align: right;
}

/* ---------- upload progress + toast ---------- */

.video-card.pending {
  opacity: 0.6;
  cursor: progress;
}

.video-card.pending:hover {
  border-color: var(--border);
  box-shadow: none;
}

.toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  max-width: min(480px, calc(100vw - 32px));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.55);
  color: var(--ink);
  font-size: 13px;
  padding: 10px 14px;
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.error {
  border-color: rgba(216, 112, 147, 0.6);
  color: var(--pink);
}

/* ---------- top bar account controls ---------- */

a.brand {
  text-decoration: none;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-user {
  font-size: 12px;
  color: var(--muted);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 0.06em;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease;
}

.link-btn:hover,
.link-btn.active {
  color: var(--pink);
  background: rgba(216, 112, 147, 0.1);
}

/* ---------- profile header ---------- */

.profile-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.profile-name {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.profile-stats {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

/* ---------- log in / sign up page ---------- */

.auth {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px var(--page-pad);
}

.auth-card {
  width: 360px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
}

.auth-brand {
  font-size: 15px;
  letter-spacing: 0.16em;
}

.auth-title {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.field-hint {
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
}

.auth-error {
  min-height: 18px;
  font-size: 12.5px;
  color: var(--pink);
}

.auth-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.auth-actions .pill-btn {
  height: var(--control-h);
  display: inline-flex;
  align-items: center;
}

.auth-stack {
  width: 360px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-stack .auth-card {
  width: 100%;
}

.dev-accounts {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--surface);
  border: 1px dashed rgba(216, 112, 147, 0.35);
  border-radius: 10px;
  padding: 16px 24px;
}

.dev-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.dev-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.dev-actions .pill-btn {
  height: var(--control-h);
  display: inline-flex;
  align-items: center;
}

/* ---------- profile page ---------- */

.profile {
  margin-bottom: 28px;
}

.profile-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 22px;
  background: linear-gradient(135deg, rgba(216, 112, 147, 0.14), rgba(216, 112, 147, 0.02) 60%), var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  flex-wrap: wrap;
}

.profile-avatar {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--pink);
  color: #050505;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 600;
}

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

.profile-hero .profile-name {
  font-size: var(--p-name-size, 24px);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.role-badge {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--ink);
}

.role-badge.admin {
  border-color: rgba(216, 112, 147, 0.6);
  background: rgba(216, 112, 147, 0.14);
  color: var(--pink);
}

.profile-back {
  margin-left: auto;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.stat-value {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.section-title {
  margin-top: 26px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.modal-actions {
  margin-top: 10px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

a.link-btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

/* uploader name in the player details: use the site's pink, not the browser's default link colour */
.modal-meta a.byline {
  color: var(--pink);
  text-decoration: none;
  font-weight: 500;
}

.modal-meta a.byline:hover {
  color: var(--pink-hover);
  text-decoration: underline;
}

/* any other plain links inherit the site's colours */
a {
  color: inherit;
}

.profile-bio {
  margin-top: 8px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink);
  white-space: pre-line;
  max-width: 60ch;
  overflow-wrap: anywhere;
}

.profile-joined {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

/* just the site's icon: no box, border or background behind it */
.link-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: none;
  border: none;
  opacity: 0.85;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.link-icon:hover {
  opacity: 1;
  transform: translateY(-1px);
}

.link-icon img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  border-radius: 3px;
}

.profile-tools {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-left: auto;
}

.profile-tools .pill-btn {
  height: var(--control-h);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.mod-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.mod-links .pill-btn {
  height: var(--control-h);
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.danger-zone {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
  padding: 16px 18px;
  border: 1px solid rgba(216, 112, 147, 0.25);
  border-radius: var(--radius);
}

.danger-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--pink);
}

.danger-text {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
  max-width: 60ch;
}

.pill-btn.danger {
  border-color: rgba(216, 112, 147, 0.6);
  color: var(--pink);
}

.pill-btn.danger:hover {
  background: var(--pink);
  color: #050505;
}

.link-inputs {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bio-input {
  height: auto;
  min-height: 84px;
  padding: 10px 12px;
  resize: vertical;
  line-height: 1.4;
}

.report-box {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* report controls sit right under the title, where they are easy to find */
.modal-meta .report-box {
  margin: 6px 0 8px;
  margin-left: 0;
  justify-content: flex-start;
}

.report-select {
  height: var(--control-h);
  width: auto;
  padding: 0 8px;
}

.video-card.awaiting .meta {
  color: var(--pink);
}

/* ---------- profile customisation (driven by CSS variables set in app.js) ---------- */

:root {
  --p-accent: #d87093;
  --p-text: #e8e8e8;
  --p-bg-from: #1c0d14;
  --p-bg-to: #070707;
  --p-angle: 135deg;
  --p-radius: 12px;
  --p-blur: 0px;
  --p-card-alpha: 3;
  --p-font: "Outfit", system-ui, sans-serif;
  --p-banner: none;
  --p-avatar: none;
  --p-accent-ok: #d87093;
  --p-page-text: #e8e8e8;
  --p-page-muted: rgba(232, 232, 232, 0.72);
  --p-page-accent: #d87093;
  --p-page-btn-border: rgba(216, 112, 147, 0.3);
  --p-page-btn-hover: rgba(216, 112, 147, 0.12);
  --p-muted: rgba(232, 232, 232, 0.72);
  --p-btn-border: rgba(216, 112, 147, 0.3);
  --p-btn-hover: rgba(216, 112, 147, 0.12);
  --p-card: rgb(255 255 255 / 3%);
}

.auto-contrast.disabled,
.custom-field.disabled {
  opacity: 0.45;
}

.auto-contrast {
  flex-direction: row !important;
  align-items: center;
  justify-content: space-between;
}

.auto-contrast input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--pink);
}

.profile {
  font-family: var(--p-font);
  color: var(--p-page-text);
}

.profile-banner {
  height: 170px;
  border-radius: var(--p-radius) var(--p-radius) 0 0;
  background-image: var(--p-banner);
  background-size: cover;
  background-position: center;
  background-color: var(--p-bg-to);
  margin-bottom: -40px;
}

.profile-banner.hidden {
  display: none !important;
}

.profile-hero {
  position: relative;
  background: linear-gradient(var(--p-angle), var(--p-bg-from), var(--p-bg-to));
  border-radius: var(--p-radius);
  backdrop-filter: blur(var(--p-blur));
  -webkit-backdrop-filter: blur(var(--p-blur));
}

/* no visible outline: the gradient runs into the page's black instead of ending at a pink edge */
.profile .profile-hero {
  border-color: transparent;
  /* size the gradient to the whole box and never repeat it; otherwise the edge shows its light start colour */
  background-origin: border-box;
  background-repeat: no-repeat;
}

.profile.has-banner .profile-hero {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  padding-top: 52px;
}

.profile-avatar {
  background-color: var(--p-accent);
  background-image: var(--p-avatar);
  background-size: cover;
  background-position: center;
  color: #050505;
}

/* with an uploaded avatar, hide the initial letter so only the picture shows */
.profile.has-avatar .profile-avatar {
  color: transparent;
  font-size: 0;
}

.profile-name {
  color: var(--p-text);
}

.profile-tagline {
  font-size: 13.5px;
  color: var(--p-accent);
  margin-top: 4px;
}

.profile-tagline.hidden {
  display: none !important;
}

.profile .section-title {
  color: var(--p-page-accent, var(--p-accent));
}

/* text inside the gradient box uses the box's readable colour */
.profile-joined,
.profile-meta {
  color: var(--p-muted, var(--muted));
}

.profile-bio {
  color: var(--p-text, var(--ink));
}

/* text on the page (stats, mod buttons) uses the page's readable colour */
.profile .stat-label {
  color: var(--p-page-muted, var(--muted));
}

.profile .stat-value {
  color: var(--p-page-text, var(--ink));
}

.profile .mod-links .pill-btn:not(.danger) {
  color: var(--p-page-text, #e8e8e8);
  border-color: var(--p-page-btn-border, rgba(216, 112, 147, 0.3));
}

.profile .mod-links .pill-btn:not(.danger):hover {
  color: var(--p-page-text, #e8e8e8);
  border-color: var(--p-page-text, #e8e8e8);
  background: var(--p-page-btn-hover, rgba(216, 112, 147, 0.12));
}

.profile-tagline {
  color: var(--p-accent-ok, var(--p-accent)) !important;
}

.profile .stat {
  background: var(--p-card, rgb(255 255 255 / 3%));
  border-radius: var(--p-radius);
  backdrop-filter: blur(var(--p-blur));
  -webkit-backdrop-filter: blur(var(--p-blur));
}

.profile.hide-bio .profile-bio,
.profile.hide-links .profile-links {
  display: none !important;
}

.profile.hide-stats .stat-row {
  display: none !important;
}

/* buttons on a profile use the readable text colour, so they stay visible on any background */
.profile .pill-btn:not(.danger) {
  color: var(--p-text, #e8e8e8);
  border-color: var(--p-btn-border, rgba(216, 112, 147, 0.3));
  border-radius: 8px; /* outline: squared corners, like the Upload button; pill and solid override this */
}

.profile .pill-btn:not(.danger):hover {
  border-color: var(--p-text, #e8e8e8);
  background: var(--p-btn-hover, rgba(216, 112, 147, 0.12));
  color: var(--p-text, #e8e8e8);
}

/* ---------- profile customisation: layout, type, shape and buttons (classes set on #profileView) ---------- */

/* a column, so the stats can move above the hero with `order` (the banner stays first) */
.profile {
  display: flex;
  flex-direction: column;
}

.profile .profile-banner {
  order: -2;
}

/* name, bio and small text sizes come from the popup */
.profile .profile-bio,
.profile .profile-tagline,
.profile .profile-joined,
.profile .profile-meta {
  font-size: var(--p-body-size, 13px);
}

/* solid background: the box uses the start colour only, no gradient */
.profile.bg-solid .profile-hero {
  background: var(--p-bg-from, #1c0d14);
}

/* centred: avatar, text and tools stack in the middle of the hero */
.profile.align-center .profile-hero {
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  text-align: center;
}

.profile.align-center .profile-avatar {
  margin: 0 auto;
}

.profile.align-center .profile-info {
  flex: none;
}

.profile.align-center .profile-bio {
  margin-left: auto;
  margin-right: auto;
}

.profile.align-center .profile-links,
.profile.align-center .mod-links {
  justify-content: center;
}

.profile.align-center .profile-tools {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  margin: 0;
}

/* avatar shapes: circle is the base rule (50%) */
.profile.avatar-rounded .profile-avatar {
  border-radius: 18px;
}

.profile.avatar-square .profile-avatar {
  border-radius: 0;
}

/* stats above the hero. With a banner, the banner no longer tucks under the hero, so keep it separate */
.profile.stats-above .stat-row {
  order: -1;
  margin-top: 0;
  margin-bottom: 12px;
}

.profile.stats-above.has-banner .stat-row {
  margin-top: 12px;
}

.profile.stats-above .profile-banner {
  margin-bottom: 0;
  border-radius: var(--p-radius, 12px);
}

.profile.stats-above.has-banner .profile-hero {
  border-top-left-radius: var(--p-radius, 12px);
  border-top-right-radius: var(--p-radius, 12px);
  padding-top: 22px;
}

/* solid buttons: filled. Hero buttons use the hero text colour; page buttons use the page text colour */
.profile.buttons-solid .pill-btn:not(.danger) {
  background: var(--p-text, #e8e8e8);
  border-color: var(--p-text, #e8e8e8);
  color: var(--p-btn-ink, #111111);
}

.profile.buttons-solid .mod-links .pill-btn:not(.danger) {
  background: var(--p-page-text, #e8e8e8);
  border-color: var(--p-page-text, #e8e8e8);
  color: var(--p-page-btn-ink, #111111);
}

.profile.buttons-solid .pill-btn:not(.danger):hover,
.profile.buttons-solid .mod-links .pill-btn:not(.danger):hover {
  opacity: 0.88;
}

/* pill buttons: fully rounded ends (the .pill-btn base is already 999px, so this keeps the look explicit) */
.profile.buttons-pill .pill-btn:not(.danger) {
  border-radius: 999px;
}

/* pinned clips: a responsive grid of the gallery's own video cards */
.profile-featured.hidden {
  display: none !important;
}

.featured-grid {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  margin-top: 12px;
}

@media (min-width: 641px) {
  .featured-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 18px;
  }
}

@media (max-width: 640px) {
  /* large names wrap on a phone instead of being cut off */
  .profile-hero .profile-name {
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

/* customise modal */

.custom-card {
  width: 540px;
}

.custom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.custom-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.custom-field.wide {
  grid-column: 1 / -1;
}

.custom-field input[type="color"] {
  width: 100%;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  padding: 3px;
  cursor: pointer;
}

.custom-field input[type="range"] {
  width: 100%;
  accent-color: var(--pink);
}

.custom-checks,
.custom-images {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  font-size: 13px;
}

.custom-images .pill-btn {
  height: 30px;
  display: inline-flex;
  align-items: center;
}

@media (max-width: 640px) {
  .custom-card {
    width: 100%;
  }

  .custom-grid {
    grid-template-columns: 1fr;
  }
}

/* popup: group headings and help text span the whole grid, so the new controls read as sections */
.custom-group {
  grid-column: 1 / -1;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
}

.custom-help {
  grid-column: 1 / -1;
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--muted);
}

.custom-group + .custom-help {
  margin-top: -6px;
}

.custom-card select {
  color-scheme: dark;
  cursor: pointer;
}

.custom-field input[type="range"] {
  cursor: pointer;
}

.custom-checks input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--pink);
  cursor: pointer;
}

.custom-card textarea {
  width: 100%;
  min-height: 84px;
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--ink);
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  line-height: 1.4;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.custom-card textarea:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 2px rgba(216, 112, 147, 0.12);
}

.custom-card .upload-actions {
  flex-wrap: wrap;
}

/* preset buttons wrap onto as many rows as they need */
#cPresets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#cPresets button {
  height: 30px;
  display: inline-flex;
  align-items: center;
}

/* pinned clip picker: a short scrolling list of checkboxes */
#cFeaturedList {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 6px 14px;
  max-height: 180px;
  overflow-y: auto;
}

#cFeaturedList label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 13px;
  cursor: pointer;
  overflow-wrap: anywhere;
}

#cFeaturedList input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  accent-color: var(--pink);
  cursor: pointer;
}

#cFeaturedList label:has(input:disabled) {
  opacity: 0.45;
  cursor: not-allowed;
}

#cFeaturedLimit {
  font-size: 11.5px;
  color: var(--muted);
}

/* status line under the look code box */
#cShareStatus {
  min-height: 16px;
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 640px) {
  #cFeaturedList {
    grid-template-columns: 1fr;
    max-height: 150px;
  }

  .custom-card textarea {
    min-height: 96px;
  }
}

/* ---------- staff and owner panels ---------- */

.panel {
  flex: 1;
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 24px var(--page-pad) 56px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.panel-title {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.panel-status {
  min-height: 18px;
  font-size: 12.5px;
  color: var(--muted);
}

.panel-status.error {
  color: var(--pink);
}

.panel .text-input {
  width: 100%;
}

.panel-row {
  /* index.html's settings panel also uses .panel-row; keep this rule so that panel does not change */
  display: grid;
  grid-template-columns: 96px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}

.panel-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
}

.ptabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ptab {
  min-height: var(--control-h);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.ptab:hover {
  color: var(--ink);
  border-color: rgba(216, 112, 147, 0.45);
}

.ptab.active {
  color: var(--pink);
  border-color: var(--pink);
  background: rgba(216, 112, 147, 0.12);
}

.ptab-count {
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 7px;
  font-variant-numeric: tabular-nums;
}

.ptab.active .ptab-count {
  color: var(--pink);
  border-color: rgba(216, 112, 147, 0.5);
}

.psearch {
  flex: 1 1 240px;
  max-width: 360px;
  min-width: 0;
}

.pempty {
  font-size: 12.5px;
  color: var(--muted);
  padding: 8px 0;
}

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

.pgrid > .paccount {
  grid-column: 1 / -1;
}

.pcard {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.pcard:hover {
  transform: translateY(-2px);
  border-color: rgba(216, 112, 147, 0.45);
  box-shadow: 0 0 24px rgba(216, 112, 147, 0.06), 0 8px 20px rgba(0, 0, 0, 0.35);
}

.pcard-media {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0a0a0a;
  overflow: hidden;
  cursor: pointer;
}

.pcard-media:focus-visible {
  outline: 2px solid var(--pink);
  outline-offset: -3px;
}

.pcard-thumb {
  position: absolute;
  inset: 0;
  background-color: #0a0a0a;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.pcard-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.pcard.is-previewing .pcard-preview {
  opacity: 1;
}

.pcard-duration {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 2;
  background: rgba(0, 0, 0, 0.65);
  color: #ffffff;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 3px;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.pcard-chip {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 8px;
  color: var(--ink);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
}

.pcard-chip-waiting {
  color: var(--ink);
}

.pcard-chip-reported {
  border-color: rgba(216, 112, 147, 0.6);
  color: var(--pink);
}

.pcard-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 12px 14px 0;
}

.pcard-title {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.35;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pcard-meta {
  font-size: 11px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.pcard-reasons {
  font-size: 11.5px;
  color: var(--pink);
  overflow-wrap: anywhere;
}

.pcard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 14px 14px;
}

.pbtn {
  min-height: var(--control-h);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  background: transparent;
  border: 1px solid rgba(216, 112, 147, 0.3);
  border-radius: 999px;
  color: var(--pink);
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.pbtn:hover {
  background: rgba(216, 112, 147, 0.12);
  border-color: var(--pink);
}

.pbtn:disabled {
  opacity: 0.5;
  cursor: default;
}

.pbtn-primary {
  background: var(--pink);
  border-color: var(--pink);
  color: #050505;
}

.pbtn-primary:hover {
  background: var(--pink-hover);
  border-color: var(--pink-hover);
}

.pbtn-danger {
  border-color: rgba(216, 112, 147, 0.6);
  color: var(--pink);
}

.pbtn-danger:hover {
  background: var(--pink);
  border-color: var(--pink);
  color: #050505;
}

.ptab:focus-visible,
.pbtn:focus-visible {
  outline: 2px solid var(--pink);
  outline-offset: 2px;
}

.paccount {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.paccount-info {
  flex: 1 1 220px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.paccount .pcard-actions {
  padding: 0;
  justify-content: flex-end;
}

.pchip {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border: 1px solid rgba(216, 112, 147, 0.5);
  border-radius: 999px;
  color: var(--pink);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: middle;
}

@media (max-width: 640px) {
  .psearch {
    flex: 1 1 100%;
    max-width: none;
  }

  .pgrid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .paccount-info {
    flex-basis: 100%;
  }

  .panel-row {
    grid-template-columns: 1fr;
  }

  /* the gallery's report box (index.html) uses this rule too */
  .report-box {
    margin-left: 0;
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pcard,
  .pcard-preview,
  .ptab,
  .pbtn {
    transition: none;
  }

  .pcard:hover {
    transform: none;
  }
}

/* the category menu in the upload form opens inline so the form card does not clip it */
.upload-cat .dropdown-menu {
  position: static;
  margin-top: 6px;
  box-shadow: none;
}

@media (max-width: 640px) {
  .stat-row {
    grid-template-columns: 1fr;
  }

  .profile-hero {
    padding: 16px;
  }

  .profile-back {
    margin-left: 0;
  }
}

/* share status messages: errors in the pink accent colour */
#cShareStatus.error {
  color: var(--pink);
}

/* Settings panel: the volume row stacks (label, then slider and value) so nothing sticks out of the box */
.floating-panel .panel-row {
  display: flex;
  flex-direction: column;
  grid-template-columns: none;
  align-items: stretch;
  gap: 8px;
}

.floating-panel .panel-volume {
  width: 100%;
  min-width: 0;
}

.floating-panel .panel-slider {
  flex: 1;
  width: auto;
  min-width: 0;
}

.floating-panel .panel-volume-value {
  min-width: 40px;
}

/* ---------- footer, signup agreement, and policy pages ---------- */

.site-footer {
  text-align: center;
  padding: 22px var(--page-pad) 30px;
  font-size: 12px;
  color: var(--muted);
}

.site-footer a,
.legal a,
.agree-row a {
  color: var(--pink);
  text-decoration: none;
}

.site-footer a:hover,
.legal a:hover,
.agree-row a:hover {
  text-decoration: underline;
}

.agree-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.45;
}

.agree-row input {
  margin-top: 3px;
  accent-color: var(--pink);
}

.legal-page {
  flex: 1;
}

.legal {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px var(--page-pad) 48px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.65;
}

.legal h1 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.legal .legal-updated {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 22px;
}

.legal h2 {
  font-size: 16px;
  font-weight: 600;
  margin: 26px 0 8px;
}

.legal p,
.legal li {
  margin-bottom: 10px;
}

.legal ul,
.legal ol {
  padding-left: 22px;
}

.legal .notice {
  padding: 12px 14px;
  border: 1px solid rgba(216, 112, 147, 0.35);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 13px;
}

/* sign-in buttons */
.oauth-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.oauth-btn {
  display: block;
  text-align: center;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.18s ease, color 0.18s ease;
}

.oauth-btn:hover {
  border-color: var(--pink);
  color: var(--pink);
}

/* owner tools span the whole panel grid */
.pgrid .pfull {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* empty error lines take no space, so the sign-in card stays tight */
.auth-error:empty {
  display: none;
}

/* text for search engines and screen readers that is not drawn on screen */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* site logo next to the name */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.brand-logo {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  object-fit: contain;
}
