:root {
  color-scheme: light;
  --page: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #ececf0;
  --ink: #1d1d1f;
  --ink-2: #515154;
  --muted: #6e6e73;
  --axis-text: #6e6e73;
  --grid: #e5e5ea;
  --axis: #c7c7cc;
  --border: rgba(0, 0, 0, 0.08);
  --control-border: rgba(0, 0, 0, 0.16);
  --accent: #0071e3;
  --accent-ink: #0066cc;
  --accent-wash: rgba(0, 113, 227, 0.1);
  --on-accent: #0071e3;
  --on-danger: #d70015;
  --s2xx: #0071e3;
  --s3xx: #34c759;
  --s4xx: #ff9500;
  --s5xx: #ff3b30;
  --good: #34c759;
  --warn: #ff9f0a;
  --critical: #ff3b30;
  --critical-ink: #c5000f;
  --critical-wash: rgba(255, 59, 48, 0.1);
  --warn-wash: rgba(255, 159, 10, 0.14);
  --segment-on: #ffffff;
  --sidebar: #ececf0;
  --sidebar-on: rgba(0, 0, 0, 0.09);
  --glass: rgba(255, 255, 255, 0.72);
  --card-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.04);
  --card-shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.05), 0 10px 28px rgba(0, 0, 0, 0.09);
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.16);
  --map-none: #e8e8ed;
  --map-line: #ffffff;
  --map-1: #cfe3fb;
  --map-2: #8fc0f5;
  --map-3: #4a9bef;
  --map-4: #0071e3;
  --map-5: #00407f;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #000000;
    --surface: #1c1c1e;
    --surface-2: #2c2c2e;
    --ink: #f5f5f7;
    --ink-2: #c7c7cc;
    --muted: #98989d;
    --axis-text: #98989d;
    --grid: #38383a;
    --axis: #48484a;
    --border: rgba(255, 255, 255, 0.1);
    --control-border: rgba(255, 255, 255, 0.18);
    --accent: #0a84ff;
    --accent-ink: #64b0ff;
    --accent-wash: rgba(10, 132, 255, 0.18);
    --s2xx: #0a84ff;
    --s3xx: #30d158;
    --s4xx: #ff9f0a;
    --s5xx: #ff453a;
    --good: #30d158;
    --warn: #ff9f0a;
    --critical: #ff453a;
    --critical-ink: #ff7b72;
    --critical-wash: rgba(255, 69, 58, 0.18);
    --warn-wash: rgba(255, 159, 10, 0.16);
    --segment-on: #636366;
    --sidebar: #1c1c1e;
    --sidebar-on: rgba(255, 255, 255, 0.13);
    --glass: rgba(28, 28, 30, 0.72);
    --card-shadow: none;
    --card-shadow-hover: 0 0 0 1px rgba(255, 255, 255, 0.14);
    --shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
    --map-none: #2c2c2e;
    --map-line: #1c1c1e;
    --map-1: #123a68;
    --map-2: #17569b;
    --map-3: #0a84ff;
    --map-4: #64b0ff;
    --map-5: #cfe3fb;
  }
}

