/* === Color Palette === */
:root {
  /* Force light-mode rendering of native form controls. Without this the
     browser auto-tints <select>, <input>, and <datalist> dropdowns when the
     user has OS dark mode enabled — which produced a white-on-white
     datalist option popup in Chrome/Safari that made the camera/film
     filter autocomplete unreadable. The site's palette is light-only, so
     we explicitly opt out of dark-mode form chrome everywhere. */
  color-scheme: light;
  --bg-primary: #faf6f1;
  --bg-card: #ffffff;
  --walnut: #5c4033;
  --walnut-light: #7a5c4f;
  --off-white: #faf6f1;
  --cream: #f0e8dd;
  --blue-dark: #1e2a4a;
  --blue-accent: #2c3e6b;
  --text-primary: #1e2a4a;
  --text-muted: #4a5568;
  --overlay: rgba(10, 12, 20, 0.92);
}

/* === Reset & Base === */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Discourage casual saving of uploaded photos: disable text selection,
   drag-to-save, and the iOS long-press "Save Image" callout. JS in
   site-settings.js also blocks contextmenu/dragstart on these images.
   This is not real DRM — anything visible can be screenshotted — it just
   removes the obvious right-click / long-press / drag paths. The
   attribute selector targets only photos served from /uploads/ so logos,
   icons, and other site chrome are unaffected. */
img[src*="/uploads/"] {
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-primary);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Crect width='8' height='8' fill='%23faf6f1'/%3E%3Cline x1='0' y1='0' x2='8' y2='0' stroke='%23e8dfd4' stroke-width='0.5' opacity='0.6'/%3E%3Cline x1='0' y1='2' x2='8' y2='2' stroke='%23ede5da' stroke-width='0.3' opacity='0.5'/%3E%3Cline x1='0' y1='4' x2='8' y2='4' stroke='%23e5dbd0' stroke-width='0.5' opacity='0.55'/%3E%3Cline x1='0' y1='6' x2='8' y2='6' stroke='%23ede5da' stroke-width='0.3' opacity='0.45'/%3E%3Cline x1='0' y1='0' x2='0' y2='8' stroke='%23e8dfd4' stroke-width='0.3' opacity='0.35'/%3E%3Cline x1='2' y1='0' x2='2' y2='8' stroke='%23ebe3d8' stroke-width='0.2' opacity='0.3'/%3E%3Cline x1='4' y1='0' x2='4' y2='8' stroke='%23e8dfd4' stroke-width='0.3' opacity='0.35'/%3E%3Cline x1='6' y1='0' x2='6' y2='8' stroke='%23ebe3d8' stroke-width='0.2' opacity='0.3'/%3E%3C/svg%3E");
  color: var(--text-primary);
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

/* === Shared Navigation Bar ===
   Always-compact sticky bar — no morph, no scroll-linked state, no CSS
   transitions on layout properties. This is the third rewrite of the nav,
   and the design has been intentionally simplified to eliminate a
   persistent Chrome/Edge flicker that survived every previous attempt.

   History: the first version wrote a 0..1 --nav-progress CSS custom
   property per scroll frame and used calc() to interpolate everything
   continuously. Flicker. Second version was a discrete two-state flip
   with CSS transitions on padding/gap/height/background-color. Still
   flickered, specifically when you stopped scrolling partway through
   the transition. Root cause: on desktop Blink, CSS transitions on
   layout-inducing properties (padding, gap, height) of a position:sticky
   element invalidate the compositor sticky fast-path the moment the
   transition starts. When the user then stops scrolling mid-transition,
   the compositor thread and the main thread produce mismatched frames
   for the nav — the "flash between large and small header" the user
   reported. Mobile Chrome uses a different sticky pipeline and was
   unaffected, which matched the reported behavior.

   Fix: make the nav's box completely static. No morph. The big vertical
   signature logo has been removed from the gallery page entirely — the
   horizontal logo in the top-left of the compact nav is the only brand
   mark the user wanted (the two-logo design was visually redundant once
   the morph was gone). Nothing on the nav transitions, so there is no
   compositor race possible. */
.site-nav {
  /* Horizontal logo height is admin-tunable. */
  --nav-h-h: 38px;

  position: sticky;
  top: 0;
  z-index: 900;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  background: rgba(92, 64, 51, 1);
  padding: 0.4rem 1.5rem;
  box-shadow: 0 2px 12px rgba(92, 64, 51, 0.18);
}
.site-nav-brand {
  color: #fff;
  font-family: 'Lora', 'Georgia', serif;
  font-size: 1.2rem;
  font-weight: 400;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
}
.site-nav-brand:hover { opacity: 0.85; }
.site-nav-logo {
  display: block;
  width: auto;
  filter: brightness(0) invert(1);
}
.site-nav-logo-h {
  height: var(--nav-h-h);
}

/* Screen-reader-only utility — keeps the brand name in the accessibility tree
   without showing it on screen, used as a fallback for the logo images */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Brand logo wrappers used on the age gate (vertical) and gallery h1 (horizontal) */
.brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 1.5rem 0;
}
.brand-logo img { display: block; max-width: 100%; height: auto; }
.brand-logo-vertical img { max-height: 280px; width: auto; }
.brand-logo-horizontal img { max-width: min(90%, 640px); height: auto; }

/* Birthday easter egg banner — sits just under the nav bar on the gallery
   page when /api/auth/status reports is_birthday_today === true */
.birthday-banner {
  text-align: center;
  background: linear-gradient(135deg, #fff6e0 0%, #ffe9b8 100%);
  border-bottom: 1px solid #e0c27a;
  color: #6b4a0f;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  line-height: 1.5;
  letter-spacing: 0.01em;
}
.birthday-banner strong { color: #5c4033; font-weight: 600; }
.birthday-banner.hidden { display: none; }

.site-nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.site-nav-link {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  font-size: 0.88rem;
  padding: 0.4rem 0.7rem;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}
.site-nav-link:hover { color: #fff; background: rgba(255,255,255,0.1); }
.site-nav-link.active { color: #fff; background: rgba(255,255,255,0.15); font-weight: 600; }

.site-nav-user {
  color: rgba(255,255,255,0.6);
  font-size: 0.82rem;
  padding: 0 0.4rem 0 0.6rem;
  border-left: 1px solid rgba(255,255,255,0.15);
  margin-left: 0.3rem;
}
.site-nav-btn {
  font: inherit;
  font-size: 0.85rem;
  padding: 0.3rem 0.7rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.site-nav-btn-outline {
  background: transparent;
  color: rgba(255,255,255,0.85);
  border: 1px solid rgba(255,255,255,0.3);
}
.site-nav-btn-outline:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.5);
  color: #fff;
}

/* Hamburger toggle (mobile) */
.site-nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}
.nav-hamburger,
.nav-hamburger::before,
.nav-hamburger::after {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
  position: relative;
}
.nav-hamburger::before,
.nav-hamburger::after { content: ''; position: absolute; left: 0; }
.nav-hamburger::before { top: -7px; }
.nav-hamburger::after { top: 7px; }
.site-nav-toggle[aria-expanded="true"] .nav-hamburger { background: transparent; }
.site-nav-toggle[aria-expanded="true"] .nav-hamburger::before { top: 0; transform: rotate(45deg); }
.site-nav-toggle[aria-expanded="true"] .nav-hamburger::after { top: 0; transform: rotate(-45deg); }

@media (max-width: 700px) {
  /* Mobile: compact row with a hamburger that drops the links panel
     vertically when open. No morph, same layout as desktop. */
  .site-nav {
    padding: 0.4rem 1rem;
    flex-wrap: wrap;
  }
  .site-nav-toggle {
    display: block;
  }
  .site-nav-links {
    display: none;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 0.15rem;
    padding-top: 0.6rem;
  }
  .site-nav-links.open { display: flex; }
  .site-nav-link { padding: 0.6rem 0.5rem; }
  .site-nav-user { border-left: none; margin: 0; padding: 0.4rem 0.5rem; }
  .site-nav-btn { text-align: left; padding: 0.6rem 0.5rem; }

}

/* === Page title (replaces old admin-header h1) === */
.page-title {
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--walnut);
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--cream);
}

