/* ═══════════════════════════════════════════════════════════════════════════
   Family Album V3 — Global Stylesheet
   Background: #04020C   Accent: #7C3AED   Amber: #92400E   Green: #14532D
   ═══════════════════════════════════════════════════════════════════════════ */

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

:root {
  --bg:         #04020C;
  --bg-raised:  #0d0a1a;
  --bg-card:    #110e1f;
  --purple:     #7C3AED;
  --purple-lt:  #a78bfa;
  --purple-dim: #2e1a5e;
  --amber-bg:   #3a1f00;
  --amber-text: #fbbf24;
  --amber-border:#92400E;
  --green-bg:   #052010;
  --green-text: #4ade80;
  --green-border:#14532D;
  --text:       #e2e0ec;
  --text-muted: #6b6882;
  --border:     #1e1a30;
  --radius:     8px;
  --radius-lg:  12px;
  --transition: 0.25s ease;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
}

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

/* ── Typography ────────────────────────────────────────────────────────────── */
h1, h2, h3 { font-weight: 600; letter-spacing: -0.01em; }
a          { color: var(--purple-lt); text-decoration: none; }
a:hover    { color: var(--purple); }

/* ══════════════════════════════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 20px;
  border: 1.5px solid transparent;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
  white-space: nowrap;
  user-select: none;
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Primary — filled purple */
.btn-primary {
  background: var(--purple);
  color: #fff;
  border-color: var(--purple);
}
.btn-primary:hover { background: #6d28d9; border-color: #6d28d9; }

/* Outline purple */
.btn-outline {
  background: transparent;
  color: var(--purple-lt);
  border-color: var(--purple);
}
.btn-outline:hover { background: var(--purple-dim); }

/* Trim In — green outline */
.btn-trim-in {
  background: transparent;
  color: var(--green-text);
  border-color: var(--green-border);
}
.btn-trim-in:hover, .btn-trim-in.active { background: var(--green-bg); }

/* Trim Out — amber outline */
.btn-trim-out {
  background: transparent;
  color: var(--amber-text);
  border-color: var(--amber-border);
}
.btn-trim-out:hover, .btn-trim-out.active { background: var(--amber-bg); }

/* Ghost — subtle */
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
}
.btn-ghost:hover { color: var(--text); background: var(--bg-raised); }

/* Danger */
.btn-danger {
  background: #450a0a;
  color: #fca5a5;
  border-color: #7f1d1d;
}
.btn-danger:hover { background: #7f1d1d; }

/* ══════════════════════════════════════════════════════════════════════════════
   ADMIN LAYOUT
   ══════════════════════════════════════════════════════════════════════════════ */
#admin-wrapper {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ── Nav bar ───────────────────────────────────────────────────────────────── */
#admin-nav {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 54px;
  padding: 0 20px;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
  z-index: 10;
}

#nav-logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

#nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  padding: 6px 8px;
  border-radius: 6px;
  transition: background var(--transition);
  color: var(--text-muted);
}
.nav-icon-btn:hover { background: var(--bg-card); color: var(--text); }

/* ── Control bar ───────────────────────────────────────────────────────────── */
#control-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 48px;
  padding: 0 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

#year-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
}

#year-display {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  min-width: 44px;
  text-align: center;
}

.year-arrow {
  background: none;
  border: 1.5px solid var(--border);
  color: var(--purple-lt);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: background var(--transition), border-color var(--transition);
}
.year-arrow:hover { background: var(--purple-dim); border-color: var(--purple); }

/* ── Wheel section ─────────────────────────────────────────────────────────── */
#wheel-section {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

#wheel-container {
  flex: 0 0 460px;
  height: 460px;
  overflow: hidden;
  display: flex;
  align-items: center;
  position: relative;
  cursor: grab;
}

#wheel-track {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 48px;
  will-change: transform;
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  cursor: grab;
}

/* ── Photo cards ───────────────────────────────────────────────────────────── */
.photo-card {
  flex: 0 0 190px;
  height: 260px;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  opacity: 0.55;
  transition:
    flex-basis 0.3s ease,
    height 0.3s ease,
    opacity 0.3s ease,
    box-shadow 0.3s ease;
  position: relative;
  background: var(--bg-card);
  border: 1.5px solid transparent;
  cursor: grab;
}

.photo-card:hover {
  opacity: 0.75;
}

.photo-card.active {
  flex: 0 0 340px;
  height: 410px;
  opacity: 1;
  border-color: var(--purple);
  box-shadow: 0 0 0 1px var(--purple), 0 8px 32px rgba(124, 58, 237, 0.25);
}

/* Trim range highlight */
.photo-card.in-range {
  border-color: rgba(124, 58, 237, 0.4);
  opacity: 0.8;
}

/* Trashed photo card */
.photo-card.trashed {
  opacity: 0.4;
  border-color: #7f1d1d;
}
.photo-card.trashed.active {
  opacity: 0.7;
  border-color: #ef4444;
  box-shadow: 0 0 0 1px #ef4444, 0 8px 32px rgba(239,68,68,0.2);
}

.card-trash-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(127,29,29,0.85);
  color: #fca5a5;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 20px;
  pointer-events: none;
  backdrop-filter: blur(4px);
}

.card-pearl-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(124, 58, 237, 0.85);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 20px;
  pointer-events: none;
  backdrop-filter: blur(4px);
}

.card-footer.trashed {
  background: #1a0a0a;
  border-top-color: #7f1d1d;
}
.card-footer.trashed .card-date { color: #fca5a5; }

.card-thumb {
  flex: 1 1 0;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-card);
  transition: background-image 0.2s ease;
}

.card-footer {
  flex: 0 0 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  background: var(--amber-bg);
  border-top: 1px solid var(--amber-border);
}

.card-footer.published {
  background: var(--green-bg);
  border-top-color: var(--green-border);
}

