:root {
  --bg: #0b0f0e;
  --bg-elev: #121817;
  --bg-card: #161e1d;
  --border: #243029;
  --text: #e6f0ec;
  --text-muted: #8aa399;
  --accent: #34d399;
  --accent-strong: #10b981;
  --accent-soft: rgba(52, 211, 153, 0.12);
  --danger: #f87171;
  --radius: 12px;
  --maxw: 960px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
}

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

/* Header */
.site-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elev);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text);
  letter-spacing: 0.02em;
}
.brand:hover { text-decoration: none; color: var(--accent); }
.site-nav { display: flex; gap: 1.25rem; flex: 1; }
.site-nav a { color: var(--text-muted); font-size: 0.95rem; }
.site-nav a:hover { color: var(--text); text-decoration: none; }
.site-auth { display: flex; align-items: center; gap: 0.75rem; }
.user-name { color: var(--text-muted); font-size: 0.9rem; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--accent);
  color: #06231b;
}
.btn-primary:hover { background: var(--accent-strong); text-decoration: none; }
.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--accent); text-decoration: none; }

/* Main */
.site-main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}

/* Hero */
.hero {
  display: flex;
  align-items: center;
  gap: 3rem;
  flex-wrap: wrap;
  padding: 2rem 0 3rem;
}
.hero-text { flex: 1; min-width: 260px; }
.hero-text h1 { font-size: 2.6rem; margin: 0 0 0.75rem; }
.lede { font-size: 1.15rem; color: var(--text-muted); max-width: 36ch; }
.hero-actions { display: flex; gap: 0.75rem; margin-top: 1.5rem; flex-wrap: wrap; }
.hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 2.5rem;
  text-align: center;
}
.avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0 auto 0.75rem;
  border: 2px solid var(--accent);
}
.avatar-img {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 0.75rem;
  display: block;
  border: 3px solid var(--accent);
  box-shadow: 0 0 0 6px var(--accent-soft);
}
.avatar-cap { color: var(--text-muted); margin: 0; }

/* About */
.about { margin-top: 2rem; }
.about h2 { font-size: 1.5rem; }

/* Page heads */
.page-head { margin-bottom: 2rem; }
.page-head h1 { font-size: 2rem; margin: 0 0 0.25rem; }
.page-head p { color: var(--text-muted); margin: 0; }

/* Projects */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}
.project-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
}
.project-card.has-image {
  background-size: cover;
  background-position: center;
  min-height: 260px;
}
.project-card.has-image::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(11, 15, 14, 0.88) 0%, rgba(11, 15, 14, 0.55) 45%, rgba(11, 15, 14, 0.8) 100%);
}
.project-card.has-image.light-bg::before {
  background: linear-gradient(to bottom, rgba(242, 245, 243, 0.9) 0%, rgba(242, 245, 243, 0.6) 45%, rgba(242, 245, 243, 0.85) 100%);
}
.project-card-body {
  position: relative;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}
