:root {
  --bg: #f7f1e7;
  --paper: #fffaf1;
  --paper-2: #f1e4d0;
  --ink: #30271f;
  --muted: #786858;
  --gold: #b48a4a;
  --gold-dark: #8a6432;
  --green: #405343;
  --wine: #6e2f2f;
  --border: rgba(80, 58, 35, 0.16);
  --shadow: 0 18px 50px rgba(49, 35, 22, 0.14);
  --radius: 28px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Georgia, 'Times New Roman', serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(180, 138, 74, 0.18), transparent 32%),
    radial-gradient(circle at bottom right, rgba(64, 83, 67, 0.16), transparent 36%),
    linear-gradient(180deg, #fbf5eb 0%, var(--bg) 45%, #efe1cc 100%);
}

body.locked .app { display: none; }
body:not(.locked) .gate { display: none; }

h1, h2, h3, p { margin-top: 0; }
button, input, textarea { font: inherit; }

.eyebrow {
  margin: 0 0 12px;
  color: var(--gold-dark);
  font-family: Arial, sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 2.4px;
  text-transform: uppercase;
}
.small, p { color: var(--muted); line-height: 1.62; }

.gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.gate-card,
.panel,
.hero-card,
.photo-frame,
.gallery-card,
.admin-card,
.upload-hero {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 250, 241, .88);
  box-shadow: var(--shadow);
}
.gate-card::before,
.panel::before,
.hero-card::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(180, 138, 74, .23);
  border-radius: calc(var(--radius) - 8px);
  pointer-events: none;
}
.gate-card {
  width: min(440px, 100%);
  padding: 34px 26px;
  text-align: center;
}
.monogram, .brand-mark {
  border-radius: 50%;
  border: 1px solid rgba(180,138,74,.52);
  color: var(--gold-dark);
  background: rgba(255,250,241,.75);
  display: grid;
  place-items: center;
}
.monogram {
  width: 74px; height: 74px;
  margin: 0 auto 18px;
  font-size: 27px;
  letter-spacing: -1px;
}
.brand-mark { width: 38px; height: 38px; }
.gate h1 { font-size: clamp(40px, 9vw, 58px); line-height: .96; font-weight: 400; margin-bottom: 14px; }

input, textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 15px;
  background: rgba(255,255,255,.72);
  color: var(--ink);
  outline: none;
}
textarea { resize: vertical; }
input:focus, textarea:focus { border-color: rgba(180,138,74,.72); box-shadow: 0 0 0 4px rgba(180,138,74,.13); }

button, .button {
  border: 0;
  border-radius: 999px;
  padding: 14px 18px;
  cursor: pointer;
  background: var(--green);
  color: #fffaf1;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: Arial, sans-serif;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 10px 24px rgba(64, 83, 67, .22);
  transition: transform .18s ease, box-shadow .18s ease;
}
button:hover, .button:hover { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(64, 83, 67, .28); }
.button.secondary, button.secondary { background: rgba(255,250,241,.76); color: var(--green); border: 1px solid rgba(64,83,67,.2); box-shadow: none; }
.button.gold, button.gold { background: var(--gold-dark); }

.password-row { display: flex; gap: 10px; margin-top: 22px; }
.error { display: none; margin-top: 13px; color: var(--wine); font-family: Arial, sans-serif; font-size: 13px; font-weight: 800; }

.app { min-height: 100vh; padding-bottom: 94px; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid rgba(80,58,35,.1);
  background: rgba(247, 241, 231, .88);
  backdrop-filter: blur(16px);
}
.topbar-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: 13px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  min-width: max-content;
}
.brand-label { font-family: Arial, sans-serif; font-size: 13px; font-weight: 900; letter-spacing: .4px; text-transform: uppercase; }

