* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  background: #fafafa; color: #262626;
  padding: 32px 28px 120px;
  --site-bg: #fafafa;
  --pick-outer-r: 12px;
  --pick-inner-r: 8px;
  --pick-inset: 10%;
  --pick-bg-bleed: 12.5%;
  --pick-bg-scale-from: 1;
  --pick-bg-scale-to: 0.92;
  --pick-bg-duration: 0.5s;
  --pick-ease-quint: cubic-bezier(0.22, 1, 0.36, 1);
  /* Lightbox hero + card grow — ease-in-out quint, shared so mid-path stays locked */
  --lightbox-ms: 280ms;
  --lightbox-ease: cubic-bezier(0.86, 0, 0.07, 1);
}

.header { text-align: center; margin-bottom: 32px; max-width: 920px; margin-inline: auto; }
.header-links-sep { margin: 0 8px; color: #c8c8c8; }
.header-links a.is-active { color: #262626; font-weight: 600; }
.header-mark {
  font-size: 52px; line-height: 1; font-weight: 400;
  margin-bottom: 10px;
}
.header p { font-size: 14px; color: #8e8e8e; margin-bottom: 18px; }
.header-links { margin-top: -10px; margin-bottom: 14px; }
.header-links a { font-size: 13px; color: #8e8e8e; }
.header-links a:hover { color: #262626; }

.search-shell { position: relative; text-align: left; margin-bottom: 16px; }
.search-bar {
  display: flex; align-items: center; gap: 10px;
  min-height: 46px; padding: 8px 8px 8px 14px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 22px rgba(0, 0, 0, 0.05);
  overflow: visible;
  transition: border-color 0.125s ease, box-shadow 0.125s ease;
}
.search-bar:focus-within {
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 10px 28px rgba(0, 0, 0, 0.08);
}
.search-bar.is-stacked.has-category {
  padding-bottom: 8px;
  flex-wrap: wrap;
  align-items: stretch;
}
.search-bar-inner {
  flex: 1; min-width: 0;
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
}
.search-bar.is-stacked .search-bar-inner {
  flex-direction: column; align-items: stretch; gap: 0;
}
.search-chips-wrap {
  display: contents;
}
.search-bar.is-stacked .search-chips-wrap {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  width: 100%; padding-bottom: 10px;
}
.search-filter-divider {
  display: none; flex: 0 0 auto; align-self: stretch;
  height: 1px; margin: 0 10px 10px; border: none;
  background: linear-gradient(90deg, transparent, #e4e4e4 12%, #e4e4e4 88%, transparent);
}
.search-bar.is-stacked .search-filter-divider { display: block; }
.search-bar.is-stacked .search-filter-divider[hidden] { display: none !important; }
.search-bar.is-stacked .search-input {
  width: 100%; flex: 1 1 auto; min-width: 0;
  padding: 0 2px 2px;
}
.search-bar.is-stacked .search-run {
  align-self: flex-end;
  margin-top: 6px;
}
.category-trigger {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 11px; margin: 0;
  border: none; border-radius: 999px;
  background: #f4f4f4; color: #666;
  font: inherit; font-size: 12px; font-weight: 600;
  cursor: pointer; white-space: nowrap; flex: 0 0 auto;
  transition: background-color 0.125s ease, color 0.125s ease;
}
.category-trigger:hover { background: #ececec; color: #262626; }
.category-trigger-chevron { font-size: 11px; line-height: 1; opacity: 0.85; }
.category-slot { display: contents; }
.category-pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 600; padding: 4px 10px;
  border-radius: 999px; white-space: nowrap; flex: 0 0 auto;
}
.category-pill-selected { background: #262626; color: #fff; }
.category-pill-label {
  border: none; background: transparent; color: inherit;
  font: inherit; font-size: inherit; font-weight: inherit;
  cursor: pointer; padding: 0;
}
.category-pill-remove {
  border: none; background: transparent; color: inherit; cursor: pointer;
  font-size: 14px; line-height: 1; opacity: 0.75; padding: 0 0 0 2px;
}
.category-pill-remove:hover { opacity: 1; }
.category-menu {
  position: absolute; left: 0; top: calc(100% + 6px); z-index: 51;
  min-width: 260px; max-width: min(380px, 100%);
  max-height: 320px; overflow-y: auto;
  background: #fff; border: 1px solid #dbdbdb; border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,.08);
}
.category-menu-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; text-align: left; border: none; background: transparent;
  padding: 10px 14px; font: inherit; font-size: 13px; cursor: pointer; color: inherit;
}
.category-menu-item:hover, .category-menu-item.is-active { background: #f5f5f5; }
.category-menu-item.is-active { font-weight: 600; }
.category-menu-count { font-size: 12px; color: #8e8e8e; flex: 0 0 auto; }
.search-pills { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.search-pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 500; padding: 5px 11px; border-radius: 999px;
  transition: background-color 0.125s ease, border-color 0.125s ease;
}
.search-pill.category {
  background: #262626; color: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.14);
}
.search-pill.tag {
  background: #f5f5f5; color: #262626;
  border: 1px solid #ebebeb;
}
.search-pill button {
  border: none; background: transparent; color: inherit; cursor: pointer;
  font-size: 14px; line-height: 1; opacity: 0.65; padding: 0;
}
.search-pill button:hover { opacity: 1; }
.search-input {
  flex: 1; min-width: 140px; border: none; outline: none;
  font: inherit; font-size: 14px; background: transparent; color: inherit;
}
.search-input::placeholder { color: #b0b0b0; }
.search-suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 50;
  background: #fff; border: 1px solid rgba(0, 0, 0, 0.08); border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}
.search-suggest-header {
  padding: 11px 14px 7px;
  font-size: 11px; font-weight: 600; color: #8e8e8e;
  text-transform: uppercase; letter-spacing: .04em;
}
.search-suggest-item {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; text-align: left; border: none; background: transparent;
  padding: 10px 14px; font: inherit; font-size: 13px; cursor: pointer; color: inherit;
}
.search-suggest-item:hover, .search-suggest-item.active { background: #f5f5f5; }
.search-suggest-kind { font-size: 11px; color: #8e8e8e; text-transform: uppercase; letter-spacing: .04em; }
.search-run {
  flex: 0 0 auto;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px; padding: 8px 14px;
  border: none; background: #262626; color: #fff; border-radius: 999px;
  font: inherit; cursor: pointer; white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  transition: background-color 0.125s ease, transform 0.125s ease;
}
.search-run-label {
  font-size: 13px; font-weight: 600; line-height: 1.15; letter-spacing: -0.01em;
}
.search-run-detail {
  font-size: 10px; font-weight: 500; line-height: 1.15;
  opacity: 0.72; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.search-run-detail[hidden] { display: none !important; }
.search-run:hover {
  background: #111;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.14), 0 8px 20px rgba(0, 0, 0, 0.14);
}
.search-run:active { transform: scale(0.98); }
.tag-mode-toggle {
  position: relative;
  flex: 0 0 auto;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  padding: 2px;
  margin-left: auto;
  border-radius: 999px;
  background: #ececec;
  border: 1px solid rgba(0, 0, 0, 0.06);
}
.search-bar:not(.is-stacked) .tag-mode-toggle { margin-left: 0; }
.tag-mode-toggle[hidden] { display: none !important; }
.tag-mode-thumb {
  position: absolute;
  top: 2px; bottom: 2px; left: 2px;
  width: calc(50% - 2px);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: transform 0.125s ease;
  pointer-events: none;
  z-index: 0;
}
.tag-mode-toggle[data-mode="and"] .tag-mode-thumb {
  transform: translateX(100%);
}
.tag-mode-btn {
  position: relative; z-index: 1;
  border: none; background: transparent; color: #999;
  padding: 5px 12px; border-radius: 999px;
  font: inherit; font-size: 11px; font-weight: 600; line-height: 1.2;
  cursor: pointer; white-space: nowrap;
  transition: color 0.125s ease;
}
.tag-mode-btn.active { color: #262626; }
.tag-mode-btn:hover:not(.active) { color: #666; }

.grid {
  width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  max-width: none; margin-inline: auto;
}
.grid.grid-resizing { pointer-events: none; }
.grid.is-masonry {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.masonry-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.grid-item {
  display: block; text-decoration: none; color: inherit;
  position: relative; aspect-ratio: 1; overflow: hidden; cursor: pointer;
  background: #efefef; z-index: 0; border-radius: 5px;
  transition: background-color 0.125s ease, border-radius 0.125s ease;
}
.grid-item-bg {
  position: absolute;
  inset: calc(-1 * var(--pick-bg-bleed));
  z-index: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transform: scale(var(--pick-bg-scale-from));
  transform-origin: center center;
  overflow: hidden;
}
.grid-item-bg-layer {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-image: var(--pick-bg-image);
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
  transform: translate3d(0, var(--pick-parallax-y, 0px), 0);
  will-change: transform;
}
.grid-item.selected .grid-item-bg {
  opacity: 1;
}
.grid-item.selected.pick-settled .grid-item-bg {
  transform: scale(var(--pick-bg-scale-to));
}
.grid-item.selected {
  z-index: 2;
  isolation: isolate;
  background: transparent;
  border-radius: var(--pick-outer-r);
}
.grid-item.selected:hover .grid-item-bg {
  opacity: 1;
}
.grid-item.selected:hover .grid-item-media img {
  transform: scale(1);
}
.grid-item-media {
  position: absolute; inset: 0; overflow: hidden; border-radius: 5px;
  z-index: 1;
  background: transparent;
  transform-origin: center center;
  box-sizing: border-box;
  padding: 0;
}
.grid-item.selected.pick-settled .grid-item-media {
  padding: var(--pick-inset);
  border-radius: var(--pick-inner-r);
}
.pick-badge {
  position: absolute; top: 6px; left: 6px; z-index: 4;
  min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px;
  background: #262626; color: #fff;
  font-size: 11px; font-weight: 600; line-height: 20px;
  text-align: center; pointer-events: none;
  transition: top 0.125s ease, left 0.125s ease, opacity 0.125s ease, transform 0.125s ease;
}
.grid-item.selected .pick-badge { top: 8px; left: 8px; }
.grid-item-media img {
  width: 100%; height: 100%; object-fit: cover; transform-origin: center center;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.48s cubic-bezier(0.22, 1, 0.36, 1), transform 0.125s ease;
}
.grid-item-media img.is-loaded { opacity: 1; }
.grid-item:not(.selected):not(.flip-animating):hover .grid-item-media img {
  transform: scale(1.02);
  transition: opacity 0.48s cubic-bezier(0.22, 1, 0.36, 1), transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
.grid-item.selected .grid-item-media img { transform: scale(1); }

@keyframes tileIn {
  0% { opacity: 0; transform: translateY(12px); }
  100% { opacity: 1; transform: translateY(0); }
}
.grid-item.enter {
  animation: tileIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.grid-item.flip-animating { z-index: 2; will-change: transform; transition: transform 0.64s cubic-bezier(0.22, 1, 0.36, 1); }
.grid-item.flip-animating .grid-item-media img { transition: transform 0.64s cubic-bezier(0.22, 1, 0.36, 1); }

.grid.is-masonry .grid-item {
  aspect-ratio: auto;
  width: 100%;
}
.grid.is-masonry .grid-item-media {
  position: relative;
  inset: auto;
  width: 100%;
  z-index: 1;
  background: transparent;
  transform-origin: center center;
  box-sizing: border-box;
  padding: 0;
  transition: none;
}
.grid.is-masonry .grid-item.selected {
  background: transparent;
  border-radius: var(--pick-outer-r);
}
.grid.is-masonry .grid-item.selected .grid-item-bg {
  border-radius: var(--pick-outer-r);
}
.grid.is-masonry .grid-item.selected.pick-settled .grid-item-media {
  padding: var(--pick-inset);
  border-radius: var(--pick-inner-r);
  overflow: hidden;
}
.grid.is-masonry .grid-item-media img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}
.grid.is-masonry .grid-item.selected .grid-item-media img {
  border-radius: var(--pick-inner-r);
  transform: scale(1);
}
.grid.is-masonry .grid-item.selected .pick-badge { top: 8px; left: 8px; }

.drop-zone {
  position: relative;
  min-height: 40vh;
}
.drop-zone.is-dragover::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 800;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.72);
  border: 2px dashed rgba(0, 0, 0, 0.14);
  margin: 16px;
  border-radius: 18px;
}

.import-bar[hidden] { display: none !important; }
.import-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 850;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 14px 20px 18px;
  background: rgba(255,255,255,.97); backdrop-filter: blur(16px);
  border-top: 1px solid #dbdbdb;
  box-shadow: 0 -8px 32px rgba(0,0,0,.08);
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.125s ease, opacity 0.125s ease;
}
.import-bar.is-visible {
  transform: translateY(0);
  opacity: 1;
}
body.has-import-bar { padding-bottom: 200px; }
.import-strip-wrap {
  width: 100%; max-width: 720px; display: flex; justify-content: center;
  overflow: visible;
}
.import-strip {
  display: flex; gap: 6px; overflow-x: auto; justify-content: flex-start;
  padding: 8px 8px 2px; scrollbar-width: thin; max-width: 100%;
}
.import-thumb {
  position: relative;
  width: 52px; height: 52px; border-radius: 8px; overflow: hidden;
  flex: 0 0 auto; background: #efefef; border: 1px solid #dbdbdb;
}
.import-thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.import-progress {
  position: absolute; inset: 0; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.48); color: #fff;
  font-size: 10px; font-weight: 600;
}
.import-check {
  position: absolute; inset: 0; z-index: 3;
  display: flex; align-items: center; justify-content: center;
  background: rgba(38, 38, 38, 0.72); color: #fff;
  font-size: 18px; font-weight: 700;
  transform: scale(0.8);
  transition: transform 0.125s ease, opacity 0.125s ease;
  opacity: 0;
}
.import-check.is-in {
  transform: scale(1);
  opacity: 1;
}
.import-error {
  position: absolute; inset: 0; z-index: 3;
  display: flex; align-items: center; justify-content: center;
  background: rgba(192, 57, 43, 0.85); color: #fff;
  font-size: 16px; font-weight: 700;
}
.import-actions {
  width: 100%; max-width: 720px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.import-status { font-size: 13px; color: #666; margin: 0; }
.import-flow-cta {
  border: none; background: #262626; color: #fff; border-radius: 999px;
  padding: 10px 18px; font: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  transition: background-color 0.125s ease, transform 0.125s ease;
}
.import-flow-cta:hover { background: #111; }
.import-flow-cta:active { transform: scale(0.98); }
.import-flow-cta[hidden] { display: none !important; }

.layout-controls {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
}
.layout-toggle {
  position: relative;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  padding: 2px;
  border-radius: 999px;
  background: #ececec;
  border: 1px solid rgba(0, 0, 0, 0.06);
}
.layout-toggle.cols-toggle {
  min-width: 72px;
}
.layout-toggle-thumb {
  position: absolute;
  top: 2px; bottom: 2px; left: 2px;
  width: calc(50% - 2px);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: transform 0.125s ease;
  pointer-events: none;
  z-index: 0;
}
.layout-toggle[data-mode="grid"] .layout-toggle-thumb,
.layout-toggle[data-cols="10"] .layout-toggle-thumb {
  transform: translateX(100%);
}
.layout-toggle-btn {
  position: relative; z-index: 1;
  border: none; background: transparent; color: #999;
  padding: 6px 14px; border-radius: 999px;
  font: inherit; font-size: 11px; font-weight: 600; line-height: 1.2;
  cursor: pointer; white-space: nowrap;
  transition: color 0.125s ease;
}
.cols-toggle .layout-toggle-btn {
  padding: 6px 16px;
}
.layout-toggle-btn.active { color: #262626; }
.layout-toggle-btn:hover:not(.active) { color: #666; }
@media (min-width: 1025px) { .layout-controls { display: inline-flex; } }

.container-strip {
  display: flex; gap: 6px; overflow-x: auto; justify-content: center; scrollbar-width: thin;
  padding: 8px 8px 2px;
}
.container-thumb {
  position: relative;
  width: 52px; height: 52px; border-radius: 8px; overflow: visible;
  flex: 0 0 auto; background: #efefef; border: 1px solid #dbdbdb; cursor: default;
}
.container-thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  border-radius: 7px;
}
.container-thumb-remove {
  position: absolute; top: -5px; right: -5px; z-index: 2;
  width: 18px; height: 18px; padding: 0; border: none; border-radius: 999px;
  background: #262626; color: #fff; font-size: 13px; line-height: 18px;
  text-align: center; cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
  transition: transform 0.125s ease, background-color 0.125s ease;
}
.container-thumb-remove:hover { background: #c0392b; transform: scale(1.08); }

/* Triggered UI — see philosophy_interaction.md */
.ui-enter {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.125s ease, transform 0.125s ease;
}
.ui-enter.is-in {
  opacity: 1;
  transform: scale(1);
}

.load-checkpoint[hidden] { display: none !important; }
.load-checkpoint {
  max-width: 520px; margin: 32px auto 48px; text-align: center;
  padding: 20px 24px; border-radius: 14px;
  background: rgba(255,255,255,.94); border: 1px solid #dbdbdb;
  box-shadow: 0 8px 32px rgba(0,0,0,.06);
  opacity: 0;
  transform: scale(0.95) translateY(8px);
  transition: opacity 0.125s ease, transform 0.125s ease;
}
.load-checkpoint.is-visible {
  opacity: 1;
  transform: scale(1) translateY(0);
}
.load-checkpoint-label { font-size: 14px; color: #8e8e8e; margin-bottom: 12px; }
.load-continue-btn {
  border: none; background: #262626; color: #fff; border-radius: 999px;
  padding: 10px 22px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.load-continue-btn:hover:not(:disabled) { background: #111; }
.load-continue-btn:disabled { opacity: 0.45; cursor: default; }

.moodboard-bar[hidden] { display: none !important; }
.moodboard-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 900;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 14px 20px 18px;
  background: rgba(255,255,255,.96); backdrop-filter: blur(16px);
  border-top: 1px solid #dbdbdb;
  box-shadow: 0 -8px 32px rgba(0,0,0,.06);
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.125s ease, opacity 0.125s ease;
}
.moodboard-bar.is-visible {
  transform: translateY(0);
  opacity: 1;
}
.moodboard-strip-wrap {
  width: 100%; max-width: 720px; display: flex; justify-content: center;
  overflow: visible;
}
.moodboard-actions {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px;
  width: 100%; max-width: 520px;
}
.moodboard-name {
  flex: 1 1 180px; min-width: 0; max-width: 320px;
  border: 1px solid #dbdbdb; border-radius: 999px;
  padding: 10px 16px; font: inherit; font-size: 13px;
  background: #fff; color: inherit; outline: none;
}
.moodboard-name:focus { border-color: #262626; }
.moodboard-cta {
  border: none; background: #262626; color: #fff; border-radius: 999px;
  padding: 10px 24px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  white-space: nowrap;
}
.moodboard-cta:disabled { opacity: 0.45; cursor: default; }
.moodboard-cta:not(:disabled):hover { background: #111; }
.moodboard-clear {
  border: 1px solid #dbdbdb; background: #fff; color: inherit; border-radius: 999px;
  padding: 10px 18px; font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.moodboard-clear:hover { border-color: #999; }
.moodboard-delete {
  border: none; background: #e74c3c; color: #fff; border-radius: 999px;
  padding: 10px 18px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.moodboard-delete:hover:not(:disabled) { background: #c0392b; }
.moodboard-delete:disabled { opacity: 0.45; cursor: default; }

body.has-bucket { padding-bottom: 200px; }

@media (max-width: 768px) { .grid:not(.is-masonry) { grid-template-columns: repeat(2, 1fr) !important; } }
@media (min-width: 769px) and (max-width: 1024px) { .grid:not(.is-masonry) { grid-template-columns: repeat(3, 1fr) !important; } }

.overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 1000; justify-content: center; align-items: center; }
.overlay.active { display: flex; }
.overlay.active.is-hero-opening {
  background: rgba(0,0,0,0);
  transition: background-color 280ms ease;
}
.overlay.active.is-hero-opening.show-backdrop { background: rgba(0,0,0,0.85); }

.lightbox-hero {
  position: fixed;
  margin: 0;
  padding: 0;
  z-index: 1002;
  border-radius: 3px;
  overflow: hidden;
  pointer-events: none;
  line-height: 0;
}
.lightbox-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 0;
}
.lightbox-hero[hidden] { display: none !important; }
.lightbox-hero.is-animating {
  transition:
    top var(--lightbox-ms) var(--lightbox-ease),
    left var(--lightbox-ms) var(--lightbox-ease),
    width var(--lightbox-ms) var(--lightbox-ease),
    height var(--lightbox-ms) var(--lightbox-ease),
    border-radius var(--lightbox-ms) var(--lightbox-ease);
}
.grid-item.is-lightbox-source .grid-item-media img {
  opacity: 0 !important;
  transition: none !important;
}

.modal {
  background: #fff; border-radius: 12px; max-width: 860px; width: 90%; max-height: 85vh;
  overflow: hidden; transform: scale(0.95); opacity: 0;
  transition: opacity 0.125s ease, transform 0.125s ease;
  display: flex; flex-direction: column;
}
.modal.is-preparing {
  opacity: 0;
  pointer-events: none;
}
/* Grow from grid tile → final frame; hero flies above (image in card stays hidden). */
.modal.is-growing {
  position: fixed;
  margin: 0;
  max-width: none;
  max-height: none;
  z-index: 1001;
  opacity: 1;
  transform: none;
  overflow: hidden;
  pointer-events: none;
  box-sizing: border-box;
  transition:
    top var(--lightbox-ms) var(--lightbox-ease),
    left var(--lightbox-ms) var(--lightbox-ease),
    width var(--lightbox-ms) var(--lightbox-ease),
    height var(--lightbox-ms) var(--lightbox-ease),
    border-radius var(--lightbox-ms) var(--lightbox-ease);
}
.modal.is-growing > * {
  width: var(--modal-grow-w, 100%);
  min-width: var(--modal-grow-w, 100%);
  box-sizing: border-box;
  flex-shrink: 0;
}
.modal.is-media-pending .modal-media-frame img,
.modal.is-media-pending .filename-copy {
  opacity: 0;
}
.modal.show,
.modal.ui-enter.is-in {
  transform: scale(1);
  opacity: 1;
}
.modal.closing {
  transform: scale(0.95);
  opacity: 0;
  pointer-events: none;
}
.modal-media {
  width: 100%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: #f5f5f5; position: relative;
  padding: 20px;
  box-sizing: border-box;
}
.modal-media-frame {
  display: inline-block;
  max-width: 100%;
  max-height: 50vh;
  border-radius: 3px;
  overflow: hidden;
  line-height: 0;
}
.modal-media-frame img {
  display: block;
  max-width: 100%;
  max-height: 50vh;
  width: auto;
  height: auto;
  border-radius: 0;
}
.filename-copy {
  position: absolute; bottom: 28px; right: 28px; background: rgba(0,0,0,0.6); color: #fff; border: none; font-size: 11px; padding: 5px 10px; border-radius: 6px; cursor: pointer; z-index: 3; }
.modal-info { padding: 24px; overflow-y: auto; }
.modal-date { font-size: 13px; color: #8e8e8e; margin-bottom: 16px; }
.desc-wrap { position: relative; margin-bottom: 16px; }
.description { font-size: 15px; line-height: 1.5; }
.copy-btn { position: absolute; right: 0; top: 0; background: #262626; color: #fff; border: none; font-size: 11px; padding: 4px 10px; border-radius: 6px; cursor: pointer; opacity: 0; }
.desc-wrap:hover .copy-btn { opacity: 1; }
.meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.tag { background: #efefef; font-size: 12px; padding: 4px 12px; border-radius: 20px; }
.tag-category { font-weight: 600; }
.tag-label { background: #fff; border: 1px solid #dbdbdb; color: #444; }
.tag-add {
  border: 1px dashed #bbb; background: transparent; color: #666; cursor: pointer;
  font: inherit; font-size: 12px; padding: 4px 12px; border-radius: 20px;
}
.tag-add:hover { border-color: #262626; color: #262626; }
.modal-tag-add {
  margin: 4px 0 12px; padding: 12px 14px; border-radius: 10px;
  background: #fafafa; border: 1px solid #efefef;
}
.modal-tag-add[hidden] { display: none !important; }
.modal-tag-field { position: relative; }
.modal-tag-input {
  width: 100%; border: 1px solid #dbdbdb; border-radius: 999px;
  padding: 8px 14px; font: inherit; font-size: 13px; background: #fff; color: inherit;
}
.modal-tag-input:focus { outline: none; border-color: #262626; }
.modal-tag-suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 5;
  background: #fff; border: 1px solid #dbdbdb; border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.08); overflow: hidden;
}
.modal-tag-suggest[hidden] { display: none !important; }
.modal-tag-suggest-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; text-align: left; border: none; background: transparent;
  padding: 9px 12px; font: inherit; font-size: 13px; cursor: pointer; color: inherit;
}
.modal-tag-suggest-item:hover { background: #f5f5f5; }
.modal-tag-suggest-kind {
  font-size: 10px; color: #8e8e8e; text-transform: uppercase; letter-spacing: .04em;
}
.modal-tag-similar {
  margin-top: 10px; padding: 10px 12px; border-radius: 8px;
  background: #fff8e6; border: 1px solid #f0d78c; font-size: 13px; line-height: 1.45;
}
.modal-tag-similar[hidden] { display: none !important; }
.modal-tag-similar-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.modal-tag-apply, .modal-tag-confirm {
  border: none; background: #262626; color: #fff; border-radius: 999px;
  padding: 6px 14px; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
}
.modal-tag-ignore, .modal-tag-cancel {
  border: 1px solid #dbdbdb; background: #fff; color: inherit; border-radius: 999px;
  padding: 6px 14px; font: inherit; font-size: 12px; cursor: pointer;
}
.modal-tag-actions {
  display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px;
}
.modal-size { font-size: 13px; color: #8e8e8e; }
.close-btn { position: absolute; top: 20px; right: 24px; background: rgba(255,255,255,0.9); border: none; width: 36px; height: 36px; border-radius: 50%; font-size: 18px; cursor: pointer; z-index: 1001; }

body.dark { background: #1a1a1a; color: #e0e0e0; --site-bg: #1a1a1a; }
body.dark .header-mark { color: inherit; }
body.dark .header p { color: #666; }
body.dark .header-links a { color: #666; }
body.dark .header-links a:hover { color: #eee; }
body.dark .search-bar, body.dark .search-suggest, body.dark .category-menu { background: #222; border-color: #333; }
body.dark .search-bar:focus-within {
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 10px 28px rgba(0, 0, 0, 0.28);
}
body.dark .category-trigger { color: #888; }
body.dark .category-trigger:hover { background: #2a2a2a; color: #eee; }
body.dark .category-pill-selected { background: #eee; color: #111; }
body.dark .category-menu-item:hover, body.dark .category-menu-item.is-active { background: #2a2a2a; }
body.dark .category-menu-count { color: #666; }
body.dark .search-pill.tag { background: #333; color: #ddd; border-color: #444; }
body.dark .search-suggest-item:hover { background: #2a2a2a; }
body.dark .search-suggest-header { color: #666; }
body.dark .search-filter-divider {
  background: linear-gradient(90deg, transparent, #3a3a3a 12%, #3a3a3a 88%, transparent);
}
body.dark .tag-mode-toggle { background: #2a2a2a; border-color: #444; }
body.dark .tag-mode-thumb { background: #444; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35); }
body.dark .tag-mode-btn.active { color: #eee; }
body.dark .tag-mode-btn:hover:not(.active) { color: #bbb; }
body.dark .header-links a.is-active { color: #eee; }
body.dark .drop-zone.is-dragover::after {
  background: rgba(26, 26, 26, 0.82);
  border-color: rgba(255, 255, 255, 0.16);
}
body.dark .import-bar { background: rgba(26,26,26,.97); border-color: #333; }
body.dark .import-status { color: #888; }
body.dark .import-flow-cta { background: #eee; color: #111; }
body.dark .import-flow-cta:hover { background: #fff; }
body.dark .import-thumb { background: #2a2a2a; border-color: #444; }
body.dark .layout-toggle { background: #2a2a2a; border-color: #444; }
body.dark .layout-toggle-thumb { background: #444; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35); }
body.dark .layout-toggle-btn.active { color: #eee; }
body.dark .layout-toggle-btn:hover:not(.active) { color: #bbb; }
body.dark .search-run {
  background: #eee; color: #111;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 6px 16px rgba(0, 0, 0, 0.24);
}
body.dark .search-run:hover {
  background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.22), 0 8px 20px rgba(0, 0, 0, 0.28);
}
body.dark .grid-item { background: #2a2a2a; }
body.dark .grid-item.selected { background: transparent; }
body.dark .pick-badge { background: #eee; color: #111; }

@media (prefers-reduced-motion: reduce) {
  .ui-enter, .moodboard-bar, .load-checkpoint, .grid-item, .grid-item-bg, .grid-item-media, .pick-badge,
  .tag-mode-thumb, .layout-toggle-thumb, .search-bar, .search-run, .search-pill,
  .lightbox-hero, .modal {
    transition: none !important;
    animation: none !important;
  }
  .modal.show, .modal.ui-enter.is-in { opacity: 1; transform: none; }
  .import-bar, .import-check, .import-thumb {
    transition: none !important;
    animation: none !important;
  }
  .grid-item.selected.pick-settled .grid-item-bg {
    transform: scale(var(--pick-bg-scale-to));
  }
  .grid-item-bg-layer {
    transform: none;
  }
  .grid-item.selected.pick-settled .grid-item-media {
    padding: var(--pick-inset);
  }
  .ui-enter { opacity: 1; transform: none; }
  .moodboard-bar.is-visible { transform: none; opacity: 1; }
  .load-checkpoint.is-visible { transform: none; opacity: 1; }
}
/* Public web deploy — browse only (server also 403s mutators). */
body.is-readonly .import-bar,
body.is-readonly #importFlowCta,
body.is-readonly .tag-add,
body.is-readonly #deleteAssetsBtn,
body.is-readonly #moodboardCta,
body.is-readonly #moodboardName,
body.is-readonly #modalTagAdd,
body.is-readonly #moodboardsLink,
body.is-readonly #moodboardsSep,
body.is-readonly #containerBar {
  display: none !important;
}

body.dark .load-checkpoint { background: rgba(26,26,26,.94); border-color: #333; }
body.dark .load-checkpoint-label { color: #888; }
body.dark .load-continue-btn { background: #eee; color: #111; }
body.dark .moodboard-bar { background: rgba(26,26,26,.96); border-color: #333; }
body.dark .moodboard-name { background: #222; border-color: #444; color: #e0e0e0; }
body.dark .moodboard-clear { background: #333; border-color: #444; color: #ddd; }
body.dark .moodboard-delete { background: #e74c3c; color: #fff; }
body.dark .moodboard-delete:hover:not(:disabled) { background: #c0392b; }
body.dark .container-thumb-remove { background: #eee; color: #111; }
body.dark .container-thumb-remove:hover { background: #e74c3c; color: #fff; }
body.dark .moodboard-name:focus { border-color: #eee; }
body.dark .moodboard-cta { background: #eee; color: #111; }
body.dark .moodboard-cta:not(:disabled):hover { background: #fff; }
body.dark .modal { background: #222; }
body.dark .modal-media { background: #1a1a1a; }
body.dark .tag { background: #333; color: #ccc; }
body.dark .tag-label { background: #2a2a2a; border-color: #444; color: #bbb; }
body.dark .tag-add { border-color: #555; color: #888; }
body.dark .tag-add:hover { border-color: #eee; color: #eee; }
body.dark .modal-tag-add { background: #1a1a1a; border-color: #333; }
body.dark .modal-tag-input { background: #222; border-color: #444; color: #e0e0e0; }
body.dark .modal-tag-suggest { background: #222; border-color: #333; }
body.dark .modal-tag-suggest-item:hover { background: #2a2a2a; }
body.dark .modal-tag-similar { background: #3a3520; border-color: #665c2a; color: #e8dca0; }
body.dark .modal-tag-ignore, body.dark .modal-tag-cancel { background: #333; border-color: #444; color: #ddd; }
body.dark .modal-tag-apply, body.dark .modal-tag-confirm { background: #eee; color: #111; }
body.dark .close-btn { background: rgba(50,50,50,0.9); color: #e0e0e0; }
