/* ============================================================
   Mongkol Photos — gallery.css
   Design system: internal-editorial v2.2 tokens
   Paper #DFD6C3 · ink warm · Noto Sans Thai
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@400;500;600;700&family=JetBrains+Mono:wght@400;600&display=swap');

/* ---------- Tokens (aligned with internal-editorial v2.2) ---------- */
:root {
  --paper:      #DFD6C3;
  --paper-lo:   #D3C9B5;
  --paper-hi:   #EDE5D2;
  --paper-card: #E8DFC9;
  --ink:        #4A4236;
  --ink-lo:     #7A7264;
  --rule:       #C0B6A3;
  --accent:     #8B6F47;   /* warm brown — primary interactive */
  --accent-hi:  #A07850;
  --accent-dim: rgba(139,111,71,0.12);
  --favorite:   #C0392B;   /* warm red for heart */
  --exclude-bg: rgba(74,66,54,0.55);
  --check-bg:   #4A4236;
  --check-on:   #DFD6C3;
  --font-body:  'Noto Sans Thai', 'Thonburi', system-ui, sans-serif;
  --font-mono:  'JetBrains Mono', 'Courier New', monospace;
  --radius:     2px;
  --radius-md:  4px;
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-6: 1.5rem;
  --sp-8: 2rem;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur:  0.2s;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}
button { cursor: pointer; font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Layout ---------- */
.app-shell {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  min-height: 100dvh;
}

/* Top bar */
.topbar {
  background: var(--ink);
  color: var(--paper);
  padding: var(--sp-3) var(--sp-6);
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar h1 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  flex: 1;
}
.topbar .version-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  opacity: 0.55;
}

/* Search bar */
.search-bar {
  background: var(--paper-lo);
  border-bottom: 1px solid var(--rule);
  padding: var(--sp-3) var(--sp-6);
  display: flex;
  gap: var(--sp-3);
  align-items: center;
  flex-wrap: wrap;
  position: sticky;
  top: 3rem;
  z-index: 99;
  box-shadow: 0 2px 4px rgba(74,66,54,0.06);
}
.search-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
}
.search-wrap svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.45;
  pointer-events: none;
}
#search-input {
  width: 100%;
  background: var(--paper-hi);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: var(--sp-2) var(--sp-3) var(--sp-2) 2.25rem;
  font-size: 0.9375rem;
  color: var(--ink);
}
#search-input::placeholder { color: var(--ink-lo); }
#search-input:focus { outline: 2px solid var(--accent); border-color: transparent; }

.btn-filter-toggle {
  display: none;
  background: var(--paper-hi);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: var(--sp-2) var(--sp-4);
  font-size: 0.875rem;
  font-weight: 600;
  align-items: center;
  gap: var(--sp-2);
  white-space: nowrap;
}
.btn-filter-toggle .filter-count {
  background: var(--accent);
  color: var(--paper);
  border-radius: 10px;
  padding: 0 6px;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.6;
  display: none;
}
.btn-filter-toggle .filter-count.visible { display: inline; }

/* Select bar (shown when multi-select active) */
.select-bar {
  background: var(--ink);
  color: var(--paper);
  padding: var(--sp-2) var(--sp-6);
  display: none;
  align-items: center;
  gap: var(--sp-4);
  font-size: 0.875rem;
}
.select-bar.visible { display: flex; position: sticky; top: 6.5rem; z-index: 98; }
.select-bar strong { flex: 1; }
.btn-clear-sel, .btn-export {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: var(--sp-1) var(--sp-4);
  font-size: 0.85rem;
}
.btn-clear-sel { background: transparent; color: var(--paper); border-color: rgba(255,255,255,0.3); }
.btn-clear-sel:hover { border-color: var(--paper); }
.btn-export {
  background: var(--accent);
  color: var(--paper);
  border-color: transparent;
  font-weight: 600;
}
.btn-export:hover { background: var(--accent-hi); }
.btn-export:disabled { opacity: 0.5; cursor: default; }

/* ---------- Content area (sidebar + grid) ---------- */
.content-area {
  display: grid;
  grid-template-columns: 240px 1fr;
  align-items: start;
}