.project-card-body > .btn:last-child {
  margin-top: auto;
  align-self: flex-start;
}
.project-card h3 { margin: 0; font-size: 1.1rem; }
.project-card p { margin: 0; color: var(--text-muted); font-size: 0.95rem; }
.project-card.light-bg .project-card-body h3 { color: #0b0f0e; }
.project-card.light-bg .project-card-body p { color: #2a3330; }
.project-card.light-bg .tag { background: rgba(11, 15, 14, 0.12); color: #0b0f0e; }
.project-icon { font-size: 1.1rem; }
.project-title-link { color: inherit; text-decoration: none; }
.project-title-link:hover { color: var(--accent); text-decoration: none; }

/* --- Project detail page --- */
.project-detail {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}
.project-detail-image img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.project-detail-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: flex-start;
}
.project-detail-text {
  margin: 0;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-line;
}
.project-admin {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  display: flex;
  gap: 0.35rem;
  z-index: 2;
}
.project-admin-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(11, 15, 14, 0.85);
  color: var(--accent);
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s;
}
.project-admin-btn:hover { background: var(--accent-soft); transform: scale(1.08); text-decoration: none; }
.project-admin-delete { color: var(--danger, #f87171); }
.project-admin-delete:hover { background: rgba(248, 113, 113, 0.25); }
.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tag {
  font-size: 0.75rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}
.muted { color: var(--text-muted); font-size: 0.9rem; }

/* Gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}
.gallery-item {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
}
.gallery-item img { width: 100%; height: 200px; object-fit: cover; display: block; }
.gallery-item figcaption {
  padding: 0.6rem 0.85rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Forms */
.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  max-width: 480px;
}
.auth-wrap { display: flex; justify-content: center; }
.field { margin-bottom: 1rem; display: flex; flex-direction: column; gap: 0.3rem; }
.field label { font-size: 0.85rem; color: var(--text-muted); }
.field input, .field textarea {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 0.55rem 0.7rem;
  font-size: 0.95rem;
  font-family: inherit;
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field-error { color: var(--danger); font-size: 0.8rem; }
.field-inline { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem; font-size: 0.9rem; color: var(--text-muted); }
.auth-alt { margin-top: 1rem; color: var(--text-muted); font-size: 0.9rem; }
.resend-form { margin-top: 1.25rem; }

/* Flash */
.flash-container { margin-bottom: 1.5rem; display: flex; flex-direction: column; gap: 0.5rem; }
.flash {
  padding: 0.7rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-size: 0.92rem;
}
.flash-success { border-color: var(--accent); color: var(--accent); }
.flash-error { border-color: var(--danger); color: var(--danger); }
.flash-info { color: var(--text-muted); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  text-align: center;
  padding: 1.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 600px) {
  .site-header { flex-wrap: wrap; gap: 0.75rem; }
  .site-nav { order: 3; width: 100%; justify-content: space-between; }
  .hero-text h1 { font-size: 2rem; }
}

/* --- Role badges --- */
.role-badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}
.role-user { background: var(--bg-elev); color: var(--text-muted); }
.role-admin { background: rgba(52, 211, 153, 0.15); color: var(--accent); }
.role-superadmin { background: rgba(168, 85, 247, 0.15); color: #c084fc; }
.nav-admin { color: var(--accent) !important; font-weight: 600; }

/* --- Status badges --- */
.status-badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  text-transform: uppercase;
  font-weight: 600;
}
.status-pending { background: rgba(250, 204, 21, 0.15); color: #facc15; }
.status-published, .status-approved { background: var(--accent-soft); color: var(--accent); }
.status-rejected { background: rgba(248, 113, 113, 0.15); color: var(--danger); }

/* --- Blog --- */
.blog-list { display: flex; flex-direction: column; gap: 1.25rem; }
.blog-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.blog-card h2 { margin: 0 0 0.25rem; font-size: 1.3rem; }
.blog-card h2 a { color: var(--text); }
.blog-card h2 a:hover { color: var(--accent); }
.blog-meta { color: var(--text-muted); font-size: 0.85rem; margin: 0 0 0.75rem; }
.blog-body { line-height: 1.7; }
.blog-body h2, .blog-body h3 { color: var(--text); margin-top: 1.5rem; }
.blog-body code {
  background: var(--bg-elev);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.9em;
}
.blog-body pre {
  background: var(--bg-elev);
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
  border: 1px solid var(--border);
}
.blog-body pre code { background: none; padding: 0; }
.blog-body a { color: var(--accent); }
.blog-body ul, .blog-body ol { padding-left: 1.5rem; }
.blog-body table { border-collapse: collapse; width: 100%; margin: 1rem 0; }
.blog-body th, .blog-body td { border: 1px solid var(--border); padding: 0.5rem; }
.blog-body th { background: var(--bg-elev); }
.blog-actions { display: flex; gap: 0.75rem; align-items: center; margin-top: 1.5rem; flex-wrap: wrap; }
.inline-form { display: inline; }
.form-wide { max-width: 720px; }

/* --- Moderation --- */
.moderation-actions { display: flex; gap: 0.5rem; margin-top: 0.75rem; flex-wrap: wrap; }

/* --- Picture detail --- */
.picture-detail { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
@media (min-width: 900px) { .picture-detail { grid-template-columns: 1fr 1fr; align-items: start; } }
.picture-left { display: flex; flex-direction: column; gap: 1rem; }
.picture-right { display: flex; flex-direction: column; gap: 1rem; }
.picture-image-wrap {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.picture-image-wrap img { width: 100%; display: block; }
.picture-below h1 { font-size: 1.5rem; margin: 0 0 0.5rem; }

/* --- Delete X button --- */
.picture-delete-x {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(248, 113, 113, 0.9);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  transition: background 0.15s, transform 0.1s;
}
.picture-delete-x:hover { background: rgba(248, 113, 113, 1); transform: scale(1.1); }
.hidden-form { display: none; }

/* --- Edit pencil button --- */
.picture-edit-x {
  position: absolute;
  top: 0.5rem;
  right: 3rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(52, 211, 153, 0.9);
  color: #0b0f0e;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s;
}
.picture-edit-x:hover { background: rgba(52, 211, 153, 1); transform: scale(1.1); text-decoration: none; }

/* --- Delete confirmation popup --- */
.delete-popup {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.delete-popup.show { display: flex; }
.delete-popup-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
  text-align: center;
  max-width: 320px;
}
.delete-popup-card p { margin: 0 0 1rem; font-size: 1.1rem; }
.delete-popup-actions { display: flex; gap: 0.75rem; justify-content: center; }

/* --- Picture overlay (reactions + rating at bottom of image) --- */
.picture-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(to top, rgba(11, 15, 14, 0.95) 0%, rgba(11, 15, 14, 0.8) 70%, transparent 100%);
  flex-wrap: wrap;
}
.overlay-reactions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.overlay-rating {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.overlay-avg {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  white-space: nowrap;
}
.overlay-avg .muted { font-size: 0.75rem; }
.overlay-no-rating { font-size: 0.8rem; }
.overlay-rate-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.overlay-rate-form .star-rating { gap: 0.15rem; margin: 0; }
.overlay-rate-form .star-btn { font-size: 1.1rem; padding: 0; }
.overlay-rate-form .star-submit-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--accent);
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  cursor: pointer;
  font-size: 0.85rem;
  margin-left: 0.25rem;
}
.overlay-rate-form .star-submit-btn:hover { background: var(--accent-soft); }

/* --- Unified star bar (avg + rate in one) --- */
.unified-stars {
  display: inline-flex;
  gap: 0.15rem;
}
.unified-stars .ustar {
  font-size: 1.2rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  filter: grayscale(100%) opacity(35%);
  transition: filter 0.15s, transform 0.1s;
}
.unified-stars .ustar.filled {
  filter: grayscale(0%) opacity(100%);
}
.unified-stars .ustar.hover {
  filter: grayscale(0%) opacity(100%);
  transform: scale(1.15);
}
.unified-stars .ustar:hover {
  transform: scale(1.15);
}
.unified-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.unified-stars-readonly .ustar {
  cursor: default;
}
.unified-stars-readonly .ustar:hover {
  transform: none;
}
.unified-stars-readonly .unified-label {
  margin-left: 0.4rem;
}
.reaction-static {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  font-size: 1rem;
}
.reaction-static .rcount { font-size: 0.8rem; color: var(--text-muted); }

/* --- Reactions --- */
.reactions { margin-top: 1.5rem; }
.reactions h3, .rating-section h3, .comments-section h3 { font-size: 1.1rem; margin: 0 0 0.5rem; }
.reaction-buttons { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.reaction-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.15s;
}
.reaction-emoji { font-size: 1.3rem; line-height: 1; }
.reaction-count { font-size: 0.9rem; font-weight: 600; }
.reaction-btn:hover { border-color: var(--accent); color: var(--text); transform: scale(1.05); }
.reaction-btn.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

/* --- Star rating --- */
.rating-section { margin-top: 1.5rem; }
.rating-form { margin-top: 0.5rem; }
.rating-display { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; }
.stars-display { font-size: 1.2rem; letter-spacing: 2px; }
.rate-label { font-size: 0.85rem; color: var(--text-muted); margin: 0 0 0.25rem; }
.star-rating { display: flex; gap: 0.25rem; margin-bottom: 0.75rem; }
.star-btn {
  font-size: 1.6rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  filter: grayscale(100%) opacity(40%);
  transition: filter 0.15s, transform 0.1s;
}
.star-btn:hover { filter: grayscale(0%) opacity(100%); transform: scale(1.15); }
.star-btn.selected { filter: grayscale(0%) opacity(100%); }
.star-btn.dimmed { filter: grayscale(100%) opacity(40%); }

/* --- Comments --- */
.comments-section { margin-top: 1.5rem; }
.comment-list { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1rem; }
.comment {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem 1rem;
}
.comment strong { color: var(--text); }
.comment .muted { font-size: 0.8rem; margin-left: 0.5rem; }
.comment p { margin: 0.4rem 0 0; }
.comment-header { display: flex; align-items: center; gap: 0.25rem; }
.comment-reactions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.5rem;
}
.comment-form { margin-top: 1rem; }

/* --- Admin --- */
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}
.admin-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: border-color 0.15s;
}
.admin-card:hover { border-color: var(--accent); text-decoration: none; }
.admin-card h3 { margin: 0; font-size: 1rem; }
.admin-count { font-size: 2rem; font-weight: 700; color: var(--accent); }