.nav {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  white-space: nowrap;
  color: var(--muted);
  text-decoration: none;
  font-family: Arial, sans-serif;
  font-size: 13px;
  font-weight: 800;
  padding: 10px 12px;
  border-radius: 999px;
}
.nav a.active, .nav a:hover { background: rgba(180,138,74,.13); color: var(--ink); }
.nav a.nav-primary { background: rgba(138,100,50,.14); color: var(--gold-dark); }
.nav a.nav-primary.active, .nav a.nav-primary:hover { background: var(--gold-dark); color: #fffaf1; }
.menu-toggle {
  display: none;
  border: 1px solid rgba(80,58,35,.14);
  background: rgba(255,250,241,.74);
  color: var(--ink);
  box-shadow: none;
  padding: 10px 13px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: .4px;
  text-transform: uppercase;
}


.page {
  display: none;
  max-width: 1160px;
  margin: 0 auto;
  padding: 28px 20px 64px;
  animation: fadeIn .22s ease;
}
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.hero-grid { display: grid; grid-template-columns: 1.08fr .92fr; gap: 22px; align-items: stretch; }
.hero-card {
  min-height: 610px;
  padding: clamp(28px, 5vw, 58px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.hero-card::after {
  content: "";
  position: absolute;
  right: -80px;
  bottom: -90px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(180,138,74,.28), transparent 63%);
  pointer-events: none;
}
.hero h1 { font-size: clamp(56px, 13vw, 116px); line-height: .92; font-weight: 400; margin-bottom: 18px; }
.quote { max-width: 620px; color: var(--green); font-size: clamp(20px, 3vw, 28px); line-height: 1.34; }

.mobile-hero-cta { display: none; margin: 14px 0; }
.countdown-label { margin-bottom: 8px; }
.countdown {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.count-box, .info-card, .timeline-item, .menu-card {
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(255,255,255,.46);
  padding: 18px;
}
.count-box strong { display: block; color: var(--green); font-family: Arial, sans-serif; font-size: clamp(26px, 6vw, 42px); line-height: 1; }
.count-box span { display: block; margin-top: 6px; color: var(--muted); font-family: Arial, sans-serif; font-size: 11px; font-weight: 900; letter-spacing: 1px; text-transform: uppercase; }

.photo-frame {
  min-height: 294px;
  background: linear-gradient(180deg, rgba(48,39,31,.02), rgba(48,39,31,.14));
  padding: 14px;
}
.photo-frame.main-photo { min-height: 610px; }
.photo-frame img { width: 100%; height: 100%; min-height: 250px; object-fit: cover; display: block; border-radius: 20px; filter: sepia(.08) saturate(.88); }
.photo-frame.main-photo img { min-height: 580px; }
.photo-caption {
  position: absolute;
  left: 28px;
  right: 28px;
  bottom: 28px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(48,39,31,.48);
  color: white;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.18);
}
.photo-caption p { color: rgba(255,255,255,.84); margin-bottom: 0; }

.couple-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 22px;
}
.couple-card {
  position: relative;
  overflow: hidden;
  min-height: 230px;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: rgba(255,250,241,.7);
  box-shadow: 0 14px 34px rgba(49,35,22,.1);
  padding: 12px;
}
.couple-card img {
  width: 100%;
  height: 100%;
  min-height: 206px;
  object-fit: cover;
  display: block;
  border-radius: 18px;
  filter: sepia(.08) saturate(.9);
}

.panel { padding: clamp(26px, 4vw, 42px); }
.page-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-title h2 { font-size: clamp(38px, 7vw, 68px); font-weight: 400; margin-bottom: 0; }

.cards-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.info-card h3, .menu-card h3 { color: var(--green); margin-bottom: 7px; }
.timeline { display: grid; gap: 12px; }
.timeline-item { display: grid; grid-template-columns: 92px 1fr; gap: 18px; align-items: start; }
.time { color: var(--gold-dark); font-family: Arial, sans-serif; font-weight: 900; letter-spacing: .6px; }

.map-placeholder {
  min-height: 340px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 22px;
  color: var(--green);
  background:
    linear-gradient(135deg, rgba(64,83,67,.15), rgba(180,138,74,.14)),
    repeating-linear-gradient(45deg, rgba(255,255,255,.28) 0 10px, rgba(255,255,255,.12) 10px 20px);
}

.gallery-hero {
  display: grid;
  grid-template-columns: .95fr 1.05fr;
  gap: 18px;
  align-items: stretch;
  margin-bottom: 22px;
}
.camera-cta, .upload-hero {
  padding: clamp(26px, 4vw, 44px);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(64,83,67,.94), rgba(48,39,31,.92)),
    radial-gradient(circle at top right, rgba(180,138,74,.34), transparent 40%);
  color: #fffaf1;
  box-shadow: var(--shadow);
  min-height: 360px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  position: relative;
}
.camera-cta h2, .upload-hero h1 { font-size: clamp(40px, 7vw, 76px); line-height: .95; font-weight: 400; margin-bottom: 14px; }
.camera-cta p, .upload-hero p { color: rgba(255,250,241,.78); }
.camera-icon { font-size: 56px; line-height: 1; margin-bottom: 18px; }