/* Sidebar filters */
.filter-sidebar {
  position: sticky;
  top: calc(3rem + 3.5rem);  /* below topbar + searchbar */
  max-height: calc(100dvh - 6.5rem);
  overflow-y: auto;
  border-right: 1px solid var(--rule);
  padding: var(--sp-6) var(--sp-4);
  background: var(--paper);
  scrollbar-width: thin;
  scrollbar-color: var(--rule) transparent;
}
body.select-bar-open .filter-sidebar {
  top: calc(3rem + 3.5rem + 2.5rem);
  max-height: calc(100dvh - 9rem);
}
.filter-sidebar h2 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-lo);
  margin-bottom: var(--sp-4);
}
.filter-clear-btn {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.75rem;
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
  float: right;
  line-height: 1.6;
}
.filter-group { margin-bottom: var(--sp-6); }
.filter-group-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-lo);
  margin-bottom: var(--sp-2);
  display: block;
}
.chip-wrap { display: flex; flex-wrap: wrap; gap: var(--sp-1); }
.chip {
  background: var(--paper-hi);
  border: 1px solid var(--rule);
  border-radius: 20px;
  padding: 2px var(--sp-3);
  font-size: 0.75rem;
  cursor: pointer;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease), transform 0.1s;
  user-select: none;
}
.chip:hover { border-color: var(--accent); }
.chip:active { transform: scale(0.93); }
.chip.include {
  background: #2f7d4f;
  color: #fff;
  border-color: #2f7d4f;
}
.chip.include::before { content: '✓ '; }
.chip.exclude {
  background: #b23b3b;
  color: #fff;
  border-color: #b23b3b;
}
.chip.exclude::before { content: '✕ '; }
.filter-legend {
  font-size: 0.7rem;
  color: var(--ink-lo);
  margin-bottom: var(--sp-3);
  line-height: 1.6;
}
.filter-legend .lg-in { color: #2f7d4f; font-weight: 700; }
.filter-legend .lg-not { color: #b23b3b; font-weight: 700; }

/* ---------- Gallery grid ---------- */
.gallery-main {
  padding: var(--sp-6);
  min-height: 60dvh;
}
.gallery-meta {
  font-size: 0.8rem;
  color: var(--ink-lo);
  margin-bottom: var(--sp-4);
  display: flex;
  align-items: center;
  gap: var(--sp-4);
}
.gallery-meta strong { color: var(--ink); }

.gallery-grid {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
}
.masonry-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

/* Photo card */
.photo-card {
  position: relative;
  background: var(--paper-lo);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow var(--dur) var(--ease), transform var(--dur);
}
.photo-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(74,66,54,0.18); }
.photo-card img {
  width: 100%;
  height: auto;
  display: block;
  transition: opacity 0.3s;
}
/* placeholder aspect while loading so masonry columns reserve height (lazy works) */
.photo-card img.lazy-loading { opacity: 0; aspect-ratio: 3/2; object-fit: cover; background: var(--paper-lo); }
.photo-card.portrait img.lazy-loading { aspect-ratio: 2/3; }
.photo-card img.lazy-loaded { opacity: 1; }

/* Favorite border */
.photo-card.is-favorite {
  border: 2px solid var(--favorite);
  box-shadow: 0 0 0 2px rgba(192,57,43,0.2);
}

/* Excluded overlay */
.photo-card.is-excluded .card-img { opacity: 0.25; filter: grayscale(1); }
.photo-card.is-excluded::after {
  content: 'ซ่อน';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--paper);
  background: var(--exclude-bg);
  pointer-events: none;
}

/* Card checkbox (multi-select) — clickable */
.card-check {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.95);
  background: rgba(74,66,54,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur), border-color var(--dur), transform var(--dur);
  z-index: 3;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.card-check:hover { transform: scale(1.12); background: rgba(47,125,79,0.6); }
.photo-card.selected .card-check {
  background: #2f7d4f;
  border-color: #fff;
}
.photo-card.selected { box-shadow: 0 0 0 3px #2f7d4f; border-radius: var(--radius-md); }
.card-check-mark {
  opacity: 0.55;
  color: #fff;
  font-size: 14px;
  line-height: 1;
  font-weight: 700;
  transition: opacity var(--dur);
}
.photo-card.selected .card-check-mark { opacity: 1; }

/* Card action buttons (top-right overlay) */
.card-actions {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity var(--dur);
  z-index: 2;
}
.photo-card:hover .card-actions { opacity: 1; }
.card-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(223,214,195,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: background var(--dur), transform var(--dur);
  backdrop-filter: blur(4px);
}
.card-btn:hover { transform: scale(1.15); background: var(--paper-hi); }
.card-btn.is-on { background: rgba(192,57,43,0.85); color: #fff; }

/* Favorite badge on card */
.fav-badge {
  position: absolute;
  bottom: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  background: var(--favorite);
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #fff;
  z-index: 2;
}
.photo-card.is-favorite .fav-badge { display: flex; }

/* Load more */
.load-more-wrap {
  margin: var(--sp-8) 0;
  text-align: center;
}
.btn-load-more {
  background: var(--paper-hi);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: var(--sp-3) var(--sp-8);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink);
  transition: background var(--dur);
}
.btn-load-more:hover { background: var(--accent-dim); border-color: var(--accent); }
.btn-load-more:disabled { opacity: 0.4; cursor: default; }

/* Status message */
.status-msg {
  text-align: center;
  color: var(--ink-lo);
  padding: var(--sp-16) var(--sp-4);
  font-size: 0.9375rem;
}
.status-msg .icon { font-size: 2rem; margin-bottom: var(--sp-3); }

/* ---------- Lightbox ---------- */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(30,26,20,0.92);
  z-index: 500;
  display: flex;
  align-items: stretch;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease);
}
.lightbox-overlay.visible {
  opacity: 1;
  pointer-events: all;
}
.lightbox-backdrop {
  position: absolute;
  inset: 0;
  cursor: zoom-out;
}
.lightbox-inner {
  position: relative;
  z-index: 1;
  display: flex;
  width: 100%;
  max-width: 1280px;
  margin: auto;
  padding: var(--sp-8);
  gap: var(--sp-6);
  align-items: center;
}
.lightbox-img-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}
.lightbox-img-wrap img {
  max-height: calc(100dvh - 80px);
  max-width: 100%;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}
