/* Pixelicious Photography – File share */

:root {
  --bg: #0f0f0f;
  --surface: #1a1a1a;
  --border: #2a2a2a;
  --text: #e8e8e8;
  --muted: #888;
  --accent: #c4a574;
  --accent-hover: #d4b884;
  --primary: #22c55e;
  --primary-hover: #16a34a;
  --error: #c44;
  --radius: 8px;
}

[data-theme="light"] {
  --bg: #f5f5f5;
  --surface: #fff;
  --border: #e0e0e0;
  --text: #1a1a1a;
  --muted: #666;
  --accent: #9a7b4f;
  --accent-hover: #8a6b3f;
}

[data-theme="light"] .collection-card-check-wrap {
  background: rgba(255, 255, 255, 0.85);
}

[data-theme="light"] .btn-secondary {
  background: rgba(0, 0, 0, 0.06);
  color: #333;
  border-color: rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .btn-secondary:hover {
  background: rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.2);
  color: #111;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

/* Auth (login / setup) */
.auth-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
}

.brand {
  text-align: center;
  margin-bottom: 2rem;
}

.brand h1 {
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin: 0;
}

.tagline {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0.25rem 0 0;
}

.auth-card {
  width: 100%;
  max-width: 360px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}

.auth-card h2 {
  margin: 0 0 1.25rem;
  font-size: 1.25rem;
  font-weight: 600;
}

.auth-card .error {
  color: var(--error);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.auth-card label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.auth-card input {
  width: 100%;
  padding: 0.6rem 0.75rem;
  margin-bottom: 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 1rem;
}

.auth-card input:focus {
  outline: none;
  border-color: var(--accent);
}

.auth-card button {
  width: 100%;
  padding: 0.75rem;
  margin-top: 0.5rem;
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

.auth-card button:hover {
  background: var(--accent-hover);
}

.auth-card-hint {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 1rem 0;
}

.logs-stats {
  margin-bottom: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.logs-stats .users-table {
  margin: 0;
}

.logs-stats-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0;
  padding: 1rem 1.25rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

/* Dashboard */
.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.dashboard-header h1 {
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0;
}

.dashboard-header nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}

.dashboard-header nav a:hover {
  color: var(--accent);
}

.dashboard main {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.dashboard .upload-section,
.dashboard .shares-section {
  margin-bottom: 2.5rem;
}

.dashboard h2 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 1rem;
  color: var(--text);
}

.upload-form label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.upload-form input[type="datetime-local"] {
  width: 100%;
  max-width: 280px;
  padding: 0.5rem 0.75rem;
  margin-bottom: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.95rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--text);
}

.checkbox-label input[type="checkbox"] {
  width: auto;
  margin: 0;
  accent-color: var(--accent);
}

.upload-hint {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 1rem;
}

.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  text-align: center;
  cursor: pointer;
  margin-bottom: 1rem;
  transition: border-color 0.15s, background 0.15s;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--accent);
  background: rgba(196, 165, 116, 0.06);
}

.dropzone p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.file-list {
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.file-list:empty {
  display: none;
}

/* Upload progress – overall + per-file */
.upload-progress {
  margin-bottom: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}

.upload-progress-overall {
  margin-bottom: 1.25rem;
}

.upload-progress-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}

.upload-progress-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}

.upload-progress-meta {
  font-size: 0.85rem;
  color: var(--muted);
}

.upload-progress-speed {
  font-size: 0.85rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.upload-progress-eta {
  font-size: 0.82rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  opacity: 0.8;
}

.upload-progress-pct {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent);
  margin-left: auto;
}

.upload-progress-bar {
  width: 100%;
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
  accent-color: var(--accent);
  display: block;
}

.upload-file-rows {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 280px;
  overflow-y: auto;
}

.upload-file-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.5rem 1rem;
  font-size: 0.875rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  transition: opacity 0.2s;
}

.upload-file-row:last-child {
  border-bottom: none;
}

.upload-file-row.done {
  opacity: 0.7;
}

.upload-file-row.done .upload-file-pct {
  color: var(--muted);
}

.upload-file-row.uploading .upload-file-name {
  color: var(--accent);
  font-weight: 500;
}

.upload-file-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-width: 0;
}

.upload-file-name {
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upload-file-size {
  font-size: 0.8rem;
  color: var(--muted);
  flex-shrink: 0;
}

.upload-file-pct {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--accent);
  min-width: 2.5em;
  text-align: right;
}