.card-date {
  font-size: 12px;
  font-weight: 500;
  color: var(--amber-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-footer.published .card-date {
  color: var(--green-text);
}

.card-tag-btn {
  background: none;
  border: 1px solid var(--amber-border);
  color: var(--amber-text);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
  transition: background var(--transition);
}
.card-tag-btn:hover { background: rgba(251,191,36,0.15); }
.card-footer.published .card-tag-btn {
  border-color: var(--green-border);
  color: var(--green-text);
}
.card-footer.published .card-tag-btn:hover { background: rgba(74,222,128,0.15); }

.wheel-empty {
  color: var(--text-muted);
  font-size: 15px;
  text-align: center;
  width: 100%;
  padding: 40px;
}

/* ── Scrub bar ─────────────────────────────────────────────────────────────── */
#scrub-wrap {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  height: 38px;
  background: var(--bg-raised);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 0 4px;
  gap: 4px;
}

.scrub-arrow {
  background: none;
  border: none;
  color: var(--purple-lt);
  cursor: pointer;
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 4px;
  transition: background var(--transition);
  flex-shrink: 0;
}
.scrub-arrow:hover { background: var(--purple-dim); }

#scrub-track {
  flex: 1 1 0;
  height: 100%;
  position: relative;
  cursor: pointer;
  display: flex;
  align-items: center;
}

#scrub-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Anime tracking eyes — floated over the canvas, centred */
#scrub-eyes {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;   /* clicks pass through to canvas */
  z-index: 2;
  /* allow lashes to overflow the scrub bar */
  overflow: visible;
}

.scrub-eye {
  display: block;
  flex-shrink: 0;
  overflow: visible;      /* lashes extend above the SVG bounds */
}

/* ── Detail panel ──────────────────────────────────────────────────────────── */
#detail-panel {
  flex: 1 1 0;
  display: flex;
  align-items: stretch;
  overflow: hidden;
  background: var(--bg);
}

.detail-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  color: var(--text-muted);
  font-size: 13px;
}

.detail-content {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  width: 100%;
  padding: 16px 24px;
  overflow-y: auto;
}

.detail-left {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 220px;
}

.detail-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.detail-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.detail-input {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 10px;
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color var(--transition);
  width: 100%;
}
.detail-input:focus { border-color: var(--purple); }

.detail-date-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 10px;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  transition: border-color var(--transition), background var(--transition);
  white-space: nowrap;
}
.detail-date-btn:hover    { border-color: var(--purple); background: var(--bg-raised); }
.detail-date-btn.has-date { color: var(--purple-lt); border-color: var(--purple-dim); }

/* Tags section in detail panel */
.detail-tags-section {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.detail-tags-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 10px;
  min-height: 36px;
  transition: border-color var(--transition);
}
.detail-tags-wrap:focus-within { border-color: var(--purple); }

.detail-tag-input {
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 12px;
  min-width: 80px;
  flex: 1 1 auto;
  padding: 0;
}
.detail-tag-input::placeholder { color: var(--text-muted); }

/* Right actions column */
.detail-right {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
  min-width: 130px;
}

.detail-publish-btn {
  font-size: 12px;
  padding: 7px 14px;
  justify-content: center;
}
.detail-publish-btn.published {
  background: var(--green-bg);
  color: var(--green-text);
  border-color: var(--green-border);
}
.detail-publish-btn.unpublished {
  background: var(--amber-bg);
  color: var(--amber-text);
  border-color: var(--amber-border);
}

.detail-trash-btn {
  font-size: 12px;
  padding: 7px 14px;
  justify-content: center;
}

/* ── Date popover ───────────────────────────────────────────────────────────── */
.date-popover {
  position: absolute;
  z-index: 500;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  width: 220px;
}

/* ── Batch actions bar ─────────────────────────────────────────────────────── */
#batch-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding-left: 12px;
  border-left: 1px solid var(--border);
}

.batch-label {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.batch-btn {
  font-size: 12px;
  padding: 5px 12px;
}

/* ── Jam panel ─────────────────────────────────────────────────────────────── */
#jam-panel {
  position: fixed;
  top: 0;
  right: -420px;
  width: 400px;
  height: 100vh;
  background: var(--bg-raised);
  border-left: 1px solid var(--border);
  z-index: 200;
  display: flex;
  flex-direction: column;
  transition: right 0.3s ease;
  overflow: hidden;
}
#jam-panel.open { right: 0; }

.jam-file-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.jam-file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.jam-file-item.done  { border-color: var(--green-border); color: var(--green-text); }
.jam-file-item.error { border-color: #7f1d1d; color: #fca5a5; }

.jam-progress-text {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  padding: 8px 0;
}

/* ══════════════════════════════════════════════════════════════════════════════
   LIGHTBOX
   ══════════════════════════════════════════════════════════════════════════════ */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 2, 12, 0.96);
  z-index: 800;
  display: flex;
  flex-direction: column;
}

.lightbox-body {
  flex: 1 1 0;
  display: flex;
  gap: 24px;
  padding: 24px 24px 0;
  overflow: hidden;
  min-height: 0;
}

/* ── Left column ── */
.lb-left {
  flex: 0 0 240px;
  display: flex;
  flex-direction: column;
}

.lb-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.lb-date-label  { margin-top: 20px; }
.lb-tags-label  { margin-top: 16px; }

.lb-title-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  resize: none;
  outline: none;
  min-height: 90px;
  transition: border-color var(--transition);
  font-family: inherit;
}
.lb-title-input:focus { border-color: var(--purple); }

.lb-date-display {
  font-size: 13px;
  color: var(--text-muted);
}

/* ── Center column ── */
.lb-center {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  position: relative;
  min-width: 0;
  overflow: hidden;
}

.lb-photo-wrap {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 0 60px;
  overflow: hidden;
}

.lb-photo {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius);
  display: block;
}

