:root {
  --rot: #8e2f25;
  --rot-dunkel: #6f241c;
  --text: #2b2b2b;
  --leise: #6b6b6b;
  --rand: #d9d4cf;
  --flaeche: #faf8f6;
  --weiss: #ffffff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--flaeche);
  font-size: 16px;
}

button {
  font: inherit;
  cursor: pointer;
  border: 0;
  border-radius: 8px;
  padding: 12px 20px;
  background: var(--rot);
  color: var(--weiss);
  font-weight: 600;
}
button:hover { background: var(--rot-dunkel); }
button.zweitrangig {
  background: var(--weiss);
  color: var(--rot);
  border: 1px solid var(--rot);
  padding: 11px 18px;
}
button.zweitrangig:hover { background: var(--flaeche); }
button.leise {
  background: transparent;
  color: var(--leise);
  padding: 8px 12px;
  font-weight: 400;
}
button.leise:hover { color: var(--text); background: transparent; }

input, textarea {
  font: inherit;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--rand);
  border-radius: 8px;
  background: var(--weiss);
  color: var(--text);
}
input:focus, textarea:focus { outline: 2px solid var(--rot); outline-offset: -1px; }
textarea { resize: vertical; line-height: 1.5; }

label { display: block; margin: 14px 0 6px; font-size: 14px; color: var(--leise); }

.fehler { color: #b00020; }

/* Anmeldung */
.login {
  max-width: 340px;
  margin: 12vh auto 0;
  padding: 0 16px;
  text-align: center;
}
.login-logo { width: 96px; }
.login h1 { font-size: 22px; margin: 16px 0 24px; }
.login form { text-align: left; }
.login input { font-size: 22px; letter-spacing: 0.3em; text-align: center; }
.login button { width: 100%; margin-top: 16px; }

/* App */
.kopf {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  background: var(--weiss);
  border-bottom: 1px solid var(--rand);
}
.kopf img { width: 40px; }
.kopf h1 { font-size: 19px; margin: 0; flex: 1; }
.status { font-size: 14px; color: var(--leise); }

.app {
  display: grid;
  grid-template-columns: minmax(320px, 460px) 1fr;
  gap: 24px;
  padding: 24px;
  max-width: 1400px;
  margin: 0 auto;
}

.formular h2 {
  font-size: 17px;
  margin: 28px 0 4px;
  color: var(--rot);
}
.formular h2:first-child { margin-top: 0; }

.zwei { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.bilder { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.bild {
  margin: 0;
  position: relative;
  border: 1px dashed var(--rand);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: var(--weiss);
  aspect-ratio: 77 / 46;
}
.bild.gross { grid-column: 1 / -1; aspect-ratio: 160 / 88; }
.bild img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bild span {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 6px 10px;
  font-size: 13px;
  color: var(--weiss);
  background: rgba(0, 0, 0, 0.55);
}
.bild input { display: none; }

.vorschau { position: sticky; top: 24px; align-self: start; }
.aktionen { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 12px; }
#auswahl {
  font: inherit;
  padding: 8px 10px;
  border: 1px solid var(--rand);
  border-radius: 8px;
  background: var(--weiss);
  color: var(--text);
  max-width: 260px;
}
#anzahl { color: var(--leise); }
#vorschau {
  display: block;
  width: 100%;
  max-width: calc((100vh - 150px) * 210 / 297);
  height: auto;
  margin: 0 auto;
  border: 1px solid var(--rand);
  border-radius: 4px;
  background: var(--weiss);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}
.blaettern { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 8px; color: var(--leise); }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; padding: 16px; }
  .kopf { padding: 12px 16px; }
  .vorschau { position: static; }
  #vorschau { max-width: 100%; }
}