.upload-file-bar {
  grid-column: 1 / -1;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  accent-color: var(--accent);
}

.upload-file-row.done .upload-file-bar {
  opacity: 0.6;
}

.share-result {
  margin-bottom: 1rem;
  padding: 1rem;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.share-result p {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.share-link-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.share-link-row input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.9rem;
}

.share-link-row button {
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.share-link-row button:hover {
  background: var(--accent-hover);
}

#upload_btn {
  padding: 0.75rem 1.5rem;
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

#upload_btn:hover:not(:disabled) {
  background: var(--accent-hover);
}

#upload_btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Shares list */
.shares-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.share-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: grid;
  gap: 0.75rem;
}

.share-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}

.share-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  word-break: break-all;
}

.share-link:hover {
  text-decoration: underline;
}

.share-date {
  font-size: 0.8rem;
  color: var(--muted);
}

.expires {
  font-size: 0.8rem;
  color: var(--muted);
}

.expires.expired {
  color: var(--error);
  font-weight: 500;
}

.share-stats {
  font-size: 0.85rem;
  color: var(--muted);
}

.share-stats span {
  margin-right: 1rem;
}

.share-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-copy,
.btn-delete {
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}

.btn-copy:hover,
.btn-delete:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-delete:hover {
  border-color: var(--error);
  color: var(--error);
}

.no-shares {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0;
}

/* Collections dashboard layout (sidebar + topbar + grid) */
.collections-dashboard {
  display: flex;
  min-height: 100vh;
}

.dashboard-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 1.25rem 0;
}

.sidebar-brand {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  padding: 0 1.25rem 1rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1.25rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.15s, background 0.15s;
}

.sidebar-link:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.sidebar-link.active {
  color: var(--accent);
  background: rgba(196, 165, 116, 0.08);
  font-weight: 500;
}

.sidebar-icon {
  font-size: 1rem;
  opacity: 0.9;
}

.dashboard-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.dashboard-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.topbar-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
  color: var(--text);
}

.topbar-storage {
  margin: 0 0 0 auto;
  font-size: 0.85rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.storage-status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--muted);
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  background: var(--bg);
}

.storage-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.storage-status--ok .storage-status-dot {
  background: var(--success, #22c55e);
}

.storage-status--error .storage-status-dot {
  background: var(--error, #ef4444);
}

.storage-status--error .storage-status-text {
  color: var(--error, #ef4444);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.logs-filter-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.logs-filter-label {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
}

.logs-filter-input {
  padding: 0.45rem 0.65rem;
  min-width: 160px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.9rem;
}

.logs-filter-input:focus,
.logs-filter-input:focus-visible {
  outline: none;
  border-color: var(--accent);
}

.btn-sm {
  padding: 0.45rem 0.9rem;
  font-size: 0.85rem;
}

.logs-empty {
  color: var(--muted);
  text-align: center;
  padding: 2rem !important;
}

.search-wrap {
  display: flex;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.4rem 0.75rem;
  min-width: 180px;
}

.search-icon {
  margin-right: 0.5rem;
  opacity: 0.6;
  font-size: 0.9rem;
}

.search-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: none;
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
}

.search-input::placeholder {
  color: var(--muted);
}

.btn-new-collection {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-new-collection:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-new-collection:active {
  transform: translateY(0);
}

.btn-chevron {
  font-size: 0.65rem;
  opacity: 0.9;
}

.view-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.view-btn {
  padding: 0.45rem 0.65rem;
  border: none;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  border-radius: 6px;
  transition: color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}

.view-btn:hover {
  color: var(--text);
}

.view-btn.active {
  background: var(--border);
  color: var(--text);
}

.view-btn:active {
  transform: scale(0.98);
}

.collections-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.collections-toolbar .bulk-actions {
  margin-left: 0.25rem;
  padding-left: 0.75rem;
  border-left: 1px solid var(--border);
}

.filter-select {
  padding: 0.45rem 0.75rem;
  font-size: 0.875rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  min-height: 2.25rem;
}

.filter-select:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.filter-select:focus,
.filter-select:focus-visible {
  outline: none;
  border-color: var(--accent);
}

.collections-content {
  flex: 1;
  padding: 1.5rem;
  overflow: auto;
}

/* Settings page */
.settings-page .settings-content {
  flex: 1;
  padding: 1.5rem 2rem;
  overflow: auto;
  max-width: 640px;
}

.settings-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.settings-section:last-child {
  margin-bottom: 0;
}

.settings-section-title {
  margin: 0;
  padding: 1rem 1.35rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.01em;
}

.settings-section-inner {
  padding: 1.35rem 1.5rem;
}

.settings-form label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
  font-weight: 500;
}

.settings-form .settings-input,
.settings-form select.settings-input,
.settings-section-inner .settings-input,
.settings-section-inner select.settings-input {
  width: 100%;
  max-width: 320px;
  padding: 0.6rem 0.85rem;
  margin-bottom: 0.25rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
  box-sizing: border-box;
  transition: border-color 0.2s ease;
  cursor: pointer;
}

.settings-form select.settings-input,
.settings-section-inner select.settings-input,
.settings-content select.settings-input {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  min-height: 2.5rem;
  padding-right: 2.5rem;
  background-color: var(--bg) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M3 4.5 L6 7.5 L9 4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  color: var(--text) !important;
}

.settings-form select.settings-input:hover,
.settings-section-inner select.settings-input:hover,
.settings-content select.settings-input:hover {
  border-color: rgba(255, 255, 255, 0.12);
}

.settings-form select.settings-input:focus,
.settings-form select.settings-input:focus-visible,
.settings-section-inner select.settings-input:focus,
.settings-section-inner select.settings-input:focus-visible,
.settings-content select.settings-input:focus,
.settings-content select.settings-input:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(196, 165, 116, 0.2);
}

.settings-form select.settings-input option,
.settings-section-inner select.settings-input option,
.settings-content select.settings-input option {
  background: var(--surface);
  color: var(--text);
}

.settings-form .settings-input:focus,
.settings-form .settings-input:focus-visible,
.settings-form select.settings-input:focus,
.settings-form select.settings-input:focus-visible {
  outline: none;
  border-color: var(--accent);
}

.settings-form .settings-input::placeholder {
  color: var(--muted);
  opacity: 0.8;
}

.settings-hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0 0 1rem 0;
}