.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--purple-dim);
  background: rgba(124, 58, 237, 0.15);
  color: var(--purple-lt);
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  flex-shrink: 0;
  transition: background var(--transition), border-color var(--transition);
}
.lb-nav:hover    { background: var(--purple-dim); border-color: var(--purple); }
.lb-nav:disabled { opacity: 0.2; cursor: not-allowed; }
.lb-prev { left: 0; }
.lb-next { right: 0; }

/* ── Right column ── */
.lb-right {
  flex: 0 0 220px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.lb-tags-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
  min-height: 24px;
}

.lb-tag-input-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.lb-tag-input {
  flex: 1 1 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 10px;
  color: var(--text);
  font-size: 12px;
  outline: none;
  transition: border-color var(--transition);
  font-family: inherit;
}
.lb-tag-input:focus { border-color: var(--purple); }

.lb-tag-add-btn {
  width: 30px;
  height: 30px;
  border-radius: var(--radius);
  border: none;
  background: var(--purple);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--transition);
}
.lb-tag-add-btn:hover { background: #6d28d9; }

/* Mobile-only close button — hidden by default, shown inside @media (max-width: 768px) */
/* Mobile-only elements — hidden on desktop */
#lb-close-mobile         { display: none; }
#lb-darkener             { display: none; }
#lb-mobile-top           { display: none; }
#lb-whomdis-mobile-toggle { display: none; }
#lb-whomdis-sheet        { max-height: 0; overflow: hidden; }

/* Desktop: lb-mobile-bottom is a plain flex column child of the lightbox */
#lb-mobile-bottom {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
}

/* ── Action bar ── */
.lb-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: rgba(4, 2, 12, 0.8);
}

/* Publish / Unpublish button states */
.lb-publish-btn.state-publish {
  background: var(--green-bg);
  color: var(--green-text);
  border-color: var(--green-border);
}
.lb-publish-btn.state-publish:hover { background: #052010; }

.lb-publish-btn.state-unpublish {
  background: var(--amber-bg);
  color: var(--amber-text);
  border-color: var(--amber-border);
}
.lb-publish-btn.state-unpublish:hover { background: #4a2500; }

/* ══════════════════════════════════════════════════════════════════════════════
   LOGIN OVERLAY
   ══════════════════════════════════════════════════════════════════════════════ */
#login-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.login-box {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  width: 340px;
}

.login-box h1 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
}

.login-subtitle {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 28px;
}

.form-field {
  margin-bottom: 16px;
}

.form-field label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-field input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 12px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition);
}
.form-field input:focus { border-color: var(--purple); }

.login-error {
  color: #fca5a5;
  font-size: 13px;
  margin-bottom: 14px;
  display: none;
}

.login-btn {
  width: 100%;
  justify-content: center;
  padding: 10px;
  margin-top: 4px;
}

/* ══════════════════════════════════════════════════════════════════════════════
   ADD PHOTOS PANEL
   ══════════════════════════════════════════════════════════════════════════════ */
#add-panel {
  position: fixed;
  top: 0;
  right: -420px;
  width: 400px;
  height: 100vh;
  background: var(--bg-raised);
  border-left: 1px solid var(--border);
  z-index: 200;
  display: flex;
  flex-direction: column;
  transition: right 0.3s ease;
  overflow: hidden;
}

#add-panel.open { right: 0; }

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.panel-header h2 {
  font-size: 16px;
  font-weight: 600;
}

.panel-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color var(--transition);
}
.panel-close:hover { color: var(--text); }

.panel-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.panel-tab {
  flex: 1;
  padding: 11px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}
.panel-tab.active {
  color: var(--purple-lt);
  border-bottom-color: var(--purple);
}

.panel-body {
  flex: 1 1 0;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Drop zone */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--purple);
  background: rgba(124, 58, 237, 0.06);
}
.drop-zone-icon { font-size: 32px; margin-bottom: 8px; }
.drop-zone-text { color: var(--text-muted); font-size: 13px; }
.drop-zone-text span {
  color: var(--purple-lt);
  cursor: pointer;
  text-decoration: underline;
}
.drop-zone-preview {
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

/* Tag pills in add panel */
.tag-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--purple-dim);
  color: var(--purple-lt);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition);
  user-select: none;
}
.tag-pill:hover { background: var(--purple); color: #fff; }
.tag-pill.active { background: var(--purple); color: #fff; }
.tag-pill .pill-x {
  font-size: 14px;
  line-height: 1;
  opacity: 0.6;
}

/* Panel form fields */
.panel-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.panel-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color var(--transition);
}
.panel-input:focus { border-color: var(--purple); }

.panel-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
}

/* Upload progress */
.upload-progress {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  padding: 8px 0;
}

/* ══════════════════════════════════════════════════════════════════════════════
   MINI CALENDAR
   ══════════════════════════════════════════════════════════════════════════════ */
.mini-cal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  user-select: none;
}

.mini-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
}

.mini-cal-nav {
  background: none;
  border: none;
  color: var(--purple-lt);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 6px;
  border-radius: 4px;
}
.mini-cal-nav:hover { background: var(--purple-dim); }

.mini-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.mini-cal-dow {
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 3px 0;
  text-transform: uppercase;
}

.mini-cal-day {
  text-align: center;
  font-size: 12px;
  padding: 4px 2px;
  border-radius: 4px;
  cursor: pointer;
  transition: background var(--transition);
  color: var(--text);
}
.mini-cal-day:hover  { background: var(--purple-dim); }
.mini-cal-day.today  { color: var(--purple-lt); font-weight: 600; }
.mini-cal-day.selected {
  background: var(--purple);
  color: #fff;
  font-weight: 600;
}
.mini-cal-day.empty  { cursor: default; }
.mini-cal-day.empty:hover { background: none; }
.mini-cal-day.other-month { color: var(--text-muted); opacity: 0.4; }

