:root {
  color-scheme: light;
  --page: #ffffff;
  --canvas: #f6f4f0;
  --surface: #ffffff;
  --surface-soft: #faf9f6;
  --ink: #1b1a17;
  --ink-soft: #34312c;
  --muted: #6f6b64;
  --subtle: #a8a39b;
  --line: #e7e3dd;
  --line-strong: #d3cdc3;
  --accent: #1f1d1a;
  --accent-hover: #36332e;
  --accent-soft: #f0eee9;
  --success: #3f6b50;
  --success-soft: #e9f2ec;
  --warning: #7a633c;
  --warning-soft: #f5eedb;
  --danger: #963535;
  --danger-soft: #f3e3e3;
  --shadow: 0 30px 70px rgba(28, 26, 23, 0.09);
  --shadow-soft: 0 14px 34px rgba(28, 26, 23, 0.06);
  --font-body: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Cormorant Garamond", Georgia, Cambria, "Times New Roman", serif;
  --font-script: "Great Vibes", "Cormorant Garamond", cursive;
  --radius: 10px;
  --radius-lg: 14px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--page);
  /* Evita o zoom acidental de duplo-toque no celular, mantendo o pinch-to-zoom. */
  touch-action: manipulation;
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(28, 26, 23, 0.05), transparent 60%),
    linear-gradient(to bottom, var(--canvas), rgba(255, 255, 255, 0) 440px),
    var(--page);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.public-page {
  padding-bottom: 94px;
}

button,
input,
textarea {
  font: inherit;
}

button,
a.button-link {
  -webkit-tap-highlight-color: transparent;
  outline: 2px solid transparent;
  outline-offset: 3px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.site-header,
.admin-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 26px 0 20px;
}

.brand-line {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  overflow: hidden;
}

.brand-line > div {
  min-width: 0;
  overflow: hidden;
}

.header-logo-img {
  flex: 0 0 auto;
  width: clamp(56px, 14vw, 88px);
  height: clamp(56px, 14vw, 88px);
  display: block;
  object-fit: contain;
}

.site-header h1 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4.8vw, 2.6rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: 0.005em;
}

.admin-header h1 {
  max-width: 920px;
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(2rem, 5.4vw, 3.6rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.005em;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 68px;
}

.hero-panel,
.upload-band {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 22px;
  margin: 10px 0 44px;
  padding: 26px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.hero-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(31, 30, 28, 0.055), transparent 32%),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0));
}

.hero-copy,
.upload-card,
.recent-strip {
  position: relative;
  z-index: 1;
}

.hero-copy {
  display: grid;
  align-content: center;
  gap: 8px;
  animation: riseIn 520ms ease both;
}

.hero-copy .eyebrow {
  margin-bottom: 0;
}


.hero-panel h2,
.upload-band h2,
.gallery-section h2 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 7vw, 3.4rem);
  font-weight: 500;
  line-height: 1.04;
  letter-spacing: 0.005em;
}

.hero-copy h2::after {
  content: "";
  display: block;
  width: 56px;
  height: 1px;
  margin-top: 16px;
  background: linear-gradient(to right, var(--line-strong), transparent);
}

.hero-text {
  max-width: 620px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: clamp(1.02rem, 3.6vw, 1.18rem);
  line-height: 1.6;
}

.upload-card {
  display: grid;
  gap: 14px;
  align-content: start;
  padding: 18px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 18px 50px rgba(31, 30, 28, 0.08);
  backdrop-filter: blur(10px);
  animation: riseIn 620ms ease 80ms both;
}

.couple-showcase {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  min-width: 0;
  animation: riseIn 620ms ease 140ms both;
}

.couple-carousel {
  position: relative;
  min-height: clamp(310px, 72vw, 460px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius);
  background: var(--accent-soft);
  box-shadow: 0 24px 60px rgba(31, 30, 28, 0.16);
}

.couple-slides {
  position: absolute;
  inset: 0;
}

.couple-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  object-position: center;
  opacity: 0;
  transform: scale(1.045);
  transition:
    opacity 900ms ease,
    transform 4200ms ease;
}

.couple-slide.is-active {
  opacity: 1;
  transform: scale(1);
}

.carousel-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(19, 18, 16, 0.55), rgba(19, 18, 16, 0.04) 48%),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.2), transparent 34%);
  pointer-events: none;
}

.carousel-caption {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 18px;
  display: grid;
  gap: 2px;
  color: #ffffff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45);
}

.carousel-caption strong {
  order: -1;
  font-family: var(--font-body);
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  opacity: 0.9;
}

.carousel-caption span {
  font-family: var(--font-script);
  font-size: clamp(2.6rem, 12vw, 4rem);
  font-weight: 400;
  line-height: 0.95;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 7px;
}

.carousel-dots span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--line-strong);
  transition:
    width 220ms ease,
    background-color 220ms ease;
}

.carousel-dots span.is-active {
  width: 22px;
  background: var(--accent);
}

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

.recent-strip img {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: block;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  animation: imageLift 520ms ease both;
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button,
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.86rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.primary-button {
  width: 100%;
  min-height: 64px;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.98rem;
  letter-spacing: 0.12em;
  box-shadow: 0 18px 36px rgba(31, 29, 26, 0.2);
}

.primary-button:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.button-symbol {
  display: inline-flex;
  width: 26px;
  height: 26px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 1.35rem;
  line-height: 1;
}

.secondary-button,
.button-link,
.ghost-button {
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.secondary-button:hover,
.button-link:hover,
.ghost-button:hover {
  border-color: var(--line-strong);
  background: var(--surface);
  transform: translateY(-1px);
}

.ghost-button {
  flex: 0 0 auto;
  min-height: 46px;
}

.danger-button {
  background: var(--danger);
  color: #ffffff;
}

.danger-button:hover {
  background: #7f2d2d;
}

.guest-form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 750;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--ink);
  padding: 14px 15px;
  font-size: 1rem;
  outline: none;
}

input:focus,
textarea:focus,
button:focus-visible,
a.button-link:focus-visible {
  border-color: var(--accent);
  outline-color: rgba(36, 35, 31, 0.28);
  box-shadow: 0 0 0 4px rgba(38, 37, 34, 0.1);
}