.settings-form-actions {
  margin-top: 1.25rem;
  padding-top: 0.5rem;
}

.settings-message {
  font-size: 0.9rem;
  margin: 0 0 1rem 0;
  padding: 0.6rem 0.85rem;
  border-radius: 6px;
}

.settings-message--success {
  background: rgba(76, 175, 80, 0.12);
  color: #a5d6a7;
  border: 1px solid rgba(76, 175, 80, 0.25);
}

.settings-message--error {
  background: rgba(244, 67, 54, 0.1);
  color: #ef9a9a;
  border: 1px solid rgba(244, 67, 54, 0.2);
}

.users-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.users-table {
  width: 100%;
  border-collapse: collapse;
}

.users-table th,
.users-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.users-table th {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.users-table tbody tr:last-child td {
  border-bottom: none;
}

.users-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.users-loading,
.users-empty,
.users-error {
  color: var(--muted);
  text-align: center;
  padding: 2rem !important;
}

.users-error {
  color: var(--error);
}

.edit-user-name {
  margin: 0 0 1rem;
  font-weight: 600;
  color: var(--text);
}

.collections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.collections-grid.collections-list {
  grid-template-columns: 1fr;
}

.collections-list .collection-card {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 1rem;
  align-items: center;
}

.collections-list .collection-card-link {
  display: contents;
}

.collections-list .collection-card-thumb {
  width: 120px;
  height: 80px;
  border-radius: 6px;
  min-height: 80px;
}

.collections-list .collection-card-body {
  min-width: 0;
}

.collections-list .collection-card-actions {
  grid-column: 3;
}

.collection-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.25s cubic-bezier(0.22, 1, 0.36, 1), transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.2s ease;
}

.collection-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.08);
}

.collection-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.collection-card-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  background-size: cover;
  background-position: center;
  background-color: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.collection-card-placeholder {
  font-size: 2.5rem;
  opacity: 0.4;
}

