/* ═══════════════════════════════════════════════════════════════════
   One Piece Gallery - Main Stylesheet
   Theme: Dark nautical / pirate aesthetic
   ═══════════════════════════════════════════════════════════════════ */

/* ─── CSS Variables ──────────────────────────────────────────────── */
:root {
  --bg-primary:    #ffffff;
  --bg-secondary:  #f6f8fa;
  --bg-card:       #ffffff;
  --bg-hover:      #f0f2f5;
  --border:        #e1e4e8;
  --border-light:  #d0d7de;

  --text-primary:  #1a1a2e;
  --text-secondary:#57606a;
  --text-muted:    #8c959f;

  --accent:        #4a90d9;   /* Blue */
  --accent-hover:  #3a7bc8;
  --accent-dark:   #2d6aa8;
  --danger:        #cf222e;
  --danger-hover:  #a40e26;
  --success:       #1a7f37;

  --navbar-height: 60px;
  --radius:        8px;
  --radius-lg:     12px;
  --shadow:        0 4px 16px rgba(0,0,0,0.08);
  --shadow-card:   0 1px 4px rgba(0,0,0,0.08);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

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

img { max-width: 100%; display: block; }

/* ─── Navbar ─────────────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--navbar-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 24px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.1rem;
  white-space: nowrap;
}
.brand-icon { font-size: 1.4rem; }

.navbar-links {
  display: flex;
  gap: 4px;
  flex: 1;
}

.nav-link {
  padding: 6px 14px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: background 0.15s, color 0.15s;
}
.nav-link:hover, .nav-link.active {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.nav-link.active { color: var(--accent); }

.navbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}
.nav-username { color: var(--text-secondary); font-size: 0.9rem; }
.nav-logout { font-size: 0.85rem; }

/* ─── Buttons ────────────────────────────────────────────────────── */
button { cursor: pointer; border: none; outline: none; font-family: inherit; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  transition: background 0.15s, transform 0.1s;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { transform: scale(0.97); }

.btn-secondary {
  background: var(--bg-hover);
  color: var(--text-primary);
  padding: 8px 18px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  border: 1px solid var(--border);
  transition: background 0.15s;
}
.btn-secondary:hover { background: var(--border); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  border: 1px solid var(--border);
  transition: background 0.15s, color 0.15s;
}
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }

.btn-sm {
  background: var(--bg-hover);
  color: var(--text-primary);
  padding: 5px 12px;
  border-radius: var(--radius);
  font-size: 0.82rem;
  border: 1px solid var(--border);
}
.btn-sm:hover { background: var(--border); }

.btn-full { width: 100%; }

.btn-icon {
  background: transparent;
  border: none;
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-icon:hover { background: var(--bg-hover); }
.btn-icon.btn-danger:hover { background: rgba(218,54,51,0.15); }
.btn-icon-placeholder { display: inline-block; width: 30px; }

/* ─── Main Content ───────────────────────────────────────────────── */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

/* ─── Page Header ────────────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-title { font-size: 1.4rem; font-weight: 700; color: var(--text-primary); }
.page-desc { color: var(--text-secondary); font-size: 0.9rem; margin-top: 4px; }

/* ─── Filter Bar ─────────────────────────────────────────────────── */
.filter-bar {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  margin-bottom: 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.filter-label { color: var(--text-muted); font-size: 0.85rem; white-space: nowrap; }
.filter-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; flex: 1; }

.filter-chip {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.15s;
}
.filter-chip:hover { border-color: var(--accent); color: var(--accent); }
.filter-chip.active {
  background: #D3E3FD;
  color: var(--accent-dark);
  border-color: var(--accent);
  font-weight: 600;
}

.filter-mode { display: flex; align-items: center; gap: 6px; }
.filter-mode-label { color: var(--text-muted); font-size: 0.82rem; }
.mode-btn {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.mode-btn.active { background: #D3E3FD; color: var(--accent-dark); border-color: var(--accent); }

/* ─── Timeline ───────────────────────────────────────────────────── */
.timeline-container {
  position: relative;
}

/* Vertical axis line */
.timeline-container::before {
  content: '';
  position: absolute;
  left: 56px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
  z-index: 0;
}

.timeline-section {
  margin-bottom: 36px;
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0;
}

/* Left axis: episode number */
.timeline-axis {
  flex-shrink: 0;
  width: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 4px;
  position: relative;
  z-index: 1;
}

.timeline-axis-num {
  width: 40px;
  height: 40px;
  background: #D3E3FD;
  color: var(--accent-dark);
  font-weight: 700;
  font-size: 0.82rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 3px var(--bg-primary), 0 0 0 5px #D3E3FD;
  line-height: 1.1;
  text-align: center;
}

/* Right content area */
.timeline-body {
  flex: 1;
  min-width: 0;
  padding-left: 20px;
}

.timeline-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.timeline-heading h3 { font-size: 1rem; font-weight: 600; color: var(--text-primary); }
.timeline-count { color: var(--text-muted); font-size: 0.82rem; margin-left: auto; }

/* ─── Waterfall Layout ───────────────────────────────────────────── */
.waterfall {
  columns: 4 220px;
  column-gap: 12px;
}

.shot-card {
  break-inside: avoid;
  margin-bottom: 12px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  transition: transform 0.2s, box-shadow 0.2s;
}
.shot-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.shot-img-wrap { position: relative; cursor: pointer; }
.shot-img {
  width: 100%;
  height: auto;
  display: block;
  /* Placeholder background while loading */
  background: var(--bg-hover);
  min-height: 80px;
}

.shot-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.75));
  padding: 20px 8px 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s;
}
.shot-card:hover .shot-overlay { opacity: 1; }

.shot-meta {
  padding: 6px 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.delete-btn {
  position: absolute;
  top: 6px; right: 6px;
  background: rgba(0,0,0,0.6);
  border: none;
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 0.85rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
}
.shot-card:hover .delete-btn { opacity: 1; }
.delete-btn:hover { background: var(--danger); }

/* ─── Tag Chips ──────────────────────────────────────────────────── */
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #D3E3FD;
  color: var(--accent-dark);
  border: 1px solid #b3cef5;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 500;
}
.tag-chip button {
  background: none;
  border: none;
  color: var(--accent-dark);
  cursor: pointer;
  padding: 0;
  font-size: 0.9rem;
  line-height: 1;
}

.tag-chip-sm {
  background: #D3E3FD;
  color: var(--accent-dark);
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 0.72rem;
}

/* ─── Hints ──────────────────────────────────────────────────────── */
.loading-placeholder, .empty-hint {
  text-align: center;
  color: var(--text-muted);
  padding: 48px 0;
  font-size: 0.95rem;
}
.load-more-hint, .end-hint {
  text-align: center;
  color: var(--text-muted);
  padding: 16px 0;
  font-size: 0.85rem;
}

/* ─── Modal ──────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.modal-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
}
.modal-sm { max-width: 360px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 1rem; font-weight: 600; }
.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}
.modal-close:hover { color: var(--text-primary); background: var(--bg-hover); }

/* ─── Forms ──────────────────────────────────────────────────────── */
.form-group {
  padding: 12px 20px 0;
}
.form-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}
.required { color: var(--danger); }

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="password"],
.form-group input[type="file"] {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  padding: 8px 12px;
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color 0.15s;
}
.form-group input:focus { outline: none; border-color: var(--accent); }

