/* Photo Album Mode — gallery layouts and node view */

/* Theme tokens — align with global --surface / --text (light, dark, soft, glass) */
#photoAlbumRoot,
.photo-album-app {
  --bb-surface: var(--surface, #fff);
  --bb-surface-muted: var(--surface-muted, #f4f6f9);
  --bb-text: var(--text, #1f2937);
  --bb-text-muted: var(--text-muted, #64748b);
  --bb-muted-bg: var(--surface-muted, #f0f0f0);
  --bb-muted-surface: var(--surface-muted, rgba(0, 0, 0, 0.03));
  --bb-border: var(--border, #d2d2d2);
  --input-bg: var(--surface-muted, #fff);
  --photo-album-card-border: rgba(0, 0, 0, 0.22);
  --photo-album-card-border-hover: rgba(0, 0, 0, 0.32);
  color: var(--bb-text);
}

.photo-album-view-select {
  cursor: pointer;
}

.photo-album-view-select option,
#photoAlbumRoot #photoAlbumLensSelect option {
  background: var(--surface, #fff);
  color: var(--text, #1f2937);
}

html[data-theme="dark"] #photoAlbumRoot .photo-album-view-select,
html[data-theme="soft"] #photoAlbumRoot .photo-album-view-select,
html[data-theme="dark"] #photoAlbumRoot #photoAlbumLensSelect,
html[data-theme="soft"] #photoAlbumRoot #photoAlbumLensSelect {
  background: var(--input-bg, rgba(255, 255, 255, 0.06));
  color: var(--text, #eceff4);
  border-color: var(--photo-album-card-border, rgba(255, 255, 255, 0.22));
}

html[data-theme="dark"] #photoAlbumRoot .photo-album-view-select option,
html[data-theme="soft"] #photoAlbumRoot .photo-album-view-select option,
html[data-theme="dark"] #photoAlbumRoot #photoAlbumLensSelect option,
html[data-theme="soft"] #photoAlbumRoot #photoAlbumLensSelect option {
  background: var(--surface, #323846);
  color: var(--text, #eceff4);
}

html[data-theme="glass"] #photoAlbumRoot .photo-album-view-select,
html[data-theme="glass"] #photoAlbumRoot #photoAlbumLensSelect {
  background: rgba(16, 20, 32, 0.82) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-color: rgba(255, 255, 255, 0.28) !important;
  color: #f2f4f8 !important;
}

html[data-theme="glass"] #photoAlbumRoot .photo-album-view-select option,
html[data-theme="glass"] #photoAlbumRoot #photoAlbumLensSelect option {
  background: #1a2030;
  color: #f2f4f8;
}

html[data-a11y-view="contrast"] #photoAlbumRoot .photo-album-view-select,
html[data-a11y-view="contrast"] #photoAlbumRoot #photoAlbumLensSelect {
  border-width: 2px;
  font-weight: 600;
}

html[data-a11y-view="contrast"][data-theme="light"] #photoAlbumRoot .photo-album-view-select,
html[data-a11y-view="contrast"][data-theme="light"] #photoAlbumRoot #photoAlbumLensSelect {
  background: #fff;
  color: #000;
  border-color: #000;
}

html[data-a11y-view="contrast"][data-theme="dark"] #photoAlbumRoot .photo-album-view-select,
html[data-a11y-view="contrast"][data-theme="dark"] #photoAlbumRoot #photoAlbumLensSelect,
html[data-a11y-view="contrast"][data-theme="soft"] #photoAlbumRoot .photo-album-view-select,
html[data-a11y-view="contrast"][data-theme="soft"] #photoAlbumRoot #photoAlbumLensSelect,
html[data-a11y-view="contrast"][data-theme="glass"] #photoAlbumRoot .photo-album-view-select,
html[data-a11y-view="contrast"][data-theme="glass"] #photoAlbumRoot #photoAlbumLensSelect {
  background: #0a0a0a;
  color: #fff;
  border-color: #fff;
}

html[data-a11y-view="contrast"] #photoAlbumRoot .photo-album-view-select option,
html[data-a11y-view="contrast"] #photoAlbumRoot #photoAlbumLensSelect option {
  background: inherit;
  color: inherit;
}

html[data-a11y-view="comfort"] #photoAlbumRoot .photo-album-view-select,
html[data-a11y-view="comfort"] #photoAlbumRoot #photoAlbumLensSelect {
  font-size: 0.95rem;
  padding: 8px 10px;
}

.photo-album-smart-section {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
}

.photo-album-smart-section__head {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 2px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  user-select: none;
}

.photo-album-smart-section__title {
  flex: 1;
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.12), transparent);
  border-radius: 4px;
  padding: 2px 6px;
}

.photo-album-smart-section__head--active .photo-album-smart-section__title {
  font-weight: 600;
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.22), rgba(59, 130, 246, 0.08));
}

.photo-album-smart-list {
  list-style: none;
  margin: 4px 0 0;
  padding: 0 0 0 4px;
}

.photo-album-smart-group {
  list-style: none;
  margin: 8px 0 2px;
  padding: 0 6px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.55;
}

.photo-album-smart-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 4px 6px;
  cursor: pointer;
  font: inherit;
  color: inherit;
  border-radius: 6px;
}

.photo-album-smart-btn:hover {
  background: var(--bb-hover, rgba(0, 0, 0, 0.05));
}

.photo-album-smart-btn.active {
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.18), rgba(59, 130, 246, 0.1));
  font-weight: 600;
}

.photo-album-smart-btn__icon {
  flex-shrink: 0;
  width: 1.25rem;
  text-align: center;
}

.photo-album-smart-btn__label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-album-smart-btn__count {
  flex-shrink: 0;
  min-width: 1.5rem;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.75rem;
  text-align: center;
  background: rgba(139, 92, 246, 0.12);
  opacity: 0.85;
}

