:root {
  --gallery-ivory: #f7f1e7;
  --gallery-paper: #fffdf8;
  --gallery-ink: #292c25;
  --gallery-muted: #74786b;
  --gallery-sage: #748568;
  --gallery-sage-deep: #4f6047;
  --gallery-terracotta: #bd705d;
  --gallery-gold: #b59156;
  --gallery-line: rgba(79, 96, 71, 0.18);
  --gallery-shadow: 0 24px 70px rgba(54, 46, 36, 0.13);
}

.gallery-public-page {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 10% 8%, rgba(189, 112, 93, 0.12), transparent 30rem),
    radial-gradient(circle at 94% 25%, rgba(116, 133, 104, 0.14), transparent 34rem),
    var(--gallery-ivory);
  color: var(--gallery-ink);
  font-family: "Nunito", sans-serif;
}

.gallery-public-page::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Cpath d='M12 17c16 3 24 12 27 27M88 83C72 80 64 71 61 56' fill='none' stroke='%23748568' stroke-opacity='.08' stroke-width='1'/%3E%3C/svg%3E");
  content: "";
  pointer-events: none;
}

.gallery-public-header {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(100% - 40px, 1380px);
  margin: 0 auto;
  padding: 24px 0;
}

.gallery-brand {
  color: var(--gallery-ink);
  font-family: "Caveat", cursive;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  text-decoration: none;
}

.gallery-brand span {
  color: var(--gallery-terracotta);
}

.gallery-header-date {
  display: inline-flex;
  align-items: center;
  color: var(--gallery-sage-deep);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.gallery-hero {
  position: relative;
  display: grid;
  justify-items: center;
  width: min(100% - 40px, 900px);
  margin: 40px auto 76px;
  text-align: center;
}

.gallery-kicker {
  color: var(--gallery-terracotta);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.32em;
}

.gallery-hero h1 {
  margin: 18px 0 22px;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(4rem, 10vw, 8.5rem);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 0.7;
}

.gallery-hero h1 em {
  position: relative;
  left: 0.16em;
  color: var(--gallery-sage-deep);
  font-family: "Caveat", cursive;
  font-size: 0.67em;
  font-weight: 500;
  letter-spacing: 0;
}

.gallery-hero > p {
  max-width: 560px;
  margin: 0;
  color: var(--gallery-muted);
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(1.2rem, 2.5vw, 1.55rem);
  line-height: 1.55;
}

.gallery-count {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
  color: var(--gallery-muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
}

.gallery-count strong {
  color: var(--gallery-terracotta);
  font-family: "Cormorant Garamond", serif;
  font-size: 2rem;
  line-height: 1;
}

.gallery-hero-flourish {
  display: grid;
  grid-template-columns: minmax(50px, 130px) auto minmax(50px, 130px);
  align-items: center;
  gap: 14px;
  width: min(100%, 340px);
  margin-top: 30px;
  color: var(--gallery-gold);
}

.gallery-hero-flourish span {
  height: 1px;
  background: linear-gradient(90deg, transparent, currentColor);
}

.gallery-hero-flourish span:last-child {
  background: linear-gradient(90deg, currentColor, transparent);
}

.gallery-hero-flourish i {
  font-family: "Caveat", cursive;
  font-size: 1.1rem;
  font-style: normal;
}

.gallery-wall {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
  gap: 18px;
  width: min(100% - 36px, 1500px);
  margin: 0 auto;
}

.gallery-photo-card {
  min-width: 0;
  margin: 0;
}

.gallery-photo-card.is-landscape {
  grid-column: span 2;
}

.gallery-photo-card.is-new {
  animation: gallery-card-reveal 420ms ease both;
}

@keyframes gallery-card-reveal {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.gallery-photo-button {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border: 0;
  border-radius: 3px;
  padding: 0;
  background: #dfd8cb;
  box-shadow: 0 10px 30px rgba(52, 44, 35, 0.1);
  cursor: zoom-in;
}

.gallery-photo-button img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 350ms ease, transform 650ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.gallery-photo-card.is-landscape .gallery-photo-button {
  aspect-ratio: 8 / 5;
}

.gallery-photo-card.is-square .gallery-photo-button {
  aspect-ratio: 1;
}

.gallery-photo-overlay {
  position: absolute;
  inset: auto 12px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255, 253, 248, 0.92);
  color: var(--gallery-ink);
  font-size: 0.76rem;
  font-weight: 800;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 220ms ease, transform 220ms ease;
  backdrop-filter: blur(10px);
}

.gallery-photo-overlay svg {
  width: 17px;
}

.gallery-photo-button:hover img,
.gallery-photo-button:focus-visible img {
  filter: saturate(0.92) brightness(0.87);
  transform: scale(1.025);
}

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

.gallery-photo-card > p {
  margin: 9px 4px 0;
  color: var(--gallery-muted);
  font-family: "Cormorant Garamond", serif;
  font-size: 1.05rem;
  font-style: italic;
}

.gallery-load-more {
  display: grid;
  justify-items: center;
  gap: 10px;
  width: min(100% - 36px, 1500px);
  margin: 38px auto 0;
}

.gallery-load-more button {
  min-height: 48px;
  border: 1px solid var(--gallery-sage-deep);
  border-radius: 999px;
  padding: 12px 24px;
  background: var(--gallery-sage-deep);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  transition: background 180ms ease, color 180ms ease, transform 180ms ease;
}

.gallery-load-more button:hover:not(:disabled),
.gallery-load-more button:focus-visible {
  background: transparent;
  color: var(--gallery-sage-deep);
  transform: translateY(-1px);
}

.gallery-load-more button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.gallery-load-more span {
  color: var(--gallery-muted);
  font-size: 0.76rem;
}

.gallery-load-more span.is-error {
  color: var(--gallery-terracotta);
}

.gallery-empty-state {
  display: grid;
  justify-items: center;
  width: min(100% - 40px, 680px);
  min-height: 46vh;
  margin: 0 auto;
  text-align: center;
}

.gallery-empty-mark {
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  border: 1px solid var(--gallery-line);
  border-radius: 50%;
  color: var(--gallery-sage);
  font-family: "Caveat", cursive;
  font-size: 1.6rem;
}

.gallery-empty-state h2 {
  margin: 22px 0 8px;
  font-family: "Cormorant Garamond", serif;
  font-size: 3rem;
  font-weight: 500;
}

.gallery-empty-state p {
  max-width: 460px;
  margin: 0;
  color: var(--gallery-muted);
  line-height: 1.7;
}

.gallery-empty-date {
  margin-top: 22px;
  color: var(--gallery-terracotta);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.gallery-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 90px;
  padding: 36px 20px;
  color: var(--gallery-muted);
  font-family: "Cormorant Garamond", serif;
  font-size: 1rem;
  letter-spacing: 0.08em;
}

.gallery-footer i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gallery-terracotta);
}

