:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --line: #e4e4e7;
  --text: #18181b;
  --muted: #52525b;
  --focus: #2563eb;
  --live-bg: #dcfce7; --live-fg: #14532d;
  --test-bg: #fef3c7; --test-fg: #713f12;
  --arbeit-bg: #dbeafe; --arbeit-fg: #1e3a8a;
  --intern-bg: #f4f4f5; --intern-fg: #3f3f46;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #09090b; --surface: #18181b; --line: #27272a; --text: #fafafa; --muted: #a1a1aa; --focus: #60a5fa;
    --live-bg: #14532d; --live-fg: #dcfce7;
    --test-bg: #713f12; --test-fg: #fef3c7;
    --arbeit-bg: #1e3a8a; --arbeit-fg: #dbeafe;
    --intern-bg: #27272a; --intern-fg: #d4d4d8;
  }
}
* { box-sizing: border-box; margin: 0; }
body { line-height: 1.5; }
.page { max-width: 72rem; margin: 0 auto; padding: 48px 24px 64px; }
.head { margin-bottom: 32px; }
h1 { font-size: 1.75rem; font-weight: 600; line-height: 1.2; }
.lead { color: var(--muted); margin-top: 8px; max-width: 65ch; }
.group + .group { margin-top: 48px; }
h2 { font-size: 1.25rem; font-weight: 600; }
.group-text { color: var(--muted); font-size: 0.875rem; margin-top: 4px; }
.grid { list-style: none; padding: 0; margin-top: 16px; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); }
.grid > li { display: flex; }
.card {
  position: relative; display: flex; flex-direction: column; gap: 8px; width: 100%;
  padding: 20px; min-height: 44px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: inherit; text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
a.card:hover { border-color: var(--muted); box-shadow: 0 2px 8px rgb(0 0 0 / 0.06); }
a.card:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.card.disabled { background: transparent; border-style: dashed; }
h3 { font-size: 1rem; font-weight: 600; padding-right: 24px; }
.card-head { display: flex; align-items: center; gap: 12px; }
.logo { width: 32px; height: 32px; flex-shrink: 0; border-radius: 7px; object-fit: contain; }
.logo.letter { display: grid; place-items: center; background: var(--intern-bg); color: var(--intern-fg); font-weight: 600; font-size: 0.9375rem; }
.text { color: var(--muted); font-size: 0.875rem; flex: 1; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 0.8125rem; color: var(--muted); }
.badge { padding: 2px 8px; border-radius: 999px; font-weight: 500; }
.badge.live { background: var(--live-bg); color: var(--live-fg); }
.badge.test { background: var(--test-bg); color: var(--test-fg); }
.badge.arbeit { background: var(--arbeit-bg); color: var(--arbeit-fg); }
.badge.intern { background: var(--intern-bg); color: var(--intern-fg); }

/* Karte mit Checkliste: ein Kasten aus Link und aufklappbarer Liste */
.box { position: relative; display: flex; flex-direction: column; width: 100%; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); transition: border-color 0.15s; }
.box:hover, .box:has(.todo[open]) { border-color: var(--muted); }
.card.in-box { border: 0; border-radius: 10px 10px 0 0; flex: 1; }
a.card.in-box:hover { box-shadow: none; }
.card.disabled.in-box { border: 0; }
.todo { border-top: 1px solid var(--line); padding: 0 20px; font-size: 0.875rem; }
/* Aufgeklappt liegt die Liste über den Karten darunter, damit die Nachbarkarten nicht mitwachsen. */
.todo .panel {
  position: absolute; z-index: 5; top: calc(100% - 6px); left: -1px; right: -1px;
  padding: 12px 20px 0; border: 1px solid var(--muted); border-top: 0; border-radius: 0 0 10px 10px;
  background: var(--surface); box-shadow: 0 8px 20px rgb(0 0 0 / 0.12);
}
.todo[open] { border-bottom: 0; }
.todo summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 500; }
.todo summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.todo summary::-webkit-details-marker { display: none; }
.todo .count { color: var(--muted); font-weight: 400; font-size: 0.8125rem; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.todo .chev { display: inline-block; font-size: 1rem; line-height: 1; transition: transform 0.15s; }
.todo[open] .chev { transform: rotate(180deg); }
.todo ul { list-style: none; padding: 0 0 4px; display: grid; gap: 6px; }
.todo li { display: grid; grid-template-columns: 18px 1fr; gap: 8px; align-items: start; }
.todo .mark { width: 16px; height: 16px; margin-top: 2px; border: 1.5px solid var(--muted); border-radius: 4px; display: grid; place-items: center; font-size: 0.6875rem; line-height: 1; }
.todo li.done .mark { background: var(--live-bg); border-color: var(--live-fg); color: var(--live-fg); font-weight: 700; }
.todo li.done > span:last-child { color: var(--muted); text-decoration: line-through; }
.todo .stand { color: var(--muted); font-size: 0.75rem; padding: 8px 0 14px; }
.url { font-size: 0.8125rem; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.arrow { position: absolute; top: 18px; right: 20px; color: var(--muted); }
@media (max-width: 40rem) { .page { padding: 32px 16px 48px; } }
@media (prefers-reduced-motion: reduce) { .card, .box, .todo .chev { transition: none; } }

/* Anmeldung */
[hidden] { display: none !important; }
.head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.login { max-width: 24rem; margin: 10vh auto 0; display: grid; gap: 8px; }
.login h1 { margin-bottom: 0; }
.login .lead { margin: 0 0 16px; }
.login label { font-size: 0.875rem; font-weight: 500; margin-top: 8px; }
.login input {
  font: inherit; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--surface); color: var(--text);
}
.login input:focus-visible, button:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
button {
  font: inherit; font-weight: 500; height: 44px; padding: 0 16px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--text); background: var(--text); color: var(--bg); margin-top: 16px;
}
button:disabled { opacity: 0.6; cursor: wait; }
button.ghost { background: transparent; color: var(--text); border-color: var(--line); margin-top: 0; flex-shrink: 0; }
.error { padding: 8px 12px; border-radius: 6px; background: #fee2e2; color: #7f1d1d; font-size: 0.875rem; }

/* Health */
:root { --ok-bg: #dcfce7; --ok-fg: #14532d; --ok-dot: #16a34a; --warn-bg: #fef3c7; --warn-fg: #713f12; --warn-dot: #d97706; --fail-bg: #fee2e2; --fail-fg: #7f1d1d; --fail-dot: #dc2626; }
@media (prefers-color-scheme: dark) {
  :root { --ok-bg: #14532d; --ok-fg: #dcfce7; --ok-dot: #4ade80; --warn-bg: #713f12; --warn-fg: #fef3c7; --warn-dot: #fbbf24; --fail-bg: #7f1d1d; --fail-fg: #fee2e2; --fail-dot: #f87171; }
}
.back { margin-bottom: 16px; font-size: 0.875rem; }
.back a { color: var(--muted); display: inline-block; padding: 10px 0; }
.back a:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.hosts { list-style: none; padding: 0; display: grid; gap: 16px; }
.host { padding: 20px; border: 1px solid var(--line); border-left-width: 6px; border-radius: 10px; background: var(--surface); }
.host.ok { border-left-color: var(--ok-dot); }
.host.warn { border-left-color: var(--warn-dot); }
.host.fail { border-left-color: var(--fail-dot); }
.host-head { display: flex; align-items: center; gap: 12px; }
.host-head h2 { font-size: 1.125rem; }
.host .meta { margin-top: 4px; }
.stale { color: var(--fail-fg); background: var(--fail-bg); padding: 2px 8px; border-radius: 6px; font-weight: 500; }
.badge.ok { background: var(--ok-bg); color: var(--ok-fg); }
.badge.warn { background: var(--warn-bg); color: var(--warn-fg); }
.badge.fail { background: var(--fail-bg); color: var(--fail-fg); }
.checks { list-style: none; padding: 0; margin-top: 12px; display: grid; gap: 4px; font-size: 0.875rem; }
.check { display: grid; grid-template-columns: 10px minmax(6rem, max-content) 1fr; align-items: baseline; gap: 10px; }
.dot { width: 10px; height: 10px; border-radius: 50%; align-self: center; }
.dot.ok { background: var(--ok-dot); }
.dot.warn { background: var(--warn-dot); }
.dot.fail { background: var(--fail-dot); }
.check-name { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.check-msg { color: var(--muted); overflow-wrap: anywhere; }
.check.warn .check-msg, .check.fail .check-msg { color: var(--text); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Backup-Streifen und Verlaufskurven (health-charts.js) */
.backup { grid-column: 1 / -1; margin: 2px 0 8px 20px; }
.strip { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(30, 1fr); gap: 2px; }
.cell { height: 22px; border-radius: 3px; display: grid; place-items: center; font-size: 0.6875rem; line-height: 1; color: var(--fail-fg); background: var(--line); }
.cell.ok { background: var(--ok-dot); }
.cell.fail { background: var(--fail-bg); border: 1px solid var(--fail-dot); }
.strip-meta { margin-top: 6px; font-size: 0.8125rem; color: var(--muted); }
.strip-meta code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }
.history { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.history h3 { font-size: 1rem; }
.metrics { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 12px; }
.metric { position: relative; margin: 0; }
.metric figcaption { display: flex; justify-content: space-between; gap: 8px; font-size: 0.8125rem; color: var(--muted); }
.metric figcaption strong { color: var(--text); font-weight: 600; }
.chart { width: 100%; height: auto; display: block; touch-action: pan-y; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 9px; }
.chart .line { fill: none; stroke: var(--focus); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chart .pt { fill: var(--focus); stroke: var(--surface); stroke-width: 2; }
.chart .cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.tip { position: absolute; top: 20px; right: 0; padding: 2px 8px; border-radius: 6px; font-size: 0.75rem; background: var(--text); color: var(--bg); pointer-events: none; }
.tip[hidden] { display: none; }
.updates { grid-column: 1 / -1; margin: 2px 0 8px 20px; font-size: 0.8125rem; }
.updates summary { cursor: pointer; color: var(--muted); padding: 6px 0; min-height: 44px; display: flex; align-items: center; }
.updates summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.upd-day h4 { font-size: 0.8125rem; margin-top: 8px; }
.upd-day ul { list-style: none; padding: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); }
.upd-day li { overflow-wrap: anywhere; }
.upd-day li.upd-note { color: var(--warn-fg); background: var(--warn-bg); border-radius: 4px; padding: 0 6px; width: fit-content; }
