/* ─── Reset & Base ──────────────────────────────────────────────────────── */

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

:root {
  --bg:           #000000;
  --bg1:          #0a0a0a;
  --bg2:          #111111;
  --bg3:          #181818;
  --bg4:          #202020;
  --border:       rgba(255, 255, 255, 0.07);
  --border-hi:    rgba(240, 165, 0, 0.35);
  --text:         #f0f0f0;
  --text-2:       #999999;
  --text-3:       #555555;
  --accent:       #f0a500;
  --accent-hi:    #ffc233;
  --accent-lo:    #c47f00;
  --accent-dim:   rgba(240, 165, 0, 0.12);
  --accent-glow:  rgba(240, 165, 0, 0.2);
  --red:          #e05555;
  --red-dim:      rgba(224, 85, 85, 0.12);
  --radius:       10px;
  --radius-sm:    6px;
  --radius-pill:  999px;
  --ease:         cubic-bezier(0.22, 1, 0.36, 1);
  --nav-h:        58px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

.hidden { display: none !important; }

/* ─── Shared Nav ────────────────────────────────────────────────────────── */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 200;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  padding: 0 32px;
  gap: 24px;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
}

.nav-logo {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  white-space: nowrap;
}

.nav-logo span { color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
}

.nav-links a {
  color: var(--text-2);
  font-size: 13px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  transition: color 0.15s, background 0.15s;
}

.nav-links a:hover { color: var(--text); background: var(--bg2); }
.nav-links a.active { color: var(--text); }

.nav-spacer { flex: 1; }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ─── Shared Button Styles ──────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 20px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg2);
  color: var(--text-2);
  transition: all 0.18s var(--ease);
  white-space: nowrap;
  cursor: pointer;
}

.btn:hover { color: var(--text); background: var(--bg3); border-color: rgba(255,255,255,0.12); }
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--accent);
  border-color: transparent;
  color: #000;
  font-weight: 600;
}

.btn-primary:hover {
  background: var(--accent-hi);
  color: #000;
  box-shadow: 0 0 20px var(--accent-glow);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-2);
}

.btn-ghost:hover { color: var(--text); background: var(--bg2); border-color: var(--border); }

.btn-sm { padding: 5px 14px; font-size: 12px; }
.btn-lg { padding: 12px 28px; font-size: 15px; font-weight: 600; }

/* ─── Shared Input ──────────────────────────────────────────────────────── */

.input {
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  width: 100%;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}

.input:focus {
  border-color: var(--border-hi);
  background: var(--bg1);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

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

/* ─── Shared Card ───────────────────────────────────────────────────────── */

.card {
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

/* ─── Shared Footer ─────────────────────────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--bg);
}

.footer-logo {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.footer-logo span { color: var(--accent); }

.footer-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-3);
  font-size: 12px;
  transition: color 0.15s;
}

.footer-links a:hover { color: var(--text-2); }

.footer-copy {
  color: var(--text-3);
  font-size: 12px;
  width: 100%;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

/* ─── Auth Modal ────────────────────────────────────────────────────────── */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fade-in 0.18s ease;
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal {
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 400px;
  padding: 32px;
  position: relative;
  animation: modal-up 0.22s var(--ease);
  box-shadow: 0 40px 120px rgba(0,0,0,0.8);
}

@keyframes modal-up {
  from { transform: translateY(20px) scale(0.97); opacity: 0; }
  to   { transform: translateY(0) scale(1);       opacity: 1; }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 18px;
  line-height: 1;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: color 0.15s, background 0.15s;
}

.modal-close:hover { color: var(--text); background: var(--bg3); }

.modal-logo {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.modal-logo span { color: var(--accent); }

.modal-tagline {
  color: var(--text-2);
  font-size: 13px;
  margin-bottom: 24px;
}

.auth-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.auth-tab {
  flex: 1;
  text-align: center;
  padding: 9px 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-3);
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}

.auth-tab.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.auth-tab:hover:not(.active) { color: var(--text-2); }

.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form.hidden { display: none; }

.form-group { display: flex; flex-direction: column; gap: 5px; }

.form-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  letter-spacing: 0.02em;
}

.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.form-footer a {
  color: var(--text-3);
  font-size: 12px;
  transition: color 0.15s;
}

.form-footer a:hover { color: var(--accent); }

.auth-divider {
  text-align: center;
  color: var(--text-3);
  font-size: 12px;
  margin: 4px 0;
  position: relative;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: calc(50% - 28px);
  height: 1px;
  background: var(--border);
}

.auth-divider::before { left: 0; }
.auth-divider::after  { right: 0; }

.form-error {
  font-size: 12px;
  color: var(--red);
  padding: 8px 12px;
  background: var(--red-dim);
  border: 1px solid rgba(224,85,85,0.2);
  border-radius: var(--radius-sm);
  display: none;
}

.form-error.visible { display: block; }

/* ─── Landing Page ──────────────────────────────────────────────────────── */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 96px 32px 80px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 300px;
  background: radial-gradient(ellipse, rgba(240,165,0,0.07) 0%, transparent 70%);
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-pill);
  font-size: 12px;
  color: var(--accent);
  background: var(--accent-dim);
  margin-bottom: 28px;
  letter-spacing: 0.03em;
}

