/* Wedding photo app: shared shell.
   Palette matches karten-demo.html so cards and app read as one set. */
:root {
  --paper: #fdfbf7;
  --champagne: #f3e8d7;
  --champagne-deep: #e9d9bf;
  --gold: #b5924c;
  --gold-soft: #cfb37e;
  --ink: #4a4238;
  --ink-soft: #8a7f6f;
  --bg: #f6f2ea;
  --serif: "Didot", "Bodoni 72", "Playfair Display", Georgia, serif;
  --sans: "Avenir Next", "Helvetica Neue", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(74, 66, 56, 0.1);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  padding-bottom: 92px;
}

/* ---------------------------------------------------------------- header */
.topbar {
  background: var(--paper);
  border-bottom: 1px solid var(--champagne-deep);
  padding: 16px 20px 14px;
  text-align: center;
}
.topbar .mark { width: 52px; height: 52px; display: block; margin: 0 auto 4px; }
.topbar .names {
  font-family: var(--serif);
  font-size: 19px;
  letter-spacing: 1px;
}
.topbar .datum {
  font-size: 10.5px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 4px;
}

/* Tageswechsel: Standesamt oder Kirche */
.dayswitch {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 12px;
}
.dayswitch button {
  border: 1px solid var(--champagne-deep);
  background: transparent;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 13px;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  line-height: 1.2;
}
.dayswitch button span { opacity: .6; font-size: 11.5px; margin-left: 3px; }
.dayswitch button.on {
  background: var(--champagne);
  border-color: var(--gold-soft);
  color: var(--gold);
  font-weight: 600;
}

.wrap { max-width: 640px; margin: 0 auto; padding: 22px 16px 0; }

h1.page {
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 500;
  letter-spacing: .4px;
}
p.lede { color: var(--ink-soft); margin-top: 8px; font-size: 15px; line-height: 1.6; }

.rule { width: 46px; height: 1px; background: var(--gold-soft); margin: 16px auto; }

/* ----------------------------------------------------------------- cards */
.card {
  background: var(--paper);
  border: 1px solid var(--champagne-deep);
  border-radius: var(--radius);
  padding: 18px;
  margin-top: 16px;
  box-shadow: var(--shadow);
}

/* --------------------------------------------------------------- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  padding: 16px 20px;
  border: none;
  border-radius: 999px;
  background: var(--gold);
  color: #fff;
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .3px;
  cursor: pointer;
  transition: transform .12s ease, opacity .12s ease;
}
.btn:active { transform: scale(.985); }
.btn[disabled] { opacity: .45; cursor: default; }
.btn.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--gold-soft);
  font-weight: 500;
}
.btn.small { width: auto; padding: 10px 18px; font-size: 14px; }

/* ---------------------------------------------------------------- inputs */
input[type="text"], textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--champagne-deep);
  border-radius: 12px;
  background: #fff;
  font-family: var(--sans);
  font-size: 16px;
  color: var(--ink);
}
input[type="text"]:focus, textarea:focus { outline: 2px solid var(--gold-soft); outline-offset: 1px; }
textarea { min-height: 110px; resize: vertical; line-height: 1.55; }
label.field { display: block; font-size: 13px; letter-spacing: .4px; color: var(--ink-soft); margin-bottom: 7px; }

/* ------------------------------------------------------------ nav bottom */
.nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: flex;
  background: var(--paper);
  border-top: 1px solid var(--champagne-deep);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 40;
}
.nav a {
  flex: 1;
  text-align: center;
  padding: 10px 2px 12px;
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 10.5px;
  letter-spacing: .4px;
}
.nav a .ic { display: block; font-size: 19px; margin-bottom: 2px; filter: grayscale(1); opacity: .55; }
.nav a.on { color: var(--gold); }
.nav a.on .ic { filter: none; opacity: 1; }