.gallery-lightbox {
  width: 100vw;
  max-width: none;
  height: 100vh;
  max-height: none;
  margin: 0;
  border: 0;
  padding: 0;
  background: rgba(23, 25, 21, 0.95);
  color: #fff;
}

.gallery-lightbox::backdrop {
  background: rgba(23, 25, 21, 0.95);
}

.gallery-lightbox[open] {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) 70px;
  place-items: center;
}

.gallery-lightbox figure {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 34px 0 24px;
}

.gallery-lightbox-image-wrap {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
}

.gallery-lightbox-image-wrap img {
  max-width: 100%;
  max-height: calc(100vh - 125px);
  object-fit: contain;
  opacity: 0;
  transition: opacity 220ms ease;
}

.gallery-lightbox-image-wrap img.is-ready {
  opacity: 1;
}

.gallery-lightbox-loader {
  position: absolute;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gallery-lightbox figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 54px;
  padding: 10px 12px 0;
}

.gallery-lightbox figcaption p {
  margin: 0;
  color: rgba(255, 255, 255, 0.84);
  font-family: "Cormorant Garamond", serif;
  font-size: 1.15rem;
}

.gallery-lightbox-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.gallery-lightbox figcaption a,
.gallery-lightbox figcaption button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  padding: 10px 15px;
  background: transparent;
  color: #fff;
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.gallery-lightbox figcaption a:hover,
.gallery-lightbox figcaption button:hover,
.gallery-lightbox figcaption a:focus-visible,
.gallery-lightbox figcaption button:focus-visible {
  border-color: rgba(255, 255, 255, 0.65);
  background: rgba(255, 255, 255, 0.1);
}

