:root {
  color-scheme: dark;
  --bg: #07080b;
  --bg-2: #0d1017;
  --panel: rgba(18, 22, 31, .82);
  --panel-solid: #131722;
  --panel-hover: rgba(30, 37, 52, .92);
  --text: #f7f8fb;
  --muted: #a4adbc;
  --soft: #737e91;
  --line: rgba(255,255,255,.105);
  --line-strong: rgba(255,255,255,.22);
  --accent: #74e4ff;
  --accent-2: #b59cff;
  --accent-3: #ffffff;
  --danger: #ff7373;
  --radius: 24px;
  --shadow: 0 24px 70px rgba(0,0,0,.45);
  --glow: 0 0 0 1px rgba(116,228,255,.28), 0 0 36px rgba(116,228,255,.16), 0 18px 60px rgba(0,0,0,.38);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background:
    radial-gradient(circle at 20% -10%, rgba(116,228,255,.14), transparent 32rem),
    radial-gradient(circle at 90% 8%, rgba(181,156,255,.12), transparent 30rem),
    linear-gradient(180deg, var(--bg), var(--bg-2) 48%, #06070a);
  color: var(--text);
  min-height: 100vh;
  letter-spacing: -.01em;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.026) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.72), transparent 80%);
}

a { color: inherit; text-decoration: none; }
code { color: #d8edff; }

.site-header {
  position: relative;
  border-bottom: 1px solid var(--line);
  background: rgba(4,5,8,.74);
  box-shadow: 0 18px 70px rgba(0,0,0,.35);
  overflow: hidden;
}

.site-banner-wrap {
  position: relative;
  overflow: hidden;
  background: #090b10;
}

.site-banner {
  width: 100%;
  max-height: 430px;
  aspect-ratio: 2 / 1;
  object-fit: cover;
  display: block;
  filter: saturate(1.08) contrast(1.04);
  transform: scale(1.002);
}

.site-banner-wrap::after,
.site-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  pointer-events: none;
}

.site-banner-wrap::after {
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0,0,0,.08), rgba(0,0,0,.58)),
    radial-gradient(circle at 50% 100%, rgba(116,228,255,.16), transparent 42%);
}

.site-header::after {
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(116,228,255,.62), rgba(181,156,255,.42), transparent);
}

.site-heading {
  position: relative;
  z-index: 1;
  width: min(1500px, 90vw);
  margin: 0 auto;
  padding: 32px 0 34px;
}

.gallery-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
}

.site-kicker,
.back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.back {
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.035);
  transition: border-color .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.back:hover {
  color: var(--text);
  border-color: rgba(116,228,255,.48);
  box-shadow: 0 0 26px rgba(116,228,255,.14);
  transform: translateY(-1px);
}

.site-header h1 {
  margin: 12px 0 10px;
  font-size: clamp(2.4rem, 6vw, 6rem);
  line-height: .9;
  letter-spacing: -0.075em;
  text-wrap: balance;
}

.site-header p {
  color: var(--muted);
  margin: 0;
  font-size: 1.02rem;
}

.wrap {
  position: relative;
  z-index: 1;
  width: min(1500px, 90vw);
  margin: 36px auto 72px;
}

.gallery-grid,
.image-grid {
  display: grid;
  gap: 22px;
}

.gallery-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.image-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.gallery-card,
.image-tile,
.empty {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.025));
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.gallery-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  isolation: isolate;
  transition: transform .24s ease, border-color .24s ease, box-shadow .24s ease, background .24s ease;
}

.gallery-card::before,
.image-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(116,228,255,.0), rgba(116,228,255,.55), rgba(181,156,255,.38), rgba(255,255,255,.0));
  opacity: 0;
  pointer-events: none;
  transition: opacity .24s ease;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

.gallery-card:hover {
  transform: translateY(-7px) scale(1.01);
  border-color: rgba(116,228,255,.34);
  box-shadow: var(--glow);
  background: var(--panel-hover);
}

.gallery-card:hover::before,
.image-tile:hover::before,
.image-tile:has(.select-image:checked)::before { opacity: 1; }

.cover {
  position: relative;
  aspect-ratio: 16 / 10;
  background:
    radial-gradient(circle at 50% 34%, rgba(116,228,255,.18), transparent 38%),
    linear-gradient(135deg, #181d28, #090b10 62%);
  overflow: hidden;
}

.cover::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 58%;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.62));
  pointer-events: none;
}

.cover img,
.image-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .35s ease, filter .35s ease;
}

.gallery-card:hover .cover img,
.image-tile:hover img {
  transform: scale(1.045);
  filter: saturate(1.1) contrast(1.04);
}