/* === Age Gate === */
#age-gate {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8'%3E%3Crect width='8' height='8' fill='%23faf6f1'/%3E%3Cline x1='0' y1='0' x2='8' y2='0' stroke='%23e8dfd4' stroke-width='0.5' opacity='0.6'/%3E%3Cline x1='0' y1='2' x2='8' y2='2' stroke='%23ede5da' stroke-width='0.3' opacity='0.5'/%3E%3Cline x1='0' y1='4' x2='8' y2='4' stroke='%23e5dbd0' stroke-width='0.5' opacity='0.55'/%3E%3Cline x1='0' y1='6' x2='8' y2='6' stroke='%23ede5da' stroke-width='0.3' opacity='0.45'/%3E%3Cline x1='0' y1='0' x2='0' y2='8' stroke='%23e8dfd4' stroke-width='0.3' opacity='0.35'/%3E%3Cline x1='2' y1='0' x2='2' y2='8' stroke='%23ebe3d8' stroke-width='0.2' opacity='0.3'/%3E%3Cline x1='4' y1='0' x2='4' y2='8' stroke='%23e8dfd4' stroke-width='0.3' opacity='0.35'/%3E%3Cline x1='6' y1='0' x2='6' y2='8' stroke='%23ebe3d8' stroke-width='0.2' opacity='0.3'/%3E%3C/svg%3E");
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.age-gate-box {
  background: var(--bg-card);
  border: 1px solid var(--cream);
  border-radius: 12px;
  padding: 3rem 2.5rem;
  text-align: center;
  max-width: 460px;
  width: 90%;
  box-shadow: 0 12px 40px rgba(92, 64, 51, 0.1);
}

.age-gate-box h1 {
  font-size: 2rem;
  font-weight: 300;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--walnut);
  margin-bottom: 1.5rem;
}

.age-gate-box p {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 0.5rem;
}

.age-question {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  font-weight: 500;
}

.age-dob-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* Three-field DOB: MM / DD / YYYY with auto-advance. Plain text inputs so
   there's no native date picker — visitors just type their age. */
.age-dob-fields {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.age-dob-field {
  padding: 0.7rem 0.5rem;
  border: 1px solid #d5cdc3;
  border-radius: 6px;
  font-size: 1.1rem;
  font-family: inherit;
  background: var(--off-white);
  color: var(--text-primary);
  text-align: center;
  width: 3.2rem;
  /* Hide the number-input spinners in Firefox + WebKit so the plain text
     style stays clean. We're using type="text" anyway for full control, but
     this guards against future tweaks. */
  -moz-appearance: textfield;
}
.age-dob-field::-webkit-outer-spin-button,
.age-dob-field::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.age-dob-field-year { width: 5rem; }

.age-dob-field:focus {
  outline: none;
  border-color: var(--walnut);
}

.age-dob-sep {
  color: var(--text-muted);
  font-size: 1.1rem;
  user-select: none;
}

.dob-error {
  color: #b44028;
  font-size: 0.85rem;
  min-height: 1.2em;
}

/* Adult NSFW preference panel — revealed once a valid adult DOB is typed.
   Sits between the error line and the Enter button. */
.age-gate-nsfw {
  margin-top: 0.25rem;
  padding: 0.75rem 1rem;
  background: var(--cream);
  border-radius: 8px;
  max-width: 320px;
}
.age-gate-nsfw-label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--walnut);
  font-weight: 500;
}
.age-gate-nsfw-label input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--walnut);
  cursor: pointer;
}
.age-gate-nsfw-hint {
  margin: 0.4rem 0 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.35;
  text-align: left;
}

#age-enter {
  padding: 0.8rem 2.5rem;
  background: var(--walnut);
  color: var(--off-white);
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s;
  font-weight: 500;
}

#age-enter:hover {
  background: var(--walnut-light);
}

/* === Adulthood NSFW prompt ===
   One-time modal shown on first login after a minor turns 18. Built by
   nav.js after /api/auth/status reports show_adulthood_prompt === true.
   Styled to match the age-gate card for visual continuity. */
.adulthood-prompt {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.adulthood-prompt-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 12, 20, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.adulthood-prompt-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--cream);
  border-radius: 12px;
  padding: 2rem 2rem 1.5rem;
  max-width: 480px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(10, 12, 20, 0.35);
  text-align: center;
}
.adulthood-prompt-card h2 {
  color: var(--walnut);
  font-size: 1.35rem;
  font-weight: 500;
  margin: 0 0 0.9rem;
}
.adulthood-prompt-card p {
  color: var(--text-primary);
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0 0 0.75rem;
}
.adulthood-prompt-hint {
  color: var(--text-muted);
  font-size: 0.82rem !important;
}
.adulthood-prompt-actions {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 1.25rem;
}
.adulthood-prompt-btn {
  padding: 0.7rem 1.2rem;
  border: 1px solid #d5cdc3;
  background: var(--off-white);
  color: var(--walnut);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.adulthood-prompt-btn:hover:not(:disabled) {
  background: var(--cream);
  border-color: var(--walnut-light);
}
.adulthood-prompt-btn:disabled {
  opacity: 0.6;
  cursor: default;
}
.adulthood-prompt-btn-primary {
  background: var(--walnut);
  color: var(--off-white);
  border-color: var(--walnut);
}
.adulthood-prompt-btn-primary:hover:not(:disabled) {
  background: var(--walnut-light);
  border-color: var(--walnut-light);
  color: var(--off-white);
}
.adulthood-prompt-btn-link {
  background: transparent;
  border-color: transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 0.5rem;
}
.adulthood-prompt-btn-link:hover:not(:disabled) {
  background: transparent;
  color: var(--walnut);
  border-color: transparent;
}

/* === Site Admin Editor === */
.admin-wide { max-width: 100%; width: 100%; padding-left: 2rem; padding-right: 2rem; box-sizing: border-box; }

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 1.5rem;
}
.admin-tab {
  background: transparent;
  border: none;
  padding: 0.7rem 1.1rem;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}
.admin-tab:hover { color: var(--walnut); }
.admin-tab.active {
  color: var(--walnut);
  border-bottom-color: var(--walnut);
  font-weight: 500;
}

.admin-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

.admin-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.setting-row {
  display: grid;
  grid-template-columns: 260px 1fr;
  align-items: center;
  gap: 1.5rem;
  padding: 0.75rem 1rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  width: 100%;
  box-sizing: border-box;
}
.setting-row label {
  font-size: 0.9rem;
  color: var(--text-primary);
  font-weight: 500;
}
.setting-row input[type="text"],
.setting-row input[type="number"],
.setting-row textarea,
.setting-row select {
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border-color);
  border-radius: 3px;
  font-family: inherit;
  font-size: 0.9rem;
  width: 100%;
  background: #fff;
  color: var(--text-primary);
}
.setting-row textarea { resize: vertical; min-height: 60px; }
.color-input-wrap { display: flex; align-items: center; gap: 0.5rem; }
.color-input-wrap input[type="color"] {
  width: 48px; height: 36px; padding: 0; border: 1px solid var(--border-color); border-radius: 3px; cursor: pointer;
}
.color-text { font-family: monospace !important; max-width: 110px; }

