/* Verwaltung des EventServers: schlicht, hell und dunkel. */
:root {
  --bg: #f5f6f8; --card: #ffffff; --text: #1d2330; --muted: #6b7280; --line: #e3e6eb;
  --accent: #1f6feb; --accent-text: #ffffff; --ok: #1a7f37; --bad: #cf222e; --warn: #9a6700; --notice: #e8f1fe; --sel: #eef4ff;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151b; --card: #1b1f27; --text: #e6e8ec; --muted: #9aa3af; --line: #2b313c;
    --accent: #4c8dff; --accent-text: #0b0e13; --ok: #3fb950; --bad: #ff6b6b; --warn: #d29922; --notice: #1d2a40; --sel: #1f2a3d;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
.shell { max-width: 1200px; margin: 0 auto; padding: 0 24px 32px; }
/* Kopfleiste: dunkel, die Dienste als Reiter, rechts die Verwaltung. */
.topbar { background: #1d2330; color: #fff; }
.topbar-inner { max-width: 1200px; margin: 0 auto; padding: 0 24px; min-height: 60px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 18px; color: #fff; text-decoration: none; }
.tabs { display: flex; gap: 2px; flex-wrap: wrap; flex: 1 1 auto; }
.tabs a { padding: 6px 11px; border-radius: 999px; color: #d1d5db; text-decoration: none; font-size: 15px; }
.tabs a:hover { color: #fff; background: rgba(255,255,255,.08); }
.tabs a.active { background: #fff; color: #1d2330; font-weight: 600; }
.admin-nav { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.admin-nav a { color: #d1d5db; text-decoration: none; }
.admin-nav a.active, .admin-nav a:hover { color: #fff; }
.admin-nav form { margin: 0; }
.admin-nav button.link { color: #93c5fd; font-size: 14px; }
@media (prefers-color-scheme: dark) { .topbar { background: #0b0e13; border-bottom: 1px solid var(--line); } }
h1 { font-size: 24px; margin: 24px 0 8px; }
h2 { font-size: 17px; margin: 0 0 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; margin: 16px 0; overflow-x: auto; }
.card.narrow { max-width: 420px; }
.card.key { border-color: var(--accent); }
dl { display: grid; grid-template-columns: 160px 1fr; gap: 6px 16px; margin: 0 0 14px; }
dt { color: var(--muted); }
dd { margin: 0; word-break: break-word; }
label { display: block; margin: 10px 0; }
label input:not([type=checkbox]):not([type=radio]) { display: block; width: 100%; max-width: 480px; margin-top: 4px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--text); font: inherit; }
label.check { display: flex; gap: 8px; align-items: baseline; margin: 6px 0; }
fieldset { border: 1px solid var(--line); border-radius: 8px; margin: 12px 0; padding: 8px 14px; }
button { font: inherit; cursor: pointer; border-radius: 6px; padding: 7px 14px; border: 1px solid var(--line); background: var(--card); color: var(--text); }
button:disabled { opacity: .5; cursor: default; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
button.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
button.link { border: none; background: none; padding: 0 4px; color: var(--accent); }
button.danger-text { color: var(--bad); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
table { width: 100%; border-collapse: collapse; margin-bottom: 12px; }
th, td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr { cursor: default; }
tbody tr.selected { background: var(--sel); }
tbody tr.disabled td { color: var(--muted); }
.card table tbody tr:hover { background: var(--sel); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
code.secret { display: block; padding: 10px 12px; background: var(--bg); border-radius: 6px; user-select: all; word-break: break-all; }
ul.keys { padding-left: 18px; }
ul.keys li { margin: 6px 0; }
.muted { color: var(--muted); font-weight: normal; }
.hint { color: var(--muted); font-size: 13px; margin: 8px 0 0; }
.notice { background: var(--notice); padding: 10px 14px; border-radius: 8px; }
.error { color: var(--bad); }
.ok { color: var(--ok); }
.bad { color: var(--bad); }
.warn { color: var(--warn); }
/* Eigener Balken statt <progress>: Safari zeichnet <progress> in eigener Höhe und ohne Füllung in accent-color. */
.bar { width: 100%; max-width: 420px; height: 8px; margin: 8px 0 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--warn); border-radius: 4px; transition: width .4s; }
.confirm { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
table.log td { font-size: 13px; }
footer { color: var(--muted); font-size: 12px; margin-top: 32px; }

/* Seiten der Dienste (Entwurf B, 2026-11-11): Kopf, links Ausprobieren, rechts woher die Daten kommen. */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 28px 0 4px; }
.page-head h1 { margin: 0; font-size: 28px; }
.page-head .lead { margin: 4px 0 0; color: var(--muted); max-width: 680px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; padding: 5px 12px; border-radius: 999px; }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.pill.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.pill.bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); }
.split { display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-start; }
.split > .main { flex: 999 1 560px; min-width: 0; }
.split > .side { flex: 1 1 320px; min-width: 0; }
.split .card { margin: 16px 0 0; }
.try label.big { font-weight: 600; margin: 0; }
.try .inputs { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.try .inputs input, .try .inputs select { font: inherit; font-weight: 400; padding: 10px 14px; min-height: 46px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--text); }
.try .inputs input { flex: 1 1 260px; font-size: 18px; border: 2px solid var(--accent); }
.try .inputs input.small { flex: 1 1 200px; font-size: 16px; border: 1px solid var(--line); }
.try .inputs select { flex: 0 1 180px; }
.try .inputs button { min-height: 46px; padding: 10px 20px; border-radius: 10px; }
select { font: inherit; font-size: 15px; min-height: 40px; padding: 8px 12px; color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.choice { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 14px; color: var(--muted); }
.choice select { flex: 0 1 420px; max-width: 100%; min-height: 40px; padding: 8px 12px; font: inherit; font-size: 15px; color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.try .examples { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 12px 0 0; font-size: 13px; color: var(--muted); }
.try .examples button { font-size: 13px; padding: 3px 12px; border-radius: 999px; background: var(--bg); }
.try .examples button.on { background: var(--accent, #1f6feb); color: #fff; }
.try .examples:first-child { margin-top: 0; }
.mapview { height: 520px; margin-top: 12px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line, #e3e6ea); }
.try .summary { font-weight: 600; color: var(--muted); font-size: 14px; margin: 14px 0 8px; }
.hits { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.hits.list { grid-template-columns: 1fr; }
.hit { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; }
.hit .top { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.hit .code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 19px; font-weight: 700; }
.hit .name { font-size: 17px; font-weight: 600; }
.hit .tag { margin-left: auto; font-size: 12px; font-weight: 600; padding: 2px 7px; border-radius: 4px; background: var(--bg); color: var(--muted); }
.hit .sub { font-size: 14px; color: var(--muted); }
.hit .coord { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.empty { padding: 16px; border: 1px dashed var(--line); border-radius: 10px; color: var(--muted); }
.answer { padding: 12px 16px; background: var(--bg); border-radius: 10px; }
.answer .big { font-size: 22px; font-weight: 700; }
.foot { font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; margin-top: 16px; }
/* „Woher die Daten kommen“: nummerierte Schritte mit Linie dazwischen. */
ol.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; }
ol.steps > li { counter-increment: step; position: relative; padding: 0 0 18px 44px; display: flex; flex-direction: column; gap: 3px; }
ol.steps > li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; background: var(--sel); color: var(--accent); font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center; }
ol.steps > li:not(:last-child)::after { content: ""; position: absolute; left: 13px; top: 32px; bottom: 4px; width: 2px; background: var(--line); }
ol.steps > li > span { font-size: 14px; color: var(--muted); }
ol.steps > li > button { align-self: flex-start; margin-top: 6px; }
.small { font-size: 12px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0; }
.chip { font-size: 13px; padding: 3px 10px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); }
.chip.active { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: color-mix(in srgb, var(--ok) 10%, transparent); }
/* Übersicht: eine Kachel je Dienst. */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-top: 20px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px; display: flex; flex-direction: column; gap: 8px; color: var(--text); text-decoration: none; }
.tile:hover { border-color: var(--accent); }
.tile.busy { border-color: color-mix(in srgb, var(--warn) 50%, transparent); }
.tile .head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tile .title { font-weight: 700; font-size: 18px; }
.tile .what { color: var(--muted); font-size: 14px; }
.tile .figure { font-size: 26px; font-weight: 700; }
.tile .meta { font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 10px; }
.tile .bar { margin: 0; }
.row input.filter { margin-left: auto; padding: 6px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--text); font: inherit; min-width: 180px; }
/* Eingabefeld mit ✕ zum Löschen als ein Feld (Input-Group): das ✕ leert Eingabe und Treffer. */
.try .inputs .group { display: flex; flex: 1 1 260px; min-width: 0; }
.try .inputs .group input { flex: 1 1 auto; min-width: 0; border-right: none; border-radius: 10px 0 0 10px; }
.try .inputs .group button.clear { flex: none; min-height: 46px; padding: 0 14px; border: 2px solid var(--accent); border-left: none; border-radius: 0 10px 10px 0; background: var(--card); color: var(--muted); display: flex; align-items: center; }
.try .inputs .group button.clear:hover { color: var(--text); }
.try .inputs .group.small { flex: 1 1 200px; }
.try .inputs .group.small input { font-size: 16px; border: 1px solid var(--line); border-right: none; }
.try .inputs .group.small button.clear { border: 1px solid var(--line); border-left: none; }
.page-head .title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-head .via { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--accent); background: var(--sel); padding: 4px 12px; border: 1px solid transparent; border-radius: 999px; cursor: pointer; }
.page-head .via:hover { border-color: var(--accent); }
/* Dialog hinter dem Schild. */
dialog.info { font-size: 15px; font-weight: 400; line-height: 1.5; width: min(600px, calc(100% - 32px)); max-height: calc(100% - 48px); border: none; border-radius: 14px; padding: 24px 28px; background: var(--card); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog.info::backdrop { background: rgba(15, 20, 30, .45); }
dialog.info h2 { font-size: 22px; margin: 0 32px 10px 0; }
dialog.info h3 { font-size: 15px; margin: 18px 0 4px; }
dialog.info p { margin: 6px 0; line-height: 1.55; }
dialog.info .close-form { position: absolute; top: 14px; right: 14px; margin: 0; }
dialog.info .close { border: none; background: none; font-size: 18px; color: var(--muted); padding: 6px 10px; }
dialog.info .close:hover { color: var(--text); }
.flow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.flow span { font-size: 13px; font-weight: 600; padding: 5px 12px; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); }
.flow i { font-style: normal; color: var(--muted); }
.aside { margin: 10px 0 0; padding: 10px 14px; border-radius: 10px; background: var(--sel); font-size: 14px; max-width: 900px; }
tbody tr.clickable { cursor: pointer; }
dialog.info.app { width: min(760px, calc(100% - 32px)); }
dialog.info.app h3 { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 22px; }
dialog.info.app h3:first-of-type { border-top: none; padding-top: 0; margin-top: 8px; }
dialog.info.app .newkey { border: 1px solid var(--accent); border-radius: 10px; padding: 4px 16px 12px; margin: 10px 0; }
dialog.info.app .newkey h3 { border-top: none; padding-top: 0; margin-top: 10px; }
dialog.info fieldset { min-width: 0; }
dialog.info fieldset .muted { overflow-wrap: anywhere; font-size: 13px; }
dialog.info label input:not([type=checkbox]):not([type=radio]) { max-width: none; }
dialog.info label input[type=number] { max-width: 160px; }

/* Seite Länder */
img.flag { display: block; height: 18px; width: auto; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.08); }
img.flag.square { width: 18px; }
img.flag.round { width: 18px; border-radius: 50%; box-shadow: none; }
img.flag.big { height: 72px; }
img.flag.big.square, img.flag.big.round { width: 72px; }
table.countries td { padding-top: 6px; padding-bottom: 6px; cursor: pointer; }
table.countries tr.sel { background: var(--sel); }
.flags { display: flex; gap: 16px; align-items: flex-end; margin: 8px 0 12px; }
.flags figure { margin: 0; text-align: center; font-size: 12px; color: var(--muted); }
.flags figcaption { margin-top: 6px; }
ul.parts { list-style: none; padding: 0; margin: 0; max-height: 520px; overflow-y: auto; font-size: 14px; }
ul.parts li { padding: 3px 0; border-bottom: 1px solid var(--line); }

/* ---- EventServer: Ablauf, Quellen, Kategorien ------------------------------------------------ */
.pipeline { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.pipeline li { position: relative; border: 1px solid var(--line, #e3e6ea); border-radius: 10px; padding: 12px 12px 10px; background: var(--card, #fff); display: flex; flex-direction: column; gap: 4px; }
.pipeline li.end { border-style: dashed; }
.pipeline .num { font-size: 12px; font-weight: 600; color: var(--muted, #6b7280); }
.pipeline b { font-size: 15px; }
.pipeline .what { font-size: 13px; line-height: 1.35; }
.pipeline .who { margin-top: auto; padding-top: 6px; font-size: 12px; color: var(--accent, #2563eb); font-weight: 600; }
.sources { display: flex; flex-direction: column; gap: 8px; }
.source { border: 1px solid var(--line, #e3e6ea); border-radius: 10px; background: var(--card, #fff); }
.source > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: minmax(180px, 1.2fr) 2.4fr minmax(170px, 1fr); gap: 14px; padding: 12px 14px; align-items: start; }
.source > summary::-webkit-details-marker { display: none; }
.source.planned { opacity: .6; }
.source .name b { display: block; font-size: 15px; }
.source .name span, .source .state span { display: block; font-size: 12px; color: var(--muted, #6b7280); }
.source .purpose { font-size: 13px; line-height: 1.4; }
.source .purpose .chips { margin-top: 6px; }
.source .body { border-top: 1px solid var(--line, #e3e6ea); padding: 12px 14px 14px; display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; }
.source dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; font-size: 13px; }
.source dt { color: var(--muted, #6b7280); }
.source dd { margin: 0; }
.kind-head { margin: 18px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted, #6b7280); }
.tree { list-style: none; margin: 0; padding-left: 0; }
.tree ul { list-style: none; margin: 4px 0 8px 18px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tree > li { padding: 8px 0; border-bottom: 1px solid var(--line, #e3e6ea); }
.tree code { font-size: 12px; color: var(--muted, #6b7280); }
@media (max-width: 800px) {
    .source > summary, .source .body { grid-template-columns: 1fr; }
}