.gallery-info {
  position: relative;
  padding: 20px 20px 22px;
}

.gallery-info h2 {
  margin: 0 0 8px;
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  letter-spacing: -.04em;
}

.gallery-info p {
  color: var(--muted);
  margin: 0 0 14px;
  line-height: 1.45;
}

.gallery-info span,
.image-count-pill,
.last-upload-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #dbe8f7;
  font-size: .84rem;
  font-weight: 800;
  padding: 8px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.055);
}

.gallery-info span::before,
.image-count-pill::before,
.last-upload-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px rgba(116,228,255,.78);
}


.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 11px 18px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(210,241,255,.92));
  color: #071018;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 12px 32px rgba(116,228,255,.14);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px rgba(116,228,255,.26), 0 18px 48px rgba(116,228,255,.22);
}

.button:active { transform: translateY(0); }

.button:disabled,
.button[aria-disabled="true"] {
  opacity: .42;
  cursor: not-allowed;
  pointer-events: none;
  filter: grayscale(.35);
  box-shadow: none;
}


.button.secondary {
  background: rgba(255,255,255,.045);
  color: var(--text);
  border-color: var(--line-strong);
  box-shadow: none;
}

.button.secondary:hover {
  border-color: rgba(116,228,255,.55);
  background: rgba(116,228,255,.08);
}


.button.danger {
  background: linear-gradient(135deg, rgba(255,117,117,.96), rgba(255,190,135,.9));
  color: #180707;
  border-color: rgba(255,255,255,.2);
  box-shadow: 0 12px 32px rgba(255,117,117,.13);
}

.button.danger:hover {
  box-shadow: 0 0 0 1px rgba(255,145,145,.25), 0 18px 48px rgba(255,117,117,.2);
}

.button.small {
  min-height: 34px;
  padding: 7px 12px;
  font-size: .82rem;
}

.inline-delete-form {
  display: inline-flex;
  margin: 0;
}

.notice {
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px;
  color: rgba(255,255,255,.9);
  background: rgba(255,255,255,.055);
}

.notice.success {
  border-color: rgba(116,228,255,.24);
  background: rgba(116,228,255,.075);
}

.sort-toggle-button {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.sort-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1em;
  height: 1em;
  font-size: 1.05em;
  line-height: 1;
}

.image-grid { gap: 18px; }

.image-tile {
  position: relative;
  display: block;
  aspect-ratio: 3 / 2;
  border-radius: 18px;
  overflow: hidden;
  background: #10141d;
  isolation: isolate;
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}

.image-tile:hover {
  transform: translateY(-4px);
  border-color: rgba(116,228,255,.35);
  box-shadow: var(--glow);
}

.image-tile:has(.select-image:checked) {
  border-color: rgba(116,228,255,.72);
  box-shadow: 0 0 0 1px rgba(116,228,255,.38), 0 0 42px rgba(116,228,255,.18), 0 20px 60px rgba(0,0,0,.42);
}

.lightbox-link {
  display: block;
  width: 100%;
  height: 100%;
  cursor: zoom-in;
}

.select-image {
  position: absolute;
  z-index: 5;
  top: 14px;
  left: 14px;
  width: 24px;
  height: 24px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.55));
}

.download-icon {
  position: absolute;
  z-index: 5;
  right: 14px;
  top: 14px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(5,8,12,.72);
  color: #fff;
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 8px 26px rgba(0,0,0,.38);
  font-size: 0;
  line-height: 1;
  opacity: 0;
  transform: translateY(-8px) scale(.96);
  transition: opacity .2s ease, transform .2s ease, background .2s ease, box-shadow .2s ease;
  backdrop-filter: blur(12px);
}

.download-icon::before {
  content: "";
  width: 18px;
  height: 18px;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3a1 1 0 0 1 1 1v8.59l2.3-2.3a1 1 0 1 1 1.4 1.42l-4 4a1 1 0 0 1-1.4 0l-4-4a1 1 0 1 1 1.4-1.42l2.3 2.3V4a1 1 0 0 1 1-1ZM5 19a1 1 0 0 1 1-1h12a1 1 0 1 1 0 2H6a1 1 0 0 1-1-1Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.download-icon:hover {
  background: rgba(116,228,255,.20);
  box-shadow: 0 0 26px rgba(116,228,255,.24), 0 10px 30px rgba(0,0,0,.36);
}

.image-tile:hover .download-icon,
.image-tile:focus-within .download-icon {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.image-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0,0,0,.48), transparent 38%, rgba(0,0,0,.22)),
    radial-gradient(circle at 50% 10%, rgba(116,228,255,.16), transparent 38%);
  opacity: 0;
  transition: opacity .2s ease;
}

