/* Server-Status. Rick.Software-Designsprache: Petrol, Bernstein, Roboto (wie Inventar-Verwaltung) */
@font-face { font-family: Roboto; src: url("/roboto-regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: Roboto; src: url("/roboto-bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --petrol: #14566a; --petrol-hell: #1e7189; --petrol-dunkel: #0e4252; --bernstein: #e8a84a; --bernstein-dunkel: #b5761e;
  --grund: #f3f6f7; --karte: #ffffff; --text: #14343d; --leise: #4c6670; --rand: #d5dddd; --feld: #ffffff;
  --ok: #1f7a3a; --hinweis: #b5761e; --warnung: #b3261e; --info: #14566a;
  --flaeche: color-mix(in srgb, var(--petrol) 7%, var(--karte));
  --schatten: 0 1px 2px rgba(13, 60, 75, .06), 0 4px 14px rgba(13, 60, 75, .07);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --grund: #0f1719; --karte: #172226; --text: #e6eeee; --leise: #a6b6b6; --rand: #2b3a3e; --feld: #10191c;
    --ok: #5cc27a; --hinweis: #f0b65e; --warnung: #ff8a80; --info: #6cc3da; --petrol: #2a8aa5;
    --schatten: 0 1px 2px rgba(0,0,0,.3); color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { background: var(--grund); min-height: 100%; -webkit-tap-highlight-color: transparent; }
body { min-height: 100dvh; background: var(--grund); color: var(--text); font: 17px/1.45 Roboto, "Segoe UI", system-ui, sans-serif; }
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }

header { background: linear-gradient(135deg, var(--petrol-hell), #14566a, var(--petrol-dunkel)); color: #fff;
  padding-top: env(safe-area-inset-top); position: sticky; top: 0; z-index: 5; }
.kopf { max-width: 760px; margin: 0 auto; padding: 14px 16px 16px; display: flex; align-items: center; gap: 12px; }
.kopf-titel { flex: 1; min-width: 0; }
h1 { margin: 0; font-size: 23px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.strich { width: 48px; height: 4px; border-radius: 99px; background: var(--bernstein); margin-top: 7px; }
.status { display: flex; align-items: center; gap: 7px; background: rgba(255,255,255,.12); border: 0; color: #fff;
  border-radius: 99px; padding: 6px 12px; font-size: 14px; cursor: pointer; min-height: 36px; }
.status-punkt { width: 9px; height: 9px; border-radius: 50%; background: #7ee29a; flex: none; }
.status.hinweis .status-punkt { background: var(--bernstein); }
.status.warnung .status-punkt { background: #ff8a80; }
.status.laedt .status-punkt { background: #c9d3d6; }

main { max-width: 760px; margin: 0 auto; padding: 16px 16px calc(110px + env(safe-area-inset-bottom)); display: grid; gap: 14px; outline: none; }
.karte { background: var(--karte); border: 1px solid color-mix(in srgb, var(--rand) 60%, transparent); border-radius: 18px;
  padding: 16px 18px; box-shadow: var(--schatten); }
h2 { margin: 0 0 8px; font-size: 20px; }
p { margin: 0 0 8px; }
.leise { color: var(--leise); }
.klein { font-size: 14px; color: var(--leise); }

/* Ampel */
.ampel { display: flex; gap: 16px; align-items: center; }
.ampel-kreis { width: 58px; height: 58px; border-radius: 50%; flex: none; display: grid; place-items: center; color: #fff; font-size: 30px; font-weight: 700; }
.ampel.ok .ampel-kreis { background: var(--ok); }
.ampel.hinweis .ampel-kreis { background: var(--bernstein-dunkel); }
.ampel.warnung .ampel-kreis { background: var(--warnung); }
.ampel h2 { margin: 0 0 2px; }
.ampel p { margin: 0; }

/* Bereiche */
details.bereich { padding: 0; overflow: hidden; }
details.bereich > summary { list-style: none; cursor: pointer; padding: 14px 18px; display: flex; align-items: center; gap: 12px; min-height: 56px; }
details.bereich > summary::-webkit-details-marker { display: none; }
details.bereich > summary::after { content: "›"; font-size: 26px; line-height: 1; color: var(--leise); transition: transform .15s; }
details.bereich[open] > summary::after { transform: rotate(90deg); }
.bereich-name { flex: 1; font-weight: 700; font-size: 18px; }
.bereich-zusammen { font-size: 14px; color: var(--leise); }
.punkte { list-style: none; margin: 0; padding: 0 18px 10px; }
.punkte li { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid color-mix(in srgb, var(--rand) 60%, transparent); }
.punkt-titel { font-weight: 700; overflow-wrap: anywhere; }
.punkt-text { color: var(--leise); font-size: 15px; overflow-wrap: anywhere; }
.punkt-text.ok { color: var(--leise); }

.punkt-farbe { width: 12px; height: 12px; border-radius: 50%; flex: none; margin-top: 6px; background: var(--ok); }
.punkt-farbe.hinweis { background: var(--bernstein); }
.punkt-farbe.warnung { background: var(--warnung); }
.punkt-farbe.info { background: var(--info); }

/* Meldungen und Verlauf */
.liste { list-style: none; margin: 0; padding: 0; }
.liste > li { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid color-mix(in srgb, var(--rand) 60%, transparent); }
.liste > li:first-child { border-top: 0; }
.eintrag { flex: 1; min-width: 0; }
.eintrag-kopf { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.eintrag-titel { font-weight: 700; overflow-wrap: anywhere; }
.eintrag-zeit { font-size: 14px; color: var(--leise); }
.eintrag-text { white-space: pre-wrap; color: var(--leise); overflow-wrap: anywhere; margin-top: 2px; font-size: 15px; }
.tag-kopf { margin: 14px 0 2px; font-size: 14px; font-weight: 700; color: var(--leise); text-transform: uppercase; letter-spacing: .04em; }
.tag-kopf:first-child { margin-top: 0; }

/* Knöpfe und Felder */
.knopf { font-weight: 700; font-size: 17px; color: #fff; background: #14566a; border: 0; border-radius: 99px;
  padding: 12px 24px; min-height: 48px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.knopf:hover { background: var(--petrol-hell); }
.knopf:disabled { opacity: .55; cursor: default; }
.knopf.zweit { background: var(--flaeche); color: var(--text); }
.knopf.klein { font-size: 15px; padding: 7px 16px; min-height: 38px; }
.knoepfe { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
label { display: block; font-weight: 700; margin: 10px 0 6px; }
.qr { display: block; margin: 12px auto 4px; border-radius: 12px; background: #fff; max-width: 100%; height: auto; }
.link { overflow-wrap: anywhere; user-select: all; }
input[type="text"], input[type="password"] { width: 100%; border: 1px solid var(--rand); background: var(--feld); border-radius: 12px; padding: 12px 14px; min-height: 48px; }
input:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid var(--bernstein); outline-offset: 2px; }
.fehler { color: var(--warnung); font-weight: 700; margin-top: 10px; }

/* Leiste unten */
.leiste { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: var(--karte); border-top: 1px solid var(--rand);
  display: flex; justify-content: center; padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -2px 12px rgba(13,60,75,.06); }
.leiste button { flex: 1; max-width: 190px; background: none; border: 0; padding: 8px 4px 10px; display: grid; justify-items: center;
  gap: 1px; font-size: 13px; color: var(--leise); cursor: pointer; min-height: 56px; }
.leiste .sym { font-size: 20px; line-height: 1.2; }
.leiste button[aria-current="page"] { color: var(--text); font-weight: 700; }
.leiste button[aria-current="page"] .sym { color: var(--bernstein-dunkel); }
.zahl { display: inline-block; min-width: 19px; padding: 0 5px; margin-left: 4px; border-radius: 99px; background: var(--warnung);
  color: #fff; font-size: 12px; font-weight: 700; line-height: 19px; text-align: center; }
.zahl.hinweis { background: var(--bernstein-dunkel); }
.zahl.info { background: var(--petrol); }

.hinweisleiste { position: fixed; left: 16px; right: 16px; bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 20; max-width: 520px;
  margin: 0 auto; background: #14343d; color: #fff; border-radius: 14px; padding: 12px 16px; box-shadow: var(--schatten); }