.photo-album-smart-divider {
  list-style: none;
  height: 1px;
  margin: 10px 4px 12px;
  background: var(--bb-border, rgba(0, 0, 0, 0.12));
}

.photo-album-smart-tag-picker {
  list-style: none;
  margin: 4px 0 6px;
  padding: 0 6px;
}

.photo-album-smart-tag-picker__label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.78rem;
  opacity: 0.7;
}

.photo-album-people-block {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--bb-border, rgba(0, 0, 0, 0.1));
}

.photo-album-people-title {
  margin: 0 0 6px;
  font-size: 0.95rem;
}

.photo-album-people-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}

.photo-album-people-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 0;
  border-bottom: 1px solid var(--bb-border, rgba(0, 0, 0, 0.06));
}

.photo-album-people-row__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 8px;
}

.photo-album-people-row__label {
  font-weight: 600;
}

.photo-album-people-row__name-field {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.photo-album-people-name-input,
.photo-album-face-name-input {
  flex: 1;
  min-width: 8rem;
  padding: 5px 8px;
  border: 1px solid var(--bb-border, rgba(0, 0, 0, 0.2));
  border-radius: 6px;
  font: inherit;
  font-size: 0.85rem;
}

.photo-album-people-row:last-child {
  border-bottom: none;
}

.photo-album-people-row__name {
  font-weight: 600;
  flex: 1;
  min-width: 5rem;
}

.photo-album-people-row__meta {
  font-size: 0.8rem;
  opacity: 0.7;
}

.photo-album-people-rename {
  flex-shrink: 0;
  font-size: 0.78rem;
  padding: 2px 8px;
}

.photo-album-photo-faces-detail {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 4px 0 8px;
}

.photo-album-face-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.photo-album-face-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.8rem;
  background: rgba(59, 130, 246, 0.12);
}