.image-tile:hover::after,
.image-tile:has(.select-image:checked)::after { opacity: 1; }

.empty {
  padding: 34px;
  border-style: dashed;
  border-radius: var(--radius);
  color: var(--muted);
}

.empty h2 { color: var(--text); margin-top: 0; }

.pager {
  display: flex;
  justify-content: center;
  gap: 18px;
  align-items: center;
  margin: 40px 0 0;
  color: var(--muted);
}

.pager a {
  padding: 10px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.035);
  transition: border-color .18s ease, color .18s ease, box-shadow .18s ease;
}

.pager a:hover {
  color: var(--text);
  border-color: rgba(116,228,255,.48);
  box-shadow: 0 0 24px rgba(116,228,255,.12);
}

.lightbox {
  position: fixed;
  inset: 0;
  box-sizing: border-box;
  background: rgba(0,0,0,.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: clamp(16px, 4vw, 56px) clamp(12px, 4vw, 24px);
  overflow: hidden;
  backdrop-filter: blur(18px);
}

.lightbox[hidden] { display: none; }

.lightbox-panel {
  width: 100%;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  box-sizing: border-box;
}

.lightbox img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 146px);
  max-height: calc(100dvh - 146px);
  object-fit: contain;
  border-radius: 16px;
  box-shadow: 0 24px 100px rgba(0,0,0,.7), 0 0 0 1px rgba(255,255,255,.14);
}


.lightbox-image-time {
  display: block !important;
  width: 100%;
  min-height: 1.4em;
  margin: -2px 0 0;
  color: #ffffff !important;
  font-size: 13px;
  line-height: 1.4;
  letter-spacing: .02em;
  text-align: center;
  text-shadow: 0 2px 14px rgba(0,0,0,.9);
}

.lightbox-image-time[hidden] {
  display: block !important;
}

.lightbox-download {
  width: auto;
  min-width: 190px;
  justify-content: center;
}

#closeLightbox {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  color: #fff;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}

#closeLightbox:hover {
  transform: rotate(90deg) scale(1.04);
  background: rgba(116,228,255,.14);
  box-shadow: 0 0 30px rgba(116,228,255,.18);
}

@media (max-width: 1180px) {
  .image-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 1000px) {
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .image-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .gallery-heading { align-items: start; flex-direction: column; }
  .toolbar { justify-content: flex-start; }
}

@media (max-width: 640px) {
  .wrap,
  .site-heading { width: 92vw; }
  .gallery-grid { grid-template-columns: 1fr; }
  .image-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .image-tile { border-radius: 10px; }
  .select-image { top: 7px; left: 7px; width: 18px; height: 18px; }
  .download-icon { top: 7px; right: 7px; width: 30px; height: 30px; }
  .download-icon::before { width: 14px; height: 14px; }
  .site-banner { max-height: 280px; }
  .site-header h1 { font-size: clamp(2.2rem, 14vw, 4.2rem); }
  .toolbar { width: 100%; }
  .button { width: 100%; }
  .lightbox { padding: 14px 10px; }
  .lightbox-panel { max-width: calc(100vw - 20px); max-height: calc(100dvh - 24px); gap: 12px; }
  .lightbox img { max-height: calc(100dvh - 140px); border-radius: 12px; }
  .lightbox-download { width: 100%; min-width: 0; }
  #closeLightbox { top: 12px; right: 12px; width: 42px; height: 42px; }
}

/* v6: gallery page heading overlays the shared banner */
.gallery-page-header {
  min-height: clamp(300px, 42vw, 430px);
}

.gallery-page-header .site-banner-wrap {
  min-height: inherit;
}

.gallery-page-header .site-banner {
  min-height: inherit;
}

.gallery-page-header .site-banner-wrap::after {
  background:
    linear-gradient(180deg, rgba(0,0,0,.10), rgba(0,0,0,.72)),
    linear-gradient(90deg, rgba(0,0,0,.70), rgba(0,0,0,.20) 48%, rgba(0,0,0,.56)),
    radial-gradient(circle at 18% 82%, rgba(116,228,255,.22), transparent 38%);
}

.gallery-page-header .gallery-heading {
  position: absolute;
  left: 50%;
  right: auto;
  bottom: 0;
  transform: translateX(-50%);
  z-index: 3;
  padding: 0 0 34px;
  align-items: flex-end;
}