.collection-card-badge {
  position: absolute;
  bottom: 0.5rem;
  left: 0.5rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.collection-card-badge--preparing {
  background: rgba(0, 0, 0, 0.7);
  color: #fbbf24;
}

.collection-card-badge--failed {
  background: rgba(0, 0, 0, 0.8);
  color: #f87171;
}

.collection-card-status-uploading {
  color: var(--muted);
  font-style: italic;
}

.collection-card-failure-reason {
  color: #f87171;
  font-size: 0.85em;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  vertical-align: bottom;
}

.share-failure-reason {
  color: #f87171;
  font-weight: 500;
  margin: 0.5rem 0 1rem;
}

.collection-card-body {
  padding: 1rem;
}

.collection-card-title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.collection-card-meta {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.collection-card-items {
  color: var(--primary);
  font-weight: 500;
}

.collection-card-size {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.collection-card-sep {
  opacity: 0.6;
}

.collection-card-check-wrap {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  z-index: 2;
  padding: 0.2rem;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 4px;
}

.collection-card-check {
  width: 1.15rem;
  height: 1.15rem;
  cursor: pointer;
  accent-color: var(--accent);
}

.bulk-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.edit-quick-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.collection-card-actions {
  padding: 0 1rem 1rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-card-download,
.btn-card-copy,
.btn-card-delete {
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  transition: border-color 0.15s, color 0.15s;
}

.btn-card-copy:hover,
.btn-card-delete:hover {
  border-color: var(--accent);
  color: var(--text);
}

.btn-card-delete:hover {
  border-color: var(--error);
  color: var(--error);
}

.no-collections {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0;
  padding: 2rem;
  text-align: center;
}

/* New Collection modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  --modal-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --modal-duration: 0.3s;
}

.modal[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity var(--modal-duration) var(--modal-ease);
}

.modal.modal--open .modal-backdrop {
  opacity: 1;
}

.modal-dialog {
  position: relative;
  width: 100%;
  max-width: 540px;
  max-height: 90vh;
  overflow: auto;
  background: #1e1e1e;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.03);
  opacity: 0;
  transform: scale(0.97) translateY(12px);
  transition: opacity var(--modal-duration) var(--modal-ease), transform var(--modal-duration) var(--modal-ease);
}

.modal.modal--open .modal-dialog {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.35rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.modal-header h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #f0f0f0;
  letter-spacing: -0.01em;
}

.modal-close {
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 8px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
}

.modal-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.modal-body {
  padding: 1.5rem 1.5rem 1.75rem;
}

.modal-body .upload-form {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.modal-body .upload-form label {
  margin-top: 1rem;
  margin-bottom: 0.4rem;
  color: #b0b0b0;
  font-size: 0.8125rem;
  font-weight: 500;
}

.modal-body .upload-form label:first-child {
  margin-top: 0;
}

.modal-body .upload-form input[type="text"],
.modal-body .upload-form input[type="date"],
.modal-body .upload-form input[type="datetime-local"],
.modal-body .upload-form input[type="password"],
.modal-body .upload-form input[type="number"] {
  max-width: none;
  padding: 0.65rem 0.85rem;
  background: #252525;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #f0f0f0;
  font-size: 0.9375rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.modal-body .upload-form input::placeholder {
  color: #6a6a6a;
}

.modal-body .upload-form input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

.modal-body .upload-form select,
.modal-body .edit-form select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  margin-top: 0.4rem;
  margin-bottom: 0;
  background: #252525;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #f0f0f0;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.modal-body .upload-form select:focus,
.modal-body .edit-form select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

/* Cover style grid (layout picker) */
.cover-style-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 0.6rem;
  margin-top: 0.5rem;
  margin-bottom: 0;
}

.cover-style-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem;
  background: #252525;
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #e0e0e0;
  font-size: 0.7rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.cover-style-option:hover {
  background: #2a2a2a;
  border-color: rgba(255, 255, 255, 0.15);
}

.cover-style-option.selected {
  border-color: var(--primary);
  background: rgba(34, 197, 94, 0.08);
  color: #fff;
}

.cover-style-preview {
  width: 56px;
  height: 40px;
  border-radius: 4px;
  background: linear-gradient(135deg, #3a3a3a 0%, #2a2a2a 100%);
  flex-shrink: 0;
}

.cover-style-preview--center {
  background: linear-gradient(180deg, rgba(0,0,0,0.2) 0%, #2a2a2a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.cover-style-preview--center::after {
  content: 'TITLE';
  font-size: 6px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.9);
}

.cover-style-preview--left {
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: 2px;
}
.cover-style-preview--left::after {
  content: 'TITLE';
  font-size: 5px;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
}

.cover-style-preview--frame {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #2a2a2a;
  box-shadow: inset 0 0 0 3px rgba(255,255,255,0.25);
}
.cover-style-preview--frame::after {
  content: 'TITLE';
  font-size: 5px;
  font-weight: 600;
  color: #fff;
}

.cover-style-preview--stripe {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  background: linear-gradient(90deg, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0.5) 35%, transparent 35%, transparent 100%);
}
.cover-style-preview--stripe::after {
  content: 'TITLE';
  font-size: 5px;
  font-weight: 600;
  color: #fff;
  margin-left: 4px;
}

.cover-style-preview--divider {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  background: linear-gradient(90deg, transparent 0%, transparent 38%, rgba(255,255,255,0.3) 38%, rgba(255,255,255,0.3) 40%, transparent 40%, transparent 100%);
}
.cover-style-preview--divider::after {
  content: 'TITLE';
  font-size: 5px;
  font-weight: 600;
  color: #fff;
  margin-left: 2px;
}

.cover-style-preview--vintage {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 4px;
  background: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 100%);
  border-bottom: 2px solid rgba(255,255,255,0.25);
}
.cover-style-preview--vintage::after {
  content: 'TITLE';
  font-size: 5px;
  font-weight: 600;
  color: rgba(255,255,255,0.95);
}

.cover-style-preview--novel {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  background: linear-gradient(90deg, #333 0%, #333 45%, #2a2a2a 45%, #2a2a2a 100%);
}
.cover-style-preview--novel::after {
  content: 'TITLE';
  font-size: 5px;
  font-weight: 600;
  color: #fff;
  margin-left: 4px;
}

.cover-style-label {
  line-height: 1.2;
  text-align: center;
}

.modal-body .upload-form .checkbox-label {
  margin-top: 0.75rem;
  margin-bottom: 0;
  color: #e0e0e0;
}

.modal-body .upload-form .upload-hint {
  margin-top: 0.35rem;
  margin-bottom: 0;
  color: #7a7a7a;
  font-size: 0.8125rem;
  line-height: 1.45;
}

.modal-body .dropzone {
  margin-top: 1.25rem;
  margin-bottom: 0;
  padding: 2.25rem 1.5rem;
  border: 2px dashed rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.2s, background 0.2s;
}

.modal-body .dropzone::before {
  content: '↑';
  display: block;
  font-size: 1.75rem;
  color: rgba(255, 255, 255, 0.2);
  margin-bottom: 0.5rem;
  font-weight: 300;
  transition: color 0.2s ease;
}

.modal-body .dropzone:hover,
.modal-body .dropzone.dragover {
  border-color: var(--primary);
  background: rgba(34, 197, 94, 0.06);
}

.modal-body .dropzone:hover::before,
.modal-body .dropzone.dragover::before {
  color: rgba(34, 197, 94, 0.5);
}

.modal-body .dropzone p {
  margin: 0;
  color: #8a8a8a;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.modal-body .dropzone:hover p,
.modal-body .dropzone.dragover p {
  color: #a0a0a0;
}

.modal-body #upload_btn {
  margin-top: 1.25rem;
  padding: 0.85rem 1.5rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.modal-body #upload_btn:hover:not(:disabled) {
  background: var(--primary-hover);
}

.modal-body #upload_btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.modal-body .file-list {
  margin-top: 0.75rem;
  color: #8a8a8a;
}

.modal-body .share-result {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: 8px;
}

.modal-body .upload-progress {
  margin-top: 1rem;
  background: #252525;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.upload-success-hint {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0.5rem 0 0;
}

/* Edit collection form – match New Collection modal polish */
.modal-body .edit-form {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.modal-body .edit-form label {
  margin-top: 1.1rem;
  margin-bottom: 0.4rem;
  color: #b0b0b0;
  font-size: 0.8125rem;
  font-weight: 500;
}

.modal-body .edit-form label:first-child {
  margin-top: 0;
}

.modal-body .edit-form input[type="text"],
.modal-body .edit-form input[type="date"],
.modal-body .edit-form input[type="datetime-local"],
.modal-body .edit-form input[type="password"],
.modal-body .edit-form input[type="number"] {
  width: 100%;
  padding: 0.65rem 0.85rem;
  margin-bottom: 0;
  background: #252525;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #f0f0f0;
  font-size: 0.9375rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.modal-body .edit-form input::placeholder {
  color: #6a6a6a;
}

.modal-body .edit-form input[type="password"] {
  padding-right: 2.5rem;
}

.modal-body .edit-form input[type="number"] {
  -moz-appearance: textfield;
}

.modal-body .edit-form input[type="number"]::-webkit-outer-spin-button,
.modal-body .edit-form input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.modal-body .edit-form input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

.modal-body .edit-form .checkbox-label {
  margin-top: 0.9rem;
  margin-bottom: 0;
  color: #e0e0e0;
}

.modal-body .edit-form .upload-hint {
  margin-top: 0.35rem;
  margin-bottom: 0;
  color: #7a7a7a;
  font-size: 0.8125rem;
  line-height: 1.45;
}

.edit-form label {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.edit-form input[type="text"],
.edit-form input[type="date"],
.edit-form input[type="datetime-local"] {
  width: 100%;
  padding: 0.5rem 0.75rem;
  margin-bottom: 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.95rem;
}

.edit-form .upload-hint {
  margin-bottom: 1rem;
}

.edit-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.35rem;
  padding-top: 0.25rem;
}

.btn-primary {
  padding: 0.6rem 1.35rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-primary:active:not(:disabled) {
  transform: scale(0.98);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  padding: 0.6rem 1.35rem;
  background: rgba(255, 255, 255, 0.06);
  color: #e0e0e0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}

.btn-secondary:hover {
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.btn-secondary:active {
  transform: scale(0.98);
}

a.btn-secondary {
  display: inline-block;
  text-decoration: none;
  box-sizing: border-box;
}

.btn-card-edit {
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  transition: border-color 0.15s, color 0.15s;
}

.btn-card-edit:hover {
  border-color: var(--accent);
  color: var(--text);
}

.btn-card-download {
  display: inline-block;
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
  border-radius: 6px;
  text-decoration: none;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  transition: border-color 0.15s, color 0.15s;
  box-sizing: border-box;
}

.btn-card-download:hover {
  border-color: var(--accent);
  color: var(--text);
}

/* Cover picker in edit modal */
.modal-body .edit-cover-section {
  margin-top: 1.35rem;
  margin-bottom: 0;
  padding-top: 1.1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.modal-body .edit-cover-section label {
  margin-top: 0;
}

.cover-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 0.6rem;
  margin-top: 0.6rem;
  max-height: 200px;
  overflow-y: auto;
  padding: 0.15rem 0;
}

.cover-picker-thumb {
  aspect-ratio: 1;
  border: 2px solid transparent;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  background-color: #2a2a2a;
  cursor: pointer;
  padding: 0;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.cover-picker-thumb:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.35);
  transform: scale(1.02);
}

.cover-picker-thumb.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary);
}

/* Public share page */
.share-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
}

/* Full-page gallery layout */
.share-page--gallery {
  justify-content: flex-start;
  padding: 0;
  min-height: 100vh;
}

/* Share cover (hero with title + View Gallery) */
.share-cover {
  position: relative;
  width: 100%;
  min-height: 85vh;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  background-color: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
}

.share-cover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0.5) 100%);
  pointer-events: none;
}