.radio-group { display: flex; gap: 16px; }
.radio-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-primary);
}
.radio-label input { accent-color: var(--accent); }

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 20px;
}

.form-message {
  min-height: 20px;
  font-size: 0.82rem;
  padding: 4px 20px;
}
.form-message.error { color: var(--danger); }
.form-message.success { color: var(--success); }

/* Tag selector in upload modal */
.tag-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.tag-chip-toggle {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.15s;
}
.tag-chip-toggle:hover { border-color: var(--accent); color: var(--accent); }
.tag-chip-toggle.active { background: #D3E3FD; color: var(--accent-dark); border-color: var(--accent); font-weight: 600; }

.tag-input-row {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}
.tag-input-row input {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  padding: 6px 10px;
  font-size: 0.85rem;
  font-family: inherit;
}
.tag-input-row input:focus { outline: none; border-color: var(--accent); }

.selected-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  min-height: 28px;
}
.no-tags-hint { color: var(--text-muted); font-size: 0.8rem; }

.file-preview { margin-top: 6px; }

/* ─── Lightbox ───────────────────────────────────────────────────── */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 300;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.lightbox-content {
  max-width: 90vw;
  width: 100%;
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

#lightbox-img {
  max-width: 85vw;
  max-height: 75vh;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.lightbox-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.lightbox-tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.lightbox-meta {
  display: flex;
  gap: 16px;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.lightbox-close {
  position: fixed;
  top: 16px; right: 20px;
  background: rgba(255,255,255,0.1);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 36px; height: 36px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.15s;
  z-index: 301;
}
.lightbox-close:hover { background: rgba(255,255,255,0.2); }

.lightbox-prev, .lightbox-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.1);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 44px; height: 44px;
  font-size: 1.6rem;
  cursor: pointer;
  transition: background 0.15s;
  z-index: 301;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }
