body.library-overlay-open .home-orb-shell {
  opacity: 0;
  pointer-events: none;
}

#spatial-gallery,
#contextual-aura,
#folder-context-menu,
#rename-folder-modal {
  --serif: "Playfair Display", Georgia, serif;
  --garamond: "EB Garamond", Georgia, serif;
  --sans: "Outfit", system-ui, sans-serif;
  --mono: "JetBrains Mono", monospace;
  --bg-base: #f4f3f0;
  --bg-panel: #ffffff;
  --text-main: #1a1a1a;
  --text-muted: rgba(26,26,26,0.65);
  --text-ghost: rgba(26,26,26,0.35);
  --border: rgba(0,0,0,0.08);
  --border-strong: rgba(0,0,0,0.15);
  --accent: #b48c46;
  --shadow-soft: 0 10px 30px rgba(0,0,0,0.04);
  --shadow-float: 0 20px 40px rgba(0,0,0,0.08);
  --shadow-heavy: 0 30px 60px rgba(0,0,0,0.15);
}

/* =========================================
   SPATIAL GALLERY (FULL SCREEN)
   ========================================= */
.spatial-gallery {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  background: var(--bg-base);
  overflow: hidden;
  perspective: 2000px;
}

.spatial-gallery.is-summoned {
  opacity: 1;
  pointer-events: auto;
}

/* =========================================
   OPAQUE GLOBAL HEADER
   ========================================= */
.gallery-header {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  background: rgba(244, 243, 240, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-strong);
  z-index: 15000;
  padding: 1.5rem 3rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  box-shadow: 0 4px 20px rgba(0,0,0,0.03);
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.spatial-gallery.has-hero .gallery-header {
  opacity: 0;
  transform: translateY(-20px);
  pointer-events: none;
}

.spatial-gallery.has-hero .swimlanes-wrapper {
  filter: blur(4px) saturate(0.92);
  transform: scale(0.995);
}

.gallery-metadata {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.breadcrumb-trail {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-main);
  font-weight: bold;
}

.breadcrumb-link {
  cursor: pointer;
  transition: color 0.2s ease;
}

.breadcrumb-link:hover {
  color: var(--accent);
}

.breadcrumb-link.drag-over {
  color: var(--accent);
  text-decoration: underline;
}

.view-toggles {
  margin-top: 1rem;
  font-family: var(--garamond);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--text-ghost);
  display: flex;
  gap: 1rem;
}

.view-toggle {
  cursor: pointer;
  transition: color 0.3s ease;
}

.view-toggle:hover {
  color: var(--accent);
}

.view-toggle.is-active {
  color: var(--text-main);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 4px;
}

.clear-filters-link {
  font-family: var(--garamond);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--text-main);
  text-decoration: underline;
  text-decoration-color: var(--border-strong);
  text-underline-offset: 4px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, color 0.2s ease;
}

.clear-filters-link.is-active {
  opacity: 1;
  pointer-events: auto;
}

.clear-filters-link:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

/* =========================================
   THE "NEW" BUTTON & ACTION HUB
   ========================================= */
.action-hub {
  position: relative;
}

.btn-new {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-strong);
  border-radius: 30px;
  padding: 0.6rem 1.8rem;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-main);
  cursor: pointer;
  box-shadow: var(--shadow-float);
  transition: all 0.3s ease;
}

.btn-new:hover {
  background: var(--text-main);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-heavy);
}

.action-dropdown {
  position: absolute;
  top: 120%;
  right: 0;
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-heavy);
  border-radius: 4px;
  padding: 0.5rem 0;
  width: 200px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  transition: all 0.3s ease;
}

.action-dropdown.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.dropdown-item {
  padding: 0.8rem 1.5rem;
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--text-main);
  cursor: pointer;
  transition: background 0.2s ease;
}

.dropdown-item:hover {
  background: var(--bg-base);
  color: var(--accent);
}

/* =========================================
   CONTEXTUAL AURA (DIRECTOR'S CONTROLS)
   ========================================= */
.contextual-aura {
  position: fixed;
  top: 85%;
  left: 50%;
  transform: translate(-50%, 20px);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-strong);
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0.5rem;
  box-shadow: var(--shadow-heavy);
  z-index: 15500;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
  height: 48px;
  width: auto;
  transition: all 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.contextual-aura.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

body.pluso-studio-open #contextual-aura {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 20px);
}

.aura-controls-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  height: 32px;
}

.aura-btn {
  background: transparent;
  border: none;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.6rem 1.2rem;
  border-radius: 20px;
  transition: all 0.2s ease;
  white-space: nowrap;
  pointer-events: auto;
  position: relative;
  z-index: 1;
}

.aura-btn:hover {
  background: rgba(0,0,0,0.05);
  color: var(--text-main);
}

