:root {
  --color-brand-50: #f0f9ff;
  --color-brand-100: #e0f2fe;
  --color-brand-200: #bae6fd;
  --color-brand-300: #7dd3fc;
  --color-brand-400: #38bdf8;
  --color-brand-500: #0ea5e9;
  --color-brand-600: #0284c7;
  --color-brand-700: #0369a1;
  --color-brand-800: #075985;
  --color-brand-900: #0c4a6e;
  --surface-bg: #f9fafb;
  --surface-card: #ffffff;
  --surface-border: #e5e7eb;
  --surface-muted: #f3f4f6;
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;
  --header-bg: #ffffff;
  --site-header-h: 4rem;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
img, video, iframe {
  max-width: 100%;
}
img, video {
  height: auto;
}
body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--surface-bg);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
a { color: var(--color-brand-600); text-decoration: none; }
a:hover { text-decoration: underline; }
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1rem;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.site-header {
  background: var(--header-bg);
  border-bottom: 1px solid var(--surface-border);
  position: sticky; top: 0; z-index: 50;
}
.site-header .inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 4rem; gap: 1rem;
  position: relative;
}
.logo { font-size: 1.25rem; font-weight: 700; color: var(--color-brand-600); }
.site-nav-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex: 1;
  min-width: 0;
}
.nav { display: flex; gap: 1.5rem; align-items: center; }
.nav a { color: var(--text-secondary); font-size: 0.875rem; }
.nav a:hover { color: var(--color-brand-600); text-decoration: none; }
.site-nav-links { flex-wrap: wrap; }
.site-nav-actions { margin-left: auto; flex-shrink: 0; }
.site-nav-email {
  font-size: 0.875rem;
  color: var(--text-muted);
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-left: auto;
  padding: 0;
  border: 1px solid var(--surface-border);
  border-radius: 0.65rem;
  background: var(--surface-card);
  color: var(--text-primary);
  cursor: pointer;
  flex-shrink: 0;
}
.nav-toggle:hover {
  border-color: var(--color-brand-400);
  color: var(--color-brand-700);
}
.nav-toggle-bars {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 1.1rem;
}
.nav-toggle-bars span {
  display: block;
  height: 2px;
  width: 100%;
  border-radius: 999px;
  background: currentColor;
}
.nav-toggle-close { display: none; }
.site-header.nav-open .nav-toggle-bars { display: none; }
.site-header.nav-open .nav-toggle-close { display: flex; }
.site-footer {
  background: var(--surface-card);
  border-top: 1px solid var(--surface-border);
  margin-top: auto;
  padding: 2rem 0;
}
.site-footer .inner {
  display: flex; flex-wrap: wrap; justify-content: space-between;
  gap: 1rem; align-items: center;
}
.card {
  background: var(--surface-card);
  border: 1px solid var(--surface-border);
  border-radius: 0.75rem;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.5rem 1rem; border-radius: 0.5rem; font-size: 0.875rem;
  font-weight: 500; border: none; cursor: pointer; text-decoration: none;
}
.btn-primary { background: var(--color-brand-600); color: #fff; }
.btn-primary:hover { background: var(--color-brand-700); text-decoration: none; }
.btn-secondary { background: var(--surface-muted); color: var(--text-primary); border: 1px solid var(--surface-border); }
.btn-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-sm { padding: 0.25rem 0.75rem; font-size: 0.8125rem; }
.input, .textarea, .select {
  width: 100%; padding: 0.5rem 0.75rem; border: 1px solid var(--surface-border);
  border-radius: 0.5rem; font-size: 0.875rem; background: var(--surface-card);
  color: var(--text-primary);
}
.input:focus, .textarea:focus, .select:focus {
  outline: none; border-color: var(--color-brand-500);
  box-shadow: 0 0 0 1px var(--color-brand-500);
}
.label { display: block; font-size: 0.875rem; font-weight: 500; margin-bottom: 0.25rem; color: var(--text-secondary); }
.grid { display: grid; gap: 1rem; }
.grid-images { grid-template-columns: repeat(auto-fill, minmax(min(160px, 100%), 1fr)); }
.image-card { overflow: hidden; transition: box-shadow .2s; }
.image-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.08); }
.image-card img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.image-card .meta { padding: 0.75rem; }
.flash { padding: 0.75rem 1rem; border-radius: 0.5rem; margin-bottom: 1rem; font-size: 0.875rem; }
.flash-success { background: #dcfce7; color: #166534; }
.flash-error { background: #fee2e2; color: #991b1b; }
/* Admin stays light regardless of public site theme (e.g. Midnight/Slate). */
.admin-body {
  --color-brand-50: #f0f9ff;
  --color-brand-100: #e0f2fe;
  --color-brand-200: #bae6fd;
  --surface-bg: #f3f4f6;
  --surface-card: #ffffff;
  --surface-border: #e5e7eb;
  --surface-muted: #f3f4f6;
  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;
  --header-bg: #ffffff;
  background:
    radial-gradient(ellipse 80% 50% at 0% 0%, rgba(14, 165, 233, 0.08), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(2, 132, 199, 0.06), transparent 50%),
    var(--surface-bg);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}
.admin-body .input,
.admin-body input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
.admin-body select,
.admin-body textarea {
  background: var(--surface-card);
  color: var(--text-primary);
  border-color: var(--surface-border);
}
.admin-body .input::placeholder,
.admin-body input::placeholder,
.admin-body textarea::placeholder {
  color: var(--text-muted);
  opacity: 1;
}
.admin-body .label,
.admin-body label {
  color: var(--text-secondary);
}
.admin-body h1,
.admin-body h2,
.admin-body h3 {
  color: var(--text-primary);
}
.admin-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  gap: 0;
}
.admin-shell {
  flex: 1;
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
}
.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.75rem;
  margin: 1rem 1.25rem 0;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(229, 231, 235, 0.9);
  border-radius: 1.25rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  backdrop-filter: blur(8px);
}
.admin-topbar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}
.admin-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 1px solid var(--surface-border);
  border-radius: 0.75rem;
  background: #fff;
  color: var(--text-primary);
  cursor: pointer;
  flex-shrink: 0;
}
.admin-sidebar-backdrop[hidden] { display: none !important; }
.admin-topbar-copy { display: grid; gap: 0.1rem; min-width: 0; }
.admin-topbar-kicker {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.admin-topbar-copy strong { font-size: 1rem; color: var(--text-primary); }
.admin-topbar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: inherit;
  text-decoration: none;
  border-radius: 999px;
  padding: 0.2rem 0.45rem 0.2rem 0.2rem;
  transition: background 0.15s ease;
}
.admin-topbar-user:hover {
  background: var(--color-brand-50);
  text-decoration: none;
  color: inherit;
}
.admin-topbar-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.875rem;
  color: #fff;
  background: linear-gradient(145deg, var(--color-brand-500), var(--color-brand-700));
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
  flex-shrink: 0;
}
.admin-topbar-avatar-img {
  object-fit: cover;
  background: #e2e8f0;
  display: block;
}
.admin-topbar-name { font-size: 0.875rem; font-weight: 600; color: var(--text-primary); line-height: 1.2; }
.admin-topbar-role { font-size: 0.75rem; color: var(--text-muted); }
.admin-sidebar {
  width: 260px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  margin: 1rem 0 1rem 1rem;
  padding: 1rem 0.75rem;
  background: #fff;
  border: 1px solid rgba(229, 231, 235, 0.95);
  border-radius: 1.5rem;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.05);
  color: var(--text-secondary);
  max-height: calc(100vh - 2rem);
  position: sticky;
  top: 1rem;
  overflow: hidden;
}
.admin-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.65rem 1rem;
}
.admin-brand-mark {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  color: #fff;
  background: linear-gradient(145deg, var(--color-brand-500), var(--color-brand-800));
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.28);
  flex-shrink: 0;
}
.admin-brand-name { font-weight: 700; font-size: 1rem; color: var(--text-primary); line-height: 1.2; }
.admin-brand-sub { font-size: 0.75rem; color: var(--text-muted); }
.admin-nav {
  flex: 1;
  overflow-y: auto;
  padding: 0 0.25rem 0.5rem;
  scrollbar-width: thin;
}
.admin-sidebar a {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.15rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
  border-radius: 0.85rem;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.admin-sidebar a:hover {
  background: var(--color-brand-50);
  color: var(--color-brand-700);
  text-decoration: none;
}
.admin-sidebar a.active {
  background: linear-gradient(135deg, var(--color-brand-600), var(--color-brand-700));
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  box-shadow: 0 8px 18px rgba(2, 132, 199, 0.28);
}
.admin-nav-icon { flex-shrink: 0; color: #94a3b8; }
.admin-sidebar a:hover .admin-nav-icon { color: var(--color-brand-600); }
.admin-sidebar a.active .admin-nav-icon { color: #fff; }
.admin-nav-label { flex: 1; }
.admin-sidebar-footer {
  padding: 0.75rem 0.25rem 0.25rem;
  margin-top: auto;
  border-top: 1px solid var(--surface-border);
}
.admin-sidebar-footer a { margin-top: 0.2rem; }
.admin-main {
  flex: 1;
  width: 100%;
  max-width: 100%;
  padding: 1.25rem 1.75rem 2rem;
  background: transparent;
  min-width: 0;
  box-sizing: border-box;
}
.admin-main > .card,
.admin-main > form.card {
  width: 100%;
  box-sizing: border-box;
}

/* Animated toggle switch (enable/disable) */
.toggle-field { display: inline-flex; align-items: center; gap: 0.6rem; cursor: pointer; }
.switch { position: relative; display: inline-flex; align-items: center; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-slider {
  position: relative; display: inline-block; width: 42px; height: 24px;
  background: #cbd5e1; border-radius: 999px; transition: background 0.2s ease; flex-shrink: 0;
}
.switch-slider::before {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
  background: #fff; border-radius: 50%; transition: transform 0.2s ease; box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.switch input:checked + .switch-slider { background: var(--color-brand-600); }
.switch input:checked + .switch-slider::before { transform: translateX(18px); }
.switch input:focus-visible + .switch-slider { box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.28); }
.switch input:disabled + .switch-slider { opacity: 0.5; cursor: not-allowed; }

/* Contact form (public) */
.contact-field { margin-bottom: 1rem; }
.contact-field .req { color: #dc2626; }
.contact-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Contact submissions (admin) */
.contact-sub-list { display: grid; gap: 1rem; margin-top: 1rem; }
.contact-sub { padding: 1rem 1.25rem; }
.contact-sub.unread { border-left: 3px solid var(--color-brand-600); }
.contact-sub-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.contact-sub-message {
  margin: 0.75rem 0; padding: 0.75rem 1rem; background: var(--surface-muted);
  border-radius: 0.5rem; font-size: 0.9rem; color: var(--text-secondary); white-space: pre-wrap;
}
.contact-sub-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.contact-fields-table { width: 100%; border-collapse: collapse; }
.contact-fields-table th, .contact-fields-table td {
  padding: 0.6rem 0.5rem; border-bottom: 1px solid var(--surface-border); font-size: 0.9rem; text-align: left;
}
.contact-fields-table th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }

.db-cleaner-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}
.db-cleaner-stats div {
  padding: 0.75rem;
  border: 1px solid var(--surface-border, #e2e8f0);
  border-radius: 0.5rem;
  background: var(--surface-muted, #f8fafc);
}
.db-cleaner-stats span {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}
.db-cleaner-stats strong { font-size: 1.125rem; }
.db-cleaner-options { display: grid; gap: 0.65rem; }
.db-cleaner-option {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  cursor: pointer;
  font-size: 0.9375rem;
}
.db-cleaner-option input { margin-top: 0.2rem; }

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.4;
}
.badge-success { background: #dcfce7; color: #166534; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-muted { background: #f1f5f9; color: #64748b; }

/* Profile avatar */
.profile-avatar {
  width: 96px; height: 96px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--surface-border); background: #e2e8f0; flex-shrink: 0;
}

/* Blog byline (author) */
.blog-byline {
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
  font-size: 0.875rem; color: var(--text-muted);
}
.blog-byline-avatar {
  width: 28px; height: 28px; border-radius: 50%; object-fit: cover;
  background: #e2e8f0; flex-shrink: 0;
}
.blog-byline-author { font-weight: 500; color: var(--text-secondary); }
.blog-byline-sep { opacity: 0.6; }
.blog-byline-date { color: var(--text-muted); }

/* Ad networks */
.ad-net-none {
  display: flex; align-items: center; gap: 0.6rem; padding: 0.85rem 1rem; margin-bottom: 1rem;
  background: var(--surface-card); border: 1px solid var(--surface-border); border-radius: 0.6rem; cursor: pointer;
}
.ad-net { padding: 0; margin-bottom: 0.75rem; overflow: hidden; }
.ad-net-summary {
  display: flex; align-items: center; gap: 0.6rem; padding: 0.9rem 1rem; cursor: pointer;
  list-style: none; font-weight: 600; user-select: none;
}
.ad-net-summary::-webkit-details-marker { display: none; }
.ad-net-summary::before {
  content: ""; width: 0; height: 0; flex-shrink: 0;
  border-left: 5px solid var(--text-muted); border-top: 4px solid transparent; border-bottom: 4px solid transparent;
  transition: transform 0.15s ease;
}
.ad-net[open] .ad-net-summary::before { transform: rotate(90deg); }
.ad-net-name { flex-shrink: 0; }
.ad-net-status {
  margin-left: auto; font-size: 0.7rem; font-weight: 700; color: #166534;
  background: #dcfce7; padding: 0.15rem 0.55rem; border-radius: 999px;
}
.badge-recommended {
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase;
  color: #fff; background: linear-gradient(90deg, #2563eb, #4f46e5);
  padding: 0.15rem 0.5rem; border-radius: 999px;
}
.ad-net-body { padding: 0 1rem 1.25rem; border-top: 1px solid var(--surface-border); }
.ad-net-enable {
  display: flex; align-items: center; gap: 0.5rem; margin-top: 1rem;
  font-weight: 500; cursor: pointer;
}
.admin-sidebar-section {
  padding: 1rem 0.85rem 0.4rem;
  margin-top: 0.35rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #94a3b8;
}
.sidebar-badge {
  display: inline-block;
  margin-left: 0.35rem;
  min-width: 1.15rem;
  padding: 0 0.4rem;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.15rem;
  text-align: center;
  color: #fff;
  background: #e11d48;
  border-radius: 999px;
}
.admin-sidebar a.active .sidebar-badge {
  background: rgba(255, 255, 255, 0.25);
}

/* Image page: meta + share popover */
.image-author {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin: 0 0 1rem;
}
.image-author-avatar {
  width: 48px;
  height: 48px;
  border-radius: 0.65rem;
  object-fit: cover;
  background: #e5e7eb;
  flex-shrink: 0;
}
.image-author-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.image-author-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary, #1f2937);
  line-height: 1.25;
}
.image-author-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.8125rem;
  color: var(--text-muted, #6b7280);
}
.image-author-stat {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.image-author-stat svg {
  flex-shrink: 0;
  opacity: 0.9;
}
.image-description {
  margin: 0 0 0.75rem;
  color: var(--text-secondary);
}
.image-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0 0 0.25rem;
}
.image-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: var(--surface-muted);
  border-bottom: 1px solid var(--surface-border);
}
.image-stage img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: min(72vh, 40rem);
  object-fit: contain;
  display: block;
  border-radius: 0.5rem;
}
@media (max-width: 640px) {
  .image-stage { padding: 0.5rem; }
  .image-stage img { max-height: 70vh; }
}
.video-player {
  position: relative;
  background: #0b1220;
  min-height: min(52vw, 22rem);
}
.video-player-el {
  width: 100%;
  height: auto;
  max-height: 80vh;
  display: block;
  background: #000;
  vertical-align: middle;
}
.video-player-status {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  padding: 1.5rem;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.45) 0%, rgba(15, 23, 42, 0.72) 100%);
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.video-player.is-loading .video-player-status,
.video-player.is-buffering .video-player-status,
.video-player.is-error .video-player-status {
  opacity: 1;
}
.video-player-spinner {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.22);
  border-top-color: #fff;
  animation: video-player-spin 0.75s linear infinite;
}
.video-player.is-error .video-player-spinner { display: none; }
@keyframes video-player-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .video-player-spinner { animation: none; border-top-color: rgba(255,255,255,0.5); }
}
.image-actions-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  margin: 1.25rem 0 0;
}
.image-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.25rem;
  padding: 0.45rem 0.9rem;
  border-radius: 0.65rem;
  border: 1px solid var(--color-brand-600, #0284c7);
  background: var(--color-brand-600, #0284c7);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  box-shadow: none;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
@media (max-width: 640px) {
  .image-actions-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
    gap: 0.45rem;
  }
  .image-actions-row > .share-popover-wrap,
  .image-actions-row > .image-action-btn {
    width: 100%;
    min-width: 0;
  }
  .image-actions-row > .share-popover-wrap {
    display: flex;
    position: relative;
  }
  .image-actions-row > .share-popover-wrap > .image-action-btn,
  .image-actions-row > .share-popover-wrap > .share-toggle {
    width: 100%;
  }
  .image-action-btn {
    min-height: 2.1rem;
    padding: 0.4rem 0.55rem;
    font-size: 0.75rem;
    gap: 0.3rem;
    border-radius: 0.55rem;
  }
  .image-action-btn svg {
    width: 14px;
    height: 14px;
  }
  .engagement-toolbar,
  .engagement-comments {
    max-width: none;
  }
}
@media (max-width: 380px) {
  .image-actions-row {
    gap: 0.35rem;
  }
  .image-action-btn {
    padding: 0.4rem 0.4rem;
    font-size: 0.6875rem;
  }
}
.image-action-btn:hover {
  text-decoration: none;
  background: var(--color-brand-700, #0369a1);
  border-color: var(--color-brand-700, #0369a1);
  color: #fff;
}
.image-action-btn:active {
  background: var(--color-brand-800, #075985);
  border-color: var(--color-brand-800, #075985);
}
.image-action-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}
.image-action-btn svg {
  flex-shrink: 0;
}
.image-action-btn--download {
  background: #e11d48;
  border-color: #e11d48;
  color: #fff;
}
.image-action-btn--download:hover {
  background: #be123c;
  border-color: #be123c;
  color: #fff;
}
.image-action-btn--download:active {
  background: #9f1239;
  border-color: #9f1239;
}
.image-action-btn--primary,
.image-action-btn--muted {
  /* Legacy aliases — theme brand style */
  background: var(--color-brand-600, #0284c7);
  border-color: var(--color-brand-600, #0284c7);
  color: #fff;
}
.image-action-btn--primary:hover,
.image-action-btn--muted:hover {
  background: var(--color-brand-700, #0369a1);
  border-color: var(--color-brand-700, #0369a1);
  color: #fff;
}
.ai-check-result {
  margin-top: 0.85rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--surface-border, #e2e8f0);
  border-radius: 0.85rem;
  background: var(--surface-muted, #f8fafc);
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--text-secondary, #475569);
}
.ai-check-result[hidden] {
  display: none !important;
}
.ai-check-title {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--text-primary, #0f172a);
}
.ai-check-body {
  white-space: normal;
  line-height: 1.5;
}
.ai-check-body p {
  margin: 0 0 0.45em;
}
.ai-check-body p:last-child {
  margin-bottom: 0;
}
.ai-check-meta {
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.ai-check-pending { color: var(--text-muted); }
.ai-check-error { color: #b91c1c; }
.share-popover-wrap {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-width: 100%;
}
.share-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}
.share-popover {
  flex: 1 1 auto;
  min-width: 0;
}
.share-popover[hidden] {
  display: none !important;
}
.share-popover:not([hidden]) {
  display: flex;
  align-items: center;
  animation: share-expand 0.22s ease;
}
@keyframes share-expand {
  from { opacity: 0; transform: translateX(-0.35rem); }
  to { opacity: 1; transform: translateX(0); }
}
.share-popover-track {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem;
  border-radius: 999px;
  background: var(--surface-card, #fff);
  border: 1px solid var(--surface-border, #e2e8f0);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  max-width: 100%;
}
.share-popover-track::-webkit-scrollbar { display: none; }
.share-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  border: none;
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
}
.share-icon svg {
  width: 1.05rem;
  height: 1.05rem;
  display: block;
}
.share-icon:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.18);
  text-decoration: none;
  opacity: 1;
}
.share-icon:active { transform: translateY(0); }
.share-facebook { background: linear-gradient(145deg, #2d88ff, #1877f2); }
.share-x { background: linear-gradient(145deg, #222, #000); }
.share-whatsapp { background: linear-gradient(145deg, #34d369, #25d366); }
.share-linkedin { background: linear-gradient(145deg, #1a7fdc, #0a66c2); }
.share-reddit { background: linear-gradient(145deg, #ff5722, #ff4500); }
.share-email { background: linear-gradient(145deg, #7b8798, #64748b); }
.share-copy {
  background: var(--surface-muted, #f1f5f9);
  color: var(--text-secondary);
  border: 1px solid var(--surface-border, #e2e8f0);
  box-shadow: none;
}
.share-copy:hover {
  background: #fff;
  color: var(--text-primary);
}
.share-copy.is-copied {
  background: #ecfdf5;
  color: #059669;
  border-color: #a7f3d0;
}

@media (max-width: 520px) {
  .share-popover-wrap.open {
    width: 100%;
  }
  .share-popover:not([hidden]) {
    width: 100%;
  }
  .share-popover-track {
    width: 100%;
    justify-content: flex-start;
  }
}

.image-actions { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--surface-border); }

/* Error pages */
.error-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 50vh;
  padding: 2rem 0;
}
.error-page-card {
  width: 100%;
  max-width: 32rem;
  padding: 2rem 1.75rem;
  text-align: center;
}
.error-code {
  margin: 0 0 0.5rem;
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--color-brand-600, #4f46e5);
}
.error-title {
  margin: 0 0 0.75rem;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
}
.error-message {
  margin: 0 0 1.5rem;
  color: var(--text-secondary);
  line-height: 1.6;
}
.error-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

/* Report modal */
.report-modal { position: fixed; inset: 0; z-index: 100; display: none; }
.report-modal.open { display: block; }
.report-modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.55); }
.report-modal-dialog {
  position: relative; max-width: 480px; margin: 6vh auto 0; background: var(--surface-card);
  border-radius: 0.75rem; padding: 1.5rem; box-shadow: 0 20px 50px rgba(0,0,0,.25);
  width: calc(100% - 2rem);
}
.report-modal-head { display: flex; align-items: center; justify-content: space-between; }
.report-modal-x { background: none; border: none; font-size: 1.5rem; line-height: 1; cursor: pointer; color: var(--text-muted); }
.report-modal-x:hover { color: var(--text-primary); }

/* Engagement: likes, dislikes, comments */
.engagement-block {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--surface-border, #e2e8f0);
}
.engagement-toolbar {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  max-width: 22rem;
}
.engagement-toolbar .reaction-btn,
.engagement-toolbar .engagement-comments-summary {
  flex: 1 1 0;
  min-width: 0;
  justify-content: center;
  white-space: nowrap;
}
.engagement-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.engagement-comments-summary {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--surface-border, #e2e8f0);
  border-radius: 999px;
  background: var(--surface-card, #fff);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 600;
}
.engagement-comments-summary .engagement-comment-total {
  min-width: 1.25rem;
  text-align: center;
  background: none;
  padding: 0;
  border-radius: 0;
  color: inherit;
  font-size: inherit;
}
.reaction-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--surface-border, #e2e8f0);
  border-radius: 999px;
  background: var(--surface-card, #fff);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.reaction-btn:hover { border-color: var(--color-brand-500, #6366f1); color: var(--text-primary); }
.reaction-btn.active {
  background: var(--color-brand-50, #eef2ff);
  border-color: var(--color-brand-500, #6366f1);
  color: var(--color-brand-700, #4338ca);
}
.reaction-dislike.active {
  background: #fef2f2;
  border-color: #ef4444;
  color: #b91c1c;
}
.reaction-count { min-width: 1.25rem; text-align: center; }
.reaction-label { font-weight: 500; }

@media (max-width: 520px) {
  .engagement-toolbar {
    gap: 0.35rem;
  }
  .engagement-toolbar .reaction-btn,
  .engagement-toolbar .engagement-comments-summary {
    padding: 0.45rem 0.5rem;
    font-size: 0.75rem;
    gap: 0.3rem;
  }
  .engagement-toolbar .reaction-btn svg,
  .engagement-toolbar .engagement-comments-summary svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
  }
  .engagement-toolbar .reaction-count {
    min-width: 0.75rem;
  }
}

@media (max-width: 380px) {
  .engagement-toolbar .reaction-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}

.engagement-comments {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  max-width: 28rem;
}
.engagement-comment-total {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.375rem;
  height: 1.375rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text-muted);
  font-size: 0.6875rem;
  font-weight: 600;
}
.engagement-comment-list {
  list-style: none;
  margin: 0 0 0.875rem;
  padding: 0;
  display: grid;
  gap: 0.625rem;
}
.engagement-comment {
  display: flex;
  gap: 0.625rem;
  align-items: flex-start;
}
.comment-avatar {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: var(--color-brand-100);
  color: var(--color-brand-700);
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.125rem;
}
.comment-bubble {
  flex: 1;
  min-width: 0;
  padding: 0.625rem 0.75rem;
  border-radius: 0.625rem;
  background: var(--surface-muted);
  border: 1px solid var(--surface-border);
}
.engagement-comment-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.5rem;
  margin-bottom: 0.2rem;
  font-size: 0.75rem;
}
.engagement-comment-head strong {
  font-weight: 600;
  color: var(--text-primary);
}
.engagement-comment-head time { color: var(--text-muted); font-size: 0.6875rem; }
.engagement-comment-body {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  line-height: 1.5;
  word-break: break-word;
}

.comment-compose {
  padding: 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid var(--surface-border);
  background: var(--surface-card);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.comment-compose-compact {
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}
.comment-compose-row {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}
.comment-compose-avatar {
  width: 2rem;
  height: 2rem;
  margin-top: 0;
  overflow: hidden;
}
.comment-compose-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.comment-compose-shell {
  flex: 1;
  min-width: 0;
}
.comment-compose-trigger {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 2.25rem;
  padding: 0 0.85rem;
  border: 1px solid var(--surface-border);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.2;
  text-align: left;
  text-decoration: none;
  cursor: text;
  box-sizing: border-box;
  transition: border-color 0.15s, background 0.15s;
}
.comment-compose-trigger:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: var(--text-muted);
  text-decoration: none;
}
.comment-compose.is-expanded .comment-compose-trigger,
.comment-compose-compact.is-expanded .comment-compose-trigger {
  display: none;
}
.comment-compose.is-expanded .comment-compose-shell,
.comment-compose-compact.is-expanded .comment-compose-shell {
  border: 1px solid var(--surface-border);
  border-radius: 1rem;
  background: var(--surface-muted);
  padding: 0.625rem 0.75rem;
}
.comment-compose-panel[hidden] {
  display: none !important;
}
.comment-compose-panel:not([hidden]) {
  display: grid;
  gap: 0.625rem;
}
.comment-compose-panel .comment-field-body {
  width: 100%;
  min-height: 1.5rem;
  max-height: 8rem;
  padding: 0.125rem 0.25rem;
  border: none;
  border-radius: 0;
  background: transparent;
  resize: none;
  box-shadow: none;
  font-size: 0.875rem;
  line-height: 1.45;
}
.comment-compose-panel .comment-field-body:focus {
  outline: none;
  box-shadow: none;
  background: transparent;
}
.comment-compose-actions {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.comment-field {
  width: 100%;
  font-family: inherit;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text-primary);
  background: var(--surface-bg);
  border: 1px solid var(--surface-border);
  border-radius: 0.5rem;
  padding: 0.5rem 0.625rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.comment-field::placeholder { color: #9ca3af; }
.comment-field:focus {
  outline: none;
  border-color: var(--color-brand-400);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12);
  background: #fff;
}
.comment-field-name { margin-bottom: 0.5rem; }
.comment-field-body {
  resize: vertical;
  min-height: 3.25rem;
  max-height: 8rem;
}
.comment-compose-meta,
.comment-compose-actions {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}
.comment-captcha { flex: 1; min-width: 10rem; }
.comment-captcha-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0;
}
.comment-captcha-text {
  font-size: 0.6875rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.comment-captcha-input {
  width: 4.5rem;
  padding: 0.375rem 0.5rem;
  text-align: center;
}
.comment-submit {
  flex-shrink: 0;
  border: none;
  border-radius: 0.5rem;
  padding: 0.45rem 0.9rem;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #fff;
  background: var(--color-brand-600);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.comment-submit:hover { background: var(--color-brand-700); }
.comment-submit:active { transform: scale(0.98); }
.comment-submit:disabled { opacity: 0.6; cursor: not-allowed; }
.comment-compose-note {
  margin: 0.45rem 0 0;
  font-size: 0.6875rem;
  color: var(--text-muted);
}
.engagement-form-error {
  margin: 0.5rem 0 0;
  color: #dc2626;
  font-size: 0.75rem;
}

@media (max-width: 480px) {
  .comment-compose-actions { flex-direction: column; align-items: stretch; }
  .comment-submit { width: 100%; padding: 0.55rem 0.9rem; }
}

/* Admin reported content */
.report-list { display: grid; gap: 1rem; }
.report-card { display: flex; gap: 1rem; padding: 1rem; align-items: flex-start; }
.report-card-media { flex-shrink: 0; width: 120px; }
.report-card-media img { width: 120px; height: 120px; object-fit: cover; border-radius: 0.5rem; display: block; }
.report-card-noimg {
  width: 120px; height: 120px; display: flex; align-items: center; justify-content: center;
  background: var(--surface-muted); border-radius: 0.5rem; font-size: 0.75rem; color: var(--text-muted); text-align: center;
}
.report-card-body { flex: 1; min-width: 0; }
.report-message {
  margin: 0.5rem 0; padding: 0.6rem 0.8rem; background: var(--surface-muted);
  border-radius: 0.5rem; font-size: 0.875rem; color: var(--text-secondary);
}
.report-card-actions { display: flex; gap: 0.5rem; margin-top: 0.75rem; flex-wrap: wrap; }
@media (max-width: 600px) {
  .report-card { flex-direction: column; }
  .report-card-media, .report-card-media img, .report-card-noimg { width: 100%; }
  .report-card-media img { height: 180px; }
}

/* Menu settings picker */
.menu-pick-list { display: grid; gap: 0.5rem; }
.menu-pick-row {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.5rem 0.75rem; border: 1px solid var(--surface-border); border-radius: 0.5rem;
  flex-wrap: wrap;
}
.menu-pick-label { display: flex; align-items: center; gap: 0.6rem; font-size: 0.9375rem; cursor: pointer; min-width: 0; }
.menu-pick-label > span:first-of-type { font-weight: 500; }
.menu-pick-slug { color: var(--text-muted); font-size: 0.8125rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-pick-order { width: 72px; flex-shrink: 0; text-align: center; }

/* Admin dashboard */
.admin-dashboard {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.admin-shell .card {
  border: 1px solid rgba(229, 231, 235, 0.95);
  border-radius: 1.25rem;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.04);
  background: #fff;
}
.dash-hero {
  display: grid;
  grid-template-columns: 1.4fr 0.6fr;
  gap: 1.25rem;
  align-items: stretch;
  margin-bottom: 1.25rem;
  padding: 1.75rem 1.75rem;
  border-radius: 1.5rem;
  color: #fff;
  background:
    radial-gradient(circle at 85% 20%, rgba(255, 255, 255, 0.18), transparent 40%),
    linear-gradient(135deg, var(--color-brand-600) 0%, var(--color-brand-800) 100%);
  box-shadow: 0 16px 40px rgba(2, 132, 199, 0.28);
  overflow: hidden;
  position: relative;
}
.dash-hero::after {
  content: "";
  position: absolute;
  right: -2rem;
  bottom: -3rem;
  width: 14rem;
  height: 14rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
}
.dash-hero-copy { position: relative; z-index: 1; max-width: 36rem; min-width: 0; overflow-wrap: anywhere; }
.dash-hero-kicker {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.8;
}
.dash-hero h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.35rem, 2.2vw, 1.85rem);
  line-height: 1.25;
  font-weight: 700;
}
.dash-hero-copy > p {
  margin: 0 0 1.15rem;
  opacity: 0.9;
  font-size: 0.9375rem;
  max-width: 32rem;
}
.dash-hero-actions { display: flex; flex-wrap: wrap; gap: 0.65rem; }
.dash-hero-actions .btn-primary {
  background: #0f172a;
  border-color: #0f172a;
  border-radius: 999px;
  padding-inline: 1.15rem;
}
.dash-hero-actions .btn-primary:hover { background: #020617; border-color: #020617; }
.dash-hero-actions .btn-secondary {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
  border-radius: 999px;
  padding-inline: 1.15rem;
}
.dash-hero-actions .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.22);
  text-decoration: none;
  color: #fff;
}
.dash-hero-aside {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.dash-hero-metric {
  min-width: 9.5rem;
  padding: 1.15rem 1.25rem;
  border-radius: 1.15rem;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(6px);
  text-align: center;
}
.dash-hero-metric span {
  display: block;
  font-size: 0.75rem;
  opacity: 0.85;
  margin-bottom: 0.35rem;
}
.dash-hero-metric strong {
  display: block;
  font-size: 2rem;
  line-height: 1;
  font-weight: 800;
}
.dash-hero-metric em {
  display: block;
  margin-top: 0.35rem;
  font-style: normal;
  font-size: 0.75rem;
  opacity: 0.8;
}
.dash-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.dash-stat-card {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  padding: 1.15rem 1.2rem;
  background: #fff;
  border: 1px solid rgba(229, 231, 235, 0.95);
  border-radius: 1.15rem;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  min-width: 0;
}
.dash-stat-card > div { min-width: 0; }
.dash-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
}
.dash-stat-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dash-stat-images .dash-stat-icon { background: #e0f2fe; color: #0369a1; }
.dash-stat-posts .dash-stat-icon { background: #ecfeff; color: #0e7490; }
.dash-stat-users .dash-stat-icon { background: #dcfce7; color: #15803d; }
.dash-stat-views .dash-stat-icon { background: #ffedd5; color: #c2410c; }
.dash-stat-video.is-ok {
  border-color: #86efac;
  background: #f0fdf4;
}
.dash-stat-video.is-ok .dash-stat-icon { background: #dcfce7; color: #15803d; }
.dash-stat-video.is-ok .dash-stat-value { color: #15803d; }
.dash-stat-video.is-alert {
  border-color: #fca5a5;
  background: #fef2f2;
}
.dash-stat-video.is-alert .dash-stat-icon { background: #fee2e2; color: #b91c1c; }
.dash-stat-video.is-alert .dash-stat-value { color: #b91c1c; }
.dash-stat-video.is-alert .dash-stat-label { color: #991b1b; }
.dash-stat-label { font-size: 0.8125rem; color: var(--text-muted); margin-bottom: 0.15rem; }
.dash-stat-value { font-size: 1.65rem; font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; }
.dash-stat-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.35rem; }
.dash-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}
.dash-grid-3 {
  display: grid;
  grid-template-columns: minmax(200px, 280px) minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem;
}
.dash-panel { padding: 1.25rem 1.35rem; min-width: 0; overflow: hidden; }
.dash-panel h2 {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}
.dash-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}
.dash-panel-head h2 { margin-bottom: 0; }
.dash-panel-sub { font-size: 0.75rem; font-weight: 400; color: var(--text-muted); }
.dash-line-chart { padding: 0.5rem 1.25rem 0; }
.dash-line-plot { position: relative; height: 120px; }
.dash-line-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.dash-line-stroke { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.dash-line-area { stroke: none; opacity: 0.14; }
.dash-line-dot {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  border: 2px solid #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}
.dash-line-stroke.images { stroke: #0284c7; }
.dash-line-area.images { fill: #38bdf8; }
.dash-line-dot.images { background: #0284c7; }
.dash-line-stroke.posts { stroke: #0e7490; }
.dash-line-area.posts { fill: #22d3ee; }
.dash-line-dot.posts { background: #0e7490; }
.dash-line-axis { position: relative; height: 2.6rem; margin-top: 0.35rem; }
.dash-line-tick {
  position: absolute;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  white-space: nowrap;
}
.dash-chart-label { font-size: 0.6875rem; color: var(--text-muted); }
.dash-chart-count { font-size: 0.75rem; font-weight: 600; color: var(--text-secondary); }
.dash-status-list { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: 0.625rem; }
.dash-status-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.875rem;
  color: var(--text-secondary);
}
.dash-status-list li strong { color: var(--text-primary); }
.dash-status-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  margin-right: 0.5rem;
  display: inline-block;
}
.dash-status-dot.draft { background: #9ca3af; }
.dash-status-dot.pending { background: #f59e0b; }
.dash-status-dot.published { background: #22c55e; }
.dash-status-list li span:first-child { display: inline-flex; align-items: center; }
.dash-mini-stats {
  display: grid;
  gap: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--surface-border);
  font-size: 0.8125rem;
}
.dash-mini-stats div { display: flex; justify-content: space-between; color: var(--text-muted); }
.dash-mini-stats strong { color: var(--text-primary); }
.dash-recent-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.15rem; }
.dash-recent-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.15rem;
  border-bottom: 1px solid var(--surface-border);
  font-size: 0.8125rem;
  min-width: 0;
}
.dash-recent-list li:last-child { border-bottom: none; }
.dash-recent-list li > div {
  min-width: 0;
  flex: 1 1 auto;
}
.dash-recent-list strong {
  display: block;
  font-size: 0.875rem;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-recent-list span { color: var(--text-muted); font-size: 0.75rem; }
.dash-badge {
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}
.dash-badge.public, .dash-badge.published { background: #dcfce7; color: #166534; }
.dash-badge.private, .dash-badge.draft { background: #f3f4f6; color: #4b5563; }
.dash-badge.pending { background: #fef3c7; color: #92400e; }
.dash-link {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-brand-700);
  text-decoration: none;
}
.dash-link:hover { text-decoration: underline; }
.dash-empty { margin: 0.5rem 0 0; font-size: 0.875rem; color: var(--text-muted); }
@media (max-width: 1100px) {
  .dash-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-hero { grid-template-columns: 1fr; }
  .dash-hero-aside { justify-content: flex-start; }
  .dash-grid-3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .dash-panel-wide { grid-column: span 1; }
}

@media (min-width: 1400px) {
  .admin-sidebar { width: 272px; }
  .admin-topbar { margin: 1rem 1.75rem 0; padding: 1.05rem 2rem; }
  .admin-main { padding: 1.5rem 2.25rem 2.5rem; }
  .dash-hero { padding: 2rem 2.15rem; }
  .dash-line-plot { height: 150px; }
}

@media (min-width: 1800px) {
  .admin-sidebar { width: 288px; }
  .admin-topbar { margin: 1.15rem 2.5rem 0; padding: 1.15rem 2.25rem; }
  .admin-main { padding: 1.75rem 3rem 3rem; }
  .dash-stat-grid,
  .dash-grid-2,
  .dash-grid-3 { gap: 1.25rem; }
  .dash-hero { padding: 2.15rem 2.5rem; }
  .dash-line-plot { height: 180px; }
}

.table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.table th, .table td { padding: 0.75rem; border-bottom: 1px solid var(--surface-border); text-align: left; }
.admin-main .table td {
  overflow-wrap: anywhere;
  word-break: break-word;
  vertical-align: middle;
  max-width: 28rem;
}
.admin-main .table td a {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.table-wrap, .admin-main .table {
  max-width: 100%;
}
.admin-main .card {
  min-width: 0;
}
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(140px, 100%), 1fr)); gap: 0.75rem; }
.theme-option { border: 2px solid var(--surface-border); border-radius: 0.5rem; padding: 0.5rem; cursor: pointer; }
.theme-option.selected { border-color: var(--color-brand-600); }
.theme-swatch { display: flex; gap: 2px; height: 24px; margin-bottom: 0.5rem; }
.theme-swatch span { flex: 1; border-radius: 2px; }
.gradient-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(120px, 100%), 1fr)); gap: 0.75rem; }
.gradient-option { border: 2px solid var(--surface-border); border-radius: 0.5rem; padding: 0.5rem; cursor: pointer; text-align: center; }
.gradient-option.selected { border-color: var(--color-brand-600); }
.gradient-swatch {
  height: 48px; border-radius: 0.375rem; margin-bottom: 0.5rem;
  border: 1px solid var(--surface-border);
  display: flex; align-items: center; justify-content: center;
}
.gradient-swatch-none { font-size: .75rem; color: var(--text-muted); }
.upload-zone {
  border: 2px dashed var(--surface-border); border-radius: 0.75rem;
  padding: 3rem; text-align: center; cursor: pointer;
  background: var(--surface-card);
  color: var(--text-primary);
  transition: border-color .2s, box-shadow .2s;
}
.upload-zone.dragover {
  border-color: var(--color-brand-500);
  box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--color-brand-500) 22%, transparent);
}

/* Homepage full-size drop zone (full-bleed, edge to edge) */
.page-home main.container {
  max-width: none;
  width: 100%;
  padding: 0;
  position: relative;
}
.page-home main.container > .flash {
  position: absolute;
  top: calc(var(--site-header-h, 4rem) + 0.75rem);
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  margin: 0;
  max-width: min(1120px, calc(100% - 2rem));
  width: min(1120px, calc(100% - 2rem));
}
.home-hero {
  width: 100%;
  max-width: none;
  margin: calc(-1 * var(--site-header-h, 4rem)) 0 0;
}
.home-hero form {
  display: block;
  width: 100%;
}
.home-dropzone {
  position: relative;
  width: 100%;
  border: 0;
  border-bottom: 2px dashed var(--surface-border);
  border-radius: 0;
  box-sizing: border-box;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  padding: calc(var(--site-header-h, 4rem) + clamp(1rem, 3vh, 2.5rem)) clamp(1rem, 4vw, 3rem) clamp(1.5rem, 4vh, 3rem);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  background: var(--surface-muted, #f8fafc);
  color: var(--text-primary);
  transition: border-color .2s, box-shadow .2s, filter .2s;
}
.home-dropzone.is-staging {
  cursor: default;
}
.home-dropzone.is-staging .home-dropzone-inner {
  pointer-events: none;
  user-select: none;
  visibility: hidden;
}
/* Hover/drag: keep the current surface (theme or gradient). Never swap to brand-50 —
   dark themes like Slate use a light brand-50 which makes light text unreadable. */
.home-dropzone:hover {
  border-color: var(--color-brand-400, #38bdf8);
  box-shadow: inset 0 0 0 9999px color-mix(in srgb, var(--color-brand-500) 10%, transparent);
}
.home-dropzone.is-staging:hover,
.home-dropzone.is-staging.dragover {
  border-color: var(--surface-border);
  box-shadow: none;
}
.home-dropzone.dragover {
  border-color: var(--color-brand-500);
  box-shadow: inset 0 0 0 9999px color-mix(in srgb, var(--color-brand-500) 14%, transparent),
              inset 0 0 0 3px color-mix(in srgb, var(--color-brand-500) 28%, transparent);
}
.home-dropzone-disabled {
  cursor: not-allowed;
  opacity: .85;
  background: var(--surface-muted, #f1f5f9);
}
.home-dropzone-disabled:hover {
  border-color: var(--surface-border);
  box-shadow: none;
}
.home-dropzone-inner { padding: 1rem; max-width: min(36rem, 92vw); }

/* Animated upload icon */
.home-dropzone-icon {
  display: inline-flex; color: var(--color-brand-500, #0ea5e9); margin-bottom: 1rem;
  animation: dropzone-float 2.4s ease-in-out infinite;
  will-change: transform;
}
.home-dropzone:hover .home-dropzone-icon { animation-duration: 1.1s; }
.home-dropzone.dragover .home-dropzone-icon { animation: dropzone-bounce .6s ease-in-out infinite; }
@keyframes dropzone-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes dropzone-bounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-16px) scale(1.08); }
}
@media (prefers-reduced-motion: reduce) {
  .home-dropzone-icon,
  .home-dropzone:hover .home-dropzone-icon,
  .home-dropzone.dragover .home-dropzone-icon { animation: none; }
}

.home-dropzone-icon-img { display: block; width: 72px; height: 72px; object-fit: contain; }
.home-tagline { text-align: center; color: var(--text-secondary); font-size: 1.125rem; margin: 0 0 2rem; }
.home-below {
  width: 100%;
  max-width: 1120px;
  margin: 2.5rem auto 0;
  padding: 0 1rem 2rem;
  box-sizing: border-box;
}
.home-dropzone-title {
  margin: 0 0 .5rem;
  font-size: clamp(1.25rem, 3.6vw, 1.875rem);
  color: var(--text-primary);
}
.home-dropzone-sub { margin: 0; color: var(--text-muted); font-size: .9375rem; }
.home-dropzone-sub strong { color: var(--text-primary); font-weight: 600; }
.home-dropzone-meta { margin: .5rem 0 0; color: var(--text-muted); font-size: .8125rem; opacity: .9; }
.home-dropzone-note { margin: .75rem 0 0; color: #d97706; font-size: .875rem; }

/* Light pastel gradients always need dark text, even on Midnight/Slate themes. */
.home-dropzone--gradient {
  color: #0f172a;
}
.home-dropzone--gradient .home-dropzone-title,
.home-dropzone--gradient .home-dropzone-sub strong {
  color: #0f172a;
}
.home-dropzone--gradient .home-dropzone-sub,
.home-dropzone--gradient .home-dropzone-meta {
  color: #475569;
  opacity: 1;
}
.home-dropzone--gradient .home-dropzone-icon {
  color: #0369a1;
}
.home-dropzone--gradient:hover {
  box-shadow: inset 0 0 0 9999px rgba(2, 132, 199, 0.08);
}
.home-dropzone--gradient.dragover {
  box-shadow: inset 0 0 0 9999px rgba(2, 132, 199, 0.12),
              inset 0 0 0 3px rgba(2, 132, 199, 0.28);
}

@supports not (background: color-mix(in srgb, red 10%, transparent)) {
  .home-dropzone:hover {
    box-shadow: inset 0 0 0 3px rgba(56, 189, 248, 0.35);
  }
  .home-dropzone.dragover {
    box-shadow: inset 0 0 0 3px rgba(14, 165, 233, 0.45);
  }
  .upload-zone.dragover {
    box-shadow: inset 0 0 0 3px rgba(14, 165, 233, 0.35);
  }
}

.home-upload-stage {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  box-sizing: border-box;
}
.home-upload-stage[hidden] {
  display: none !important;
}
.home-upload-stage-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 1.5rem 2rem;
  box-sizing: border-box;
  background: transparent;
  color: inherit;
  box-shadow: none;
}
.home-upload-stage-content {
  flex: 0 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 42rem;
  color: inherit;
}
.home-upload-previews {
  width: 100%;
  flex: 0 1 auto;
  min-height: 0;
  max-height: min(42vh, 22rem);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: center;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.5rem 0;
  overflow-y: auto;
}
.home-upload-previews.is-single {
  align-content: center;
}
.home-upload-preview {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 8.5rem;
  min-width: 0;
}
.home-upload-preview-media {
  position: relative;
}
.home-upload-remove {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  z-index: 2;
  width: 1.5rem;
  height: 1.5rem;
  border: none;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.78);
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.home-upload-remove:hover {
  background: rgba(185, 28, 28, 0.92);
}
.home-upload-remove:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.home-upload-preview img,
.home-upload-preview video,
.home-upload-preview-fallback {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 0.75rem;
  border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
  background: color-mix(in srgb, currentColor 8%, transparent);
  display: block;
}
.home-upload-preview-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 700;
  color: inherit;
  opacity: 0.7;
}
.home-upload-preview-meta {
  min-width: 0;
  text-align: center;
  color: inherit;
}
.home-upload-preview-meta strong {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.home-upload-preview-meta span {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.75rem;
  color: inherit;
  opacity: 0.75;
}
.home-upload-progress {
  flex-shrink: 0;
  width: min(100%, 28rem);
  margin-top: 1rem;
}
.home-upload-progress-track {
  position: relative;
  height: 0.5rem;
  border-radius: 999px;
  background: color-mix(in srgb, currentColor 14%, transparent);
  overflow: hidden;
}
.home-upload-progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--color-brand-500, #0ea5e9), var(--color-brand-600, #0284c7));
  transition: width 0.2s ease;
}
.home-upload-progress-bar.is-indeterminate {
  width: 40% !important;
  transition: none;
  animation: upload-progress-indeterminate 1.2s ease-in-out infinite;
}
@keyframes upload-progress-indeterminate {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}
@media (prefers-reduced-motion: reduce) {
  .home-upload-progress-bar.is-indeterminate { animation: none; width: 100% !important; opacity: 0.45; }
}
.home-upload-progress-label {
  margin: 0.5rem 0 0;
  font-size: 0.8125rem;
  color: inherit;
  opacity: 0.8;
  text-align: center;
}
.home-upload-stage-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.625rem;
  flex-wrap: wrap;
  flex-shrink: 0;
  margin-top: 1.15rem;
  padding-top: 0;
  width: 100%;
}
.home-upload-error {
  margin: 0.75rem 0 0;
  font-size: 0.8125rem;
  color: #f87171;
  flex-shrink: 0;
  text-align: center;
  width: min(100%, 28rem);
}
.home-dropzone:not(.home-dropzone--gradient) .home-upload-error {
  color: #b91c1c;
}

/* Homepage blog cards */
.home-section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 1.25rem;
}
.home-section-head h2 { margin: 0; font-size: 1.375rem; }
.home-section-link { font-size: .875rem; }
.home-post-grid { grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); }
.blog-card {
  overflow: hidden; text-decoration: none; color: inherit;
  display: flex; flex-direction: column; transition: box-shadow .2s, transform .2s;
}
.blog-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,.08); transform: translateY(-2px); text-decoration: none; }
.blog-card-cover { width: 100%; height: 12rem; object-fit: cover; display: block; }
.blog-card-cover-empty { background: linear-gradient(135deg, var(--color-brand-100, #e0f2fe), var(--color-brand-50, #f0f9ff)); }
.blog-card-body { padding: 1.25rem; display: flex; flex-direction: column; gap: .5rem; }
.blog-card-title { margin: 0; font-size: 1.0625rem; line-height: 1.3; }
.blog-card-excerpt {
  margin: 0; color: var(--text-secondary, #475569); font-size: .875rem; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.blog-card-date { margin-top: auto; font-size: .8125rem; color: var(--text-muted); }

/* Homepage FAQ */
.home-faq {
  margin-top: 2.5rem;
  width: 100%;
  max-width: min(40rem, 100%);
  min-width: 0;
  box-sizing: border-box;
  margin-left: auto;
  margin-right: auto;
}
.home-faq .home-section-head {
  width: 100%;
  min-width: 0;
  flex-wrap: wrap;
}
.home-faq .home-section-head h2 {
  min-width: 0;
  overflow-wrap: anywhere;
}
.faq-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: .75rem;
  width: 100%;
  min-width: 0;
}
.faq-item {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  box-sizing: border-box;
}
.faq-question {
  list-style: none;
  cursor: pointer;
  padding: .875rem 1rem;
  font-weight: 600;
  line-height: 1.4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
}
.faq-question-text {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.faq-question::-webkit-details-marker { display: none; }
.faq-question::after {
  content: '+';
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--color-brand-50, #f0f9ff);
  color: var(--color-brand-700, #0369a1);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1;
}
.faq-item[open] .faq-question::after { content: '−'; }
.faq-item:not([open]) .faq-answer-panel { display: none; }
.faq-answer-panel {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}
.faq-answer {
  height: 9rem;
  overflow-y: auto;
  overflow-x: hidden;
  padding: .75rem 1rem 1rem;
  border-top: 1px solid var(--surface-border);
  color: var(--text-secondary, #475569);
  line-height: 1.6;
  font-size: .9375rem;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.blog-cover-zone.cover-required {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}
.blog-cover-zone {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  border: 2px dashed #cbd5e1;
  border-radius: 0.75rem;
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  background: #f8fafc;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.blog-cover-zone:hover {
  border-color: var(--color-brand-400, #38bdf8);
  background: #f0f9ff;
}
.blog-cover-zone.dragover {
  border-color: var(--color-brand-500, #0ea5e9);
  background: #e0f2fe;
  box-shadow: inset 0 0 0 3px rgba(14, 165, 233, 0.15);
}
.blog-cover-zone.has-image {
  min-height: auto;
  padding: 0.75rem;
  background: var(--surface-card, #fff);
  border-style: solid;
  border-color: var(--surface-border, #e5e7eb);
}
.blog-cover-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  pointer-events: none;
}
.blog-cover-icon {
  width: 3rem;
  height: 3rem;
  color: var(--color-brand-500, #0ea5e9);
  margin-bottom: 0.25rem;
}
.blog-cover-title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary, #111827);
}
.blog-cover-hint {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-muted, #6b7280);
}
.blog-cover-browse {
  margin-top: 0.25rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-brand-600, #0284c7);
  text-decoration: underline;
}
.blog-cover-preview {
  width: 100%;
}
.blog-cover-preview img {
  display: block;
  width: 100%;
  max-height: 240px;
  border-radius: 0.5rem;
  object-fit: cover;
}
.blog-cover-preview-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--surface-border, #e5e7eb);
}
.blog-cover-filename {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-muted, #6b7280);
  word-break: break-all;
  text-align: left;
}
.blog-cover-replace-hint {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-muted, #6b7280);
}
.blog-cover-remove {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  font-size: 0.875rem;
}

/* Install wizard password checker */
.password-field-wrap { position: relative; }
.password-field-input { padding-right: 2.75rem; }
.password-toggle {
  position: absolute; top: 50%; right: 0.625rem; transform: translateY(-50%);
  display: inline-flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; padding: 0; border: none; background: transparent;
  color: #6b7280; cursor: pointer; border-radius: 0.375rem;
}
.password-toggle:hover { color: #111827; background: #f3f4f6; }
.password-toggle-icon { width: 1.25rem; height: 1.25rem; }
.password-checker { margin-top: 0.875rem; }
.password-checker-bar { height: 0.5rem; background: #e5e7eb; border-radius: 999px; overflow: hidden; }
.password-checker-bar span {
  display: block; height: 100%; width: 0; border-radius: 999px; background: #ef4444;
  transition: width 0.25s ease, background-color 0.25s ease;
}
.password-checker[data-level="2"] .password-checker-bar span { background: #f59e0b; }
.password-checker[data-level="3"] .password-checker-bar span { background: #22c55e; }
.password-checker-list { list-style: none; margin: 0.75rem 0 0; padding: 0; display: grid; gap: 0.4rem; }
.password-check-item {
  position: relative; padding-left: 1.1rem; font-size: 0.875rem; color: #ef4444; line-height: 1.4;
}
.password-check-item::before {
  content: ""; position: absolute; left: 0; top: 0.55rem;
  width: 0.45rem; height: 0.45rem; border-radius: 50%; background: #ef4444;
}
.password-check-item.is-met { color: #16a34a; }
.password-check-item.is-met::before { background: #22c55e; }
.password-strength-tip {
  margin: 0.5rem 0 0; font-size: 0.75rem; color: #6b7280; line-height: 1.5;
}

/* Rich text content (blog posts, policy pages) */
.content-body { line-height: 1.7; color: var(--text-primary); text-align: left; }
.content-body h1, .content-body h2, .content-body h3, .content-body h4 { margin: 1.5em 0 0.5em; line-height: 1.3; }
.content-body h1 { font-size: 1.75rem; }
.content-body h2 { font-size: 1.5rem; }
.content-body h3 { font-size: 1.25rem; }
.content-body p { margin: 0 0 1em; }
.content-body ul, .content-body ol { margin: 0 0 1em; padding-left: 1.5em; }
.content-body li { margin-bottom: 0.35em; }
.content-body a { color: var(--color-brand-600); text-decoration: underline; }
.content-body img { max-width: 100%; height: auto; border-radius: 0.5rem; }
.content-body blockquote { margin: 1em 0; padding: 0.75em 1em; border-left: 4px solid var(--color-brand-300); background: var(--surface-muted); }
.content-body table { width: 100%; border-collapse: collapse; margin: 1em 0; }
.content-body th, .content-body td { border: 1px solid var(--surface-border); padding: 0.5rem 0.75rem; text-align: left; }
.content-body pre, .content-body code { font-family: ui-monospace, monospace; font-size: 0.875em; }
.content-body pre { background: var(--surface-muted); padding: 1rem; border-radius: 0.5rem; overflow-x: auto; }
.content-body .wp-block-image { margin: 1.25em 0; }
.content-body .wp-block-image img { display: block; }
.content-body .wp-block-image figcaption {
  margin-top: 0.4rem; font-size: 0.8125rem; color: var(--text-muted); text-align: center;
}
.content-body .wp-block-separator { border: 0; border-top: 1px solid var(--surface-border); margin: 1.75em 0; }
.content-body .wp-block-quote { margin: 1em 0; }
.content-body .wp-block-code { margin: 1em 0; }

.blog-form-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
  max-width: 800px;
}
.blog-form-head.is-block-editor { max-width: none; }
.blog-editor-switch {
  display: inline-flex;
  padding: 0.2rem;
  border: 1px solid var(--surface-border);
  border-radius: 999px;
  background: #fff;
  gap: 0.15rem;
}
.blog-editor-switch-btn {
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
}
.blog-editor-switch-btn.is-active {
  background: var(--color-brand-600);
  color: #fff;
}
.blog-post-form {
  padding: 1.5rem;
  max-width: 800px;
}
.blog-post-form.is-block-editor {
  max-width: none;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.blog-setting-field { margin-bottom: 1rem; }
.blog-post-form.is-block-editor .blog-classic-only { display: none; }
.blog-post-form.is-block-editor .blog-editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  grid-template-areas:
    "title settings"
    "content settings"
    "actions settings";
  gap: 0 1.25rem;
  align-items: start;
}
.blog-post-form.is-block-editor .blog-title-field { grid-area: title; }
.blog-post-form.is-block-editor .blog-post-settings {
  grid-area: settings;
  position: sticky;
  top: 1rem;
  background: #fff;
  border: 1px solid var(--surface-border);
  border-radius: 0.75rem;
  padding: 1rem 1.1rem;
}
.blog-post-form.is-block-editor .blog-content-field { grid-area: content; margin-bottom: 0; }
.blog-post-form.is-block-editor .blog-form-actions {
  grid-area: actions;
  padding: 1rem 0 1.5rem;
}
.blog-post-settings-title {
  display: none;
  margin: 0 0 0.85rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.blog-post-form.is-block-editor .blog-post-settings-title { display: block; }
.blog-post-form.is-block-editor .blog-title-input {
  border: 0;
  background: transparent;
  box-shadow: none;
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.03em;
  padding: 0.35rem 3rem 0.5rem;
  height: auto;
  border-radius: 0;
}
.blog-post-form.is-block-editor .blog-title-input:focus {
  outline: none;
  box-shadow: none;
}
.blog-content-field { margin-bottom: 1rem; }
.gb-mount { position: relative; }
.gb-editor {
  position: relative;
  background: transparent;
  min-height: 22rem;
}
.gb-header {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 3rem 0.75rem;
}
.gb-header-btn {
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--surface-border);
  border-radius: 4px;
  background: #fff;
  color: var(--text-secondary);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}
.gb-header-btn:hover { border-color: var(--color-brand-500); color: var(--color-brand-700); }
.gb-header-btn:disabled { opacity: 0.4; cursor: default; }
.gb-header-hint {
  margin-left: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.gb-header-hint kbd {
  font: inherit;
  font-weight: 700;
  padding: 0.05rem 0.3rem;
  border: 1px solid var(--surface-border);
  border-radius: 4px;
  background: #fff;
}
.gb-canvas { padding: 0 0 2rem; }
.gb-block {
  position: relative;
  padding: 0.45rem 1rem 0.45rem 3rem;
  margin: 0;
}
.gb-block.is-selected {
  box-shadow: inset 0 0 0 1.5px #1e1e1e;
  margin-top: 2.35rem;
}
.gb-add {
  position: absolute;
  left: 0.65rem;
  top: 0.55rem;
  width: 1.75rem;
  height: 1.75rem;
  border: 1px solid var(--surface-border);
  border-radius: 2px;
  background: #fff;
  color: #1e1e1e;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  opacity: 0;
}
.gb-block:hover .gb-add,
.gb-block.is-selected .gb-add { opacity: 1; }
.gb-add:hover { background: #1e1e1e; color: #fff; border-color: #1e1e1e; }
.gb-toolbar {
  display: none;
  position: absolute;
  left: 3rem;
  top: -2.15rem;
  z-index: 5;
  align-items: center;
  gap: 0.15rem;
  padding: 0.2rem 0.3rem;
  background: #1e1e1e;
  color: #fff;
  border-radius: 2px;
  width: max-content;
  max-width: calc(100% - 3.5rem);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.gb-block.is-selected .gb-toolbar { display: flex; }
.gb-toolbar-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0 0.45rem;
  white-space: nowrap;
}
.gb-tool {
  border: 0;
  background: transparent;
  color: #fff;
  min-width: 1.7rem;
  height: 1.7rem;
  border-radius: 2px;
  cursor: pointer;
}
.gb-tool:hover { background: rgba(255,255,255,0.12); }
.gb-tool-danger:hover { background: #cc1818; }
.gb-tool-select {
  background: #000;
  color: #fff;
  border: 0;
  border-radius: 2px;
  font-size: 0.75rem;
  padding: 0.2rem 0.3rem;
}
.gb-edit {
  outline: none;
  min-height: 1.5em;
}
.gb-edit:empty::before {
  content: attr(data-placeholder);
  color: #949494;
}
.gb-edit-p { margin: 0; font-size: 1.125rem; line-height: 1.8; }
.gb-edit-h { margin: 0; line-height: 1.25; font-weight: 700; }
.gb-block[data-type="heading"] .gb-edit-h { font-size: 2rem; }
.gb-edit-list { margin: 0; padding-left: 1.25rem; font-size: 1.125rem; }
.gb-edit-quote {
  margin: 0;
  padding: 0 1rem;
  border-left: 4px solid #1e1e1e;
  color: var(--text-secondary);
  font-size: 1.25rem;
}
.gb-image-fields { display: grid; gap: 0.5rem; }
.gb-image-fields label { display: grid; gap: 0.2rem; font-size: 0.75rem; color: var(--text-muted); }
.gb-image-fields input { font-size: 0.875rem; }
.gb-image-preview { max-width: 100%; max-height: 16rem; object-fit: contain; border-radius: 0.25rem; background: var(--surface-muted); }
.gb-image-placeholder {
  padding: 2.5rem 1rem;
  text-align: center;
  color: var(--text-muted);
  background: #f0f0f0;
  border: 1px dashed #ccc;
}
.gb-code {
  width: 100%;
  min-height: 8rem;
  font-family: ui-monospace, monospace;
  font-size: 0.8125rem;
  padding: 0.75rem;
  border: 1px solid var(--surface-border);
  background: #1e1e1e;
  color: #e2e8f0;
  resize: vertical;
}
.gb-separator { border: 0; border-top: 1px solid #ccc; margin: 1.25rem 0; }
.gb-more {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-top: 1px dashed var(--surface-border);
  border-bottom: 1px dashed var(--surface-border);
  padding: 0.45rem;
}
.gb-appender {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.35rem 0 0 3rem;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
  padding: 0.5rem 0;
}
.gb-appender span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border: 1px solid var(--surface-border);
  border-radius: 2px;
  font-size: 1.1rem;
}
.gb-appender:hover { color: var(--text-primary); }
.gb-inserter-menu {
  position: absolute;
  z-index: 20;
  width: 17rem;
  max-height: 22rem;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--surface-border);
  border-radius: 2px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.16);
  padding: 0.5rem;
}
.gb-inserter-search {
  width: 100%;
  margin-bottom: 0.4rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--surface-border);
  border-radius: 2px;
  font: inherit;
  font-size: 0.875rem;
}
.gb-inserter-title {
  margin: 0 0 0.35rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.25rem 0.4rem;
}
.gb-inserter-empty {
  margin: 0;
  padding: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.gb-inserter-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0.5rem 0.5rem;
  border-radius: 2px;
  cursor: pointer;
  font: inherit;
  font-size: 0.875rem;
  color: var(--text-primary);
}
.gb-inserter-item:hover { background: #f0f0f0; }
.gb-inserter-item span {
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f0f0f0;
  color: #1e1e1e;
  font-weight: 700;
}
@media (max-width: 960px) {
  .blog-post-form.is-block-editor .blog-editor-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "title"
      "content"
      "settings"
      "actions";
  }
  .blog-post-form.is-block-editor .blog-post-settings { position: static; }
  .blog-post-form.is-block-editor .blog-title-input,
  .gb-header { padding-left: 0.5rem; padding-right: 0.5rem; }
  .gb-block { padding-left: 2.4rem; }
}

/* Public blog post page — centered column, left-aligned text */
.blog-post {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}
.blog-post--with-sidebar {
  max-width: 1040px;
}
.blog-post-cover {
  display: block;
  width: 100%;
  max-height: 22rem;
  object-fit: cover;
  border-radius: 1rem;
  margin: 0 0 1.75rem;
  background: var(--surface-muted);
}
.blog-post-layout {
  display: block;
}
.blog-post--with-sidebar .blog-post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 2rem;
  align-items: start;
}
.blog-post-main {
  min-width: 0;
  text-align: left;
}
.blog-post-header {
  margin-bottom: 1.5rem;
}
.blog-post-title {
  margin: 0 0 0.85rem;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  text-align: left;
}
.blog-post-body {
  margin-top: 0;
}
.blog-post-sidebar {
  position: sticky;
  top: 5rem;
}
.blog-post .ad-slot {
  margin-bottom: 1.5rem;
}
.blog-post .ad-slot:last-child {
  margin-bottom: 0;
  margin-top: 2rem;
}

.tox-tinymce { border-radius: 0.5rem !important; border-color: var(--surface-border) !important; }
.admin-body .tox-tinymce {
  border-radius: 0.75rem !important;
  overflow: hidden;
}
.admin-body .tox .tox-toolbar-overlord,
.admin-body .tox .tox-toolbar__primary {
  background: #f8fafc !important;
}
.admin-body .tox .tox-edit-area__iframe {
  background: #fff;
}

/* Tablet */
@media (max-width: 1024px) {
  .admin-menu-toggle { display: inline-flex; }
  .admin-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 70;
    background: rgba(15, 23, 42, 0.4);
    border: 0;
    padding: 0;
  }
  .admin-body.admin-nav-open .admin-sidebar-backdrop {
    display: block;
  }
  .admin-sidebar {
    position: fixed;
    z-index: 80;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(18.5rem, 88vw);
    margin: 0;
    max-height: none;
    height: 100%;
    border-radius: 0;
    border-left: 0;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
  }
  .admin-body.admin-nav-open .admin-sidebar {
    transform: translateX(0);
  }
  .admin-body.admin-nav-open {
    overflow: hidden;
  }
}

@media (max-width: 900px) {
  .site-header .inner { gap: 0.75rem; }
  .nav { gap: 1rem; }
  .home-dropzone-title { font-size: 1.625rem; }
}

/* Mobile */
@media (max-width: 768px) {
  .admin-topbar { margin: 0.75rem 0.75rem 0; padding: 0.75rem 0.9rem; }
  .admin-topbar-name { max-width: 8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .admin-main { padding: 1rem 0.75rem 1.5rem; }
  .dash-stat-grid,
  .dash-grid-2,
  .dash-grid-3 { grid-template-columns: 1fr; }
  .dash-hero { padding: 1.35rem 1.25rem; grid-template-columns: 1fr; }
  .dash-hero-aside { justify-content: flex-start; }
  .dash-panel { padding: 1rem; }
  .card { max-width: 100%; }
  .blog-post-form,
  .admin-dashboard { max-width: 100%; }

  :root { --site-header-h: 3.75rem; }
  .site-header .inner {
    height: 3.75rem;
    flex-wrap: nowrap;
  }
  .nav-toggle { display: inline-flex; }
  .site-nav-panel {
    display: none;
    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    right: 0;
    margin: 0;
    padding: 0.75rem 1rem 1rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    background: var(--header-bg);
    border-bottom: 1px solid var(--surface-border);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
    z-index: 60;
  }
  .site-header.nav-open .site-nav-panel {
    display: flex;
  }
  .site-nav-links,
  .site-nav-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    margin-left: 0;
    width: 100%;
  }
  .site-nav-links a {
    display: block;
    padding: 0.7rem 0.85rem;
    border-radius: 0.65rem;
    font-size: 0.9375rem;
    color: var(--text-primary);
  }
  .site-nav-links a:hover {
    background: var(--surface-muted);
    color: var(--color-brand-700);
  }
  .site-nav-actions {
    padding-top: 0.5rem;
    border-top: 1px solid var(--surface-border);
    gap: 0.5rem;
  }
  .site-nav-actions .btn {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
  .site-nav-email {
    max-width: none;
    padding: 0 0.25rem;
    font-size: 0.8125rem;
    white-space: normal;
    word-break: break-all;
  }
  .logo { font-size: 1.125rem; }
  body.nav-menu-open {
    overflow: hidden;
  }

  /* Full-bleed hero fills remaining viewport */
  .home-hero { margin-top: 0; }
  .home-dropzone { padding: clamp(1rem, 5vh, 2.5rem) 1rem; }
  .home-upload-stage-card { padding: 1.25rem 1rem; }
  .home-upload-preview { width: 7.5rem; }
  .home-dropzone-title { font-size: 1.375rem; }
  .home-dropzone-sub { font-size: 0.875rem; }
  .home-dropzone-icon svg { width: 48px; height: 48px; }

  .home-section-head h2 { font-size: 1.25rem; }
  .home-post-grid { grid-template-columns: 1fr; }

  /* Stack sidebar layouts (blog, etc.) */
  .content-layout { grid-template-columns: 1fr !important; }
  .blog-post--with-sidebar .blog-post-layout { grid-template-columns: 1fr; }
  .blog-post-sidebar { position: static; }
  .blog-post-cover { max-height: 16rem; border-radius: 0.75rem; }
  .blog-post-title { font-size: 1.625rem; }

  .content-body h1 { font-size: 1.5rem; }
  .content-body h2 { font-size: 1.3rem; }

  .table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .upload-zone { padding: 1.75rem 1rem; }
  .auth-card, .login-box { max-width: 100%; }
  .content-body img { height: auto; }
  .tox-tinymce { max-width: 100% !important; }
}

/* Small phones */
@media (max-width: 420px) {
  .container { padding: 0 0.85rem; }
  .btn { padding: 0.45rem 0.85rem; }
  .home-dropzone-title { font-size: 1.2rem; }
  .admin-topbar-user > div { display: none; }
  .admin-topbar-copy strong { font-size: 0.9375rem; }
}