textarea {
  resize: vertical;
}

.progress {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--accent-soft);
}

.progress div {
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width 180ms ease;
}

.progress div.is-uploading {
  background: linear-gradient(
    90deg,
    var(--accent) 0%,
    #5c5a52 45%,
    var(--accent) 100%
  );
  background-size: 200% 100%;
  animation: progressShimmer 1.4s linear infinite;
}

.status-message {
  min-height: 24px;
  margin: 0;
  color: var(--success);
  font-weight: 820;
}

.privacy-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
}

.gallery-section {
  padding-top: 4px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.count-pill,
#photoCount {
  flex: 0 0 auto;
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 0 14px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.gallery-grid {
  display: grid;
  grid-auto-flow: dense;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.photo-tile {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--accent-soft);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  opacity: 0;
  transform: translateY(14px) scale(0.984);
  transition:
    opacity 500ms ease,
    transform 500ms ease,
    box-shadow 160ms ease;
}

.photo-tile.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.photo-tile:first-child {
  grid-column: span 2;
  aspect-ratio: 4 / 3;
}

.photo-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: var(--radius);
  pointer-events: none;
}

.photo-tile img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  filter: blur(6px);
  transition: transform 240ms ease, filter 400ms ease;
}

.photo-tile img.is-loaded {
  filter: blur(0);
}

.photo-tile:hover img {
  transform: scale(1.03);
}

.photo-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 24px 10px 9px;
  color: #ffffff;
  background: linear-gradient(to top, rgba(29, 29, 27, 0.76), rgba(29, 29, 27, 0));
  font-size: 0.86rem;
  font-weight: 750;
  text-align: left;
}

.empty-state {
  margin: 24px 0;
  padding: 34px 24px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: var(--shadow-soft);
}

.load-more {
  width: 100%;
  margin-top: 18px;
}


.mobile-upload-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 18;
  display: block;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.88);
  border-top: 1px solid var(--line);
  box-shadow: 0 -12px 34px rgba(31, 30, 28, 0.08);
  backdrop-filter: blur(12px);
  transform: translateY(0);
  transition: transform 280ms ease;
}

.mobile-upload-bar.is-tucked {
  transform: translateY(140%);
}

.toast-stack {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 50;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  overflow: hidden;
  padding: 11px 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: 0 18px 44px rgba(28, 26, 23, 0.13);
  pointer-events: auto;
  animation: toastIn 320ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
  backdrop-filter: blur(12px);
}

.toast-ico {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--muted);
}

.toast-ico-svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.toast.success .toast-ico { background: var(--success-soft); color: var(--success); }
.toast.warning .toast-ico { background: var(--warning-soft); color: var(--warning); }
.toast.error .toast-ico { background: var(--danger-soft); color: var(--danger); }

.toast-content {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 1px;
}

.toast-content strong {
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0;
}

.toast-content span {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.toast-close {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--subtle);
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease;
}

.toast-close:hover {
  background: var(--accent-soft);
  color: var(--ink);
}

.toast-bar {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  transform-origin: left center;
  background: var(--accent);
  opacity: 0.5;
  animation: toastBar 4000ms linear forwards;
}

.toast.success .toast-bar { background: var(--success); }
.toast.warning .toast-bar { background: var(--warning); }
.toast.error .toast-bar { background: var(--danger); }

.toast.is-leaving {
  animation: toastOut 240ms ease both;
}

@keyframes toastBar {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

.feedback-modal {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(31, 30, 28, 0.38);
  backdrop-filter: blur(10px);
}

.feedback-modal[hidden] {
  display: none;
}

.feedback-open {
  overflow: hidden;
}

.feedback-dialog {
  position: relative;
  width: min(460px, 100%);
  display: grid;
  gap: 14px;
  padding: 26px;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: var(--radius);
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.22);
  animation: modalIn 260ms ease both;
}

.feedback-dialog h2 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(2rem, 8vw, 2.8rem);
  font-weight: 520;
  line-height: 1;
}

.feedback-dialog p {
  margin: 0;
  color: var(--muted);
}

.feedback-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
}