.hero-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
}

.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 20px;
  max-width: 720px;
}

.hero h1 em {
  font-style: normal;
  color: var(--accent);
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--text-2);
  max-width: 480px;
  margin-bottom: 36px;
  line-height: 1.65;
}

.hero-cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.hero-stats {
  display: flex;
  gap: 0;
  margin-top: 64px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg1);
  overflow: hidden;
}

.stat-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 28px;
  border-right: 1px solid var(--border);
  min-width: 120px;
}

.stat-item:last-child { border-right: none; }

.stat-num {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}

.stat-label {
  font-size: 11px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 2px;
}

/* Features */

.features {
  padding: 64px 32px;
  border-top: 1px solid var(--border);
}

.features-head {
  text-align: center;
  margin-bottom: 48px;
}

.section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 10px;
}

.section-title {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 10px;
}

.section-sub {
  color: var(--text-2);
  font-size: 15px;
  max-width: 460px;
  margin: 0 auto;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  max-width: 960px;
  margin: 0 auto;
}

.feature-card {
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: border-color 0.2s, transform 0.2s;
}

.feature-card:hover {
  border-color: rgba(255,255,255,0.12);
  transform: translateY(-2px);
}

.feature-icon {
  font-size: 1.5rem;
  margin-bottom: 14px;
  display: block;
}

.feature-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
}

.feature-desc {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.6;
}

/* CTA Banner */

.cta-banner {
  margin: 0 32px 64px;
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 48px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  position: relative;
  overflow: hidden;
}

.cta-banner::before {
  content: '';
  position: absolute;
  right: -60px;
  top: 50%;
  transform: translateY(-50%);
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(240,165,0,0.04) 0%, transparent 70%);
  pointer-events: none;
}

.cta-banner h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.cta-banner p {
  font-size: 14px;
  color: var(--text-2);
}

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

/* ─── Static Pages (Privacy / Terms) ───────────────────────────────────── */

.static-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 56px 32px 80px;
}

.static-page h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}

.static-page .page-date {
  color: var(--text-3);
  font-size: 13px;
  margin-bottom: 40px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}

.static-page h2 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 32px 0 10px;
  color: var(--text);
}

.static-page p {
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.75;
  margin-bottom: 14px;
}

.static-page ul, .static-page ol {
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.75;
  margin-bottom: 14px;
  padding-left: 22px;
}

.static-page li { margin-bottom: 6px; }

.static-page a { color: var(--accent); }
.static-page a:hover { text-decoration: underline; }

.static-page .contact-box {
  margin-top: 32px;
  padding: 20px 24px;
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text-2);
}

/* ─── Gallery Page ──────────────────────────────────────────────────────── */

.gallery-page body { display: flex; flex-direction: column; min-height: 100vh; }

#filter-bar {
  position: sticky;
  top: var(--nav-h);
  z-index: 100;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 4px;
  padding: 0 16px;
  height: 46px;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}

#filter-bar::-webkit-scrollbar { display: none; }

.filter-group {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  padding: 0;
}

#cat-dropdown-wrap {
  position: relative;
}

.cat-dropdown-btn {
  min-width: 130px;
  text-align: left;
}

.filter-select-active {
  border-color: var(--accent) !important;
  color: var(--accent) !important;
}