.gallery-page-header .gallery-heading h1 {
  max-width: 980px;
  text-shadow: 0 8px 36px rgba(0,0,0,.62);
}

.gallery-page-header .gallery-heading p {
  max-width: 760px;
  text-shadow: 0 4px 20px rgba(0,0,0,.62);
}

.gallery-page-header .toolbar {
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  background: rgba(5,8,12,.42);
  box-shadow: 0 18px 50px rgba(0,0,0,.28);
  backdrop-filter: blur(16px);
}

.gallery-page-header .image-count-pill {
  min-height: 46px;
  background: rgba(255,255,255,.075);
  border-color: rgba(255,255,255,.16);
}

.gallery-page-header .last-upload-pill {
  min-height: 46px;
  background: rgba(255,255,255,.045);
  border-color: rgba(255,255,255,.12);
  color: var(--muted);
  white-space: nowrap;
}

.gallery-page-header .last-upload-pill::before {
  background: rgba(255,255,255,.52);
  box-shadow: none;
}


@media (max-width: 1000px) {
  .gallery-page-header .gallery-heading {
    align-items: flex-start;
    flex-direction: column;
    padding-bottom: 28px;
  }
  .gallery-page-header .toolbar {
    justify-content: flex-start;
    border-radius: 24px;
  }
}

@media (max-width: 640px) {
  .gallery-page-header {
    min-height: 420px;
  }
  .gallery-page-header .gallery-heading {
    width: 92vw;
    padding-bottom: 22px;
  }
  .gallery-page-header .toolbar {
    width: 100%;
    padding: 10px;
  }
  .gallery-page-header .image-count-pill,
  .gallery-page-header .last-upload-pill {
    width: 100%;
    justify-content: center;
  }
}


/* v6.1: homepage heading overlays banner and homepage download-all support */
.home-page-header {
  min-height: clamp(300px, 42vw, 430px);
}

.home-page-header .site-banner-wrap {
  min-height: inherit;
}

.home-page-header .site-banner {
  min-height: inherit;
}

.home-page-header .site-banner-wrap::after {
  background:
    linear-gradient(180deg, rgba(0,0,0,.10), rgba(0,0,0,.72)),
    linear-gradient(90deg, rgba(0,0,0,.70), rgba(0,0,0,.20) 48%, rgba(0,0,0,.56)),
    radial-gradient(circle at 18% 82%, rgba(116,228,255,.22), transparent 38%);
}

.home-page-header .home-heading {
  position: absolute;
  left: 50%;
  right: auto;
  bottom: 0;
  transform: translateX(-50%);
  z-index: 3;
  padding: 0 0 34px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
}

.home-page-header .home-heading h1 {
  max-width: 980px;
  text-shadow: 0 8px 36px rgba(0,0,0,.62);
}

.home-page-header .toolbar {
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  background: rgba(5,8,12,.42);
  box-shadow: 0 18px 50px rgba(0,0,0,.28);
  backdrop-filter: blur(16px);
}

@media (max-width: 1000px) {
  .home-page-header .home-heading {
    align-items: flex-start;
    flex-direction: column;
    padding-bottom: 28px;
  }
  .home-page-header .toolbar {
    justify-content: flex-start;
    border-radius: 24px;
  }
}

@media (max-width: 640px) {
  .home-page-header {
    min-height: 420px;
  }
  .home-page-header .home-heading {
    width: 92vw;
    padding-bottom: 22px;
  }
  .home-page-header .toolbar {
    width: 100%;
    padding: 10px;
  }
  .home-page-header .button {
    width: 100%;
  }
}

.cover-placeholder {
    min-height: 220px;
    display: grid;
    place-items: center;
    padding: 24px;
    text-align: center;
    color: rgba(255,255,255,0.68);
    font-size: 0.88rem;
    letter-spacing: 0.02em;
    background: radial-gradient(circle at 50% 20%, rgba(255,255,255,0.12), rgba(255,255,255,0.03) 52%, rgba(255,255,255,0.015));
}

.compact-header {
    min-height: auto;
    padding: 32px 0 0;
}

.static-heading {
    position: relative;
    inset: auto;
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    padding: 28px;
    border-radius: 26px;
}

.status-panel {
    padding: 22px;
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 24px;
    background: rgba(255,255,255,0.055);
    box-shadow: 0 24px 80px rgba(0,0,0,0.28);
    overflow-x: auto;
}

.status-table {
    width: 100%;
    border-collapse: collapse;
}

.status-table th,
.status-table td {
    padding: 14px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.09);
    text-align: left;
}

.status-table th {
    color: rgba(255,255,255,0.72);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
}