.feedback-actions {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.login-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.login-box {
  width: min(430px, 100%);
  display: grid;
  gap: 18px;
  padding: 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.login-box h1 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 2.3rem;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: 0.005em;
}

.admin-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-panel {
  display: grid;
  gap: 18px;
}

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

.stat-box,
.setting-row,
.admin-photo {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.stat-box {
  padding: 18px;
}

.stat-box strong {
  display: block;
  color: var(--ink);
  font-size: 2rem;
  line-height: 1;
}

.stat-box span {
  color: var(--muted);
  font-weight: 820;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
}

.setting-row strong {
  color: var(--ink);
}

.switch {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.switch input {
  width: 22px;
  height: 22px;
  accent-color: var(--accent);
}

.filter-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.filter-row button[aria-pressed="true"] {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.admin-grid {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.admin-photo {
  display: grid;
  grid-template-columns: 98px minmax(0, 1fr);
  gap: 12px;
  padding: 10px;
}

.admin-photo img {
  width: 98px;
  height: 98px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--accent-soft);
}

.admin-photo h3 {
  margin: 0 0 6px;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 1rem;
  letter-spacing: 0;
}

.admin-photo p {
  margin: 6px 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.photo-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.photo-actions button,
.photo-actions a {
  min-height: 40px;
  padding: 0 12px;
  font-size: 0.92rem;
}

/* ===== ADMIN DASHBOARD ===== */

body.admin-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 0%, rgba(63, 107, 80, 0.12), transparent 30%),
    radial-gradient(circle at 96% 8%, rgba(122, 99, 60, 0.09), transparent 24%),
    #f4f2ed;
}

.admin-login-page {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 32px;
}

.admin-login-shell {
  width: min(1040px, 100%);
  min-height: 570px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 24px;
  box-shadow: 0 34px 90px rgba(34, 31, 27, 0.14);
  backdrop-filter: blur(18px);
}

.admin-login-intro {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: 46px;
  color: #ffffff;
  background:
    linear-gradient(145deg, rgba(17, 20, 17, 0.92), rgba(45, 55, 47, 0.9)),
    url("/img/fotos%20(1).jpeg") center / cover;
}

.admin-login-intro::after {
  content: "";
  position: absolute;
  right: -80px;
  bottom: -100px;
  width: 300px;
  height: 300px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  box-shadow: 0 0 0 42px rgba(255, 255, 255, 0.035), 0 0 0 84px rgba(255, 255, 255, 0.025);
}

.admin-login-logo {
  position: relative;
  z-index: 1;
  width: 76px;
  height: 76px;
  object-fit: contain;
  padding: 8px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 50%;
}

.admin-login-intro > div {
  position: relative;
  z-index: 1;
  max-width: 520px;
}

.admin-login-intro .eyebrow {
  color: rgba(255, 255, 255, 0.68);
}

.admin-login-intro h1 {
  max-width: 600px;
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-size: clamp(2.7rem, 5vw, 4.7rem);
  font-weight: 500;
  line-height: 0.96;
}

.admin-login-intro p:last-child {
  max-width: 480px;
  margin: 0;
  color: rgba(255, 255, 255, 0.74);
  line-height: 1.7;
}

.admin-login-box {
  align-self: center;
  display: grid;
  gap: 20px;
  padding: 52px;
}

.admin-login-kicker {
  color: var(--success);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.admin-login-box h2 {
  margin: 8px 0 6px;
  font-family: var(--font-display);
  font-size: 2.55rem;
  font-weight: 600;
  line-height: 1;
}

.admin-login-box p {
  margin: 0;
  color: var(--muted);
}

.admin-field {
  display: grid;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 0.85rem;
  font-weight: 700;
}

.admin-field input {
  width: 100%;
  min-height: 54px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--ink);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.admin-field input:focus {
  border-color: var(--success);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(63, 107, 80, 0.11);
}

.admin-login-button {
  min-height: 54px;
}

.admin-login-box .status-message {
  min-height: 22px;
  color: var(--danger);
  text-align: center;
}

.admin-dashboard {
  min-height: 100vh;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 82px;
  padding: 12px max(24px, calc((100vw - 1220px) / 2));
  border-bottom: 1px solid rgba(211, 205, 195, 0.75);
  background: rgba(250, 249, 246, 0.88);
  backdrop-filter: blur(18px);
}

.admin-brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.admin-brand img {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.admin-brand span {
  min-width: 0;
  display: grid;
}

.admin-brand small {
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.admin-brand strong {
  overflow: hidden;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.admin-action-link,
.admin-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink-soft);
  text-decoration: none;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.admin-action-link {
  padding: 0 15px;
  font-size: 0.82rem;
  font-weight: 700;
}

.admin-icon-button {
  width: 42px;
  padding: 0;
  cursor: pointer;
}

.admin-action-link:hover,
.admin-icon-button:hover {
  border-color: var(--line-strong);
  background: #ffffff;
  transform: translateY(-1px);
}

.admin-icon-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.admin-icon-button.is-refreshing svg {
  animation: adminSpin 800ms linear infinite;
}

@keyframes adminSpin {
  to { transform: rotate(360deg); }
}

main.admin-panel {
  width: min(1220px, calc(100% - 40px));
  display: grid;
  gap: 20px;
  margin: 0 auto;
  padding: 34px 0 72px;
}

.admin-overview {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  min-height: 220px;
  padding: 34px;
  border-radius: 20px;
  color: #ffffff;
  background:
    radial-gradient(circle at 88% 15%, rgba(255, 255, 255, 0.12), transparent 24%),
    linear-gradient(135deg, #191b18, #2f3932);
  box-shadow: 0 24px 60px rgba(28, 34, 29, 0.16);
}

.admin-overview::after {
  content: "";
  position: absolute;
  right: -120px;
  top: -170px;
  width: 430px;
  height: 430px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  box-shadow: 0 0 0 56px rgba(255, 255, 255, 0.025), 0 0 0 112px rgba(255, 255, 255, 0.018);
}

.admin-overview-copy,
.admin-overview-status {
  position: relative;
  z-index: 1;
}

.admin-overview .eyebrow {
  color: rgba(255, 255, 255, 0.6);
}

.admin-overview h1 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 500;
  line-height: 0.98;
}

.admin-overview-copy > p:last-child {
  max-width: 620px;
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
}

.admin-overview-status {
  display: grid;
  justify-items: end;
  gap: 5px;
  text-align: right;
}

.health-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 36px;
  margin-bottom: 8px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.78rem;
}

.health-badge i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c9c6bf;
  box-shadow: 0 0 0 5px rgba(201, 198, 191, 0.1);
}

.health-badge.is-healthy i {
  background: #83d2a2;
  box-shadow: 0 0 0 5px rgba(131, 210, 162, 0.12);
}

.health-badge.is-attention i {
  background: #f0bd6d;
  box-shadow: 0 0 0 5px rgba(240, 189, 109, 0.12);
}

.health-badge.is-loading i {
  animation: healthPulse 1.2s ease-in-out infinite;
}

@keyframes healthPulse {
  50% { opacity: 0.35; transform: scale(0.78); }
}

.admin-overview-status small {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.admin-overview-status time {
  font-size: 1.05rem;
  font-weight: 700;
}

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

.stat-box {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 19px;
  border: 1px solid rgba(225, 220, 211, 0.9);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 12px 30px rgba(28, 26, 23, 0.045);
}

.stat-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: var(--success-soft);
  color: var(--success);
}

.stat-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stat-box > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.stat-box > div > span {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-box strong {
  color: var(--ink);
  font-size: clamp(1.55rem, 3vw, 2.15rem);
  font-weight: 720;
  line-height: 1;
}

.admin-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.75fr);
  gap: 20px;
  align-items: start;
}

.admin-card {
  min-width: 0;
  padding: 24px;
  border: 1px solid rgba(225, 220, 211, 0.9);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 16px 38px rgba(28, 26, 23, 0.05);
}

.admin-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.admin-card-head .eyebrow {
  margin-bottom: 5px;
}

.admin-card-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.3vw, 2.45rem);
  font-weight: 600;
  line-height: 1;
}

.node-version,
.library-count {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
}

.health-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.health-metric {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 18px;
}

.health-metric:nth-child(odd) {
  border-right: 1px solid var(--line);
}

.health-metric:nth-child(-n + 2) {
  border-bottom: 1px solid var(--line);
}

.health-metric span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.health-metric strong {
  overflow: hidden;
  font-size: 1.2rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.health-metric strong.is-danger {
  color: var(--danger);
}

.health-metric small {
  overflow: hidden;
  color: var(--subtle);
  font-size: 0.7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.disk-usage {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.disk-usage > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 0.75rem;
}

.disk-usage strong {
  color: var(--ink-soft);
  font-size: 0.75rem;
}

.disk-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--accent-soft);
}

.disk-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--success);
  transition: width 400ms ease, background-color 200ms ease;
}