/* Von Hand gewählt: gilt unabhängig vom Betriebssystem. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #000000;
  --surface: #1c1c1e;
  --surface-2: #2c2c2e;
  --ink: #f5f5f7;
  --ink-2: #c7c7cc;
  --muted: #98989d;
  --axis-text: #98989d;
  --grid: #38383a;
  --axis: #48484a;
  --border: rgba(255, 255, 255, 0.1);
  --control-border: rgba(255, 255, 255, 0.18);
  --accent: #0a84ff;
  --accent-ink: #64b0ff;
  --accent-wash: rgba(10, 132, 255, 0.18);
  --s2xx: #0a84ff;
  --s3xx: #30d158;
  --s4xx: #ff9f0a;
  --s5xx: #ff453a;
  --good: #30d158;
  --warn: #ff9f0a;
  --critical: #ff453a;
  --critical-ink: #ff7b72;
  --critical-wash: rgba(255, 69, 58, 0.18);
  --warn-wash: rgba(255, 159, 10, 0.16);
  --segment-on: #636366;
  --sidebar: #1c1c1e;
  --sidebar-on: rgba(255, 255, 255, 0.13);
  --glass: rgba(28, 28, 30, 0.72);
  --card-shadow: none;
  --card-shadow-hover: 0 0 0 1px rgba(255, 255, 255, 0.14);
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  --map-none: #2c2c2e;
  --map-line: #1c1c1e;
  --map-1: #123a68;
  --map-2: #17569b;
  --map-3: #0a84ff;
  --map-4: #64b0ff;
  --map-5: #cfe3fb;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 14px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, p { margin: 0; }
h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.022em; line-height: 1.15; }
h2 { font-size: 17px; font-weight: 600; letter-spacing: -0.012em; }
a { color: var(--accent-ink); }
code { font: 12.5px var(--mono); }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Rahmen: Seitenmenü und Inhalt */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100dvh; }
.content { min-width: 0; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px 12px 12px;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
}
.brand { font-weight: 600; letter-spacing: -0.012em; font-size: 15px; display: flex; align-items: center; gap: 9px; }
.brand svg { width: 24px; height: 24px; flex: none; }
.sidebar .brand { padding: 0 10px; }
.nav { display: grid; gap: 18px; align-content: start; flex: 1; }
.nav-group { display: grid; gap: 2px; }
.nav-title { padding: 0 10px 4px; color: var(--muted); font-size: 12px; font-weight: 600; }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav a, .side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 34px;
  padding: 6px 10px;
  border-radius: 9px;
  font: inherit;
  font-weight: 400;
  color: var(--ink);
  background: transparent;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s;
}
.nav a .icon { color: var(--accent-ink); }
.nav a:hover, .side-link:hover { background: var(--surface-2); filter: none; }
.nav a[aria-current="page"] { font-weight: 600; background: var(--sidebar-on); }
.side-foot { display: grid; gap: 2px; padding-top: 10px; border-top: 1px solid var(--border); }
.side-user { padding: 0 10px 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-link { color: var(--ink-2); }
.side-link:active { transform: none; }
.mobilebar { display: none; }
.scrim { display: none; }
.menu-button { padding: 0; width: 38px; min-height: 38px; justify-content: center; background: transparent; color: var(--accent-ink); }
.menu-button .icon { width: 22px; height: 22px; }

main { max-width: 1280px; margin: 0 auto; padding: 32px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }

.banner {
  padding: 12px 16px;
  border-radius: 14px;
  margin-bottom: 20px;
  background: var(--warn-wash);
}
.banner.error { background: var(--critical-wash); }

/* Bedienelemente */
button, .button {
  font: inherit;
  font-weight: 500;
  padding: 6px 15px;
  min-height: 34px;
  border-radius: 980px;
  border: 0;
  background: var(--surface-2);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: filter 0.15s, background 0.15s, transform 0.1s;
}
button:hover, .button:hover { filter: brightness(0.96); }
button:active, .button:active { transform: scale(0.98); }
button:disabled { opacity: 0.45; cursor: default; filter: none; transform: none; }
button.primary { background: var(--on-accent); color: #fff; font-weight: 600; }
button.primary:hover { filter: brightness(1.08); }
button.danger { color: var(--critical-ink); }
button.danger-solid { background: var(--on-danger); color: #fff; font-weight: 600; }
button.danger-solid:hover { filter: brightness(1.08); }
button.ghost { background: transparent; color: var(--accent-ink); }
button.ghost:hover { background: var(--surface-2); filter: none; }

input[type="text"], input[type="search"], input[type="password"], input[type="number"], input[type="email"], select, textarea {
  font: inherit;
  color: var(--ink);
  background-color: var(--surface);
  border: 1px solid var(--control-border);
  border-radius: 10px;
  padding: 6px 11px;
  min-height: 36px;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}
select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5 6 7.5 9 4.5' fill='none' stroke='%238e8e93' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
}
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-wash);
}
input::placeholder, textarea::placeholder { color: var(--muted); }
textarea { resize: vertical; min-height: 64px; }

.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 20px; }
.filters select { width: auto; max-width: 260px; }
.filters input[type="search"] { width: 200px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { margin: 0; accent-color: var(--accent); flex: none; }
.check input[type="radio"] { width: 16px; height: 16px; }
/* Ein/Aus-Schalter. Lange Länderlisten behalten Häkchen, dort wäre ein Schalter nur Lärm. */
.check input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  width: 36px;
  height: 22px;
  border-radius: 11px;
  background: var(--axis);
  cursor: pointer;
  transition: background 0.18s;
}
.check input[type="checkbox"]::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.18s;
}
.check input[type="checkbox"]:checked { background: var(--good); }
.check input[type="checkbox"]:checked::before { transform: translateX(14px); }
.check input[type="checkbox"]:disabled { opacity: 0.45; cursor: default; }
.country-row input[type="checkbox"] { -webkit-appearance: auto; appearance: auto; width: 16px; height: 16px; background: none; border-radius: 4px; }
.country-row input[type="checkbox"]::before { content: none; }