.cat-dropdown {
  position: fixed;
  z-index: 500;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  min-width: 170px;
  max-height: 320px;
  overflow-y: auto;
  padding: 6px 0;
  scrollbar-width: thin;
}

.cat-check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  transition: background 0.1s;
}

.cat-check-row:hover { background: var(--bg3); color: var(--text); }

.cat-check-row input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

.filter-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
  flex-shrink: 0;
  margin: 0 2px;
}

.filter-label {
  color: var(--text-3);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  white-space: nowrap;
  margin-right: 2px;
}

.filter-buttons { display: flex; flex-wrap: wrap; gap: 4px; }

.filter-btn {
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text-3);
  padding: 3px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  transition: all 0.15s;
  white-space: nowrap;
}

.filter-btn:hover { color: var(--text); border-color: rgba(255,255,255,0.15); background: var(--bg3); }

.filter-btn.active {
  background: var(--accent);
  border-color: transparent;
  color: #000;
  font-weight: 600;
}

.filter-select,
#tag-filter,
#search-input {
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
  white-space: nowrap;
}

.filter-select,
#tag-filter {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23666'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 24px;
}

.filter-select:hover,
#tag-filter:hover { border-color: rgba(255,255,255,0.15); background-color: var(--bg3); }

#search-input { width: 180px; }
#search-input::placeholder { color: var(--text-3); }

#tag-filter:focus,
#search-input:focus {
  border-color: var(--border-hi);
  background: var(--bg1);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.filter-spacer { flex: 1; }

#clear-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-3);
  padding: 3px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-size: 11px;
  font-family: inherit;
  transition: all 0.15s;
}

#clear-btn:hover { border-color: rgba(224,85,85,0.35); color: var(--red); background: var(--red-dim); }

/* Gallery stats in nav */
#gallery-count {
  font-size: 12px;
  color: var(--text-3);
  margin-left: 4px;
}

/* Update bar */
#update-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 20px;
  background: rgba(10, 26, 10, 0.97);
  border-bottom: 1px solid rgba(80,200,80,0.1);
  color: #5db85d;
  font-size: 12px;
  animation: slide-down 0.3s var(--ease);
}

@keyframes slide-down {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

#update-bar span { flex: 1; }

#update-bar button {
  background: none;
  border: 1px solid rgba(80,180,80,0.25);
  color: #5db85d;
  padding: 3px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-size: 11px;
  font-family: inherit;
  transition: all 0.15s;
}

#update-bar button:hover { background: rgba(80,180,80,0.1); border-color: rgba(80,180,80,0.45); }

/* Gallery grid */
main { flex: 1; padding: 12px; }

#gallery {
  columns: 6 160px;
  column-gap: 10px;
}

@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position: 600px 0; }
}

.gallery-item {
  break-inside: avoid;
  margin-bottom: 10px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  background: linear-gradient(90deg, var(--bg2) 25%, var(--bg3) 50%, var(--bg2) 75%);
  background-size: 600px 100%;
  animation: shimmer 1.6s infinite linear;
  display: block;
  transition: transform 0.25s var(--ease), box-shadow 0.25s ease;
  will-change: transform;
}

.gallery-item:has(img.loaded) { background: var(--bg2); animation: none; }

.gallery-item:hover {
  transform: translateY(-6px) scale(1.022);
  box-shadow: 0 24px 60px rgba(0,0,0,0.85), 0 0 0 2px rgba(240,165,0,0.55);
  z-index: 2;
}

.gallery-item img {
  display: block;
  width: 100%;
  height: auto;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-item img.loaded { opacity: 1; }

.item-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.82) 0%, rgba(0,0,0,0.18) 40%, transparent 68%);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.gallery-item:hover .item-overlay { opacity: 1; }

.item-label {
  position: absolute;
  bottom: 8px;
  left: 8px;
  right: 8px;
  font-size: 10px;
  color: rgba(255,255,255,0.9);
  text-shadow: 0 1px 6px rgba(0,0,0,0.9);
  line-height: 1.4;
  word-break: break-word;
  pointer-events: none;
}

/* Status */
.status-msg {
  text-align: center;
  padding: 48px;
  color: var(--text-3);
  font-size: 13px;
  letter-spacing: 0.04em;
}

#sentinel { height: 1px; }

/* Lightbox */
#lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fade-in 0.18s ease;
}