.aura-btn.is-active {
  background: var(--text-main);
  color: #ffffff;
}

/* =========================================
   DYNAMIC DATA VIEWS (LANE, GRID, LIST)
   ========================================= */
.swimlanes-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  padding: 12rem 4rem 6rem 4rem;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 10010;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

.spatial-gallery.is-summoned .swimlanes-wrapper {
  opacity: 1;
  pointer-events: auto;
}

.swimlane-section {
  margin-bottom: 5rem;
}

.swimlane-header {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-main);
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.swimlane-track {
  display: flex;
  gap: 2rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2rem;
  align-items: stretch;
}

.swimlane-track::-webkit-scrollbar {
  display: none;
}

.swimlane-item {
  flex-shrink: 0;
  border-radius: 2px;
  box-shadow: var(--shadow-soft);
  cursor: grab;
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

.swimlane-item:active {
  cursor: grabbing;
}

.swimlane-item:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-heavy);
  border-color: var(--accent);
  z-index: 10;
}

.swimlane-item.is-diminished {
  filter: grayscale(1) opacity(0.3);
  pointer-events: none;
  transform: scale(0.95);
}

.swimlane-item.is-highlighted {
  border: 2px solid var(--accent);
  box-shadow: 0 0 40px rgba(180,140,70,0.2);
}

.item-preview-content {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
}

/* =========================================
   THE "EDITORIAL BINDER" (FOLDERS)
   ========================================= */
.swimlane-item[data-type="folder"] {
  width: 160px;
  height: 420px;
  background: var(--text-main);
  border: none;
  color: var(--bg-base);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.swimlane-item[data-type="folder"]:hover {
  background: #000;
  box-shadow: var(--shadow-heavy);
  transform: translateY(-8px) scale(1.02);
}

.swimlane-item[data-type="folder"].drag-over {
  border: 2px solid var(--accent);
  box-shadow: 0 0 40px rgba(180,140,70,0.5);
  background: var(--text-muted);
}

.folder-spine {
  writing-mode: vertical-rl;
  transform: scale(-1);
  display: flex;
  align-items: center;
  gap: 2rem;
}

.folder-spine-title {
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  white-space: nowrap;
}

.folder-spine-count {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--accent);
}

.swimlane-item[data-type="image"] .item-preview-content,
.swimlane-item[data-type="moodboard"] .item-preview-content {
  width: 320px;
  height: 420px;
}

.swimlane-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.swimlane-item[data-type="text"] .item-preview-content {
  width: 380px;
  height: auto;
  min-height: 250px;
  padding: 2.5rem;
}

.swimlane-item[data-type="text"] .preview-title {
  font-family: var(--serif);
  font-size: 1.4rem;
  font-style: italic;
  margin-bottom: 1rem;
  color: var(--text-main);
}