.segmented { display: inline-flex; padding: 2px; gap: 2px; border-radius: 10px; background: var(--surface-2); }
.segmented button { background: transparent; border-radius: 8px; min-height: 30px; padding: 4px 13px; font-weight: 500; color: var(--ink-2); }
.segmented button:hover { filter: none; color: var(--ink); }
.segmented button[aria-pressed="true"] { background: var(--segment-on); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.14); }
/* Muss nach .segmented stehen: Drei gleich breite Felder über die ganze Breite des Menüs. */
.segmented.theme-switch { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; margin-bottom: 8px; background: var(--sidebar-on); }
.theme-switch button { width: 100%; padding: 3px 4px; min-height: 28px; justify-content: center; font-size: 12.5px; }

/* Karten */
.card { background: var(--surface); border-radius: 18px; padding: 20px; min-width: 0; box-shadow: var(--card-shadow); }
.card > h2 { margin-bottom: 14px; }
.grid-top { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); margin-top: 16px; }
.loading { opacity: 0.55; transition: opacity 0.15s; }

/* Sechs Kacheln: alle in einer Reihe oder zwei gleiche Reihen, nie eine einzelne übrig. */
.tiles { display: grid; gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 16px; }
@media (min-width: 1500px) { .tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.tile .label { color: var(--ink-2); font-size: 13px; font-weight: 500; }
a.tile-link { display: block; color: inherit; text-decoration: none; transition: box-shadow 0.18s, transform 0.18s; }
a.tile-link:hover { box-shadow: var(--card-shadow-hover); transform: translateY(-1px); }
.tile .value { font-size: 30px; font-weight: 600; letter-spacing: -0.024em; line-height: 1.2; margin-top: 4px; font-variant-numeric: tabular-nums; }
.tile .sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }

