/* ═══════════════════════════════════════════════════════════════════════════
   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;
}

   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; }


/* ══════════════════════════════════════════════════════════════════════════════