#lb-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* Outer wrapper: sidebar on left, image on right */
#lb-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 12px;
  max-width: 96vw;
  max-height: 92vh;
  animation: modal-up 0.22s var(--ease);
}

/* Left sidebar */
#lb-sidebar {
  width: 300px;
  flex-shrink: 0;
  display: none;
  flex-direction: column;
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

#lb-content.lb-sidebar-open #lb-sidebar { display: flex; }

#lb-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

#lb-sidebar-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}

#lb-sidebar-close {
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 13px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  transition: color .15s, background .15s;
}

#lb-sidebar-close:hover { color: var(--red); background: var(--red-dim); }

/* Right: image column */
#lb-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

#lb-close {
  align-self: flex-end;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text-3);
  font-size: 14px;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

#lb-close:hover { color: var(--red); border-color: rgba(224,85,85,0.3); background: var(--red-dim); }

#lb-img-wrap {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#lb-img {
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 32px 100px rgba(0,0,0,0.95), 0 0 0 1px var(--border);
}

#lb-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 14px;
  flex-shrink: 0;
}

#lb-info {
  color: var(--text-3);
  font-size: 11px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#lb-uploader {
  font-size: 12px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 3px 10px;
  flex-shrink: 0;
}
#lb-uploader::before {
  content: '↑ ';
  opacity: 0.5;
}
#lb-uploader a { color: var(--accent); text-decoration: none; font-weight: 500; }
#lb-uploader a:hover { text-decoration: underline; }

#lb-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

#lb-counter {
  color: var(--text-3);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  min-width: 64px;
  text-align: center;
  letter-spacing: 0.04em;
}

#lb-actions button,
#lb-download {
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-size: 12px;
  text-decoration: none;
  transition: all 0.15s;
  font-family: inherit;
  white-space: nowrap;
}

#lb-actions button:hover { border-color: rgba(255,255,255,0.15); background: var(--bg3); }

#lb-comments-toggle.active { color: var(--accent); border-color: rgba(240,165,0,.35); }

#lb-download {
  background: var(--accent);
  border-color: transparent;
  color: #000;
  font-weight: 700;
}

#lb-download:hover {
  background: var(--accent-hi);
  box-shadow: 0 4px 16px var(--accent-glow);
}

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

@media (max-width: 768px) {
  .site-nav { padding: 0 18px; gap: 12px; }
  .nav-links { display: none; }
  .hero { padding: 60px 20px 48px; }
  .hero h1 { font-size: 2rem; }
  .hero-stats { flex-wrap: wrap; }
  .stat-item { min-width: calc(50% - 1px); }
  .features { padding: 48px 20px; }
  .cta-banner { margin: 0 20px 48px; padding: 32px 24px; }
  .static-page { padding: 40px 20px 60px; }
  #filter-bar { padding: 0 12px; }
  #gallery { columns: 2 140px; }
  #lb-bar { padding: 7px 10px; }
  #lb-info { display: none; }
  .site-footer { padding: 20px 18px; flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  #gallery { columns: 2 120px; column-gap: 6px; }
  .gallery-item { margin-bottom: 6px; }
  #search-input { width: 130px; }
  .hero-stats { flex-direction: column; }
  .stat-item { border-right: none; border-bottom: 1px solid var(--border); width: 100%; }
  .stat-item:last-child { border-bottom: none; }
}


/* ─── Favorites button ─────────────────────────────────────────── */

.fav-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(0,0,0,.65);
  color: rgba(255,255,255,0.65);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .15s, color .15s, background .15s, border-color .15s, transform .15s;
  backdrop-filter: blur(6px);
}

.gallery-item:hover .fav-btn { opacity: 1; }
.fav-btn.active { color: #ff4466; border-color: rgba(255,68,102,0.4); opacity: 1; }
.fav-btn:hover { background: rgba(0,0,0,.85); color: #ff4466; border-color: rgba(255,68,102,0.5); transform: scale(1.1); }

/* ─── Nav user label ───────────────────────────────────────────── */

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

/* ─── Admin panel ──────────────────────────────────────────────── */

.admin-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.admin-header {
  margin-bottom: 36px;
}

.admin-header h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-1);
  margin: 0 0 6px;
}

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

.admin-stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px 20px;
  text-align: center;
}

.admin-stat-num {
  font-size: 32px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 6px;
}

