/* ── Variables ─────────────────────────────────────────────────────────────── */
:root {
  --bg: #0d0d0d;
  --surface: #161616;
  --surface-2: #1e1e1e;
  --border: #2a2a2a;
  --text: #e2e2e2;
  --text-muted: #666;
  --accent: #ffffff;
  --accent-dim: rgba(255,255,255,0.06);
  --green: #3ddc84;
  --blue: #5b9cf6;
  --red: #f25c5c;
  --yellow: #e5a94e;
  --radius: 4px;
  --radius-lg: 8px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Mono', ui-monospace, monospace;
  --nav-height: 56px;
  --muted: #666;
}
.muted { color: var(--muted); }

/* ── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 300;
  line-height: 1.65;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

/* ── Navbar ────────────────────────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  padding: 0 2rem;
  height: var(--nav-height);
  background: rgba(13,13,13,0.9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.navbar-brand {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  flex-shrink: 0;
}

.navbar-links {
  display: flex;
  gap: 0;
  list-style: none;
  margin-left: auto;
}

.navbar-links a {
  display: block;
  padding: 0 1rem;
  height: var(--nav-height);
  line-height: var(--nav-height);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.navbar-links a:hover { color: var(--text); }
.navbar-links a.nav-active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Gallery grid (JS-masonry via row spans) ───────────────────────────────── */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  grid-auto-rows: 4px;
  grid-auto-flow: dense;
  gap: 3px;
  padding: 3px;
}

.photo-card {
  display: block;
  position: relative;
  overflow: hidden;
  background: var(--surface);
  aspect-ratio: 3 / 2;
}
.photo-card.spanned { aspect-ratio: auto !important; }

.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.45s ease;
}
.photo-card img.img-loaded {
  opacity: 1;
}
.photo-card:hover img.img-loaded { opacity: 0.82; transform: scale(1.03); }

/* Scroll sentinel */
.scroll-sentinel {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.scroll-sentinel.loading::after {
  content: '';
  width: 18px; height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--muted);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Announcement strip ────────────────────────────────────────────────────── */
.announce-strip {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--border);
  background: rgba(91,156,246,0.05);
}
.announce-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 2rem;
  font-size: 13px;
  color: var(--text);
  transition: background 0.15s;
  border-top: 1px solid transparent;
}
.announce-item:first-child { border-top: none; }
.announce-item + .announce-item { border-top-color: var(--border); }
.announce-item:hover { background: rgba(91,156,246,0.08); }
.announce-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--blue);
  flex-shrink: 0;
}
.announce-text { flex: 1; }
.announce-arrow { font-size: 12px; color: var(--blue); opacity: 0.7; }

/* ── Filter bar ────────────────────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 0 2rem;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.filter-bar::-webkit-scrollbar { display: none; }
.filter-tab {
  padding: 0 1.1rem;
  height: 44px;
  line-height: 44px;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color 0.2s, border-color 0.2s;
  flex-shrink: 0;
}
.filter-tab:hover { color: var(--text); }
.filter-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Section header (albums, album detail) ─────────────────────────────────── */
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 2rem 2rem 1.25rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2px;
}
.section-header h1 {
  font-size: 22px;
  font-weight: 300;
  letter-spacing: -0.01em;
  margin-top: 0.25rem;
}
.section-header-left { display: flex; flex-direction: column; gap: 0.25rem; }
.section-desc { font-size: 13px; color: var(--text-muted); margin-top: 0.2rem; }
.section-count { font-size: 12px; color: var(--text-muted); padding-bottom: 4px; }
.back-link { font-size: 12px; color: var(--text-muted); transition: color 0.2s; }
.back-link:hover { color: var(--accent); }

/* ── Albums grid ───────────────────────────────────────────────────────────── */
.albums-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2px;
  padding: 2px;
}
.album-card {
  display: block;
  text-decoration: none;
}
.album-card-cover {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3/2;
  background: var(--surface);
}
.album-cover-placeholder { width: 100%; height: 100%; background: var(--surface-2); }
.album-card-cover img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: opacity 0.35s, transform 0.45s;
}
.album-card:hover .album-card-cover img { opacity: 0.82; transform: scale(1.03); }
.album-card-body {
  padding: 0.75rem 0.1rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.album-card-title { font-size: 14px; font-weight: 400; color: var(--text); }
.album-card-desc { font-size: 12px; color: var(--text-muted); }

/* ── Space sections ────────────────────────────────────────────────────────── */
.space-section {
  border-bottom: 1px solid var(--border);
  padding-bottom: 2rem;
  margin-bottom: 2px;
}
.space-section:last-child { border-bottom: none; }
.space-section-header {
  padding: 1.75rem 2rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.space-section-title {
  font-size: 17px;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}
a.space-section-title:hover { color: var(--accent); }
.space-section-desc { font-size: 12px; color: var(--text-muted); }
.breadcrumb-back { font-size: 12px; color: var(--text-muted); text-decoration: none; display: block; margin-bottom: 0.3rem; }
.breadcrumb-back:hover { color: var(--accent); }
.inline-link { color: var(--text-muted); text-decoration: none; font-size: 13px; }
.inline-link:hover { color: var(--accent); }

/* ── Photo page ────────────────────────────────────────────────────────────── */
.photo-page { display: flex; flex-direction: column; }

.photo-stage {
  position: relative;
  background: #080808;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 55vh;
  max-height: 82vh;
  overflow: hidden;
}
.photo-stage img {
  max-width: 100%;
  max-height: 82vh;
  object-fit: contain;
  display: block;
}

.photo-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: rgba(255,255,255,0.25);
  background: rgba(0,0,0,0.3);
  border-radius: 50%;
  transition: color 0.2s, background 0.2s;
  user-select: none;
}
.photo-arrow:hover { color: #fff; background: rgba(0,0,0,0.6); }
.photo-arrow-prev { left: 1.25rem; }
.photo-arrow-next { right: 1.25rem; }

.photo-info-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 2rem;
  border-bottom: 1px solid var(--border);
  gap: 1rem;
  flex-wrap: wrap;
}
.photo-info-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  min-width: 0;
}
.photo-info-title { font-size: 15px; font-weight: 400; }
.photo-info-album {
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color 0.2s;
}
.photo-info-album:hover { color: var(--accent); }
.photo-info-date { font-size: 12px; color: var(--text-muted); }

