:root {
  --bg: #fafaf9;
  --surface: #ffffff;
  --text: #26262a;
  --muted: #7a7a80;
  --line: #ececea;
  --code-bg: #f3f3f1;
  --accent: #3d63dd;
  --accent-hover: #3256c8;
  --accent-text: #ffffff;
  --danger: #c2413a;
  --ok-bg: #e9f5ee;
  --ok-text: #2b7a4b;
  --off-bg: #f1f1ef;
  --off-text: #7a7a80;
  --notice: #fffaeb;
  --shadow: 0 1px 2px rgba(20, 20, 30, .04), 0 4px 16px rgba(20, 20, 30, .04);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141416;
    --surface: #1b1b1e;
    --text: #e8e8ea;
    --muted: #8e8e95;
    --line: #2a2a2e;
    --code-bg: #222226;
    --accent: #8aa4ff;
    --accent-hover: #a1b6ff;
    --accent-text: #10131f;
    --danger: #ff8a80;
    --ok-bg: #1b2e23;
    --ok-text: #8fd6a6;
    --off-bg: #26262a;
    --off-text: #8e8e95;
    --notice: #2b2818;
    --shadow: none;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
:root { --gutter: clamp(20px, 5vw, 48px); }
main { margin: 0 auto; padding: 40px var(--gutter) 64px; }
main.narrow { max-width: 460px; padding-top: 14vh; }
main.home { max-width: 860px; padding-top: 12vh; }
main.wide { max-width: 1200px; }

h1 { font-size: 1.375rem; font-weight: 500; letter-spacing: -.01em; margin: 0 0 12px; }
h2 { font-size: .8125rem; font-weight: 500; color: var(--muted); margin: 0 0 6px; }
p { margin: 0 0 12px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .875em; }
pre {
  background: var(--code-bg); border-radius: 8px; padding: 10px 14px; margin: 0;
  white-space: pre-wrap; overflow-wrap: anywhere;
}

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 28px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.notice { background: var(--notice); }
.muted { color: var(--muted); }
.small { font-size: .8125rem; }
.error { color: var(--danger); margin: 0; font-size: .875rem; }
.filename { word-break: break-word; }

.meta { display: grid; grid-template-columns: auto 1fr; gap: 2px 20px; margin: 4px 0 24px; font-size: .9375rem; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; }
.stack { display: grid; gap: 10px; }

input {
  font: inherit; color: inherit; background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; min-width: 0;
  transition: border-color .15s;
}
input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }

button, .button {
  font: inherit; cursor: pointer; display: inline-block; text-decoration: none; text-align: center;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 8px; padding: 7px 14px; transition: background .15s, border-color .15s;
}
button:hover, .button:hover { border-color: var(--muted); text-decoration: none; }
.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 500; }
.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
a.button.primary { display: block; padding: 11px 16px; }
.danger { color: var(--danger); }
button.small { padding: 3px 10px; font-size: .8125rem; }
button.link { border: 0; background: none; color: var(--muted); padding: 0; }
button.link:hover { color: var(--text); }

/* Startseite */
.hero { margin-bottom: 40px; }
.hero h1 { font-size: 1.75rem; margin-bottom: 8px; }
.hero p { color: var(--muted); font-size: 1rem; max-width: 52ch; }
.steps { display: grid; gap: 28px; }
.step h2 { display: flex; gap: 10px; align-items: baseline; }
.step .n { color: var(--accent); font-variant-numeric: tabular-nums; }
.step p { color: var(--muted); font-size: .875rem; margin: 8px 0 0; }

/* Admin */
.nav {
  display: flex; gap: 24px; align-items: center; flex-wrap: wrap;
  max-width: 1200px; margin: 0 auto; padding: 20px var(--gutter) 0; font-size: .9375rem;
}
.nav strong { font-weight: 600; margin-right: 8px; }
.nav a { color: var(--muted); padding-bottom: 2px; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--text); text-decoration: none; }
.nav a[aria-current] { color: var(--text); border-bottom-color: var(--accent); }
.nav .logout { margin-left: auto; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 16px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; display: grid; gap: 2px; box-shadow: var(--shadow); }
.label { color: var(--muted); font-size: .8125rem; }
.value { font-size: 1.75rem; font-weight: 400; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
progress { width: 100%; height: 6px; accent-color: var(--accent); }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; font-size: .875rem; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 400; font-size: .8125rem; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.ellipsis { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
tr.inactive td { color: var(--muted); }

.badge { border-radius: 999px; padding: 1px 8px; font-size: .75rem; background: var(--off-bg); color: var(--off-text); }
.badge.aktiv { background: var(--ok-bg); color: var(--ok-text); }
.inline-form { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.inline-form label { display: grid; gap: 4px; font-size: .8125rem; color: var(--muted); }
.row { display: flex; gap: 6px; align-items: center; margin: 0; }
.key { user-select: all; word-break: break-all; }