.photo-album-smart-tag-picker__select {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 5px 8px;
  border: 1px solid var(--bb-border, rgba(0, 0, 0, 0.15));
  border-radius: 6px;
  background: var(--bb-surface, #fff);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.photo-album-empty-hint {
  padding: 32px 16px;
}

.photo-album-editor .note-toolbar.photo-album-note-toolbar {
  margin-bottom: 8px;
}

.photo-album-title-bar {
  display: none;
}

.photo-album-view-bar,
.photo-album-tag-filter {
  display: none;
}

.photo-album-drop-zone {
  min-height: 120px;
  border: 2px dashed var(--bb-border, rgba(0, 0, 0, 0.15));
  border-radius: 8px;
  padding: 12px;
  transition: border-color 0.15s, background 0.15s;
}

/* Story edit: picker + slide strip can exceed viewport — scroll inside the canvas */
.photo-album-editor .photo-album-drop-zone {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.photo-album-editor .photo-album-drop-zone > .photo-album-gallery-shell:not(.hidden),
.photo-album-editor .photo-album-drop-zone > .photo-album-story-shell:not(.hidden),
.photo-album-editor .photo-album-drop-zone > .photo-album-node-shell:not(.hidden) {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.photo-album-editor .photo-album-drop-zone > .photo-album-gallery-shell:not(.hidden) {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.photo-album-editor .photo-album-drop-zone > .photo-album-gallery-shell:not(.hidden) .photo-album-gallery-shell__inner,
.photo-album-editor .photo-album-drop-zone > .photo-album-gallery-shell:not(.hidden) > .photo-album-compare,
.photo-album-editor .photo-album-drop-zone > .photo-album-gallery-shell:not(.hidden) > .photo-album-map-shell {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.photo-album-drop-zone--over {
  border-color: var(--bb-accent, #3b82f6);
  background: var(--bb-accent-soft, rgba(59, 130, 246, 0.08));
}

.photo-album-empty {
  opacity: 0.75;
  padding: 24px 12px;
  text-align: center;
}

.photo-album-detail-hint {
  font-size: 0.9rem;
  margin-top: 8px;
}

.photo-album-tag-chip {
  display: inline-block;
  padding: 1px 8px;
  margin: 2px 2px 0 0;
  border-radius: 999px;
  font-size: 0.8rem;
  background: var(--bb-accent-soft, rgba(59, 130, 246, 0.12));
}

.photo-album-auto-tag-chip {
  display: inline-block;
  padding: 1px 8px;
  margin: 2px 2px 0 0;
  border-radius: 999px;
  font-size: 0.8rem;
  border: 1px dashed var(--bb-border-muted, rgba(100, 116, 139, 0.45));
  background: var(--bb-surface-muted, rgba(148, 163, 184, 0.12));
  color: var(--bb-text-muted, #64748b);
}

.photo-album-node-view__auto-tags {
  margin-top: 0.35rem;
  font-size: 0.85rem;
  line-height: 1.5;
}

.photo-album-auto-tags-label {
  display: inline-block;
  margin-right: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--bb-text-muted, #64748b);
}

/* Gallery layouts */
.photo-album-gallery {
  width: 100%;
}

.photo-album-gallery--grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.photo-album-gallery--masonry {
  columns: 180px;
  column-gap: 12px;
}

.photo-album-gallery--masonry .photo-album-card {
  break-inside: avoid;
  margin-bottom: 12px;
}

.photo-album-gallery--timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.photo-album-gallery--timeline .photo-album-card {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 12px;
  align-items: start;
  text-align: left;
}

.photo-album-card {
  border: 1px solid var(--photo-album-card-border);
  background: var(--bb-surface);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.07);
  transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s;
  color: var(--bb-text);
  font: inherit;
}

.photo-album-card:hover {
  transform: translateY(-2px);
  border-color: var(--photo-album-card-border-hover);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.photo-album-card__thumb {
  position: relative;
  aspect-ratio: 1;
  background: var(--bb-muted-bg, #f0f0f0);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.photo-album-gallery--masonry .photo-album-card__thumb {
  aspect-ratio: auto;
  min-height: 100px;
}

.photo-album-gallery--timeline .photo-album-card__thumb {
  aspect-ratio: 4/3;
}

.photo-album-card__thumb img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

.photo-album-gallery--masonry .photo-album-card__thumb img {
  width: 100%;
  height: auto;
  max-height: 280px;
  object-fit: contain;
}

.photo-album-card__caption {
  padding: 6px 8px;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-top: 1px solid var(--photo-album-card-border);
  background: var(--bb-surface);
  color: var(--bb-text);
}

.photo-album-card__date {
  padding: 0 8px 8px;
  font-size: 0.75rem;
  color: var(--bb-text-muted);
}

.photo-album-card__badges {
  position: absolute;
  top: 6px;
  left: 6px;
  right: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  pointer-events: none;
  z-index: 2;
}

.photo-album-card__badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.02em;
  background: rgba(15, 23, 42, 0.72);
  color: #f8fafc;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.photo-album-card__badge--gps {
  background: rgba(22, 101, 52, 0.88);
}

.photo-album-card__badge--notes {
  background: rgba(37, 99, 235, 0.88);
}

.photo-album-card__badge--forum {
  background: rgba(124, 58, 237, 0.88);
}

.photo-album-node-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--bb-muted-surface);
  border: 1px solid var(--photo-album-card-border);
}

.photo-album-node-nav--overlay {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  margin: 0;
  padding: 3px 6px;
  gap: 4px;
  background: rgba(0, 0, 0, 0.48);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
  pointer-events: auto;
}

.photo-album-node-nav__btn {
  appearance: none;
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  line-height: 1;
  border-radius: 4px;
  padding: 2px 6px;
  font: inherit;
}

.photo-album-node-nav__btn--icon {
  font-size: 1.1rem;
  font-weight: 600;
  padding: 1px 5px;
  color: #fff;
  opacity: 0.92;
}

.photo-album-node-nav__btn--icon:hover,
.photo-album-node-nav__btn--icon:focus-visible {
  opacity: 1;
  background: rgba(255, 255, 255, 0.12);
}

.photo-album-node-nav__pos {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.88);
  min-width: 2.75rem;
  text-align: center;
  letter-spacing: 0.02em;
  user-select: none;
}

.photo-album-node-nav--overlay .photo-album-node-nav__pos {
  color: rgba(255, 255, 255, 0.88);
}

.photo-album-gallery--timeline .photo-album-card__caption,
.photo-album-gallery--timeline .photo-album-card__date {
  text-align: left;
  padding-left: 0;
}

.photo-album-card__loading,
.photo-album-card__err {
  opacity: 0.5;
  font-size: 1.2rem;
}

/* Node view (single photo) */
.photo-album-node-shell {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.photo-album-node-view {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.photo-album-node-view__image-wrap {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  background: var(--bb-muted-bg, #111);
  border-radius: 8px;
  padding: 8px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.photo-album-node-view__image-inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-album-node-view__img {
  display: block;
  max-width: 100%;
  max-height: min(72vh, 860px);
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
}

.photo-album-node-view__image-inner .photo-album-annotate-stage {
  max-width: 100%;
}

.photo-album-node-view__image-inner .photo-album-annotate-stage .photo-album-node-view__img {
  max-width: 100%;
  max-height: min(72vh, 860px);
}

.photo-album-node-view__meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 0 0 auto;
  font-size: 0.9rem;
}

.photo-album-node-view__tags {
  width: 100%;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--bb-border, #ccc);
  font: inherit;
}

.photo-album-node-view__title.note-editor-title {
  width: 100%;
}

.photo-album-node-view__desc {
  width: 100%;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid var(--bb-border, #ccc);
  font: inherit;
  resize: vertical;
}

.photo-album-detail-note {
  font-size: 0.85rem;
  opacity: 0.75;
}

.photo-album-node-view__date-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--bb-muted-surface, rgba(0, 0, 0, 0.03));
  border: 1px solid var(--bb-border, rgba(0, 0, 0, 0.08));
}

.photo-album-node-view__date-line {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: baseline;
}

.photo-album-node-view__date-label {
  font-weight: 600;
  opacity: 0.82;
}

.photo-album-node-view__date-value {
  opacity: 0.92;
}

.photo-album-node-view__date-row input {
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--bb-border, #ccc);
  font: inherit;
}

.photo-album-node-view__auto-caption {
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--bb-muted-surface, rgba(0, 0, 0, 0.03));
  border: 1px solid var(--bb-border, rgba(0, 0, 0, 0.08));
}

.photo-album-node-view__auto-caption-label {
  font-size: 0.82rem;
  font-weight: 600;
  opacity: 0.82;
  margin-bottom: 4px;
}

.photo-album-node-view__auto-caption-text {
  margin: 0 0 8px;
  font-size: 0.88rem;
  line-height: 1.4;
}

.photo-album-node-view__auto-caption-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.photo-album-caption-block {
  margin: 4px 0 8px;
}

.photo-album-caption-status {
  margin: 6px 0 0;
  font-size: 0.88rem;
  min-height: 1.25rem;
  color: var(--bb-accent, #2563eb);
}

.photo-album-caption-status--error {
  color: #b45309;
}

.photo-album-toolbar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.photo-album-node-view__replace {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.photo-album-pending-hint {
  margin: 0;
  font-size: 0.85rem;
  opacity: 0.85;
}

.photo-album-pending-hint.hidden {
  display: none;
}

html[data-theme="dark"] #photoAlbumRoot,
html[data-theme="soft"] #photoAlbumRoot,
html[data-theme="glass"] #photoAlbumRoot {
  --photo-album-card-border: rgba(255, 255, 255, 0.22);
  --photo-album-card-border-hover: rgba(255, 255, 255, 0.34);
  --input-bg: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .photo-album-empty,
html[data-theme="soft"] .photo-album-empty,
html[data-theme="glass"] .photo-album-empty,
html[data-theme="dark"] .photo-album-detail-hint,
html[data-theme="soft"] .photo-album-detail-hint,
html[data-theme="glass"] .photo-album-detail-hint,
html[data-theme="dark"] .photo-album-detail-note,
html[data-theme="soft"] .photo-album-detail-note,
html[data-theme="glass"] .photo-album-detail-note {
  color: var(--bb-text-muted);
}

html[data-theme="glass"] .photo-album-card,
html[data-theme="glass"] .photo-album-flip-page,
html[data-theme="glass"] .photo-album-drop-zone,
html[data-theme="glass"] .photo-album-annotate-toolbar-wrap,
html[data-theme="glass"] .photo-album-batch-bar,
html[data-theme="glass"] .photo-album-node-nav:not(.photo-album-node-nav--overlay),
html[data-theme="glass"] .photo-album-compare__toolbar,
html[data-theme="glass"] .photo-album-compare__pane,
html[data-theme="glass"] .photo-album-story-shell,
html[data-theme="glass"] .photo-album-map-shell {
  background: rgba(255, 255, 255, 0.07) !important;
  backdrop-filter: blur(14px) saturate(1.25);
  -webkit-backdrop-filter: blur(14px) saturate(1.25);
  border-color: var(--glass-edge, rgba(255, 255, 255, 0.22)) !important;
  color: var(--text);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset;
}

html[data-theme="glass"] .photo-album-node-nav--overlay {
  background: rgba(0, 0, 0, 0.52) !important;
  border-color: rgba(255, 255, 255, 0.16) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

html[data-theme="glass"] .photo-album-card__caption,
html[data-theme="glass"] .photo-album-flip-tile__title,
html[data-theme="glass"] .photo-album-flip-toc__title,
html[data-theme="glass"] .photo-album-node-view__title,
html[data-theme="glass"] .photo-album-node-view__desc,
html[data-theme="glass"] .photo-album-node-view__tags,
html[data-theme="glass"] .photo-album-smart-btn__label,
html[data-theme="glass"] .photo-album-annotate-style__label {
  color: var(--text);
}

html[data-theme="glass"] .photo-album-card__date,
html[data-theme="glass"] .photo-album-flip-toc,
html[data-theme="glass"] .photo-album-flip-toc__meta,
html[data-theme="glass"] .photo-album-flip-pager,
html[data-theme="glass"] .photo-album-node-view__date-label,
html[data-theme="glass"] .photo-album-node-view__date-value,
html[data-theme="glass"] .photo-album-smart-btn__count,
html[data-theme="glass"] .photo-album-annotate-toolbar__count,
html[data-theme="glass"] .photo-album-annotate-toolbar__hint {
  color: var(--text-muted);
}

html[data-theme="glass"] .photo-album-flip-shell {
  background: rgba(255, 255, 255, 0.04) !important;
}

html[data-theme="glass"] .photo-album-flip-toc {
  background: rgba(255, 255, 255, 0.05) !important;
}

html[data-theme="glass"] .photo-album-card__loading,
html[data-theme="glass"] .photo-album-card__err,
html[data-theme="glass"] .photo-album-flip-tile__loading {
  color: var(--text-muted);
}

/* Compare view — side-by-side */
.photo-album-compare {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px 0;
}

.photo-album-compare__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--bb-surface-muted, rgba(0, 0, 0, 0.03));
  border: 1px solid var(--bb-border, #ddd);
}

.photo-album-compare__hint {
  margin: 0;
  font-size: 0.85rem;
  opacity: 0.85;
  flex: 1 1 200px;
}

.photo-album-compare__pickers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
}

.photo-album-compare__pickers label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
}

.photo-album-compare__pickers select {
  min-width: 140px;
  max-width: 220px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--bb-border, #ccc);
  font: inherit;
}

.photo-album-compare__panes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  min-height: 280px;
}

@media (max-width: 900px) {
  .photo-album-compare__panes {
    grid-template-columns: 1fr;
  }
}

.photo-album-compare__pane {
  border: 1px solid var(--photo-album-card-border, rgba(0, 0, 0, 0.22));
  border-radius: 8px;
  overflow: hidden;
  background: var(--bb-surface, #fff);
  display: flex;
  flex-direction: column;
}

.photo-album-compare__pane-head {
  padding: 8px 10px;
  font-weight: 600;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--photo-album-card-border, rgba(0, 0, 0, 0.15));
}

.photo-album-compare__pane-image {
  flex: 1;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bb-surface-muted, #f5f5f5);
}

.photo-album-compare__pane-image img {
  max-width: 100%;
  max-height: 360px;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
}

.photo-album-compare__pane-meta {
  padding: 8px 10px;
  font-size: 0.85rem;
  border-top: 1px solid var(--photo-album-card-border, rgba(0, 0, 0, 0.12));
}

.photo-album-compare__pane-empty {
  opacity: 0.6;
  font-size: 0.9rem;
}

.photo-album-card--compare-a {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.photo-album-card--compare-b {
  outline: 2px solid #d97706;
  outline-offset: 2px;
}

.photo-album-gallery-shell__inner {
  min-height: 0;
}

.photo-album-batch-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--photo-album-card-border, rgba(0, 0, 0, 0.22));
  border-radius: 8px;
  background: var(--photo-album-batch-bar-bg, rgba(0, 0, 0, 0.03));
}

.photo-album-batch-bar__left,
.photo-album-batch-bar__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.photo-album-batch-bar__count {
  font-size: 0.9rem;
  font-weight: 600;
  min-width: 8rem;
}

.photo-album-batch-bar__tags {
  min-width: 12rem;
  max-width: 18rem;
  padding: 6px 10px;
  border: 1px solid var(--photo-album-card-border, rgba(0, 0, 0, 0.22));
  border-radius: 6px;
  font: inherit;
  background: var(--input-bg, #fff);
  color: inherit;
}

.photo-album-batch-bar__move {
  min-width: 11rem;
  max-width: 16rem;
}

.photo-album-batch-bar__delete:not(:disabled) {
  color: #b91c1c;
}

.photo-album-batch-bar__done {
  margin-left: 4px;
}

.photo-album-card--batch {
  cursor: pointer;
}

.photo-album-card--batch-selected {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.photo-album-card--batch-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.photo-album-card__batch-check {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: 2px solid rgba(255, 255, 255, 0.95);
  background: rgba(0, 0, 0, 0.35);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.photo-album-card--batch-selected .photo-album-card__batch-check {
  background: #2563eb;
  border-color: #fff;
}

.photo-album-card--batch-selected .photo-album-card__batch-check::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.photo-album-main-header .photo-album-batch-btn[aria-pressed="true"] {
  background: rgba(37, 99, 235, 0.12);
  border-color: #2563eb;
}

.photo-album-compare-picker-grid {
  margin-top: 4px;
}

.photo-album-compare-picker-grid .photo-album-gallery {
  max-height: 240px;
  overflow-y: auto;
}

.photo-album-main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.photo-album-main-header__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.photo-album-slideshow-btn:not(:disabled),
.photo-album-export-video-btn:not(:disabled),
.photo-album-share-video-btn:not(:disabled),
.photo-album-batch-btn:not(:disabled),
.photo-album-flip-btn:not(:disabled) {
  flex-shrink: 0;
}

.photo-album-export-block {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--photo-album-card-border, rgba(0, 0, 0, 0.12));
}

.photo-album-export-block__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
}

.photo-album-slideshow {
  position: fixed;
  inset: 0;
  z-index: 100200;
  display: flex;
  flex-direction: column;
  background: #000;
  color: #f8fafc;
}

.photo-album-slideshow.hidden {
  display: none;
}

.photo-album-slideshow__stage {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.photo-album-slideshow__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  opacity: 0;
  transition: opacity 0.85s ease-in-out;
  pointer-events: none;
  user-select: none;
}

.photo-album-slideshow__img.is-active {
  opacity: 1;
}

.photo-album-slideshow__chrome {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 14px 20px 18px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.35));
  flex-shrink: 0;
}

.photo-album-slideshow__nav {
  min-width: 2.75rem;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  font: inherit;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.photo-album-slideshow__nav:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.18);
}

.photo-album-slideshow__nav:disabled {
  opacity: 0.35;
  cursor: default;
}

.photo-album-slideshow__meta {
  flex: 1;
  min-width: 0;
  text-align: center;
}

.photo-album-slideshow__title {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.photo-album-slideshow__count {
  display: block;
  margin-top: 4px;
  font-size: 0.85rem;
  opacity: 0.75;
}

.photo-album-slideshow__hint {
  font-size: 0.8rem;
  opacity: 0.55;
  white-space: nowrap;
}

body.photo-album-slideshow-open {
  overflow: hidden;
}

.photo-album-slideshow__caption {
  display: block;
  margin-top: 2px;
  font-size: 0.82rem;
  opacity: 0.7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.photo-album-slideshow__caption.hidden {
  display: none;
}

/* —— Photo Stories —— */
.photo-album-stories-section {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
}

.photo-album-stories-section__head {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 2px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  user-select: none;
}

.photo-album-stories-section__title {
  flex: 1;
  background: linear-gradient(90deg, rgba(234, 88, 12, 0.12), transparent);
  border-radius: 4px;
  padding: 2px 6px;
}

.photo-album-stories-section__head--active .photo-album-stories-section__title {
  background: linear-gradient(90deg, rgba(234, 88, 12, 0.22), rgba(251, 191, 36, 0.08));
}

.photo-album-stories-section__new {
  padding: 0 8px;
  min-width: 0;
  line-height: 1.4;
}

.photo-album-stories-list {
  list-style: none;
  margin: 4px 0 0;
  padding: 0 0 0 4px;
}

.photo-album-stories-empty {
  list-style: none;
  padding: 4px 8px;
  font-size: 0.82rem;
  opacity: 0.65;
}

.photo-album-stories-divider {
  list-style: none;
  height: 1px;
  margin: 8px 6px 10px;
  background: var(--bb-border, rgba(0, 0, 0, 0.08));
}

.photo-album-story-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 4px 6px;
  cursor: pointer;
  font: inherit;
  color: inherit;
  border-radius: 6px;
}

.photo-album-story-btn:hover {
  background: var(--bb-hover, rgba(0, 0, 0, 0.05));
}

.photo-album-story-btn.active {
  background: rgba(234, 88, 12, 0.14);
  font-weight: 600;
}

.photo-album-story-btn__label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-album-story-btn__count {
  font-size: 0.75rem;
  opacity: 0.6;
  min-width: 1.25rem;
  text-align: right;
}

.photo-album-story-shell {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.photo-album-story-view {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px 4px 24px;
}

.photo-album-story-view__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}

.photo-album-story-view__title {
  flex: 1;
  min-width: 180px;
  font-size: 1.25rem;
  font-weight: 600;
  padding: 6px 10px;
  border: 1px solid var(--bb-border, rgba(0, 0, 0, 0.12));
  border-radius: 8px;
  background: var(--bb-surface, #fff);
}

.photo-album-story-view__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.photo-album-story-view__hint {
  margin: 0;
  font-size: 0.88rem;
  opacity: 0.72;
}

.photo-album-story-add-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
}

.photo-album-story-add-panel {
  margin: 8px 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--bb-border, rgba(0, 0, 0, 0.1));
  border-radius: 10px;
  background: var(--bb-muted-surface, rgba(0, 0, 0, 0.02));
}

.photo-album-story-add-panel__meta {
  margin: 0 0 12px;
  font-size: 0.88rem;
  font-weight: 600;
}

.photo-album-story-add-panel__head {
  margin-bottom: 8px;
}

.photo-album-story-add-panel__title {
  margin: 0 0 2px;
  font-size: 0.95rem;
  font-weight: 600;
}

.photo-album-story-add-panel__hint {
  margin: 0;
  font-size: 0.82rem;
  opacity: 0.72;
}

.photo-album-story-add-panel__upload-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--bb-border, rgba(0, 0, 0, 0.08));
}