.photo-info-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}
.photo-exif-toggle {
  padding: 0.3rem 0.8rem;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.photo-exif-toggle:hover, .photo-exif-toggle.active {
  color: var(--accent);
  border-color: var(--accent);
}

.photo-caption {
  padding: 0.75rem 2rem;
  font-size: 13px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  max-width: 680px;
}

/* ── EXIF panel (photo page) ───────────────────────────────────────────────── */
.exif-panel {
  padding: 1.25rem 2rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.exif-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0 2.5rem;
}
.exif-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 80px;
}
.exif-item dt {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.exif-item dd {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
}

/* ── Download button ───────────────────────────────────────────────────────── */
.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
  transition: border-color 0.2s, color 0.2s;
  flex-shrink: 0;
}
.btn-download:hover { border-color: var(--accent); color: var(--accent); }

/* ── Page header (legacy, kept for about/posts) ────────────────────────────── */
.page-header {
  padding: 2.5rem 2rem 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2px;
}
.page-header h1 {
  font-size: 22px;
  font-weight: 300;
  letter-spacing: -0.01em;
}
.page-description {
  color: var(--text-muted);
  margin-top: 0.4rem;
  font-size: 14px;
}

/* ── Prose / Markdown content ──────────────────────────────────────────────── */
.prose-content {
  max-width: 680px;
  margin: 0 auto;
  padding: 2.5rem 2rem;
  line-height: 1.8;
}
.prose-content h1, .prose-content h2, .prose-content h3 {
  font-weight: 400;
  margin: 1.5rem 0 0.5rem;
}
.prose-content p { margin-bottom: 1rem; color: var(--text-muted); }
.prose-content a { border-bottom: 1px solid var(--border); transition: border-color 0.2s; }
.prose-content a:hover { border-color: var(--accent); }

/* ── Posts list ────────────────────────────────────────────────────────────── */
.posts-list {
  max-width: 740px;
  margin: 0 auto;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.post-card {
  border-bottom: 1px solid var(--border);
  padding-bottom: 2rem;
}
.post-card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
.post-card-title { font-size: 18px; font-weight: 400; }
.post-card-date { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.post-card-body { font-size: 14px; color: var(--text-muted); }
.badge-pinned {
  margin-left: 0.5rem;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue);
}

/* ── Pagination ────────────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 2rem;
}
.page-link {
  font-size: 13px;
  color: var(--text-muted);
  transition: color 0.2s;
}
.page-link:hover { color: var(--accent); }
.page-info { font-size: 12px; color: var(--text-muted); }

/* ── Empty state ───────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 5rem 2rem;
  color: var(--text-muted);
  font-size: 14px;
}

/* ── Footer ────────────────────────────────────────────────────────────────── */
.site-footer {
  margin-top: 4rem;
  padding: 2rem;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}
.footer-link {
  color: var(--text-muted);
  text-decoration: none;
}
.footer-link:hover { color: var(--text-primary); }

/* ── Album unlock page ─────────────────────────────────────────────────────── */
.unlock-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--nav-height));
  padding: 2rem;
}
.unlock-card {
  width: 100%;
  max-width: 360px;
  text-align: center;
}
.unlock-icon { font-size: 32px; margin-bottom: 1rem; opacity: 0.5; }
.unlock-title { font-size: 20px; font-weight: 400; margin-bottom: 0.4rem; }
.unlock-sub { font-size: 13px; color: var(--text-muted); margin-bottom: 1.5rem; }
.unlock-error { font-size: 13px; color: var(--red); margin-bottom: 1rem; }
.unlock-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.unlock-input {
  width: 100%;
  padding: 0.65rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text);
  transition: border-color 0.2s;
}
.unlock-input:focus { border-color: var(--accent); }
.unlock-input-error { border-color: var(--red); }

/* ── Share link box ─────────────────────────────────────────────────────────── */
.share-link-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.share-link-row { display: flex; gap: 0.5rem; align-items: center; }
.share-link-input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.35rem 0.65rem;
  font-size: 12px;
  font-family: var(--mono);
  color: var(--text);
  min-width: 0;
}

/* ── Form separator ─────────────────────────────────────────────────────────── */
.form-separator {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.25rem 0;
}

