:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-soft: #f7f7f7;
  --text: #171717;
  --muted: #737373;
  --line: #e5e5e5;
  --accent: #111827;
  --accent-hover: #030712;
  --danger: #dc2626;
  --radius: 8px;
  --shadow: 0 8px 24px rgba(17, 24, 39, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
.upload-btn,
.download,
.home-primary-btn,
.home-secondary-btn,
.home-signup-btn {
  min-height: 40px;
  border: 1px solid transparent;
  background: var(--accent);
  color: #ffffff;
  padding: 10px 16px;
  border-radius: var(--radius);
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

button:hover,
.upload-btn:hover,
.download:hover,
.home-primary-btn:hover {
  background: var(--accent-hover);
}

button.secondary,
.home-secondary-btn {
  background: #ffffff;
  color: var(--text);
  border-color: var(--line);
}

button.secondary:hover,
.home-secondary-btn:hover {
  background: var(--surface-soft);
}

button.active,
.favorite-btn.active {
  background: var(--accent);
  color: #ffffff;
}

.danger-btn {
  background: var(--danger) !important;
  color: #ffffff !important;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: 32px;
  line-height: 1.12;
  letter-spacing: 0;
}

h2 {
  font-size: 20px;
  line-height: 1.2;
}

h3 {
  font-size: 16px;
  line-height: 1.35;
}

.muted {
  color: var(--muted);
}

label {
  display: block;
  margin: 0 0 6px;
  font-weight: 650;
}

input,
textarea,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  border-radius: var(--radius);
  padding: 10px 12px;
  outline: none;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #c7c7c7;
  box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.08);
}

textarea {
  min-height: 92px;
  resize: vertical;
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 10px 14px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.check-row input,
.select-file input,
.manager-file-check {
  width: 16px;
  height: 16px;
  min-height: 16px;
}

.empty-state {
  min-height: 150px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: #ffffff;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 28px;
}

.site-logo {
  height: 38px;
  width: auto;
}

/* Public gallery */
.public-gallery-page {
  background: #ffffff;
}

.public-topbar {
  height: 70px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 28px;
  padding: 0 clamp(20px, 4vw, 48px);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(14px);
}

.public-brand,
.dashboard-logo {
  color: var(--text);
  font-size: 24px;
  font-weight: 850;
  text-decoration: none;
}

.public-nav,
.public-actions,
.gallery-toolbar,
.proofing-summary,
.selection-actions,
.dashboard-filters,
.actions,
.gallery-manager-actions,
.settings-actions,
.copy-modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.public-actions {
  justify-content: flex-end;
}

.public-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: linear-gradient(135deg, #d9c4a7, #4b3a2b);
  border: 1px solid var(--line);
}

.public-nav a,
.public-nav button {
  min-height: auto;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-weight: 650;
  text-decoration: none;
}

.gallery-hero {
  --gallery-cover: linear-gradient(120deg, #525252, #171717);
  min-height: 300px;
  display: flex;
  align-items: flex-end;
  padding: 54px clamp(48px, 5vw, 64px);
  background-image: linear-gradient(90deg, rgba(0, 0, 0, 0.74), rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0.08)), var(--gallery-cover);
  background-size: cover;
  background-position: center;
}

.gallery-hero-content {
  max-width: 760px;
  color: #ffffff;
}

.gallery-hero h1 {
  margin-bottom: 10px;
  font-size: clamp(34px, 4vw, 44px);
  color: #ffffff;
}

.gallery-hero p {
  color: rgba(255, 255, 255, 0.86);
}

.gallery-notes {
  max-width: 680px;
  line-height: 1.55;
}

.proofing-summary {
  margin-top: 24px;
}

.proofing-summary span {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 13px;
  font-weight: 750;
  backdrop-filter: blur(12px);
}

.gallery-shell {
  max-width: 100%;
  margin: 0 auto 86px;
  padding: 22px clamp(48px, 5vw, 64px) 86px;
}

.gallery-toolbar {
  margin-bottom: 22px;
}

.toolbar-spacer {
  flex: 1;
}

.gallery-toolbar .search-input {
  max-width: 280px;
}

.gallery-toolbar .select-input {
  max-width: 170px;
}

.gallery-meta {
  display: none;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.gallery-photo-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: transparent;
  border: 0;
  border-radius: var(--radius);
  box-shadow: none;
}

.file-thumb {
  width: 100%;
  aspect-ratio: 1.48 / 1;
  min-height: 196px;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-soft);
  display: block;
}