.disk-track span.is-warning { background: var(--warning); }
.disk-track span.is-danger { background: var(--danger); }

.health-footnotes {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  color: var(--subtle);
  font-size: 0.7rem;
}

.control-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.control-item strong {
  font-size: 0.92rem;
}

.control-item p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.5;
}

.control-item-stack {
  align-items: stretch;
  flex-direction: column;
}

.control-divider {
  height: 1px;
  margin: 22px 0;
  background: var(--line);
}

.admin-switch {
  position: relative;
  flex: 0 0 auto;
  display: inline-flex;
  cursor: pointer;
}

.admin-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.admin-switch span {
  position: relative;
  width: 48px;
  height: 27px;
  border-radius: 999px;
  background: #cec9c1;
  transition: background-color 180ms ease;
}

.admin-switch span::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.2);
  transition: transform 180ms ease;
}

.admin-switch input:checked + span {
  background: var(--success);
}

.admin-switch input:checked + span::after {
  transform: translateX(21px);
}

.admin-switch input:focus-visible + span {
  outline: 3px solid rgba(63, 107, 80, 0.2);
  outline-offset: 3px;
}

.admin-switch em {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.controls-panel .danger-button {
  align-self: flex-start;
  min-height: 42px;
  padding: 0 14px;
}

.admin-public-url {
  display: grid;
  gap: 2px;
  margin-top: 22px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  color: inherit;
  text-decoration: none;
}

.admin-public-url span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.admin-public-url strong {
  overflow: hidden;
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-library {
  padding: 26px;
}

.photo-library-head {
  align-items: center;
}

.photo-library-head p:last-child {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.admin-photo {
  min-width: 0;
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 14px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: none;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.admin-photo:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(28, 26, 23, 0.06);
}

.admin-photo-preview {
  display: block;
  overflow: hidden;
  border-radius: 10px;
  background: var(--accent-soft);
}

.admin-photo-preview img,
.admin-photo img {
  width: 118px;
  height: 118px;
  display: block;
  object-fit: cover;
  border: 0;
  border-radius: 0;
}

.admin-photo-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 3px 2px 2px 0;
}

.admin-photo-head {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.admin-photo h3 {
  margin: 0;
  overflow: hidden;
  font-size: 0.85rem;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-photo time {
  color: var(--subtle);
  font-size: 0.67rem;
}

.admin-photo-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 9px;
}

.admin-photo-meta span {
  padding: 3px 6px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 650;
}

.admin-photo .admin-photo-guest {
  display: -webkit-box;
  overflow: hidden;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.68rem;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.photo-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: auto;
  padding-top: 9px;
}

.admin-photo-action {
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--success);
  font-size: 0.68rem;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}

.admin-photo-action.is-danger {
  margin-left: auto;
  color: var(--danger);
}

.admin-footer {
  padding: 22px;
  border-top: 1px solid var(--line);
  color: var(--subtle);
  font-size: 0.7rem;
  text-align: center;
}

@media (max-width: 920px) {
  .admin-login-shell {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .admin-login-intro {
    min-height: 330px;
  }

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

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

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

@media (max-width: 640px) {
  .admin-login-page {
    padding: 0;
    place-items: stretch;
  }

  .admin-login-shell {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
  }

  .admin-login-intro {
    min-height: 250px;
    padding: 28px;
  }

  .admin-login-logo {
    width: 58px;
    height: 58px;
  }

  .admin-login-intro h1 {
    margin-bottom: 10px;
    font-size: 2.55rem;
  }

  .admin-login-intro p:last-child {
    display: none;
  }

  .admin-login-box {
    padding: 34px 24px 42px;
  }

  .admin-topbar {
    align-items: center;
    min-height: 72px;
    padding: 10px 14px;
  }

  .admin-brand img {
    width: 42px;
    height: 42px;
  }

  .admin-brand small {
    display: none;
  }

  .admin-brand strong {
    max-width: 130px;
    font-size: 1.12rem;
  }

  .admin-action-link {
    display: none;
  }

  main.admin-panel {
    width: min(100% - 24px, 1220px);
    gap: 14px;
    padding: 18px 0 46px;
  }

  .admin-overview {
    min-height: 255px;
    align-items: flex-start;
    flex-direction: column;
    padding: 24px;
  }

  .admin-overview h1 {
    font-size: 2.55rem;
  }

  .admin-overview-status {
    align-self: stretch;
    align-items: center;
    grid-template-columns: 1fr auto;
    justify-items: start;
    text-align: left;
  }

  .admin-overview-status .health-badge {
    grid-row: span 2;
    margin: 0;
  }

  .stats-grid {
    gap: 8px;
  }

  .stat-box {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
  }

  .stat-icon {
    width: 38px;
    height: 38px;
  }

  .stat-icon svg {
    width: 20px;
    height: 20px;
  }

  .stat-box strong {
    font-size: 1.7rem;
  }

  .admin-card,
  .photo-library {
    padding: 18px;
    border-radius: 15px;
  }

  .admin-card-head {
    margin-bottom: 18px;
  }

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

  .health-metric:nth-child(n) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .health-metric:last-child {
    border-bottom: 0;
  }

  .health-footnotes {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .photo-library-head {
    align-items: flex-start;
  }

  .admin-photo {
    grid-template-columns: 94px minmax(0, 1fr);
  }

  .admin-photo-preview img,
  .admin-photo img {
    width: 94px;
    height: 116px;
  }

  .admin-photo-meta span:nth-child(n + 3) {
    display: none;
  }
}

[hidden] {
  display: none !important;
}

@media (max-width: 520px) {
  .admin-header {
    align-items: stretch;
    flex-direction: column;
    padding-top: 22px;
  }

  .admin-actions {
    width: 100%;
  }

  .admin-actions > * {
    flex: 1 1 auto;
  }

  .hero-panel,
  .upload-band {
    padding: 16px;
  }

  .hero-panel h2,
  .upload-band h2,
  .gallery-section h2 {
    font-size: clamp(1.95rem, 9vw, 2.6rem);
  }
}

@media (min-width: 640px) {
  body.public-page {
    padding-bottom: 0;
  }

  .hero-panel {
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
    align-items: stretch;
    padding: 30px;
  }

  .recent-strip {
    grid-column: 1 / -1;
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .couple-showcase {
    grid-row: span 2;
  }

  .mobile-upload-bar {
    display: none;
  }

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

  .stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 920px) {
  .hero-panel {
    min-height: 310px;
  }

  .upload-card {
    align-self: center;
  }

  .couple-carousel {
    height: 100%;
    min-height: 420px;
  }

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

  .photo-tile:nth-child(8n + 1) {
    grid-column: span 2;
    aspect-ratio: 16 / 10;
  }

  .photo-tile:nth-child(8n + 5) {
    aspect-ratio: 4 / 5;
  }

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

@media (max-width: 639px) {
  .toast-stack {
    top: auto;
    right: 12px;
    bottom: 98px;
    left: 12px;
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes imageLift {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastOut {
  to {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ===== PAGE LOADER ===== */
.page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--page);
  transition: opacity 600ms ease, visibility 600ms ease;
}

.page-loader.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-ring {
  width: 48px;
  height: 48px;
  border: 2.5px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 750ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== SKELETON SHIMMER ===== */
.skeleton-tile {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--accent-soft);
  overflow: hidden;
  position: relative;
  aspect-ratio: 1 / 1;
}

.skeleton-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.65) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

.skeleton-tile:first-child {
  grid-column: span 2;
  aspect-ratio: 4 / 3;
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

@media (min-width: 920px) {
  .skeleton-tile:nth-child(8n + 1) {
    grid-column: span 2;
    aspect-ratio: 16 / 10;
  }
  .skeleton-tile:nth-child(8n + 5) {
    aspect-ratio: 4 / 5;
  }
}

/* ===== PROGRESS SHIMMER KEYFRAMES ===== */
@keyframes progressShimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}


/* ===== CONFETTI ===== */
.confetti-piece {
  position: absolute;
  top: 0;
  pointer-events: none;
  font-size: 1.1rem;
  animation: confettiFall 1.6s ease forwards;
  z-index: 1;
}

.feedback-dialog {
  overflow: hidden;
}

@keyframes confettiFall {
  0%   { transform: translateY(-10px) rotate(0deg);   opacity: 1; }
  100% { transform: translateY(100px) rotate(220deg); opacity: 0; }
}

/* ===== WELCOME SCREEN ===== */
.welcome-screen {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  background: var(--page);
  transition: opacity 480ms ease, visibility 480ms ease;
}

.welcome-screen.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.welcome-box {
  width: min(400px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  text-align: center;
}

.welcome-logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  animation: riseIn 520ms ease both;
}

.welcome-text {
  animation: riseIn 520ms ease 80ms both;
}

.welcome-text .eyebrow {
  margin-bottom: 8px;
}

.welcome-title {
  margin: 0 0 8px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 6vw, 2.2rem);
  font-weight: 520;
  line-height: 1.1;
}

.welcome-sub {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.5;
}

.welcome-form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  width: 100%;
  animation: riseIn 520ms ease 140ms both;
}

.welcome-input {
  width: 100%;
  padding: 15px 18px;
  font-size: 1.05rem;
  font-family: inherit;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--ink);
  text-align: center;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
  box-sizing: border-box;
}

.welcome-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(36, 35, 31, 0.1);
}

.welcome-input::placeholder {
  color: var(--subtle, #b8b4ab);
}

.welcome-error {
  margin: 0;
  color: #c0392b;
  font-size: 0.88rem;
}

.welcome-note {
  margin: 0;
  color: var(--subtle, #b8b4ab);
  font-size: 0.8rem;
  animation: riseIn 520ms ease 200ms both;
}

/* ===== LIKE BUTTON ===== */
.photo-tile {
  position: relative;
}

.like-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--muted);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14);
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
  z-index: 2;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.like-btn .like-heart {
  font-size: 0.85rem;
  line-height: 1;
  transition: transform 200ms ease;
  display: inline-block;
}

.like-btn.is-liked {
  color: #e03a3a;
}

.like-btn.is-liked .like-heart {
  transform: scale(1.25);
}

.like-btn:hover {
  background: rgba(255, 255, 255, 0.98);
}

.like-btn:active {
  transform: scale(0.92);
}

.like-count:empty {
  display: none;
}

.comment-badge {
  position: absolute;
  top: 7px;
  right: 7px;
  min-width: 34px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(8px);
  z-index: 2;
}

.comment-badge-icon {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.comment-badge-count {
  line-height: 1;
}

/* ===== LIGHTBOX ===== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(20, 19, 17, 0.84);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.lightbox[hidden] {
  display: none;
}

.lightbox-shell {
  position: relative;
  width: min(1240px, 100%);
  height: min(820px, calc(100vh - 48px));
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 360px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.42);
  animation: modalIn 240ms ease both;
  transition: grid-template-columns 320ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.lightbox-shell.comments-collapsed {
  grid-template-columns: minmax(0, 1fr) 0;
}

.lightbox-shell.comments-collapsed .comments-panel {
  opacity: 0;
  transform: translateX(28px);
  pointer-events: none;
  padding-right: 0;
  padding-left: 0;
  border-left-color: transparent;
}

.lightbox-photo-area {
  position: relative;
  min-width: 0;
  min-height: 0;
  display: grid;
}

.lightbox-photo-frame {
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 16px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), transparent 42%),
    #151411;
}

.comments-toggle {
  position: absolute;
  left: 50%;
  bottom: 16px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  max-width: calc(100% - 32px);
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(12px);
  cursor: pointer;
  transform: translateX(-50%);
  transition:
    transform 180ms ease,
    background-color 180ms ease,
    box-shadow 180ms ease;
}

.comments-toggle:hover {
  transform: translateX(-50%) translateY(-1px);
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.26);
}

.comments-toggle-icon {
  width: 15px;
  height: 15px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.comments-toggle span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.comments-toggle strong {
  min-width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.7rem;
  line-height: 1;
}

.lightbox-img {
  align-self: stretch;
  justify-self: stretch;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.42);
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}

.comments-panel {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 10px;
  overflow: hidden;
  padding: 18px;
  border-left: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(250, 249, 246, 0.92), rgba(255, 255, 255, 0.98) 42%),
    var(--surface);
  transition:
    opacity 260ms ease,
    transform 320ms cubic-bezier(0.2, 0.8, 0.2, 1),
    padding 320ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.comments-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.comments-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 3.4vw, 1.9rem);
  font-weight: 520;
  line-height: 1;
}

.comments-head .eyebrow {
  margin-bottom: 5px;
  font-size: 0.62rem;
}

.comments-head .count-pill {
  min-height: 28px;
  padding: 0 10px;
  font-size: 0.66rem;
}

.comments-list {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding: 3px 5px 3px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.comment-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 9px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  animation: commentIn 260ms ease both;
}

.comment-avatar {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background:
    linear-gradient(145deg, #ffffff, var(--accent-soft));
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 700;
  box-shadow: 0 10px 22px rgba(31, 30, 28, 0.08);
}

.comment-body {
  position: relative;
  min-width: 0;
  padding: 9px 10px 8px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background:
    linear-gradient(180deg, #ffffff, rgba(250, 249, 246, 0.96));
  box-shadow: 0 10px 24px rgba(31, 30, 28, 0.052);
}

.comment-body::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 13px;
  width: 9px;
  height: 9px;
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  transform: rotate(45deg);
}

.comment-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.comment-meta strong {
  color: var(--ink);
  font-size: 0.84rem;
}

.comment-meta span {
  flex: 0 0 auto;
  color: var(--subtle);
  font-size: 0.66rem;
  font-weight: 700;
}

.comment-item p,
.comments-loading,
.empty-comments {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.42;
}

.comment-item.is-deleted .comment-avatar {
  color: var(--subtle);
  background: var(--surface-soft);
}

.comment-item.is-deleted .comment-body {
  border-style: dashed;
  background: rgba(250, 249, 246, 0.72);
}

.comment-item.is-deleted .comment-body::before {
  background: rgba(250, 249, 246, 0.72);
}

.comment-item.is-deleted p {
  font-style: italic;
}

.comment-thread {
  position: relative;
  display: grid;
  gap: 8px;
  margin-left: 17px;
  padding-left: 20px;
}

.comment-thread::before {
  content: "";
  position: absolute;
  left: 0;
  top: -7px;
  bottom: 18px;
  width: 1px;
  background: linear-gradient(to bottom, var(--line-strong), transparent);
}

.comment-item.is-reply {
  grid-template-columns: 28px minmax(0, 1fr);
}

.comment-item.is-reply .comment-avatar {
  width: 28px;
  height: 28px;
  font-size: 0.82rem;
}

.comment-item.is-reply .comment-body {
  padding: 8px 10px;
}

.comment-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
}

.comment-actions button,
.reply-cancel {
  min-height: 24px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    background-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.comment-actions button:hover,
.reply-cancel:hover {
  color: var(--ink);
  background: #ffffff;
  transform: translateY(-1px);
}

.comment-actions .comment-delete {
  background: var(--danger-soft);
  color: var(--danger);
}

.comment-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 14px 34px rgba(31, 30, 28, 0.07);
}

.comment-form textarea {
  min-height: 42px;
  max-height: 96px;
  resize: vertical;
  padding: 10px 11px;
  border: 0;
  border-radius: 13px;
  background: transparent;
  box-shadow: none;
  font-size: 0.88rem;
  line-height: 1.35;
}

.comment-form textarea:focus {
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.comment-form .primary-button {
  width: auto;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  box-shadow: 0 10px 22px rgba(31, 29, 26, 0.16);
}

#commentStatus {
  grid-column: 1 / -1;
  min-height: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
}

@keyframes commentIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 760px) {
  .lightbox {
    align-items: stretch;
    padding: 8px;
  }

  .lightbox-shell {
    height: calc(100dvh - 16px);
    grid-template-columns: 1fr;
    grid-template-rows: minmax(220px, 38vh) minmax(0, 1fr);
    border-radius: 12px;
    transition: grid-template-rows 320ms cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  .lightbox-shell.comments-collapsed {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) 0;
  }

  .lightbox-shell.comments-collapsed .comments-panel {
    transform: translateY(26px);
    padding-top: 0;
    padding-bottom: 0;
    border-top-color: transparent;
  }

  .lightbox-photo-frame {
    padding: 8px;
  }

  .comments-panel {
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--line);
    border-left: 0;
    border-radius: 14px 14px 0 0;
  }

  .comments-head {
    align-items: center;
    padding-bottom: 8px;
  }

  .comments-head h2 {
    font-size: 1.42rem;
  }

  .comments-head .eyebrow {
    display: none;
  }

  .comments-list {
    gap: 8px;
    padding-right: 2px;
  }

  .comment-item {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 8px;
  }

  .comment-avatar {
    width: 30px;
    height: 30px;
    font-size: 0.86rem;
  }

  .comment-body {
    padding: 8px 9px;
    border-radius: 12px;
  }

  .comment-meta {
    align-items: start;
    flex-direction: column;
    gap: 1px;
  }

  .comment-thread {
    margin-left: 13px;
    padding-left: 15px;
  }

  .comment-form {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
    padding: 7px;
  }

  .comment-form textarea {
    min-height: 38px;
    max-height: 76px;
    padding: 9px 10px;
    font-size: 0.84rem;
  }

  .comment-form .primary-button {
    min-height: 36px;
    padding: 0 11px;
    font-size: 0.62rem;
  }

  #commentStatus {
    min-height: 16px;
    font-size: 0.7rem;
  }

  .comments-toggle {
    left: 50%;
    bottom: 13px;
    max-width: calc(100% - 28px);
    min-height: 36px;
    transform: translateX(-50%);
  }

  .comments-toggle:hover {
    transform: translateX(-50%) translateY(-1px);
  }

  .lightbox-close {
    top: 12px;
    right: 12px;
    width: 38px;
    height: 38px;
  }
}

/* ============================================================
   ATELIER UPGRADE — icons, lightbox, sheet, upload, fab, onboarding
   ============================================================ */

/* ---------- shared vector icons ---------- */
.btn-ico,
.lb-ico {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.button-symbol svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.primary-button .btn-ico,
.secondary-button .btn-ico {
  width: 17px;
  height: 17px;
}

/* ---------- like heart icon + burst ---------- */
.like-btn .like-heart-ico {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linejoin: round;
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.like-btn.is-liked {
  color: #e03a3a;
}

.like-btn.is-liked .like-heart-ico {
  fill: #e03a3a;
  stroke: #e03a3a;
}

.like-btn.burst .like-heart-ico {
  animation: heartBurst 460ms ease;
}

.like-btn.burst::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px;
  border: 2px solid #e03a3a;
  pointer-events: none;
  animation: heartRing 520ms ease forwards;
}

@keyframes heartBurst {
  0% { transform: scale(1); }
  30% { transform: scale(1.5); }
  55% { transform: scale(0.88); }
  100% { transform: scale(1); }
}

@keyframes heartRing {
  from { opacity: 0.55; transform: scale(0.55); }
  to { opacity: 0; transform: scale(1.9); }
}

/* ---------- lightbox top bar / counter ---------- */
.lightbox-topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 26px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.46), transparent);
  transition: opacity 260ms ease, transform 260ms ease;
}

.lightbox-topbar-actions {
  display: flex;
  gap: 8px;
}

.lightbox-counter {
  padding-left: 4px;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5);
}

.lb-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: background-color 160ms ease, transform 160ms ease;
}

.lb-icon-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.lb-icon-btn .lb-ico {
  width: 20px;
  height: 20px;
}

/* ---------- lightbox nav arrows ---------- */
.lightbox-nav {
  position: absolute;
  top: 50%;
  z-index: 4;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: background-color 160ms ease, opacity 220ms ease, transform 160ms ease;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.32);
}

.lightbox-nav.prev { left: 14px; }
.lightbox-nav.next { right: 14px; }

.lightbox-nav:disabled {
  opacity: 0;
  pointer-events: none;
}

.lightbox-nav .lb-ico {
  width: 22px;
  height: 22px;
}

/* ---------- lightbox action bar (like + comments) ---------- */
.lightbox-actionbar {
  position: absolute;
  left: 50%;
  bottom: 16px;
  z-index: 5;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: opacity 260ms ease, transform 260ms ease;
}

.lb-action {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(12px);
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  transition: transform 160ms ease, background-color 160ms ease, box-shadow 160ms ease, color 160ms ease;
}

.lb-action:hover {
  transform: translateY(-1px);
  background: #fff;
}

.lb-action .lb-ico {
  width: 18px;
  height: 18px;
}

/* neutralise legacy absolute positioning inside the action bar */
.lightbox-actionbar .comments-toggle,
.lightbox-actionbar .like-btn {
  position: static;
  left: auto;
  right: auto;
  bottom: auto;
  max-width: none;
  transform: none;
}

.lightbox-actionbar .comments-toggle:hover,
.lightbox-actionbar .like-btn:hover {
  transform: translateY(-1px);
}

#lightboxLike .like-heart-ico {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

#lightboxLike .like-count {
  font-size: 0.72rem;
  font-weight: 800;
}