.toggle-switch {
  position: relative; display: inline-block; width: 48px; height: 26px;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0; cursor: pointer; background: #ccc; border-radius: 26px; transition: 0.2s;
}
.toggle-slider::before {
  content: ""; position: absolute; height: 20px; width: 20px; left: 3px; top: 3px; background: white; border-radius: 50%; transition: 0.2s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--walnut); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(22px); }

.admin-save-bar {
  position: sticky;
  bottom: 0;
  background: var(--bg-primary);
  border-top: 1px solid var(--border-color);
  padding: 1rem 0;
  margin-top: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  z-index: 5;
}
.save-status {
  flex: 1;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.save-status.dirty { color: #b8860b; font-weight: 500; }
.save-status.saved { color: #4a7c59; font-weight: 500; }
.save-status.error { color: #a04040; font-weight: 500; }

/* Live preview panel */
.admin-preview-col { margin-top: 2rem; padding-top: 2rem; border-top: 2px solid var(--border-color); }
.admin-preview-col h3 { margin-top: 0; color: var(--walnut); }
.preview-frame {
  --pv-bg: #faf6f1; --pv-walnut: #5c4033; --pv-text: #1e2a4a; --pv-muted: #8a7f73; --pv-border: #d4cbc0;
  --pv-gap: 12px; --pv-pad: 6px; --pv-shadow: 1px 2px 6px rgba(92,64,51,0.12);
  --pv-cols: 2;
  background: var(--pv-bg); border: 1px solid var(--pv-border); border-radius: 6px; padding: 1rem; transition: all 0.2s;
}
.preview-header { text-align: center; margin-bottom: 1rem; }
.preview-title { font-family: 'Lora', serif; font-weight: 400; font-size: 1.3rem; color: var(--pv-text); }
.preview-tagline { font-family: 'Lora', serif; font-style: italic; font-size: 0.85rem; color: var(--pv-muted); margin-top: 0.2rem; }
.preview-gallery { columns: 2; column-gap: var(--pv-gap); }
.preview-item {
  break-inside: avoid; margin-bottom: var(--pv-gap); background: #fff; padding: var(--pv-pad); padding-bottom: 6px;
  box-shadow: var(--pv-shadow); border-radius: 2px;
}
.preview-img { width: 100%; background: linear-gradient(135deg, #c4b8a8, #8a7360); display: block; }
.preview-caption {
  font-family: 'Dancing Script', cursive; font-weight: 600; font-size: 0.95rem; color: var(--pv-walnut); text-align: center; padding-top: 4px;
}

/* List editor */
.list-selector { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; }
.list-selector label { font-weight: 500; }
.list-selector select { padding: 0.4rem 0.6rem; border: 1px solid var(--border-color); border-radius: 3px; }
.list-add-row { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.list-add-row input { flex: 1; padding: 0.5rem 0.7rem; border: 1px solid var(--border-color); border-radius: 3px; font-family: inherit; }
.list-add-row button, .list-save-btn, .list-delete-btn {
  padding: 0.4rem 0.8rem; background: var(--walnut); color: var(--bg-primary); border: none; border-radius: 3px; cursor: pointer; font-family: inherit; font-size: 0.85rem;
}
.list-delete-btn { background: transparent; color: #a04040; border: 1px solid #a04040; }
.list-delete-btn:hover { background: #a04040; color: var(--bg-primary); }
.list-items { display: flex; flex-direction: column; gap: 0.4rem; max-height: 520px; overflow-y: auto; padding-right: 0.5rem; }
.list-item-row { display: grid; grid-template-columns: 1fr auto auto; gap: 0.5rem; }
.list-item-input { padding: 0.4rem 0.6rem; border: 1px solid var(--border-color); border-radius: 3px; font-family: inherit; font-size: 0.9rem; }

/* === Master Admin Panel === */
.admin-users-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.admin-user-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1.2rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.admin-user-row:hover {
  background: rgba(92, 64, 51, 0.05);
  border-color: var(--walnut);
}

.admin-user-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.admin-user-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.admin-user-arrow {
  color: var(--walnut);
  font-size: 1.3rem;
}

.disabled-badge {
  display: inline-block;
  margin-top: 0.3rem;
  font-size: 0.7rem;
  color: #a04040;
  background: rgba(160, 64, 64, 0.1);
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  width: fit-content;
}

.admin-user-detail-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.admin-user-detail-header h3 {
  margin: 0;
  color: var(--walnut);
}

.admin-user-actions {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.danger-btn {
  background: transparent !important;
  color: #a04040 !important;
  border: 1px solid #a04040 !important;
}

.danger-btn:hover {
  background: #a04040 !important;
  color: var(--bg-primary) !important;
}

.admin-user-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.75rem;
}

.admin-thumb {
  position: relative;
  cursor: pointer;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  transition: transform 0.15s, border-color 0.15s;
}

.admin-thumb:hover {
  transform: scale(1.03);
  border-color: #a04040;
}

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

.admin-thumb-meta {
  font-size: 0.65rem;
  padding: 0.3rem 0.4rem;
  background: var(--bg-primary);
  color: var(--text-muted);
  line-height: 1.3;
}

.question-label {
  font-weight: 500;
  color: var(--walnut) !important;
  margin-bottom: 0.5rem !important;
  display: block;
  font-size: 0.95rem !important;
}

/* === Upload Disclaimer === */
.upload-disclaimer {
  background: rgba(92, 64, 51, 0.08);
  border-left: 3px solid var(--walnut);
  padding: 0.9rem 1.2rem;
  margin: 0 0 1.5rem 0;
  border-radius: 4px;
}

.upload-disclaimer p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-primary);
  line-height: 1.5;
}

/* === Gallery Filters === */
.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  justify-content: center;
  padding: 0 2rem 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.filter-group label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.filter-group select {
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-primary);
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.9rem;
  min-width: 160px;
}

.filter-reset {
  padding: 0.5rem 1rem;
  background: transparent;
  color: var(--walnut);
  border: 1px solid var(--walnut);
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
}

.filter-reset:hover {
  background: var(--walnut);
  color: var(--bg-primary);
}

/* === Edit Modal === */
.edit-modal {
  position: fixed;
  inset: 0;
  background: rgba(30, 42, 74, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.edit-modal-box {
  background: var(--bg-primary);
  border-radius: 8px;
  padding: 2rem;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.edit-modal-box h3 {
  margin-top: 0;
  color: var(--walnut);
}

.edit-modal-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.edit-modal-actions button {
  flex: 1;
  padding: 0.6rem 1rem;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  border: 1px solid var(--walnut);
}

.edit-save-btn {
  background: var(--walnut);
  color: var(--bg-primary);
}

.edit-cancel-btn {
  background: transparent;
  color: var(--walnut);
}

.admin-image-card {
  cursor: pointer;
}

.admin-image-card .edit-hint {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  background: rgba(30, 42, 74, 0.8);
  color: var(--bg-primary);
  padding: 0.25rem 0.5rem;
  border-radius: 3px;
  font-size: 0.7rem;
  opacity: 0;
  transition: opacity 0.2s;
}

.admin-image-card:hover .edit-hint {
  opacity: 1;
}

/* === NSFW Toggle === */
.nsfw-toggle-wrap {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  z-index: 10;
}

.toggle-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  user-select: none;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #c5bdb3;
  border-radius: 22px;
  transition: background 0.25s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.25s;
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--walnut);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(18px);
}

/* === Header === */
header {
  text-align: center;
  padding: 2.5rem 1rem 1.5rem;
  position: relative;
}

header h1 {
  font-size: 1.8rem;
  font-weight: 300;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--walnut);
}

.site-tagline {
  font-family: 'Lora', Georgia, serif;
  font-style: italic;
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0.75rem auto 0;
  line-height: 1.7;
}

#header-auth {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

#header-username {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.header-username-link {
  color: var(--walnut);
  font-size: 0.9rem;
  text-decoration: none;
  font-weight: 500;
  padding: 0.3rem 0.6rem;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, color 0.2s;
}

.header-username-link:hover {
  color: var(--walnut-light);
  border-bottom-color: var(--walnut-light);
}

.header-btn {
  padding: 0.45rem 1.2rem;
  background: var(--walnut);
  color: var(--off-white);
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
  font-family: inherit;
}

.header-btn:hover {
  background: var(--walnut-light);
}

.header-btn-outline {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid #c5bdb3;
}

.header-btn-outline:hover {
  border-color: var(--walnut);
  color: var(--walnut);
  background: transparent;
}

/* === Gallery Grid === */
:root {
  --cols-desktop: 4;
  --cols-tablet: 3;
  --cols-small: 2;
  --cols-mobile: 1;
  --img-gap: 12px;
  --img-pad: 6px;
  --img-shadow: 1px 2px 6px rgba(92,64,51,0.12), 2px 4px 16px rgba(0,0,0,0.06);
  --img-shadow-hover: 2px 4px 12px rgba(92,64,51,0.2), 4px 8px 24px rgba(0,0,0,0.1);
}
.gallery-grid {
  columns: var(--cols-desktop);
  column-gap: var(--img-gap);
  padding: 0 12px 2rem;
  max-width: 1600px;
  margin: 0 auto;
}

.gallery-grid .gallery-item {
  break-inside: avoid;
  margin-bottom: var(--img-gap);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
  background: #fff;
  padding: var(--img-pad) var(--img-pad) 8px;
  box-shadow: var(--img-shadow);
  transition: box-shadow 0.3s ease;
}

.gallery-grid .gallery-item:hover {
  box-shadow: var(--img-shadow-hover);
}

.gallery-grid .gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  /* While the image is still downloading it has no intrinsic size, which
     breaks CSS multi-column layout (columns balance around zero-height
     placeholders and leave huge blank gaps). `aspect-ratio: auto 4/3`
     reserves a 4:3 placeholder slot BEFORE the image loads; once the
     browser knows the natural dimensions, the `auto` keyword lets them
     take over automatically. */
  aspect-ratio: auto 4 / 3;
  background: #efe9de;
}

.gallery-grid .gallery-item:hover img {
  filter: brightness(1.05);
}

/* Caption base */
.gallery-caption {
  font-weight: 600;
  color: var(--walnut);
  line-height: 1.25;
  word-wrap: break-word;
}

.gallery-caption .caption-sep {
  color: var(--text-muted);
  margin: 0 0.25rem;
  font-family: 'Lora', serif;
  font-size: 0.7em;
  font-weight: 400;
  vertical-align: middle;
}

/* Two-line caption: camera on top, film stock as a quieter subtitle below */
.gallery-caption .caption-camera {
  /* Inherits font from .gallery-caption (user's chosen handwriting font) */
}
.gallery-caption .caption-film {
  font-family: 'Lora', serif;
  font-size: 0.78em;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 1px;
}

/* Font picker (register/settings) */
.font-picker {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.font-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  cursor: pointer;
  background: var(--bg-primary);
  transition: border-color 0.15s, background 0.15s;
}
.font-option:hover {
  border-color: var(--walnut);
}
.font-option input[type="radio"] {
  margin: 0;
  accent-color: var(--walnut);
}
.font-option:has(input:checked) {
  border-color: var(--walnut);
  background: rgba(92, 64, 51, 0.05);
}
.font-preview {
  color: var(--walnut);
  font-weight: 600;
}

/* Font variants */
.font-dancing-script { font-family: 'Dancing Script', 'Segoe Script', cursive; font-size: 1.15rem; }
.font-allura         { font-family: 'Allura', cursive;        font-size: 1.35rem; }
.font-great-vibes    { font-family: 'Great Vibes', cursive;   font-size: 1.35rem; }
.font-pinyon-script  { font-family: 'Pinyon Script', cursive; font-size: 1.35rem; }
.font-sacramento     { font-family: 'Sacramento', cursive;    font-size: 1.25rem; }

/* Gallery item layout variants for caption position */
.gallery-item.cap-top,
.gallery-item.cap-bottom {
  display: flex;
  flex-direction: column;
}
.gallery-item.cap-top    { padding: 8px 6px 6px; }
.gallery-item.cap-bottom { padding: 6px 6px 8px; }
.gallery-item.cap-top .gallery-caption,
.gallery-item.cap-bottom .gallery-caption {
  text-align: center;
  padding: 6px 4px 2px;
}
.gallery-item.cap-top .gallery-caption { order: -1; padding: 2px 4px 6px; }

@keyframes _unused_drop {
  0% {
    opacity: 0;
    transform: translateY(-80px) scale(0.8);
  }
  40% {
    opacity: 1;
  }
  65% {
    transform: translateY(6px) scale(1.015);
  }
  80% {
    transform: translateY(-2px) scale(0.995);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* === Empty State === */
#empty-state {
  text-align: center;
  padding: 6rem 2rem;
}

#empty-state p {
  color: var(--text-muted);
  font-size: 1.1rem;
}

#empty-state a {
  color: var(--walnut-light);
  text-decoration: underline;
}

/* === Lightbox === */
#lightbox {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  opacity: 1;
  transition: opacity 0.5s ease;
}

#lightbox.hidden {
  display: flex !important;
  opacity: 0;
  pointer-events: none;
}

#lightbox.fully-hidden {
  display: none !important;
}