.photo-album-story-add-panel__status {
  margin: 0;
  font-size: 0.82rem;
  opacity: 0.85;
}

.photo-album-story-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 10px;
  max-height: min(280px, 40vh);
  overflow-y: auto;
  padding: 4px 2px 8px;
  -webkit-overflow-scrolling: touch;
}

.photo-album-story-picker__empty {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.85rem;
  opacity: 0.7;
}

.photo-album-story-picker__thumb {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px;
  border: 2px solid transparent;
  border-radius: 8px;
  background: var(--bb-surface, #fff);
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.photo-album-story-picker__thumb:hover {
  border-color: rgba(234, 88, 12, 0.45);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.photo-album-story-picker__thumb-img {
  aspect-ratio: 1;
  border-radius: 5px;
  overflow: hidden;
  background: var(--bb-muted, rgba(0, 0, 0, 0.04));
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-album-story-picker__thumb-img img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
}

.photo-album-story-picker__thumb-label {
  font-size: 0.68rem;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0.85;
}

.photo-album-story-strip {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 8px 4px 16px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.photo-album-story-strip__empty {
  margin: 0;
  opacity: 0.65;
}

.photo-album-story-slide {
  flex: 0 0 min(280px, 72vw);
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--bb-border, rgba(0, 0, 0, 0.1));
  border-radius: 10px;
  padding: 10px;
  background: var(--bb-surface, #fff);
}

.photo-album-story-slide__thumb {
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bb-muted, rgba(0, 0, 0, 0.04));
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-album-story-slide__thumb img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
}

.photo-album-story-slide__caption {
  width: 100%;
  resize: vertical;
  min-height: 2.5rem;
  font: inherit;
  padding: 6px 8px;
  border: 1px solid var(--bb-border, rgba(0, 0, 0, 0.12));
  border-radius: 6px;
}

.photo-album-story-slide__caption-text {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.35;
}

.photo-album-story-slide__tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.photo-album-story-export-overlay {
  position: fixed;
  inset: 0;
  z-index: 100300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  padding: 24px;
}

.photo-album-story-export-overlay.hidden {
  display: none;
}

.photo-album-story-export-overlay__card {
  width: min(420px, 100%);
  padding: 20px 22px;
  border-radius: 12px;
  background: var(--bb-surface, #fff);
  color: inherit;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.photo-album-story-export-overlay__title {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 600;
}

.photo-album-story-export-overlay__msg {
  margin: 0 0 14px;
  font-size: 0.9rem;
  opacity: 0.8;
}

.photo-album-story-export-overlay__bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.photo-album-story-export-overlay__fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #ea580c, #f59e0b);
  transition: width 0.2s ease;
}

/* Photo versions (non-destructive replace / restore) */
.photo-album-versions-block {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--photo-album-card-border, rgba(0, 0, 0, 0.12));
}

.photo-album-versions-block__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 8px;
}

.photo-album-versions-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.photo-album-versions-list__item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--photo-album-card-border, rgba(0, 0, 0, 0.15));
  border-radius: 8px;
  background: var(--bb-muted-surface, rgba(0, 0, 0, 0.02));
}