.status-table small,
.status-note {
    color: rgba(255,255,255,0.58);
}

/* v6.6 thumbnail placeholder states */
.thumb-placeholder-tile {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 28%, rgba(255,184,77,.16), transparent 42%),
    linear-gradient(135deg, rgba(255,255,255,.055), rgba(255,255,255,.018));
  border-style: dashed;
  border-color: rgba(255,184,77,.24);
  box-shadow: 0 18px 52px rgba(0,0,0,.28);
}

.thumb-placeholder-tile:hover {
  transform: none;
  border-color: rgba(255,184,77,.42);
  box-shadow: 0 0 0 1px rgba(255,184,77,.18), 0 22px 60px rgba(0,0,0,.34);
}


.thumb-placeholder-link {
  display: block;
  width: 100%;
  height: 100%;
  color: inherit;
  text-decoration: none;
  cursor: zoom-in;
}

.thumb-placeholder-link:hover .thumb-placeholder small {
  color: #dbe8f7;
}

.thumb-placeholder {
  display: grid;
  place-items: center;
  gap: 8px;
  width: 100%;
  height: 100%;
  padding: 18px;
  text-align: center;
  color: #ffe5a3;
}

.thumb-placeholder-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffb84d;
  box-shadow: 0 0 18px rgba(255,184,77,.88), 0 0 40px rgba(255,184,77,.28);
  animation: thumbStatusPulse 1.4s ease-in-out infinite;
}

.thumb-placeholder strong {
  font-size: .92rem;
  letter-spacing: -.01em;
}

.thumb-placeholder small {
  max-width: 100%;
  color: var(--muted);
  font-size: .72rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-tile.thumb-placeholder-tile::after,
.image-tile.thumb-placeholder-tile::before { opacity: 0; }
.image-tile.thumb-placeholder-tile .download-icon,
.image-tile.thumb-placeholder-tile .select-image { display: none; }

.cover-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 18px;
  color: #ffe5a3;
  text-align: center;
  font-weight: 800;
  background:
    radial-gradient(circle at 50% 32%, rgba(255,184,77,.16), transparent 42%),
    linear-gradient(135deg, #151a24, #090c12 70%);
}

.cover-placeholder::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 8px;
  display: inline-block;
  background: #ffb84d;
  box-shadow: 0 0 16px rgba(255,184,77,.82);
  animation: thumbStatusPulse 1.4s ease-in-out infinite;
}

/* v6.7 progressive scroll loading */
.infinite-loader {
  width: min(420px, calc(100% - 32px));
  margin: 34px auto 8px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  background: rgba(255,255,255,0.055);
  color: rgba(255,255,255,0.74);
  box-shadow: 0 16px 50px rgba(0,0,0,0.28), inset 0 1px 0 rgba(255,255,255,0.08);
  backdrop-filter: blur(16px);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

.infinite-loader.is-loading .thumb-placeholder-dot {
  animation-duration: 0.85s;
}


/* v6.12: brand logo aligns to the page/top-bar right edge */
.site-banner-wrap .brand-logo {
  position: absolute;
  top: clamp(18px, 3vw, 34px);
  right: max(5vw, calc((100vw - 1500px) / 2));
  z-index: 3;
  width: 5%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: 50%;
  filter: drop-shadow(0 18px 42px rgba(0,0,0,.46)) drop-shadow(0 0 22px rgba(116,228,255,.18));
}

@media (max-width: 640px) {
  .site-banner-wrap .brand-logo {
    width: 20%;
    top: 16px;
    right: 5vw;
  }
}

/* v6.13: pinned selected-images download bar */
.selection-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  padding: 14px max(20px, calc((100vw - 1500px) / 2 + 20px)) calc(14px + env(safe-area-inset-bottom));
  pointer-events: none;
}

.selection-bar[hidden] {
  display: none;
}

.selection-bar-inner {
  width: min(760px, 100%);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px 12px 20px;
  border: 1px solid rgba(116,228,255,.26);
  border-radius: 999px;
  background: rgba(5,8,12,.78);
  box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 22px 70px rgba(0,0,0,.52), 0 0 38px rgba(116,228,255,.16);
  backdrop-filter: blur(20px);
  pointer-events: auto;
  animation: selectionBarIn .18s ease-out both;
}

.selection-count {
  color: var(--text);
  font-weight: 900;
  letter-spacing: -.01em;
  white-space: nowrap;
}