#lightboxLike .like-count:empty {
  display: none;
}

#lightboxLike.is-liked {
  color: #e03a3a;
  border-color: rgba(224, 58, 58, 0.5);
}

#lightboxLike.is-liked .like-heart-ico {
  fill: #e03a3a;
  stroke: #e03a3a;
}

#lightboxLike.burst .like-heart-ico {
  animation: heartBurst 460ms ease;
}

/* ---------- photo frame: fade + swap + gestures ---------- */
.lightbox-photo-frame {
  position: relative;
  cursor: grab;
  touch-action: none;
}

.lightbox-img {
  opacity: 0;
  transition: opacity 320ms ease;
}

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

.lightbox-photo-frame.swap-next .lightbox-img {
  animation: swapNext 340ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.lightbox-photo-frame.swap-prev .lightbox-img {
  animation: swapPrev 340ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes swapNext {
  from { transform: translateX(7%); opacity: 0; }
  to { transform: none; opacity: 1; }
}

@keyframes swapPrev {
  from { transform: translateX(-7%); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.lightbox-shell {
  transition:
    grid-template-columns 320ms cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 260ms ease,
    opacity 260ms ease;
}

/* ---------- immersive (auto-hiding UI) ---------- */
.lightbox-photo-area.ui-hidden .lightbox-topbar {
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
}

.lightbox-photo-area.ui-hidden .lightbox-actionbar {
  opacity: 0;
  transform: translateX(-50%) translateY(12px);
  pointer-events: none;
}

.lightbox-photo-area.ui-hidden .lightbox-nav {
  opacity: 0;
  pointer-events: none;
}

/* ---------- comment send + action icons + states ---------- */
.comment-send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(31, 29, 26, 0.18);
  transition: transform 160ms ease, background-color 160ms ease;
}

.comment-send:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.comment-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.comment-send .lb-ico {
  width: 18px;
  height: 18px;
}

.comment-actions .comment-reply,
.comment-actions .comment-delete {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.comment-actions .btn-ico {
  width: 13px;
  height: 13px;
}

.reply-indicator {
  color: var(--muted);
  font-weight: 700;
}

.reply-cancel {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.reply-cancel .btn-ico {
  width: 12px;
  height: 12px;
}

.comment-sent {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--success);
  font-weight: 800;
  animation: chipPop 320ms ease both;
}

.comment-sent .btn-ico {
  width: 14px;
  height: 14px;
}

@keyframes chipPop {
  from { opacity: 0; transform: scale(0.88); }
  to { opacity: 1; transform: scale(1); }
}

.comment-item.just-sent .comment-body {
  animation: sentGlow 1300ms ease;
}

@keyframes sentGlow {
  0% { box-shadow: 0 0 0 2px var(--success); }
  100% { box-shadow: 0 10px 24px rgba(31, 30, 28, 0.052); }
}

.comment-item.is-removing {
  animation: commentOut 220ms ease forwards;
}

@keyframes commentOut {
  to { opacity: 0; transform: translateX(14px) scale(0.96); }
}

/* ---------- bottom-sheet handle ---------- */
.sheet-handle {
  display: none;
}

/* ---------- confirm upload modal (full-screen) ---------- */
.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(28, 26, 23, 0.5);
  backdrop-filter: blur(10px);
}

.confirm-modal[hidden] {
  display: none;
}

.confirm-dialog {
  position: relative;
  width: min(460px, 100%);
  max-height: calc(100dvh - 36px);
  overflow-y: auto;
  display: grid;
  gap: 12px;
  padding: 26px 24px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.34);
  text-align: center;
  animation: modalIn 300ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.confirm-dialog .eyebrow {
  margin: 0;
}

.confirm-dialog h2 {
  margin: 0 0 2px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 6vw, 2.5rem);
  font-weight: 600;
  line-height: 1.04;
}

.confirm-preview-frame {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #151411;
  box-shadow: var(--shadow-soft);
}

.confirm-preview-frame img {
  display: block;
  width: 100%;
  max-height: 46vh;
  object-fit: contain;
}

.confirm-name {
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.confirm-dialog .guest-form {
  text-align: left;
  margin-top: 2px;
}

.confirm-actions {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  margin-top: 4px;
}

.confirm-actions .secondary-button,
.confirm-actions .primary-button {
  min-height: 56px;
}

.confirm-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  transition: background-color 160ms ease, transform 160ms ease;
}

.confirm-close:hover {
  background: var(--accent-soft);
  transform: scale(1.05);
}

.confirm-close .lb-ico {
  width: 18px;
  height: 18px;
}

/* ---------- floating action button ---------- */
.fab-stack {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 30;
  display: grid;
  gap: 10px;
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity 240ms ease, transform 240ms ease;
}

.fab-stack.is-visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.fab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  box-shadow: 0 16px 38px rgba(28, 26, 23, 0.18);
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: transform 160ms ease, background-color 160ms ease;
}

.fab:hover {
  transform: translateY(-2px);
  background: #fff;
}

.fab .btn-ico {
  width: 20px;
  height: 20px;
}

/* ---------- onboarding ---------- */
.onboarding {
  position: fixed;
  inset: 0;
  z-index: 480;
  display: grid;
  place-items: end center;
  padding: 18px;
  background: rgba(28, 26, 23, 0.34);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 320ms ease;
}

.onboarding.is-open {
  opacity: 1;
}

.onboarding[hidden] {
  display: none;
}

.onboarding-card {
  width: min(420px, 100%);
  display: grid;
  gap: 10px;
  padding: 24px 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.28);
  text-align: center;
  transform: translateY(22px);
  transition: transform 400ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.onboarding.is-open .onboarding-card {
  transform: none;
}

.onboarding-spark {
  font-size: 1.5rem;
  line-height: 1;
  color: var(--muted);
}

.onboarding-card .eyebrow {
  margin: 0;
}

.onboarding-card h3 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 600;
  line-height: 1.05;
}

