:root {
  --ground: #FBF8F2;
  --card: #FFFFFF;
  --ink: #2A2622;
  --ink-soft: #4A433B;
  --muted: #6B6258;
  --gold: #86661F;
  --gold-line: #C9A961;
  --line: #EBE3D3;
  --sand: #EFE8DA;
  --error: #9B2C1F;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Jost', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

button, input { font-family: inherit; }
button { cursor: pointer; }
a { color: var(--gold); }

#app {
  max-width: 480px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 32px 22px 28px;
}

.view { flex: 1; display: flex; flex-direction: column; }
.center { align-items: center; text-align: center; }
.date { font-size: 15px; letter-spacing: 3px; color: var(--muted); text-transform: uppercase; }
.spacer { flex: 1; }

.eyebrow {
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--gold);
  font-weight: 500;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.1;
}
h1.names { font-size: 50px; }
h1.title { font-size: 38px; }
h1.task-title { font-size: 32px; line-height: 1.15; }

.rule { width: 56px; height: 1px; background: var(--gold-line); border: 0; margin: 0; }
.text { margin: 0; color: var(--ink-soft); }
.text.lead { font-size: 17px; line-height: 1.55; }
.hint { margin: 0; font-size: 14px; color: var(--muted); }
.brand { font-size: 12px; letter-spacing: 2px; color: var(--muted); }

.cover {
  height: 300px;
  background: var(--sand);
  display: flex;
  align-items: center;
  justify-content: center;
}
.cover img.logo { width: 120px; height: auto; }
.cover img.photo { width: 100%; height: 100%; object-fit: cover; }

.btn {
  width: 100%;
  min-height: 56px;
  padding: 0 20px;
  border-radius: 28px;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.btn-primary { border: 0; background: var(--gold); color: #FFFFFF; }
.btn-outline { border: 1px solid var(--gold); background: transparent; color: var(--gold); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn svg { flex: none; }

.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 13px; letter-spacing: 1.5px; color: var(--muted); text-transform: uppercase; }
.field input[type="text"] {
  height: 56px;
  padding: 0 18px;
  border: 1px solid var(--gold-line);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
  font-size: 18px;
}

.consent {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.consent input { width: 24px; height: 24px; margin: 0; flex: none; accent-color: var(--gold); }
.consent label { font-size: 15px; line-height: 1.45; color: var(--ink-soft); }

.notice {
  margin: 0;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  font-size: 15px;
  color: var(--ink-soft);
}
.notice.error { border-color: var(--error); color: var(--error); }

.sections { display: flex; flex-direction: column; gap: 10px; }
.section {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.section.open { border-color: var(--gold-line); }
.section-head {
  width: 100%;
  min-height: 56px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: transparent;
  border: 0;
  font-size: 17px;
  color: var(--ink);
  text-align: left;
}
.section.open .section-head { font-weight: 500; }
.section-head svg { flex: none; color: var(--gold); transition: transform 0.15s; }
.section.open .section-head svg { transform: rotate(180deg); }

.task {
  width: 100%;
  min-height: 76px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line);
  color: var(--ink);
  text-align: left;
}
.task-body { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.task-name { font-size: 16px; line-height: 1.35; }
.task-desc { font-size: 14px; color: var(--muted); }
.task-count { font-size: 13px; color: var(--muted); }
.task-count.has { color: var(--gold); font-weight: 500; }
.task svg { flex: none; color: var(--gold); }

.back {
  align-self: flex-start;
  min-height: 44px;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 0;
  color: var(--gold);
  font-size: 16px;
}

.stack { display: flex; flex-direction: column; gap: 12px; }
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }

.count-line { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--gold); font-weight: 500; }
.count-line.none { color: var(--muted); font-weight: 400; }

.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tile {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: var(--sand);
}
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile-del {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
}
.tile-del span {
  width: 28px;
  height: 28px;
  border-radius: 14px;
  background: rgba(42, 38, 34, 0.78);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tile.pending {
  background: var(--card);
  border: 1px solid var(--gold-line);
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  font-size: 12px;
  line-height: 1.3;
  color: var(--ink-soft);
}
.tile.failed { border-color: var(--error); color: var(--error); }
.bar { height: 4px; background: var(--line); border-radius: 2px; }
.bar div { height: 4px; background: var(--gold); border-radius: 2px; width: 0; }
.retry {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--gold);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
}

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

.loading { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--muted); }

/* ---------- Verwaltung ---------- */
#app.admin { max-width: 980px; }
.screen.narrow { width: 100%; max-width: 480px; margin: 0 auto; }

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--card);
}
.topbar-title { flex: 1; font-size: 13px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }

