:root {
  color-scheme: light dark;
  --bg: #f5f6f8;
  --flaeche: #ffffff;
  --text: #1a2233;
  --text-schwach: #5b6577;
  --rand: #d9dde3;
  --akzent: #12213b;
  --gruen: #2e9e5b;
  --rot: #c0392b;
  --grau: #9aa2b1;
  --fehler: #c0392b;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151c;
    --flaeche: #1b1f2a;
    --text: #e7eaf0;
    --text-schwach: #9aa2b1;
    --rand: #2c313e;
    --akzent: #6f8fd6;
  }
}

* { box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  margin: 0;
}

.kopf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: var(--akzent);
  color: #fff;
}
.kopf h1 { font-size: 1.1rem; margin: 0; }

main {
  margin: 1.5rem auto 2.5rem;
  padding: 0 1.5rem;
}

.karte {
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: 10px;
  padding: 1.5rem;
}
.karte-schmal { max-width: 420px; margin: 3rem auto; }
.karte-kopf { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }

h2 { margin-top: 0; }

.hinweis { color: var(--text-schwach); font-size: 0.9rem; }
.fehler { color: var(--fehler); min-height: 1.2em; font-size: 0.9rem; }

form { display: flex; flex-direction: column; gap: 0.9rem; }
label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.9rem; }
input, textarea {
  font: inherit;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--rand);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
}
textarea { font-family: ui-monospace, monospace; font-size: 0.8rem; resize: vertical; }

button {
  font: inherit;
  padding: 0.55rem 1rem;
  border: none;
  border-radius: 6px;
  background: var(--akzent);
  color: #fff;
  cursor: pointer;
}
button:hover { filter: brightness(1.1); }
.knopf-still {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--rand);
}
.knopf-loeschen { color: var(--rot); border-color: var(--rot); }
.knopf-zeile { display: flex; gap: 0.6rem; margin-bottom: 1rem; }

.knopf-update { background: var(--gruen); }
.knopf-rollback { background: var(--rot); }

.aktionen-zelle { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.aktionen-zelle button { white-space: nowrap; }

.komponenten-liste { display: flex; flex-direction: column; gap: 0.45rem; margin: 0.8rem 0 1rem; }
.komponenten-liste label { display: flex; gap: 0.5rem; align-items: flex-start; }
.komponenten-liste input { width: auto; margin-top: 0.2rem; }

.code-anzeige {
  font-family: ui-monospace, monospace;
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  background: var(--bg);
  padding: 0.6rem;
  border-radius: 6px;
  word-break: break-all;
}
.uri { word-break: break-all; font-size: 0.75rem; }

.tabelle { width: 100%; border-collapse: collapse; }
.tabelle th, .tabelle td {
  text-align: left;
  padding: 0.5rem 0.4rem;
  border-bottom: 1px solid var(--rand);
  font-size: 0.9rem;
}

.ampel {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
}
.ampel-gruen { background: var(--gruen); }
.ampel-rot { background: var(--rot); }
.ampel-grau { background: var(--grau); }

.status-laeuft { color: var(--text-schwach); }
.status-erfolgreich { color: var(--gruen); }
.status-fehlgeschlagen { color: var(--rot); }