/* Cover style: center (default) — title centered, medium overlay */
.share-cover--center { }

/* Cover style: left — content bottom-left */
.share-cover--left {
  align-items: flex-start;
  justify-content: flex-end;
  padding: 3rem 1.5rem 4rem 2.5rem;
}

.share-cover--left .share-cover-content {
  text-align: left;
  align-items: flex-start;
}

.share-cover--left .share-cover-brand {
  position: absolute;
  left: 2.5rem;
  bottom: 1.5rem;
  transform: none;
  margin-left: 0;
}

/* Cover style: frame — title in a light box */
.share-cover--frame .share-cover-content {
  background: rgba(255, 255, 255, 0.92);
  color: #1a1a1a;
  padding: 2rem 2.5rem;
  border-radius: 4px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.share-cover--frame .share-cover-title,
.share-cover--frame .share-cover-date,
.share-cover--frame .share-cover-summary,
.share-cover--frame .share-cover-expires {
  color: inherit;
  text-shadow: none;
}

.share-cover--frame .btn-view-gallery {
  border-color: #1a1a1a;
  color: #1a1a1a;
}

.share-cover--frame .btn-view-gallery:hover {
  background: #1a1a1a;
  color: #fff;
  border-color: #1a1a1a;
}

/* Cover style: stripe — vertical stripe on left, content inside */
.share-cover--stripe {
  align-items: flex-start;
  justify-content: center;
  padding: 3rem 1.5rem 3rem 2rem;
}

.share-cover--stripe .share-cover-overlay {
  background: linear-gradient(90deg, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.6)  min(42%, 320px), transparent min(42%, 320px));
}