/* Download und Upload */
.data-parts { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 4px; }
.data-part .value { font-size: 24px; margin-top: 0; white-space: nowrap; }
.data-label { display: flex; align-items: center; gap: 3px; margin-top: 0; }
@media (min-width: 1500px) {
  .data-parts { flex-wrap: nowrap; gap: 10px; }
  .data-part .value { font-size: 17px; line-height: 1.6; }
}
.data-label .icon { width: 13px; height: 13px; stroke-width: 2.2; }
.traffic-card { margin-top: 16px; }
.traffic-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.traffic-fig { margin: 0; min-width: 0; }
.traffic-fig figcaption { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.traffic-title { font-weight: 600; }
.fill-traffic { fill: var(--accent); }

/* Diagramm */
.chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; color: var(--ink-2); font-size: 12.5px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; }
.chart text { fill: var(--axis-text); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.gridline { stroke: var(--grid); stroke-width: 1; }
.baseline { stroke: var(--axis); stroke-width: 1; }
.fill-s2xx, .swatch.s2xx, .key.s2xx { fill: var(--s2xx); background: var(--s2xx); }
.fill-s3xx, .swatch.s3xx, .key.s3xx { fill: var(--s3xx); background: var(--s3xx); }
.fill-s4xx, .swatch.s4xx, .key.s4xx { fill: var(--s4xx); background: var(--s4xx); }
.fill-s5xx, .swatch.s5xx, .key.s5xx { fill: var(--s5xx); background: var(--s5xx); }
.band { fill: transparent; }
.band.on { fill: var(--surface-2); }
.tooltip {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  background: var(--surface);
  box-shadow: var(--shadow);
  border-radius: 12px;
  padding: 9px 12px;
  font-size: 12.5px;
  min-width: 150px;
  z-index: 3;
}
.tooltip .when { color: var(--muted); margin-bottom: 4px; white-space: nowrap; }
.tooltip .row { display: flex; align-items: center; gap: 6px; }
.tooltip .row b { font-variant-numeric: tabular-nums; min-width: 44px; text-align: right; font-weight: 620; }
.tooltip .row span:last-child { color: var(--ink-2); }
.key { width: 10px; height: 2px; border-radius: 1px; flex: none; }
details.table-view { margin-top: 10px; }
details.table-view summary { cursor: pointer; color: var(--accent-ink); font-size: 13px; font-weight: 500; }
details.table-view .scroll { max-height: 260px; overflow: auto; margin-top: 8px; }

/* Top-Listen */
.top-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.top-row .line { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.top-row .name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: baseline; gap: 6px; }
.top-row .name { align-items: center; }
.top-row .name a, .top-row .name > span:not(.tag) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flag { width: 20px; height: 15px; flex: none; border-radius: 3px; object-fit: cover; outline: 1px solid var(--border); outline-offset: -1px; }
.with-flag { display: inline-flex; align-items: center; gap: 6px; }
.map-tip-name { display: flex; align-items: center; gap: 6px; color: var(--ink); }
.top-row .name a { color: var(--ink); text-decoration: none; }
.top-row .name a:hover { color: var(--accent-ink); text-decoration: underline; }
.top-row .count { font-variant-numeric: tabular-nums; color: var(--ink-2); flex: none; }
.top-row .track { height: 5px; margin-top: 4px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.top-row .bar { height: 5px; border-radius: 3px; background: var(--accent); min-width: 3px; }
.tag { font-size: 11px; font-weight: 500; color: var(--ink-2); background: var(--surface-2); border-radius: 980px; padding: 1px 7px; flex: none; }
.empty { color: var(--muted); padding: 8px 0; }
.empty-state { text-align: center; padding: 48px 16px; color: var(--ink-2); }
.empty-state h2 { font-size: 19px; margin-bottom: 6px; color: var(--ink); }
.empty-state p { max-width: 520px; margin: 0 auto 14px; }

/* Tabellen */
.table-wrap { overflow-x: auto; background: var(--surface); border-radius: 18px; box-shadow: var(--card-shadow); }
table { border-collapse: collapse; width: 100%; }
th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12.5px; white-space: nowrap; }
th, td { padding: 10px 14px; border-bottom: 1px solid var(--grid); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.mono { font: 12.5px var(--mono); }
td.nowrap { white-space: nowrap; }
.compact th, .compact td { padding: 7px 10px; font-size: 13px; }

.log-table th, .log-table td { padding-left: 8px; padding-right: 8px; }
.log-table td.path { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-table td.host { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-table td.client { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-table tr.entry { cursor: pointer; }
.log-table tr.entry:hover td { background: var(--surface-2); }
.log-table tr.fresh td { animation: fresh 1.4s ease-out; }
@keyframes fresh { from { background: var(--accent-wash); } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .log-table tr.fresh td { animation: none; } .loading { transition: none; } }
.detail td { background: var(--page); }
.detail dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 3px 14px; font-size: 13px; }
.detail dt { color: var(--muted); }
.detail dd { margin: 0; overflow-wrap: anywhere; }
.detail .actions { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }

.status { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; font-weight: 500; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--muted); }
.dot.s2xx { background: var(--s2xx); }
.dot.s3xx { background: var(--s3xx); }
.dot.s4xx { background: var(--s4xx); }
.dot.s5xx { background: var(--s5xx); }
.dot.good { background: var(--good); }
.dot.warn { background: var(--warn); }
.dot.bad { background: var(--critical); }
.dot.pulse { animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .dot.pulse { animation: none; } }

.log-foot { display: flex; justify-content: center; padding: 12px; }
.log-foot:has(> button[hidden]) { display: none; }
.live { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 13px; }

/* Hosts */
.host-domains { display: grid; gap: 2px; }
.host-domains a { font-weight: 600; text-decoration: none; color: var(--ink); overflow-wrap: anywhere; }
.host-domains a:hover { text-decoration: underline; }
.state { display: flex; align-items: center; gap: 6px; }
.state + .state { margin-top: 2px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }
tr.off td { color: var(--muted); }
tr.off .host-domains a { color: var(--muted); }

.switch { position: relative; display: inline-block; width: 36px; height: 22px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; width: 100%; height: 100%; }
.switch i { position: absolute; inset: 0; background: var(--axis); border-radius: 11px; pointer-events: none; transition: background 0.18s; }
.switch i::after { content: ""; position: absolute; width: 18px; height: 18px; left: 2px; top: 2px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: transform 0.18s; }
.switch input:checked + i { background: var(--good); }
.switch input:checked + i::after { transform: translateX(14px); }
.switch input:focus-visible + i { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Updates */
.updates-summary { display: grid; gap: 8px; margin-bottom: 16px; }
.summary-state strong { font-size: 19px; font-weight: 600; letter-spacing: -0.012em; }
.updates-card { margin-bottom: 16px; }
.updates-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); align-items: start; }
.policy-form { display: grid; gap: 12px; }
.scroll-x { overflow-x: auto; }
.versions .ver { font: 12px var(--mono); overflow-wrap: anywhere; }
.row-actions-cell { text-align: right; }
.vuln-list, .change-list { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 2px; max-height: 220px; overflow: auto; }
.run-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.run-list > li { display: grid; gap: 4px; padding-bottom: 10px; border-bottom: 1px solid var(--grid); }
.run-list > li:last-child { border-bottom: 0; padding-bottom: 0; }
.run-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
.run-log { font: 12px var(--mono); max-height: 240px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; background: var(--page); border-radius: 10px; padding: 10px 12px; margin: 8px 0 0; }

/* Sicherheit */
.security-intro { margin: -6px 0 12px; max-width: 80ch; }
.fw-state { display: grid; gap: 4px; margin-bottom: 14px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; min-height: 32px; align-items: center; margin-bottom: 12px; }
.country-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 2px 12px; max-height: 360px; overflow: auto; margin-top: 8px; padding: 4px 2px; border-top: 1px solid var(--grid); border-bottom: 1px solid var(--grid); }
.country-row { padding: 4px 2px; min-width: 0; }
.country-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.country-row .count { margin-left: auto; white-space: nowrap; }
.save-row { margin-top: 12px; align-items: center; }
.mode-row { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-bottom: 10px; }
.threshold-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 16px; margin-top: 10px; }
.guard-rules { margin-top: 14px; }
.ban-scroll { max-height: 420px; overflow: auto; margin-bottom: 12px; }
.ban-table td { vertical-align: middle; }
.ban-actions { display: flex; gap: 6px; justify-content: flex-end; }
.ban-detail { min-width: 220px; max-width: 420px; overflow-wrap: anywhere; }
.nowrap { white-space: nowrap; }
.ban-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.ban-form .field { flex: 1 1 240px; margin: 0; }
.ban-form select { width: auto; flex: 0 0 140px; }
.scan-result { margin-top: 14px; }
.scan-result h3 { margin: 0 0 8px; font-size: 15px; font-weight: 600; }

