:root {
  --bg: #fbf7f2;
  --card: #ffffff;
  --text: #2b2622;
  --muted: #7a6f66;
  --line: #eadfd4;
  --accent: #b5654a;
  --accent-dark: #9a5039;
  --accent-soft: #f3e3da;
  --danger: #b03a2e;
  --radius: 18px;
  --shadow: 0 2px 10px rgba(60, 40, 20, 0.08);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.45;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.page {
  max-width: 520px;
  margin: 0 auto;
  padding: 28px 20px 48px;
}

body.wide .page { max-width: 1200px; }

h1 {
  font-size: 1.7rem;
  line-height: 1.2;
  margin: 0.2em 0 0.4em;
  font-weight: 700;
}

.hero { text-align: center; margin-bottom: 24px; }
.hero-emoji { font-size: 3.2rem; line-height: 1; margin-bottom: 8px; }
.eyebrow { margin: 0; color: var(--muted); font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.08em; }
.lead { color: var(--muted); margin: 0; font-size: 1.05rem; }
.task-title { font-size: 1.55rem; }
.task-recap { margin-top: 16px; color: var(--muted); font-size: 1rem; }
.muted { color: var(--muted); margin: 0; }

/* Aufgabenliste */
.task-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.task-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; text-decoration: none; color: inherit; box-shadow: var(--shadow);
}
.task-card:active { background: var(--accent-soft); }
.task-emoji { font-size: 1.8rem; flex: 0 0 auto; }
.task-text { flex: 1 1 auto; font-weight: 600; }
.task-arrow { color: var(--muted); font-size: 1.6rem; }

/* Formular */
.upload-form { display: flex; flex-direction: column; gap: 16px; }
.field { display: block; }
.field-label { display: block; font-weight: 600; margin-bottom: 6px; }
.field-label small { font-weight: 400; color: var(--muted); }
.field input[type="text"] {
  width: 100%; font: inherit; font-size: 1.1rem; padding: 14px 16px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--card); color: inherit;
}
.field input[type="text"]:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.upload-buttons { display: flex; flex-direction: column; gap: 12px; }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  font: inherit; font-size: 1.25rem; font-weight: 700;
  padding: 20px 18px; border-radius: var(--radius); border: 0; cursor: pointer;
  text-decoration: none; text-align: center; box-shadow: var(--shadow);
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:active { background: var(--accent-dark); }
.btn-secondary { background: var(--card); color: var(--text); border: 1px solid var(--line); }
.btn-secondary:active { background: var(--accent-soft); }
.btn-icon { font-size: 1.6rem; line-height: 1; }
.btn-small { font-size: 0.95rem; padding: 10px 14px; border-radius: 12px; box-shadow: none; }
.btn[aria-disabled="true"], .btn:disabled { opacity: 0.55; pointer-events: none; }

.status {
  display: flex; align-items: center; gap: 12px; justify-content: center;
  background: var(--accent-soft); border-radius: 14px; padding: 14px; font-weight: 600;
}
.spinner {
  width: 20px; height: 20px; border-radius: 50%;
  border: 3px solid rgba(0,0,0,0.12); border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.error {
  background: #fdecea; color: var(--danger); border-radius: 14px; padding: 14px; font-weight: 600;
}

.hint { color: var(--muted); font-size: 0.9rem; text-align: center; margin-top: 20px; }

.page-footer {
  margin-top: 36px; text-align: center; color: var(--muted); font-size: 0.95rem;
  display: flex; gap: 10px; justify-content: center;
}
.link { color: var(--accent); text-decoration: none; }
.link:hover { text-decoration: underline; }

/* Galerie */
.gallery-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.gallery-actions { display: flex; gap: 8px; }
.empty { color: var(--muted); text-align: center; padding: 60px 0; }

.grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.photo {
  margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column;
}
.photo-link { display: block; background: #eee; aspect-ratio: 1 / 1; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo figcaption { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.photo-task { margin: 0; font-size: 0.9rem; line-height: 1.35; }
.photo-meta { margin: 0; font-size: 0.85rem; color: var(--muted); }
.photo-meta strong { color: var(--text); }
.delete-form { margin-top: auto; padding-top: 6px; text-align: right; }
.btn-delete {
  background: none; border: 0; color: var(--danger); font: inherit; font-size: 0.8rem;
  cursor: pointer; padding: 4px 0; opacity: 0.75;
}
.btn-delete:hover { opacity: 1; text-decoration: underline; }

@media (max-width: 480px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .photo figcaption { padding: 8px 10px 10px; }
  .photo-task { font-size: 0.8rem; }
}
