:root { --bg:#f5f6f8; --fg:#1d2330; --muted:#667085; --line:#d9dde4; --accent:#1f5eff; --card:#fff; --warn:#b42318; }
@media (prefers-color-scheme: dark) {
  :root { --bg:#14171f; --fg:#e6e9f0; --muted:#98a2b3; --line:#2d3342; --accent:#6d9bff; --card:#1c202b; --warn:#f97066; }
}
* { box-sizing: border-box; }
body { margin:0; background:var(--bg); color:var(--fg); font:15px/1.5 system-ui, sans-serif; }
a { color:var(--accent); text-decoration:none; }
.top { display:flex; align-items:center; gap:16px; padding:10px 20px; background:var(--card); border-bottom:1px solid var(--line); flex-wrap:wrap; }
.top .brand { color:var(--fg); }
.top nav { display:flex; gap:14px; flex:1; flex-wrap:wrap; }
main { max-width:1100px; margin:20px auto; padding:0 16px; }
main.doc { max-width:760px; }
h1 { font-size:1.4rem; margin:0 0 14px; }
.card { background:var(--card); border:1px solid var(--line); border-radius:8px; padding:16px; margin-bottom:16px; }
.row { display:flex; gap:10px; flex-wrap:wrap; align-items:end; margin-bottom:12px; }
label { display:flex; flex-direction:column; font-size:.8rem; color:var(--muted); gap:3px; }
input, select, textarea, button { font:inherit; padding:7px 9px; border:1px solid var(--line); border-radius:6px; background:var(--card); color:var(--fg); }
textarea { width:100%; min-height:110px; }
button { cursor:pointer; background:var(--accent); color:#fff; border-color:var(--accent); }
button.secondary { background:transparent; color:var(--fg); border-color:var(--line); }
table { width:100%; border-collapse:collapse; }
th, td { text-align:left; padding:8px 10px; border-bottom:1px solid var(--line); vertical-align:top; }
th { font-size:.78rem; color:var(--muted); text-transform:uppercase; letter-spacing:.03em; }
.badge { display:inline-block; padding:1px 8px; border-radius:99px; font-size:.78rem; border:1px solid var(--line); }
.p4, .p5 { color:var(--warn); border-color:var(--warn); }
.err { color:var(--warn); margin:8px 0; }
.article { border-left:3px solid var(--accent); padding:6px 12px; margin:10px 0; background:var(--bg); border-radius:0 6px 6px 0; }
.article.internal { border-left-color:#f79009; }
.article .meta { font-size:.8rem; color:var(--muted); margin-bottom:4px; }
.article .body { white-space:pre-wrap; word-break:break-word; }
.grid { display:grid; grid-template-columns:2fr 1fr; gap:16px; }
@media (max-width:800px) { .grid { grid-template-columns:1fr; } }
.small { font-size:.85rem; color:var(--muted); }
.login { max-width:340px; margin:60px auto; }
.login label { margin-bottom:10px; }
.top .doclink { margin-left:auto; }
.top nav a, .top .doclink { padding:6px 2px; }
input, select { min-width:0; }

/* Smartphone-Ansicht */
@media (max-width:700px) {
  body { font-size:16px; }
  .top { padding:8px 12px; gap:6px 12px; }
  .top nav { order:3; flex:1 1 100%; gap:4px 16px; }
  .top nav a { padding:8px 0; }
  main { margin:12px auto; padding:0 12px; }
  h1 { font-size:1.2rem; }
  .card { padding:12px; }
  /* 16px Schrift verhindert das automatische Hineinzoomen auf dem iPhone */
  input, select, textarea, button { font-size:16px; min-height:44px; padding:10px 12px; width:100%; }
  textarea { min-height:140px; }
  .row { flex-direction:column; align-items:stretch; gap:10px; }
  .row > label, .row > button, .row > input, .row > select { width:100%; flex:none !important; }
  label { font-size:.85rem; }
  .login { margin:24px auto; }
  .article { padding:8px 10px; }

  /* Tabellen als Karten */
  table.stack, table.stack thead, table.stack tbody, table.stack tr, table.stack td { display:block; width:100%; }
  table.stack thead { display:none; }
  table.stack tr { border:1px solid var(--line); border-radius:8px; padding:8px 10px; margin-bottom:10px; background:var(--card); }
  table.stack td { border:0; padding:3px 0; }
  table.stack td[data-label]::before { content:attr(data-label) ": "; color:var(--muted); font-size:.8rem; }
  table.stack td.title { font-weight:500; font-size:1.05rem; }
  table.stack td.title::before, table.stack td.num::before { content:none; }
  table.stack td button { width:auto; margin:4px 6px 0 0; min-height:40px; }
}
