:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --text: #1f2421;
  --muted: #5f6763;
  --border: #dcdad3;
  --accent: #2f6f5e;
  --accent-text: #ffffff;
  --notice-bg: #e6f1ec;
  --error: #b3261e;
  --error-bg: #fbe9e7;
  --radius: 8px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141816;
    --surface: #1d2320;
    --text: #e6e9e7;
    --muted: #9aa49f;
    --border: #2f3733;
    --accent: #5fb39a;
    --accent-text: #0e1412;
    --notice-bg: #1f332b;
    --error: #f2b8b5;
    --error-bg: #3b1f1d;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  color: var(--text);
  text-decoration: none;
}

.nav { display: flex; align-items: center; gap: 16px; }
.nav a { text-decoration: none; }

.container { width: 100%; max-width: 960px; margin: 0 auto; padding: 24px 16px 48px; flex: 1; }
.container.narrow { max-width: 440px; }

h1 { font-size: 1.6rem; margin: 0.4em 0 0.6em; }
h2 { font-size: 1.2rem; margin: 1.6em 0 0.6em; }

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }

.stack { display: flex; flex-direction: column; gap: 14px; margin: 16px 0 24px; }
.stack > button { align-self: flex-start; }

label { display: flex; flex-direction: column; gap: 6px; font-weight: 550; }

input[type="email"], input[type="text"] {
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}

button, .button {
  font: inherit;
  font-weight: 600;
  display: inline-block;
  padding: 10px 18px;
  border: 0;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-text);
  cursor: pointer;
  text-decoration: none;
}

button.link {
  background: none;
  color: var(--accent);
  padding: 0;
  font-weight: inherit;
}

form.inline { display: inline; margin: 0; }

.notice {
  background: var(--notice-bg);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin: 12px 0;
}

.empty {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px 16px;
  text-align: center;
  color: var(--muted);
}

table.kv { border-collapse: collapse; width: 100%; background: var(--surface); border-radius: var(--radius); overflow: hidden; }
table.kv th, table.kv td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.kv th { width: 30%; font-weight: 600; }

.log { padding-left: 20px; }
.log .ok { color: var(--accent); }
.log .fail { color: #c0392b; }

/* ---------- M2: Projekte, Admin, Uploads ---------- */

.notice.error { background: var(--error-bg); color: var(--error); }

.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--border);
  color: var(--text);
  vertical-align: middle;
}
.badge.warn { background: var(--error-bg); color: var(--error); }

.crumbs { color: var(--muted); font-size: 0.9rem; margin: 0; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; word-break: break-all; }

.subnav { display: flex; flex-wrap: wrap; gap: 4px 18px; border-bottom: 1px solid var(--border); padding-bottom: 10px; margin-bottom: 8px; }
.subnav a { text-decoration: none; color: var(--muted); font-weight: 550; }
.subnav a[aria-current="page"] { color: var(--accent); }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.tile {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
}
.tile:hover { border-color: var(--accent); }
.tile img, .tile-placeholder { width: 100%; aspect-ratio: 16 / 9; }
/* Titelbild immer vollständig zeigen (Logos sind oft breiter als 16:9), statt Ränder abzuschneiden */
.tile img { object-fit: contain; padding: 10px; background: var(--surface); border-bottom: 1px solid var(--border); }
.tile-placeholder { display: grid; place-items: center; font-size: 2.4rem; font-weight: 700; color: var(--accent); background: var(--notice-bg); }
.tile-body { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; }

.project-head { display: flex; gap: 20px; align-items: flex-start; margin: 8px 0 16px; }
.project-head .cover { width: 220px; max-width: 40%; border-radius: var(--radius); aspect-ratio: 16 / 9; object-fit: contain; padding: 8px; background: var(--surface); border: 1px solid var(--border); }

.card, details.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 12px 0;
}
details.card summary { cursor: pointer; font-weight: 600; }
.card h2 { margin-top: 0; }

.files { list-style: none; padding: 0; margin: 12px 0; display: flex; flex-direction: column; gap: 12px; }
.files li { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); }
.files li.recommended { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.files .download { align-self: flex-start; margin-bottom: 4px; }
.file-meta { font-size: 0.85rem; color: var(--muted); }

.hint { margin: 8px 0; font-size: 0.92rem; }
.hint summary { cursor: pointer; color: var(--accent); }

.changelog { margin-top: 12px; }
.changelog :first-child { margin-top: 0; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 12px 0 8px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; }
.stat-value { font-size: 1.6rem; font-weight: 700; }
.stat-label { color: var(--muted); font-size: 0.85rem; }

table.list { border-collapse: collapse; width: 100%; background: var(--surface); border-radius: var(--radius); overflow: hidden; margin: 8px 0 16px; }
table.list th, table.list td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.list th { font-size: 0.85rem; color: var(--muted); font-weight: 600; }

.columns { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }

textarea, select {
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; margin: 0; }
legend { font-weight: 550; padding: 0 4px; }
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: normal; }
.inline-form { display: flex; gap: 8px; margin-top: 8px; }
.inline-form input { flex: 1; }

button.secondary { background: var(--surface); color: var(--accent); border: 1px solid var(--accent); }
button.danger { background: var(--error); color: var(--surface); }
button.link.danger { background: none; color: var(--error); }
label.link { display: inline; color: var(--accent); cursor: pointer; text-decoration: underline; font-weight: inherit; }

.dropzone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 18px; text-align: center; margin: 12px 0; }
.dropzone.small { padding: 12px; font-size: 0.9rem; }
.dropzone.over { border-color: var(--accent); background: var(--notice-bg); }
.upload-row { display: grid; grid-template-columns: 1fr 140px auto; gap: 10px; align-items: center; text-align: left; margin-top: 8px; font-size: 0.9rem; }
.upload-row progress { width: 100%; }
.upload-row.ok .upload-status { color: var(--accent); }
.upload-row.fail .upload-status { color: var(--error); }
.upload-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cover-preview { max-width: 100%; border-radius: var(--radius); margin-bottom: 8px; }

@media (max-width: 760px) {
  .columns { grid-template-columns: 1fr; gap: 8px; }
  .project-head { flex-direction: column; }
  .project-head .cover { max-width: 100%; width: 100%; }
  .upload-row { grid-template-columns: 1fr; }
  table.list { display: block; overflow-x: auto; }
}

/* ---------- M3: Feedback & Statistik ---------- */

a.button.secondary { background: var(--surface); color: var(--accent); border: 1px solid var(--accent); }
.stars { color: #c98a00; letter-spacing: 1px; white-space: nowrap; }
.prewrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.shots { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.shots img { width: 160px; height: 110px; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--border); }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin: 12px 0; }
.filters label { font-size: 0.85rem; }
.badge.status-neu { background: var(--accent); color: var(--accent-text); }
.badge.status-erledigt { background: var(--notice-bg); color: var(--muted); }
a.stat { text-decoration: none; color: var(--text); }
a.stat:hover { border-color: var(--accent); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.footer { text-align: center; padding: 16px; color: var(--muted); font-size: 0.8rem; }

@media (max-width: 560px) {
  .brand span { display: none; }
  table.kv th { width: 40%; }
}