/* ── Login page ────────────────────────────────────────────────────────────── */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
}
.login-container {
  width: 100%;
  max-width: 360px;
  padding: 2.5rem 2rem;
}
.login-title {
  font-size: 22px;
  font-weight: 300;
  letter-spacing: 0.06em;
  margin-bottom: 0.25rem;
  text-align: center;
}
.login-sub {
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
}
.login-error {
  text-align: center;
  font-size: 13px;
  color: var(--red);
  margin-bottom: 1rem;
}
.login-form { display: flex; flex-direction: column; gap: 1.25rem; }

/* ── Forms ─────────────────────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.form-group label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.form-group input,
.form-group textarea,
.form-group select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 0.85rem;
  font-size: 14px;
  color: var(--text);
  transition: border-color 0.2s;
  width: 100%;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--text-muted);
}
.form-group textarea { resize: vertical; }
.form-row {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 13px;
  cursor: pointer;
}
.checkbox-label input { width: 16px; height: 16px; cursor: pointer; accent-color: var(--accent); }

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.25rem;
  background: var(--accent);
  color: #000;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: opacity 0.2s;
  border: none;
}
.btn-primary:hover { opacity: 0.88; }
.btn-primary.full-width { width: 100%; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.btn-secondary:hover { border-color: var(--text-muted); color: var(--text); }

.btn-ghost {
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  border: none;
  transition: color 0.2s;
}
.btn-ghost:hover { color: var(--text); }

.btn-xs {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  transition: border-color 0.2s, color 0.2s;
}
.btn-xs:hover { border-color: var(--text-muted); color: var(--text); }
.btn-danger { border-color: transparent; color: var(--red); }
.btn-danger:hover { border-color: var(--red); color: var(--red); }

/* ── Badges ────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
}
.badge-green { background: rgba(61,220,132,0.12); color: var(--green); }
.badge-grey  { background: rgba(255,255,255,0.06); color: var(--text-muted); }
.badge-blue  { background: rgba(91,156,246,0.12); color: var(--blue); }

/* ── Admin layout — sidebar ────────────────────────────────────────────────── */
.admin-body {
  display: flex;
  min-height: 100vh;
  background: var(--bg);
}

.admin-sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 200px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.sidebar-brand {
  padding: 1.5rem 1.25rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo {
  display: block;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--accent);
  text-decoration: none;
}
.sidebar-label {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 2px;
  display: block;
}

.sidebar-nav {
  flex: 1;
  padding: 0.75rem 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow-y: auto;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1.25rem;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  border-radius: 0;
  transition: color 0.15s, background 0.15s;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
}
.sidebar-link:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.sidebar-link.active { color: var(--accent); background: rgba(255,255,255,0.06); }
.sidebar-icon { font-size: 11px; opacity: 0.7; width: 14px; text-align: center; flex-shrink: 0; }

.sidebar-footer {
  padding: 0.75rem 0;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.sidebar-link-muted { font-size: 12px; }
.sidebar-logout { font-family: inherit; font-size: 12px; }

.admin-main {
  margin-left: 200px;
  flex: 1;
  padding: 2rem 2.5rem;
  max-width: calc(100vw - 200px);
}

.admin-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
  gap: 1rem;
}
.admin-page-header h1 {
  font-size: 22px;
  font-weight: 300;
  letter-spacing: -0.01em;
  margin: 0;
}
.header-actions { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }

/* ── Section cards (aligned with .stats-block aesthetic) ────────────────── */
.admin-section,
.admin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.6rem 1.5rem;
  margin-bottom: 1.25rem;
}
.admin-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.1rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.admin-section h2,
.admin-section-header h2 {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1rem;
}
.admin-section-header h2 { margin-bottom: 0; }

.block-link {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-decoration: none;
  transition: color 0.15s;
}
.block-link:hover { color: var(--text); }

.link-action {
  background: none;
  border: none;
  padding: 0;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  transition: color 0.15s;
}
.link-action:hover { color: var(--text); }
.link-action:disabled { opacity: 0.5; cursor: default; }

/* ── Dashboard legacy stats-grid (now unused but kept for safety) ───────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 1.25rem;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.stat-value {
  font-size: 2.4rem;
  font-weight: 200;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--text);
}
.stat-label {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}

/* ── Quick actions ─────────────────────────────────────────────────────────── */
.quick-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }

/* ── Admin table ───────────────────────────────────────────────────────────── */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.admin-table th {
  text-align: left;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.5rem 0.6rem 0.7rem;
  border-bottom: 1px solid var(--border);
}
.admin-table td {
  padding: 0.7rem 0.6rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tbody tr { transition: background 0.12s; }
.admin-table tbody tr:hover { background: rgba(255,255,255,0.02); }
.table-thumb {
  width: 52px;
  height: 38px;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--surface-2);
}
.filename-cell { font-family: var(--mono); font-size: 12px; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.muted-cell { color: var(--text-muted); font-size: 12px; }
.actions-cell { display: flex; gap: 0.4rem; align-items: center; }
.actions-cell form { display: contents; }

/* ── Alerts ────────────────────────────────────────────────────────────────── */
.alert {
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 1.5rem;
}
.alert-info {
  background: rgba(91,156,246,0.1);
  border: 1px solid rgba(91,156,246,0.25);
  color: var(--blue);
}

/* ── Upload / Drop zone ────────────────────────────────────────────────────── */
.upload-form { margin-bottom: 1.5rem; }
.drop-zone {
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
}
.drop-zone:hover,
.drop-zone.dragover {
  border-color: var(--text-muted);
  background: var(--accent-dim);
}
.file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

/* ── Edit layout ───────────────────────────────────────────────────────────── */
.edit-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2rem;
  align-items: start;
}
.edit-preview {}
.edit-thumb {
  width: 100%;
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
}
.edit-form { display: flex; flex-direction: column; gap: 1.25rem; }