.gallery-lightbox figcaption svg {
  width: 18px;
  flex: 0 0 auto;
}

.gallery-lightbox-close,
.gallery-lightbox-nav {
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  cursor: pointer;
}

.gallery-lightbox-close {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 2;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
}

.gallery-lightbox-close svg,
.gallery-lightbox-nav svg {
  width: 28px;
}

.gallery-lightbox-nav {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  transition: background 180ms ease;
}

.gallery-lightbox-nav:hover,
.gallery-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

/* Admin gallery */
.gallery-admin-page {
  min-height: 100vh;
}

.gallery-admin-shell {
  display: grid;
  gap: 22px;
  width: min(100% - 44px, 1460px);
  margin: 0 auto;
  padding: 24px 0 70px;
}

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

.gallery-metrics article {
  min-height: 128px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  background: rgba(255, 253, 248, 0.93);
  box-shadow: var(--shadow);
}

.gallery-metrics span,
.gallery-metrics small {
  display: block;
  color: var(--muted);
}

.gallery-metrics span {
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.gallery-metrics strong {
  display: block;
  margin: 9px 0 5px;
  color: var(--sage-dark);
  font-size: 2rem;
}

.gallery-metrics small {
  font-size: 0.76rem;
}

.gallery-upload-panel {
  display: grid;
  grid-template-columns: minmax(260px, 0.75fr) minmax(390px, 1.25fr);
  gap: 32px;
  padding: 28px;
}

.gallery-upload-copy h2,
.gallery-library-heading h2 {
  margin: 0;
  font-size: 1.45rem;
}

.gallery-upload-copy > p:not(.eyebrow) {
  margin: 13px 0;
  color: var(--muted);
  line-height: 1.6;
}

.gallery-upload-copy ul {
  margin: 18px 0 0;
  padding-left: 19px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.8;
}

.gallery-upload-form {
  display: grid;
  gap: 12px;
}

.gallery-dropzone {
  display: grid;
  justify-items: center;
  gap: 7px;
  min-height: 230px;
  border: 1.5px dashed rgba(84, 97, 73, 0.38);
  border-radius: 14px;
  padding: 28px;
  background:
    radial-gradient(circle at 50% 0, rgba(201, 128, 112, 0.13), transparent 52%),
    rgba(238, 243, 234, 0.58);
  color: var(--muted);
  text-align: center;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.gallery-dropzone:hover,
.gallery-dropzone.is-dragging {
  border-color: var(--sage-dark);
  background-color: rgba(238, 243, 234, 0.94);
  transform: translateY(-2px);
}

.gallery-dropzone strong {
  color: var(--ink);
  font-size: 1rem;
}

.gallery-dropzone > span:not(.gallery-dropzone-icon) {
  font-size: 0.82rem;
  font-weight: 600;
}

.gallery-dropzone-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-bottom: 6px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--sage-dark);
  box-shadow: 0 8px 22px rgba(59, 49, 38, 0.12);
}

.gallery-dropzone-icon svg {
  width: 27px;
}

.gallery-dropzone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.gallery-file-summary {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.gallery-upload-button {
  justify-self: start;
  min-width: 170px;
}

.gallery-upload-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.gallery-progress {
  display: grid;
  gap: 6px;
}

.gallery-progress[hidden],
.gallery-upload-error[hidden] {
  display: none !important;
}

.gallery-progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(111, 128, 97, 0.16);
}

.gallery-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sage), var(--rose));
  transition: width 160ms ease;
}

.gallery-progress > span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.gallery-upload-error {
  margin: 0;
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(163, 76, 76, 0.11);
  color: var(--danger);
  font-size: 0.82rem;
  font-weight: 800;
}