.lightbox-panel {
  width: 340px;
  flex-shrink: 0;
  background: rgba(223,214,195,0.07);
  border: 1px solid rgba(223,214,195,0.15);
  border-radius: var(--radius-md);
  padding: var(--sp-6);
  color: var(--paper);
  max-height: calc(100dvh - 80px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(223,214,195,0.2) transparent;
}
.lightbox-panel .lp-caption {
  font-size: 0.9375rem;
  line-height: 1.7;
  margin-bottom: var(--sp-4);
  opacity: 0.9;
}
.lightbox-panel .lp-meta {
  font-size: 0.75rem;
  color: rgba(223,214,195,0.6);
  margin-bottom: var(--sp-4);
  font-family: var(--font-mono);
}
.lightbox-panel .lp-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: var(--sp-6); }
.lp-tag {
  background: rgba(223,214,195,0.1);
  border: 1px solid rgba(223,214,195,0.2);
  border-radius: 12px;
  padding: 2px 10px;
  font-size: 0.7rem;
  color: rgba(223,214,195,0.8);
}
.lp-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(223,214,195,0.5);
  margin-bottom: var(--sp-3);
}
.similar-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-bottom: var(--sp-6);
}
.similar-thumb {
  aspect-ratio: 1;
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: opacity var(--dur);
}
.similar-thumb:hover { opacity: 0.75; }
.similar-thumb img { width: 100%; height: 100%; object-fit: cover; }

.lb-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.lb-btn {
  flex: 1;
  min-width: 70px;
  background: rgba(223,214,195,0.08);
  border: 1px solid rgba(223,214,195,0.2);
  border-radius: var(--radius);
  padding: var(--sp-2) var(--sp-3);
  font-size: 0.8rem;
  color: var(--paper);
  text-align: center;
  transition: background var(--dur), border-color var(--dur);
}
.lb-btn:hover { background: rgba(223,214,195,0.18); border-color: rgba(223,214,195,0.4); }
.lb-btn.active-fav { background: rgba(192,57,43,0.3); border-color: rgba(192,57,43,0.5); }
.lb-btn.active-excl { background: rgba(74,66,54,0.5); border-color: rgba(74,66,54,0.8); }
.lb-btn.active-select { background: rgba(47,125,79,0.3); border-color: rgba(47,125,79,0.5); }

/* Close button */
.lightbox-close {
  position: absolute;
  top: var(--sp-4);
  right: var(--sp-4);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(223,214,195,0.1);
  border: 1px solid rgba(223,214,195,0.2);
  color: var(--paper);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur);
  z-index: 2;
}
.lightbox-close:hover { background: rgba(223,214,195,0.25); }

/* Nav arrows */
.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 56px;
  background: rgba(223,214,195,0.08);
  border: 1px solid rgba(223,214,195,0.15);
  border-radius: var(--radius);
  color: var(--paper);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: background var(--dur);
}
.lb-nav:hover { background: rgba(223,214,195,0.2); }
.lb-prev { left: var(--sp-4); }
.lb-next { right: var(--sp-4); }

/* ---------- Filter drawer (mobile) ---------- */
.filter-drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(30,26,20,0.5);
  z-index: 200;
}
.filter-drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--paper);
  border-radius: 12px 12px 0 0;
  padding: var(--sp-6);
  max-height: 80dvh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.3s var(--ease);
  z-index: 201;
}
.filter-drawer.open { transform: translateY(0); }
.filter-drawer-overlay.open { display: block; }
.drawer-handle {
  width: 40px;
  height: 4px;
  background: var(--rule);
  border-radius: 2px;
  margin: 0 auto var(--sp-4);
}

/* ---------- Footer ---------- */
.gallery-footer {
  padding: var(--sp-4) var(--sp-6);
  border-top: 1px solid var(--rule);
  font-size: 0.75rem;
  color: var(--ink-lo);
  font-family: var(--font-mono);
  display: flex;
  justify-content: space-between;
}

body.timeline-ux .gallery-footer {
  display: none;
}

/* ---------- Loading skeleton ---------- */
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-3);
  padding: var(--sp-6);
}
.skeleton-card {
  aspect-ratio: 3/2;
  background: linear-gradient(90deg, var(--paper-lo) 25%, var(--paper-card) 50%, var(--paper-lo) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-md);
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---------- Toast notification ---------- */
.toast {
  position: fixed;
  bottom: var(--sp-6);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius-md);
  padding: var(--sp-3) var(--sp-6);
  font-size: 0.875rem;
  z-index: 600;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s var(--ease);
  pointer-events: none;
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .skeleton-grid { grid-template-columns: repeat(3, 1fr); }
  .content-area { grid-template-columns: 1fr; }
  .filter-sidebar { display: none; }
  .btn-filter-toggle { display: flex; }
}

@media (max-width: 600px) {
  .topbar { padding: var(--sp-3) var(--sp-4); }
  .search-bar { padding: var(--sp-3) var(--sp-4); }
  .gallery-main { padding: var(--sp-4); }
  .skeleton-grid { grid-template-columns: repeat(2, 1fr); gap: var(--sp-2); }
  .gallery-grid, .masonry-col { gap: var(--sp-2); }
  .lightbox-inner { flex-direction: column; padding: var(--sp-4); gap: var(--sp-4); }
  .lightbox-panel { width: 100%; max-height: 40dvh; }
  .lb-nav { display: none; }
  .lightbox-close { top: var(--sp-2); right: var(--sp-2); }
  .select-bar { flex-wrap: wrap; padding: var(--sp-2) var(--sp-4); }
}

