/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f0f2f5;
  --surface: #ffffff;
  --sidebar-bg: #1e2130;
  --sidebar-hover: #2a2f45;
  --sidebar-active: #4361ee;
  --text: #1a1d2e;
  --text-muted: #6b7280;
  --accent: #4361ee;
  --accent-hover: #3451d1;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --border: #e5e7eb;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 25px rgba(0,0,0,.15);
}

body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }

/* ── Auth Screen ── */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e2130 0%, #2d3561 100%);
}

.auth-box {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
}

.auth-box h1 {
  font-size: 1.75rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 1.5rem;
  color: var(--accent);
}

.auth-box p { color: var(--text-muted); margin-bottom: 1rem; font-size: .9rem; text-align: center; }

.auth-box input[type="password"] {
  width: 100%;
  padding: .75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  margin-bottom: .75rem;
  outline: none;
  transition: border-color .2s;
}
.auth-box input[type="password"]:focus { border-color: var(--accent); }

.auth-box button { width: 100%; }

.error { color: var(--danger); font-size: .85rem; margin-top: .5rem; min-height: 1.2em; }

/* ── App Shell ── */
.app-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: var(--sidebar-bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  z-index: 100;
}

.app-header h1 { color: #fff; font-size: 1.1rem; font-weight: 600; letter-spacing: .02em; }

.app-body {
  display: flex;
  padding-top: 56px;
  min-height: 100vh;
}

/* ── Sidebar ── */
.sidebar {
  width: 240px;
  min-height: calc(100vh - 56px);
  background: var(--sidebar-bg);
  padding: 1rem;
  flex-shrink: 0;
  position: fixed;
  top: 56px;
  bottom: 0;
  overflow-y: auto;
}

.album-list { margin-top: .75rem; display: flex; flex-direction: column; gap: 2px; }

.album-item {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .6rem .75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: #ccc;
  font-size: .9rem;
  transition: background .15s, color .15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.album-item:hover { background: var(--sidebar-hover); color: #fff; }
.album-item.active { background: var(--sidebar-active); color: #fff; }

.album-item-thumb {
  width: 32px; height: 32px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  background: #333;
}
.album-item-icon {
  width: 32px; height: 32px;
  border-radius: 4px;
  background: #333;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.album-item-name { overflow: hidden; text-overflow: ellipsis; }
.album-item-count { margin-left: auto; font-size: .75rem; color: #888; flex-shrink: 0; }
.album-item.active .album-item-count { color: rgba(255,255,255,.7); }

/* ── Main Content ── */
.main-content {
  margin-left: 240px;
  flex: 1;
  padding: 1.5rem;
  min-width: 0;
}

/* ── Buttons ── */
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: .6rem 1.2rem;
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }

.btn-danger {
  background: var(--danger);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: .5rem 1rem;
  font-size: .85rem;
  cursor: pointer;
  transition: background .15s;
}
.btn-danger:hover { background: var(--danger-hover); }

.btn-text {
  background: none;
  border: none;
  color: #ccc;
  cursor: pointer;
  font-size: .9rem;
  padding: .4rem .6rem;
  border-radius: var(--radius-sm);
  transition: color .15s;
}
.btn-text:hover { color: #fff; }

.btn-ghost {
  background: none;
  border: 1.5px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: .45rem .9rem;
  font-size: .85rem;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.btn-small {
  padding: .35rem .7rem;
  font-size: .8rem;
}

.btn-block { width: 100%; justify-content: center; }

/* ── Empty State ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  color: var(--text-muted);
  text-align: center;
  gap: .75rem;
}
.empty-state .empty-icon { font-size: 3rem; }
.empty-state p { font-size: 1rem; }

/* ── Album Header ── */
.album-header {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
}

.album-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.album-title {
  font-size: 1.4rem;
  font-weight: 700;
  outline: none;
  border-bottom: 2px solid transparent;
  padding-bottom: 2px;
  transition: border-color .2s;
}
.album-title:focus { border-bottom-color: var(--accent); }

.album-desc {
  font-size: .9rem;
  color: var(--text-muted);
  outline: none;
  border-bottom: 1.5px solid transparent;
  padding-bottom: 2px;
  transition: border-color .2s;
  min-width: 200px;
}
.album-desc:focus { border-bottom-color: var(--accent); }
.album-desc:empty::before { content: attr(data-placeholder); color: #aaa; }

.album-meta { display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.album-actions { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }

.share-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: .5rem .75rem;
  flex-wrap: wrap;
}
.share-row label { font-size: .8rem; color: var(--text-muted); white-space: nowrap; }
.share-link-input {
  font-size: .8rem;
  border: none;
  background: none;
  color: var(--accent);
  cursor: pointer;
  flex: 1;
  min-width: 120px;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Upload Zone ── */
.upload-zone {
  border: 2.5px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  margin-bottom: 1.25rem;
  background: var(--surface);
  transition: border-color .2s, background .2s;
  cursor: default;
}
.upload-zone.drag-over { border-color: var(--accent); background: rgba(67, 97, 238, .04); }
.upload-zone.uploading { opacity: .7; pointer-events: none; }

.upload-zone-inner { display: flex; flex-direction: column; align-items: center; gap: .75rem; }
.upload-icon { font-size: 2rem; }
.upload-zone p { color: var(--text-muted); font-size: .9rem; }

.upload-url-row {
  display: flex;
  gap: .5rem;
  width: 100%;
  max-width: 520px;
  margin-top: .25rem;
}
.upload-url-row input {
  flex: 1;
  padding: .55rem .9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  outline: none;
  transition: border-color .2s;
}
.upload-url-row input:focus { border-color: var(--accent); }

.upload-progress {
  font-size: .85rem;
  color: var(--accent);
  font-weight: 500;
}

/* ── Images Grid ── */
.images-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: .75rem;
}

.img-card {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #ddd;
  aspect-ratio: 1;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s;
}
.img-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.img-card:hover .img-overlay { opacity: 1; }

.img-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.img-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.7) 0%, transparent 50%);
  opacity: 0;
  transition: opacity .2s;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: .5rem;
}

.img-caption-text {
  color: #fff;
  font-size: .75rem;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.img-actions {
  position: absolute;
  top: .4rem;
  right: .4rem;
  display: flex;
  gap: .3rem;
  opacity: 0;
  transition: opacity .2s;
}
.img-card:hover .img-actions { opacity: 1; }

.img-btn {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-size: .75rem;
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s;
  backdrop-filter: blur(4px);
}
.img-btn:hover { transform: scale(1.1); }
.img-btn-delete { background: rgba(239,68,68,.85); color: #fff; }
.img-btn-cover  { background: rgba(255,255,255,.85); color: #333; }

/* ── Modal ── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
}

.modal-content {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 2rem;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
}

.modal-content h2 { font-size: 1.25rem; margin-bottom: 1.25rem; }

.modal-content input,
.modal-content textarea {
  width: 100%;
  padding: .65rem .9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .95rem;
  margin-bottom: .75rem;
  outline: none;
  font-family: inherit;
  transition: border-color .2s;
}
.modal-content input:focus,
.modal-content textarea:focus { border-color: var(--accent); }
.modal-content textarea { resize: vertical; min-height: 80px; }

.modal-actions { display: flex; gap: .75rem; justify-content: flex-end; margin-top: .5rem; }

/* ── Caption Edit Modal ── */
.caption-edit-input {
  width: 100%;
  padding: .65rem .9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .95rem;
  outline: none;
  font-family: inherit;
  transition: border-color .2s;
}
.caption-edit-input:focus { border-color: var(--accent); }

/* ── Lightbox ── */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  cursor: pointer;
}

.lightbox-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 90vw;
  max-height: 90vh;
  cursor: default;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 4px;
  display: block;
}

/* kept for any legacy refs */
.lightbox-caption { display: none; }

/* ── Lightbox description panel ── */
.lb-desc-wrap {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}

.lb-desc-view {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  padding: .75rem .5rem .25rem;
}

.lb-desc-text {
  flex: 1;
  color: rgba(255,255,255,.9);
  font-size: 1rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 1.4em;
}

.lb-desc-text:empty::before {
  content: 'Click ✏ to add a description';
  color: rgba(255,255,255,.25);
  font-style: italic;
}

.lb-desc-readonly .lb-desc-text:empty {
  display: none;
}

.lb-edit-btn {
  flex-shrink: 0;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.15);
  color: rgba(255,255,255,.55);
  border-radius: var(--radius-sm);
  padding: .3rem .55rem;
  font-size: .8rem;
  cursor: pointer;
  transition: background .15s, color .15s;
  margin-top: .1rem;
}
.lb-edit-btn:hover { background: rgba(255,255,255,.2); color: #fff; }

.lb-desc-editor {
  padding: .6rem .5rem .25rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.lb-desc-input {
  width: 100%;
  background: rgba(255,255,255,.08);
  border: 1.5px solid rgba(255,255,255,.2);
  border-radius: var(--radius-sm);
  color: #fff;
  font-size: 1rem;
  line-height: 1.6;
  padding: .65rem .85rem;
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
  outline: none;
  transition: border-color .2s;
}
.lb-desc-input:focus { border-color: rgba(255,255,255,.5); }
.lb-desc-input::placeholder { color: rgba(255,255,255,.3); }

.lb-editor-actions {
  display: flex;
  align-items: center;
  gap: .6rem;
}

.lb-editor-hint {
  flex: 1;
  font-size: .75rem;
  color: rgba(255,255,255,.3);
}

/* Override btn-ghost colours inside lightbox */
.lb-editor-actions .btn-ghost {
  border-color: rgba(255,255,255,.2);
  color: rgba(255,255,255,.7);
}
.lb-editor-actions .btn-ghost:hover {
  border-color: rgba(255,255,255,.5);
  color: #fff;
}

.lightbox-close {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  width: 40px; height: 40px;
  background: rgba(255,255,255,.15);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
  z-index: 1;
}
.lightbox-close:hover { background: rgba(255,255,255,.3); }

.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 44px; height: 44px;
  background: rgba(255,255,255,.15);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}
.lightbox-nav:hover { background: rgba(255,255,255,.3); }
.lightbox-prev { left: 1.25rem; }
.lightbox-next { right: 1.25rem; }
.lightbox-counter {
  position: fixed;
  top: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,.7);
  font-size: .85rem;
}

/* ── Toast ── */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  z-index: 400;
}

.toast {
  padding: .7rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: slideIn .2s ease;
  max-width: 300px;
}
.toast-success { background: #22c55e; color: #fff; }
.toast-error   { background: var(--danger); color: #fff; }
.toast-info    { background: var(--accent); color: #fff; }

@keyframes slideIn {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* ── Public Gallery ── */
.gallery-page {
  min-height: 100vh;
  background: #0f1117;
  color: #fff;
}

.gallery-page-header {
  padding: 3rem 2rem 2rem;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.gallery-page-header h1 { font-size: 2rem; font-weight: 700; margin-bottom: .5rem; }
.gallery-page-header p  { color: rgba(255,255,255,.55); font-size: 1rem; }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 4px;
  padding: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

.gallery-thumb {
  aspect-ratio: 1;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  background: #1a1d2e;
}
.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease, opacity .2s;
}
.gallery-thumb:hover img { transform: scale(1.04); }
.gallery-thumb .gallery-caption {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, rgba(0,0,0,.75) 0%, transparent 100%);
  padding: .75rem .6rem .4rem;
  color: #fff;
  font-size: .78rem;
  opacity: 0;
  transition: opacity .2s;
}
.gallery-thumb:hover .gallery-caption { opacity: 1; }

.gallery-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem;
  color: rgba(255,255,255,.35);
}

.gallery-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  gap: 1rem;
  color: rgba(255,255,255,.5);
}

.spinner {
  width: 36px; height: 36px;
  border: 3px solid rgba(255,255,255,.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Settings panel ── */
.settings-panel {
  position: fixed;
  top: 56px; right: 0;
  width: 300px;
  height: calc(100vh - 56px);
  background: var(--surface);
  border-left: 1px solid var(--border);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-shadow: -4px 0 12px rgba(0,0,0,.08);
  z-index: 50;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform .25s ease;
}
.settings-panel.open { transform: translateX(0); }
.settings-panel h3 { font-size: 1rem; font-weight: 600; }
.settings-panel label { display: block; font-size: .85rem; color: var(--text-muted); margin-bottom: .35rem; }
.settings-panel input {
  width: 100%;
  padding: .55rem .8rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  outline: none;
  transition: border-color .2s;
}
.settings-panel input:focus { border-color: var(--accent); }
.settings-divider { border: none; border-top: 1px solid var(--border); }

/* ── User list in settings ── */
.user-list { display: flex; flex-direction: column; gap: .4rem; margin-bottom: .75rem; }

.user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: .45rem .65rem;
  gap: .5rem;
}

.user-row-info { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.user-row-name { font-size: .9rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-row-role { font-size: .72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }

.user-row-actions { display: flex; gap: .3rem; flex-shrink: 0; }

.add-user-form { display: flex; flex-direction: column; gap: .4rem; }
.add-user-form input { width: 100%; padding: .5rem .75rem; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: .88rem; outline: none; transition: border-color .2s; }
.add-user-form input:focus { border-color: var(--accent); }

/* ── Edit mode ── */
.edit-mode-btn.active,
#edit-toggle-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.img-actions-edit {
  opacity: 1 !important; /* always visible in edit mode */
  position: absolute;
  top: .4rem; right: .4rem;
  display: flex; gap: .3rem;
}

.img-btn-desc { background: rgba(255,255,255,.85); color: #333; }

/* ── Mobile hamburger ── */
.hamburger-btn {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
  padding: .3rem .4rem;
  border-radius: var(--radius-sm);
  line-height: 1;
  transition: background .15s;
}
.hamburger-btn:hover { background: rgba(255,255,255,.12); }

.header-username {
  color: rgba(255,255,255,.45);
  font-size: .82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
}

/* ── Sidebar overlay ── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 98;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.visible { display: block; }

/* ── Mobile breakpoint ── */
@media (max-width: 767px) {
  .hamburger-btn { display: flex; align-items: center; }

  /* Sidebar becomes a drawer */
  .sidebar {
    position: fixed;
    top: 56px; left: 0; bottom: 0;
    z-index: 99;
    transform: translateX(-100%);
    transition: transform .25s ease;
    width: 260px;
  }
  .sidebar.open { transform: translateX(0); }

  /* Main fills full width */
  .main-content {
    margin-left: 0;
    padding: 1rem;
  }

  /* Tighter image grid: 2 columns */
  .images-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: .4rem;
  }

  /* Stack album header vertically */
  .album-header { padding: 1rem; }
  .album-header-top { flex-direction: column; gap: .6rem; }
  .album-actions { flex-wrap: wrap; }
  .album-title { font-size: 1.2rem; }

  /* Share row wraps */
  .share-row { flex-wrap: wrap; gap: .4rem; }
  .share-link-input { max-width: 100%; min-width: 0; flex: 1 1 100%; }

  /* Upload zone less tall */
  .upload-zone { padding: 1rem; }
  .upload-zone-inner { gap: .6rem; }
  .upload-url-row { flex-direction: column; }
  .upload-url-row input { min-width: 0; }

  /* Settings panel: full-width drawer from right */
  .settings-panel {
    width: 100%;
    max-width: 100%;
  }

  /* Auth box full width */
  .auth-box { padding: 1.75rem 1.25rem; }

  /* Modals: full-width with margin */
  .modal-content {
    max-width: calc(100vw - 2rem);
    padding: 1.5rem;
  }

  /* Empty state smaller */
  .empty-state { min-height: 40vh; }

  /* Bigger lightbox nav targets on touch */
  .lightbox-nav {
    width: 48px; height: 48px;
    font-size: 1.6rem;
  }
  .lightbox-prev { left: .25rem; }
  .lightbox-next { right: .25rem; }

  /* Lightbox image fills more of the screen */
  .lightbox-img { max-height: 72vh; }

  /* Gallery grid: smaller minimum column on mobile */
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 2px;
    padding: .75rem;
  }
  .gallery-page-header { padding: 2rem 1rem 1.25rem; }
  .gallery-page-header h1 { font-size: 1.5rem; }

  /* No-album hint changes on mobile */
  .no-album-mobile-hint { display: block; }
}

/* tablet: 3 columns, sidebar always visible */
@media (min-width: 768px) {
  .hamburger-btn { display: none; }
  .sidebar { transform: none !important; transition: none; }
}

/* Auth box inputs need spacing too */
.auth-box input[type="text"] {
  width: 100%;
  padding: .75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  margin-bottom: .75rem;
  outline: none;
  transition: border-color .2s;
}
.auth-box input[type="text"]:focus { border-color: var(--accent); }