.photo-album-versions-list__label {
  font-size: 0.88rem;
}

.photo-album-versions-list__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.photo-album-node-versions-mount {
  margin: 4px 0 8px;
}

.photo-album-node-versions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
}

.photo-album-node-versions__count {
  font-weight: 600;
}

.photo-album-node-view__image-wrap--version-compare {
  display: block;
}

.photo-album-node-view__image-wrap--version-compare .photo-album-node-view__image-inner {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  max-height: min(72vh, 860px);
  overflow: auto;
}

.photo-album-version-compare__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.photo-album-version-compare__title {
  font-size: 0.9rem;
  font-weight: 600;
}

.photo-album-version-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
}

@media (max-width: 720px) {
  .photo-album-version-compare {
    grid-template-columns: 1fr;
  }
}

.photo-album-version-compare__pane {
  border: 1px solid var(--photo-album-card-border, rgba(0, 0, 0, 0.2));
  border-radius: 8px;
  overflow: hidden;
  background: var(--bb-muted-bg, #f0f0f0);
}

.photo-album-version-compare__label {
  padding: 6px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  border-bottom: 1px solid var(--photo-album-card-border, rgba(0, 0, 0, 0.12));
  background: var(--bb-muted-surface, rgba(0, 0, 0, 0.03));
}

.photo-album-version-compare__img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: contain;
  object-position: center;
}