@media (min-width: 1400px) {
  .skeleton-grid { grid-template-columns: repeat(6, 1fr); }
}

/* ---------- Mock mode banner ---------- */
.mock-banner {
  background: #8B6F47;
  color: var(--paper);
  text-align: center;
  padding: var(--sp-2);
  font-size: 0.8rem;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

/* ---------- Accordion filter groups ---------- */
.filter-accordion {
  border-bottom: 1px solid var(--rule);
}
.filter-accordion:last-of-type { border-bottom: none; }
details.filter-accordion > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) 0;
  cursor: pointer;
  user-select: none;
}
details.filter-accordion > summary::-webkit-details-marker { display: none; }
details.filter-accordion > summary:hover .filter-group-label { color: var(--accent); }
details.filter-accordion > summary .filter-group-label {
  flex: 1;
  margin-bottom: 0;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-lo);
  display: block;
}
.filter-group-count {
  background: var(--accent);
  color: var(--paper);
  border-radius: 10px;
  padding: 0 5px;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.6;
  min-width: 15px;
  text-align: center;
}
.accordion-arrow {
  opacity: 0.4;
  flex-shrink: 0;
  transition: transform var(--dur) var(--ease), opacity var(--dur);
}
details.filter-accordion[open] .accordion-arrow {
  transform: rotate(90deg);
  opacity: 0.7;
}
details.filter-accordion .chip-wrap { padding: 0 0 var(--sp-3) 0; }
@keyframes chipWrapFadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to   { opacity: 1; transform: translateY(0); }
}
details.filter-accordion[open] .chip-wrap {
  animation: chipWrapFadeIn var(--dur) var(--ease) both;
}

/* Overflow chips (show-more) */
.chip-overflow { display: none !important; }
.chip-more {
  background: transparent;
  border: 1px dashed var(--rule);
  color: var(--ink-lo);
  font-size: 0.68rem;
  border-radius: 20px;
  padding: 2px var(--sp-3);
}
.chip-more:hover { border-color: var(--accent); color: var(--ink); }

/* ---------- Excluded badge on card ---------- */
.excl-badge {
  position: absolute;
  bottom: 6px;
  left: 6px;
  width: 18px;
  height: 18px;
  background: #b23b3b;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: #fff;
  font-weight: 700;
  z-index: 2;
  line-height: 1;
}
.photo-card.is-excluded .excl-badge { display: flex; }

/* ---------- Show-excluded toggle button ---------- */
.btn-logo-toggle {
  background: var(--paper-hi);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: var(--sp-2) var(--sp-3);
  font-size: 0.8rem;
  color: var(--ink-lo);
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--dur), border-color var(--dur), color var(--dur);
}
.btn-logo-toggle:hover { border-color: var(--accent); color: var(--ink); }
.btn-logo-toggle.active {
  background: rgba(107,80,53,0.1);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}
.btn-show-excluded {
  background: var(--paper-hi);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: var(--sp-2) var(--sp-3);
  font-size: 0.8rem;
  color: var(--ink-lo);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  transition: background var(--dur), border-color var(--dur), color var(--dur);
}
.btn-show-excluded:hover { border-color: var(--accent); color: var(--ink); }
.btn-show-excluded.active {
  background: rgba(107,80,53,0.1);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}
.btn-show-excluded svg { flex-shrink: 0; }

/* ---------- SVG heart in card-btn ---------- */
.card-btn svg { pointer-events: none; display: block; }
.card-btn[data-action="favorite"] { color: var(--ink-lo); }
.card-btn[data-action="favorite"].is-on { background: rgba(192,57,43,0.85); color: #fff; }

/* ---------- Print safety ---------- */
@media print {
  .topbar, .filter-sidebar, .card-actions, .select-bar, .btn-load-more,
  .lightbox-overlay, .toast, .filter-drawer-overlay { display: none !important; }
  .gallery-grid { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .photo-card { page-break-inside: avoid; }
}

/* ---------- Folder dropdown ---------- */
.folder-section {
  margin-top: var(--sp-4);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--rule);
}
.folder-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-lo);
  margin-bottom: var(--sp-2);
}
.folder-select {
  width: 100%;
  background: var(--paper-hi);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: var(--sp-2) var(--sp-3);
  font-size: 0.8rem;
  color: var(--ink);
  font-family: var(--font-body);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238B6F47'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--sp-3) center;
  padding-right: calc(var(--sp-3) * 2 + 10px);
}
.folder-select:focus { outline: 2px solid var(--accent); border-color: transparent; }

/* ---------- Labeled tag rows (lightbox) ---------- */
.lightbox-panel .lp-tags { flex-direction: column; gap: 6px; }
.lp-tag-row {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(223,214,195,0.08);
  border: 1px solid rgba(223,214,195,0.18);
  border-radius: 14px;
  padding: 3px 10px 3px 8px;
  font-size: 0.72rem;
  margin: 1px 2px;
  position: relative;
}
.lp-tag-label {
  color: rgba(223,214,195,0.5);
  font-size: 0.68rem;
  white-space: nowrap;
  font-family: var(--font-mono);
}
.lp-tag-label::after { content: ':'; margin-right: 2px; }
.lp-tag-value { color: rgba(223,214,195,0.9); }
.lp-tag-edit-btn {
  opacity: 0;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 2px;
  color: var(--accent-hi);
  font-size: 0.7rem;
  line-height: 1;
  transition: opacity 0.15s;
  flex-shrink: 0;
}
.lp-tag-row:hover .lp-tag-edit-btn { opacity: 1; }
.lp-tag-input {
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 2px 6px;
  background: rgba(30,26,20,0.8);
  color: rgba(223,214,195,0.95);
  font-size: 0.72rem;
  font-family: var(--font-body);
  width: 100px;
}
.lp-tag-save, .lp-tag-cancel {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.75rem;
  padding: 0 3px;
  line-height: 1;
}
.lp-tag-save { color: var(--accent-hi); }
.lp-tag-cancel { color: rgba(223,214,195,0.4); }