/* ── Post editor ───────────────────────────────────────────────────────────── */
.post-edit-form { display: flex; flex-direction: column; gap: 1.25rem; }
.post-editor-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.markdown-input { font-family: var(--mono); font-size: 13px; }
.markdown-preview {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  min-height: 400px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-muted);
  overflow-y: auto;
}

/* ── Inline form ───────────────────────────────────────────────────────────── */
.inline-form {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
}
.inline-form input,
.inline-form select {
  flex: 1;
  min-width: 160px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.55rem 0.85rem;
  font-size: 13px;
  color: var(--text);
  transition: border-color 0.15s;
}
.inline-form input:focus,
.inline-form select:focus { border-color: rgba(255,255,255,0.2); outline: none; }
.inline-form input::placeholder { color: var(--muted); opacity: 0.7; }

/* ── Photo select grid ─────────────────────────────────────────────────────── */
.photo-select-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 1rem;
}
.photo-select-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s;
}
.photo-select-item:hover { border-color: var(--text-muted); }
.photo-select-item.selected { border-color: var(--accent); background: rgba(255,255,255,0.05); }
.photo-select-item input { display: none; }
.photo-select-item img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 2px; }
.photo-select-name { font-size: 10px; color: var(--text-muted); text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; width: 100%; }
.album-select-cover { width: 100%; aspect-ratio: 3/2; overflow: hidden; border-radius: 2px; background: var(--surface-2); }
.album-select-cover img { width: 100%; height: 100%; object-fit: cover; }
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 0.3rem; }
.photo-select-actions { display: flex; gap: 0.75rem; align-items: center; margin-top: 1.25rem; }

/* ── Folder browser ───────────────────────────────────────────────────────── */
.folder-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
  font-size: 13px;
}
.crumb { color: var(--text-muted); transition: color 0.2s; }
.crumb:hover { color: var(--accent); }
.crumb-sep { color: var(--border); }

.folder-list { width: 100%; }
.folder-link {
  color: var(--text);
  transition: color 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.folder-link:hover { color: var(--accent); }

/* ── Modal ─────────────────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title { font-size: 16px; font-weight: 400; }
.modal-form { display: flex; flex-direction: column; gap: 1.1rem; }
.modal-actions { display: flex; gap: 0.75rem; margin-top: 0.5rem; }
#newAlbumFields { display: flex; flex-direction: column; gap: 1rem; }
.announcement-list { display: flex; flex-direction: column; gap: 0; }
.announcement-item { display: flex; align-items: center; justify-content: space-between; padding: 0.75rem 0; border-bottom: 1px solid var(--border); }
.announcement-item:last-child { border-bottom: none; }
.announcement-meta { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.announcement-title { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jobs-banner { display: flex; flex-direction: column; gap: 0.4rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.75rem 1rem; margin-bottom: 1.25rem; font-size: 13px; }
.job-running { color: var(--muted); }
.job-done { color: var(--accent); }
.progress-bar-track { width: 100%; height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; margin-bottom: 0.6rem; }
.progress-bar-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width 0.3s ease; width: 0%; }
.progress-label { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Per-page selector ─────────────────────────────────────────────────────── */
.per-page-select { display: flex; align-items: center; gap: 0.4rem; }
.per-page-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.2rem 0.55rem; font-size: 12px; color: var(--muted);
  border: 1px solid var(--border); border-radius: 4px;
  text-decoration: none; transition: color 0.15s, border-color 0.15s;
}
.per-page-btn:hover { color: var(--text); border-color: var(--text); }
.per-page-btn.active { color: var(--accent); border-color: var(--accent); }

/* ── Album card meta (date line) ────────────────────────────────────────────── */
.album-card-meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  display: block;
}

/* ── Album search ────────────────────────────────────────────────────────────── */
.album-search-wrap { display: flex; align-items: center; }
.album-search-input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 6px 12px;
  font-size: 13px;
  width: 220px;
}
.album-search-input:focus { border-color: var(--muted); outline: none; }

/* ── Save toast ──────────────────────────────────────────────────────────────── */
.save-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--green);
  color: #000;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  z-index: 9999;
  transition: opacity 0.4s ease;
}
.save-toast.fade-out { opacity: 0; }

/* ── Space picker (searchable dropdown) ──────────────────────────────────────── */
.space-picker { position: relative; }
.space-search-input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 8px 12px;
  font-size: 14px;
}
.space-search-input:focus { border-color: var(--muted); outline: none; }
.space-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  z-index: 100;
  max-height: 200px;
  overflow-y: auto;
}
.space-option {
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
}
.space-option:hover { background: var(--accent-dim); }

/* album-photo-grid, bulk-action-bar, photo-row, folder-files — see below */

/* ── Section header right (album dates) ──────────────────────────────────────── */
.section-header-right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.album-date-meta { font-size: 11px; }