/* Map view (EXIF GPS) */
.photo-album-map-shell {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 420px;
  height: 100%;
}

.photo-album-map-shell__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
}

.photo-album-map-shell__count {
  font-weight: 600;
  font-size: 0.95rem;
}

.photo-album-map-shell__hint {
  font-size: 0.84rem;
  opacity: 0.72;
}

.photo-album-map-shell__empty {
  margin: 0;
  padding: 12px 14px;
  border: 1px dashed var(--photo-album-card-border, rgba(0, 0, 0, 0.2));
  border-radius: 8px;
  font-size: 0.9rem;
  opacity: 0.85;
}

.photo-album-map {
  flex: 1 1 420px;
  min-height: 420px;
  width: 100%;
  border: 1px solid var(--photo-album-card-border, rgba(0, 0, 0, 0.22));
  border-radius: 10px;
  overflow: hidden;
  z-index: 1;
}

.photo-album-map-popup {
  min-width: 10rem;
}

.photo-album-map-popup__date {
  margin: 4px 0 8px;
  font-size: 0.82rem;
  opacity: 0.75;
}

.photo-album-map-popup__open {
  margin-top: 4px;
}

.photo-album-node-view__map-btn {
  margin-left: 8px;
}

html[data-theme="dark"] .photo-album-map,
html[data-theme="soft"] .photo-album-map {
  border-color: rgba(255, 255, 255, 0.22);
}

