:root {
  --purple: #9d4edd;
  --purple-dark: #7c3aed;
  --pink: #f72585;
  --blue: #45b7d1;
  --green: #36c46f;
  --yellow: #ffd93d;
  --ink: #1f2937;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #fff;
}

.text-purple {
  color: var(--purple) !important;
}

.bg-purple {
  background: var(--purple) !important;
}

.fw-black {
  font-weight: 950 !important;
}

.site-navbar {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  box-shadow: 0 4px 18px rgba(31, 41, 55, 0.08);
}

.site-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.9rem;
  color: #fff;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  font-weight: 950;
}

.site-footer {
  background: #fff;
  border-top: 1px solid rgba(31, 41, 55, 0.08);
}

.screen {
  min-height: 100vh;
}

.splash-screen {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(1rem, 3vh, 1.9rem);
  overflow: hidden;
  min-height: 100vh;
  max-height: 100vh;
  padding-block: clamp(1.5rem, 4vh, 3rem);
  background: linear-gradient(135deg, #a855f7 0%, #f472b6 52%, #fde047 100%);
}

.gallery-screen {
  display: flex;
  flex-direction: column;
  background: linear-gradient(100deg, #eef5ff 0%, #faf5ff 55%, #fff0fb 100%);
}

.gallery-topbar {
  min-height: 7.9rem;
  padding: 1.75rem 2.25rem;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  border-bottom: 1px solid rgba(15, 23, 42, 0.04);
}

.gallery-title-wrap {
  gap: 1.45rem;
  min-width: 0;
}

.gallery-back-btn,
.gallery-settings-btn,
.gallery-brand-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 4rem;
  height: 4rem;
  border-radius: 1.2rem;
  text-decoration: none;
}

.gallery-back-btn {
  color: #9b18f3;
  background: #f3e8ff;
}

.gallery-back-btn:hover {
  color: #8b1cf6;
  background: #eadcff;
}

.gallery-back-btn svg,
.gallery-settings-btn svg,
.gallery-brand-tile svg {
  width: 2rem;
  height: 2rem;
}

.gallery-brand-tile {
  color: #fff;
  background: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
}

.gallery-page-title {
  color: #8b1cf6;
  font-size: clamp(2.25rem, 4vw, 3rem);
  line-height: 0.92;
  font-weight: 950;
}

.gallery-page-subtitle {
  margin-top: 0.3rem !important;
  color: #374151;
  font-size: 1.05rem;
  font-weight: 500;
}

.gallery-settings-btn {
  color: #4b5563;
  background: #f1f5f9;
}

.gallery-settings-btn:hover {
  color: #374151;
  background: #e5e7eb;
}

.gallery-category-bar {
  min-height: 7rem;
  display: flex;
  align-items: center;
  padding: 1.5rem 2.25rem;
  background: #f8fafc;
  border-bottom: 1px solid rgba(15, 23, 42, 0.03);
}

@media (max-width: 575.98px) {
  .gallery-topbar {
    min-height: 13.5rem;
    gap: 1rem;
    padding: 2rem 1rem 1.6rem;
    align-items: center !important;
    justify-content: center !important;
  }

  .gallery-title-wrap {
    width: auto;
    flex: 0 1 auto;
    gap: 1rem;
  }

  .gallery-back-btn,
  .gallery-settings-btn,
  .gallery-brand-tile {
    width: 3.9rem;
    height: 3.9rem;
    border-radius: 1.1rem;
  }

  .gallery-back-btn svg,
  .gallery-settings-btn svg,
  .gallery-brand-tile svg {
    width: 1.95rem;
    height: 1.95rem;
  }

  .gallery-page-title {
    max-width: 6.7rem;
    font-size: 2.35rem;
    line-height: 0.92;
    letter-spacing: 0;
  }

  .gallery-page-subtitle {
    max-width: 6.3rem;
    margin-top: 0.35rem !important;
    font-size: 1rem;
    line-height: 1.32;
    font-weight: 500;
  }

  .gallery-settings-btn {
    margin-left: 0.1rem;
  }

  .gallery-category-bar {
    min-height: 5.6rem;
    padding: 1rem 1.25rem;
  }

  .gallery-category-bar .scroll-row {
    gap: 0.65rem;
  }

  .gallery-category-bar + section {
    padding: 1rem !important;
  }
}

.color-screen {
  display: flex;
  flex-direction: column;
  background: linear-gradient(100deg, #faf5ff 0%, #fdf2f8 100%);
}

.color-workspace {
  position: relative;
  background: linear-gradient(100deg, #faf5ff 0%, #fdf2f8 100%);
  gap: 1rem !important;
  padding: 1.75rem !important;
}

.color-topbar {
  min-height: 6rem;
  padding: 1.25rem 1.75rem;
  background: #fff;
  box-shadow: 0 6px 22px rgba(15, 23, 42, 0.14);
  z-index: 5;
}

.color-back-btn,
.color-done-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  text-decoration: none;
  box-shadow: 0 7px 15px rgba(15, 23, 42, 0.16);
}

.color-back-btn {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #b548f4 0%, #a12cf1 100%);
}

.color-back-btn:hover {
  color: #fff;
  filter: brightness(1.03);
}

.color-back-btn svg {
  width: 1.65rem;
  height: 1.65rem;
}

.color-page-title {
  color: #8b1cf6;
  font-size: clamp(1.7rem, 3vw, 2rem);
  line-height: 1.2;
  font-weight: 950;
  padding-block: 0.12em;
}

.color-done-btn {
  min-width: 8rem;
  min-height: 3rem;
  gap: 0.55rem;
  border-radius: 999px;
  color: #fff;
  background: #00cf67;
  font-weight: 900;
}

.color-done-btn:hover {
  color: #fff;
  background: #00be5f;
}

.color-done-btn svg {
  width: 1.15rem;
  height: 1.15rem;
}

.admin-screen {
  background: linear-gradient(135deg, #4f46e5 0%, #9333ea 48%, #ec4899 100%);
}

.login-screen {
  min-height: 100vh;
  align-items: center;
  background: linear-gradient(135deg, #7c2cff 0%, #9b11f2 42%, #d91bb8 100%);
}

.soft-page {
  background: linear-gradient(135deg, #dbeafe 0%, #faf5ff 48%, #fce7f3 100%);
}

.admin-dashboard-screen {
  background: #f8fafc;
  color: #0f172a;
}

.admin-topbar {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.12);
}

.admin-title-group {
  min-width: 0;
}

.admin-brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  flex: 0 0 auto;
  border-radius: 1rem;
  color: #fff;
  background: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
}

.admin-brand-icon svg {
  width: 2rem;
  height: 2rem;
}

.admin-page-title {
  color: #8b1cf6;
  font-size: clamp(1.8rem, 3vw, 2rem);
  line-height: 1;
  font-weight: 950;
}

.admin-page-subtitle {
  color: #4b5563;
  font-size: 0.95rem;
  font-weight: 500;
}

/*.admin-dashboard-content {
  max-width: 1280px;
}*/

.admin-logout-btn,
.admin-upload-btn,
.dashboard-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 0;
  font-weight: 850;
  white-space: nowrap;
}

.admin-logout-btn {
    min-height: 2.5rem;
    padding: 0.65rem 1.05rem;
    border-radius: 0.85rem;
    color: #ef0000;
    background: #fee2e2;
    font-weight: 600;
}

.admin-logout-btn:hover {
  color: #dc0000;
  background: #fecaca;
}

.admin-logout-btn svg,
.admin-upload-btn svg,
.dashboard-action-btn svg {
  width: 1.15rem;
  height: 1.15rem;
}

.dashboard-stat-card {
  min-height: 8rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  border-radius: 0.9rem;
  padding: 1.5rem;
  color: #fff;
  box-shadow: 0 14px 24px rgba(15, 23, 42, 0.14);
}

.dashboard-stat-purple {
  background: linear-gradient(135deg, #a855f7 0%, #8b1cf6 100%);
}

.dashboard-stat-pink {
  background: linear-gradient(135deg, #ec4899 0%, #e00072 100%);
}

.dashboard-stat-blue {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

.dashboard-stat-label {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  font-weight: 900;
}

.dashboard-stat-value {
  display: block;
  font-size: 2.25rem;
  line-height: 1;
  font-weight: 950;
}

.dashboard-stat-icon {
  opacity: 0.9;
}

.dashboard-stat-icon svg {
  width: 2rem;
  height: 2rem;
}

.admin-upload-btn {
  min-height: 3.75rem;
  padding: 0.9rem 1.7rem;
  border-radius: 0.9rem;
  color: #fff;
  background: linear-gradient(90deg, #a855f7 0%, #ec4899 100%);
  box-shadow: 0 10px 22px rgba(236, 72, 153, 0.18);
}

.admin-upload-btn:hover {
  color: #fff;
  filter: brightness(1.02);
  transform: translateY(-1px);
}

.admin-section-title {
  color: #111827;
  font-size: 1.55rem;
  line-height: 1.1;
  font-weight: 950;
}

.dashboard-page-list {
  padding-bottom: 2rem;
}

.dashboard-page-card {
  min-height: 11rem;
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.05rem;
  border-radius: 0.95rem;
  padding: 1.5rem;
  background: #fff;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
}

/* Inline form validation */
.field-error {
  margin: 0.35rem 0 0;
  color: #dc2626;
  font-size: 0.85rem;
  font-weight: 700;
}

.field-invalid,
.field-invalid:focus {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 0.18rem rgba(220, 38, 38, 0.18) !important;
}

.char-counter {
  display: block;
  margin-top: 0.3rem;
  color: #94a3b8;
  font-size: 0.78rem;
  font-weight: 600;
  text-align: right;
}

.char-counter-over {
  color: #dc2626;
}

.char-counter-hint {
  display: block;
  margin-top: 0.3rem;
  color: #94a3b8;
  font-size: 0.78rem;
  font-weight: 600;
}

/* Admins panel */
.admin-admins-card {
  padding: 1.5rem;
  border-radius: 0.95rem;
  background: #fff;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
}

.admin-add-admin-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: start;
}

.admin-add-admin-fields .admin-modal-input {
  flex: 1 1 14rem;
  min-width: 0;
}

.admin-add-admin-fields .admin-modal-upload {
  flex: 0 0 auto;
}

.admin-list {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.admin-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.1rem;
  border-radius: 0.75rem;
  background: #f8fafc;
}

.admin-list-email {
  font-weight: 800;
  color: #1f2937;
  word-break: break-all;
}

.admin-list-actions {
  display: flex;
  gap: 0.5rem;
  flex: 0 0 auto;
}

/* ===== Admin portal shell (sidebar + content) ===== */
.admin-portal {
  display: flex;
  min-height: 100vh;
  background: #f8fafc;
  color: #0f172a;
}

.admin-sidebar {
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  width: 16rem;
  flex: 0 0 16rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1.5rem 1rem;
  background: #fff;
  border-right: 1px solid #e5e7eb;
}

.admin-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0.6rem 1.2rem;
}

.admin-sidebar-brand strong {
  display: block;
  font-weight: 950;
  color: #8b1cf6;
  line-height: 1;
}

.admin-sidebar-brand span {
  display: block;
  font-size: 0.78rem;
  color: #64748b;
  font-weight: 600;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 0;
  border-radius: 0.7rem;
  color: #475569;
  background: transparent;
  font-weight: 800;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.admin-nav-link svg {
  width: 1.25rem;
  height: 1.25rem;
  flex: 0 0 auto;
}

.admin-nav-link:hover {
  background: #f3e8ff;
  color: #7c3aed;
}

.admin-nav-link.active {
  background: linear-gradient(100deg, #b548f4, #9b18f3);
  color: #fff;
}

.admin-sidebar-logout {
  margin-top: auto;
}

.admin-nav-logout:hover {
  background: #fee2e2;
  color: #dc2626;
}

.admin-portal-main {
  flex: 1 1 auto;
  min-width: 0;
  padding: 2rem 2.5rem;
}

.admin-portal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
}

.admin-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

.admin-filter-bar:empty {
  display: none;
}

.admin-quicklink {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.4rem;
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
  text-decoration: none;
  color: #0f172a;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.admin-quicklink:hover {
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.14);
  transform: translateY(-2px);
  color: #0f172a;
}

.admin-quicklink-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  flex: 0 0 auto;
  border-radius: 0.85rem;
  color: #fff;
  background: linear-gradient(135deg, #a855f7, #ec4899);
}

.admin-quicklink-icon svg {
  width: 1.5rem;
  height: 1.5rem;
}

.admin-quicklink-copy strong {
  display: block;
  font-weight: 900;
}

.admin-quicklink-copy span {
  color: #64748b;
  font-size: 0.9rem;
  font-weight: 600;
}

@media (max-width: 991.98px) {
  .admin-portal {
    flex-direction: column;
  }

  .admin-sidebar {
    position: static;
    height: auto;
    width: auto;
    flex: none;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.3rem;
    border-right: 0;
    border-bottom: 1px solid #e5e7eb;
  }

  .admin-sidebar-brand {
    padding: 0.4rem 0.6rem;
  }

  .admin-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .admin-sidebar-logout {
    margin-top: 0;
    margin-left: auto;
  }

  .admin-portal-main {
    padding: 1.5rem 1.25rem;
  }
}

.dashboard-page-clickable {
  cursor: pointer;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.dashboard-page-clickable:hover {
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.14);
  transform: translateY(-2px);
}

.dashboard-page-preview {
  width: 8rem;
  height: 8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 2px solid #f1f5f9;
  border-radius: 0.8rem;
  background: #fff;
}

.dashboard-page-preview svg {
  width: 92%;
  height: 92%;
}

.dashboard-page-copy {
  min-width: 0;
}

.dashboard-page-copy h3 {
  margin: 0 0 0.25rem;
  color: #0f172a;
  font-size: 1.2rem;
  line-height: 1.15;
  font-weight: 950;
}

.dashboard-page-category {
  margin: 0 0 0.55rem;
  color: #8b1cf6;
  font-size: 0.92rem;
  font-weight: 850;
}

.dashboard-page-caption {
  margin: 0;
  color: #374151;
  font-size: 0.92rem;
  font-style: italic;
}

.dashboard-page-actions {
  display: flex;
  gap: 0.75rem;
}

.dashboard-action-btn {
  min-height: 2.5rem;
  padding: 0.55rem 1rem;
  border-radius: 0.8rem;
  font-weight:600;
}

.dashboard-edit-btn {
  color: #0b66ff;
  background: #dbeafe;
}

.dashboard-edit-btn:hover {
  color: #084fd6;
  background: #bfdbfe;
}

.dashboard-delete-btn {
  color: #ef0000;
  background: #fee2e2;
}

.dashboard-delete-btn:hover {
  color: #dc0000;
  background: #fecaca;
}

.admin-upload-modal {
  --bs-modal-width: 448px;
  --bs-modal-border-radius: 1.45rem;
}

.admin-upload-modal .modal-backdrop,
.modal-backdrop.show {
  opacity: 0.55;
}

.admin-upload-modal .modal-dialog {
  max-width: 448px;
}

.admin-upload-modal .modal-content {
  overflow: hidden;
  border: 0;
  border-radius: 1.45rem;
  background: #fff;
  box-shadow: 0 22px 65px rgba(15, 23, 42, 0.28);
}

.admin-upload-modal .modal-header {
  min-height: 5.5rem;
  align-items: center;
  border: 0;
  padding: 1.45rem 1.5rem;
  color: #fff;
  background: linear-gradient(100deg, #a855f7 0%, #ec4899 100%);
}

.admin-upload-modal .modal-title {
  margin: 0;
  font-size: 1.55rem;
  line-height: 1;
  font-weight: 950;
}

.admin-upload-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  border: 0;
  border-radius: 0.9rem;
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
}

.admin-upload-close:hover {
  background: rgba(255, 255, 255, 0.28);
}

.admin-upload-close svg {
  width: 1.25rem;
  height: 1.25rem;
}

.admin-upload-modal .modal-body {
  padding: 1.6rem 1.5rem 1.5rem;
}

.admin-modal-label {
  margin-bottom: 0.55rem;
  color: #374151;
  font-size: 0.9rem;
  font-weight: 850;
}

.admin-upload-dropzone {
  min-height: 7.8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border: 2px dashed #cbd5e1;
  border-radius: 0.9rem;
  color: #4b5563;
  background: #fff;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}

.admin-upload-dropzone:hover {
  border-color: #a855f7;
  background: #faf5ff;
}

.admin-upload-dropzone svg {
  width: 2.75rem;
  height: 2.75rem;
  color: #94a3b8;
}

.admin-upload-dropzone span {
  font-size: 0.95rem;
  font-weight: 600;
}

.admin-upload-dropzone small {
  color: #8491a6;
  font-size: 0.78rem;
  font-weight: 700;
}

.admin-modal-input {
  min-height: 3.15rem;
  border: 2px solid #e1e5ea;
  border-radius: 0.9rem;
  color: #111827;
  box-shadow: none !important;
}

.admin-modal-input:focus {
  border-color: #c084fc;
}

.admin-modal-textarea {
  min-height: 6.25rem;
  resize: none;
}

.admin-modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.admin-modal-cancel,
.admin-modal-upload {
  min-height: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border: 0;
  border-radius: 0.9rem;
  font-weight: 900;
}

.admin-modal-cancel {
  color: #374151;
  background: #f3f4f6;
}

.admin-modal-cancel:hover {
  color: #111827;
  background: #e5e7eb;
}

.admin-modal-upload {
  color: #fff;
  background: linear-gradient(90deg, #a855f7 0%, #ec4899 100%);
}

.admin-modal-upload:hover {
  color: #fff;
  filter: brightness(1.02);
}

.admin-modal-upload svg {
  width: 1.15rem;
  height: 1.15rem;
}

.logo-orb {
  width: clamp(6.5rem, 15vw, 10rem);
  height: clamp(6.5rem, 15vw, 10rem);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 16px 42px rgba(31, 41, 55, 0.22);
  margin-bottom: clamp(1.1rem, 2.4vh, 1.8rem);
}

.home-logo-text {
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  line-height: 1;
  font-weight: 850;
}

.hero-title {
  margin: 0 0 clamp(0.8rem, 1.8vh, 1.2rem);
  font-size: clamp(3rem, 7.5vw, 5.7rem);
  line-height: 0.95;
  font-weight: 850;
  color: #fff;
  text-shadow: 0 6px 16px rgba(80, 23, 112, 0.32);
}

.hero-copy {
  margin: 0 0 clamp(0.45rem, 1.2vh, 0.8rem);
  color: #fff;
  font-size: clamp(1.15rem, 2.8vw, 2rem);
  font-weight: 700;
  text-shadow: 0 4px 12px rgba(80, 23, 112, 0.25);
}

.hero-age {
  margin: 0 0 clamp(1.2rem, 2.6vh, 2rem);
  color: #fff;
  font-size: clamp(1rem, 2vw, 1.35rem);
  line-height: 1.2;
  font-weight: 700;
}

.btn-pill-xl {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: clamp(0.8rem, 1.8vw, 1.1rem) clamp(2rem, 4.5vw, 3.75rem);
  color: #7e22ce;
  background: #fff;
  box-shadow: 0 12px 32px rgba(80, 23, 112, 0.24);
  font-size: clamp(1.45rem, 3.4vw, 2.45rem);
  font-weight: 850;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.btn-pill-xl:hover {
  color: #7e22ce;
  transform: scale(1.04);
  box-shadow: 0 24px 55px rgba(80, 23, 112, 0.34);
}

.home-admin-login {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.5rem 1.15rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.4);
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.home-admin-login:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.04);
}

.edit-page-preview {
  width: 9rem;
  height: 9rem;
  border-radius: 0.85rem;
  background: #f1f3f5;
  border: 1px solid #e5e7eb;
  padding: 0.5rem;
}

.float-shape,
.star,
.color-dot {
  position: absolute;
  pointer-events: none;
}

.float-shape {
  width: clamp(3rem, 6vw, 5rem);
  height: clamp(3rem, 6vw, 5rem);
  border-radius: 999px;
  border: 0.5rem solid rgba(255, 255, 255, 0.32);
  animation: floaty 4s ease-in-out infinite;
}

.star {
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.34);
  animation: popspin 3s ease-in-out infinite;
}

.bounce-word {
  display: inline-block;
  animation: bounceWord 1.5s ease-in-out infinite;
}

.bounce-word:nth-child(2) {
  animation-delay: 0.2s;
}

.color-dots {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 0.65rem;
}

.color-dot {
  position: static;
  width: clamp(1rem, 2.2vw, 1.55rem);
  height: clamp(1rem, 2.2vw, 1.55rem);
  border-radius: 999px;
  box-shadow: 0 6px 14px rgba(31, 41, 55, 0.18);
  animation: dotBounce 1.5s ease-in-out infinite;
}

.app-header {
  background: #fff;
  box-shadow: 0 4px 15px rgba(31, 41, 55, 0.08);
}

.brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(3.25rem, 6vw, 5rem);
  height: clamp(3.25rem, 6vw, 5rem);
  border-radius: 1rem;
  color: #fff;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  font-size: 1.8rem;
  font-weight: 950;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 1rem;
  width: clamp(3rem, 6vw, 4.5rem);
  height: clamp(3rem, 6vw, 4.5rem);
  background: #f3e8ff;
  color: #7e22ce;
  text-decoration: none;
  transition: transform 140ms ease, background 140ms ease;
}

.icon-button:hover {
  color: #7e22ce;
  transform: scale(1.04);
  background: #e9d5ff;
}

.category-bar {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
}

.scroll-row {
  display: flex;
  gap: 0.8rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.scroll-row::-webkit-scrollbar {
  display: none;
}

.category-btn {
  white-space: nowrap;
  border: 0;
  border-radius: 999px;
  min-width: 9.8rem;
  min-height: 3.75rem;
  padding: 0.9rem 1.9rem;
  color: #374151;
  background: #fff;
  /*box-shadow: 0 6px 14px rgba(15, 23, 42, 0.12);*/
  font-size: 1.15rem;
  font-weight: 900;
}

.category-btn.active {
  color: #fff;
  background: linear-gradient(100deg, #a855f7 0%, #ec4899 100%);
  /*box-shadow: 0 8px 18px rgba(168, 85, 247, 0.22);*/
  transform: none;
}

@media (max-width: 575.98px) {
  .category-btn {
    min-width: auto;
    min-height: 3.15rem;
    padding: 0.75rem 1.35rem;
    font-size: 0.98rem;
    font-weight: 800;
    box-shadow: 0 5px 12px rgba(15, 23, 42, 0.12);
  }
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

@media (min-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.4rem;
  }
}

@media (min-width: 992px) {
  .gallery-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1400px) {
  .gallery-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

.page-card {
  overflow: hidden;
  border: 0;
  border-radius: 1.5rem;
  background: #fff;
  box-shadow: 0 10px 26px rgba(31, 41, 55, 0.12);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.page-card:hover {
  color: inherit;
  transform: scale(1.035);
  box-shadow: 0 22px 42px rgba(31, 41, 55, 0.16);
}

.line-preview {
  aspect-ratio: 1 / 1;
  background: #fff;
}

.line-preview svg {
  width: 100%;
  height: 100%;
}

.tool-sidebar {
  flex: 0 0 18.8rem;
  width: 18.8rem;
  min-width: 18.8rem;
  border-radius: 1.45rem;
  background: #fff;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.09);
}

.tool-sidebar h2 {
  margin-bottom: 0.8rem !important;
  color: #172033;
  font-size: 1.2rem;
  line-height: 1.1;
  font-weight: 950;
}

.tool-btn {
  width: 100%;
  min-width: 0;
  min-height: 3.55rem;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.95rem;
  border: 0;
  border-radius: 0.9rem;
  padding: 0.75rem 1rem;
  color: #4b5563;
  background: #f3f4f6;
  font-weight: 900;
  box-shadow: 0 5px 11px rgba(15, 23, 42, 0.12);
}

.tool-btn.active {
  color: #fff;
  background: linear-gradient(100deg, #b548f4 0%, #9b18f3 100%);
  box-shadow: 0 8px 18px rgba(168, 85, 247, 0.28);
  transform: none;
}

/* Color Over toggle: distinct dashed outline + an ON/OFF pill so it reads as a switch,
   not just another tool button. */
.tool-toggle {
  border: 2px dashed #d1b3f5;
}

.tool-toggle.active {
  border-color: transparent;
}

.tool-toggle-state {
  margin-left: auto;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  color: #9b18f3;
  background: #f3e8ff;
}

.tool-toggle.active .tool-toggle-state {
  color: #fff;
  background: rgba(255, 255, 255, 0.28);
}

.tool-btn-icon {
  display: inline-flex;
  width: 1.9rem;
  height: 1.9rem;
  flex: 0 0 auto;
}

.tool-btn-icon svg {
  width: 100%;
  height: 100%;
}

.swatch {
  width: 2.8rem;
  height: 2.8rem;
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  box-shadow: 0 6px 12px rgba(15, 23, 42, 0.14);
  touch-action: manipulation; /* remove the tap delay so one tap selects a colour */
}

.swatch.active {
  outline: 4px solid var(--purple);
  outline-offset: 2px;
  transform: none;
}

.canvas-wrap {
  position: relative;
  min-width: 0;
  min-height: 18rem;
  border-radius: 1.45rem;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.09);
}

.canvas-stage {
  position: relative;
  width: 100%;
  min-height: 0;
  padding: 1rem;
  overflow: hidden;
}

#colorCanvas {
  width: 100%;
  height: 100%;
  max-height: 100%;
  touch-action: none;
  cursor: crosshair;
  will-change: transform;
}

/* Zoom controls (bottom-right of the canvas). */
.zoom-control {
  position: absolute;
  bottom: 1rem;
  right: 1.45rem;
  z-index: 4;
  display: flex;
  gap: 0.4rem;
  padding: 0.35rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.16);
  backdrop-filter: blur(6px);
}

.zoom-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  color: #6b21a8;
  background: #f3e8ff;
  cursor: pointer;
}

.zoom-btn:hover {
  background: #eadcff;
}

.zoom-btn svg {
  width: 1.3rem;
  height: 1.3rem;
}

.zoom-reset {
  color: #64748b;
  background: #f1f5f9;
}

.zoom-reset:hover {
  background: #e5e7eb;
}

/* Mobile brush-size row (the desktop sidebar slider is hidden on phones). */
.mobile-brush-label,
.mobile-brush-value {
  font-weight: 800;
  color: #6b7280;
  font-size: 0.85rem;
  white-space: nowrap;
}

.mobile-brush .form-range {
  min-width: 0;
}

.canvas-error {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  padding: 1.5rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.97);
}

.canvas-error svg {
  width: 3rem;
  height: 3rem;
  color: #ec4899;
}

.canvas-error p {
  max-width: 28rem;
  margin: 0;
  font-weight: 800;
  color: #475569;
}

.canvas-error-btn {
  font-weight: 800;
  color: #fff;
  background: linear-gradient(90deg, #b548f4 0%, #ec4899 100%);
  border-radius: 0.9rem;
  padding: 0.6rem 1.4rem;
}

.canvas-caption {
  position: relative;
  z-index: 5;
  flex: 0 0 auto;
  width: 100%;
  max-height: 8rem;
  overflow-y: auto;
  padding: 1rem clamp(1rem, 4vw, 2rem);
  color: #fff;
  text-align: center;
  font-weight: 950;
  line-height: 1.4;
  overflow-wrap: anywhere;
  background: linear-gradient(90deg, #b548f4 0%, #ec4899 100%);
}

.color-action-rail {
  position: absolute;
  top: 1rem;
  right: 1.45rem;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  padding-top: 0;
}

.color-floating-action {
  width: 3.45rem;
  height: 3.45rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  box-shadow: 0 9px 18px rgba(15, 23, 42, 0.14);
}

.color-floating-action svg {
  width: 1.3rem;
  height: 1.3rem;
}

.color-floating-light {
  color: #9b18f3;
  background: #fff;
}

.color-floating-muted {
  color: #c084fc;
  opacity: 0.72;
}

.color-floating-danger {
  color: #fff;
  background: #ff2d3f;
}

#brushSize {
  accent-color: #0d8be8;
}

#brushSizeLabel {
  display: inline-block;
  margin-top: 0.6rem;
}

#undoBtn,
#redoBtn,
#clearBtn {
  min-height: 3.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  border: 0;
  border-radius: 0.75rem !important;
  font-weight: 900;
}

#undoBtn {
  color: #0969ff !important;
  background: #dbeafe !important;
}

#redoBtn {
  color: #bcd3ff !important;
  background: #f1f5f9 !important;
}