.drive-panel {
  position: relative;
  margin-top: 8px;
  padding: clamp(24px, 4vw, 42px);
  overflow: hidden;
  background:
    radial-gradient(circle at 100% 0, rgba(111, 128, 97, 0.14), transparent 34%),
    linear-gradient(145deg, #fffdf9, #fbf6ed);
}

.drive-panel::before {
  position: absolute;
  top: -55px;
  right: -45px;
  width: 180px;
  height: 180px;
  border: 1px solid rgba(177, 143, 83, 0.2);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.drive-panel-heading,
.drive-browser-toolbar {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.drive-panel-heading h2 {
  margin: 2px 0 8px;
  color: var(--ink);
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 600;
}

.drive-panel-heading p:not(.eyebrow) {
  max-width: 580px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.drive-connection-badge {
  flex: 0 0 auto;
  border: 1px solid rgba(201, 128, 112, 0.25);
  border-radius: 999px;
  padding: 8px 13px;
  background: rgba(201, 128, 112, 0.1);
  color: #9d5547;
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.drive-connection-badge.is-ready {
  border-color: rgba(84, 97, 73, 0.25);
  background: rgba(111, 128, 97, 0.11);
  color: var(--sage-dark);
}

.drive-setup-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 28px;
}

.drive-setup-card {
  min-width: 0;
  border: 1px solid rgba(84, 97, 73, 0.15);
  border-radius: 18px;
  padding: 22px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 12px 35px rgba(59, 52, 42, 0.05);
}

.drive-setup-card.is-complete {
  border-color: rgba(84, 97, 73, 0.32);
}

.drive-step-heading {
  display: flex;
  align-items: center;
  gap: 13px;
}

.drive-step-heading > span {
  display: grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  place-items: center;
  background: rgba(201, 128, 112, 0.12);
  color: var(--rose-dark);
  font-size: 0.85rem;
  font-weight: 900;
}

.drive-setup-card.is-complete .drive-step-heading > span {
  background: var(--sage-dark);
  color: white;
}

.drive-step-heading strong,
.drive-step-heading small {
  display: block;
}

.drive-step-heading strong {
  color: var(--ink);
  font-size: 1rem;
}

.drive-step-heading small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
}

.drive-step-copy {
  margin: 18px 0 16px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.drive-credentials-form,
.drive-folder-form,
.drive-replace-credentials form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.drive-credentials-form label,
.drive-folder-form label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
}

.drive-credentials-form input,
.drive-folder-form input,
.drive-replace-credentials input {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(84, 97, 73, 0.22);
  border-radius: 11px;
  padding: 10px 12px;
  background: white;
  color: var(--ink);
  font: inherit;
}

.drive-credentials-form input[type="file"],
.drive-replace-credentials input[type="file"] {
  padding: 7px;
  font-size: 0.78rem;
}

.drive-account-box,
.drive-folder-current {
  display: grid;
  gap: 6px;
  margin-top: 18px;
  border-radius: 13px;
  padding: 15px;
  background: rgba(111, 128, 97, 0.1);
}

.drive-account-box span,
.drive-folder-current span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.drive-account-box strong,
.drive-folder-current strong {
  overflow-wrap: anywhere;
  color: var(--sage-dark);
  font-size: 0.88rem;
}

.drive-copy-button {
  justify-self: start;
  margin-top: 5px;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--rose-dark);
  cursor: pointer;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 900;
}

.drive-replace-credentials {
  margin-top: 15px;
  color: var(--muted);
  font-size: 0.8rem;
}

.drive-replace-credentials summary {
  cursor: pointer;
  font-weight: 800;
}

.drive-console-link {
  display: inline-block;
  margin-top: 14px;
  color: var(--rose-dark);
  font-size: 0.78rem;
  font-weight: 800;
}

.drive-inline-error {
  margin: 14px 0 0;
  color: var(--danger);
  font-size: 0.8rem;
  font-weight: 700;
}

.drive-step-locked {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 110px;
  margin-top: 18px;
  border: 1px dashed rgba(84, 97, 73, 0.22);
  border-radius: 13px;
  padding: 16px;
  color: var(--muted);
}

.drive-step-locked > span {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  place-items: center;
  background: rgba(84, 97, 73, 0.09);
  font-weight: 900;
}

.drive-step-locked p {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.5;
}

.drive-browser,
.drive-browser-locked {
  position: relative;
  margin-top: 28px;
  border-top: 1px solid rgba(84, 97, 73, 0.14);
  padding-top: 26px;
}

.drive-browser-locked {
  color: var(--muted);
  font-size: 0.88rem;
  text-align: center;
}

.drive-browser-toolbar > div:first-child {
  display: grid;
  gap: 4px;
}

.drive-browser-toolbar strong {
  color: var(--ink);
}

.drive-browser-toolbar span {
  color: var(--muted);
  font-size: 0.8rem;
}

.drive-browser-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
}

.drive-browser-actions .btn {
  min-height: 40px;
  white-space: nowrap;
}

.drive-browser-actions .btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.drive-browser-message {
  min-height: 20px;
  margin: 15px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.drive-browser-message.is-success {
  color: var(--sage-dark);
}

.drive-browser-message.is-error {
  color: var(--danger);
}

.drive-operation-progress {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.drive-operation-progress[hidden],
.drive-files-grid[hidden],
.drive-browser-actions [hidden] {
  display: none !important;
}

.drive-operation-progress > span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.drive-files-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.drive-file-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(84, 97, 73, 0.16);
  border-radius: 14px;
  background: white;
  cursor: pointer;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.drive-file-card:hover {
  box-shadow: 0 12px 28px rgba(59, 52, 42, 0.1);
  transform: translateY(-2px);
}

.drive-file-card:has(input:checked) {
  border-color: var(--rose-dark);
  box-shadow: 0 0 0 3px rgba(201, 128, 112, 0.14);
}

.drive-file-card > input {
  position: absolute;
  z-index: 3;
  top: 10px;
  left: 10px;
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--rose-dark);
}

.drive-file-card.is-disabled {
  cursor: default;
  opacity: 0.7;
}

.drive-file-card.is-disabled:hover {
  box-shadow: none;
  transform: none;
}

.drive-file-preview {
  position: relative;
  display: grid;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  place-items: center;
  background: linear-gradient(145deg, #ebe7df, #f6f2ea);
}

.drive-file-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.drive-file-preview.has-no-preview::before {
  color: var(--muted);
  content: "Sin vista previa";
  font-size: 0.72rem;
  font-weight: 700;
}

.drive-file-status {
  position: absolute;
  right: 8px;
  bottom: 8px;
  border-radius: 999px;
  padding: 5px 8px;
  background: rgba(41, 44, 37, 0.82);
  color: white;
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.drive-file-card.is-new .drive-file-status {
  background: rgba(84, 97, 73, 0.94);
}

.drive-file-card.is-updated .drive-file-status {
  background: rgba(177, 143, 83, 0.95);
}

.drive-file-copy {
  display: grid;
  gap: 4px;
  padding: 11px;
}

.drive-file-copy strong,
.drive-file-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drive-file-copy strong {
  color: var(--ink);
  font-size: 0.78rem;
}

.drive-file-copy small {
  color: var(--muted);
  font-size: 0.67rem;
}

.drive-file-card.is-importing {
  animation: drive-card-pulse 900ms ease-in-out infinite alternate;
}

.drive-file-card.is-complete {
  border-color: var(--sage-dark);
}

.drive-file-card.has-error {
  border-color: var(--danger);
}

.drive-files-empty {
  grid-column: 1 / -1;
  border: 1px dashed rgba(84, 97, 73, 0.22);
  border-radius: 14px;
  padding: 34px 20px;
  color: var(--muted);
  text-align: center;
}

.drive-privacy-note {
  margin: 17px 0 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.5;
}

@keyframes drive-card-pulse {
  from { opacity: 0.62; }
  to { opacity: 1; }
}

.gallery-library {
  display: grid;
  gap: 18px;
}

.gallery-library-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.gallery-library-heading > span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.gallery-library-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  position: sticky;
  z-index: 8;
  top: 16px;
  border: 1px solid rgba(84, 97, 73, 0.16);
  border-radius: 14px;
  padding: 11px;
  background: rgba(255, 253, 248, 0.94);
  box-shadow: 0 12px 30px rgba(59, 49, 38, 0.08);
  backdrop-filter: blur(14px);
}

.gallery-filter-tabs,
.gallery-bulk-panel,
.gallery-bulk-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gallery-filter-tabs a,
.gallery-select-visible {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 8px 11px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.gallery-filter-tabs a:hover,
.gallery-select-visible:hover {
  background: rgba(84, 97, 73, 0.08);
  color: var(--ink);
}

.gallery-filter-tabs a.is-active {
  border-color: rgba(84, 97, 73, 0.2);
  background: var(--sage-dark);
  color: white;
}

.gallery-filter-tabs a span {
  display: inline-grid;
  min-width: 22px;
  min-height: 22px;
  margin-left: 4px;
  border-radius: 999px;
  padding: 2px 6px;
  place-items: center;
  background: rgba(84, 97, 73, 0.1);
  font-size: 0.68rem;
}

.gallery-filter-tabs a.is-active span {
  background: rgba(255, 255, 255, 0.18);
}

.gallery-bulk-panel {
  justify-content: flex-end;
}

.gallery-select-visible {
  border-color: rgba(84, 97, 73, 0.18);
}

.gallery-select-visible:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.gallery-selection-count {
  min-width: 92px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-align: right;
}

.gallery-bulk-form .btn {
  min-height: 38px;
}

.gallery-bulk-form .btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.gallery-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
  gap: 18px;
}

.gallery-admin-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.95);
  box-shadow: 0 12px 32px rgba(59, 49, 38, 0.09);
}

.gallery-admin-card[hidden] {
  display: none;
}

.gallery-admin-card:has([data-gallery-photo-select]:checked) {
  border-color: var(--sage-dark);
  box-shadow: 0 0 0 3px rgba(84, 97, 73, 0.13), 0 12px 32px rgba(59, 49, 38, 0.09);
}

.gallery-admin-card.is-hidden {
  opacity: 0.72;
}

.gallery-admin-image {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: #e3ddd2;
}

.gallery-admin-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-visibility-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(255, 253, 248, 0.9);
  color: var(--sage-dark);
  font-size: 0.7rem;
  font-weight: 900;
  backdrop-filter: blur(8px);
}

