:root {
  --bg: #f7f3ec;
  --card: #fffdf9;
  --ink: #2d3340;
  --muted: #6c7280;
  --blue: #4f7aa6;
  --blue-dark: #3b6189;
  --blue-soft: #e3ecf5;
  --line: #e7e0d4;
  --red: #b0413e;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.5 var(--sans);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
[hidden] { display: none !important; }

.hero { text-align: center; padding: 40px 20px 8px; max-width: 640px; margin: 0 auto; }
.drop { width: 40px; height: 50px; fill: var(--blue-soft); stroke: var(--blue); stroke-width: 3; stroke-linejoin: round; }
.drop .shine { fill: none; stroke-linecap: round; }
.kicker { margin: 10px 0 0; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; font-size: 13px; }
h1 { font: 400 clamp(36px, 9vw, 54px)/1.1 var(--serif); margin: 4px 0 12px; color: var(--blue-dark); }
.lead { color: var(--muted); margin: 0 auto; max-width: 30em; }

main { max-width: 960px; margin: 0 auto; padding: 16px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  max-width: 520px;
  margin: 16px auto;
  box-shadow: 0 1px 2px rgb(0 0 0 / .04);
}
h2 { font: 400 26px/1.2 var(--serif); margin: 0 0 12px; }

.name { display: block; margin-bottom: 16px; }
.name span { display: block; font-weight: 600; margin-bottom: 6px; }
.name small { font-weight: 400; color: var(--muted); }
input[type="text"] {
  width: 100%; font: inherit; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 12px; background: #fff; color: inherit;
}
input[type="text"]:focus { outline: 2px solid var(--blue); outline-offset: 1px; }

.pick { display: block; position: relative; }
.pick input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.pick .btn { width: 100%; font-size: 20px; padding: 18px; }
.pick input:focus-visible + .btn { outline: 3px solid var(--blue-dark); outline-offset: 2px; }
.hint { color: var(--muted); font-size: 14px; text-align: center; margin: 10px 0 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 16px/1.2 var(--sans); padding: 12px 18px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; color: var(--ink); text-decoration: none; cursor: pointer;
}
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-dark); }
.btn.danger { color: var(--red); border-color: #e9c9c7; }

.progress { margin-top: 18px; }
.progress p { margin: 0 0 8px; font-weight: 600; }
.progress progress { width: 100%; height: 10px; appearance: none; border: 0; border-radius: 99px; background: var(--blue-soft); overflow: hidden; }
.progress progress::-webkit-progress-bar { background: var(--blue-soft); }
.progress progress::-webkit-progress-value { background: var(--blue); }
.progress progress::-moz-progress-bar { background: var(--blue); }
.progress.done p { color: var(--blue-dark); }
.errors { margin: 10px 0 0; padding-left: 18px; color: var(--red); font-size: 14px; }

.admin .zips { display: flex; flex-direction: column; gap: 10px; }

.gallery-wrap { margin-top: 28px; }
.gallery-wrap h2 { text-align: center; }
.empty { text-align: center; color: var(--muted); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 4px; }
@media (min-width: 700px) { .gallery { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; } }
.tile {
  aspect-ratio: 1; padding: 0; border: 0; border-radius: 6px; overflow: hidden;
  background: var(--blue-soft); cursor: pointer; display: block; width: 100%;
}
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile.placeholder { font-size: 32px; }

footer { text-align: center; padding: 32px 16px 40px; font-size: 14px; }
footer a { color: var(--muted); }

.viewer {
  width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0;
  border: 0; background: #111; color: #eee;
}
.viewer[open] { display: flex; flex-direction: column; }
.viewer::backdrop { background: #111; }
.viewer-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top)); font-size: 14px; color: #bbb; }
.stage { flex: 1; min-height: 0; position: relative; display: flex; align-items: center; justify-content: center; touch-action: pan-y pinch-zoom; }
.stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
.no-preview { text-align: center; color: #bbb; padding: 20px; }
.icon { background: rgb(255 255 255 / .1); color: #fff; border: 0; border-radius: 999px; width: 44px; height: 44px; font-size: 22px; cursor: pointer; }
.nav { position: absolute; top: 50%; transform: translateY(-50%); font-size: 32px; line-height: 1; }
.nav:disabled { opacity: 0; pointer-events: none; }
#prev { left: 8px; }
#next { right: 8px; }
.viewer-actions { display: flex; gap: 10px; justify-content: center; padding: 12px; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
.viewer-actions .btn { background: rgb(255 255 255 / .12); border-color: transparent; color: #fff; }
.viewer-actions .btn.danger { color: #f3a5a2; }