.file-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 0.22s ease, filter 0.22s ease;
}

.gallery-photo-card:hover .file-thumb img {
  transform: scale(1.035);
  filter: brightness(0.92);
}

.file-type,
.photo-overlay,
.photo-select {
  position: absolute;
  z-index: 3;
}

.file-type {
  left: 10px;
  bottom: 10px;
  color: #ffffff;
  background: rgba(17, 24, 39, 0.58);
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 11px;
  font-weight: 800;
  text-transform: capitalize;
}

.photo-overlay {
  right: 10px;
  top: 10px;
  display: flex;
  gap: 8px;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.gallery-photo-card:hover .photo-overlay,
.photo-overlay:focus-within {
  opacity: 1;
  transform: translateY(0);
}

.icon-btn,
.favorite-btn {
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  background: rgba(255, 255, 255, 0.90);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.photo-select {
  left: 10px;
  top: 10px;
  display: none;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 10px;
  margin: 0;
  color: var(--text);
  background: rgba(255, 255, 255, 0.92);
  border-radius: var(--radius);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.photo-select.visible {
  display: inline-flex;
}

.file-info {
  display: none;
}

.selection-bar {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 50;
  width: min(1120px, calc(100vw - 40px));
  min-height: 58px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 16px 38px rgba(17, 24, 39, 0.16);
  backdrop-filter: blur(16px);
}

.selection-bar[hidden] {
  display: none;
}

/* Dashboard */
.dashboard-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  background: var(--bg);
}

.dashboard-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 24px 18px;
  background: #ffffff;
  border-right: 1px solid var(--line);
}

.sidebar-nav {
  display: grid;
  gap: 6px;
}

.sidebar-nav a {
  display: flex;
  min-height: 40px;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  color: var(--text);
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 650;
}

.sidebar-nav a::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 1.8px solid currentColor;
  border-radius: 4px;
  opacity: 0.76;
}

.sidebar-nav a.active,
.sidebar-nav a:hover {
  background: var(--surface-soft);
}

.sidebar-logout {
  margin-top: auto;
}

.sidebar-logout button {
  width: 100%;
}

.dashboard-main {
  min-width: 0;
  padding: 28px clamp(26px, 4vw, 40px) 46px;
}