/* ── btn-ghost (minimal text button) ────────────────────────────────────────── */
.btn-ghost {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: var(--radius);
}
.btn-ghost:hover { color: var(--text); background: var(--accent-dim); }

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .edit-layout { grid-template-columns: 1fr; }
  .post-editor-layout { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .navbar { padding: 0 1rem; }
  .navbar-links a { padding: 0 0.6rem; }
  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .albums-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .section-header { padding: 1.25rem 1rem 1rem; }
  .filter-bar { padding: 0 1rem; }
  .photo-info-bar { padding: 0.75rem 1rem; }
  .photo-caption { padding: 0.75rem 1rem; }
  .exif-panel { padding: 1rem; }
  .page-header { padding: 1.5rem 1rem 1rem; }
  .photo-arrow { width: 40px; height: 40px; font-size: 24px; }
  .admin-sidebar { width: 160px; }
  .admin-main { margin-left: 160px; padding: 1rem 1.25rem; max-width: calc(100vw - 160px); }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .navbar-links a { padding: 0 0.4rem; font-size: 11px; }
  .photo-grid { grid-template-columns: repeat(2, 1fr); }
  .albums-grid { grid-template-columns: repeat(2, 1fr); }
  .photo-arrow { display: none; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .post-card-header { flex-direction: column; gap: 0.25rem; }

  /* Hide sidebar completely — bottom nav takes over */
  .admin-sidebar { display: none; }
  .admin-main {
    margin-left: 0;
    padding: 0.75rem 0.75rem 90px;
    max-width: 100vw;
    width: 100%;
  }

  /* Tables: scroll + hide low-priority columns */
  .admin-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .admin-table { font-size: 12px; }
  .col-hide-mobile { display: none; }

  /* Touch-friendly action buttons */
  .btn-xs {
    min-height: 36px;
    padding: 0 10px;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .btn-icon {
    min-width: 36px;
    min-height: 36px;
    padding: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .cover-btn {
    min-width: 36px;
    min-height: 36px;
  }

  /* Always show photo overlays on mobile (no hover) */
  .album-photo-overlay { opacity: 1; }

  /* Form inputs full-width */
  .form-group input,
  .form-group textarea,
  .form-group select { width: 100%; box-sizing: border-box; }

  /* Form action buttons: stack vertically */
  .form-actions { flex-direction: column; gap: 0.5rem; }
  .form-actions .btn-primary,
  .form-actions .btn-secondary { width: 100%; text-align: center; }

  /* Share link row: wrap on small screens */
  .share-link-row { flex-wrap: wrap; gap: 0.5rem; }
  .share-link-input { min-width: 0; flex: 1 1 100%; width: 100%; }

  /* Page header: stack title and back button */
  .admin-page-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .header-actions { flex-wrap: wrap; gap: 0.5rem; }
  .admin-section-header { flex-direction: column; align-items: flex-start; gap: 0.5rem; }

  /* Post editor: single column */
  .post-editor-layout { grid-template-columns: 1fr; }

  /* Save toast: above bottom nav */
  .save-toast { bottom: 80px; }
}

/* admin-bottom-nav styles are defined at end of file */

/* ── Album card meta (date line) ─────────────────────────────────────────────── */
.album-card-meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  display: block;
}

/* ── Album search ────────────────────────────────────────────────────────────── */
.album-search-wrap { display: flex; align-items: center; }
.album-search-input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 6px 12px;
  font-size: 13px;
  width: 220px;
}
.album-search-input:focus { border-color: var(--muted); outline: none; }

/* ── Save toast ──────────────────────────────────────────────────────────────── */
.save-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--green);
  color: #000;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  z-index: 9999;
  transition: opacity 0.4s ease;
}
.save-toast.fade-out { opacity: 0; }

/* ── Space picker (searchable dropdown) ──────────────────────────────────────── */
.space-picker { position: relative; }
.space-search-input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 8px 12px;
  font-size: 14px;
}
.space-search-input:focus { border-color: var(--muted); outline: none; }
.space-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  z-index: 100;
  max-height: 200px;
  overflow-y: auto;
}
.space-option {
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
}
.space-option:hover { background: var(--accent-dim); }

/* ── Album photo grid (admin edit) ───────────────────────────────────────────── */
.album-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 140px);
  gap: 8px;
}
.album-photo-item {
  cursor: pointer;
  border-radius: var(--radius);
  overflow: hidden;
  border: 2px solid transparent;
  transition: border-color 0.15s;
}
.album-photo-item.selected { border-color: var(--accent); }
.album-photo-item.is-cover { border-color: var(--blue); }
.album-photo-thumb {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--surface);
}
.album-photo-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.album-photo-overlay {
  position: absolute; inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 4px;
  opacity: 0;
  transition: opacity 0.15s;
  background: linear-gradient(to bottom, rgba(0,0,0,0.55) 0%, transparent 50%);
}
.album-photo-item:hover .album-photo-overlay { opacity: 1; }
.album-photo-cb-wrap { cursor: pointer; }
.album-photo-reorder { display: flex; gap: 2px; }
.btn-icon {
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  border-radius: 3px;
  padding: 2px 5px;
  font-size: 11px;
  cursor: pointer;
  line-height: 1.4;
}
.btn-icon:hover { background: rgba(0,0,0,0.85); }
.cover-btn {
  position: absolute;
  bottom: 4px; right: 4px;
  background: rgba(0,0,0,0.5);
  color: #888;
  border: none;
  border-radius: 3px;
  font-size: 14px;
  padding: 2px 5px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  opacity: 0;
}
.album-photo-item:hover .cover-btn { opacity: 1; }
.album-photo-item.is-cover .cover-btn { opacity: 1; color: var(--blue); }
.cover-btn:hover { background: rgba(0,0,0,0.8); color: var(--blue); }
.album-photo-name {
  display: block;
  font-size: 10px;
  color: var(--muted);
  padding: 3px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: var(--surface);
}