.kind-filter { flex-wrap: wrap; }
.access-users { display: grid; gap: 8px; }
.access-users:empty { display: none; }
.access-user { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; }
.access-table td { vertical-align: middle; overflow-wrap: anywhere; }
@media (max-width: 560px) { .access-user { grid-template-columns: minmax(0, 1fr); padding-bottom: 8px; border-bottom: 1px solid var(--grid); } .access-user button { justify-self: start; } }
.maint-tag { color: var(--ink); background: var(--warn-wash); }
.maint-button { padding: 0; width: 34px; justify-content: center; flex: none; align-self: center; }
.maint-button .icon { width: 18px; height: 18px; fill: currentColor; stroke: none; }
.maint-button.on { background: #ff9500; color: #1d1d1f; }
.dot.maint { background: var(--accent); }
.error-pages { display: grid; gap: 14px; }
.error-pages-intro { margin-bottom: 14px; max-width: 80ch; }
.ep-html { margin-top: 8px; }
.ep-note { align-self: center; }
.kind-tag { display: inline-block; margin-top: 4px; }
.target-line { max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.field-group { display: grid; gap: 12px; }
.status-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 2px 12px; max-height: 220px; overflow: auto; padding: 2px; }
.pem { font: 12px var(--mono); }
.bl-list { margin-top: 10px; }
.bl-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid var(--grid); }
.bl-text { min-width: 0; display: grid; gap: 2px; }
.bl-name { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; }
.bl-controls { display: flex; align-items: center; gap: 10px; flex: none; }
.bl-url { color: var(--muted); overflow-wrap: anywhere; }
.bl-warning { color: var(--ink-2); }
.bl-error { color: var(--critical-ink); }
.bl-add { margin: 14px 0 2px; padding-top: 14px; border-top: 1px solid var(--grid); font-size: 14px; font-weight: 600; }
.switch input:disabled { cursor: default; }
.switch input:disabled + i { opacity: 0.55; }
.acme-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px 12px; align-items: end; margin-top: 12px; }
.acme-actions { flex-wrap: wrap; }
.acme-table tr.has-path td { border-bottom: 0; padding-bottom: 2px; }
.acme-table .acme-path-row td { padding-top: 0; padding-bottom: 10px; }
.acme-path { display: block; color: var(--muted); user-select: all; overflow-wrap: anywhere; }
.acme-path-hint { margin-top: 10px; }
@media (max-width: 720px) {
  .acme-form { grid-template-columns: minmax(0, 1fr); }
  .acme-form button { justify-self: start; }
  /* Auf dem Handy untereinander, sonst lägen die Knöpfe außerhalb des Bildschirms. */
  .acme-table thead, .acme-table .acme-issuer { display: none; }
  .acme-table, .acme-table tbody, .acme-table tr, .acme-table td { display: block; }
  .acme-table tr { padding: 10px 0; border-bottom: 1px solid var(--grid); }
  .acme-table td { padding: 2px 0; border: 0; white-space: normal; }
  .acme-table .acme-actions { justify-content: flex-start; margin-top: 6px; }
  .acme-table tr.has-path { border-bottom: 0; padding-bottom: 0; }
  .acme-table tr.has-path td { padding-bottom: 2px; }
  .acme-table tr.acme-path-row { padding-top: 4px; }
  .acme-table .acme-path-row td { padding: 0; }
}
.cert-form { display: grid; gap: 12px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--grid); }
.cert-pair { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.cert-table td { vertical-align: middle; }
.cert-domains { overflow-wrap: anywhere; min-width: 160px; }
.stream-hint { margin: 10px 2px 0; }
.stream-recent { margin-top: 16px; }
.stream-table { min-width: 860px; }
.stream-table th, .stream-table td { padding-left: 10px; padding-right: 10px; }
.stream-table .row-actions { flex-direction: column; align-items: stretch; }
.stream-table .row-actions button { justify-content: center; }
.row-target { display: grid; grid-template-columns: minmax(0, 1fr) 110px; gap: 8px; }

/* Karte */
.geo-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 2.4fr) minmax(280px, 1fr); margin-top: 16px; align-items: start; }
.map-box { position: relative; width: 100%; aspect-ratio: 2.29; min-height: 120px; background: var(--page); border-radius: 12px; overflow: hidden; }
.map-box svg { display: block; width: 100%; height: 100%; }
.map-box path { stroke: var(--map-line); stroke-width: 0.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.map-box path[data-c]:hover { stroke: var(--ink); stroke-width: 1; }
.map-box path.m0 { fill: var(--map-none); }
.map-box path.m1, .swatch.map-s1 { fill: var(--map-1); background: var(--map-1); }
.map-box path.m2, .swatch.map-s2 { fill: var(--map-2); background: var(--map-2); }
.map-box path.m3, .swatch.map-s3 { fill: var(--map-3); background: var(--map-3); }
.map-box path.m4, .swatch.map-s4 { fill: var(--map-4); background: var(--map-4); }
.map-box path.m5, .swatch.map-s5 { fill: var(--map-5); background: var(--map-5); }
.map-box path.m1, .map-box path.m2, .map-box path.m3, .map-box path.m4, .map-box path.m5 { cursor: pointer; }
.map-legend { display: flex; align-items: center; gap: 2px; margin-top: 8px; color: var(--ink-2); font-size: 12.5px; }
.map-legend span:first-child { margin-right: 6px; }
.map-legend span:last-child { margin-left: 6px; }
.map-legend .swatch { width: 22px; border-radius: 3px; }
.map-off { margin-top: 6px; }
.map-off:empty { display: none; }
.chip { background: var(--accent-wash); color: var(--accent-ink); font-weight: 500; padding: 4px 12px; min-height: 30px; }

/* Verfügbarkeit */
.health-table td { vertical-align: middle; }
.health-table .host-domains a { white-space: nowrap; }
.health-table .target { overflow-wrap: anywhere; }
.status-cell { white-space: nowrap; }
.timeline-cell { width: 100%; min-width: 220px; }
.timeline { display: flex; gap: 2px; height: 22px; }
.timeline i { flex: 1 1 0; min-width: 1px; border-radius: 2px; background: var(--grid); }
.timeline i.ok, .swatch.t-ok { background: var(--good); }
.timeline i.partial, .swatch.t-partial { background: var(--warn); }
.timeline i.down, .swatch.t-down { background: var(--critical); }
.swatch.t-none { background: var(--grid); }
.timeline-legend { padding: 10px 12px; border-top: 1px solid var(--grid); }
.events { margin-top: 16px; }
.event-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.event-list li { display: grid; grid-template-columns: 124px 150px minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: baseline; }
.event-host { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Dialog und Formulare */
dialog {
  border: 0;
  border-radius: 20px;
  padding: 0;
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(0, 0, 0, 0.35); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.dialog-body { padding: 24px; display: grid; gap: 16px; }
.dialog-body h1 { font-size: 21px; font-weight: 700; letter-spacing: -0.018em; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 8px; padding-top: 4px; }
.field { display: grid; gap: 4px; }
.field > label:not(.check), .field > .field-label { font-weight: 500; font-size: 13px; }
.hint { color: var(--muted); font-size: 12.5px; }
.row-3 { display: grid; grid-template-columns: 96px 1fr 96px; gap: 8px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
fieldset { border: 0; border-radius: 14px; background: var(--page); padding: 14px; margin: 0; display: grid; gap: 12px; min-width: 0; }
legend { float: left; width: 100%; font-weight: 600; font-size: 13px; padding: 0; margin-bottom: 2px; }
legend + * { clear: both; }
.form-error { color: var(--critical-ink); background: var(--critical-wash); border-radius: 10px; padding: 9px 12px; }

.settings { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); align-items: start; }
.settings form { display: grid; gap: 12px; }
.facts { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; }
.facts dt { color: var(--ink-2); }
.facts dd { margin: 0; display: flex; align-items: center; gap: 6px; }
.ok-note { color: var(--ink-2); }

.notify-card { grid-column: 1 / -1; }
.notify-intro { margin: -6px 0 12px; }
.notify-channels { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); align-items: start; }
.steps { margin: 0; padding-left: 18px; color: var(--ink-2); display: grid; gap: 2px; }
.inline { display: flex; gap: 8px; }
.inline input { flex: 1; min-width: 0; }
.chat-choices { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.chat-choices:empty { display: none; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; }
.row-mail { display: grid; grid-template-columns: minmax(0, 1fr) 120px 84px; gap: 8px; }
.small.form-error { padding: 6px 8px; }

/* Anmeldung */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 16px; }
.login form { width: min(380px, 100%); display: grid; gap: 16px; background: var(--surface); border-radius: 22px; padding: 32px; box-shadow: var(--card-shadow-hover); }
.login .brand { flex-direction: column; gap: 12px; margin-bottom: 4px; }
.login .brand svg { width: 52px; height: 52px; }
.login button.primary { justify-content: center; min-height: 40px; }

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--page);
  border-radius: 980px;
  font-weight: 500;
  padding: 10px 18px;
  box-shadow: var(--shadow);
  z-index: 20;
  max-width: calc(100vw - 32px);
}