.admin-stat-label {
  font-size: 12px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .06em;
}

.admin-section {
  margin-bottom: 40px;
}

.admin-section h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-1);
  margin: 0 0 16px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
}

.admin-table th {
  color: var(--text-3);
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  background: var(--bg1);
}

.admin-table tr:hover td { background: var(--bg1); }

.role-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.role-admin { background: rgba(240,165,0,.15); color: var(--accent); }
.role-user  { background: rgba(255,255,255,.06); color: var(--text-3); }

.btn-danger {
  background: rgba(220,50,50,.15);
  color: #f87;
  border: 1px solid rgba(220,50,50,.3);
}

.btn-danger:hover {
  background: rgba(220,50,50,.3);
  color: #faa;
}

.form-success {
  color: #4caf82;
  font-size: 13px;
  margin-bottom: 12px;
}

.change-pw-form {
  max-width: 400px;
}

/* ─── Category badge on gallery card ─────────────────────────────── */

.item-cat-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.68);
  color: var(--cat-color);
  border: 1px solid color-mix(in srgb, var(--cat-color) 45%, transparent);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  backdrop-filter: blur(6px);
  line-height: 1.5;
  text-shadow: 0 1px 3px rgba(0,0,0,0.7);
  max-width: calc(100% - 88px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery-item:hover .item-cat-badge { opacity: 1; }

/* ─── Nav avatar + user button ───────────────────────────────────── */

.nav-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  vertical-align: middle;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s;
}

.nav-avatar:hover { border-color: var(--accent); }

.nav-avatar-init {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, color 0.15s;
}

.nav-avatar-init:hover { border-color: var(--accent); color: var(--accent); }

.nav-user-btn {
  color: var(--text-2);
  background: transparent;
  border: none;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  padding: 4px 8px;
  border-radius: var(--radius-pill);
  transition: color 0.15s, background 0.15s;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-user-btn:hover {
  color: var(--text);
  background: var(--bg2);
}

/* ─── Account modal ──────────────────────────────────────────────── */

.account-modal-box {
  max-width: 480px;
  padding: 0;
  overflow: hidden;
}

.account-modal-header {
  padding: 28px 28px 20px;
  display: flex;
  gap: 16px;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.account-avatar-wrap {
  position: relative;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  cursor: pointer;
  border-radius: 50%;
}

.account-avatar-lg {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  transition: border-color 0.18s;
  display: block;
  background: var(--bg3);
}

.account-avatar-init-lg {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--bg3);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-2);
  transition: border-color 0.18s;
}

.account-avatar-overlay {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  opacity: 0;
  transition: opacity 0.15s;
}

.account-avatar-wrap:hover .account-avatar-overlay { opacity: 1; }
.account-avatar-wrap:hover .account-avatar-lg,
.account-avatar-wrap:hover .account-avatar-init-lg { border-color: var(--accent); }

.account-change-photo-btn {
  margin-top: 8px;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-3);
  font-size: 11px;
  font-family: inherit;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.account-change-photo-btn:hover { color: var(--accent); border-color: var(--accent); }

.account-name-lg {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.account-email-sm {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 2px;
}

.account-meta {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 4px;
}

.account-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
}

.account-tab {
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-3);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  font-family: inherit;
}

.account-tab:hover:not(.active) { color: var(--text-2); }

.account-tab.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.account-panels { padding: 24px 28px; }

.account-panel { display: none; }
.account-panel.active { display: block; }

.account-panel .form-group { margin-bottom: 14px; }

.account-stat-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.account-stat {
  flex: 1;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  text-align: center;
}

.account-stat-num {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
}

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

.account-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.account-feedback {
  font-size: 12px;
  margin-top: 6px;
  min-height: 18px;
}

.account-feedback.ok { color: #4caf82; }
.account-feedback.err { color: var(--red); }

/* ─── Report modal ─────────────────────────────────────────────────── */

.report-reason-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
  transition: background 0.12s;
}

.report-reason-opt:hover { background: var(--bg3); }

.report-reason-opt input[type=radio] {
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
}

/* ─── Like button on gallery cards ──────────────────────────────────── */

.like-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(0,0,0,.65);
  color: rgba(255,255,255,0.65);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .15s, color .15s, background .15s, border-color .15s, transform .15s;
  backdrop-filter: blur(6px);
}

