:root { --bg: #f7f6f2; --fg: #1d2421; --muted: #5d6662; --line: #dcdad2; --card: #fff; --accent: #0f6e5c; --accent-fg: #fff;
  --ok: #1d7a46; --ok-bg: #e5f4ea; --warn: #8a5a00; --warn-bg: #fdf3dc; --stop: #a3261b; --stop-bg: #fbe7e4; color-scheme: light; }
@media (prefers-color-scheme: dark) {
  :root { --bg: #151a18; --fg: #e8ebe9; --muted: #9aa49f; --line: #2c3431; --card: #1c2220; --accent: #5cc3a8; --accent-fg: #0e1312;
    --ok: #7fd4a0; --ok-bg: #173126; --warn: #f0c46a; --warn-bg: #352a12; --stop: #f39a8f; --stop-bg: #3b1c18; color-scheme: dark; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent); }
main { max-width: 40rem; margin: 0 auto; padding: 2rem 16px 3rem; }
main.wide { max-width: 78rem; }
.is-public main { padding-top: 12vh; }
h1 { font-size: 1.8rem; line-height: 1.2; margin: 0 0 .6rem; }
h2 { font-size: 1.15rem; margin: 1.6rem 0 .6rem; }
h3 { font-size: 1rem; margin: 1.2rem 0 .4rem; }
.card h2:first-child, .card .head-row h2 { margin-top: 0; }
.muted { color: var(--muted); }
.small, small { font-size: .85rem; }
.pre { white-space: pre-wrap; }
code { font-size: .9em; }

/* öffentlich */
.hero h1 { font-size: 2.2rem; letter-spacing: -.01em; }
.lead { color: var(--muted); margin: 0 0 2.5rem; }
.eyebrow { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.projects { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.projects li { border-bottom: 1px solid var(--line); }
.projects a, .projects .soon { display: flex; justify-content: space-between; gap: 1rem; padding: .9rem 0; color: inherit; text-decoration: none; }
.projects a:hover strong, .projects a:focus-visible strong { color: var(--accent); }
.projects small { color: var(--muted); text-align: right; }
.projects .soon { opacity: .6; }
.site-foot { max-width: 40rem; margin: 0 auto; padding: 0 16px 2rem; font-size: .85rem; color: var(--muted); }
.site-foot a { color: inherit; }

/* Admin */
.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem; padding: .6rem 16px; border-bottom: 1px solid var(--line); background: var(--card); }
.topbar .brand { font-weight: 700; color: var(--fg); text-decoration: none; }
.topbar nav { display: flex; flex-wrap: wrap; gap: .2rem .9rem; flex: 1; }
.topbar nav a { color: var(--fg); text-decoration: none; font-size: .95rem; }
.topbar nav a:hover { color: var(--accent); }
.logout { margin: 0; }
.head-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .6rem; }
.head-row h1, .head-row h2 { margin-bottom: .4rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 1rem 1.1rem; margin: 1rem 0; }
details.card > summary { cursor: pointer; font-weight: 600; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); gap: 0 1rem; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: .6rem; margin: 1rem 0; }
.tile { display: flex; flex-direction: column; padding: .8rem 1rem; background: var(--card); border: 1px solid var(--line); border-radius: 10px; color: var(--fg); text-decoration: none; }
.tile b { font-size: 1.6rem; }
.tile span { color: var(--muted); font-size: .9rem; }
.tile.warn { border-color: var(--warn); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .45rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .82rem; color: var(--muted); font-weight: 600; white-space: nowrap; }
tr.due td { background: var(--warn-bg); }
dl.facts { display: grid; grid-template-columns: 9rem 1fr; gap: .3rem .8rem; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }
ul.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: .3rem 0; border-bottom: 1px solid var(--line); }
ul.timeline { list-style: none; padding: 0; }
ul.timeline li { padding: .35rem 0; border-bottom: 1px solid var(--line); }
ul.timeline time { color: var(--muted); font-size: .85rem; margin-right: .3rem; }
.tag { display: inline-block; padding: 0 .45rem; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); font-size: .8rem; }
.badge { display: inline-block; padding: 0 .45rem; border-radius: 4px; background: var(--bg); border: 1px solid var(--line); font-size: .78rem; }
.badge.ok { color: var(--ok); background: var(--ok-bg); border-color: transparent; }
.badge.stop { color: var(--stop); background: var(--stop-bg); border-color: transparent; }
.note { padding: .5rem .8rem; border-radius: 8px; background: var(--warn-bg); color: var(--fg); }
.alert { padding: .7rem .9rem; border-radius: 8px; background: var(--stop-bg); color: var(--fg); border: 1px solid var(--stop); }
.alert ul { margin: .3rem 0; }
.permissions { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: .6rem; margin: 1rem 0; }
.perm { display: flex; flex-direction: column; gap: .2rem; padding: .7rem .9rem; border-radius: 10px; border: 1px solid var(--line); }
.perm.ok { background: var(--ok-bg); }
.perm.warn { background: var(--warn-bg); }
.perm.stop { background: var(--stop-bg); border-color: var(--stop); }
.perm small { color: var(--muted); overflow-wrap: anywhere; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr)); gap: .8rem; }
.th-card { border: 1px solid var(--line); border-radius: 10px; padding: .7rem .9rem; }
.th-card p { margin: .3rem 0; }
.tabs { display: flex; flex-wrap: wrap; gap: .3rem; margin: .5rem 0 1rem; }
.tabs a { padding: .3rem .8rem; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--fg); }
.tabs a.on { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
pre.snippet { white-space: pre-wrap; background: var(--bg); padding: .7rem; border-radius: 8px; border: 1px solid var(--line); font: inherit; font-size: .9rem; }

/* Formulare */
form { margin: 0; }
.stack { display: flex; flex-direction: column; gap: .8rem; }
fieldset, details.fieldset { border: 1px solid var(--line); border-radius: 10px; padding: .8rem 1rem; margin: 0; background: var(--card); }
legend, details.fieldset summary { font-weight: 600; padding: 0 .3rem; cursor: default; }
details.fieldset summary { cursor: pointer; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .6rem 1rem; }
.field { display: flex; flex-direction: column; gap: .2rem; }
.field.wide { grid-column: 1 / -1; }
.field > span { font-size: .85rem; color: var(--muted); }
.field small { color: var(--muted); }
.field .error { color: var(--stop); font-style: normal; font-size: .85rem; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--stop); }
input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea { width: 100%; padding: .45rem .55rem; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); min-width: 0; }
input[type="checkbox"] { width: auto; }
.checks { display: flex; flex-wrap: wrap; gap: .3rem 1rem; margin-top: .7rem; align-items: center; }
.checks > span { font-size: .85rem; color: var(--muted); width: 100%; }
.check { display: inline-flex; gap: .4rem; align-items: center; }
button, .button { display: inline-block; padding: .5rem 1rem; border: 0; border-radius: 6px; background: var(--accent); color: var(--accent-fg); cursor: pointer; text-decoration: none; font-weight: 600; }
button.small, .button.small { padding: .3rem .7rem; font-size: .88rem; }
button.link { background: none; color: var(--accent); padding: 0; font-weight: 400; text-decoration: underline; }
button.danger { background: var(--stop); color: #fff; }
.danger { border-top: 1px solid var(--line); padding-top: .8rem; margin-top: .8rem; }
.actions { display: flex; gap: 1rem; align-items: center; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin: .8rem 0; align-items: center; }
.filters input, .filters select { width: auto; flex: 1 1 10rem; }
.filters .num, .row-form .num { flex: 0 0 6rem; width: 6rem; }
.row-form { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: .3rem 0; }
.row-form input { width: auto; flex: 1 1 12rem; }
.row-form .grow { flex: 1 1 20rem; }
form.inline { display: inline; }
form.rel { border-top: 1px solid var(--line); padding-top: .6rem; margin-top: .8rem; }
form.rel.new { border-top-style: dashed; }
.login { max-width: 22rem; margin: 10vh auto; }
@media (max-width: 40rem) {
  dl.facts { grid-template-columns: 1fr; }
  dl.facts dt { margin-top: .4rem; }
  h1 { font-size: 1.5rem; }
}