/* --- User table --- */
.user-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}
.user-table th, .user-table td {
  text-align: left;
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.user-table th { color: var(--text-muted); font-weight: 600; }

/* --- Messages --- */
.message-list { display: flex; flex-direction: column; gap: 0.75rem; }
.message-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
}
.message-card.unread { border-color: var(--accent); }
.message-header { display: flex; gap: 0.5rem; align-items: center; margin-bottom: 0.5rem; flex-wrap: wrap; }
.message-card p { margin: 0.5rem 0; }

/* --- Gallery (updated for real uploads) --- */
.gallery-item figcaption { display: flex; flex-direction: column; gap: 0.15rem; }
.gallery-item figcaption .muted { font-size: 0.8rem; }

/* --- Category cards --- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}
.category-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, transform 0.1s;
}
.category-card:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-2px); }
.category-preview {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}
.category-info { padding: 1rem; }
.category-info h3 { margin: 0 0 0.25rem; font-size: 1.1rem; }
.category-info .muted { font-size: 0.85rem; }
.category-card-wrap { position: relative; }
.category-card-wrap .category-card { display: block; height: 100%; }
.category-thumb-edit {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(52, 211, 153, 0.9);
  color: #0b0f0e;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  z-index: 3;
  transition: background 0.15s, transform 0.1s;
}
.category-thumb-edit:hover { background: rgba(52, 211, 153, 1); transform: scale(1.1); text-decoration: none; }
.category-pin-form {
  position: absolute;
  top: 0.5rem;
  right: 3rem;
  z-index: 3;
  margin: 0;
}
.category-pin-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(11, 15, 14, 0.75);
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.1s, color 0.15s;
}
.category-pin-btn:hover { transform: scale(1.1); color: var(--text); }
.category-pin-btn.active { background: rgba(52, 211, 153, 0.9); color: #0b0f0e; }
.category-pinned-badge {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  font-size: 1rem;
  z-index: 3;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.8));
}

/* --- Category thumbnail picker --- */
.thumb-form .btn { margin-top: 1rem; }
.thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}
.thumb-option {
  position: relative;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  cursor: pointer;
  transition: border-color 0.15s;
}
.thumb-option:hover { border-color: var(--accent); }
.thumb-option:has(input:checked) { border-color: var(--accent); }
.thumb-option input[type="radio"] { position: absolute; top: 0.6rem; left: 0.6rem; accent-color: var(--accent); }
.thumb-option img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: 6px;
}
.thumb-random {
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  background: var(--bg-elev);
  border-radius: 6px;
}
.thumb-name { font-size: 0.9rem; font-weight: 600; }
.thumb-option .muted { font-size: 0.75rem; }