.gallery-item:hover .like-btn { opacity: 1; }
.like-btn.active { color: var(--accent); border-color: rgba(240,165,0,0.4); opacity: 1; }
.like-btn:hover  { background: rgba(0,0,0,.85); color: var(--accent); border-color: rgba(240,165,0,0.5); transform: scale(1.1); }

.item-overlay-btns {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  flex-direction: row;
  gap: 5px;
  align-items: center;
  pointer-events: auto;
}

/* ─── Lightbox icon buttons ──────────────────────────────────────────── */

.lb-icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
}

#lb-like.active  { color: var(--accent); border-color: rgba(240,165,0,.35); }
#lb-fav.active   { color: #e8c84c; border-color: rgba(232,200,76,.35); }
#lb-comments-toggle { font-size: 14px; }

/* ─── Lightbox comments sidebar content ──────────────────────────────── */

#lb-comments-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 48px;
}

.lb-comment {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}

.lb-cmt-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.lb-cmt-author {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}

.lb-cmt-admin {
  color: #e03333;
  font-weight: 700;
}

.lb-cmt-date {
  font-size: 11px;
  color: var(--text-3);
  flex: 1;
}

.lb-cmt-del {
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 11px;
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 4px;
  transition: color .15s, background .15s;
}

.lb-cmt-del:hover { color: var(--red); background: var(--red-dim); }

.lb-cmt-body {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.lb-cmt-loading,
.lb-cmt-empty {
  font-size: 12px;
  color: var(--text-3);
  text-align: center;
  padding: 12px 0;
}

#lb-comment-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 14px;
  border-top: 1px solid var(--border);
  background: var(--bg2);
}

#lb-comment-input {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 11px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-family: inherit;
  resize: none;
  outline: none;
  transition: border-color .15s;
  line-height: 1.4;
}

#lb-comment-input:focus { border-color: var(--border-hi); }
#lb-comment-input::placeholder { color: var(--text-3); }

#lb-comment-submit {
  background: var(--accent);
  border: none;
  color: #000;
  font-weight: 700;
  font-size: 12px;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: background .15s;
}

#lb-comment-submit:hover { background: var(--accent-hi); }
#lb-comment-submit:disabled { opacity: .6; cursor: default; }

#lb-comment-login-hint {
  font-size: 12px;
  color: var(--text-3);
  padding: 6px 0;
}

/* ─── Profile page ───────────────────────────────────────────────────── */

.profile-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 24px;
  max-width: 1200px;
  margin: 36px auto;
  padding: 0 24px;
  align-items: start;
}

/* Left sidebar */
.profile-sidebar {
  position: sticky;
  top: 80px;
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.profile-avatar-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 4px;
}

.profile-avatar,
.profile-avatar-placeholder {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}

.profile-avatar-placeholder {
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  font-weight: 700;
  color: var(--accent);
}

.profile-avatar-placeholder[hidden],
.profile-avatar[hidden] { display: none; }

.profile-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.profile-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  text-align: center;
}

.profile-name-admin { color: #e03333; }

.profile-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(224,51,51,.12);
  color: #e03333;
  border: 1px solid rgba(224,51,51,.3);
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.profile-joined {
  font-size: 12px;
  color: var(--text-3);
  margin: 0;
  text-align: center;
}

.profile-bio {
  font-size: 13px;
  color: var(--text-2);
  margin: 4px 0 0;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  text-align: center;
}

.profile-website {
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
  text-align: center;
  word-break: break-all;
}

.profile-website:hover { text-decoration: underline; }

/* Stat list in sidebar */
.profile-stat-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 8px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.profile-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .15s;
}

.profile-stat-row:hover { background: var(--bg2); }

.profile-stat-row-label {
  font-size: 13px;
  color: var(--text-2);
}

.profile-stat-row-val {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

/* Right content column */
.profile-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.profile-tabs {
  display: flex;
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 0 12px;
  gap: 0;
}

.profile-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-3);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  padding: 13px 16px;
  cursor: pointer;
  transition: color .15s, border-color .15s;
  margin-bottom: -1px;
  white-space: nowrap;
}

.profile-tab:hover { color: var(--text-2); }
.profile-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.profile-panel {
  background: var(--bg0);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 20px;
  min-height: 220px;
}

/* Thumbnail grid */
.profile-thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}