/* ══════════════════════════════════════════════════════════════════════════════
   TOAST
   ══════════════════════════════════════════════════════════════════════════════ */
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 9px 20px;
  font-size: 13px;
  color: var(--text);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  z-index: 9999;
  white-space: nowrap;
}
#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ══════════════════════════════════════════════════════════════════════════════
   VISITOR LANDING  (index.html)
   ══════════════════════════════════════════════════════════════════════════════ */
#slideshow-wrap {
  position: fixed;
  inset: 0;
  background: #000;
  overflow: hidden;
}

.ss-layer {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 0.9s ease;
  will-change: transform, opacity;
}

.ss-layer.active {
  opacity: 1;
  animation: kenBurns 4.5s ease-in-out forwards;
}

@keyframes kenBurns {
  0%   { transform: scale(1)    translate(0, 0); }
  100% { transform: scale(1.08) translate(-1%, -1%); }
}
@keyframes kenBurns2 {
  0%   { transform: scale(1.05) translate(1%, 0); }
  100% { transform: scale(1)    translate(0, 1%); }
}
@keyframes kenBurns3 {
  0%   { transform: scale(1)    translate(-1%, 1%); }
  100% { transform: scale(1.07) translate(1%, 0); }
}
@keyframes kenBurns4 {
  0%   { transform: scale(1.06) translate(0, -1%); }
  100% { transform: scale(1)    translate(-1%, 1%); }
}

.ss-layer.active.kb-1 { animation-name: kenBurns; }
.ss-layer.active.kb-2 { animation-name: kenBurns2; }
.ss-layer.active.kb-3 { animation-name: kenBurns3; }
.ss-layer.active.kb-4 { animation-name: kenBurns4; }

#returning-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  font-size: 13px;
}

/* Pearl welcome overlay */
#pearl-welcome {
  position: fixed;
  inset: 0;
  background: rgba(4, 2, 12, 0.88);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}
#pearl-welcome.show { opacity: 1; pointer-events: auto; }

.pearl-box {
  text-align: center;
  max-width: 400px;
  padding: 40px 32px;
}
.pearl-icon { font-size: 48px; margin-bottom: 16px; }
.pearl-title { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.pearl-sub { color: var(--text-muted); margin-bottom: 32px; font-size: 15px; }
.pearl-actions { display: flex; flex-direction: column; gap: 10px; }
.pearl-actions .btn { justify-content: center; padding: 12px 24px; font-size: 14px; }

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 2, 12, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.modal-backdrop.show { opacity: 1; pointer-events: auto; }

.modal-box {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  width: 340px;
  transform: scale(0.96);
  transition: transform 0.2s ease;
}
.modal-backdrop.show .modal-box { transform: scale(1); }

.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.modal-sub   { color: var(--text-muted); font-size: 13px; margin-bottom: 20px; }

.modal-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  margin-bottom: 14px;
  transition: border-color var(--transition);
}
.modal-input:focus { border-color: var(--purple); }

.modal-error {
  color: #fca5a5;
  font-size: 13px;
  margin-bottom: 12px;
  min-height: 18px;
}

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ══════════════════════════════════════════════════════════════════════════════
   LAYER 4 — Trim badges, card hashtag strip, date text input, shuttle scrub
   ══════════════════════════════════════════════════════════════════════════════ */

/* ── Trim In / Trim Out card borders ─────────────────────────────────────────── */
.photo-card.is-trim-in {
  border-color: var(--green-border) !important;
  box-shadow: 0 0 0 1px var(--green-border), 0 0 20px rgba(20,83,45,0.5) !important;
}
.photo-card.is-trim-out {
  border-color: var(--amber-border) !important;
  box-shadow: 0 0 0 1px var(--amber-border), 0 0 20px rgba(146,64,14,0.5) !important;
}

/* Trim badge shared */
.card-trim-badge {
  position: absolute;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 2px 7px;
  border-radius: 20px;
  pointer-events: none;
  backdrop-filter: blur(4px);
  animation: badge-pop 0.18s ease forwards;
  z-index: 2;
  text-transform: uppercase;
}
.card-trim-in-badge {
  top: 8px;
  left: 8px;
  background: rgba(5,32,16,0.92);
  color: var(--green-text);
  border: 1px solid var(--green-border);
}
.card-trim-out-badge {
  top: 8px;
  right: 8px;
  background: rgba(58,31,0,0.92);
  color: var(--amber-text);
  border: 1px solid var(--amber-border);
}

@keyframes badge-pop {
  from { opacity: 0; transform: scale(0.6); }
  to   { opacity: 1; transform: scale(1); }
}

/* ── Card hashtag strip ──────────────────────────────────────────────────────── */
.card-tags-strip {
  flex: 0 0 auto;
  padding: 3px 8px;
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  overflow: hidden;
  background: rgba(0,0,0,0.28);
  border-top: 1px solid rgba(255,255,255,0.05);
}
.card-tag-chip {
  font-size: 9px;
  color: var(--purple-lt);
  background: rgba(44,26,94,0.75);
  border-radius: 10px;
  padding: 1px 5px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── Date text input above MiniCal ──────────────────────────────────────────── */
.mini-cal-date-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 10px;
  color: var(--text);
  font-size: 12px;
  outline: none;
  margin-bottom: 8px;
  transition: border-color var(--transition);
  font-family: inherit;
  display: block;
}
.mini-cal-date-input:focus  { border-color: var(--purple); }
.mini-cal-date-input.valid  { border-color: var(--green-border); }
.mini-cal-date-input::placeholder { color: var(--text-muted); }

/* ── Shuttle scrub cursor ────────────────────────────────────────────────────── */
#scrub-track { cursor: ew-resize; }

/* ── Folder body in Add Photos panel ────────────────────────────────────────── */
#add-folder-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.folder-count-msg {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  padding: 4px 0;
}
.folder-count-msg .count-images  { color: var(--green-text); font-weight: 600; }
.folder-count-msg .count-skipped { color: var(--text-muted); }