/* Photo annotations (SVG overlays) */
.photo-album-annotate-stage {
  position: relative;
  display: inline-block;
  max-width: 100%;
  line-height: 0;
}

.photo-album-annotate-svg {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.photo-album-annotate-svg--edit {
  pointer-events: auto;
  cursor: crosshair;
}

.photo-album-annotate-toolbar-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.photo-album-annotate-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--photo-album-card-border, rgba(0, 0, 0, 0.2));
  border-radius: 8px;
  background: var(--bb-muted-surface, rgba(0, 0, 0, 0.03));
}

.photo-album-annotate-style {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 10px 12px;
  border: 1px solid var(--photo-album-card-border, rgba(0, 0, 0, 0.2));
  border-radius: 8px;
  background: var(--bb-muted-surface, rgba(0, 0, 0, 0.02));
}

.photo-album-annotate-style__label {
  font-size: 0.85rem;
  font-weight: 600;
}

.photo-album-annotate-style__field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.84rem;
}

.photo-album-annotate-style__field select {
  font: inherit;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--photo-album-card-border, rgba(0, 0, 0, 0.2));
  background: var(--input-bg, #fff);
  color: inherit;
}

.photo-album-annotate-style__selected {
  font-size: 0.82rem;
  opacity: 0.75;
  margin-left: auto;
}

.photo-album-annotate-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.photo-album-annotate-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.2);
  padding: 0;
  cursor: pointer;
}

.photo-album-annotate-swatch--light {
  border-color: rgba(0, 0, 0, 0.35);
}

.photo-album-annotate-swatch--active {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.photo-album-annotate-svg--select {
  cursor: default;
}

.photo-album-annotate-svg--dragging,
.photo-album-annotate-svg--dragging .photo-album-annotate-stage {
  cursor: grabbing;
}

.photo-album-annotate-toolbar__label {
  font-size: 0.85rem;
  font-weight: 600;
}

.photo-album-annotate-toolbar__sep {
  width: 1px;
  height: 1.4rem;
  background: var(--photo-album-card-border, rgba(0, 0, 0, 0.15));
  margin: 0 2px;
}

.photo-album-annotate-toolbar__btn--active {
  background: rgba(37, 99, 235, 0.12);
  border-color: #2563eb;
}

.photo-album-annotate-toolbar__save:not(:disabled) {
  border-color: #16a34a;
}

.photo-album-annotate-toolbar__count,
.photo-album-annotate-toolbar__hint {
  font-size: 0.84rem;
  opacity: 0.75;
  margin-left: auto;
}

.photo-album-annotate-toolbar__hint {
  margin-left: 0;
}

@media (max-width: 720px) {
  .photo-album-annotate-toolbar__count,
  .photo-album-annotate-toolbar__hint {
    margin-left: 0;
    width: 100%;
  }
}

/* —— Flip-View —— */
.archive-app--flip .photo-album-editor .note-toolbar.photo-album-note-toolbar {
  display: none;
}

.archive-app--flip .photo-album-editor .photo-album-drop-zone {
  padding: 0;
  border-color: transparent;
}

.photo-album-gallery-shell__inner--flip {
  min-height: 320px;
}

.photo-album-flip-shell {
  display: flex;
  align-items: stretch;
  gap: 0;
  min-height: 360px;
  background: linear-gradient(165deg, #f4f1ea 0%, #ebe6dc 45%, #e2ddd2 100%);
  border-radius: 8px;
  overflow: hidden;
}

.photo-album-flip-toc {
  flex: 0 0 200px;
  min-width: 160px;
  max-width: 240px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 12px 10px;
  background: rgba(255, 255, 255, 0.42);
  border-right: 1px solid rgba(15, 23, 42, 0.08);
  color: #475569;
  font-size: 0.82rem;
}

.photo-album-flip-toc__head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
  flex-shrink: 0;
}

.photo-album-flip-toc__label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
}

.photo-album-flip-toc__sort-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
}

.photo-album-flip-toc__sort {
  flex: 1;
  min-width: 0;
  font-size: 0.78rem;
  padding: 2px 4px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  background: #fff;
}

.photo-album-flip-toc__list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.photo-album-flip-toc__item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 8px;
  margin-bottom: 2px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.photo-album-flip-toc__item:hover {
  background: rgba(255, 255, 255, 0.65);
  border-color: rgba(148, 163, 184, 0.35);
}

.photo-album-flip-toc__item--active {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.25);
}