.profile-thumb {
  display: block;
  aspect-ratio: 16/9;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: border-color .15s, transform .15s;
  background: var(--bg2);
}

.profile-thumb:hover { border-color: var(--accent); transform: scale(1.03); }
.profile-thumb-broken { opacity: .3; }

.profile-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Comments list */
.profile-comments-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-comment-row {
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, background .15s;
}

.profile-comment-row:hover { border-color: var(--border-hi); background: var(--bg2); }

.profile-cmt-thumb {
  width: 72px;
  height: 46px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.profile-cmt-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.profile-cmt-text {
  font-size: 13px;
  color: var(--text-2);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-cmt-date {
  font-size: 11px;
  color: var(--text-3);
}

.profile-cmt-arrow {
  font-size: 20px;
  color: var(--text-3);
  flex-shrink: 0;
}

/* Activity feed */
.profile-activity-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-activity-row {
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--bg1);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, background .15s;
}

.profile-activity-row:hover { border-color: var(--border-hi); background: var(--bg2); }

.profile-activity-icon {
  font-size: 16px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.profile-activity-favorited { color: #e8c84c; }
.profile-activity-liked     { color: var(--accent); }
.profile-activity-commented { color: var(--text-3); }

.profile-empty {
  color: var(--text-3);
  font-size: 13px;
  text-align: center;
  padding: 48px 0;
  margin: 0;
}

/* Account modal privacy toggles */
.acc-toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  padding: 6px 0;
  user-select: none;
}

.acc-toggle-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

.lb-cmt-author {
  text-decoration: none;
  transition: opacity .15s;
}

.lb-cmt-author:hover { opacity: .8; }

/* Mobile: collapse to single column */
@media (max-width: 768px) {
  .profile-layout {
    grid-template-columns: 1fr;
  }

  .profile-sidebar {
    position: static;
  }

  .profile-stat-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

/* Mobile: stack sidebar below image */
@media (max-width: 768px) {
  #lb-content {
    flex-direction: column;
    max-height: 95vh;
    overflow-y: auto;
  }

  #lb-content.lb-sidebar-open #lb-sidebar {
    width: 100%;
    max-height: 40vh;
  }

  #lb-img { max-height: 45vh; }
}

/* ─── Nav badge ──────────────────────────────────────────────────────── */

.nav-inbox-alert {
  color: #e03333 !important;
  border-color: rgba(224,51,51,.3) !important;
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e03333;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  padding: 0 4px;
  margin-left: 2px;
  vertical-align: middle;
}

/* ─── Social action buttons ──────────────────────────────────────────── */

.social-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 4px;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-2);
  padding: 7px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
  text-decoration: none;
  transition: border-color .15s, color .15s, background .15s;
}

.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-outline.active { background: var(--accent); border-color: var(--accent); color: #000; font-weight: 700; }
.btn-outline:disabled { opacity: .5; cursor: default; }
.btn-block { display: block; width: 100%; }

.btn-xs { padding: 4px 10px; font-size: 11px; border-radius: var(--radius-pill); }

/* ─── Messages page ──────────────────────────────────────────────────── */

.messages-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: calc(100vh - 56px);
  overflow: hidden;
}

.msg-sidebar {
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.msg-sidebar-head {
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.msg-sidebar-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.msg-section { flex-shrink: 0; }

.msg-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-3);
  padding: 12px 18px 6px;
}

#conversations-list {
  flex: 1;
  overflow-y: auto;
}

.msg-conv-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background .15s;
  border-bottom: 1px solid var(--border);
}

.msg-conv-item:hover { background: var(--bg1); }
.msg-conv-item.active { background: var(--bg2); }

.msg-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.msg-avatar-init {
  border-radius: 50%;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
  border: 1px solid var(--border);
}

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

.msg-conv-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.msg-unread-dot {
  background: var(--accent);
  color: #000;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.msg-conv-preview {
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.msg-conv-time { font-size: 11px; color: var(--text-3); flex-shrink: 0; }

/* Friend request items */
.msg-fr-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}

.msg-fr-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }

.msg-fr-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

.msg-fr-name:hover { color: var(--accent); }
.msg-fr-date { font-size: 11px; color: var(--text-3); }
.msg-fr-actions { display: flex; gap: 4px; flex-shrink: 0; }