/* ══════════════════════════════════════════════════════════════════════════════
   LAYER 2 — Batch date text input, Batch Trash, Review Filter Toggle
   ══════════════════════════════════════════════════════════════════════════════ */

/* ── Review filter toggle (next to year nav) ─────────────────────────────────── */
#review-filter-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: 10px;
}

.review-filter-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 74px;
  text-align: right;
}

.review-toggle-switch {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  cursor: pointer;
  flex-shrink: 0;
}

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

.review-toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  transition: background var(--transition), border-color var(--transition);
}

.review-toggle-slider::before {
  content: '';
  position: absolute;
  width: 13px;
  height: 13px;
  left: 3px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--text-muted);
  border-radius: 50%;
  transition: transform var(--transition), background var(--transition);
}

.review-toggle-switch input:checked + .review-toggle-slider {
  background: var(--green-bg);
  border-color: var(--green-border);
}

.review-toggle-switch input:checked + .review-toggle-slider::before {
  transform: translateY(-50%) translateX(16px);
  background: var(--green-text);
}

.review-toggle-switch:hover .review-toggle-slider {
  border-color: var(--purple);
}

/* ══════════════════════════════════════════════════════════════════════════════
   FOCAL POINT CROSSHAIR  (admin lightbox)
   ══════════════════════════════════════════════════════════════════════════════ */

/* Make the photo-wrap the positioning context */
.lb-photo-wrap { position: relative; }

/* Crosshair dot */
.lb-focal-crosshair {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--purple);
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5), 0 0 8px rgba(124, 58, 237, 0.6);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 20;
  display: none;
}

/* Horizontal arm */
.lb-focal-crosshair::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2000px;
  height: 1px;
  background: rgba(255, 255, 255, 0.45);
  transform: translate(-50%, -50%);
}

/* Vertical arm */
.lb-focal-crosshair::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1px;
  height: 2000px;
  background: rgba(255, 255, 255, 0.45);
  transform: translate(-50%, -50%);
}

/* "Click to set" hint — fades in on hover */
.lb-focal-hint {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(13, 10, 26, 0.78);
  border: 1px solid var(--purple-dim);
  color: var(--purple-lt);
  font-size: 11px;
  padding: 4px 12px;
  border-radius: 20px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  white-space: nowrap;
  z-index: 21;
}

.lb-photo-wrap:hover .lb-focal-hint {
  opacity: 1;
}

/* Crosshair cursor on the photo */
#lb-photo {
  cursor: crosshair;
}

/* ══════════════════════════════════════════════════════════════════════════════
   HASHTAG REFERENCE BAR — below shuttle scrub, wide viewports only
   ══════════════════════════════════════════════════════════════════════════════ */

#hashtag-bar {
  /* Fill whatever vertical space remains after wheel + scrub bar.
     flex: 1 1 0 + min-height: 0 prevents the bar from overflowing
     wheel-section's overflow: hidden and clipping the photo cards. */
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
  border-top: 1px solid var(--border);
  background: var(--bg);
  display: none;                /* hidden by default; shown via media query below */
  flex-direction: column;
}

/* Show only when viewport is wide enough */
@media (min-width: 1100px) {
  #hashtag-bar { display: flex; }
}

/* Collapsed state — shrink to header height only */
#hashtag-bar.collapsed {
  flex: 0 0 auto;
}
#hashtag-bar.collapsed #hashtag-bar-inner {
  display: none;
}

/* Header row */
#hashtag-bar-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px 4px;
  flex-shrink: 0;
}

#hashtag-bar-title {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  flex: 1;
  user-select: none;
}

#hashtag-bar-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 11px;
  padding: 0 3px;
  line-height: 1;
  transition: color var(--transition), transform 0.2s ease;
  transform-origin: center 55%;
}
#hashtag-bar-toggle:hover { color: var(--purple-lt); }
#hashtag-bar.collapsed #hashtag-bar-toggle { transform: rotate(-90deg); }

/* Scrollable category row */
#hashtag-bar-inner {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  align-items: flex-start;   /* cards hug the top, not stretched */
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 12px 8px;
  scrollbar-width: thin;
}
#hashtag-bar-inner::-webkit-scrollbar { height: 4px; }
#hashtag-bar-inner::-webkit-scrollbar-track { background: transparent; }
#hashtag-bar-inner::-webkit-scrollbar-thumb { background: var(--purple-dim); border-radius: 2px; }