/* ---------------------------------------------------------------- toasts */
#toasts {
  position: fixed;
  left: 50%; bottom: 84px;
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(92vw, 420px);
}
.toast {
  background: var(--ink);
  color: #fff;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  box-shadow: var(--shadow);
  animation: pop .18s ease;
}
.toast.warn { background: #8c5b3a; }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } }

/* ----------------------------------------------------------- name dialog */
.sheet-backdrop {
  position: fixed; inset: 0;
  background: rgba(74, 66, 56, .45);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 22px; z-index: 80;
}
.sheet {
  background: var(--paper);
  border-radius: 18px;
  padding: 26px 22px;
  width: min(100%, 400px);
  text-align: center;
  box-shadow: 0 24px 60px rgba(74, 66, 56, .3);
}
.sheet .mark { width: 66px; height: 66px; display: block; margin: 0 auto 10px; }
.sheet h2 { font-family: var(--serif); font-size: 22px; font-weight: 500; }
.sheet p { color: var(--ink-soft); font-size: 14.5px; margin: 10px 0 18px; line-height: 1.55; }
.sheet input { margin-bottom: 14px; text-align: center; }

.hidden { display: none !important; }

/* ---------------------------------------------------------- upload queue */
.queue { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.qitem {
  display: flex; align-items: center; gap: 12px;
  background: var(--paper);
  border: 1px solid var(--champagne-deep);
  border-radius: 12px;
  padding: 10px 12px;
}
.qitem .thumb {
  width: 46px; height: 46px; border-radius: 8px;
  background: var(--champagne) center/cover no-repeat;
  flex: 0 0 auto;
}
.qitem .meta { flex: 1; min-width: 0; }
.qitem .name {
  font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.qitem .state { font-size: 12px; color: var(--ink-soft); margin-top: 3px; }
.qitem.err .state { color: #a4522f; }
.bar { height: 3px; background: var(--champagne-deep); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; background: var(--gold); transition: width .2s ease; }
.qitem .ok { color: var(--gold); font-size: 18px; }

/* --------------------------------------------------------------- gallery */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  margin-top: 16px;
}
.grid .cell {
  position: relative;
  aspect-ratio: 1;
  background: var(--champagne);
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
}
.grid .cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.grid .cell .vid {
  position: absolute; right: 5px; bottom: 4px;
  font-size: 13px; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.6);
}
@media (min-width: 560px) { .grid { grid-template-columns: repeat(4, 1fr); } }

/* -------------------------------------------------------------- lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(30, 26, 22, .96);
  display: flex; flex-direction: column;
}
.lightbox .lb-top {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; color: #f2ece2; font-size: 14px;
}
.lightbox .lb-top a, .lightbox .lb-top button {
  background: none; border: none; color: #f2ece2; font-size: 15px; cursor: pointer; text-decoration: none;
}
.lightbox .lb-body { flex: 1; display: flex; align-items: center; justify-content: center; padding: 0 8px 16px; }
.lightbox img, .lightbox video { max-width: 100%; max-height: 100%; border-radius: 8px; }
.lightbox .lb-nav {
  display: flex; justify-content: space-between; padding: 0 16px 24px; color: #f2ece2;
}
.lightbox .lb-nav button { background: none; border: 1px solid rgba(242,236,226,.35); color: #f2ece2;
  border-radius: 999px; padding: 9px 20px; font-size: 14px; cursor: pointer; }

/* --------------------------------------------------------------- tasks */
.task {
  display: flex; align-items: center; gap: 13px;
  background: var(--paper);
  border: 1px solid var(--champagne-deep);
  border-radius: 12px;
  padding: 13px 14px;
  margin-top: 10px;
}
.task .emoji { font-size: 22px; flex: 0 0 auto; }
.task .t { flex: 1; min-width: 0; }
.task .t b { font-weight: 600; font-size: 14.5px; display: block; }
.task .t span { font-size: 12.5px; color: var(--ink-soft); }
.task.done { background: var(--champagne); border-color: var(--gold-soft); }
.task .go {
  border: 1px solid var(--gold-soft); background: none; color: var(--gold);
  border-radius: 999px; padding: 8px 14px; font-size: 13px; font-weight: 600; cursor: pointer; flex: 0 0 auto;
}
.task.done .go { background: var(--gold); color: #fff; border-color: var(--gold); }

/* ------------------------------------------------------------- guestbook */
.entry {
  background: var(--paper);
  border: 1px solid var(--champagne-deep);
  border-radius: 12px;
  padding: 15px 16px;
  margin-top: 12px;
}
.entry .who { font-family: var(--serif); font-size: 16px; color: var(--gold); }
.entry .when { font-size: 11.5px; color: var(--ink-soft); letter-spacing: .3px; margin-top: 1px; }
.entry .txt { margin-top: 9px; white-space: pre-wrap; font-size: 15px; line-height: 1.55; }
.entry audio { width: 100%; margin-top: 10px; }

.muted { color: var(--ink-soft); font-size: 14px; text-align: center; padding: 26px 10px; }
.stats { text-align: center; color: var(--ink-soft); font-size: 12.5px; letter-spacing: .5px; margin-top: 14px; }

/* ------------------------------------------------------------- Galerie */
.tabs { display: flex; gap: 7px; margin-top: 16px; }
.tabs button {
  flex: 1;
  border: 1px solid var(--champagne-deep);
  background: var(--paper);
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 13.5px;
  padding: 10px 6px;
  border-radius: 999px;
  cursor: pointer;
}
.tabs button.on { background: var(--gold); border-color: var(--gold); color: #fff; font-weight: 600; }

.download { margin-top: 22px; }
.download h2 {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  text-align: center;
}
.download p { color: var(--ink-soft); font-size: 13.5px; text-align: center; margin-top: 6px; line-height: 1.55; }
.download .links { display: flex; flex-direction: column; gap: 9px; margin-top: 14px; }
.download a {
  display: flex; justify-content: space-between; align-items: center;
  border: 1px solid var(--gold-soft);
  border-radius: 12px;
  padding: 13px 16px;
  text-decoration: none;
  color: var(--ink);
  font-size: 14.5px;
  background: var(--paper);
}
.download a span { color: var(--ink-soft); font-size: 12.5px; }

/* Aufgaben nach Tag gruppiert */
.groupline {
  display: flex; align-items: center; gap: 10px;
  margin: 24px 0 4px;
  color: var(--ink-soft);
  font-size: 11px; letter-spacing: 2.4px; text-transform: uppercase;
}
.groupline::before, .groupline::after {
  content: ""; flex: 1; height: 1px; background: var(--champagne-deep);
}

/* ------------------------------------------------- Tageswahl beim Upload */
.daychoice { margin-top: 18px; }
.daychoice .frage {
  font-size: 13px;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-align: center;
  margin-bottom: 10px;
}
.daychoice .choices { display: flex; gap: 9px; }
.daychoice button {
  flex: 1;
  border: 1.5px solid var(--champagne-deep);
  background: var(--paper);
  border-radius: 14px;
  padding: 14px 8px;
  cursor: pointer;
  font-family: var(--sans);
  color: var(--ink-soft);
  text-align: center;
  transition: border-color .15s ease, background .15s ease;
}
.daychoice button b {
  display: block;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.2;
}
.daychoice button span { display: block; font-size: 12px; margin-top: 4px; }
.daychoice button.on {
  border-color: var(--gold);
  background: var(--champagne);
}
.daychoice button.on b, .daychoice button.on span { color: var(--gold); }
.daychoice button.on b::after { content: " ✓"; font-size: 13px; }

.ziel {
  text-align: center;
  font-size: 13.5px;
  color: var(--ink-soft);
  margin-top: 12px;
  line-height: 1.5;
}
.ziel b { color: var(--gold); }