@media (prefers-reduced-motion: reduce) {
  .sidebar, .scrim { transition: none !important; }
  button, .button, a.tile-link, .nav a, .side-link, .switch i, .switch i::after, .check input[type="checkbox"], .check input[type="checkbox"]::before { transition: none; }
  button:active, .button:active, a.tile-link:hover { transform: none; }
}

/* Touch: ausreichend große Ziele, 16 px verhindert den Zoom von iOS beim Tippen ins Feld. */
@media (pointer: coarse) {
  button, .button { min-height: 44px; }
  .segmented button { min-height: 38px; }
  .theme-switch button { min-height: 38px; }
  .chip { min-height: 36px; }
  input[type="text"], input[type="search"], input[type="password"], input[type="number"], input[type="email"], select, textarea { min-height: 44px; font-size: 16px; }
}

@media (max-width: 1180px) {
  .geo-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Schmal: Das Seitenmenü wird eingeblendet. */
@media (max-width: 900px) {
  .shell { display: block; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 15;
    width: min(280px, 84vw);
    border-right: 0;
    box-shadow: var(--shadow);
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 0.25s ease, visibility 0s linear 0.25s;
  }
  .menu-open { overflow: hidden; }
  .menu-open .sidebar { transform: none; visibility: visible; transition: transform 0.25s ease; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 14; background: rgba(0, 0, 0, 0.35); opacity: 0; pointer-events: none; transition: opacity 0.25s ease; }
  .menu-open .scrim { opacity: 1; pointer-events: auto; }
  .mobilebar {
    display: flex;
    align-items: center;
    gap: 6px;
    position: sticky;
    top: 0;
    z-index: 5;
    min-height: 52px;
    padding: 6px 12px;
    background: var(--glass);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border);
  }
  main { padding: 24px; }
}