.gallery-card-select {
  position: absolute;
  top: 9px;
  left: 9px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 6px 9px;
  background: rgba(255, 253, 248, 0.92);
  color: var(--ink);
  cursor: pointer;
  font-size: 0.69rem;
  font-weight: 900;
  backdrop-filter: blur(8px);
}

.gallery-card-select input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--sage-dark);
}

.gallery-admin-card.is-hidden .gallery-visibility-badge {
  color: var(--danger);
}

.gallery-admin-card-body {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.gallery-file-meta {
  min-width: 0;
}

.gallery-file-meta strong,
.gallery-file-meta span {
  display: block;
}

.gallery-file-meta strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.86rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery-file-meta span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.73rem;
}

.gallery-photo-form {
  display: grid;
  gap: 11px;
}

.gallery-publish-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.gallery-publish-toggle input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--sage-dark);
}

.gallery-publish-toggle span {
  color: var(--muted);
  font-size: 0.78rem;
}

.gallery-delete-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--danger);
  font-size: 0.75rem;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.gallery-pagination {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto minmax(120px, 1fr);
  align-items: center;
  gap: 14px;
  border: 1px solid rgba(84, 97, 73, 0.16);
  border-radius: 14px;
  padding: 13px 16px;
  background: rgba(255, 253, 248, 0.9);
}