.dashboard-header,
.section-head,
.gallery-card-main,
.gallery-card-footer,
.gallery-manager-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.dashboard-header {
  align-items: center;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.dashboard-header h1 {
  margin-bottom: 4px;
  font-size: 30px;
  letter-spacing: 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 22px 0 26px;
}

.stats-grid div {
  min-height: 86px;
  display: grid;
  grid-template-columns: 42px 1fr;
  grid-template-areas:
    "icon value"
    "icon label";
  align-content: center;
  column-gap: 14px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.stats-grid strong {
  grid-area: value;
  font-size: 26px;
  line-height: 1;
}

.stats-grid span {
  grid-area: label;
  color: var(--muted);
  font-weight: 650;
}

.stats-grid .stat-icon {
  grid-area: icon;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

.stats-grid .stat-icon + strong {
  align-self: end;
}

.create-gallery-panel,
.gallery-settings-form {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.dashboard-section {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.create-gallery-panel {
  position: fixed;
  left: 50%;
  top: 86px;
  z-index: 90;
  width: min(1040px, calc(100vw - 48px));
  max-height: calc(100vh - 120px);
  overflow: auto;
  transform: translateX(-50%);
  margin: 0;
  box-shadow: 0 24px 70px rgba(17, 24, 39, 0.22);
}

.create-gallery-panel[hidden] {
  display: none;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.dashboard-filters {
  min-width: min(440px, 100%);
  justify-content: flex-end;
}

.dashboard-filters .search-input {
  flex: 1 1 260px;
}

.dashboard-filters .select-input {
  width: 120px;
}

.gallery-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.gallery-card {
  min-width: 0;
  max-width: 340px;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.gallery-cover {
  width: 100%;
  aspect-ratio: 1.68 / 1;
  min-height: 146px;
  max-height: 176px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--surface-soft);
  color: var(--muted);
  overflow: hidden;
}

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

.gallery-card-main,
.gallery-card-footer {
  padding: 12px;
}

.gallery-card-main {
  display: block;
}

.gallery-card h3 {
  margin: 0 0 4px;
}

.gallery-card .muted {
  margin: 0;
  font-size: 12px;
}

.gallery-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.gallery-badges span,
.file-breakdown span {
  color: var(--muted);
  background: var(--surface-soft);
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 750;
}

.gallery-card-footer {
  align-items: center;
  border-top: 1px solid var(--line);
  min-height: 52px;
}

.gallery-card-actions {
  margin-left: auto;
  justify-content: flex-end;
}

.gallery-card-actions button:not(.more-btn) {
  display: none;
}

.more-btn {
  width: 32px;
  min-height: 32px;
  padding: 0;
}

.file-breakdown {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.upload-btn input {
  display: none;
}

.upload-status {
  padding: 0 14px 14px;
  color: var(--muted);
  font-size: 12px;
}

.upload-progress-bar {
  width: 100%;
  height: 8px;
  overflow: hidden;
  background: var(--surface-soft);
  border-radius: 999px;
}

.upload-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
}

.upload-dropzone {
  min-height: 104px;
  margin-top: 22px;
  display: grid;
  place-items: center;
  gap: 4px;
  text-align: center;
  background: #ffffff;
  border: 1px dashed #d4d4d4;
  border-radius: var(--radius);
  color: var(--text);
}

.upload-dropzone span {
  color: var(--muted);
  font-size: 13px;
}

/* Modals and manager */
.copy-modal,
.gallery-manager-modal,
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(17, 24, 39, 0.58);
}

.copy-modal-card,
.gallery-manager-card {
  width: min(560px, 100%);
  max-height: 88vh;
  overflow: auto;
  background: #ffffff;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 24px 70px rgba(17, 24, 39, 0.24);
}

.gallery-manager-card {
  width: min(1080px, 100%);
}

.gallery-manager-header {
  margin-bottom: 16px;
}

.gallery-manager-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.manager-photo-card {
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
}

.manager-photo-card img,
.manager-file-placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  object-fit: cover;
  background: var(--surface-soft);
}

.manager-photo-card strong {
  display: block;
  margin: 9px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manager-delete-btn {
  width: 100%;
  margin-top: 8px;
}

.manager-select-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.lightbox[hidden] {
  display: none;
}

.lightbox {
  background: rgba(3, 7, 18, 0.9);
}

.lightbox-frame {
  width: min(1120px, 86vw);
  max-height: 84vh;
  margin: 0;
  display: grid;
  gap: 14px;
}

.lightbox-frame img,
.lightbox-frame video {
  max-width: 100%;
  max-height: 76vh;
  justify-self: center;
  border-radius: var(--radius);
  background: #111111;
}

.lightbox-frame figcaption {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #ffffff;
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.20);
}

.lightbox-close {
  top: 18px;
  right: 18px;
}

.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-nav.prev {
  left: 18px;
}

.lightbox-nav.next {
  right: 18px;
}

.password-gate {
  max-width: 430px;
  margin: 22px auto;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.password-gate button {
  width: 100%;
  margin-top: 12px;
}

/* Existing auth and home pages */
.center {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.login-card {
  width: min(420px, 100%);
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow);
}

.login-logo {
  height: 64px;
  width: auto;
  display: block;
  margin: 0 auto 18px;
}

.login-card button {
  width: 100%;
  margin-top: 18px;
}

.home-header {
  min-height: 78px;
  padding: 18px clamp(20px, 5vw, 72px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.home-logo {
  height: 48px;
}

.home-nav,
.home-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.home-login-link {
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
}

.home-main {
  padding: 34px clamp(20px, 5vw, 72px) 80px;
}

.home-hero {
  max-width: 1180px;
  margin: 0 auto;
  min-height: calc(100vh - 190px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(310px, 0.9fr);
  align-items: center;
  gap: 42px;
}

.home-pill {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 800;
  margin-bottom: 18px;
}

.home-hero p {
  max-width: 620px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}

.home-preview-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.preview-grid div {
  min-height: 150px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #d4d4d4, #737373);
}

.preview-top,
.preview-info {
  display: none;
}

@media (max-width: 1100px) {
  .gallery-grid,
  .gallery-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .public-topbar {
    height: auto;
    grid-template-columns: 1fr;
    align-items: start;
    padding-top: 16px;
    padding-bottom: 16px;
  }

  .dashboard-page {
    grid-template-columns: 1fr;
  }

  .dashboard-sidebar {
    position: static;
    height: auto;
  }

  .sidebar-nav {
    grid-template-columns: repeat(3, 1fr);
  }

  .stats-grid,
  .settings-grid,
  .home-hero {
    grid-template-columns: 1fr;
  }

  .gallery-grid,
  .gallery-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .gallery-hero {
    min-height: 250px;
    padding: 34px 18px;
  }

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

  .selection-bar,
  .dashboard-header,
  .section-head,
  .gallery-card-footer,
  .gallery-manager-header,
  .lightbox-frame figcaption {
    align-items: stretch;
    flex-direction: column;
  }

  .selection-bar {
    left: 12px;
    right: 12px;
    width: auto;
    transform: none;
  }

  .sidebar-nav {
    grid-template-columns: 1fr;
  }
}

/* Premium public gallery pass */
.public-gallery-page {
  --premium-bg: #ffffff;
  --premium-shell: #fafafa;
  --premium-border: #e7e7e7;
  --premium-text: #171717;
  --premium-muted: #737373;
  background: var(--premium-bg);
  color: var(--premium-text);
}

.public-gallery-page .public-topbar {
  height: 70px;
  grid-template-columns: 160px minmax(260px, 1fr) auto;
  padding: 0 48px;
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid var(--premium-border);
  box-shadow: 0 1px 0 rgba(17, 24, 39, 0.03);
}

.public-gallery-page .public-brand {
  font-size: 26px;
  font-weight: 850;
}

.public-gallery-page .public-nav {
  gap: 24px;
}

.public-gallery-page .public-nav a,
.public-gallery-page .public-nav button {
  color: var(--premium-text);
  font-size: 14px;
  font-weight: 650;
}

.public-gallery-page .public-actions {
  gap: 12px;
}

.public-gallery-page .download {
  min-height: 42px;
  padding: 0 18px;
  background: #111827;
  border-color: #111827;
  border-radius: 7px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 750;
}

.public-gallery-page .secondary {
  min-height: 42px;
  padding: 0 16px;
  background: #ffffff;
  border: 1px solid var(--premium-border);
  border-radius: 7px;
  color: var(--premium-text);
  font-size: 13px;
  font-weight: 650;
}

.public-gallery-page .public-avatar {
  width: 34px;
  height: 34px;
  background: radial-gradient(circle at 34% 24%, #e8d5bd, #5d452d 64%, #1f2937);
}

.public-gallery-page .gallery-hero {
  min-height: 300px;
  padding: 56px 64px 34px;
  align-items: flex-end;
  background-position: center 42%;
  background-image:
    linear-gradient(90deg, rgba(0, 0, 0, 0.70) 0%, rgba(0, 0, 0, 0.36) 42%, rgba(0, 0, 0, 0.10) 100%),
    var(--gallery-cover);
}

.public-gallery-page .gallery-hero-content {
  max-width: 720px;
}

.public-gallery-page .gallery-hero h1 {
  margin: 0 0 8px;
  color: #ffffff;
  font-size: 40px;
  line-height: 1.08;
  font-weight: 850;
}

.public-gallery-page #galleryClient {
  margin-bottom: 24px;
  color: rgba(255, 255, 255, 0.90);
  font-size: 18px;
}

.public-gallery-page .gallery-notes {
  display: none;
}

.public-gallery-page .proofing-summary {
  gap: 10px;
  margin-top: 0;
}

.public-gallery-page .proofing-summary span {
  min-height: 36px;
  padding: 0 14px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  font-size: 13px;
}

.public-gallery-page .gallery-shell {
  max-width: none;
  padding: 22px 48px 86px;
  background: #ffffff;
}

.public-gallery-page .gallery-toolbar {
  min-height: 42px;
  margin-bottom: 20px;
  gap: 12px;
}

.public-gallery-page .toolbar-spacer {
  flex: 1;
}

.public-gallery-page .gallery-search,
.public-gallery-page .gallery-sort {
  display: none;
}

.public-gallery-page.filters-open .gallery-search,
.public-gallery-page.filters-open .gallery-sort {
  display: block;
}

.public-gallery-page .gallery-search {
  width: 260px;
  max-width: 260px;
}

.public-gallery-page .gallery-sort {
  width: 156px;
  max-width: 156px;
}

.public-gallery-page .layout-btn {
  width: 42px;
  min-width: 42px;
  padding: 0;
  overflow: hidden;
  color: transparent;
  position: relative;
}

.public-gallery-page .layout-btn::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid var(--premium-text);
  border-radius: 3px;
  opacity: 0.84;
}

.public-gallery-page .layout-btn.active {
  background: #ffffff;
  color: transparent;
}

.public-gallery-page .gallery-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.public-gallery-page .gallery-photo-card {
  border-radius: 8px;
  background: #f5f5f5;
}

.public-gallery-page .file-thumb {
  width: 100%;
  min-height: 0;
  aspect-ratio: 1.46 / 1;
  border-radius: 8px;
  background: #f5f5f5;
}

.public-gallery-page .file-thumb img {
  border-radius: 8px;
}

.public-gallery-page .file-type {
  display: none;
}

.public-gallery-page .photo-overlay {
  inset: 10px 10px auto auto;
  gap: 8px;
  opacity: 1;
  transform: none;
}

.public-gallery-page .icon-btn,
.public-gallery-page .favorite-btn {
  width: 34px;
  height: 34px;
  min-height: 34px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.58);
  color: #ffffff;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.55);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(10px);
}

.public-gallery-page .favorite-btn.active {
  background: rgba(17, 24, 39, 0.78);
  color: #ffffff;
}

.public-gallery-page .photo-select {
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
}

.public-gallery-page .photo-select span {
  display: none;
}

.public-gallery-page .photo-select input {
  margin: 0;
}

.public-gallery-page .selection-bar {
  width: min(1120px, calc(100vw - 96px));
  min-height: 60px;
  bottom: 28px;
  padding: 0 18px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--premium-border);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(17, 24, 39, 0.14);
}

.public-gallery-page .selection-bar strong {
  font-size: 14px;
  font-weight: 700;
}

.public-gallery-page .selection-actions {
  gap: 8px;
}

.public-gallery-page .selection-actions .secondary {
  border-color: transparent;
  background: transparent;
}

@media (max-width: 980px) {
  .public-gallery-page .public-topbar {
    grid-template-columns: 1fr;
    height: auto;
    gap: 14px;
    padding: 18px 24px;
  }

  .public-gallery-page .gallery-hero {
    padding: 48px 24px 30px;
  }

  .public-gallery-page .gallery-shell {
    padding: 20px 24px 80px;
  }

  .public-gallery-page .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .public-gallery-page .gallery-hero h1 {
    font-size: 34px;
  }

  .public-gallery-page .gallery-grid {
    grid-template-columns: 1fr;
  }

  .public-gallery-page .selection-bar {
    width: auto;
    left: 12px;
    right: 12px;
    transform: none;
  }
}

/* Premium dashboard pass */
.dashboard-page {
  --dash-bg: #fafafa;
  --dash-surface: #ffffff;
  --dash-border: #e5e5e5;
  --dash-text: #171717;
  --dash-muted: #737373;
  --dash-accent: #111827;
  grid-template-columns: 220px minmax(0, 1fr);
  background: var(--dash-bg);
  color: var(--dash-text);
}

.dashboard-page .dashboard-sidebar {
  gap: 28px;
  padding: 26px 22px;
  background: #ffffff;
  border-right: 1px solid var(--dash-border);
  box-shadow: 1px 0 0 rgba(17, 24, 39, 0.02);
}

.dashboard-page .dashboard-logo {
  font-size: 25px;
  line-height: 1;
  letter-spacing: 0;
}

.dashboard-page .sidebar-nav {
  gap: 8px;
}

.dashboard-page .sidebar-nav a {
  min-height: 42px;
  gap: 12px;
  padding: 0 12px;
  border-radius: 7px;
  color: var(--dash-text);
  font-size: 14px;
  font-weight: 700;
}

.dashboard-page .sidebar-nav a::before {
  width: 17px;
  height: 17px;
  border: 0;
  border-radius: 5px;
  background:
    linear-gradient(var(--dash-text), var(--dash-text)) center / 12px 2px no-repeat,
    linear-gradient(var(--dash-text), var(--dash-text)) center / 2px 12px no-repeat;
  opacity: 0.72;
}

.dashboard-page .sidebar-nav a.active {
  background: #f4f4f5;
}

.dashboard-page .sidebar-user {
  margin-top: auto;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding-top: 18px;
  border-top: 1px solid var(--dash-border);
}

.dashboard-page .sidebar-user strong,
.dashboard-page .sidebar-user span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-page .sidebar-user strong {
  font-size: 13px;
}

.dashboard-page .sidebar-user span {
  color: var(--dash-muted);
  font-size: 12px;
}

.dashboard-page .sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: radial-gradient(circle at 34% 24%, #f1d9bf, #745332 62%, #111827);
}

.dashboard-page .sidebar-logout {
  margin-top: 0;
}

.dashboard-page .dashboard-main {
  padding: 34px clamp(30px, 4vw, 48px) 56px;
}

.dashboard-page .dashboard-header {
  align-items: center;
  min-height: 72px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--dash-border);
}

.dashboard-page .dashboard-header h1 {
  margin: 0 0 6px;
  font-size: 34px;
  line-height: 1.05;
  font-weight: 850;
}

.dashboard-page .dashboard-header .muted {
  margin: 0;
  font-size: 15px;
}

.dashboard-page #newGalleryBtn,
.dashboard-page button:not(.secondary):not(.danger-btn),
.dashboard-page .upload-btn {
  min-height: 44px;
  border-radius: 7px;
  background: var(--dash-accent);
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.10);
}

.dashboard-page button.secondary {
  min-height: 40px;
  border-radius: 7px;
  background: #ffffff;
  border-color: var(--dash-border);
}

.dashboard-page .stats-grid {
  gap: 18px;
  margin: 28px 0 30px;
}

.dashboard-page .stats-grid div {
  min-height: 96px;
  grid-template-columns: 48px 1fr;
  column-gap: 16px;
  padding: 22px 24px;
  border-color: var(--dash-border);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(17, 24, 39, 0.055);
}

.dashboard-page .stats-grid .stat-icon {
  width: 46px;
  height: 46px;
  background: #f7f7f7;
}

.dashboard-page .stats-grid strong {
  font-size: 28px;
  font-weight: 850;
}

.dashboard-page .stats-grid span {
  font-size: 13px;
}

.dashboard-page .dashboard-section {
  margin-top: 0;
}

.dashboard-page .section-head {
  align-items: flex-end;
  margin-bottom: 20px;
}

.dashboard-page .section-head h2 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 850;
}

.dashboard-page .section-head .muted {
  margin: 0;
  font-size: 14px;
}

.dashboard-page .dashboard-filters {
  gap: 12px;
}

.dashboard-page .dashboard-filters .search-input {
  width: 300px;
  flex: 0 0 300px;
}

.dashboard-page .dashboard-filters .select-input {
  width: 132px;
}

.dashboard-page .gallery-list {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-top: 0;
}

.dashboard-page .gallery-card {
  max-width: none;
  border-color: var(--dash-border);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(17, 24, 39, 0.06);
}

.dashboard-page .gallery-cover {
  min-height: 0;
  max-height: none;
  aspect-ratio: 1.72 / 1;
  background: #f4f4f5;
}

.dashboard-page .gallery-cover span {
  font-size: 13px;
  font-weight: 750;
}

.dashboard-page .gallery-card-main {
  padding: 14px 16px 12px;
}

.dashboard-page .gallery-card h3 {
  margin-bottom: 5px;
  font-size: 15px;
  font-weight: 850;
}

.dashboard-page .gallery-card-footer {
  min-height: 58px;
  padding: 12px 16px;
}

.dashboard-page .file-breakdown span {
  background: transparent;
  padding: 0;
  color: var(--dash-muted);
  font-size: 12px;
}

.dashboard-page .file-breakdown span::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 5px;
  vertical-align: -2px;
  border: 1.5px solid currentColor;
  border-radius: 3px;
}

.dashboard-page .gallery-card-actions {
  gap: 8px;
}

.dashboard-page .gallery-card-actions .upload-btn {
  min-height: 38px;
  padding: 0 16px;
}

.dashboard-page .more-btn {
  width: 36px;
  min-width: 36px;
  min-height: 36px;
  color: var(--dash-text);
}

.dashboard-page .upload-dropzone {
  min-height: 120px;
  margin-top: 30px;
  border-color: #d7d7d7;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.035);
}

.dashboard-page .upload-dropzone strong {
  font-size: 15px;
}

.dashboard-page .create-gallery-panel {
  border-radius: 8px;
}

@media (max-width: 1280px) {
  .dashboard-page .gallery-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .dashboard-page {
    grid-template-columns: 1fr;
  }

  .dashboard-page .dashboard-sidebar {
    position: static;
    height: auto;
  }

  .dashboard-page .sidebar-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-page .stats-grid,
  .dashboard-page .gallery-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-page .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-page .dashboard-filters,
  .dashboard-page .dashboard-filters .search-input,
  .dashboard-page .dashboard-filters .select-input {
    width: 100%;
    flex-basis: auto;
  }
}

@media (max-width: 620px) {
  .dashboard-page .dashboard-main {
    padding: 24px 18px 42px;
  }

  .dashboard-page .dashboard-header {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-page .stats-grid,
  .dashboard-page .gallery-list {
    grid-template-columns: 1fr;
  }
}

/* Crandora premium v4 hard visual rebuild */
body.dashboard-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 218px minmax(0, 1fr);
  background: #fafafa;
  color: #171717;
  font-size: 14px;
}

.dashboard-page .dashboard-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 20px 24px;
  background: #ffffff;
  border-right: 1px solid #e5e5e5;
}