.swimlane-item[data-type="text"] .preview-body {
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.swimlane-item[data-type="project"] .item-preview-content {
  width: 280px;
  height: 180px;
  padding: 2rem;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.swimlane-item[data-type="project"] .proj-ext {
  font-family: var(--mono);
  font-size: 2.5rem;
  color: var(--accent);
  font-weight: bold;
}

.swimlane-item[data-type="project"] .proj-name {
  font-family: var(--sans);
  font-size: 0.95rem;
  margin-top: 1rem;
  font-weight: 500;
  color: var(--text-main);
}

/* ------------------------------
   GRID VIEW OVERRIDES
   ------------------------------ */
.swimlanes-wrapper.is-grid-view .swimlane-track {
  flex-wrap: wrap;
  justify-content: flex-start;
  padding-bottom: 0;
}

.swimlanes-wrapper.is-grid-view .swimlane-item {
  width: 240px !important;
  height: 280px !important;
}

.swimlanes-wrapper.is-grid-view .swimlane-item[data-type="folder"] {
  width: 120px !important;
}

.swimlanes-wrapper.is-grid-view .item-preview-content {
  width: 100% !important;
  height: 100% !important;
}

.swimlanes-wrapper.is-grid-view .swimlane-item[data-type="text"] .item-preview-content {
  min-height: 100%;
  padding: 1.5rem;
}

.swimlanes-wrapper.is-grid-view .preview-title {
  font-size: 1.1rem !important;
}

.swimlanes-wrapper.is-grid-view .preview-body {
  font-size: 0.75rem !important;
}

/* ------------------------------
   LIST VIEW (MAGAZINE INDEX) OVERRIDES
   ------------------------------ */
.list-view-content {
  display: none;
  width: 100%;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.swimlanes-wrapper.is-list-view .swimlane-track {
  flex-direction: column;
  gap: 0;
  padding-bottom: 0;
  align-items: stretch;
}

.swimlanes-wrapper.is-list-view .swimlane-item {
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  padding: 0;
  color: var(--text-main);
}

.swimlanes-wrapper.is-list-view .swimlane-item:hover {
  transform: translateX(10px);
  border-color: var(--border);
  box-shadow: none;
  background: transparent;
  color: var(--text-main);
}

.swimlanes-wrapper.is-list-view .item-preview-content,
.swimlanes-wrapper.is-list-view .folder-spine {
  display: none;
}

.swimlanes-wrapper.is-list-view .list-view-content {
  display: flex;
}

.list-col-date {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-ghost);
  width: 20%;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.list-col-title {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-style: italic;
  color: var(--text-main);
  width: 60%;
}

.list-col-type {
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--text-muted);
  width: 20%;
  text-align: right;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 500;
}

/* =========================================
   GHOST LIGHTBOX (IMMERSIVE FULLSCREEN)
   ========================================= */
.ghost-lightbox-wrapper {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) translateZ(100px);
  z-index: 14500;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100vw;
  height: 100vh;
  justify-content: center;
}

.ghost-lightbox-wrapper.is-visible {
  opacity: 1;
  pointer-events: none;
}

.ghost-lightbox-img {
  max-height: 85vh;
  max-width: 90vw;
  object-fit: contain;
  box-shadow: 0 40px 100px rgba(0,0,0,0.4);
  cursor: zoom-out;
  border-radius: 4px;
}

.ghost-lightbox-text {
  width: 600px;
  max-height: 80vh;
  background: var(--bg-panel);
  padding: 4rem;
  box-shadow: 0 40px 100px rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  overflow-y: auto;
  cursor: zoom-out;
  border-radius: 4px;
}

.ghost-lightbox-wrapper.is-visible .ghost-lightbox-img,
.ghost-lightbox-wrapper.is-visible .ghost-lightbox-text {
  pointer-events: none;
}

.lightbox-metadata {
  position: absolute;
  bottom: 3rem;
  left: 3rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  pointer-events: none;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.2s;
}

.ghost-lightbox-wrapper.is-visible .lightbox-metadata {
  opacity: 1;
  transform: translateY(0);
}

.meta-title {
  font-family: var(--serif);
  font-size: 2.2rem;
  font-style: italic;
  color: var(--text-main);
}

.meta-date {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.meta-cluster {
  font-family: var(--mono);
  font-size: 10px;
  background: var(--accent);
  color: white;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  display: inline-block;
  width: fit-content;
  margin-top: 0.5rem;
}

/* =========================================
   RENAME COLLECTION MODAL
   ========================================= */
.rename-folder-modal {
  position: fixed;
  inset: 0;
  z-index: 21000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.rename-folder-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.rename-folder-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(244, 243, 240, 0.52);
  backdrop-filter: blur(10px);
}

.rename-folder-dialog {
  position: relative;
  width: min(420px, calc(100vw - 2rem));
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-heavy);
  border-radius: 18px;
  padding: 2rem;
  z-index: 1;
  display: grid;
  gap: 0.75rem;
}

.rename-folder-kicker {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  font-weight: 700;
}

.rename-folder-title {
  font-family: var(--serif);
  font-size: 2rem;
  font-style: italic;
  line-height: 1;
  color: var(--text-main);
}

.rename-folder-copy {
  font-family: var(--garamond);
  font-size: 1.1rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.rename-folder-label {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-ghost);
  margin-top: 0.25rem;
}

.rename-folder-field {
  display: grid;
  gap: 0.4rem;
}

.rename-folder-field.is-hidden {
  display: none;
}

.rename-folder-input {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--bg-base);
  color: var(--text-main);
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.9rem 1rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.rename-folder-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(180,140,70,0.12);
  background: #fff;
}

.rename-folder-input.is-plain-case {
  text-transform: none;
}

.rename-folder-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.rename-folder-button {
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 0.7rem 1.1rem;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  transition: all 0.2s ease;
}

.rename-folder-button.is-secondary {
  background: var(--bg-base);
  color: var(--text-muted);
}

.rename-folder-button.is-secondary:hover {
  color: var(--text-main);
  border-color: var(--text-main);
}

.rename-folder-button.is-primary {
  background: var(--text-main);
  color: #fff;
  border-color: var(--text-main);
}

.rename-folder-button.is-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.rename-folder-modal.is-destructive .rename-folder-kicker {
  color: #b54747;
}

.rename-folder-modal.is-destructive .rename-folder-button.is-primary {
  background: #c94f4f;
  border-color: #c94f4f;
}

.rename-folder-modal.is-destructive .rename-folder-button.is-primary:hover {
  background: #a83d3d;
  border-color: #a83d3d;
}