@keyframes selectionBarIn {
  from { opacity: 0; transform: translateY(18px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 640px) {
  .selection-bar {
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  }

  .selection-bar-inner {
    width: 100%;
    border-radius: 24px;
    padding: 10px;
    gap: 10px;
  }

  .selection-count {
    padding-left: 6px;
    font-size: .9rem;
  }

  .selection-bar .button {
    min-height: 42px;
    padding: 10px 14px;
    font-size: .9rem;
  }
}

/* v6.20: password gate modal */
.login-page {
  overflow-x: hidden;
}

.login-page .site-header {
  min-height: 100vh;
  border-bottom: 0;
}

.login-page .site-banner {
  max-height: none;
  min-height: 100vh;
  aspect-ratio: auto;
}

.login-page .site-banner-wrap::after {
  background:
    linear-gradient(180deg, rgba(0,0,0,.18), rgba(0,0,0,.78)),
    radial-gradient(circle at 50% 42%, rgba(116,228,255,.2), transparent 34rem),
    radial-gradient(circle at 72% 18%, rgba(181,156,255,.18), transparent 26rem);
}

.login-page .home-heading {
  position: absolute;
  left: 50%;
  bottom: max(28px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 2;
  opacity: .42;
  pointer-events: none;
}

.login-page .wrap {
  position: fixed;
  inset: 0;
  z-index: 20;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: clamp(18px, 4vw, 44px);
  display: grid;
  place-items: center;
  min-height: 100vh;
  background: rgba(4,6,10,.18);
  backdrop-filter: blur(6px);
}

.login-card {
  width: min(520px, calc(100vw - 32px));
  margin: 0;
  position: relative;
  border: 1px solid rgba(116,228,255,.24);
  border-radius: 34px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.13), rgba(255,255,255,.045)),
    rgba(10,14,22,.78);
  box-shadow:
    0 0 0 1px rgba(255,255,255,.06),
    0 32px 110px rgba(0,0,0,.62),
    0 0 70px rgba(116,228,255,.16);
  backdrop-filter: blur(26px);
  overflow: hidden;
  animation: loginModalIn .22s ease-out both;
}

.login-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 0%, rgba(116,228,255,.18), transparent 18rem),
    linear-gradient(90deg, transparent, rgba(255,255,255,.12), transparent);
  opacity: .9;
}

.login-card-inner {
  position: relative;
  z-index: 1;
  padding: clamp(26px, 4vw, 44px);
}

.login-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  color: #d8f7ff;
  font-size: .76rem;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
  padding: 8px 11px;
  border: 1px solid rgba(116,228,255,.2);
  border-radius: 999px;
  background: rgba(116,228,255,.08);
}

.login-kicker::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px rgba(116,228,255,.78);
}

.login-card h2 {
  margin: 0 0 10px;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: .95;
  letter-spacing: -.065em;
}

.login-copy {
  margin: 0 0 24px;
  color: var(--muted);
  line-height: 1.55;
}

.login-error {
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid rgba(255,184,77,.38);
  border-radius: 16px;
  background: rgba(255,184,77,.1);
  color: #ffe4ad;
  font-weight: 800;
  box-shadow: 0 0 24px rgba(255,184,77,.08);
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-form label:not(.remember-row) {
  color: var(--text);
  font-size: .86rem;
  font-weight: 900;
}

.login-form input[type="password"] {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 18px;
  background: rgba(0,0,0,.32);
  color: var(--text);
  font: inherit;
  font-size: 1.1rem;
  padding: 15px 16px;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}

.login-form input[type="password"]:focus {
  border-color: rgba(116,228,255,.72);
  box-shadow: 0 0 0 4px rgba(116,228,255,.12), inset 0 1px 0 rgba(255,255,255,.08);
}

.remember-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: .95rem;
  user-select: none;
}

.remember-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.login-form .button {
  width: 100%;
  margin-top: 4px;
}