/* Neben dem Seitenmenü wird die Host-Tabelle eng: Aktionen untereinander, Domains am Stück. */
@media (max-width: 1320px) {
  .host-table th, .host-table td { padding-left: 10px; padding-right: 10px; }
  .host-table .row-actions { flex-direction: column; align-items: stretch; }
  .host-table .row-actions button { justify-content: center; }
  .host-domains a { white-space: nowrap; }
}

@media (max-width: 1180px) {
  /* Hosts als Karten, damit Status und Aktionen ohne Querscrollen sichtbar sind. */
  .host-table thead { display: none; }
  .host-table, .host-table tbody, .host-table tr, .host-table td { display: block; width: 100%; }
  .host-table tr { position: relative; padding: 14px; border-bottom: 1px solid var(--grid); }
  .host-table tr:last-child { border-bottom: 0; }
  .host-table td { border: 0; padding: 3px 0; }
  .host-table td.nowrap { white-space: normal; overflow-wrap: anywhere; }
  .host-table td:first-child { position: absolute; top: 14px; right: 14px; width: auto; padding: 0; }
  .host-domains { padding-right: 48px; }
  .host-domains a { white-space: normal; }
  .host-table .row-actions { flex-direction: row; align-items: center; justify-content: flex-start; margin-top: 6px; }
}