.photo-album-flip-toc__title {
  font-weight: 600;
  color: var(--bb-text, #334155);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.photo-album-flip-toc__meta {
  font-size: 0.72rem;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.photo-album-flip-stage {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 14px 18px 18px;
  min-height: 0;
}

.photo-album-flip-stage__toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 4px;
  flex-shrink: 0;
}

.photo-album-flip-pager {
  font-size: 0.85rem;
  color: #64748b;
  min-width: 8rem;
  text-align: center;
}

.photo-album-flip-book {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.photo-album-flip-stage__inner--perspective {
  perspective: 1800px;
  width: 100%;
  max-width: 920px;
  min-height: 280px;
}

.photo-album-flip-spread {
  display: grid;
  grid-template-columns: 1fr 10px 1fr;
  gap: 0;
  min-height: 280px;
  transform-style: preserve-3d;
}

.photo-album-flip-page {
  background: linear-gradient(145deg, #fffef9 0%, #faf8f2 100%);
  border: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow:
    inset 0 0 24px rgba(15, 23, 42, 0.04),
    0 8px 24px rgba(15, 23, 42, 0.08);
  padding: 12px;
  min-height: 260px;
}

.photo-album-flip-page--left {
  border-radius: 8px 2px 2px 8px;
}

.photo-album-flip-page--right {
  border-radius: 2px 8px 8px 2px;
}

.photo-album-flip-spine {
  background: linear-gradient(to right, rgba(15, 23, 42, 0.12), rgba(15, 23, 42, 0.04), rgba(15, 23, 42, 0.12));
  border-radius: 2px;
}

.photo-album-flip-page__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 10px;
  height: 100%;
  min-height: 220px;
}

.photo-album-flip-tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  min-height: 0;
}

.photo-album-flip-tile--empty {
  pointer-events: none;
  opacity: 0.25;
  border: 1px dashed rgba(148, 163, 184, 0.35);
  border-radius: 6px;
}

.photo-album-flip-tile__thumb {
  flex: 1;
  min-height: 72px;
  border-radius: 6px;
  overflow: hidden;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.1);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.photo-album-flip-tile:hover .photo-album-flip-tile__thumb {
  transform: scale(1.02);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.16);
}

.photo-album-flip-tile__thumb img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

.photo-album-flip-tile__loading,
.photo-album-flip-tile__empty {
  font-size: 0.85rem;
  color: #94a3b8;
}

.photo-album-flip-tile__title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--bb-text, #334155);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.photo-album-flip-spread--out-next {
  animation: photoAlbumFlipOutNext 0.65s ease-in-out forwards;
  transform-origin: left center;
}

.photo-album-flip-spread--out-prev {
  animation: photoAlbumFlipOutPrev 0.65s ease-in-out forwards;
  transform-origin: right center;
}

.photo-album-flip-spread--in-next {
  animation: photoAlbumFlipInNext 0.65s ease-in-out forwards;
  transform-origin: left center;
}

.photo-album-flip-spread--in-prev {
  animation: photoAlbumFlipInPrev 0.65s ease-in-out forwards;
  transform-origin: right center;
}

@keyframes photoAlbumFlipOutNext {
  0% { transform: rotateY(0deg); opacity: 1; }
  100% { transform: rotateY(-88deg); opacity: 0; }
}

@keyframes photoAlbumFlipOutPrev {
  0% { transform: rotateY(0deg); opacity: 1; }
  100% { transform: rotateY(88deg); opacity: 0; }
}

@keyframes photoAlbumFlipInNext {
  0% { transform: rotateY(88deg); opacity: 0; }
  100% { transform: rotateY(0deg); opacity: 1; }
}

@keyframes photoAlbumFlipInPrev {
  0% { transform: rotateY(-88deg); opacity: 0; }
  100% { transform: rotateY(0deg); opacity: 1; }
}

/* Flip-View manual fullscreen (no auto-advance) */
.photo-album-flip-fs {
  position: fixed;
  inset: 0;
  z-index: 100210;
  display: flex;
  flex-direction: column;
  background: #0f172a;
  color: #f8fafc;
}

.photo-album-flip-fs.hidden {
  display: none;
}

.photo-album-flip-fs__stage {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.photo-album-flip-fs__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  opacity: 0;
  transition: opacity 0.35s ease-in-out;
  pointer-events: none;
  user-select: none;
}

.photo-album-flip-fs__img.is-active {
  opacity: 1;
}

.photo-album-flip-fs__chrome {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 14px 20px 18px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.88), rgba(0, 0, 0, 0.35));
  flex-shrink: 0;
}

.photo-album-flip-fs__nav {
  min-width: 2.75rem;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  font: inherit;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.photo-album-flip-fs__nav:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.18);
}

.photo-album-flip-fs__nav:disabled {
  opacity: 0.35;
  cursor: default;
}

.photo-album-flip-fs__meta {
  flex: 1;
  min-width: 0;
  text-align: center;
}

.photo-album-flip-fs__title {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.photo-album-flip-fs__count {
  display: block;
  margin-top: 4px;
  font-size: 0.85rem;
  opacity: 0.75;
}

.photo-album-flip-fs__hint {
  font-size: 0.8rem;
  opacity: 0.55;
  white-space: nowrap;
}

body.photo-album-flip-fs-open {
  overflow: hidden;
}

@media (max-width: 860px) {
  .photo-album-flip-shell {
    flex-direction: column;
  }

  .photo-album-flip-toc {
    flex: 0 0 auto;
    max-width: none;
    max-height: 140px;
    border-right: none;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  }

  .photo-album-flip-spread {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }

  .photo-album-flip-spine {
    display: none;
  }

  .photo-album-flip-page--left,
  .photo-album-flip-page--right {
    border-radius: 8px;
  }
}