@keyframes loginModalIn {
  from { opacity: 0; transform: translateY(18px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 640px) {
  .login-page .wrap {
    padding: 16px;
    backdrop-filter: blur(4px);
  }

  .login-card {
    width: 100%;
    border-radius: 28px;
  }

  .login-card-inner {
    padding: 24px;
  }
}

/* v7.3 logout button */

.logout-form {
    display: inline-flex;
    align-items: center;
    margin: 0;
}

.logout-button {
    white-space: nowrap;
}

/* v7.9: lightbox sharing controls */
.lightbox-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.lightbox-share[hidden] { display: none !important; }

.share-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.22.09-.45.09-.7s-.04-.48-.09-.7l7.05-4.11A2.99 2.99 0 1 0 15 5c0 .25.04.48.09.7L8.04 9.81A3 3 0 1 0 8.04 14.2l7.12 4.18c-.04.2-.06.41-.06.62a2.9 2.9 0 1 0 2.9-2.92Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

@media (max-width: 760px) {
  .lightbox-actions {
    width: 100%;
    flex-direction: column;
  }
  .lightbox-actions .button {
    width: 100%;
    min-width: 0;
  }
}

/* v7.11: icon-only lightbox share button beside download */
.lightbox-actions {
  flex-direction: row;
}

.lightbox-share.icon-only {
  width: 46px;
  min-width: 46px;
  height: 46px;
  padding: 0;
  border-radius: 999px;
}

.lightbox-share.icon-only .share-icon {
  width: 19px;
  height: 19px;
}

.lightbox-share.is-copied {
  box-shadow: 0 0 0 1px rgba(255,255,255,.32), 0 0 22px rgba(255,255,255,.20);
}

@media (max-width: 760px) {
  .lightbox-actions {
    width: 100%;
    flex-direction: row;
    justify-content: center;
    flex-wrap: nowrap;
  }
  .lightbox-actions .lightbox-download {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
  }
  .lightbox-actions .lightbox-share.icon-only {
    flex: 0 0 46px;
    width: 46px;
    min-width: 46px;
  }
}

/* v7.13-beta: QR recognition beta */
.home-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.qr-beta-wrap {
  display: grid;
  gap: 28px;
}

.qr-beta-panel,
.qr-results-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,.075), rgba(255,255,255,.03));
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  padding: clamp(22px, 4vw, 36px);
}

.qr-beta-panel h2,
.qr-results-panel h2 {
  margin: 8px 0 10px;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  letter-spacing: -.045em;
}

.qr-beta-panel p,
.qr-results-panel p {
  color: var(--muted);
  margin: 0;
}

.qr-support-warning {
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 190, 86, .42);
  border-radius: 16px;
  color: #ffe2ad;
  background: rgba(255, 190, 86, .08);
}

.qr-controls {
  display: flex;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
  margin-top: 26px;
}

.qr-controls label {
  display: grid;
  gap: 8px;
  min-width: min(100%, 320px);
  color: var(--muted);
  font-weight: 800;
  font-size: .82rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.qr-controls select {
  appearance: none;
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255,255,255,.07);
  color: var(--text);
  padding: 14px 18px;
  font: inherit;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.qr-progress {
  margin-top: 24px;
  display: grid;
  gap: 12px;
}

.qr-progress-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  color: var(--muted);
}

.qr-progress-row strong { color: var(--text); }

.qr-progress-bar {
  height: 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.06);
  overflow: hidden;
}

.qr-progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 24px rgba(116,228,255,.26);
  transition: width .25s ease;
}

.qr-results-list {
  display: grid;
  gap: 16px;
  margin-top: 18px;
}

.qr-gallery-result {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.04);
  padding: 16px;
}

.qr-gallery-result h3 {
  margin: 0 0 12px;
  letter-spacing: -.025em;
}

.qr-result-row {
  display: grid;
  grid-template-columns: minmax(160px, .75fr) minmax(0, 1.25fr);
  gap: 12px;
  align-items: start;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.qr-result-row:first-of-type { border-top: 0; }
.qr-result-row span { color: var(--muted); overflow-wrap: anywhere; }
.qr-result-row code { overflow-wrap: anywhere; white-space: pre-wrap; }
.qr-empty { color: var(--muted); }

@media (max-width: 720px) {
  .home-actions { width: 100%; justify-content: flex-start; }
  .qr-controls,
  .qr-controls .button { width: 100%; }
  .qr-result-row { grid-template-columns: 1fr; }
}

/* v7.20-beta QR code generator */
.qr-generator-wrap,
.qr-admin-wrap {
    max-width: 1040px;
}

.qr-generator-card {
    border: 1px solid rgba(255,255,255,.14);
    background: linear-gradient(135deg, rgba(18,22,30,.92), rgba(11,14,20,.86));
    border-radius: 28px;
    box-shadow: 0 24px 90px rgba(0,0,0,.38), 0 0 44px rgba(96,151,205,.14);
    padding: clamp(24px, 4vw, 44px);
    max-width: 760px;
    margin: 0 auto;
}

.qr-generator-card h2 {
    margin-top: 0;
}

.qr-generator-form {
    display: grid;
    gap: 18px;
    margin-top: 24px;
}

.qr-generator-form label {
    display: grid;
    gap: 8px;
    color: rgba(255,255,255,.82);
    font-weight: 700;
    letter-spacing: .01em;
}

.qr-generator-form input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 16px;
    background: rgba(255,255,255,.08);
    color: #fff;
    padding: 14px 16px;
    font: inherit;
    outline: none;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.02);
}