/* --- Polaroid frame --- */
.polaroid-frame {
  background: #fff;
  border-radius: 3px;
  padding: 1.2rem 1.2rem 0;
  box-shadow: 0 12px 60px rgba(0, 0, 0, 0.55), 0 2px 8px rgba(0, 0, 0, 0.25);
  max-width: 92vw;
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  cursor: default;
  position: relative;
  overflow: hidden;
}

.polaroid-img-wrap {
  flex-shrink: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#lightbox-img {
  max-width: 100%;
  max-height: 72vh;
  object-fit: contain;
  display: block;
  border-radius: 2px;
}

/* --- Polaroid caption (bottom white area) --- */
.polaroid-caption {
  padding: 0.9rem 0.2rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-height: 4.5rem;
}

.polaroid-text {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  text-align: center;
}

.polaroid-camera {
  font-size: 1.15rem;
  color: var(--walnut);
}

.polaroid-film {
  font-size: 1rem;
  color: var(--text-muted);
}

.polaroid-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.polaroid-meta #lightbox-username {
  font-weight: 600;
  color: var(--walnut);
}

.polaroid-meta #lightbox-username a {
  color: var(--walnut);
  text-decoration: none;
}
.polaroid-meta #lightbox-username a:hover { text-decoration: underline; }

.polaroid-meta #lightbox-country::before {
  content: "\00b7\00a0";
  color: #b0a89e;
}

.polaroid-meta #lightbox-links:not(:empty)::before {
  content: "\00b7\00a0";
  color: #b0a89e;
}

.polaroid-meta a {
  color: var(--walnut-light);
  text-decoration: none;
}
.polaroid-meta a:hover { text-decoration: underline; }