/* --- Fullscreen button (top-left of picture) --- */
.picture-fullscreen-x {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(11, 15, 14, 0.75);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  transition: background 0.15s, transform 0.1s, color 0.15s;
}
.picture-fullscreen-x:hover { background: rgba(11, 15, 14, 0.95); color: var(--accent); transform: scale(1.1); }

/* --- Carousel (fullscreen overlay viewer) --- */
.carousel {
  position: fixed;
  inset: 0;
  z-index: 60;
  margin: 0;
  background: #000;
  border: none;
  border-radius: 0;
  overflow: hidden;
}
.carousel-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7) 0%, transparent 100%);
  z-index: 5;
}
.carousel-catname { font-size: 1rem; font-weight: 600; }
.carousel-catname .muted { font-weight: 400; font-size: 0.85rem; }
.carousel-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(11, 15, 14, 0.75);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s, color 0.15s;
}
.carousel-close:hover { background: rgba(248, 113, 113, 0.9); color: #fff; transform: scale(1.1); text-decoration: none; }
.topbar-actions { display: flex; align-items: center; gap: 0.5rem; }
.carousel-grid-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(11, 15, 14, 0.75);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, color 0.15s;
}
.carousel-grid-btn:hover { color: var(--accent); transform: scale(1.1); }

/* --- Thumbnail grid overlay (paginated) --- */
.grid-overlay {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 7, 0.97);
  transform: translateY(100%);
  transition: transform 0.35s ease;
  z-index: 8;
  display: flex;
  flex-direction: column;
}
.grid-overlay.open { transform: translateY(0); }
.grid-overlay-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}
.grid-overlay-title { font-size: 1.05rem; font-weight: 600; }
.thumb-view-grid {
  flex: 1;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
  padding: 1rem;
  align-content: start;
}
.thumb-cell {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-card);
  cursor: pointer;
  padding: 0;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s, transform 0.1s;
}
.thumb-cell:hover { border-color: var(--accent); transform: translateY(-2px); }
.thumb-cell img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  display: block;
}
.thumb-cell-name {
  font-size: 0.75rem;
  padding: 0.3rem 0.4rem;
  text-align: left;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.grid-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.75rem;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
}
.grid-page-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--accent);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s, background 0.15s;
}
.grid-page-btn:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
.grid-page-btn:disabled { opacity: 0.35; cursor: default; }
.carousel-inner {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0;
  gap: 0;
}
.carousel-viewport {
  flex: 1;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.carousel-track {
  display: flex;
  height: 100%;
  transition: transform 0.4s ease;
}
.carousel-slide {
  min-width: 100%;
  height: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
  position: relative;
}
.carousel-slide .picture-image-wrap {
  width: 100%;
  max-width: none;
  height: 100%;
  margin: 0;
  border: none;
  border-radius: 0;
}
.carousel-slide .picture-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}
.carousel-slide .picture-fullscreen-x { top: 4rem; }
.overlay-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  text-align: center;
  min-width: 0;
}
.overlay-title strong { font-size: 1rem; }
.overlay-title .muted { font-size: 0.8rem; }