.upload-box { display: grid; gap: 14px; }
.file-drop {
  border: 1.5px dashed rgba(180,138,74,.55);
  border-radius: 22px;
  background: rgba(255,255,255,.42);
  padding: 26px;
  text-align: center;
  cursor: pointer;
}
.file-drop input { display: none; }
.gallery-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 22px 0 14px;
}
.gallery-grid, .admin-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.admin-grid { align-items: start; }
.gallery-card, .admin-card { padding: 0; background: rgba(255,255,255,.52); }
.gallery-card img, .gallery-card video, .admin-card img, .admin-card video {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  background: #ddd;
}
.gallery-card.large { grid-column: span 2; grid-row: span 2; }
.gallery-card.large img, .gallery-card.large video { height: 452px; }
.photo-meta { padding: 12px; color: var(--muted); font-family: Arial, sans-serif; font-size: 12px; }
.empty { grid-column: 1/-1; border: 1px dashed var(--border); border-radius: 18px; padding: 22px; color: var(--muted); text-align: center; font-family: Arial, sans-serif; }

.form-embed {
  margin-top: 24px;
  border: 1px solid var(--border);
  border-radius: 24px;
  overflow: hidden;
  background: rgba(255, 250, 241, .72);
  padding: 8px;
}
.form-embed iframe {
  width: 100%;
  min-height: 892px;
  border: 0;
  display: block;
  border-radius: 18px;
}

.admin-login { display: flex; gap: 10px; max-width: 520px; margin-top: 18px; }
.admin-panel { display: none; }
.admin-panel.active { display: block; }
.admin-toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0; }
.admin-select { position: absolute; top: 10px; left: 10px; width: 22px; height: 22px; accent-color: var(--green); }
.status { position: absolute; top: 10px; right: 10px; border-radius: 999px; padding: 6px 8px; background: rgba(255,250,241,.92); color: var(--gold-dark); font-family: Arial, sans-serif; font-size: 11px; font-weight: 900; }