/* ── Admin search input ───────────────────────────────────────────────────────── */
.admin-search-input {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 7px 12px;
  font-size: 13px;
}
.admin-search-input:focus { border-color: var(--muted); outline: none; }

/* ── Bulk action bar ─────────────────────────────────────────────────────────── */
.bulk-action-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* ── Photo row selected state ────────────────────────────────────────────────── */
.photo-row { transition: background 0.12s; }
.photo-row:hover { background: rgba(255,255,255,0.03); }
.photo-row.selected { background: rgba(255,255,255,0.06); }
.photos-table td { vertical-align: middle; }
.photo-sel-bar { width: 3px !important; padding: 0 !important; background: transparent; transition: background 0.15s; }
.photo-row:hover .photo-sel-bar { background: var(--muted); }
.photo-row.selected .photo-sel-bar { background: var(--accent); }
.nowrap-cell { white-space: nowrap; }
.btn-select-all { background: none; border: none; color: var(--muted); font-size: 11px; cursor: pointer; padding: 0; }
.btn-select-all:hover { color: var(--text); }

/* ── Folder cards (import page) ──────────────────────────────────────────── */
.folder-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.folder-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem 1.2rem;
  transition: border-color 0.2s;
}
.folder-card:hover { border-color: rgba(255,255,255,0.14); }
.folder-card-empty { opacity: 0.55; }
.folder-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}
.folder-card-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.folder-card-name {
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.15s;
}
.folder-card-name:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.folder-card-tag {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.folder-card-stats { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.folder-stat { display: flex; align-items: baseline; gap: 4px; }
.folder-stat-value { font-size: 14px; font-weight: 400; color: var(--text); font-variant-numeric: tabular-nums; }
.folder-stat-label { font-size: 11px; color: var(--muted); text-transform: lowercase; }

.folder-file-list {
  list-style: none;
  padding: 0.75rem 0 0;
  margin: 0.5rem 0 0;
  border-top: 1px solid rgba(255,255,255,0.04);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 2px 14px;
}
.file-list-item {
  font-size: 11.5px;
  color: var(--muted);
  padding: 2px 0;
  font-family: var(--mono);
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-list-item::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  flex-shrink: 0;
}
.file-list-item.done { color: var(--text); }
.file-list-item.done::before { background: var(--green); }
.file-list-item.raw { color: var(--yellow); }
.file-list-item.raw::before { background: var(--yellow); }

/* ── Section header right (album dates) ──────────────────────────────────────── */
.section-header-right { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.album-date-meta { font-size: 11px; }

/* ── btn-ghost ────────────────────────────────────────────────────────────────── */
.btn-ghost {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: var(--radius);
}
.btn-ghost:hover { color: var(--text); background: var(--accent-dim); }

/* ── Stats page (redesign) ───────────────────────────────────────────────────── */
.page-subtitle {
  font-size: 13px;
  color: var(--muted);
  margin: 4px 0 0;
  font-weight: 300;
}

/* Hero metrics */
.stats-hero {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 1.5rem 0 2rem;
}
.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 130px;
  transition: border-color 0.2s;
}
.hero-card:hover { border-color: rgba(255,255,255,0.14); }
.hero-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-weight: 500;
}
.hero-value {
  font-size: 2.6rem;
  font-weight: 200;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-top: 2px;
}
.hero-unit {
  font-size: 1rem;
  color: var(--muted);
  margin-left: 6px;
  font-weight: 300;
  letter-spacing: 0;
}
.hero-sub {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: auto;
}
.hero-sub-sep { opacity: 0.4; margin: 0 2px; }
.hero-strong { color: var(--text); font-weight: 400; }
.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-green { background: var(--green, #4ade80); }
.dot-grey  { background: var(--muted); opacity: 0.5; }

/* Donut chart (publication rate) */
.hero-donut-row { display: flex; align-items: center; gap: 14px; margin-top: 2px; }
.donut {
  --pct: 0;
  --size: 64px;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background:
    conic-gradient(var(--text) calc(var(--pct) * 1%), rgba(255,255,255,0.08) 0);
  display: grid;
  place-items: center;
  position: relative;
  flex-shrink: 0;
}
.donut::before {
  content: '';
  position: absolute;
  inset: 7px;
  background: var(--surface);
  border-radius: 50%;
}
.donut-text {
  position: relative;
  font-size: 13px;
  font-weight: 400;
  color: var(--text);
  letter-spacing: -0.01em;
}
.hero-donut-meta { display: flex; flex-direction: column; gap: 2px; }
.hero-donut-num {
  font-size: 1.6rem;
  font-weight: 200;
  line-height: 1;
  letter-spacing: -0.01em;
}
.hero-donut-of { font-size: 0.95rem; color: var(--muted); margin-left: 2px; }

/* Section blocks */
.stats-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.6rem 1.5rem;
  margin-bottom: 1.25rem;
}
.block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.1rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.block-head h2 {
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0;
}
.block-meta {
  font-size: 11px;
  color: var(--muted);
  font-weight: 300;
}

.stats-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 0;
}
.stats-two-col .stats-block { margin-bottom: 0; }

.stats-three-col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin-top: 1.25rem;
}
.stats-three-col .stats-block { margin-bottom: 0; }

