/* Sitta Server (0263): dieselben Farbvariablen wie die Geraeteoberflaeche (led-app/templates/index.html).
   Dunkel ist die Vorgabe; Hell kommt ueber das System (prefers-color-scheme) oder die Wahl oben (data-theme). */
:root {
  color-scheme: dark;
  --bg: #1c1c1e; --panel: #2c2c2e; --fill: #3a3a3c; --border: #48484a; --deep: #0f0f11; --sunk: #232325;
  --text: #f2f2f7; --text2: #aeaeb2; --label: #a0a0a5; --muted: #8e8e93; --dim: #6c6c70;
  --blue: #0a84ff; --link: #64d2ff; --ok: #34c759; --warn: #ff9f0a; --bad: #ff6b5e; --red: #ff453a;
  --ok-soft: #0f3d24; --bad-soft: #3d1f1f; --warn-soft: #3d2e12;
  --breite: min(980px, 100%);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f2f2f7; --panel: #ffffff; --fill: #e5e5ea; --border: #c7c7cc; --deep: #fafafc; --sunk: #f7f7fa;
    --text: #1c1c1e; --text2: #48484a; --label: #636366; --muted: #6c6c70; --dim: #8e8e93;
    --blue: #007aff; --link: #0066cc; --ok: #248a3d; --warn: #c25e00; --bad: #d70015; --red: #e0261b;
    --ok-soft: #dff5e6; --bad-soft: #fde4e2; --warn-soft: #fff1db;
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f2f2f7; --panel: #ffffff; --fill: #e5e5ea; --border: #c7c7cc; --deep: #fafafc; --sunk: #f7f7fa;
  --text: #1c1c1e; --text2: #48484a; --label: #636366; --muted: #6c6c70; --dim: #8e8e93;
  --blue: #007aff; --link: #0066cc; --ok: #248a3d; --warn: #c25e00; --bad: #d70015; --red: #e0261b;
  --ok-soft: #dff5e6; --bad-soft: #fde4e2; --warn-soft: #fff1db;
}

* { box-sizing: border-box; }
body {
  font-family: system-ui, sans-serif; background: var(--bg); color: var(--text);
  margin: 0; padding: 1.2rem 1rem 2rem; display: flex; flex-direction: column; align-items: center;
}
a { color: var(--link); }
header.kopf, main, footer { width: 100%; max-width: var(--breite); }
header.kopf { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem; margin-bottom: 1rem; }
.marke { font-size: 1.05rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text); text-decoration: none; }
nav { display: flex; flex-wrap: wrap; gap: 0.3rem; }
nav a { padding: 0.35rem 0.7rem; border-radius: 8px; background: var(--panel); border: 1px solid var(--border); color: var(--text); text-decoration: none; font-size: 0.9rem; }
nav a.aktiv { background: var(--ok); color: #000; border-color: var(--ok); }
.wahl { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; font-size: 0.85rem; color: var(--muted); }
.wahl a { color: var(--muted); text-decoration: none; }
.wahl a.aktiv { color: var(--text); font-weight: 600; }
footer { margin-top: 2rem; font-size: 0.75rem; color: var(--dim); text-align: center; }

h1 { font-size: 1.2rem; margin: 0.4rem 0 0.9rem; }
h2 { font-size: 1.02rem; margin: 0 0 0.75rem; }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 1rem 1.1rem; margin-bottom: 1rem; }
.panel.schmal { max-width: 420px; margin-left: auto; margin-right: auto; }
.leise { color: var(--muted); font-size: 0.88rem; }
.hinweis { border-radius: 10px; padding: 0.6rem 0.8rem; margin: 0 0 1rem; }
.hinweis.ok { background: var(--ok-soft); color: var(--text); border: 1px solid var(--ok); }
.hinweis.fehler { background: var(--bad-soft); color: var(--text); border: 1px solid var(--bad); }
.hinweis.warn { background: var(--warn-soft); color: var(--text); border: 1px solid var(--warn); }

form { margin: 0; }
form.reihe { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: flex-end; }
form.inline { display: inline; }
.abstand { margin-top: 0.9rem; }
label { display: block; font-size: 0.85rem; color: var(--label); margin: 0.6rem 0 0.25rem; }
form.reihe label { margin-top: 0; }
input[type=text], input[type=password], input[type=number], input[type=date], textarea, select {
  width: 100%; padding: 0.55rem 0.65rem; font-size: 1rem; color: var(--text); background: var(--sunk);
  border: 1px solid var(--border); border-radius: 8px; font-family: inherit;
}
textarea { min-height: 4.5rem; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--blue); outline-offset: 0; }
button {
  padding: 0.6rem 1rem; font-size: 0.95rem; font-weight: 600; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--border); background: var(--fill); color: var(--text);
}
button.haupt { background: var(--ok); border-color: var(--ok); color: #000; }
button.gefahr { background: var(--bad-soft); border-color: var(--bad); color: var(--text); }
button.klein { padding: 0.3rem 0.6rem; font-size: 0.8rem; font-weight: 500; }
.knoepfe { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.9rem; }
.feld { flex: 1 1 12rem; min-width: 0; }

.tabelle { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 0.45rem 0.5rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--label); font-weight: 500; font-size: 0.8rem; white-space: nowrap; }
td.zahl { text-align: right; font-variant-numeric: tabular-nums; }
.marke-ok, .marke-aus, .marke-warn, .marke-bad {
  display: inline-block; padding: 0.1rem 0.45rem; border-radius: 6px; font-size: 0.78rem; white-space: nowrap;
}
.marke-ok { background: var(--ok-soft); color: var(--ok); }
.marke-aus { background: var(--fill); color: var(--muted); }
.marke-warn { background: var(--warn-soft); color: var(--warn); }
.marke-bad { background: var(--bad-soft); color: var(--bad); }
code, .code { font-family: ui-monospace, Consolas, monospace; background: var(--sunk); border: 1px solid var(--border); border-radius: 6px; padding: 0.1rem 0.35rem; word-break: break-all; }
.code.gross { display: block; font-size: 1.2rem; padding: 0.7rem; text-align: center; letter-spacing: 0.04em; margin: 0.6rem 0; }
ul.codes { columns: 2; list-style: none; padding: 0; font-family: ui-monospace, Consolas, monospace; font-size: 1.05rem; }
ul.codes li { padding: 0.2rem 0; }
dl.werte { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1rem; margin: 0; }
dl.werte dt { color: var(--label); font-size: 0.85rem; }
dl.werte dd { margin: 0; }
img.qr { background: #fff; border-radius: 8px; padding: 6px; max-width: 220px; width: 100%; }
/* 0266: Reiter des Geraets im abgeschotteten Rahmen */
iframe.fern-rahmen { display: block; width: 100%; height: max(640px, 82vh); border: 1px solid var(--border); border-radius: 12px; background: var(--bg); }
p.fern-wahl { display: flex; flex-wrap: wrap; gap: 0.4rem 0.8rem; align-items: center; }
a.knopf { display: inline-block; padding: 0.45rem 0.9rem; border: 1px solid var(--border); border-radius: 8px; background: var(--fill); color: var(--text); text-decoration: none; font-weight: 600; }

@media (max-width: 600px) {
  body { padding: 0.8rem 0.6rem 1.5rem; }
  ul.codes { columns: 1; }
  dl.werte { grid-template-columns: 1fr; }
  dl.werte dd { margin-bottom: 0.4rem; }
  th, td { padding: 0.4rem 0.35rem; }
}