#clearBtn {
  color: #fff !important;
  background: #ff2d3f !important;
}

#undoBtn svg,
#redoBtn svg,
#clearBtn svg {
  width: 1.25rem;
  height: 1.25rem;
}

.mobile-toolbar {
  background: rgba(255, 255, 255, 0.95);
  border-top: 2px solid #f3e8ff;
  box-shadow: 0 -12px 30px rgba(31, 41, 55, 0.12);
  overflow: hidden;
}

.done-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.58);
}

.done-panel {
  width: min(100%, 420px);
  border-radius: 1.4rem;
  padding: 2.9rem 2.75rem 2.65rem;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
}

.done-check {
  width: 7.5rem;
  height: 7.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.55rem;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #b548f4 0%, #ec4899 100%);
}

.done-check svg {
  width: 4.25rem;
  height: 4.25rem;
}

.done-title {
  margin: 0 0 0.35rem;
  color: #1f2937;
  font-size: 2.05rem;
  line-height: 1.1;
  font-weight: 950;
}

.done-copy {
  margin: 0 0 1.75rem;
  color: #4b5563;
  font-size: 1.05rem;
  line-height: 1.35;
  font-weight: 750;
}

.done-action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
  margin-bottom: 0.9rem;
}

.done-save-btn,
.done-share-btn,
.done-another-btn,
.done-keep-btn {
  min-height: 3.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border: 0;
  border-radius: 0.8rem;
  font-weight: 900;
}