/* Bar list — readable, two-line layout */
.bar-list { display: flex; flex-direction: column; gap: 11px; }
.bar-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.bar-item-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 12.5px;
}
.bar-item-label {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.bar-item-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.bar-item-count {
  color: var(--text);
  font-weight: 400;
}
.bar-item-pct {
  color: var(--muted);
  font-size: 11px;
  min-width: 32px;
  text-align: right;
}
.bar-item-track {
  background: rgba(255,255,255,0.04);
  height: 4px;
  border-radius: 2px;
  overflow: hidden;
}
.bar-item-fill {
  height: 100%;
  background: rgba(255,255,255,0.22);
  border-radius: 2px;
  min-width: 2px;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.bar-item-top .bar-item-label { color: var(--text); font-weight: 400; }
.bar-item-top .bar-item-fill { background: var(--text); }

.bar-empty {
  color: var(--muted);
  font-size: 12px;
  font-style: italic;
  padding: 0.5rem 0;
}

/* Timeline (vertical bars) */
.timeline-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 140px;
  padding: 4px 0;
}
.timeline-col {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: flex-end;
  min-width: 6px;
  cursor: pointer;
}
.timeline-bar {
  width: 100%;
  background: rgba(255,255,255,0.18);
  border-radius: 2px 2px 0 0;
  min-height: 2px;
  transition: background 0.15s, height 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.timeline-col:hover .timeline-bar { background: var(--text); }
.timeline-bar-accent { background: rgba(99,179,237,0.35); }
.timeline-col:hover .timeline-bar-accent { background: var(--accent); }
.timeline-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

@media (max-width: 1100px) {
  .stats-hero { grid-template-columns: repeat(2, 1fr); }
  .stats-three-col { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .stats-hero { grid-template-columns: 1fr; }
  .stats-two-col, .stats-three-col { grid-template-columns: 1fr; }
}

/* ── Album tab picker (import modal) ─────────────────────────────────────────── */
.album-tab-bar {
  display: flex;
  gap: 2px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3px;
}
.album-tab {
  flex: 1;
  background: none;
  border: none;
  border-radius: calc(var(--radius) - 2px);
  color: var(--muted);
  font-size: 12px;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.album-tab:hover { color: var(--text); }
.album-tab.active { background: var(--surface-2, rgba(255,255,255,0.08)); color: var(--text); }

.album-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 180px;
  overflow-y: auto;
  margin-top: 0.5rem;
  padding: 2px;
}
.album-list-item {
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 12.5px;
  padding: 0.4rem 0.75rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.album-list-item:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.album-list-item.active { border-color: var(--accent); background: rgba(255,255,255,0.05); color: var(--text); }

/* ── Space pill selector ─────────────────────────────────────────────────────── */
.space-pill-group { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.space-pill { display: inline-flex; cursor: pointer; }
.space-pill input[type="radio"] { display: none; }
.space-pill span {
  display: inline-block;
  padding: 0.3rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 99px;
  font-size: 12px;
  color: var(--muted);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.space-pill:hover span { color: var(--text); border-color: var(--text-muted); }
.space-pill input[type="radio"]:checked + span {
  border-color: var(--accent);
  color: var(--text);
  background: rgba(255,255,255,0.05);
}

/* ── Albums create form ──────────────────────────────────────────────────────── */
.create-form { display: flex; flex-direction: column; gap: 1rem; }
.create-form-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.form-hint { font-size: 11px; color: var(--muted); font-weight: 300; }

/* ── Posts create cards ──────────────────────────────────────────────────────── */
.post-create-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.post-create-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}
.post-create-card:hover { border-color: var(--accent); background: rgba(255,255,255,0.03); }
.post-create-icon { font-size: 22px; line-height: 1; flex-shrink: 0; }
.post-create-title { font-size: 13px; font-weight: 500; margin-bottom: 2px; }
.post-create-desc { font-size: 11.5px; color: var(--muted); }

/* ── Post list enhancements ──────────────────────────────────────────────────── */
.post-title-cell { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.post-pin-icon { font-size: 11px; }
.post-excerpt-cell { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* ── Native dialog (Match RAW) ───────────────────────────────────────────────── */
.native-dialog {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text);
  padding: 1.5rem;
  max-width: 520px;
  width: 90vw;
}
.native-dialog::backdrop { background: rgba(0,0,0,0.6); }
.native-dialog .modal-form { display: flex; flex-direction: column; gap: 1rem; }
.native-dialog code { background: rgba(255,255,255,0.06); padding: 1px 4px; border-radius: 3px; font-size: 11px; }

/* ── Match RAW section (album edit) ──────────────────────────────────────────── */
.match-raw-section summary { cursor: pointer; padding: 0.25rem 0; font-size: 13px; }
.match-raw-section summary::marker { color: var(--muted); }
.match-raw-form { display: flex; flex-direction: column; gap: 1rem; margin-top: 1rem; }
.match-raw-form code { background: rgba(255,255,255,0.06); padding: 1px 4px; border-radius: 3px; font-size: 11px; }

/* ── Input with adjacent button ──────────────────────────────────────────────── */
.input-with-button { display: flex; gap: 6px; align-items: stretch; }
.input-with-button input { flex: 1; }
.btn-sm { font-size: 12px; padding: 0.4rem 0.8rem; }

/* ── Folder picker dialog ────────────────────────────────────────────────────── */
.folder-picker-dialog { max-width: 600px; width: 92vw; padding: 1.25rem 1.4rem; }
.folder-picker-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 0.75rem;
}
.folder-picker-crumbs {
  display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
  padding: 0.5rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12px;
  margin-bottom: 0.6rem;
}
.folder-picker-crumbs .crumb {
  color: var(--text-muted);
  text-decoration: none;
  padding: 1px 4px;
  border-radius: 3px;
}
.folder-picker-crumbs .crumb:hover { color: var(--text); background: rgba(255,255,255,0.06); }
.folder-picker-crumbs .crumb-sep { color: var(--muted); font-size: 11px; }
.folder-picker-current {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
  display: flex; gap: 6px; align-items: center;
}
.folder-picker-current code {
  background: rgba(255,255,255,0.06);
  padding: 2px 6px; border-radius: 3px; font-size: 11px;
  color: var(--text);
}
.folder-picker-list {
  display: flex; flex-direction: column; gap: 2px;
  max-height: 320px; overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px;
}
.folder-picker-item {
  display: flex; align-items: center; justify-content: space-between;
  text-align: left;
  background: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--text);
  font-size: 13px;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.folder-picker-item:hover { background: rgba(255,255,255,0.05); border-color: var(--border); }

@media (max-width: 600px) {
  .post-create-cards { grid-template-columns: 1fr; }
  .create-form-row { flex-direction: column; }
}

/* ── Post editor tabs (mobile) ───────────────────────────────────────────────── */
.editor-tabs {
  display: none;
}
.editor-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 0.5rem 1rem;
}
.editor-tab.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

@media (max-width: 480px) {
  .editor-tabs { display: flex; margin-bottom: 0.5rem; }
  .desktop-only { display: none; }
}

/* ── Admin bottom navigation (mobile) ───────────────────────────────────────── */
.admin-bottom-nav {
  display: none;
}

@media (max-width: 480px) {
  .admin-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 64px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    z-index: 200;
    align-items: stretch;
  }
  .bnav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 9px;
    padding: 6px 2px;
    transition: color 0.15s;
    -webkit-tap-highlight-color: transparent;
    min-width: 0;
  }
  .bnav-item.active { color: var(--accent); }
  .bnav-item:hover { color: var(--text); }
  .bnav-icon {
    font-size: 16px;
    line-height: 1;
    display: block;
  }
  .bnav-label {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }
}

/* ── Admin card ──────────────────────────────────────────────────────────────── */
.admin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}

/* ── Stats section title (visitor stats divider) ─────────────────────────────── */
.stats-section-title {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 2rem 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.stats-section-title::before,
.stats-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.stats-section-badge {
  background: rgba(99,179,237,0.12);
  color: var(--accent);
  border: 1px solid rgba(99,179,237,0.25);
  border-radius: 20px;
  padding: 2px 8px;
  font-size: 10px;
  white-space: nowrap;
  text-transform: none;
  letter-spacing: 0;
}

/* ── Visit top list (top photos / albums) ─────────────────────────────────────── */
.visit-top-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.visit-top-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: background 0.12s;
}
.visit-top-item:hover { background: rgba(255,255,255,0.05); }
.visit-top-thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  background: var(--surface-2);
}
.visit-top-placeholder {
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.visit-top-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.visit-top-name {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.visit-top-count {
  font-size: 11px;
  color: var(--text-muted);
}
.visit-top-dl {
  color: #6eb5ff;
}

/* ── Activity log ──────────────────────────────────────────────────────────── */
.activity-log {
  overflow-x: auto;
}
.activity-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.activity-table thead th {
  text-align: left;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.activity-row td {
  padding: 7px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: middle;
}
.activity-row:last-child td { border-bottom: none; }
.activity-row-dl { background: rgba(110,181,255,0.04); }
.activity-time {
  white-space: nowrap;
  color: var(--text-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.activity-name {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.activity-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  background: rgba(255,255,255,0.08);
  color: var(--text-muted);
}
.activity-badge-photo { background: rgba(130,180,130,0.15); color: #8bc48b; }
.activity-badge-album { background: rgba(100,150,220,0.15); color: #7aaee8; }
.activity-badge-space { background: rgba(200,150,100,0.15); color: #d4a06a; }
.activity-badge-home  { background: rgba(180,140,220,0.15); color: #c09ae0; }
.activity-event {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.activity-event-download { color: #6eb5ff; }
.activity-row-bot { opacity: 0.6; }
.activity-source-bot {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #e07a5f;
  background: rgba(224,122,95,0.12);
  padding: 2px 6px;
  border-radius: 4px;
}
.activity-source-human {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #8bc48b;
  background: rgba(139,196,139,0.12);
  padding: 2px 6px;
  border-radius: 4px;
}