.onboarding-tips {
  list-style: none;
  margin: 6px 0 8px;
  padding: 0;
  display: grid;
  gap: 11px;
  text-align: left;
}

.onboarding-tips li {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.onboarding-ico {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--muted);
}

@media (min-width: 640px) {
  .onboarding {
    place-items: center;
  }
}

/* ---------- prettier skeletons ---------- */
.skeleton-tile {
  background: linear-gradient(135deg, var(--surface-soft), var(--accent-soft));
}

.skeleton-tile::after {
  background: linear-gradient(
    100deg,
    transparent 18%,
    rgba(255, 255, 255, 0.6) 50%,
    transparent 82%
  );
}

.skeleton-tile::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34px;
  height: 34px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  border: 1.5px solid rgba(31, 30, 28, 0.06);
  background:
    radial-gradient(circle at 50% 42%, rgba(31, 30, 28, 0.06) 30%, transparent 32%);
}

/* ---------- mobile lightbox bottom sheet ---------- */
@media (max-width: 760px) {
  .lightbox {
    align-items: stretch;
    padding: 0;
  }

  .lightbox-shell {
    width: 100%;
    height: 100dvh;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) 52vh;
    border: 0;
    border-radius: 0;
    transition: grid-template-rows 340ms cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  .lightbox-shell.sheet-peek { grid-template-rows: minmax(0, 1fr) 96px; }
  .lightbox-shell.sheet-half { grid-template-rows: minmax(0, 1fr) 52vh; }
  .lightbox-shell.sheet-open { grid-template-rows: 24vh minmax(0, 1fr); }

  .lightbox-photo-frame {
    padding: 6px;
  }

  .comments-panel {
    grid-template-rows: auto auto minmax(0, 1fr) auto auto;
    gap: 8px;
    padding: 6px 14px 14px;
    border-top: 1px solid var(--line);
    border-left: 0;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -18px 44px rgba(0, 0, 0, 0.16);
    opacity: 1;
    transform: none;
  }

  .sheet-handle {
    display: block;
    justify-self: center;
    width: 44px;
    height: 5px;
    margin: 6px auto 2px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: var(--line-strong);
    cursor: grab;
    touch-action: none;
  }

  .lightbox-shell.sheet-peek .comments-panel {
    opacity: 1;
    transform: none;
    padding: 6px 14px 10px;
    border-top-color: var(--line);
    pointer-events: auto;
  }

  .lightbox-shell.sheet-peek .comments-list,
  .lightbox-shell.sheet-peek .empty-comments,
  .lightbox-shell.sheet-peek .comment-form {
    display: none;
  }

  .lightbox-shell.sheet-peek .comments-head {
    border-bottom: 0;
    padding-bottom: 0;
  }

  .lightbox-actionbar {
    bottom: 12px;
  }

  .fab-stack {
    bottom: calc(86px + env(safe-area-inset-bottom));
  }
}