h2 { margin: 0; font-family: var(--serif); font-weight: 600; font-size: 24px; line-height: 1.2; }

.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack.tight { gap: 6px; }
.grow { flex: 1; min-width: 0; }
.btn.auto { width: auto; min-height: 48px; text-decoration: none; }
.btn-danger { border: 1px solid var(--error); background: transparent; color: var(--error); }

.link-btn {
  min-height: 44px;
  padding: 0 6px;
  border: 0;
  background: transparent;
  color: var(--gold);
  font-size: 15px;
  font-weight: 500;
}
.link-btn.danger { color: var(--error); }

.icon-btn {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  font-size: 18px;
}
.icon-btn:disabled { opacity: 0.35; cursor: default; }

.field input:not([type="checkbox"]), .field select, .field textarea,
.task-edit input, .add-row input {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid var(--gold-line);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
  font-family: inherit;
  font-size: 16px;
}
.task-edit input.section-name { font-weight: 500; font-size: 18px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.card {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  text-align: left;
  color: var(--ink);
}
.card-title { font-family: var(--serif); font-size: 26px; line-height: 1.15; }

.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--card);
  color: var(--ink);
  font-size: 15px;
}
.tab.active { border-color: var(--gold); background: var(--gold); color: #FFFFFF; }

.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.panel { padding: 18px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.label { font-size: 13px; letter-spacing: 1.5px; color: var(--muted); text-transform: uppercase; }
.url { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 14px; color: var(--ink-soft); }
.qr { width: 220px; max-width: 100%; }
.qr svg { width: 100%; height: auto; display: block; }

.task-edit { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.controls { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.photo-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.photo-thumb {
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 10px;
  overflow: hidden;
  background: var(--sand);
  display: flex;
  align-items: center;
  justify-content: center;
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-meta { display: flex; flex-direction: column; gap: 2px; font-size: 14px; line-height: 1.35; }

.task-line { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); }
.task-line:first-child { border-top: 0; }
.add-row { display: flex; gap: 8px; flex-wrap: wrap; }
.add-row input { flex: 1; min-width: 180px; }

/* ---------- Regeln, Galerie, Hinweise ---------- */
.rules { padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.rules ul { margin: 8px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 15px; line-height: 1.4; color: var(--ink-soft); }
.gtile { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.gtile .tile { width: 100%; padding: 0; border: 0; }
.gcap { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 13px; color: var(--ink-soft); min-height: 44px; }
.gcap span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { align-self: flex-start; padding: 2px 10px; border-radius: 10px; background: var(--error); color: #FFFFFF; font-size: 12px; }
.prose { display: flex; flex-direction: column; gap: 14px; }
.prose h2 { margin-top: 10px; }
.prose p, .prose ul { margin: 0; color: var(--ink-soft); }
.prose ul { padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }

/* ---------- Titelbild und QR-Karte ---------- */
.cover-preview { width: 100%; max-height: 220px; object-fit: cover; border-radius: 10px; display: block; }

.sheet { display: flex; justify-content: center; padding: 0 0 40px; overflow-x: auto; }
.sheet.four { display: grid; grid-template-columns: 105mm 105mm; width: 210mm; margin: 0 auto; justify-content: start; }
.print-card { width: 105mm; height: 148mm; padding: 5mm; background: #FFFFFF; color: var(--ink); overflow: hidden; flex: none; }
.sheet.four .print-card { height: 148.5mm; }
.pc-frame {
  height: 100%;
  padding: 5mm;
  border: 0.3mm solid var(--gold-line);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.2mm;
  text-align: center;
}
.pc-logo { width: 13mm; height: auto; }
.pc-eyebrow { font-size: 7.5pt; letter-spacing: 0.6mm; text-transform: uppercase; color: var(--gold); font-weight: 500; }
.pc-eyebrow.muted { color: var(--muted); font-weight: 400; }
.pc-title { font-family: var(--serif); font-weight: 500; font-size: 22pt; line-height: 1.05; }
.pc-text { margin: 0; font-size: 9.5pt; line-height: 1.35; color: var(--ink-soft); max-width: 78mm; }
.pc-qr { width: 38mm; }
.pc-qr svg { width: 100%; height: auto; display: block; }

@media screen {
  .print-card { box-shadow: 0 1px 6px rgba(42, 38, 34, 0.15); }
}
@media print {
  .no-print { display: none !important; }
  html, body { background: #FFFFFF; }
  #app, #app.admin { max-width: none; min-height: 0; display: block; }
  .sheet { padding: 0; overflow: visible; }
  .print-card { break-inside: avoid; }
}

/* ---------- Startseite ---------- */
#app.landing { max-width: 720px; padding: 0 22px; gap: 0; }
.lp-hero { padding: 56px 0 40px; display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; }
.lp-hero h1.names { font-size: 44px; }
.lp-actions { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.lp-actions .btn { text-decoration: none; }
.lp-section { padding: 36px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px; }
.lp-section h2 { font-size: 30px; font-weight: 500; }
.lp-steps { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 18px; }
.lp-steps li { display: flex; gap: 16px; align-items: flex-start; }
.lp-steps p { margin: 4px 0 0; color: var(--ink-soft); }
.lp-num {
  flex: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--gold-line);
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 24px;
  color: var(--gold);
}
.lp-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; color: var(--ink-soft); }
.lp-guest { background: var(--card); border: 1px solid var(--gold-line); border-radius: 14px; padding: 26px 20px; margin: 8px 0 36px; }
.lp-footer { padding: 26px 0 40px; border-top: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.lp-footer nav { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; font-size: 15px; }
.lp-footer nav a { min-height: 44px; display: flex; align-items: center; }

.pc-url { font-size: 7.5pt; color: var(--muted); letter-spacing: 0.2mm; }

/* ---------- Handy-Darstellungen auf der Startseite ---------- */
.ph-row { display: flex; gap: 22px; justify-content: center; align-items: flex-start; flex-wrap: wrap; margin-top: 10px; }
.ph-fig { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.ph-fig figcaption { font-size: 14px; color: var(--muted); }
.ph {
  width: 204px;
  height: 420px;
  border: 6px solid var(--ink);
  border-radius: 30px;
  background: var(--ground);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 28px rgba(42, 38, 34, 0.18);
  font-size: 9px;
  line-height: 1.4;
  color: var(--ink);
}
.ph-cover { height: 132px; background: var(--sand); display: flex; align-items: center; justify-content: center; flex: none; }
.ph-body { flex: 1; padding: 16px 13px 14px; display: flex; flex-direction: column; gap: 8px; }
.ph-center { align-items: center; text-align: center; }
.ph-eye { font-size: 6.5px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--gold); font-weight: 500; }
.ph-serif { font-family: var(--serif); font-weight: 500; line-height: 1.1; }
.ph-xl { font-size: 27px; }
.ph-lg { font-size: 21px; }
.ph-md { font-size: 16px; line-height: 1.15; }
.ph-date { font-size: 7.5px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--muted); }
.ph-rule { width: 30px; height: 1px; background: var(--gold-line); }
.ph-txt { color: var(--ink-soft); }
.ph-center-text { text-align: center; margin-top: auto; color: var(--muted); }
.ph-btn { margin-top: auto; width: 100%; padding: 8px 0; border-radius: 16px; background: var(--gold); color: #FFFFFF; font-weight: 500; text-align: center; }
.ph-body > .ph-btn + .ph-btn, .ph-md + .ph-btn { margin-top: 0; }
.ph-btn.ph-outline { background: transparent; color: var(--gold); border: 1px solid var(--gold); padding: 7px 0; }
.ph-pill, .ph-card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; }
.ph-pill { padding: 7px 10px; display: flex; justify-content: space-between; }
.ph-pill span, .ph-card-head span { color: var(--gold); }
.ph-card { border-color: var(--gold-line); }
.ph-card-head { padding: 7px 10px; display: flex; justify-content: space-between; font-weight: 500; }
.ph-task { padding: 7px 10px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; }
.ph-task em { font-style: normal; font-size: 7.5px; color: var(--gold); font-weight: 500; }
.ph-task i { font-style: normal; font-size: 7.5px; color: var(--muted); }
.ph-line { height: 1px; background: var(--line); margin: 2px 0; }
.ph-ok { color: var(--gold); font-weight: 500; }
.ph-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.ph-tile { aspect-ratio: 1; border-radius: 6px; background: linear-gradient(135deg, #D9CDB4, #EFE8DA); }
.ph-tile2 { background: linear-gradient(135deg, #C9B892, #E6DCC6); }
.ph-up { background: var(--card); border: 1px solid var(--gold-line); padding: 4px; display: flex; flex-direction: column; justify-content: flex-end; gap: 3px; font-size: 5.5px; line-height: 1.2; }
.ph-up b { display: block; height: 2px; background: var(--line); border-radius: 1px; }
.ph-up u { display: block; width: 60%; height: 2px; background: var(--gold); border-radius: 1px; }