.share-cover--stripe .share-cover-content {
  text-align: left;
  max-width: min(42%, 320px);
  margin-right: auto;
  margin-left: 0;
}

.share-cover--stripe .share-cover-brand {
  position: absolute;
  left: 2rem;
  bottom: 1.5rem;
  margin-left: 0;
}

/* Cover style: divider — content left, vertical line beside */
.share-cover--divider {
  align-items: flex-start;
  justify-content: center;
  padding: 3rem 2.5rem;
}

.share-cover--divider .share-cover-content {
  text-align: left;
  padding-left: 0;
  border-left: 4px solid rgba(255, 255, 255, 0.6);
  padding-left: 1.5rem;
  margin-left: 0;
  max-width: min(45%, 340px);
}

.share-cover--divider .share-cover-brand {
  position: absolute;
  left: 2.5rem;
  bottom: 1.5rem;
  transform: none;
  margin-left: 0;
}

/* Cover style: vintage — title toward bottom with line above */
.share-cover--vintage {
  justify-content: flex-end;
  padding-bottom: 3.5rem;
}

.share-cover--vintage .share-cover-content {
  border-top: 2px solid rgba(255, 255, 255, 0.4);
  padding-top: 1.25rem;
  margin-top: 0.5rem;
}

/* Cover style: novel — split: content on left, image emphasis right */
.share-cover--novel {
  flex-direction: row;
  align-items: stretch;
  justify-content: flex-start;
  padding: 0;
}