/* Individual category card */
.hashtag-category {
  flex: 0 0 auto;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 10px;
  min-width: 100px;
  max-width: 240px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.hashtag-cat-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Chip row inside a category */
.hashtag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* Individual clickable hashtag chip */
.hashtag-ref-chip {
  font-size: 11px;
  color: var(--purple-lt);
  background: rgba(44, 26, 94, 0.55);
  border: 1px solid var(--purple-dim);
  border-radius: 12px;
  padding: 2px 8px;
  min-height: 32px;
  cursor: pointer;
  transition:
    background var(--transition),
    color var(--transition),
    border-color var(--transition),
    transform 0.1s ease;
  user-select: none;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.hashtag-ref-chip:hover {
  background: var(--purple-dim);
  border-color: var(--purple);
  color: #fff;
  transform: scale(1.04);
}
.hashtag-ref-chip:active {
  transform: scale(0.97);
}

/* Copied flash state */
.hashtag-ref-chip.copied {
  background: var(--green-bg);
  border-color: var(--green-border);
  color: var(--green-text);
}

/* Overflow chip group — hidden until expanded */
.hashtag-overflow-chips {
  display: none;
  margin-top: 4px;
}

.hashtag-overflow-chips.expanded {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Expand / collapse toggle button */
.hashtag-expand-btn {
  display: block;
  width: 100%;
  min-height: 36px;
  margin-top: 6px;
  padding: 4px 8px;
  background: transparent;
  border: 1px solid rgba(124, 58, 237, 0.35);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s, color 0.15s;
}

.hashtag-expand-btn:hover {
  border-color: rgba(124, 58, 237, 0.7);
  color: rgba(255, 255, 255, 0.75);
}

/* Usage count inside chip */
.chip-count {
  font-size: 9px;
  opacity: 0.45;
  font-weight: 400;
}

/* Empty-state label inside the bar */
#hashtag-bar-empty {
  font-size: 12px;
  color: var(--text-muted);
  padding: 8px 0;
  align-self: center;
}

/* ── Item 4 (Session D) — Landing Approved Gold Star ─────── */
.card-star {
  position:   absolute;
  top:        6px;
  right:      6px;
  font-size:  18px;
  cursor:     pointer;
  transition: opacity 0.2s, transform 0.15s;
  z-index:    10;
  line-height: 1;
  user-select: none;
  -webkit-user-select: none;
  background: none;
  border: none;
  padding: 0;
}
.card-star.approved   { color: #FBBF24; opacity: 1; }
.card-star.unapproved { color: #FBBF24; opacity: 0.25; }
.card-star:hover      { transform: scale(1.2); opacity: 1; }

/* Lightbox star button state */
.lb-star-btn          { color: rgba(232, 224, 240, 0.55); }
.lb-star-btn.approved { color: #FBBF24; }


/* ══════════════════════════════════════════════════════════════════════════════
   Pearl Panel — Layer 7
   ══════════════════════════════════════════════════════════════════════════════ */

/* Full-screen overlay — z-index 350 keeps it above nav buttons (200)
   but below gallery fullscreen (400) */
#pearl-panel {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 350;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#pearl-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 52px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

#pearl-panel-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text);
}

/* ── Tab bar ─────────────────────────────────────────────────────────────── */
#pearl-tabs {
  display: flex;
  gap: 2px;
  flex: 1;
  padding: 0 16px;
}

.pearl-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0 14px;
  height: 52px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.pearl-tab:hover  { color: var(--text); }
.pearl-tab.active { color: var(--text); border-bottom-color: var(--purple); }

/* ── Tab body ────────────────────────────────────────────────────────────── */
#pearl-tab-body {
  flex: 1;
  position: relative;
  overflow: hidden;
}

/* Individual frames — hidden by default, shown when active */
.pearl-frame {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  overflow: hidden;
  padding: 24px 28px 20px;
  background: var(--bg);
}

.pearl-frame.active {
  display: flex;
}

/* Invite tab — name/email side by side with send button */
.pearl-invite-header {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 4px;
}

.pearl-invite-header > div {
  flex: 1;
}

.pearl-invite-send-btn {
  flex-shrink: 0;
  align-self: flex-end;
  margin-bottom: 1px;
}

/* Scrollable list area inside a frame */
.pearl-scroll-list {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.pearl-empty {
  color: var(--text-muted);
  font-size: 13px;
  font-style: italic;
  padding: 8px 0;
}

/* Shared input */
.pearl-input {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color var(--transition);
  width: 100%;
}
.pearl-input:focus { border-color: var(--purple); }

.pearl-select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 10px;
  color: var(--text);
  font-size: 13px;
  outline: none;
  cursor: pointer;
}

/* ── Frame 1: Attention ─────────────────────────────────────────────────────── */

.pearl-attention-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 10px;
  background: var(--bg-card);
}

.pearl-attention-item.knock {
  border-color: var(--amber-border);
  background: var(--amber-bg);
}

.pearl-attention-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.pearl-evt-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--purple-lt);
  background: var(--purple-dim);
  border-radius: 4px;
  padding: 2px 6px;
}

.pearl-attention-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.pearl-attention-detail {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
  line-height: 1.5;
}

.pearl-attention-ts {
  font-size: 11px;
  color: var(--text-muted);
}

.pearl-attention-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pearl-attention-actions .btn {
  font-size: 12px;
  padding: 5px 12px;
}

/* ── Frame 2: Member Lookup ──────────────────────────────────────────────────── */

.pearl-search-row {
  margin-bottom: 12px;
  flex-shrink: 0;
}

.pearl-member-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 10px;
  background: var(--bg-card);
}

.pearl-member-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.pearl-member-email {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.pearl-member-status {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  margin-bottom: 8px;
}
.pearl-member-status.approved  { background: var(--green-bg);  color: var(--green-text);  border: 1px solid var(--green-border); }
.pearl-member-status.pending   { background: var(--amber-bg);  color: var(--amber-text);  border: 1px solid var(--amber-border); }
.pearl-member-status.denied    { background: #2a0a0a; color: #f87171; border: 1px solid #7f1d1d; }

.pearl-member-detail {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
  line-height: 1.6;
}

.pearl-member-events {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 10px;
}

.pearl-member-events .pearl-evt-badge {
  cursor: default;
}

.pearl-member-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.pearl-member-actions .btn {
  font-size: 12px;
  padding: 4px 10px;
}

/* ── Frame 3: Activity Log ───────────────────────────────────────────────────── */

.pearl-log-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.pearl-log-name-input  { flex: 1; min-width: 100px; }
.pearl-log-date-input  { width: 130px; }

.pearl-log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.pearl-log-table th {
  text-align: left;
  color: var(--text-muted);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0 8px 6px;
  border-bottom: 1px solid var(--border);
}

.pearl-log-table td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: top;
}

.pearl-log-table tr:last-child td { border-bottom: none; }

.pearl-log-table tr.log-expandable { cursor: pointer; }
.pearl-log-table tr.log-expandable:hover td { background: var(--bg-raised); }

.pearl-log-expand-row td {
  background: var(--bg-raised);
  padding: 10px 14px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.6;
}

.pearl-log-email-check { color: var(--green-text); }
.pearl-log-email-dash  { color: var(--text-muted); }

.pearl-pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 10px;
  flex-shrink: 0;
  font-size: 12px;
  color: var(--text-muted);
}