.done-save-btn {
  color: #fff;
  background: #2f7df6;
  box-shadow: 0 9px 16px rgba(47, 125, 246, 0.22);
}

.done-share-btn {
  color: #fff;
  background: #00c95f;
  box-shadow: 0 9px 16px rgba(0, 201, 95, 0.2);
}

.done-save-btn:hover,
.done-share-btn:hover,
.done-another-btn:hover {
  color: #fff;
  filter: brightness(1.03);
}

.done-save-btn svg,
.done-share-btn svg {
  width: 1.15rem;
  height: 1.15rem;
}

.done-another-btn {
  width: 100%;
  min-height: 4rem;
  margin-bottom: 1rem;
  color: #fff;
  background: linear-gradient(90deg, #b548f4 0%, #ec4899 100%);
  font-size: 1.35rem;
  text-decoration: none;
}

.done-keep-btn {
  width: 100%;
  color: #334155;
  background: #f3f4f6;
  font-weight: 650;
}

.done-keep-btn:hover {
  color: #1f2937;
  background: #e5e7eb;
}

.admin-card,
.content-card {
  overflow: hidden;
  border: 0;
  border-radius: 1.5rem;
  background: #fff;
  box-shadow: 0 22px 55px rgba(31, 41, 55, 0.16);
}

.login-shell {
  width: min(100%, 31rem);
}

.login-back {
  color: rgba(255, 255, 255, 0.86);
  text-decoration: none;
  font-size: 1.05rem;
  font-weight: 800;
}

.login-back:hover {
  color: #fff;
}

.login-card {
  overflow: hidden;
  border-radius: 1.55rem;
  background: #fff;
  box-shadow: 0 28px 75px rgba(49, 0, 83, 0.22);
}

.login-card-header {
  padding: 2.15rem 2rem 2.35rem;
  color: #fff;
  text-align: center;
  background: linear-gradient(135deg, #b648f0 0%, #f23296 100%);
}

.shield-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4.25rem;
  height: 4.25rem;
  margin-bottom: 1.25rem;
  border-radius: 999px;
  background: #fff;
  color: #a855f7;
}

.shield-badge svg {
  width: 2.35rem;
  height: 2.35rem;
}

.login-card-title {
  margin: 0 0 0.45rem;
  font-size: 1.8rem;
  line-height: 1.1;
  font-weight: 950;
}

.login-card-subtitle {
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 1.02rem;
  font-weight: 500;
}

.login-card-body {
  padding: 2rem 1.75rem 1.75rem;
}

.login-label {
  margin-bottom: 0.55rem;
  color: #374151;
  font-size: 0.92rem;
  font-weight: 850;
}

.login-input {
  min-height: 3.45rem;
  border: 2px solid #e1e5ea;
  border-radius: 0.9rem;
  color: #374151;
  font-size: 1rem;
  box-shadow: none !important;
}

.login-input:focus {
  border-color: #c084fc;
}

.password-wrap {
  position: relative;
}

.password-wrap .login-input {
  padding-right: 3rem;
}

.password-lock {
  position: absolute;
  top: 50%;
  right: 0.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: 0.5rem;
  color: #9ca3af;
  background: transparent;
  transform: translateY(-50%);
  cursor: pointer;
}

.password-toggle:hover {
  color: #6b7280;
  background: #f1f5f9;
}

.password-icon {
  width: 1.25rem;
  height: 1.25rem;
}

.login-submit {
  min-height: 3.65rem;
  display:flex;
  align-items:center;
  justify-content:center;
  border: 0;
  border-radius: 0.9rem;
  color: #fff;
  background: linear-gradient(90deg, #b342f5 0%, #f23296 100%);
  font-size: 1.03rem;
  font-weight: 950;
  box-shadow: 0 12px 26px rgba(206, 48, 179, 0.2);
}

.login-submit:hover {
  color: #fff;
  filter: brightness(1.02);
}

.demo-credentials {
  border: 2px solid #acd4ff;
  border-radius: 0.9rem;
  background: #eff6ff;
  color: #1d4ed8;
  text-align: center;
}

.demo-credentials strong {
  display: block;
  margin-bottom: 0.55rem;
  font-size: 0.9rem;
}

.demo-credentials code {
  color: #2563eb;
  font-size: 0.78rem;
}

.gradient-title {
  background: linear-gradient(90deg, var(--purple), var(--pink));
  color: #fff;
}

.stat-card {
  border-radius: 1.25rem;
  padding: 1.5rem;
  color: #fff;
  box-shadow: 0 14px 32px rgba(31, 41, 55, 0.12);
}

.stat-purple {
  background: linear-gradient(135deg, #a855f7, #7c3aed);
}

.stat-pink {
  background: linear-gradient(135deg, #ec4899, #db2777);
}

.stat-blue {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.modal-panel {
  width: min(100%, 30rem);
  overflow: hidden;
  border-radius: 1.5rem;
  background: #fff;
  box-shadow: 0 22px 55px rgba(31, 41, 55, 0.22);
}

.hidden {
  display: none !important;
}

.w-md-auto {
  width: 100%;
}

@media (min-width: 768px) {
  .w-md-auto {
    width: auto !important;
  }
}

@keyframes floaty {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-1rem) rotate(9deg);
  }
}

@keyframes popspin {
  0%,
  100% {
    transform: scale(0) rotate(0deg);
    opacity: 0;
  }
  50% {
    transform: scale(1) rotate(180deg);
    opacity: 1;
  }
}

@keyframes bounceWord {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-0.45rem);
  }
}

@keyframes dotBounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-0.9rem);
  }
}