.lightbox-prev:hover, .lightbox-next:hover { background: rgba(255,255,255,0.2); }

/* ─── Tags Page ──────────────────────────────────────────────────── */
.tags-page { max-width: 700px; }

.tag-add-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
}
.tag-add-bar input {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  padding: 8px 14px;
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color 0.15s;
}
.tag-add-bar input:focus { outline: none; border-color: var(--accent); }

.tag-list-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-top: 16px;
}
.tag-list-header {
  display: grid;
  grid-template-columns: 1fr 100px 90px;
  padding: 10px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.tag-list-row {
  display: grid;
  grid-template-columns: 1fr 100px 90px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  align-items: center;
  transition: background 0.15s;
}
.tag-list-row:last-child { border-bottom: none; }
.tag-list-row:hover { background: var(--bg-hover); }
.tag-list-name { display: flex; align-items: center; }
.tag-list-type { font-size: 0.82rem; }
.tag-list-actions { display: flex; gap: 4px; }

.badge-preset {
  background: #D3E3FD;
  color: var(--accent-dark);
  border: 1px solid #b3cef5;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
}
.badge-custom {
  background: var(--bg-hover);
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
}

/* ─── Auth Page ──────────────────────────────────────────────────── */
.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg-primary);
}

.auth-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow);
}

.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}
.brand-icon-lg { font-size: 3rem; display: block; margin-bottom: 8px; }
.auth-logo h1 { font-size: 1.4rem; color: var(--accent); font-weight: 700; }
.auth-logo p { color: var(--text-muted); font-size: 0.85rem; margin-top: 4px; }

/* Mastodon section */
.mastodon-section { margin-bottom: 16px; }
.mastodon-label { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 8px; text-align: center; }
.mastodon-form { display: flex; gap: 8px; }
.mastodon-form input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-card);
  outline: none;
  transition: border-color 0.15s;
}
.mastodon-form input:focus { border-color: #6364ff; }
.btn-mastodon {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #6364ff;
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.btn-mastodon:hover { background: #5253e0; }

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 14px;
  color: var(--text-muted);
  font-size: 0.78rem;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-light);
}

.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.auth-tab {
  flex: 1;
  background: none;
  border: none;
  padding: 10px;
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  font-family: inherit;
}
.auth-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.auth-form .form-group { padding: 0 0 14px; }
.auth-form .form-group input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  padding: 10px 14px;
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color 0.15s;
}
.auth-form .form-group input:focus { outline: none; border-color: var(--accent); }
.auth-form .form-message { padding: 0 0 10px; }
.auth-form .btn-primary { margin-top: 4px; padding: 10px; font-size: 0.95rem; }

/* ─── Floating Upload Button ─────────────────────────────────────── */
.fab-upload {
  position: fixed;
  right: 28px;
  bottom: 32px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 1.6rem;
  font-weight: 300;
  border: none;
  box-shadow: 0 4px 16px rgba(74,144,217,0.35);
  cursor: pointer;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
  line-height: 1;
}
.fab-upload:hover {
  background: var(--accent-hover);
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(74,144,217,0.45);
}

/* ─── Upload Drop Zone ───────────────────────────────────────────── */
.upload-modal-box { max-width: 560px; }

.upload-dropzone {
  margin: 16px 20px 0;
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-lg);
  background: var(--bg-secondary);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
  overflow: hidden;
}
.upload-dropzone:hover, .upload-dropzone.drag-over {
  border-color: var(--accent);
  background: #eef4fd;
}
.dropzone-inner {
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}
.dropzone-icon { font-size: 2.2rem; }
.dropzone-text { font-size: 0.9rem; color: var(--text-secondary); }
.dropzone-link { color: var(--accent); text-decoration: underline; cursor: pointer; }
.dropzone-hint { font-size: 0.78rem; color: var(--text-muted); }
.dropzone-preview {
  width: 100%;
  max-height: 180px;
  object-fit: contain;
  display: block;
  border-radius: var(--radius);
}