/* Thread */
.msg-thread-wrap {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.msg-thread-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  font-size: 14px;
  text-align: center;
  padding: 40px;
}

.msg-thread {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.msg-thread-head {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.msg-partner-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.msg-partner-name:hover { color: var(--accent); }

.msg-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.msg-bubble-wrap {
  display: flex;
}

.msg-bubble-wrap.mine { justify-content: flex-end; }

.msg-bubble {
  max-width: 65%;
  padding: 9px 13px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  position: relative;
}

.msg-bubble-theirs {
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.msg-bubble-mine {
  background: var(--accent);
  color: #000;
  border-bottom-right-radius: 4px;
}

.msg-time {
  display: block;
  font-size: 10px;
  opacity: .6;
  margin-top: 3px;
  text-align: right;
}

.msg-input-bar {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  align-items: flex-end;
}

.msg-input {
  flex: 1;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 13px;
  border-radius: 20px;
  font-size: 13px;
  font-family: inherit;
  resize: none;
  outline: none;
  transition: border-color .15s;
  line-height: 1.4;
  max-height: 120px;
}

.msg-input:focus { border-color: var(--border-hi); }

.msg-empty {
  font-size: 13px;
  color: var(--text-3);
  padding: 20px 18px;
}

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

  .msg-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: 40vh;
  }
}

/* ─── Download count badge on cards ─────────────────────────────────── */

.item-dl-badge {
  position: absolute;
  bottom: 36px;
  left: 8px;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: var(--text-2);
  backdrop-filter: blur(4px);
  pointer-events: none;
}

.item-dl-badge::before { content: '↓ '; }

/* ─── Similar strip in lightbox ──────────────────────────────────────── */

#lb-similar-strip {
  background: var(--bg2);
  border-top: 1px solid var(--border);
  padding: 8px 12px;
  flex-shrink: 0;
}

#lb-similar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 8px;
}

#lb-similar-header button {
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  font-size: 13px;
  padding: 2px 4px;
}

#lb-similar-list {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: thin;
}

#lb-similar-list img {
  height: 72px;
  width: auto;
  border-radius: 4px;
  cursor: pointer;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid transparent;
  transition: border-color 0.15s;
}

#lb-similar-list img:hover { border-color: var(--accent); }

/* ─── Collect button active state ────────────────────────────────────── */

#lb-collect.active { color: #60a5fa; border-color: rgba(96,165,250,.35); }

/* ─── Collections popover ────────────────────────────────────────────── */

.collect-popover {
  position: fixed;
  z-index: 2000;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  width: 240px;
  max-height: 360px;
  flex-direction: column;
  display: none;
  overflow: hidden;
}

.collect-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.collect-popover-head button {
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  font-size: 13px;
  padding: 2px 4px;
}

#collect-list {
  overflow-y: auto;
  flex: 1;
  padding: 4px 0;
}

.collect-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 14px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s;
}

.collect-row:hover { background: var(--bg3); }
.collect-row.active { color: var(--accent); }
.collect-row.active::before { content: '✓ '; }

.collect-count {
  font-size: 11px;
  color: var(--text-3);
  margin-left: 8px;
}

.collect-empty, .collect-loading {
  padding: 12px 14px;
  font-size: 12px;
  color: var(--text-3);
}

.collect-new-row {
  display: flex;
  gap: 6px;
  padding: 8px 10px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.collect-new-row input {
  flex: 1;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 12px;
  font-family: inherit;
  padding: 5px 8px;
  outline: none;
}

.collect-new-row input:focus { border-color: var(--border-hi); }

.collect-new-row button {
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 10px;
  cursor: pointer;
}

/* ─── Profile collections grid ───────────────────────────────────────── */

.collections-private-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(240,165,0,.1);
  border: 1px solid rgba(240,165,0,.3);
  color: #c8991a;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
}
.collections-private-banner strong { color: inherit; }

.profile-collections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  padding: 4px 0;
}

.profile-col-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}

.profile-col-card:hover {
  border-color: var(--border-hi);
  transform: translateY(-2px);
}

.profile-col-thumbs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  aspect-ratio: 1.6;
  overflow: hidden;
}

.profile-col-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-col-blank {
  background: var(--bg3);
}

.profile-col-footer {
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.profile-col-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-col-count {
  font-size: 11px;
  color: var(--text-3);
}