@media (max-width: 991.98px) {
  .color-screen {
    min-height: 100dvh;
  }

  .color-workspace {
    padding: clamp(0.75rem, 2.6vw, 1.25rem) !important;
  }

  .canvas-wrap {
    min-height: 0;
    flex: 1 1 auto;
  }

  #mobileTools {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(min(8.25rem, 100%), 1fr));
    gap: 0.65rem !important;
    justify-content: stretch !important;
    margin-inline: auto;
    max-width: 42rem;
  }

  .mobile-toolbar .tool-btn {
    width: 100%;
    min-width: 0;
    min-height: 3.75rem;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.6rem 0.7rem;
    border-radius: 0.85rem;
    font-size: 0.9rem;
    line-height: 1.05;
    text-align: center;
    box-shadow: 0 5px 14px rgba(15, 23, 42, 0.1);
  }

  .mobile-toolbar .tool-btn-icon {
    width: 1.65rem;
    height: 1.65rem;
  }

  .mobile-toolbar .tool-toggle-state {
    margin-left: 0;
    padding: 0.12rem 0.45rem;
    font-size: 0.72rem;
  }

  #mobileSwatches {
    max-width: 100%;
    padding-inline: 0.15rem;
    scroll-padding-inline: 0.75rem;
  }

  .swatch {
    width: 3.1rem;
    height: 3.1rem;
  }

  .dashboard-page-card {
    grid-template-columns: 6.25rem minmax(0, 1fr);
  }

  .dashboard-page-preview {
    width: 6.25rem;
    height: 6.25rem;
  }

  .dashboard-page-actions {
    grid-column: 1 / -1;
    width: 100%;
  }

  .dashboard-action-btn {
    flex: 1 1 0;
  }
}

@media (max-width: 575.98px) {
  .color-topbar {
    min-height: auto;
    padding: 0.75rem 0.85rem;
  }

  .color-page-title {
    font-size: 1.05rem;
  }

  .color-done-btn {
    min-height: 2.65rem;
    padding-inline: 0.85rem;
  }

  .mobile-toolbar {
    padding: 0.75rem 0.8rem 0.85rem !important;
  }

  #mobileTools {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mobile-toolbar .tool-btn {
    min-height: 3.35rem;
    padding: 0.5rem 0.55rem;
    font-size: 0.82rem;
  }

  .mobile-toolbar .tool-btn-icon {
    width: 1.45rem;
    height: 1.45rem;
  }

  .swatch {
    width: 2.75rem;
    height: 2.75rem;
  }

  .admin-topbar .container-xl {
    align-items: flex-start !important;
    gap: 1rem;
  }

  .admin-brand-icon {
    width: 3rem;
    height: 3rem;
  }

  .admin-page-title {
    font-size: 1.45rem;
  }

  .admin-logout-btn {
    padding: 0.55rem 0.8rem;
  }

  .dashboard-page-card {
    grid-template-columns: 1fr;
  }
}