/* --- Polaroid bottom row: user/location left, share right --- */
.polaroid-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.3rem;
  gap: 0.5rem;
}
.polaroid-bottom-left {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.polaroid-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.polaroid-details-link {
  font-size: 0.82rem;
  color: var(--walnut);
  text-decoration: none;
}
.polaroid-details-link:hover { text-decoration: underline; }

/* --- Share button (up arrow) --- */
.share-wrapper {
  position: relative;
}

.share-toggle-btn {
  background: none;
  border: none;
  border-bottom: 2px solid var(--walnut);
  color: var(--walnut);
  padding: 0.3rem 0.45rem 0.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: color 0.15s, border-color 0.15s;
  border-radius: 0;
}
.share-toggle-btn:hover {
  color: var(--walnut-light);
  border-color: var(--walnut-light);
}

/* --- Share dropdown menu --- */
.share-menu {
  position: absolute;
  bottom: calc(100% + 0.4rem);
  right: 0;
  background: #fff;
  border: 1px solid var(--cream);
  border-radius: 6px;
  box-shadow: 0 6px 20px rgba(92, 64, 51, 0.15);
  min-width: 160px;
  z-index: 2010;
  overflow: hidden;
}

.share-menu-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.6rem 0.85rem;
  background: none;
  border: none;
  font: inherit;
  font-size: 0.85rem;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  transition: background 0.12s;
}
.share-menu-item:hover { background: var(--cream); }
.share-menu-item svg { flex-shrink: 0; }

/* SFW row (below frame) */
.polaroid-sfw-row {
  font-size: 0.75rem;
  color: #b0a89e;
  text-align: center;
  padding: 0.25rem 0 0.4rem;
}

/* --- Like button (lightbox) --- */
.like-btn {
  background: none;
  border: none;
  color: var(--walnut);
  padding: 0.3rem 0.5rem 0.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font: inherit;
  font-size: 0.85rem;
  border-radius: 4px;
  transition: color 0.15s, transform 0.15s;
}
.like-btn:hover { color: #c0392b; }
.like-btn .heart-icon { transition: fill 0.2s, stroke 0.2s, transform 0.2s; }
.like-btn.liked { color: #c0392b; }
.like-btn.liked .heart-icon { fill: #c0392b; stroke: #c0392b; }
.like-btn:active .heart-icon { transform: scale(1.25); }
.like-btn .like-count {
  font-weight: 600;
  min-width: 1ch;
  font-feature-settings: 'tnum';
}

/* --- Like badge on gallery thumbnails --- */
.gallery-item { position: relative; }
.like-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  background: rgba(0,0,0,0.55);
  color: #fff;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  pointer-events: none;
  backdrop-filter: blur(4px);
}
.like-badge.liked { color: #ff8b80; }
.like-badge svg { flex-shrink: 0; }

/* --- Nav: likes link + unseen badge --- */
.nav-likes-link { position: relative; }
.nav-likes-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #c0392b;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 1.2rem;
  height: 1.2rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  margin-left: 0.4rem;
  line-height: 1;
}

/* --- Likes dashboard page --- */
.likes-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: -0.5rem 0 1rem;
}
.likes-summary {
  font-size: 0.95rem;
  color: var(--walnut);
  margin-bottom: 1rem;
  font-weight: 600;
}
.likes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.liked-card {
  display: block;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: var(--text-primary);
  transition: transform 0.15s, box-shadow 0.15s;
}
.liked-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(92, 64, 51, 0.15);
}
.liked-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}
.liked-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.75rem;
  gap: 0.5rem;
}
.liked-card-gear {
  font-size: 0.82rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.liked-card-likes {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  color: #c0392b;
  font-weight: 700;
  font-size: 0.85rem;
}
.likes-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}
.likes-empty.hidden { display: none; }

/* Share status toast */
.lb-share-status {
  font-size: 0.78rem;
  color: var(--walnut-light);
  min-height: 1em;
  text-align: right;
  padding-top: 0.15rem;
}

/* SFW / NSFW tags */
.sfw-tag, .nsfw-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sfw-tag {
  background: rgba(45, 122, 79, 0.8);
  color: #fff;
}

.nsfw-tag {
  background: rgba(180, 64, 40, 0.85);
  color: #fff;
}

#lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: var(--off-white);
  font-size: 2.5rem;
  cursor: pointer;
  z-index: 2001;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.2s;
}

#lightbox-close:hover {
  opacity: 1;
}

#lightbox-prev,
#lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(92, 64, 51, 0.5);
  border: none;
  color: var(--off-white);
  font-size: 2.5rem;
  padding: 0.5rem 1rem;
  cursor: pointer;
  border-radius: 6px;
  z-index: 2001;
  opacity: 0.7;
  transition: opacity 0.2s, background 0.2s;
}

#lightbox-prev { left: 1rem; }
#lightbox-next { right: 1rem; }

#lightbox-prev:hover,
#lightbox-next:hover {
  opacity: 1;
  background: rgba(92, 64, 51, 0.8);
}

/* === Responsive === */
@media (max-width: 1200px) {
  .gallery-grid { columns: var(--cols-tablet); }
}

@media (max-width: 800px) {
  .gallery-grid { columns: var(--cols-small); }

  .age-gate-box {
    padding: 2rem 1.5rem;
  }

  .age-gate-box h1 {
    font-size: 1.5rem;
  }

  .brand-logo-vertical img { max-height: 200px; }
  .brand-logo-horizontal img { max-width: 95%; }
  .site-nav-logo { height: 2rem; }

  header h1 {
    font-size: 1.4rem;
  }

  #lightbox-prev,
  #lightbox-next {
    font-size: 1.8rem;
    padding: 0.4rem 0.7rem;
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    columns: var(--cols-mobile);
    padding: 0 8px 2rem;
  }

  .age-buttons {
    flex-direction: column;
  }

  .age-buttons button {
    width: 100%;
  }
}

/* === Admin Page === */
.admin-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.admin-container h1 {
  font-weight: 300;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--walnut);
  margin-bottom: 0.5rem;
}

.admin-container > p {
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.admin-container a {
  color: var(--walnut-light);
}

.upload-zone {
  border: 2px dashed var(--walnut);
  border-radius: 12px;
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  margin-bottom: 2rem;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--walnut-light);
  background: rgba(92, 64, 51, 0.1);
}

.upload-zone p {
  color: var(--text-muted);
  font-size: 1.1rem;
}

.upload-limit {
  font-size: 0.85rem !important;
  margin-top: 0.5rem;
  opacity: 0.7;
}

.upload-zone .browse-link {
  color: var(--walnut-light);
  text-decoration: underline;
  cursor: pointer;
}

#upload-btn {
  display: none;
  padding: 0.8rem 2.5rem;
  background: var(--walnut);
  color: var(--off-white);
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
  margin-bottom: 2rem;
}

#upload-btn:hover {
  background: var(--walnut-light);
}

#upload-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#upload-status {
  margin-bottom: 2rem;
  color: var(--text-muted);
}

/* === Bulk Meta (Apply to All) === */
.bulk-meta {
  background: var(--bg-card);
  border: 1px solid var(--cream);
  border-radius: 10px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.bulk-meta h3 {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--blue-dark);
  margin-bottom: 1rem;
}

.bulk-meta-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
}

.bulk-meta-fields .form-group {
  flex: 1;
  min-width: 160px;
  margin-bottom: 0;
}

.apply-all-btn {
  padding: 0.65rem 1.5rem;
  background: var(--walnut);
  color: var(--off-white);
  border: none;
  border-radius: 6px;
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
  align-self: flex-end;
}

.apply-all-btn:hover {
  background: var(--walnut-light);
}