.bottom-tabs {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 40;
  width: min(720px, calc(100% - 24px));
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(255,250,241,.88);
  backdrop-filter: blur(16px);
  box-shadow: 0 16px 42px rgba(49,35,22,.15);
}
.bottom-tabs a {
  border-radius: 18px;
  padding: 12px 8px;
  text-align: center;
  color: var(--muted);
  text-decoration: none;
  font-family: Arial, sans-serif;
  font-size: 11px;
  font-weight: 900;
}
.bottom-tabs a.active { background: var(--green); color: white; }
.bottom-tabs a.bottom-primary { background: rgba(138,100,50,.16); color: var(--gold-dark); }
.bottom-tabs a.bottom-primary.active { background: var(--gold-dark); color: #fffaf1; }

.back-link { margin-left: auto; }

@media (min-width: 981px) {
  .bottom-tabs { display: none; }
}

@media (max-width: 980px) {
  .hero-grid, .gallery-hero { grid-template-columns: 1fr; }
  .photo-frame.main-photo { min-height: 360px; }
  .photo-frame.main-photo img { min-height: 330px; }
  .cards-grid { grid-template-columns: 1fr; }
  .gallery-grid, .admin-grid { grid-template-columns: repeat(2, 1fr); }
  .couple-strip { grid-template-columns: 1fr; }
  .topbar-inner { flex-direction: column; align-items: stretch; }
  .nav { justify-content: flex-start; }
}

@media (max-width: 760px) {
  .app { padding-bottom: 104px; }
  .topbar-inner {
    position: relative;
    flex-direction: row;
    align-items: center;
    padding: 12px 14px;
  }
  .menu-toggle { display: inline-flex; margin-left: auto; }
  .topbar .nav {
    display: none;
    position: absolute;
    left: 12px;
    right: 12px;
    top: calc(100% + 8px);
    z-index: 60;
    flex-direction: column;
    gap: 6px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: rgba(255,250,241,.96);
    box-shadow: var(--shadow);
  }
  .topbar.menu-open .nav { display: flex; }
  .topbar .nav a {
    width: 100%;
    padding: 13px 14px;
    border-radius: 16px;
  }
  .page { padding: 16px 14px 74px; }
  .mobile-hero-cta { display: block; }
  .mobile-hero-cta .button { width: 100%; }
  .hero-card, .panel { padding: 26px 20px; }
  .hero-card { min-height: auto; }
  .hero h1 { font-size: clamp(54px, 18vw, 72px); }
  .quote { font-size: 21px; }
  .photo-frame { min-height: 300px; }
  .photo-caption { left: 22px; right: 22px; bottom: 22px; }
  .countdown-label { margin-bottom: 8px; }
  .countdown { grid-template-columns: repeat(4, 1fr); gap: 7px; }
  .count-box { padding: 12px 6px; border-radius: 16px; text-align: center; }
  .count-box strong { font-size: clamp(22px, 7vw, 30px); }
  .count-box span { font-size: 9px; letter-spacing: .8px; }
  .page-title { display: block; }
  .timeline-item { grid-template-columns: 1fr; gap: 4px; }
  .gallery-card.large { grid-column: span 1; grid-row: span 1; }
  .gallery-card.large img, .gallery-card.large video, .gallery-card img, .gallery-card video, .admin-card img, .admin-card video { height: 172px; }
  .bottom-tabs { width: min(620px, calc(100% - 24px)); border-radius: 20px; bottom: 12px; }
  .bottom-tabs a { font-size: 10px; padding: 11px 4px; }
  .bottom-tabs a.long-label { font-size: 9px; }
  .back-link { margin-left: 0; }
  .in-page-back { margin-bottom: 16px; }
}

@media (max-width: 390px) {
  .bottom-tabs { width: calc(100% - 16px); gap: 4px; padding: 6px; }
  .bottom-tabs a { font-size: 9px; padding: 10px 2px; }
  .bottom-tabs a.long-label { font-size: 8px; }
}


.timeline-note {
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(255,255,255,.56);
  padding: 18px;
  color: var(--muted);
  font-family: Arial, sans-serif;
  line-height: 1.6;
}
.timeline-note strong { color: var(--green); }

.map-placeholder.venue-photo {
  min-height: 420px;
  text-align: left;
  place-items: stretch;
  background:
    linear-gradient(180deg, rgba(34, 28, 21, .34), rgba(34, 28, 21, .48)),
    url('../images/retyrada-dojazd.jpg') center/cover no-repeat,
    linear-gradient(135deg, rgba(64,83,67,.15), rgba(180,138,74,.14));
}
.map-card {
  max-width: 460px;
  margin: auto 0 0 auto;
  padding: 22px;
  border-radius: 22px;
  background: rgba(255,250,241,.92);
  border: 1px solid rgba(255,255,255,.22);
  box-shadow: 0 18px 40px rgba(49,35,22,.16);
}
.map-card h3 { margin-bottom: 10px; color: var(--ink); }
.map-card p { color: var(--muted); }
.map-card .button { margin-top: 8px; }

.admin-section-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0 12px;
}
.admin-tab {
  background: rgba(255,250,241,.76);
  color: var(--green);
  border: 1px solid rgba(64,83,67,.2);
  box-shadow: none;
}
.admin-tab.active {
  background: var(--green);
  color: #fffaf1;
}
.admin-count {
  display: inline-flex;
  min-width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  border-radius: 999px;
  padding: 0 7px;
  background: rgba(255,255,255,.18);
  font-size: 11px;
  font-weight: 900;
}
.admin-tab:not(.active) .admin-count {
  background: rgba(64,83,67,.08);
}
.admin-section-hint {
  margin-bottom: 14px;
}

@media (max-width: 760px) {
  .map-placeholder.venue-photo {
    min-height: 360px;
    padding: 16px;
  }
  .map-card {
    max-width: none;
    margin: auto 0 0 0;
    padding: 18px;
  }
}

/* FINAL MODULE ZDJĘĆ v18 — ZłapMoment-style bez opisów zdjęć */