.pearl-pagination .btn {
  font-size: 12px;
  padding: 4px 10px;
}

/* ── Frame 4: Announce ───────────────────────────────────────────────────────── */

.pearl-announce-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
}

.pearl-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.pearl-textarea {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  resize: vertical;
  transition: border-color var(--transition);
  flex: 1;
  min-height: 80px;
}
.pearl-textarea:focus { border-color: var(--purple); }

.pearl-announce-actions {
  display: flex;
  gap: 8px;
}

.pearl-announce-status {
  font-size: 13px;
  color: var(--text-muted);
  min-height: 20px;
}

.pearl-announce-preview {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  background: #fff;
  color: #333;
  font-size: 13px;
  max-height: 200px;
  overflow-y: auto;
}


/* ── Jam Panel ────────────────────────────────────────────────────────────── */

#jam-panel {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 350;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#jam-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 52px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

#jam-panel-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text);
}

/* Two-column grid: submissions left, batch upload right */
#jam-grid {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr;
  gap: 1px;
  background: var(--border);
  overflow: hidden;
}

@media (max-width: 900px) {
  #jam-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    overflow-y: auto;
  }
}

.jam-frame {
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 20px 20px 16px;
  min-height: 0;
}

.jam-frame-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
  flex-shrink: 0;
}

.jam-scroll-list {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.jam-empty {
  color: var(--text-muted);
  font-size: 13px;
  font-style: italic;
  padding: 8px 0;
}

/* ── Submission review cards ─────────────────────────────────────────────── */

.jam-sub-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.jam-sub-card:last-child {
  border-bottom: none;
}

.jam-sub-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
  background: var(--card-bg);
}

.jam-sub-info {
  flex: 1;
  min-width: 0;
}

.jam-sub-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.jam-sub-caption {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.jam-sub-date {
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.7;
}

.jam-sub-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.jam-sub-btn {
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 5px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
  transition: opacity 0.15s;
}

.jam-sub-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.jam-sub-approve {
  background: #14532d;
  color: #86efac;
  border-color: #166534;
}

.jam-sub-approve:hover:not(:disabled) {
  background: #166534;
}

.jam-sub-reject {
  background: #450a0a;
  color: #fca5a5;
  border-color: #7f1d1d;
}

.jam-sub-reject:hover:not(:disabled) {
  background: #7f1d1d;
}

/* ── Batch upload frame inside Jam panel ─────────────────────────────────── */

.jam-drop-zone {
  margin-bottom: 12px;
  flex-shrink: 0;
}

.jam-upload-footer {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.jam-sub-confirm {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 0;
  display: block;
  text-align: right;
}
.jam-sub-confirm-approve { color: #86efac; }
.jam-sub-confirm-reject  { color: #fca5a5; }

/* ═══════════════════════════════════════════════════════════════════════════════
   WHOM DIS? — lightbox panel
   ═══════════════════════════════════════════════════════════════════════════════ */

.lb-whomdis-label {
  margin-top: 20px;
}

.lb-whomdis-status {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
  min-height: 16px;
}

.lb-whomdis-chips {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 8px;
}

/* Suggestion chip */
.whomdis-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(44, 26, 94, 0.55);
  border: 1px solid var(--purple-dim);
  border-radius: var(--radius);
  padding: 6px 10px;
  cursor: pointer;
  text-align: left;
  width: 100%;
  color: var(--text);
  transition: background var(--transition), border-color var(--transition);
}
.whomdis-chip:hover:not(:disabled) {
  background: var(--purple-dim);
  border-color: var(--purple);
}
.whomdis-chip.applied {
  background: rgba(22, 101, 52, 0.45);
  border-color: #166534;
  cursor: default;
}
.whomdis-chip-tag {
  font-size: 11px;
  font-weight: 700;
  color: var(--purple-lt);
  flex-shrink: 0;
  font-family: monospace;
}
.whomdis-chip.applied .whomdis-chip-tag {
  color: #86efac;
}
.whomdis-chip-display {
  font-size: 11px;
  color: var(--text-muted);
  flex: 1 1 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.whomdis-chip-icon {
  font-size: 13px;
  flex-shrink: 0;
  color: var(--purple-lt);
}
.whomdis-chip.applied .whomdis-chip-icon {
  color: #86efac;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   PEOPLE PANEL
   ═══════════════════════════════════════════════════════════════════════════════ */

#people-panel {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 450;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

#people-panel-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

#people-panel-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  flex: 1 1 0;
}

#people-table-wrap {
  flex: 1 1 0;
  overflow: auto;
  padding: 24px;
}

#people-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

#people-table th {
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 0 12px 10px 0;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

#people-table td {
  padding: 10px 12px 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  vertical-align: top;
  color: var(--text);
}

.people-tag-cell {
  font-family: monospace;
  font-weight: 700;
  color: var(--purple-lt) !important;
  white-space: nowrap;
}

.people-notes-cell {
  max-width: 200px;
  color: var(--text-muted) !important;
  font-size: 12px;
}

.people-actions-cell {
  white-space: nowrap;
}

.people-actions-cell .btn {
  font-size: 12px;
  padding: 4px 10px;
  margin-left: 4px;
}

.people-empty {
  color: var(--text-muted);
  font-size: 13px;
  padding: 32px 0;
  text-align: center;
}

/* People modal */
#people-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
}

#people-modal-body {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 12px);
  padding: 28px;
  width: 560px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
}

.people-modal-header {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
}

#people-modal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  flex: 1 1 0;
}

.people-field-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.people-field {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  margin-bottom: 16px;
}

.people-field-row .people-field {
  margin-bottom: 0;
}

.people-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 6px;
}

.people-input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color var(--transition);
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
}
.people-input:focus { border-color: var(--purple); }

.people-textarea {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color var(--transition);
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
  min-height: 64px;
}
.people-textarea:focus { border-color: var(--purple); }