/* Combo select (dropdown + custom text input) */
.combo-select {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.combo-custom {
  padding: 0.5rem 0.7rem;
  border: 1px solid #d5cdc3;
  border-radius: 5px;
  font-size: 0.85rem;
  font-family: inherit;
  background: var(--off-white);
  color: var(--text-primary);
}

/* Searchable camera/film input backed by a shared <datalist> for native
   browser type-ahead. Styled to match the existing <select> controls.
   `color-scheme: light` is declared again locally because Chrome/Safari
   render datalist option popups using the element's own color-scheme
   rather than inheriting from :root — without this, dark-mode OS users
   get white-on-white autocomplete text. */
.combo-input {
  color-scheme: light;
  padding: 0.5rem 0.7rem;
  border: 1px solid #d5cdc3;
  border-radius: 5px;
  font-size: 0.9rem;
  font-family: inherit;
  background: var(--off-white);
  color: var(--text-primary);
  width: 100%;
  box-sizing: border-box;
}
.combo-input:focus {
  outline: none;
  border-color: var(--walnut);
  box-shadow: 0 0 0 2px rgba(92, 64, 51, 0.15);
}

/* === Upload Queue (per-image cards) === */
.upload-queue {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 1.5rem;
}

.queue-card {
  display: flex;
  gap: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--cream);
  border-radius: 8px;
  padding: 0.75rem;
}

.queue-thumb {
  flex-shrink: 0;
  width: 100px;
  height: 100px;
  border-radius: 4px;
  overflow: hidden;
}

.queue-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.queue-fields {
  flex: 1;
  min-width: 0;
}

.queue-filename {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.queue-row .form-group {
  flex: 1;
  min-width: 130px;
  margin-bottom: 0;
}

.queue-row .form-group label {
  font-size: 0.75rem;
}

.queue-row select,
.queue-row input {
  font-size: 0.82rem;
  padding: 0.4rem 0.5rem;
}

.queue-remove {
  background: none;
  border: none;
  color: #b44028;
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0;
  margin-top: 0.4rem;
  font-family: inherit;
}

.queue-remove:hover {
  text-decoration: underline;
}

/* Existing images in admin */
.admin-images h2 {
  font-weight: 400;
  color: var(--blue-dark);
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

/* Image metadata overlay on admin cards */
.image-tag {
  position: absolute;
  top: 6px;
  left: 6px;
  font-size: 0.6rem;
  font-weight: 600;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.image-meta-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 0.65rem;
  padding: 0.3rem 0.4rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.admin-image-card {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
}

.admin-image-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

.admin-image-card .delete-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(180, 40, 40, 0.85);
  color: white;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.admin-image-card:hover .delete-btn {
  opacity: 1;
}

/* === Admin Header === */
.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.admin-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.9rem;
}

.admin-nav a {
  color: var(--walnut-light);
  text-decoration: none;
}

.admin-nav a:hover {
  text-decoration: underline;
}

.link-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  font-family: inherit;
  padding: 0;
}

.link-btn:hover {
  color: var(--walnut);
}

/* === Auth Pages === */
.auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem 1rem;
}

.auth-box {
  background: var(--bg-card);
  border: 1px solid var(--cream);
  border-radius: 12px;
  padding: 2.5rem 2rem;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 12px 40px rgba(92, 64, 51, 0.1);
}

.auth-box h1 {
  font-size: 1.6rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--walnut);
  text-align: center;
  margin-bottom: 2rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  font-weight: 500;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1px solid #d5cdc3;
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--off-white);
  color: var(--text-primary);
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--walnut);
}

.form-group input::placeholder {
  color: #b0a89e;
}

.error-msg {
  color: #b44028;
  font-size: 0.9rem;
  min-height: 1.4em;
  margin-bottom: 0.75rem;
}

.field-status {
  display: block;
  font-size: 0.8rem;
  margin-top: 0.3rem;
  min-height: 1.2em;
  color: var(--text-muted);
}

.field-status-ok {
  color: #2d7a4f;
}

.field-status-error {
  color: #b44028;
}

.auth-btn {
  width: 100%;
  padding: 0.8rem;
  background: var(--walnut);
  color: var(--off-white);
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s;
  font-weight: 500;
}

.auth-btn:hover {
  background: var(--walnut-light);
}

.auth-switch {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.auth-switch a {
  color: var(--walnut);
  text-decoration: underline;
}

.auth-back {
  text-align: center;
  margin-top: 0.75rem;
  font-size: 0.85rem;
}

.auth-back a {
  color: var(--text-muted);
  text-decoration: none;
}

.auth-back a:hover {
  color: var(--walnut);
}

.optional-label {
  font-weight: 400;
  color: #b0a89e;
  font-size: 0.8rem;
}

.form-note {
  font-size: 0.82rem;
  color: #b0a89e;
  line-height: 1.5;
  margin-bottom: 1.25rem;
  font-style: italic;
}

/* === Settings Page === */
.settings-section {
  background: var(--bg-card);
  border: 1px solid var(--cream);
  border-radius: 10px;
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.settings-section h2 {
  font-weight: 400;
  color: var(--blue-dark);
  font-size: 1.15rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--cream);
}

.form-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 0;
}

.form-row .form-group {
  flex: 1;
  min-width: 0;
}

.settings-btn {
  padding: 0.75rem 2rem;
  background: var(--walnut);
  color: var(--off-white);
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s;
  font-weight: 500;
}

.settings-btn:hover {
  background: var(--walnut-light);
}

.status-msg {
  font-size: 0.9rem;
  min-height: 1.4em;
  margin-bottom: 0.75rem;
}

.status-success {
  color: #2d7a4f;
}

.status-error {
  color: #b44028;
}

@media (max-width: 480px) {
  .auth-box {
    padding: 2rem 1.25rem;
  }

  #header-auth {
    position: static;
    justify-content: center;
    margin-top: 0.75rem;
  }

  .nsfw-toggle-wrap {
    position: static;
    justify-content: center;
    margin-bottom: 0.5rem;
  }

  .admin-header {
    flex-direction: column;
    gap: 1rem;
  }

  .polaroid-frame {
    padding: 0.6rem 0.6rem 0;
    max-width: 96vw;
  }
  #lightbox-img { max-height: 60vh; }
  .polaroid-caption { padding: 0.6rem 0.1rem 0.7rem; min-height: auto; }
  .polaroid-camera { font-size: 1rem; }
  .polaroid-film { font-size: 0.88rem; }
  .polaroid-meta { font-size: 0.78rem; }
  .polaroid-actions { flex-wrap: wrap; gap: 0.3rem; }

  .queue-card {
    flex-direction: column;
  }

  .queue-thumb {
    width: 100%;
    height: 160px;
  }

  .queue-row {
    flex-direction: column;
  }

  .bulk-meta-fields {
    flex-direction: column;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .settings-section {
    padding: 1.25rem;
  }
}

/* Admin IP display */
.admin-user-ips { display: block; font-size: 0.75rem; color: var(--text-muted); font-family: monospace; margin-top: 0.2rem; }
.admin-thumb-ip { font-size: 0.7rem; color: var(--text-muted); font-family: monospace; padding: 0.2rem 0.4rem; }

/* Hide SFW controls for minors on upload page */
.hide-sfw-controls .q-sfw-group { display: none \!important; }