.share-cover--novel .share-cover-overlay {
  background: linear-gradient(90deg, rgba(0,0,0,0.5) 0%, transparent 45%, transparent 100%);
}

.share-cover--novel .share-cover-content {
  width: min(48%, 380px);
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  text-align: left;
  padding: 3rem 2.5rem;
  margin: 0;
  background: rgba(28, 28, 28, 0.75);
  backdrop-filter: blur(8px);
}

.share-cover--novel .share-cover-brand {
  position: absolute;
  left: 2.5rem;
  bottom: 1.5rem;
  margin-left: 0;
}

.share-cover-download {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 2;
  padding: 0.5rem 1rem;
  border: 1px solid rgba(255,255,255,0.7);
  color: #fff;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  border-radius: 6px;
  background: rgba(0,0,0,0.2);
  backdrop-filter: blur(6px);
  transition: background 0.2s, border-color 0.2s;
}

.share-cover-download:hover {
  background: rgba(255,255,255,0.95);
  color: var(--bg);
  border-color: #fff;
}

.share-cover-content {
  position: relative;
  z-index: 1;
  text-align: center;
  color: #fff;
  opacity: 0;
  transform: translateY(28px);
  animation: shareCoverFadeIn 1.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes shareCoverFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.share-cover-title {
  margin: 0 0 0.5rem;
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-shadow: 0 2px 12px rgba(0,0,0,0.4);
}

.share-cover-date {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  opacity: 0.95;
  text-transform: uppercase;
  text-shadow: 0 1px 8px rgba(0,0,0,0.3);
}

.share-cover-summary,
.share-cover-expires {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.85);
  text-shadow: 0 1px 6px rgba(0,0,0,0.3);
}

.share-cover-summary {
  margin-bottom: 0.25rem;
}

.share-cover-expires {
  margin-bottom: 1.25rem;
  font-size: 0.8rem;
  opacity: 0.9;
}

.btn-view-gallery {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  border: 2px solid #fff;
  color: #fff;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
}

.btn-view-gallery:hover {
  background: #fff;
  color: var(--bg);
}

.share-cover-brand {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.85);
  letter-spacing: 0.1em;
  z-index: 1;
}

.share-gallery-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.share-gallery-brand {
  min-width: 0;
}

.share-gallery-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
}