.gallery-pagination > a,
.gallery-pagination > .is-disabled {
  color: var(--sage-dark);
  font-size: 0.78rem;
  font-weight: 900;
  text-decoration: none;
}

.gallery-pagination > a:last-child,
.gallery-pagination > .is-disabled:last-child {
  text-align: right;
}

.gallery-pagination > a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.gallery-pagination > .is-disabled {
  opacity: 0.35;
}

.gallery-pagination-status {
  display: grid;
  gap: 2px;
  color: var(--ink);
  font-size: 0.8rem;
  text-align: center;
}

.gallery-pagination-status small {
  color: var(--muted);
  font-size: 0.7rem;
}

.gallery-filter-empty {
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 46px 20px;
  background: rgba(255, 253, 248, 0.48);
  text-align: center;
}

.gallery-filter-empty h3 {
  margin: 0 0 7px;
}

.gallery-filter-empty p {
  margin: 0;
  color: var(--muted);
}

.gallery-admin-empty {
  display: grid;
  justify-items: center;
  min-height: 300px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 50px 20px;
  background: rgba(255, 253, 248, 0.48);
  text-align: center;
}

.gallery-admin-empty > span {
  display: grid;
  place-items: center;
  width: 80px;
  height: 80px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--rose);
  font-family: "Caveat", cursive;
  font-size: 1.5rem;
}

.gallery-admin-empty h3 {
  margin: 20px 0 7px;
}