/* Skip-to-content link (visible only on focus) */
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--walnut); color: #fff; padding: 0.5rem 1rem; z-index: 10000; text-decoration: none; border-radius: 0 0 4px 0; }
.skip-link:focus { left: 0; outline: 2px solid #fff; }

/* ============================================================
   New UI: skeletons, pagination, cookie banner, share, photo
   detail pages, photographer profiles
   ============================================================ */

/* --- Loading skeletons --- */
.gallery-skeleton {
  break-inside: avoid;
  margin-bottom: 1rem;
  border-radius: 6px;
  background: linear-gradient(90deg, #eee6d9 0%, #f5efe3 50%, #eee6d9 100%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
  width: 100%;
  display: block;
}
@keyframes skeleton-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* --- Infinite scroll sentinel --- */
.gallery-sentinel {
  break-inside: avoid;
  width: 100%;
  height: 1px;
  display: block;
  margin: 0;
  padding: 0;
  pointer-events: none;
}

/* --- Pagination --- */
.gallery-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 2rem 1rem 3rem;
}
.gallery-pagination button {
  background: var(--bg-card);
  color: var(--walnut);
  border: 1px solid var(--cream);
  padding: 0.5rem 0.85rem;
  min-width: 2.5rem;
  border-radius: 4px;
  font: inherit;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.gallery-pagination button:hover:not(:disabled) {
  background: var(--cream);
  border-color: var(--walnut-light);
}
.gallery-pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.gallery-pagination button.page-current {
  background: var(--walnut);
  color: #fff;
  border-color: var(--walnut);
  font-weight: 600;
}
.gallery-pagination .page-ellipsis {
  color: var(--text-muted);
  padding: 0 0.25rem;
  user-select: none;
}

/* --- Cookie consent banner --- */
.cookie-banner {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  max-width: 720px;
  margin: 0 auto;
  background: var(--walnut);
  color: #fff;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(10, 12, 20, 0.35);
  display: flex;
  align-items: center;
  gap: 1rem;
  z-index: 9000;
  font-size: 0.9rem;
  line-height: 1.4;
}
.cookie-banner p { flex: 1; margin: 0; color: #fff; }
.cookie-accept-btn {
  background: #fff;
  color: var(--walnut);
  border: none;
  padding: 0.55rem 1.1rem;
  border-radius: 4px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.cookie-accept-btn:hover { background: var(--cream); }

/* --- Site-wide footer (injected by site-settings.js) --- */
.site-footer {
  margin-top: 4rem;
  padding: 1.75rem 1rem 2rem;
  text-align: center;
  font-family: 'Lora', serif;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
}

/* (Old lightbox share styles removed — now using polaroid share menu) */

/* --- Photo detail page --- */
.photo-detail {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}
.detail-breadcrumbs {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.detail-breadcrumbs a {
  color: var(--walnut);
  text-decoration: none;
}
.detail-breadcrumbs a:hover { text-decoration: underline; }
.crumb-sep { margin: 0 0.4rem; color: var(--text-muted); }

.photo-detail-img-wrap {
  background: var(--bg-card);
  border: 1px solid var(--cream);
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  box-shadow: 0 4px 20px rgba(92, 64, 51, 0.08);
  margin-bottom: 1.25rem;
}
.photo-detail-img-wrap img {
  max-width: 100%;
  max-height: 80vh;
  height: auto;
  border-radius: 4px;
  display: inline-block;
}

.photo-detail-info {
  background: var(--bg-card);
  border: 1px solid var(--cream);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}
.photo-detail-info h1 {
  font-size: 1.6rem;
  font-weight: 400;
  color: var(--walnut);
  margin-bottom: 0.35rem;
  line-height: 1.3;
}
.photo-film { color: var(--text-muted); font-size: 1rem; }
.photo-detail-by {
  margin-top: 0.75rem;
  font-size: 0.95rem;
  color: var(--text-primary);
}
.photo-detail-by a { color: var(--walnut); text-decoration: none; font-weight: 600; }
.photo-detail-by a:hover { text-decoration: underline; }
.photo-country { color: var(--text-muted); margin-left: 0.35rem; }
.photo-detail-tag {
  display: inline-block;
  background: var(--cream);
  color: var(--walnut);
  padding: 0.15rem 0.55rem;
  border-radius: 10px;
  font-size: 0.75rem;
  margin-left: 0.5rem;
  vertical-align: middle;
}
.photo-view-all {
  display: inline-block;
  margin-top: 0.75rem;
  color: var(--walnut);
  font-size: 0.9rem;
}

.photo-share {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}
.photo-share button {
  background: var(--walnut);
  color: #fff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.15s;
}
.photo-share button:hover { background: var(--walnut-light); }
.share-status {
  font-size: 0.85rem;
  color: var(--text-muted);
  min-height: 1em;
}

.photo-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: stretch;
  margin-top: 1rem;
}
.photo-nav-link {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--cream);
  border-radius: 6px;
  padding: 0.85rem 1rem;
  color: var(--walnut);
  text-decoration: none;
  font-size: 0.9rem;
  transition: border-color 0.15s, background 0.15s;
  min-width: 0;
}
.photo-nav-link:hover { border-color: var(--walnut-light); background: var(--cream); }
.photo-nav-link.photo-nav-next { text-align: right; }
.photo-nav-link small {
  display: block;
  color: var(--text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.2rem;
}
.photo-nav-link span {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.photo-nav-link.photo-nav-empty { opacity: 0.4; pointer-events: none; }

/* --- Photographer profile page --- */
.profile-header {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.25rem 1rem;
  text-align: center;
}
.profile-header h1 {
  font-size: 2.2rem;
  font-weight: 300;
  color: var(--walnut);
  margin-bottom: 0.3rem;
}
.profile-meta {
  color: var(--text-muted);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.profile-meta a { color: var(--walnut); text-decoration: none; }
.profile-meta a:hover { text-decoration: underline; }
.profile-count { color: var(--text-muted); font-size: 0.85rem; margin-top: 0.25rem; }

/* --- 404 page --- */
.not-found-page {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}
.not-found-page h1 {
  font-size: 3rem;
  font-weight: 300;
  color: var(--walnut);
  margin-bottom: 0.5rem;
}
.not-found-page p { color: var(--text-muted); margin-bottom: 1.25rem; }

/* --- Checkbox-style label used on register/settings --- */
.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  cursor: pointer;
  line-height: 1.4;
  font-size: 0.92rem;
  color: var(--text-primary);
}
.checkbox-label input[type="checkbox"] {
  margin-top: 0.2rem;
  flex-shrink: 0;
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--walnut);
  cursor: pointer;
}
.checkbox-label code {
  background: var(--cream);
  padding: 0.05rem 0.35rem;
  border-radius: 3px;
  font-size: 0.85em;
}
.radio-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  line-height: 1.4;
  font-size: 0.92rem;
  color: var(--text-primary);
  padding: 0.25rem 0;
}
.radio-label input[type="radio"] {
  flex-shrink: 0;
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--walnut);
  cursor: pointer;
}

.profile-incomplete-banner {
  background: #fff6e0;
  border: 1px solid #e0c27a;
  border-left: 4px solid #c48c1a;
  color: #6b4a0f;
  padding: 0.9rem 1.1rem;
  border-radius: 6px;
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
  line-height: 1.45;
}
.profile-incomplete-banner p { margin: 0 0 0.75rem 0; }
.profile-incomplete-banner.hidden { display: none; }
.profile-incomplete-banner-btn {
  display: inline-block;
  text-decoration: none;
  background: #c48c1a;
  color: #fff;
  padding: 0.5rem 1.1rem;
  border-radius: 4px;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
}
.profile-incomplete-banner-btn:hover { background: #a87214; }

/* "(Required information in order to upload)" tag next to the Profile heading */
.profile-required-label {
  font-size: 0.8rem;
  font-weight: normal;
  color: #b5651d;
  margin-left: 0.4rem;
}

/* Inline warning style for the username 90-day notice */
.field-status-warning {
  color: #8a5a00;
  background: #fff6e0;
  border: 1px solid #e0c27a;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.82rem;
}
.field-status-warning.hidden { display: none; }

/* --- Responsive tweaks for new elements --- */
@media (max-width: 600px) {
  .cookie-banner { flex-direction: column; align-items: stretch; text-align: center; }
  .cookie-accept-btn { width: 100%; }
  .photo-nav { flex-direction: column; }
  .photo-nav-link.photo-nav-next { text-align: left; }
  .photo-detail-info h1 { font-size: 1.3rem; }
  .profile-header h1 { font-size: 1.7rem; }
  .gallery-pagination button { padding: 0.4rem 0.6rem; min-width: 2.1rem; font-size: 0.85rem; }
  .report-modal-card { max-width: 94vw; padding: 1.2rem; }
  .report-card { flex-direction: column; }
  .report-card-left { max-width: 100%; }
  .report-card-thumb { max-width: 100%; max-height: 240px; }
}

/* ============================================================
   Photo reporting feature
   ============================================================ */

/* Flag icon button in lightbox actions */
.report-btn {
  background: none;
  border: none;
  color: var(--walnut);
  opacity: 0.6;
  padding: 0.3rem 0.45rem 0.2rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  border-radius: 4px;
  transition: color 0.15s, opacity 0.15s, transform 0.15s;
}
.report-btn:hover { color: #b04b3a; opacity: 1; }
.report-btn:active { transform: scale(0.92); }
.report-btn svg { display: block; }

/* NSFW-mismark flag icon button — same visual weight as the report flag,
   but warns in amber/orange to signal a different action (mistagged photo,
   not a copyright/consent claim). Hidden by default via .hidden utility. */
.nsfw-flag-btn {
  background: none;
  border: none;
  color: #c47e1a;
  opacity: 0.75;
  padding: 0.3rem 0.45rem 0.2rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  border-radius: 4px;
  transition: color 0.15s, opacity 0.15s, transform 0.15s;
}
.nsfw-flag-btn:hover { color: #e28e1a; opacity: 1; }
.nsfw-flag-btn:active { transform: scale(0.92); }
.nsfw-flag-btn:disabled { opacity: 0.35; cursor: wait; }
.nsfw-flag-btn svg { display: block; }

/* Report modal */
.report-modal {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.report-modal.hidden { display: none; }
.report-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
}
.report-modal-card {
  position: relative;
  background: var(--paper, #f8f4ec);
  color: var(--walnut);
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  max-width: 560px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  padding: 1.5rem 1.6rem;
}
.report-modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  background: none;
  border: none;
  font-size: 1.8rem;
  line-height: 1;
  color: var(--walnut);
  cursor: pointer;
  opacity: 0.7;
}
.report-modal-close:hover { opacity: 1; }
.report-modal-card h2 {
  margin: 0 0 0.3rem;
  font-size: 1.35rem;
}
.report-modal-sub {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  color: var(--text-muted, #6a5a47);
}
.report-field {
  margin-bottom: 0.9rem;
  display: flex;
  flex-direction: column;
}
.report-field label {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.report-field input[type="text"],
.report-field input[type="email"],
.report-field input[type="file"],
.report-field select,
.report-field textarea {
  padding: 0.5rem 0.6rem;
  border: 1px solid rgba(92, 64, 51, 0.25);
  border-radius: 4px;
  background: #fff;
  color: var(--walnut);
  font: inherit;
  font-size: 0.9rem;
}
.report-field textarea { resize: vertical; min-height: 90px; }
.report-field-help {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.78rem;
  color: var(--text-muted, #6a5a47);
}
.report-captcha-row input { max-width: 160px; }

/* Honeypot field – hidden from real users, visible to bots */
.report-honeypot,
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.report-form-error {
  padding: 0.55rem 0.7rem;
  background: rgba(192, 57, 43, 0.1);
  border-left: 3px solid #c0392b;
  color: #8a2820;
  font-size: 0.85rem;
  border-radius: 4px;
  margin-bottom: 0.7rem;
}
.report-form-error.hidden { display: none; }
.report-form-success {
  padding: 0.55rem 0.7rem;
  background: rgba(46, 125, 50, 0.1);
  border-left: 3px solid #2e7d32;
  color: #1b5e20;
  font-size: 0.85rem;
  border-radius: 4px;
  margin-bottom: 0.7rem;
}
.report-form-success.hidden { display: none; }

.report-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 0.5rem;
}
.report-btn-cancel,
.report-btn-submit {
  padding: 0.55rem 1rem;
  border-radius: 4px;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  border: 1px solid rgba(92, 64, 51, 0.35);
  background: #fff;
  color: var(--walnut);
}
.report-btn-submit {
  background: var(--walnut);
  color: #fff;
  border-color: var(--walnut);
}
.report-btn-submit:hover { opacity: 0.9; }
.report-btn-submit:disabled { opacity: 0.6; cursor: not-allowed; }

/* Reports admin panel (settings page) */
.reports-pending-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.4rem;
  padding: 0 0.45rem;
  height: 1.4rem;
  margin-left: 0.5rem;
  background: #c0392b;
  color: #fff;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  vertical-align: middle;
}
.reports-pending-badge.hidden { display: none; }
.reports-filter-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.9rem;
  flex-wrap: wrap;
}
.reports-filter-row label { font-size: 0.85rem; font-weight: 600; }
.reports-filter-row select {
  padding: 0.4rem 0.55rem;
  border: 1px solid rgba(92, 64, 51, 0.25);
  border-radius: 4px;
  background: #fff;
  color: var(--walnut);
}
.reports-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.report-card {
  display: flex;
  gap: 1rem;
  padding: 0.9rem;
  border: 1px solid rgba(92, 64, 51, 0.2);
  border-radius: 6px;
  background: #fff;
}
.report-card-left { flex: 0 0 auto; }
.report-card-thumb {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 4px;
  background: #eee;
  display: block;
}
.report-card-thumb-missing {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted, #6a5a47);
  font-size: 0.8rem;
  text-align: center;
  padding: 0.5rem;
}
.report-card-body { flex: 1 1 auto; min-width: 0; }
.report-card-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.4rem;
}
.report-card-category {
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.report-cat-copyright { background: #fde8e6; color: #8a2820; }
.report-cat-model_consent { background: #fff4d6; color: #8a6b10; }
.report-cat-other { background: #e2eaf3; color: #2a4663; }
.report-cat-nsfw_mismark { background: #ffe7c2; color: #7a4a05; }
.report-card-block-warning {
  margin: 0.3rem 0 0.4rem;
  padding: 0.4rem 0.6rem;
  background: #fff2e0;
  border-left: 3px solid #c47e1a;
  color: #7a4a05;
  font-size: 0.85rem;
  border-radius: 3px;
}
.report-card-status {
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.report-status-pending { background: #fff0c2; color: #6b5300; }
.report-status-resolved { background: #d8f1dc; color: #1b5e20; }
.report-status-dismissed { background: #e5e5e5; color: #555; }
.report-card-date {
  font-size: 0.75rem;
  color: var(--text-muted, #6a5a47);
  margin-left: auto;
}
.report-card-owner {
  font-size: 0.8rem;
  color: var(--text-muted, #6a5a47);
  margin-bottom: 0.25rem;
}
.report-card-reporter {
  font-size: 0.85rem;
  margin-bottom: 0.35rem;
}
.report-card-details {
  font-size: 0.88rem;
  line-height: 1.45;
  white-space: pre-wrap;
  margin-bottom: 0.6rem;
  color: var(--walnut);
}
.report-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}
.report-card-proof {
  padding: 0.35rem 0.7rem;
  background: var(--walnut);
  color: #fff;
  border-radius: 4px;
  font-size: 0.8rem;
  text-decoration: none;
}
.report-card-proof:hover { opacity: 0.9; }
.report-card-no-proof {
  font-size: 0.8rem;
  color: var(--text-muted, #6a5a47);
  font-style: italic;
}
.report-card-actions .settings-btn {
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
}