.upload-form-body { padding: 0 0 4px; }
.upload-row { display: flex; gap: 0; }
.upload-half { flex: 1; }

/* ─── Lightbox Edit Panel ────────────────────────────────────────── */
.lightbox-edit-panel {
  background: rgba(255,255,255,0.95);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  min-width: 280px;
  max-width: 420px;
  box-shadow: var(--shadow);
  color: var(--text-primary);
}
.lightbox-edit-panel .ep-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.lightbox-edit-panel .ep-label { font-size: 0.82rem; color: var(--text-muted); white-space: nowrap; }
.lightbox-edit-panel input[type=number] {
  width: 80px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-card);
}
.lightbox-edit-panel input[type=number]:focus { outline: none; border-color: var(--accent); }
.lightbox-edit-panel .type-toggle {
  display: flex;
  gap: 6px;
}
.lightbox-edit-panel .type-btn {
  padding: 3px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.15s;
}
.lightbox-edit-panel .type-btn.active {
  background: #D3E3FD;
  color: var(--accent-dark);
  border-color: var(--accent);
  font-weight: 600;
}
.lightbox-edit-panel .tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.lightbox-edit-panel .save-row {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}
.lightbox-edit-panel .meta-row {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

/* ─── Upload drag & drop ─────────────────────────────────────────── */
.modal-box.drag-over {
  border: 2px dashed var(--accent);
  background: rgba(74,144,217,0.04);
}

/* ─── Auth Page ──────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 22px;
  border-radius: 24px;
  font-size: 0.88rem;
  font-weight: 500;
  z-index: 500;
  box-shadow: var(--shadow);
  pointer-events: none;
}
.toast-success { background: var(--success); color: #000; }
.toast-error   { background: var(--danger);  color: #fff; }

/* ─── Scrollbar ──────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ─── Comment Bubble (hover on card) ────────────────────────────── */
.shot-img-wrap { position: relative; }
.comment-bubble {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(20, 20, 30, 0.82);
  color: #fff;
  padding: 8px 10px;
  z-index: 20;
  pointer-events: none;
  backdrop-filter: blur(2px);
}
.comment-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.comment-item:last-child { border-bottom: none; }
.comment-user { font-size: 0.72rem; color: var(--accent); font-weight: 600; }
.comment-text { font-size: 0.8rem; line-height: 1.4; word-break: break-all; }

/* ─── Lightbox Comment Section ───────────────────────────────────── */
.comment-section {
  margin-top: 14px;
  border-top: 1px solid var(--border-light);
  padding-top: 12px;
}
.comment-list {
  max-height: 160px;
  overflow-y: auto;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.no-comments, .comment-loading {
  color: var(--text-muted);
  font-size: 0.82rem;
  text-align: center;
  padding: 8px 0;
}
.lb-comment-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 8px;
  background: var(--bg-hover);
  border-radius: var(--radius);
  border-left: 3px solid var(--border);
}
.lb-comment-item.mine { border-left-color: var(--accent); }
.lb-comment-user { font-size: 0.75rem; color: var(--accent); font-weight: 600; }
.lb-comment-text { font-size: 0.85rem; color: var(--text-primary); line-height: 1.4; word-break: break-all; }
.lb-comment-time { font-size: 0.72rem; color: var(--text-muted); }
.comment-input-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.comment-input-row textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-family: inherit;
  resize: none;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.comment-input-row textarea:focus { border-color: var(--accent); }
.comment-input-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ─── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .navbar { padding: 0 14px; gap: 12px; }
  .brand-text { display: none; }
  .nav-link { padding: 6px 10px; font-size: 0.82rem; }
  .main-content { padding: 16px 12px 48px; }
  .waterfall { columns: 2 140px; column-gap: 8px; }
  .shot-overlay { opacity: 1; }
  .delete-btn { opacity: 1; }
  .lightbox-prev { left: 6px; }
  .lightbox-next { right: 6px; }
  #lightbox-img { max-width: 95vw; max-height: 65vh; }
  .tag-list-header, .tag-list-row { grid-template-columns: 1fr 80px 70px; }
  .auth-container { padding: 28px 20px; }
  .timeline-container::before { left: 40px; }
  .timeline-axis { width: 40px; }
  .timeline-axis-num { width: 32px; height: 32px; font-size: 0.72rem; }
  .timeline-body { padding-left: 12px; }
}

@media (max-width: 480px) {
  .waterfall { columns: 2 120px; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .filter-bar { padding: 10px 12px; }
}
