:root {
  --text: #1d2433;
  --leise: #5b6475;
  --linie: #d9dde5;
  --flaeche: #f5f7fa;
  --akzent: #1f5fbf;
  --akzent-dunkel: #174a95;
  --ok: #1d7a46;
  --fehler: #b3261e;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: #fff;
}

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 24px 120px;
}

h1 { font-size: 1.6rem; margin: 0.5rem 0 1.5rem; }
h2 { font-size: 1.1rem; margin: 2rem 0 0.6rem; }
h3 { font-size: 1rem; margin: 1.4rem 0 0.4rem; }

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

.kopf {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 24px;
  border-bottom: 1px solid var(--linie);
  background: var(--flaeche);
}
.kopf .marke { font-weight: 600; }
.kopf nav { display: flex; gap: 16px; align-items: center; }
.kopf .wer { color: var(--leise); }

.code, pre.antwort, .chat pre {
  font-family: var(--mono);
  font-size: 0.9rem;
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: 6px;
  padding: 12px 14px;
  overflow-x: auto;
  white-space: pre;
  margin: 0;
}
pre.antwort, .chat pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.code .kommentar { color: var(--leise); }

.nummeriert { counter-reset: zeile; }
.nummeriert .zeile { counter-increment: zeile; }
.nummeriert .zeile::before {
  content: counter(zeile);
  display: inline-block;
  width: 2.2em;
  margin-right: 1em;
  text-align: right;
  color: var(--leise);
  user-select: none;
}

textarea, input[type="text"], input[type="password"], input:not([type]) {
  width: 100%;
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--linie);
  border-radius: 6px;
}
textarea { resize: vertical; }
textarea.mono { font-family: var(--mono); font-size: 0.9rem; }
textarea:focus, input:focus { outline: 2px solid var(--akzent); outline-offset: -1px; }

label.feld { display: block; margin-bottom: 8px; color: var(--leise); }
label.feld input { margin-top: 4px; color: var(--text); }

button, .knopf {
  display: inline-block;
  font: inherit;
  padding: 9px 18px;
  border: 1px solid var(--akzent);
  border-radius: 6px;
  background: var(--akzent);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
}
button:hover, .knopf:hover { background: var(--akzent-dunkel); }
button:disabled { opacity: 0.6; cursor: wait; }
.zweitrangig { background: #fff; color: var(--akzent); }
.zweitrangig:hover { background: var(--flaeche); }
button.leise { background: none; border: none; color: var(--akzent); padding: 0; }
form.inline { display: inline; }

.leiste {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  background: #fff;
  border-top: 1px solid var(--linie);
}
.leiste .mitte { display: flex; gap: 16px; align-items: center; }
.zaehler { color: var(--leise); }

.status { color: var(--leise); font-size: 0.9rem; margin-left: 8px; }
.status[data-art="ok"] { color: var(--ok); }
.status[data-art="fehler"], .fehler { color: var(--fehler); }
.ok { color: var(--ok); }
.klein { color: var(--leise); font-size: 0.85rem; font-weight: normal; }

.nebeneinander { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.app-liste {
  list-style: none;
  padding: 0;
  margin: 0;
  border: 1px solid var(--linie);
  border-radius: 6px;
}
.app-liste li { padding: 8px 14px; border-bottom: 1px solid var(--linie); }
.app-liste li:last-child { border-bottom: none; }

.chat { border: 1px solid var(--linie); border-radius: 6px; }
.chat-verlauf { max-height: 480px; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.chat-verlauf:empty { display: none; }
.nachricht.user { align-self: flex-end; max-width: 85%; }
.nachricht.user pre { background: #e8f0fc; border-color: #c8d8f2; }
.nachricht.assistant { align-self: flex-start; max-width: 95%; }
.nachricht.wartet pre { color: var(--leise); font-style: italic; }
.nachricht.fehler pre { color: var(--fehler); }
.chat-eingabe { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--linie); align-items: flex-end; }
.chat-verlauf:empty + .chat-eingabe { border-top: none; }

.anmeldung { max-width: 360px; margin: 10vh auto 0; display: flex; flex-direction: column; gap: 14px; }
.anmeldung label { display: flex; flex-direction: column; gap: 4px; }

.karte { border: 1px solid var(--linie); border-radius: 8px; padding: 4px 20px 16px; margin-bottom: 20px; }
.karte summary { cursor: pointer; }
.karte summary h2 { display: inline; }
.karte .nachricht { margin: 8px 0; }
dl.loesung dt { font-weight: 600; margin-top: 10px; }
dl.loesung dd { margin: 2px 0 0; white-space: pre-wrap; }

@media (max-width: 720px) {
  .nebeneinander { grid-template-columns: 1fr; }
}