/* Upload page */
.upload-phone-shell {
  width: min(860px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 18px;
}

.upload-welcome-card {
  border-radius: 28px;
  padding: 26px 25px 28px;
  min-height: 300px;
  background:
    linear-gradient(145deg, rgba(64,83,67,.96), rgba(48,39,31,.92)),
    radial-gradient(circle at 80% 20%, rgba(184,140,66,.26), transparent 42%);
  color: #fffaf1;
  box-shadow: 0 18px 50px rgba(49,35,22,.13);
}

.upload-eyebrow {
  color: rgba(255,250,241,.74) !important;
}

.upload-welcome-card h1 {
  margin: 0 0 14px;
  font-size: clamp(36px, 8vw, 58px);
  line-height: 1.05;
  font-weight: 400;
}

.upload-welcome-card p {
  max-width: 680px;
  margin: 0;
  color: rgba(255,250,241,.84);
  line-height: 1.55;
  font-size: 15px;
}

.upload-details-panel h2,
.upload-preview-panel h2,
.wishes-panel h2 {
  margin: 0 0 10px;
  font-weight: 400;
  font-size: clamp(32px, 6vw, 46px);
}

.upload-intro {
  margin: 0 0 16px;
  color: var(--muted);
  font-family: Arial, sans-serif;
  font-size: 13px;
  line-height: 1.45;
}

.upload-box input[type="file"] {
  display: none;
}

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

.upload-picker {
  width: 100%;
  border: 1px solid rgba(154,116,45,.22);
  background: rgba(255,255,255,.48);
  color: var(--ink);
  border-radius: 18px;
  min-height: 76px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(49,35,22,.05);
}

.upload-picker-icon {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  background: rgba(154,116,45,.11);
  color: var(--gold);
  font-family: Arial, sans-serif;
  font-weight: 900;
  font-size: 22px;
  border: 1px solid rgba(154,116,45,.18);
}

.upload-picker strong {
  display: block;
  font-family: Arial, sans-serif;
  font-size: 15px;
  color: var(--ink);
  margin-bottom: 3px;
}

.upload-picker span span {
  display: block;
  font-family: Arial, sans-serif;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}

.file-summary-card {
  border: 1px dashed rgba(80,58,35,.22);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(255,255,255,.44);
  color: var(--muted);
}

.upload-box input,
.wish-form input,
.wish-form textarea {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: rgba(255,255,255,.62);
  color: var(--ink);
  padding: 12px 14px;
  font: inherit;
}

.wish-form textarea {
  min-height: 86px;
  resize: vertical;
}

.upload-cat-label {
  color: var(--muted);
  font-family: Arial, sans-serif;
  font-size: 12px;
  font-weight: 900;
  margin: 2px 0 -4px;
}

.upload-cat-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 0 8px;
  scrollbar-width: thin;
}

.upload-cat,
.gallery-filter {
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  padding: 9px 12px;
  background: rgba(255,255,255,.72);
  color: var(--muted);
  font-family: Arial, sans-serif;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.upload-cat.active,
.gallery-filter.active {
  background: var(--gold);
  color: #fffaf1;
}

.upload-form-v18 button[type="submit"],
.wish-form button[type="submit"] {
  min-height: 54px;
  border: 0;
  border-radius: 999px;
  background: var(--green);
  color: white;
  font-family: Arial, sans-serif;
  font-weight: 900;
  cursor: pointer;
}

.preview-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.preview-head h2 {
  margin: 0;
  font-weight: 400;
  font-size: 30px;
}

.mini-gallery-grid,
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2px;
  overflow: hidden;
  border-radius: 14px;
  background: rgba(80,58,35,.08);
  align-items: stretch;
}

.mini-gallery-tile,
.gallery-card {
  position: relative;
  border: 0;
  padding: 0;
  aspect-ratio: 1 / 1;
  background: #ddd;
  overflow: hidden;
  cursor: zoom-in;
  border-radius: 0;
  box-shadow: none;
}

.mini-gallery-tile img,
.gallery-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
  filter: sepia(.02) saturate(.98);
}

.more-gallery-button {
  width: max-content;
  margin: 16px auto 0;
  display: flex;
}

.gallery-filters {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 0 12px;
  margin-top: -2px;
  scrollbar-width: thin;
}