.dashboard-page .dashboard-logo {
  margin: 0 0 28px;
  font-size: 27px;
  font-weight: 850;
}

.dashboard-page .sidebar-nav {
  display: grid;
  gap: 8px;
}

.dashboard-page .sidebar-nav a {
  min-height: 44px;
  padding: 0 13px;
  border-radius: 8px;
  color: #171717;
  font-weight: 760;
}

.dashboard-page .sidebar-nav a::before {
  content: "";
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border: 1.8px solid #171717;
  border-radius: 5px;
  background: transparent;
  opacity: 0.72;
}

.dashboard-page .sidebar-nav a[data-icon="home"]::before {
  border-radius: 4px 4px 2px 2px;
  clip-path: polygon(50% 0, 100% 38%, 100% 100%, 0 100%, 0 38%);
}

.dashboard-page .sidebar-nav a[data-icon="heart"]::before {
  border-radius: 999px;
}

.dashboard-page .sidebar-nav a.active,
.dashboard-page .sidebar-nav a:hover {
  background: #f4f4f5;
}

.dashboard-page .sidebar-user {
  margin-top: auto;
  padding-top: 18px;
}

.dashboard-page .sidebar-logout button {
  min-height: 42px;
}

.dashboard-page .dashboard-main {
  padding: 40px clamp(34px, 4.8vw, 64px) 58px;
}