/* --- Details chevron (above the picture title) --- */
.details-open {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.4rem;
  transition: transform 0.15s;
}
.details-open:hover { transform: translateY(-2px); }

/* --- Slide-up details overlay --- */
.slide-details {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 7, 0.97);
  transform: translateY(100%);
  transition: transform 0.35s ease;
  z-index: 6;
  display: flex;
  flex-direction: column;
}
.slide-details.open { transform: translateY(0); }
.slide-details-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}
.slide-details-name {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.slide-details-name strong { font-size: 1.05rem; }
.slide-details-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.detail-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
}
.detail-icon:hover { border-color: var(--accent); color: var(--accent); transform: scale(1.1); text-decoration: none; }
.detail-delete:hover { background: rgba(248, 113, 113, 0.9); border-color: transparent; color: #fff; }
.details-close:hover { border-color: var(--accent); color: var(--accent); }
.slide-details-body {
  flex: 1;
  overflow-y: auto;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 1rem;
  box-sizing: border-box;
}
.slide-details-body h4 { margin: 0 0 0.75rem; font-size: 1rem; }
.slide-desc { white-space: pre-line; margin: 0 0 1.25rem; color: var(--text); }
.slide-details-body .comment-form textarea {
  width: 100%;
  box-sizing: border-box;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0.6rem;
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
}
.slide-details-body .comment-form textarea:focus { outline: none; border-color: var(--accent); }
.slide-details-body .comment-form .btn { margin-top: 0.5rem; }
.slide-details-body .field label { display: block; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.3rem; }
.reaction-btn-sm {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.15s;
}
.reaction-btn-sm:hover { border-color: var(--accent); transform: scale(1.05); }
.reaction-btn-sm.active { background: var(--accent-soft); border-color: var(--accent); }
.reaction-btn-sm .rcount { font-size: 0.8rem; color: var(--text-muted); }
.reaction-btn-sm.active .rcount { color: var(--accent); }

/* Heart emoji is always red */
.heart-emoji { color: #ef4444; }
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(11, 15, 14, 0.6);
  color: var(--accent);
  font-size: 1.5rem;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  transition: background 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.carousel-prev { left: 0.75rem; }
.carousel-next { right: 0.75rem; }
.carousel-btn:hover { background: var(--accent-soft); border-color: var(--accent); }
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
}
.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
  cursor: pointer;
  transition: background 0.15s;
}
.carousel-dot.active { background: var(--accent); }
.carousel-dot:hover { background: var(--text-muted); }
@media (max-width: 640px) {
  .overlay-title .ot-text { display: none; }
  .carousel-btn { width: 40px; height: 40px; font-size: 1.2rem; }
  .carousel-catname .muted { display: none; }
}