@media (max-width: 720px) {
  h1 { font-size: 24px; }
  main { padding: 16px; }
  .grid-top, .settings { grid-template-columns: minmax(0, 1fr); }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile .value { font-size: 24px; }
  .row-3 { grid-template-columns: 84px 1fr 84px; }
  .filters input[type="search"], .filters select { flex: 1 1 140px; width: auto; max-width: none; }
  .geo-grid { grid-template-columns: minmax(0, 1fr); }
  .updates-grid { grid-template-columns: minmax(0, 1fr); }
  .scroll-x .versions, .scroll-x .versions tbody { display: block; width: 100%; }
  .scroll-x .versions thead { display: none; }
  .scroll-x .versions tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 8px 0; border-bottom: 1px solid var(--grid); }
  .scroll-x .versions td { display: block; border: 0; padding: 0; font-size: 13px; }
  .scroll-x .versions td:nth-child(1) { font-weight: 550; }
  .scroll-x .versions td:nth-child(2)::before { content: "Installiert: "; font-family: var(--font); color: var(--muted); }
  .scroll-x .versions td:nth-child(3)::before { content: "Verfügbar: "; font-family: var(--font); color: var(--muted); }
  .scroll-x .versions td:nth-child(2), .scroll-x .versions td:nth-child(3) { grid-column: 1 / -1; }
  .scroll-x .versions td:nth-child(4) { grid-column: 1; }
  .scroll-x .versions .row-actions-cell { grid-column: 2; grid-row: 1; text-align: right; }
  .notify-channels { grid-template-columns: minmax(0, 1fr); }
  .row-mail { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .row-mail .field:first-child { grid-column: 1 / -1; }
  .health-table thead { display: none; }
  .health-table, .health-table tbody { display: block; width: 100%; }
  .health-table tr { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px 8px; padding: 12px; border-bottom: 1px solid var(--grid); }
  .health-table tr:last-child { border-bottom: 0; }
  .health-table td { display: block; border: 0; padding: 0; min-width: 0; width: auto; }
  .health-table td:nth-child(-n+3) { grid-column: 1 / -1; }
  .health-table .host-domains a { white-space: normal; }
  .health-table td.num { text-align: left; font-size: 13px; }
  .health-table td.num::before { content: attr(data-label); display: block; color: var(--muted); font-size: 11.5px; }
  .status-cell { white-space: normal; }
  .timeline i { min-width: 0; }
  .event-list li { grid-template-columns: minmax(0, 1fr); gap: 1px; padding-bottom: 8px; border-bottom: 1px solid var(--grid); }
  .event-list li:last-child { border-bottom: 0; padding-bottom: 0; }
}