.dashboard-page .dashboard-header {
  min-height: 72px;
  align-items: center;
  padding-bottom: 28px;
  border-bottom: 1px solid #e5e5e5;
}

.dashboard-page .dashboard-header h1 {
  font-size: 36px;
  line-height: 1.06;
  font-weight: 850;
}

.dashboard-page .dashboard-header .muted {
  font-size: 15px;
}

.dashboard-page #newGalleryBtn {
  min-width: 142px;
  min-height: 48px;
  border-radius: 8px;
  background: #111827;
  font-weight: 800;
}

.dashboard-page #newGalleryBtn::before {
  content: "+";
  font-size: 18px;
  line-height: 1;
}

.dashboard-page .stats-grid {
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 20px;
  margin: 30px 0 32px;
}

.dashboard-page .stats-grid div {
  min-height: 112px;
  grid-template-columns: 50px 1fr;
  padding: 26px 28px;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 32px rgba(17, 24, 39, 0.06);
}

.dashboard-page .stats-grid .stat-icon {
  width: 50px;
  height: 50px;
}

.dashboard-page .stats-grid strong {
  font-size: 31px;
  letter-spacing: 0;
}

.dashboard-page .stats-grid span {
  font-size: 13px;
  color: #737373;
}

.dashboard-page .dashboard-section {
  padding: 0;
  background: transparent;
}