.share-gallery-summary,
.share-gallery-expires {
  margin: 0.2rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.share-gallery-full {
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow: auto;
  padding: 1.5rem;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.share-gallery-full .gallery-section {
  width: 100%;
  max-width: none;
  margin: 0;
  min-height: min-content;
}

.share-gallery-full .gallery-grid {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 0;
}

.share-page .share-card {
  width: 100%;
  max-width: 420px;
  text-align: center;
  padding: 2.5rem;
}

.share-page .share-card h2 {
  margin: 0 0 0.75rem;
  font-size: 1.35rem;
  font-weight: 600;
}

.share-page .share-card p {
  margin: 0 0 1.5rem;
  color: var(--muted);
}

.share-summary {
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.expires-info {
  font-size: 0.9rem;
}

.btn-download {
  display: inline-block;
  padding: 0.9rem 2rem;
  background: var(--accent);
  color: var(--bg);
  text-decoration: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 1.1rem;
}

.btn-download:hover {
  background: var(--accent-hover);
}

/* Gallery (share page) */
.gallery-section {
  width: 100%;
  margin-bottom: 1.5rem;
}

.share-gallery-full .gallery-loading {
  text-align: center;
  padding: 3rem;
  font-size: 1rem;
  color: var(--muted);
  margin: 0;
}

.gallery-loading {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 1rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.gallery-thumb {
  aspect-ratio: 1;
  border: none;
  border-radius: var(--radius);
  background-size: cover;
  background-position: center;
  background-color: var(--surface);
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s, box-shadow 0.15s, background-image 0.2s ease;
}

.gallery-thumb:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  will-change: transform;
}

.gallery-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  opacity: 1;
  transition: opacity 0.22s ease-out;
}

.gallery-lightbox.lightbox--closed {
  opacity: 0;
  pointer-events: none;
}

.gallery-lightbox.lightbox--closed img,
.gallery-lightbox.lightbox--closed .lightbox-video {
  opacity: 0;
  transform: scale(0.96);
}

.gallery-lightbox img,
.gallery-lightbox .lightbox-video {
  transition: opacity 0.22s ease-out, transform 0.22s ease-out;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 3rem;
  height: 3rem;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
  border-radius: 50%;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.lightbox-prev {
  left: 1rem;
}

.lightbox-next {
  right: 1rem;
}

.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255, 255, 255, 0.2);
}

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

.gallery-lightbox .lightbox-video {
  max-width: 90vw;
  max-height: 80vh;
  border-radius: 4px;
  background: #000;
}

.gallery-lightbox .lightbox-close,
.gallery-lightbox .lightbox-prev,
.gallery-lightbox .lightbox-next,
.gallery-lightbox .lightbox-caption,
.gallery-lightbox .lightbox-actions {
  transition: opacity 0.22s ease-out;
}

.gallery-lightbox.lightbox--closed .lightbox-close,
.gallery-lightbox.lightbox--closed .lightbox-prev,
.gallery-lightbox.lightbox--closed .lightbox-next,
.gallery-lightbox.lightbox--closed .lightbox-caption,
.gallery-lightbox.lightbox--closed .lightbox-actions {
  opacity: 0;
}

.gallery-thumb-wrap {
  position: relative;
  aspect-ratio: 1;
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.28s ease-out, transform 0.28s ease-out;
  contain: layout style paint;
}

.gallery-thumb-wrap--new {
  opacity: 0;
  transform: scale(0.97);
}

.gallery-thumb-wrap .gallery-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.gallery-thumb-menu {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  width: 1.75rem;
  height: 1.75rem;
  border: none;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.5);
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.gallery-thumb-menu:hover {
  background: rgba(0, 0, 0, 0.75);
}

.gallery-context-menu {
  position: fixed;
  z-index: 10000;
  min-width: 10rem;
  padding: 0.35rem 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.gallery-context-item {
  display: block;
  width: 100%;
  padding: 0.5rem 1rem;
  border: none;
  background: none;
  color: var(--text);
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
}

.gallery-context-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.gallery-context-item[data-action="delete"]:hover {
  color: var(--error);
}

.lightbox-actions {
  position: absolute;
  bottom: 1.5rem;
  right: 2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.lightbox-menu-btn {
  width: 2rem;
  height: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-menu-btn:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.6);
}

.gallery-thumb--video {
  background: #1a1a1a;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.gallery-thumb-play {
  font-size: 2rem;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1;
}

.gallery-thumb-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.6);
}

.lightbox-caption {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.95rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.lightbox-download {
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: none;
  padding: 0.35rem 0.6rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
}
.lightbox-download:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.6);
}

/* Responsive and polish */
@media (max-width: 768px) {
  .dashboard-topbar {
    padding: 1rem;
    gap: 0.75rem;
  }
  .topbar-title {
    font-size: 1.25rem;
  }
  .collections-toolbar {
    padding: 0.6rem 1rem;
    gap: 0.5rem;
  }
  .collections-toolbar .bulk-actions {
    margin-left: 0;
    padding-left: 0;
    border-left: none;
    width: 100%;
    margin-top: 0.25rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border);
  }
  .settings-page .settings-content {
    padding: 1rem;
  }
  .settings-section-inner {
    padding: 1rem 1.25rem;
  }
  .logs-filter-wrap {
    gap: 0.4rem;
  }
  .logs-filter-input {
    min-width: 120px;
  }
}

/* Disabled state for buttons in toolbar */
.bulk-actions .btn-secondary:disabled,
.edit-quick-actions .btn-secondary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