/* ---------- Batch tag modal ---------- */
.batch-tag-dialog {
  border: none;
  border-radius: 12px;
  padding: 1.5rem;
  max-width: 360px;
  width: 90vw;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 8px 40px rgba(0,0,0,0.22);
}
.batch-tag-dialog::backdrop { background: rgba(0,0,0,0.45); }
.batch-tag-dialog h3 { margin: 0 0 0.5rem; font-size: 1rem; }
.btd-hint { font-size: 0.75rem; color: var(--ink-lo); margin: 0 0 1rem; }
.btd-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 0.75rem;
  font-size: 0.78rem;
  color: var(--ink-lo);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.btd-input {
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 6px 8px;
  background: var(--paper);
  color: var(--ink);
  font-size: 0.85rem;
  font-family: var(--font-body);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}
.btd-input:focus { outline: 2px solid var(--accent); border-color: transparent; }
.btd-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 1rem; }
.btd-actions button { padding: 7px 16px; border-radius: 8px; cursor: pointer; font-size: 0.85rem; border: 1px solid var(--rule); background: var(--paper-hi); color: var(--ink); }
.btd-primary { background: var(--accent) !important; color: var(--paper) !important; border-color: var(--accent) !important; font-weight: 600; }

/* ---------- Batch tag button in select bar ---------- */
.btn-batch-tag {
  background: var(--paper-hi);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: var(--sp-2) var(--sp-3);
  font-size: 0.8rem;
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--dur), border-color var(--dur);
}
.btn-batch-tag:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.btn-batch-tag:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------- Timeline Beta (?ux=timeline) ---------- */
.timeline-beta-banner {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
  background: #1f3328;
  color: var(--paper);
  padding: var(--sp-2) var(--sp-6);
  border-bottom: 1px solid rgba(223,214,195,0.22);
  font-size: 0.82rem;
}
.timeline-beta-banner strong {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.timeline-beta-banner span { opacity: 0.82; }
.timeline-beta-banner a {
  margin-left: auto;
  color: var(--paper);
  border: 1px solid rgba(223,214,195,0.35);
  border-radius: 999px;
  padding: 3px 10px;
  text-decoration: none;
}

body.timeline-ux .content-area {
  grid-template-columns: 260px minmax(0, 1fr) 320px;
  gap: 0;
}
body.timeline-ux .topbar { display: none; }
body.timeline-ux .search-bar {
  top: 0;
  padding: 8px var(--sp-6);
  gap: 12px;
  display: grid;
  grid-template-columns: 260px minmax(320px, 760px) auto;
  justify-content: start;
}
body.timeline-ux .btn-show-excluded {
  display: none;
}
body.timeline-ux .search-wrap {
  width: 100%;
  max-width: 920px;
  min-width: 240px;
}
.timeline-search-brand {
  min-width: 0;
  padding-left: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
  color: var(--ink);
}
.timeline-search-brand strong {
  font-size: 0.92rem;
  line-height: 1.2;
}
.timeline-search-brand span {
  color: var(--ink-lo);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
body.timeline-ux .filter-sidebar {
  display: block;
  position: static;
  top: auto;
  width: 100%;
  height: auto;
  max-height: none;
  margin-top: var(--sp-4);
  padding: var(--sp-3) 0 0;
  border: 0;
  border-top: 1px solid rgba(244,241,234,0.14);
  border-radius: 0;
  background: transparent;
  color: inherit;
  overflow: visible;
}
.timeline-hidden-filter {
  margin: 0 4px var(--sp-3);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid rgba(244,241,234,0.14);
}
.timeline-hidden-filter span {
  display: block;
  margin: 0 6px 6px;
  color: rgba(244,241,234,0.72);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.timeline-hidden-filter button {
  margin: 0 4px 6px 0;
  border: 1px solid rgba(244,241,234,0.42);
  border-radius: 999px;
  background: #efe7d4;
  color: #2b241d;
  padding: 5px 9px;
  font-size: 0.68rem;
  font-weight: 650;
}
.timeline-hidden-filter button.active {
  background: #2f7d4f;
  border-color: #2f7d4f;
  color: #fff;
}
.timeline-hidden-filter button[data-hidden-mode="only"].active {
  background: #b23b3b;
  border-color: #b23b3b;
}
body.timeline-ux .filter-sidebar h2 {
  color: #8e8e8e;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  margin: 0 10px var(--sp-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
body.timeline-ux .filter-clear-btn {
  color: rgba(244,241,234,0.7);
}
body.timeline-ux .filter-group-title,
body.timeline-ux .folder-label {
  color: rgba(244,241,234,0.66);
}
body.timeline-ux .filter-chip {
  border-color: rgba(244,241,234,0.55);
  color: #2b241d;
  background: #efe7d4;
}
body.timeline-ux .filter-sidebar .chip {
  border-color: rgba(244,241,234,0.62);
  color: #2b241d;
  background: #efe7d4;
  font-weight: 650;
}
body.timeline-ux .filter-chip.in,
body.timeline-ux .filter-sidebar .chip.include {
  background: #2f7d4f;
  border-color: #2f7d4f;
  color: #fff;
}
body.timeline-ux .filter-chip.not,
body.timeline-ux .filter-sidebar .chip.exclude {
  background: #b23b3b;
  border-color: #b23b3b;
  color: #fff;
}
body.timeline-ux .folder-select {
  background-color: #2a2a2a;
  border-color: rgba(244,241,234,0.18);
  color: #f4f1ea;
}
body.timeline-ux .filter-sidebar details.filter-accordion {
  border-color: rgba(244,241,234,0.14);
}
body.timeline-ux .filter-sidebar .filter-options {
  gap: 6px;
  padding: 6px 0 10px;
}
body.timeline-ux .filter-sidebar .filter-chip {
  font-size: 0.68rem;
  padding: 4px 8px;
  font-weight: 600;
}
body.timeline-ux .filter-sidebar .filter-legend {
  font-size: 0.68rem;
  margin: 0 10px var(--sp-2);
}
body.timeline-ux .filter-sidebar .folder-section {
  border-top-color: rgba(244,241,234,0.14);
  margin-top: var(--sp-3);
  padding: var(--sp-3) 0 0;
}
body.timeline-ux .gallery-main {
  background: #171717;
  color: #f4f1ea;
  min-height: calc(100dvh - 9rem);
  padding-bottom: 7rem;
}
body.timeline-ux .gallery-meta {
  color: rgba(244,241,234,0.74);
  justify-content: space-between;
  flex-wrap: wrap;
  border-bottom: 1px solid rgba(244,241,234,0.1);
  padding-bottom: var(--sp-3);
}
.timeline-meta-line strong { color: #fff; }
.timeline-meta-help {
  font-size: 0.72rem;
  color: rgba(244,241,234,0.55);
}

.timeline-nav {
  position: sticky;
  top: 3.5rem;
  height: calc(100dvh - 3.5rem);
  overflow: auto;
  background: #1f1f1f;
  color: #ddd;
  border-right: 1px solid #333;
  padding: var(--sp-3) var(--sp-2);
}
.timeline-filter-rail {
  padding-top: var(--sp-3);
}
.timeline-nav-item {
  width: 100%;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  background: transparent;
  border: 0;
  border-radius: 999px;
  padding: 6px 10px;
  color: inherit;
  text-align: left;
  font-size: 0.82rem;
}
.timeline-nav-item:hover,
.timeline-nav-item.active {
  background: #0e5f99;
  color: #fff;
}
.timeline-nav-item b {
  font-size: 0.62rem;
  color: rgba(255,255,255,0.72);
  font-weight: 500;
}
.timeline-nav-label {
  margin: var(--sp-4) 10px var(--sp-2);
  color: #8e8e8e;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.timeline-grid {
  display: block;
}
.timeline-preset-heading {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
  color: #f4f1ea;
}
.timeline-preset-heading strong {
  font-size: 0.9rem;
}
.timeline-preset-heading span {
  color: rgba(244,241,234,0.58);
  font-size: 0.74rem;
}
.timeline-memory-strip {
  display: flex;
  gap: var(--sp-3);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  margin-bottom: var(--sp-6);
}
.timeline-memory-strip::-webkit-scrollbar { display: none; }
.timeline-memory {
  flex: 0 0 min(280px, 78vw);
  scroll-snap-align: start;
  min-height: 158px;
  display: grid;
  grid-template-rows: 82px auto auto auto auto;
  gap: 4px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: var(--sp-3);
  text-align: left;
  color: #fff;
  background: linear-gradient(135deg, #2e5d74, #a77843);
}
.timeline-memory:nth-child(2) { background: linear-gradient(135deg, #7b4736, #d6ba87); }
.timeline-memory:nth-child(3) { background: linear-gradient(135deg, #2d6449, #c9c2aa); }
.timeline-memory:nth-child(4) { background: linear-gradient(135deg, #5d4674, #b98535); }
.timeline-memory-create {
  align-content: center;
  background: #262626;
  border-style: dashed;
}
.timeline-memory-create strong {
  font-size: 1rem;
}
.timeline-memory-thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  overflow: hidden;
  border-radius: 6px;
  background: rgba(0,0,0,0.2);
}
.timeline-memory-thumbs img {
  width: 100%;
  height: 82px;
  object-fit: cover;
  opacity: 0.92;
}
.timeline-memory strong { font-size: 0.9rem; }
.timeline-memory span { font-size: 0.72rem; color: rgba(255,255,255,0.78); }
.timeline-memory small {
  width: fit-content;
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 999px;
  padding: 2px 7px;
  color: rgba(255,255,255,0.72);
  font-size: 0.62rem;
}
.timeline-memory em {
  color: rgba(255,255,255,0.62);
  font-size: 0.66rem;
  font-style: normal;
}

.timeline-day {
  margin-top: var(--sp-6);
}
.timeline-month {
  margin-bottom: var(--sp-2);
  color: rgba(244,241,234,0.92);
  font-size: 1.45rem;
  font-weight: 700;
}
.timeline-day-head {
  position: sticky;
  top: 3.5rem;
  z-index: 5;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  background: #171717;
  border-bottom: 1px solid rgba(244,241,234,0.1);
  padding: var(--sp-2) 0;
}
.timeline-day-head strong {
  display: block;
  color: #fff;
  font-size: 0.92rem;
}
.timeline-day-head span {
  color: rgba(244,241,234,0.56);
  font-size: 0.72rem;
}
.timeline-folder-name {
  display: block;
  color: rgba(244,241,234,0.72);
  font-size: 0.72rem;
  font-style: normal;
}
.timeline-day-check {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255,255,255,0.62);
  border-radius: 6px;
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-weight: 700;
}
.timeline-day-check.checked {
  background: #2f7d4f;
  border-color: #2f7d4f;
}
.timeline-day-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-left: auto;
}
.timeline-day-chips span,
.timeline-detail-tags span {
  border: 1px solid rgba(244,241,234,0.2);
  border-radius: 999px;
  color: rgba(244,241,234,0.78);
  padding: 2px 8px;
  font-size: 0.7rem;
}
.timeline-photo-grid {
  display: block;
  column-count: 6;
  column-gap: 3px;
}
.timeline-photo-card {
  display: inline-block;
  width: 100%;
  margin: 0 0 3px;
  break-inside: avoid;
  aspect-ratio: auto;
  border: 0;
  border-radius: 2px;
  background: #2c2c2c;
}
.timeline-photo-card.portrait { aspect-ratio: auto; }
.timeline-photo-card img {
  width: 100%;
  height: auto;
  object-fit: contain;
}
.timeline-photo-card img.lazy-loading {
  object-fit: contain;
}
.timeline-photo-card .timeline-card-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 18px 7px 6px;
  color: #fff;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.76));
  opacity: 0;
  transition: opacity var(--dur);
  pointer-events: none;
}
.timeline-photo-card:hover .timeline-card-caption { opacity: 1; }
.timeline-card-caption b {
  font-size: 0.72rem;
  line-height: 1.3;
}
.timeline-card-caption span {
  color: rgba(255,255,255,0.74);
  font-size: 0.64rem;
}

.timeline-detail {
  position: sticky;
  top: 3.5rem;
  height: calc(100dvh - 3.5rem);
  overflow: auto;
  background: #202020;
  color: #f4f1ea;
  border-left: 1px solid #333;
  padding: var(--sp-4);
}
.timeline-catalog-mobile {
  display: none;
}
.timeline-detail-empty {
  min-height: 220px;
  display: grid;
  place-content: center;
  gap: var(--sp-2);
  color: rgba(244,241,234,0.58);
  text-align: center;
}
.timeline-detail-preview {
  overflow: hidden;
  border-radius: 8px;
  margin-bottom: var(--sp-3);
  background: #111;
}
.timeline-detail-preview img {
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  background: #111;
}
.timeline-detail-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-bottom: var(--sp-4);
}
.timeline-detail-actions button,
.timeline-batch-bar button {
  border: 1px solid rgba(244,241,234,0.18);
  border-radius: 8px;
  background: rgba(255,255,255,0.08);
  color: #f4f1ea;
  padding: 7px 8px;
  font-size: 0.72rem;
}
.timeline-catalog-delete {
  border-color: rgba(211,86,66,0.45) !important;
  background: rgba(211,86,66,0.12) !important;
  color: #f4b3a5 !important;
}
.timeline-catalog-delete:hover {
  background: rgba(211,86,66,0.24) !important;
}
.timeline-detail h2 {
  margin-bottom: var(--sp-2);
  font-size: 1rem;
}
.timeline-panel-eyebrow {
  color: rgba(244,241,234,0.48);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  margin-bottom: var(--sp-2);
  text-transform: uppercase;
}
.timeline-context-panel > p:not(.timeline-panel-eyebrow) {
  color: rgba(244,241,234,0.72);
  font-size: 0.82rem;
  margin-bottom: var(--sp-3);
}
.timeline-catalog-panel {
  margin-bottom: var(--sp-5);
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid rgba(244,241,234,0.14);
}
.timeline-catalog-form {
  display: grid;
  gap: var(--sp-3);
}
.timeline-catalog-form label {
  display: grid;
  gap: 5px;
  color: rgba(244,241,234,0.7);
  font-size: 0.72rem;
}
.timeline-catalog-form input,
.timeline-catalog-form textarea,
.timeline-catalog-form select {
  width: 100%;
  border: 1px solid rgba(244,241,234,0.18);
  border-radius: 8px;
  background: #151515;
  color: #f4f1ea;
  padding: 8px 9px;
  font: inherit;
}
.timeline-catalog-form button {
  border: 0;
  border-radius: 8px;
  background: #b7925a;
  color: #1c1711;
  padding: 9px 10px;
  font-weight: 700;
}
.timeline-catalog-photo-list {
  display: grid;
  gap: 7px;
  margin-top: var(--sp-3);
}
.timeline-catalog-photo-list button {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(244,241,234,0.12);
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  color: #f4f1ea;
  padding: 6px;
  text-align: left;
}
.timeline-catalog-photo-list img {
  width: 42px;
  height: 34px;
  object-fit: cover;
  border-radius: 5px;
}
.timeline-catalog-photo-list span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.72rem;
}
.timeline-catalog-photo-list b {
  color: #e47d74;
  font-size: 0.66rem;
}
.timeline-catalog-photo-list em {
  color: rgba(244,241,234,0.55);
  font-size: 0.76rem;
  font-style: normal;
}
.timeline-sidebar-presets {
  display: grid;
  gap: 9px;
  margin-top: var(--sp-4);
}
.timeline-sidebar-presets-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-2);
}
.timeline-sidebar-presets-head strong {
  font-size: 0.84rem;
}
.timeline-sidebar-presets-head span {
  color: rgba(244,241,234,0.52);
  font-size: 0.68rem;
}
.timeline-sidebar-preset {
  display: grid;
  gap: 5px;
  border: 1px solid rgba(244,241,234,0.13);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(72,94,83,0.7), rgba(153,116,72,0.68));
  color: #f4f1ea;
  padding: 8px;
  text-align: left;
}
.timeline-sidebar-preset-all {
  background: rgba(255,255,255,0.06);
  border-style: dashed;
  margin-bottom: 4px;
}
.timeline-sidebar-preset-thumbs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  min-height: 42px;
  overflow: hidden;
  border-radius: 6px;
  background: rgba(0,0,0,0.18);
}
.timeline-sidebar-preset-thumbs img {
  width: 100%;
  height: 42px;
  object-fit: cover;
}
.timeline-sidebar-preset-thumbs span {
  grid-column: 1 / -1;
  align-self: center;
  justify-self: center;
  color: rgba(244,241,234,0.58);
  font-size: 0.68rem;
}
.timeline-sidebar-preset strong {
  font-size: 0.78rem;
}
.timeline-sidebar-preset > span {
  color: rgba(244,241,234,0.78);
  font-size: 0.68rem;
  line-height: 1.35;
}
.timeline-sidebar-preset em {
  color: rgba(244,241,234,0.62);
  font-size: 0.64rem;
  font-style: normal;
}
.timeline-panel-note {
  display: grid;
  gap: 4px;
  margin-top: var(--sp-4);
  padding-top: var(--sp-3);
  border-top: 1px solid rgba(244,241,234,0.12);
  color: rgba(244,241,234,0.68);
  font-size: 0.74rem;
}
.timeline-panel-note strong {
  color: #f4f1ea;
  margin-top: var(--sp-2);
}
.timeline-detail-caption {
  color: rgba(244,241,234,0.82);
  font-size: 0.84rem;
  margin-bottom: var(--sp-3);
}
.timeline-info-list div {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: var(--sp-2);
  border-top: 1px solid rgba(244,241,234,0.1);
  padding: var(--sp-2) 0;
  font-size: 0.75rem;
}
.timeline-info-list dt { color: rgba(244,241,234,0.48); }
.timeline-info-list dd { margin: 0; color: rgba(244,241,234,0.86); }
.timeline-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: var(--sp-3);
}

.timeline-batch-bar {
  position: fixed;
  left: calc(260px + var(--sp-6));
  right: calc(320px + var(--sp-6));
  bottom: var(--sp-3);
  z-index: 120;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: var(--sp-6);
  padding: var(--sp-3);
  border: 1px solid rgba(244,241,234,0.16);
  border-radius: 10px;
  background: rgba(32,32,32,0.94);
  box-shadow: 0 8px 30px rgba(0,0,0,0.28);
  transform: translateY(calc(100% + var(--sp-6)));
  transition: transform var(--dur) var(--ease);
  pointer-events: none;
}
.timeline-batch-bar.has-selection {
  transform: translateY(0);
  pointer-events: auto;
}
.timeline-batch-bar strong {
  margin-right: auto;
  font-size: 0.82rem;
}
.timeline-batch-help {
  display: none;
}

body.timeline-ux .select-bar.visible {
  display: none;
}

@media (max-width: 1100px) {
  body.timeline-ux .content-area {
    grid-template-columns: 240px minmax(0, 1fr);
  }
  .timeline-detail {
    grid-column: 1 / -1;
    position: static;
    height: auto;
    border-left: 0;
    border-top: 1px solid #333;
  }
  .timeline-photo-grid { column-count: 4; }
  .timeline-batch-bar {
    left: calc(240px + var(--sp-4));
    right: var(--sp-4);
  }
}

@media (max-width: 720px) {
  body.timeline-ux .content-area {
    display: block;
  }
  .timeline-nav {
    position: static;
    height: auto;
    display: block;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid #333;
  }
  .timeline-nav-label { display: none; }
  .timeline-nav-item {
    width: auto;
    flex: 0 0 auto;
  }
  .timeline-photo-grid { column-count: 2; }
  .timeline-day-head {
    top: 3.5rem;
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .timeline-day-chips {
    width: 100%;
    margin-left: 34px;
  }
  .timeline-batch-bar {
    left: var(--sp-3);
    right: var(--sp-3);
    bottom: var(--sp-3);
  }
  .timeline-catalog-mobile {
    position: fixed;
    right: var(--sp-3);
    bottom: 5.25rem;
    z-index: 121;
    display: block;
    border: 1px solid rgba(244,241,234,0.22);
    border-radius: 999px;
    background: #b7925a;
    color: #1c1711;
    padding: 9px 12px;
    font-weight: 700;
  }
}