.gallery-admin-empty p {
  max-width: 440px;
  margin: 0;
  color: var(--muted);
}

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

  .gallery-admin-page .admin-topbar {
    position: static;
    align-items: flex-start;
  }

  .gallery-admin-page .admin-header-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .gallery-admin-page .admin-nav {
    overflow-x: auto;
  }

  .gallery-metrics,
  .gallery-upload-panel {
    grid-template-columns: 1fr;
  }

  .gallery-upload-panel {
    gap: 22px;
  }

  .drive-files-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .gallery-library-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .gallery-bulk-panel {
    justify-content: space-between;
  }
}

@media (max-width: 640px) {
  .gallery-public-header {
    width: min(100% - 28px, 1380px);
    padding: 17px 0;
  }

  .gallery-header-date {
    max-width: 150px;
    text-align: right;
  }

  .gallery-hero {
    width: min(100% - 28px, 900px);
    margin: 42px auto 54px;
  }

  .gallery-hero h1 {
    font-size: clamp(3.8rem, 20vw, 6rem);
  }

  .gallery-wall {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: calc(100% - 20px);
  }

  .gallery-photo-card.is-landscape {
    grid-column: span 1;
  }

  .gallery-photo-button,
  .gallery-photo-card.is-landscape .gallery-photo-button,
  .gallery-photo-card.is-square .gallery-photo-button {
    aspect-ratio: 1;
  }

  .gallery-photo-overlay,
  .gallery-photo-card > p {
    display: none;
  }

  .gallery-lightbox[open] {
    grid-template-columns: 42px minmax(0, 1fr) 42px;
  }

  .gallery-lightbox figure {
    padding: 58px 0 18px;
  }

  .gallery-lightbox-image-wrap img {
    max-height: calc(100vh - 175px);
  }

  .gallery-lightbox figcaption {
    align-items: stretch;
    flex-direction: column;
    padding: 12px 0 0;
  }

  .gallery-lightbox-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .gallery-lightbox figcaption a,
  .gallery-lightbox figcaption button {
    min-height: 44px;
    padding-inline: 10px;
  }

  .gallery-lightbox-nav {
    width: 40px;
    height: 48px;
  }

  .gallery-lightbox-nav svg {
    width: 23px;
  }

  .gallery-admin-shell {
    width: calc(100% - 24px);
    padding-top: 14px;
  }

  .gallery-admin-page .admin-topbar {
    flex-direction: column;
    padding: 16px 14px;
  }

  .gallery-admin-page .admin-topbar h1 {
    font-size: 1.35rem;
  }

  .gallery-admin-page .admin-header-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    width: 100%;
  }

  .gallery-admin-page .admin-nav {
    grid-column: 1 / -1;
    width: 100%;
  }

  .gallery-admin-page .admin-nav a {
    flex: 1 0 auto;
    text-align: center;
  }

  .gallery-admin-page .admin-header-actions > .icon-btn {
    width: 100%;
  }

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

  .gallery-metrics article {
    min-height: 110px;
    padding: 16px;
  }

  .gallery-metrics article:last-child {
    grid-column: 1 / -1;
  }

  .gallery-metrics strong {
    font-size: 1.55rem;
  }

  .gallery-upload-panel {
    padding: 18px;
  }

  .gallery-dropzone {
    min-height: 210px;
    padding: 22px 14px;
  }

  .gallery-upload-button {
    width: 100%;
  }

  .drive-panel {
    padding: 22px 16px;
  }

  .drive-panel-heading,
  .drive-browser-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }

  .drive-connection-badge {
    align-self: flex-start;
  }

  .drive-setup-grid {
    grid-template-columns: 1fr;
  }

  .drive-browser-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    justify-content: stretch;
  }

  .drive-browser-actions .btn:first-child,
  .drive-browser-actions .btn:last-child {
    grid-column: 1 / -1;
  }

  .drive-files-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

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

  .gallery-library-toolbar {
    top: 8px;
    padding: 9px;
  }

  .gallery-filter-tabs {
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .gallery-filter-tabs a {
    flex: 1 0 auto;
  }

  .gallery-bulk-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .gallery-selection-count {
    min-width: 0;
    text-align: left;
  }

  .gallery-bulk-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .gallery-bulk-form > [data-gallery-bulk-ids] {
    display: none;
  }

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

  .gallery-pagination-status {
    grid-column: 1 / -1;
    grid-row: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-public-page *,
  .gallery-admin-page * {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