/* ukrywamy stare elementy z poprzednich wersji galerii */
.photo-name-badge,
.gallery-card .photo-meta,
.gallery-card .photo-caption,
.gallery-card .photo-author {
  display: none !important;
}

.wish-form {
  display: grid;
  gap: 10px;
}

.caption-counter {
  margin-top: -4px;
  color: var(--muted);
  font-family: Arial, sans-serif;
  font-size: 12px;
  text-align: right;
}

.caption-counter.is-warning {
  color: var(--wine);
  font-weight: 800;
}

.wishes-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.wish-card {
  background: white;
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 10px 28px rgba(49,35,22,.07);
  font-family: Arial, sans-serif;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #e47575;
  color: white;
  display: grid;
  place-items: center;
  font-weight: 900;
  float: left;
  margin-right: 12px;
}

.wish-card strong {
  display: block;
  margin-bottom: 5px;
}

.wish-card small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 6px;
}

.wish-card p {
  margin: 0;
  color: #333;
  line-height: 1.45;
}

/* Fullscreen photo viewer */
.photo-viewer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  background: #050505;
  color: white;
}

.photo-viewer.open {
  display: block;
}

.viewer-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 22px 20px 64px;
  background: linear-gradient(180deg, rgba(0,0,0,.78), rgba(0,0,0,.36), transparent);
}

.viewer-title {
  font-family: Arial, sans-serif;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.35;
}

.viewer-title span {
  display: block;
  margin-top: 3px;
  font-size: 13px;
  font-weight: 800;
  opacity: .82;
}

.viewer-close {
  border: 0;
  background: transparent;
  color: white;
  font-size: 36px;
  line-height: 1;
  padding: 0 4px;
  cursor: pointer;
}

.viewer-media {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

.viewer-media img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.viewer-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  border: 0;
  background: rgba(0,0,0,.12);
  color: white;
  font-size: 44px;
  width: 58px;
  height: 80px;
  cursor: pointer;
}

.viewer-arrow.prev {
  left: 0;
}

.viewer-arrow.next {
  right: 0;
}

.viewer-heart {
  position: absolute;
  right: 22px;
  bottom: 28px;
  z-index: 2;
  font-size: 36px;
  line-height: 1;
}

.lightbox-open {
  overflow: hidden;
}

/* backward compatibility for old lightbox classes */
.lightbox,
.lightbox-card,
.lightbox-image,
.lightbox-info,
.lightbox-close {
  display: none;
}

@media (min-width: 760px) {
  .photo-viewer {
    left: 50%;
    transform: translateX(-50%);
    width: min(430px, 100%);
  }
}

@media (max-width: 760px) {
  .upload-phone-shell {
    gap: 18px;
  }

  .upload-details-panel h2,
  .upload-preview-panel h2,
  .wishes-panel h2 {
    font-size: 34px;
  }

  .upload-welcome-card h1 {
    font-size: 36px;
  }

  .upload-welcome-card {
    min-height: 290px;
  }
}


/* FINAL TEXT/POLISH v19 */

.camera-icon {
  display: none !important;
}

.upload-welcome-card .upload-eyebrow {
  display: none !important;
}

.upload-welcome-card h1 {
  margin-top: 0;
}

.file-summary-card.has-files {
  border-color: rgba(64,83,67,.24);
  background: rgba(64,83,67,.10);
  color: var(--green);
  font-weight: 800;
}

.wish-intro {
  margin: -2px 0 14px;
  color: var(--muted);
  font-family: Arial, sans-serif;
  font-size: 13px;
  line-height: 1.45;
}

/* Delikatniejsze teksty w sekcji galerii */
.camera-cta .eyebrow,
.gallery-panel .eyebrow {
  display: none !important;
}

.camera-cta h2,
.gallery-panel h2 {
  margin-top: 0;
}

.camera-cta p,
.gallery-panel p {
  line-height: 1.6;
}


/* FIX v20: mniej pustej przestrzeni pod zakładkami i mniejsze minimum formularza RSVP */
.app {
  padding-bottom: 72px;
}

.page {
  padding-bottom: 28px;
}

.form-embed iframe {
  min-height: 70vh;
}

@media (max-width: 760px) {
  .app {
    padding-bottom: 78px;
  }

  .page {
    padding-bottom: 28px;
  }
}