.people-tag-preview {
  font-family: monospace;
  font-size: 15px;
  font-weight: 700;
  color: var(--purple-lt);
  padding: 8px 0;
}

.people-modal-error {
  color: #fca5a5;
  font-size: 12px;
  margin-bottom: 12px;
  padding: 8px 10px;
  background: rgba(239,68,68,0.1);
  border-radius: var(--radius);
  border: 1px solid rgba(239,68,68,0.3);
}

.people-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

/* ── Mobile responsive (≤768px) ─────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Hide desktop-only controls */
  #scrub-wrap       { display: none !important; }
  #trim-in-btn      { display: none !important; }
  #trim-out-btn     { display: none !important; }
  #batch-actions    { display: none !important; }
  #add-photos-btn   { display: none !important; }
  #preview-btn      { display: none !important; }
  #hashtag-bar      { display: none !important; }

  /* Prevent horizontal overflow */
  body,
  #admin-wrapper    { max-width: 100%; overflow-x: hidden; }

  /* Control bar: center remaining items */
  #control-bar {
    justify-content: center;
    flex-wrap: wrap;
    height: auto;
    min-height: 48px;
    padding: 8px 16px;
  }

  #year-nav         { margin-left: 0; }
  #review-filter-wrap { margin-left: 0; }

  /* 44px touch targets on year nav arrows */
  .year-arrow {
    width: 44px;
    height: 44px;
    font-size: 16px;
  }

  /* Wheel padding reduction on narrow screens */
  #wheel-track { padding: 0 20px; }

  /* ── Lightbox: mobile layout ── */

  /* Close button */
  #lb-close-mobile {
    display: flex;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 806;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(4, 2, 12, 0.82);
    border: 1px solid rgba(124, 58, 237, 0.4);
    color: var(--text);
    font-size: 20px;
    line-height: 1;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
  }

  /* Dark overlay on top of the photo */
  #lb-darkener {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 802;
    background: rgba(0, 0, 0, 0.58);
    pointer-events: none;
  }

  /* Photo: full screen, contain so the whole image is visible */
  .lightbox-overlay .lb-center {
    position: fixed;
    inset: 0;
    z-index: 801;
    padding: 0;
    overflow: visible;
  }
  .lightbox-overlay .lb-photo-wrap {
    width: 100%;
    height: 100%;
    padding: 0;
  }
  .lightbox-overlay .lb-photo {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: contain;
    border-radius: 0;
  }

  /* Hide just the left edit column — keep lightbox-body in DOM so lb-center renders */
  .lightbox-overlay .lb-left  { display: none !important; }
  .lightbox-overlay .lightbox-body { padding: 0; gap: 0; overflow: visible; }

  /* Title + date overlay, just below close button */
  #lb-mobile-top {
    display: block;
    position: fixed;
    top: 68px;
    left: 0;
    right: 0;
    z-index: 803;
    background: rgba(4, 2, 12, 0.78);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 12px 16px 14px;
  }

  .lbm-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
  }

  .lbm-date-label { margin-top: 12px; }

  #lb-mobile-top .lb-title-input {
    width: 100%;
    box-sizing: border-box;
    min-height: 54px;
  }

  #lb-mobile-top .mini-cal-date-input {
    width: 100%;
    box-sizing: border-box;
  }

  /* Bottom zone: fixed to bottom, stacks sheet + toggle + action bar */
  #lb-mobile-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 804;
    display: flex;
    flex-direction: column;
  }

  /* Whom Dis sheet — expands upward from inside the bottom zone */
  #lb-whomdis-sheet {
    background: rgba(4, 2, 12, 0.97);
    border-top: 2px solid rgba(124, 58, 237, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 0 16px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
  }

  #lb-whomdis-sheet.open {
    max-height: 280px;
    padding: 14px 16px 16px;
  }

  .lb-whomdis-sheet-handle {
    width: 36px;
    height: 4px;
    background: rgba(124, 58, 237, 0.45);
    border-radius: 2px;
    margin: 0 auto 14px;
  }

  .lb-whomdis-mobile-input {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 8px;
  }

  #lb-whomdis-mobile-status {
    font-size: 12px;
    color: var(--text-muted);
    min-height: 16px;
    margin-bottom: 6px;
  }

  /* Whom Dis toggle button */
  #lb-whomdis-mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    width: 100%;
    background: rgba(44, 26, 94, 0.92);
    border: none;
    border-top: 1px solid rgba(124, 58, 237, 0.35);
    color: var(--purple-lt);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    letter-spacing: 0.03em;
    flex-shrink: 0;
  }

  #lb-whomdis-mobile-toggle.active {
    background: rgba(124, 58, 237, 0.28);
    color: #fff;
  }

  /* Action bar — static inside bottom zone (zone handles positioning) */
  #lightbox-action-bar {
    position: static;
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    justify-content: flex-start;
    gap: 10px;
    padding: 10px 16px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    background: rgba(4, 2, 12, 0.95);
    border-top: 1px solid rgba(124, 58, 237, 0.2);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  #lightbox-action-bar::-webkit-scrollbar { display: none; }

  #lightbox-action-bar .btn {
    min-height: 44px;
    padding: 0 16px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* Button order: ↺ ↻ Publish Save Landing Trash */
  #lb-rotate-ccw { order: 1; }
  #lb-rotate-cw  { order: 2; }
  #lb-publish    { order: 3; }
  #lb-save       { order: 4; }
  #lb-star       { order: 5; }
  #lb-trash      { order: 6; }
  #lb-close      { display: none !important; }

  /* Hide desktop-only lightbox elements */
  .lightbox-overlay .lb-nav  { display: none !important; }
  #lb-cal                    { display: none !important; }
  .lb-focal-hint             { display: none !important; }
  .lb-focal-crosshair        { display: none !important; }
  .lb-date-display           { display: none !important; }
}