.qr-generator-form input:focus {
    border-color: rgba(96,151,205,.76);
    box-shadow: 0 0 0 4px rgba(96,151,205,.16);
}

.form-grid-two {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.qr-card-preview {
    display: flex;
    justify-content: center;
    margin: 26px 0;
}

.qr-card-preview img {
    width: min(100%, 420px);
    border-radius: 22px;
    box-shadow: 0 18px 60px rgba(0,0,0,.34);
    background: #fff;
}

.qr-generator-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.qr-admin-table-wrap {
    overflow-x: auto;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 20px;
}

.qr-admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.qr-admin-table th,
.qr-admin-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,.09);
}

.qr-admin-table th {
    color: rgba(255,255,255,.62);
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.qr-admin-table td {
    color: rgba(255,255,255,.88);
}

@media (max-width: 720px) {
    .form-grid-two {
        grid-template-columns: 1fr;
    }
    .qr-generator-actions {
        align-items: stretch;
        flex-direction: column;
    }
    .qr-generator-actions .button {
        justify-content: center;
    }
}

/* Server-side QR search controls. Added v7.25-beta. */
.sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.qr-search-control{display:flex;align-items:center;gap:.45rem;margin:0}.qr-search-control input[type=search]{width:10.5rem;max-width:32vw;border:1px solid rgba(255,255,255,.16);border-radius:999px;background:rgba(7,10,16,.52);color:#fff;padding:.72rem .9rem;outline:none;box-shadow:inset 0 0 0 1px rgba(255,255,255,.04);transition:width .2s ease,border-color .2s ease,box-shadow .2s ease}.qr-search-control input[type=search]::placeholder{color:rgba(255,255,255,.58)}.qr-search-control input[type=search]:focus{width:14rem;border-color:rgba(124,181,255,.58);box-shadow:0 0 0 3px rgba(124,181,255,.14),0 0 22px rgba(124,181,255,.16)}.qr-search-results{margin-bottom:2rem}.qr-search-summary{display:flex;align-items:center;gap:.75rem;flex-wrap:wrap;margin:0 0 1.25rem;padding:1rem 1.1rem;border:1px solid rgba(255,255,255,.12);border-radius:1.1rem;background:rgba(10,14,22,.66);box-shadow:0 20px 60px rgba(0,0,0,.18)}.qr-search-summary strong{color:#fff}.qr-search-summary span{color:rgba(255,255,255,.68)}.qr-search-group{margin:0 0 2.4rem}.qr-search-group h2{margin:0 0 .25rem;color:#fff}.muted{color:rgba(255,255,255,.62)}
@media (max-width:700px){.qr-search-control{order:20;width:100%;justify-content:flex-end}.qr-search-control input[type=search]{width:7.5rem;max-width:52vw;padding:.65rem .78rem}.qr-search-control input[type=search]:focus{width:min(14rem,58vw)}.qr-search-clear{padding-inline:.75rem}.qr-search-summary{align-items:flex-start;flex-direction:column}.qr-search-summary .button{width:100%;justify-content:center}}
.admin-card{margin:0 0 1.4rem;padding:1.2rem;border:1px solid rgba(255,255,255,.12);border-radius:1.2rem;background:rgba(10,14,22,.66);box-shadow:0 24px 70px rgba(0,0,0,.22)}.admin-card h2{margin-top:0;color:#fff}.stats-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.75rem}.stats-grid span{display:flex;justify-content:space-between;gap:1rem;padding:.8rem 1rem;border-radius:.9rem;background:rgba(255,255,255,.06);color:rgba(255,255,255,.72)}.stats-grid strong{color:#fff}.admin-actions{display:flex;gap:.75rem;flex-wrap:wrap;margin:.75rem 0}.admin-actions input,.admin-actions select{border:1px solid rgba(255,255,255,.16);border-radius:.85rem;background:rgba(7,10,16,.52);color:#fff;padding:.72rem .9rem}.admin-table{width:100%;border-collapse:collapse}.admin-table th,.admin-table td{padding:.75rem;border-bottom:1px solid rgba(255,255,255,.1);text-align:left}.admin-table th{color:#fff}.admin-table td{color:rgba(255,255,255,.72)}@media(max-width:700px){.stats-grid{grid-template-columns:1fr}.admin-actions{flex-direction:column}.admin-actions .button,.admin-actions input,.admin-actions select{width:100%}}