.dashboard-page .section-head {
  align-items: end;
  margin: 0 0 20px;
}

.dashboard-page .section-head h2 {
  font-size: 24px;
  font-weight: 850;
}

.dashboard-page .dashboard-filters {
  display: grid;
  grid-template-columns: minmax(250px, 360px) 132px;
  gap: 12px;
}

.dashboard-page .search-input,
.dashboard-page .select-input {
  min-height: 44px;
  border-radius: 8px;
  border-color: #e5e5e5;
  background: #ffffff;
}

.dashboard-page .gallery-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 22px;
  margin-top: 0;
}

.dashboard-page .gallery-card {
  max-width: none;
  overflow: hidden;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 34px rgba(17, 24, 39, 0.075);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.dashboard-page .gallery-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 44px rgba(17, 24, 39, 0.10);
}

.dashboard-page .gallery-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 1.78 / 1;
  min-height: 210px;
  max-height: none;
  background: #f4f4f5;
}

.dashboard-page .gallery-cover img {
  transform: scale(1.001);
  transition: transform 0.24s ease, filter 0.24s ease;
}

.dashboard-page .gallery-card:hover .gallery-cover img {
  transform: scale(1.035);
  filter: brightness(0.90);
}

.dashboard-page .gallery-cover-action {
  position: absolute;
  right: 14px;
  bottom: 14px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: #171717;
  font-size: 12px;
  font-weight: 850;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.dashboard-page .gallery-card:hover .gallery-cover-action {
  opacity: 1;
  transform: translateY(0);
}

.dashboard-page .gallery-card-main {
  padding: 17px 18px 13px;
}

.dashboard-page .gallery-card h3 {
  margin: 0 0 5px;
  font-size: 17px;
  line-height: 1.25;
}

.dashboard-page .gallery-card .muted {
  font-size: 13px;
}

.dashboard-page .gallery-badges {
  margin-top: 12px;
}

.dashboard-page .gallery-badges:empty {
  display: none;
}

.dashboard-page .gallery-card-footer {
  min-height: 66px;
  padding: 14px 18px;
  border-top: 1px solid #e5e5e5;
}

.dashboard-page .file-breakdown {
  gap: 12px;
}

.dashboard-page .file-breakdown span {
  font-size: 12px;
  font-weight: 760;
}

.dashboard-page .gallery-card-actions {
  gap: 8px;
}

.dashboard-page .gallery-card-actions button:not(.more-btn) {
  display: inline-flex;
}

.dashboard-page .gallery-card-actions .secondary {
  min-height: 36px;
  padding: 0 11px;
}

.dashboard-page .gallery-card-actions .upload-btn {
  min-height: 36px;
  padding: 0 13px;
  border-radius: 7px;
  background: #111827;
}

.dashboard-page .more-btn {
  display: none;
}

.dashboard-page .upload-dropzone {
  min-height: 132px;
  margin-top: 32px;
  border: 1px dashed #d4d4d4;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(17, 24, 39, 0.045);
}

.dashboard-page .upload-dropzone::before {
  content: "";
  width: 42px;
  height: 32px;
  margin-bottom: 4px;
  border: 2px solid #111827;
  border-top: 0;
  border-radius: 0 0 12px 12px;
  opacity: 0.85;
}

.dashboard-page .upload-dropzone strong {
  font-size: 15px;
  font-weight: 850;
}

.dashboard-page .upload-dropzone span {
  font-size: 13px;
}

body.public-gallery-page .public-topbar,
body.public-gallery-page .gallery-hero,
body.public-gallery-page .gallery-shell {
  isolation: isolate;
}

body.public-gallery-page .gallery-hero {
  min-height: 360px;
}

body.public-gallery-page .gallery-grid {
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 18px;
}

body.public-gallery-page .file-thumb {
  min-height: 235px;
}

@media (max-width: 1180px) {
  .dashboard-page .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  body.dashboard-page {
    grid-template-columns: 1fr;
  }

  .dashboard-page .dashboard-sidebar {
    position: static;
    height: auto;
  }

  .dashboard-page .sidebar-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-page .dashboard-filters {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .dashboard-page .stats-grid,
  .dashboard-page .gallery-list {
    grid-template-columns: 1fr;
  }
}
