/* Masterbot – Oberfläche im Stil eines Leitstands.
   Farbe steht nur für Zustände, nach IEC 60073 (Leuchtmelder):
   Rot = Eingriff/Gefahr · Gelb = Achtung · Grün = normal · Blau = Handlung nötig · Weiß = Hinweis.
   Schrift: Barlow (SIL OFL), lokal eingebunden – es werden keine Schriften von Dritten nachgeladen. */

@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url("../fonts/barlow-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-display: swap; src: url("../fonts/barlow-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url("../fonts/barlow-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-weight: 500; font-display: swap; src: url("../fonts/barlow-semi-condensed-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow Semi Condensed"; font-weight: 600; font-display: swap; src: url("../fonts/barlow-semi-condensed-latin-600-normal.woff2") format("woff2"); }

:root {
  color-scheme: light;
  --panel: #d9dcd8;        /* Lichtgrau: die Schrankfront */
  --paper: #f6f7f4;        /* Einlegeschild: Flächen mit Inhalt */
  --paper-2: #eceeea;
  --ink: #1f2427;          /* Anthrazit */
  --ink-2: #4a5257;
  --ink-3: #697176;
  --rule: #c6cac5;
  --rail: #2e3437;
  --rail-ink: #f2f4f0;
  --rail-dim: #b4bbb6;
  --plate: #2e3437;
  --plate-ink: #f2f4f0;
  --blue: #1d5faf;
  --blue-fill: #1d5faf;
  --red: #b0162a;
  --red-fill: #b8162b;
  --green: #1a7447;
  --green-fill: #1e7f4f;
  --yellow: #7d5200;
  --yellow-fill: #f2a900;
  --lamp-off: #c9cdc8;
  --lamp-off-ink: #5b6367;
  --on-fill: #ffffff;
  --on-yellow: #1f2427;
  /* Diagramme: geprüfte Reihenfolge (Farbfehlsichtigkeit), Blau-Stufen für Rangfolgen und Dichte */
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #6250d6; --series-5: #e87ba4;
  --series-rest: #9aa09c;
  --ord-1: #6da7ec; --ord-2: #256abf; --ord-3: #0d366b;
  --heat-1: #cde2fb; --heat-2: #9ec5f4; --heat-3: #6da7ec; --heat-4: #3987e5; --heat-5: #256abf; --heat-6: #104281;
  --grid: #dfe2dd;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --panel: #15181a; --paper: #23282b; --paper-2: #2b3135; --ink: #e9ebe7; --ink-2: #bac0bc; --ink-3: #8f9894;
    --rule: #3b4348; --rail: #0f1113; --rail-ink: #e9ebe7; --rail-dim: #8f9894; --plate: #3c444a; --plate-ink: #f2f4f0;
    --blue: #86b6ff; --blue-fill: #2f6fc4; --red: #ff7b84; --red-fill: #c92a3c; --green: #58d39a; --green-fill: #23895a;
    --yellow: #ffc533; --yellow-fill: #f2a900; --lamp-off: #30373b; --lamp-off-ink: #8f9894;
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #9085e9; --series-5: #d55181;
    --series-rest: #6f7773;
    --ord-1: #1c5cab; --ord-2: #3987e5; --ord-3: #9ec5f4;
    --heat-1: #0d366b; --heat-2: #184f95; --heat-3: #256abf; --heat-4: #3987e5; --heat-5: #6da7ec; --heat-6: #b7d3f6;
    --grid: #333a3e;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --panel: #15181a; --paper: #23282b; --paper-2: #2b3135; --ink: #e9ebe7; --ink-2: #bac0bc; --ink-3: #8f9894;
  --rule: #3b4348; --rail: #0f1113; --rail-ink: #e9ebe7; --rail-dim: #8f9894; --plate: #3c444a; --plate-ink: #f2f4f0;
  --blue: #86b6ff; --blue-fill: #2f6fc4; --red: #ff7b84; --red-fill: #c92a3c; --green: #58d39a; --green-fill: #23895a;
  --yellow: #ffc533; --yellow-fill: #f2a900; --lamp-off: #30373b; --lamp-off-ink: #8f9894;
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #9085e9; --series-5: #d55181;
  --series-rest: #6f7773;
  --ord-1: #1c5cab; --ord-2: #3987e5; --ord-3: #9ec5f4;
  --heat-1: #0d366b; --heat-2: #184f95; --heat-3: #256abf; --heat-4: #3987e5; --heat-5: #6da7ec; --heat-6: #b7d3f6;
  --grid: #333a3e;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--panel); color: var(--ink);
  font: 400 16px/1.5 "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
}
a { color: var(--blue); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3 { font-family: "Barlow Semi Condensed", "Barlow", sans-serif; font-weight: 600; margin: 0; }
h1 { font-size: 30px; line-height: 1.15; letter-spacing: -0.005em; }
h3 { font-size: 18px; line-height: 1.3; margin: 24px 0 8px; }
p { margin: 0 0 12px; max-width: 76ch; }
small, .small { font-size: 13.5px; }
.muted { color: var(--ink-2); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.hidden { display: none !important; }

/* ---------- Gerüst: Schiene links, Meldetableau oben, Inhalt als Einlegeschild */
.shell { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: 100vh; }
.rail {
  background: var(--rail); color: var(--rail-ink); position: sticky; top: 0; align-self: start;
  height: 100vh; overflow-y: auto; padding: 18px 0 24px;
}
.brand { display: block; padding: 0 20px 14px; color: var(--rail-ink); text-decoration: none;
  font: 600 24px/1 "Barlow Semi Condensed", sans-serif; letter-spacing: 0.01em; }
.rail select { margin: 0 20px 6px; width: calc(100% - 40px); background: transparent; color: var(--rail-ink);
  border: 1px solid var(--rail-dim); }
.rail select option { color: #1f2427; background: #fff; }
.rail .group { font: 500 13px/1 "Barlow Semi Condensed", sans-serif; color: var(--rail-dim);
  padding: 20px 20px 6px; }
.rail a.item { display: block; padding: 7px 20px; color: var(--rail-ink); text-decoration: none;
  font: 500 16px/1.25 "Barlow Semi Condensed", sans-serif; border-left: 4px solid transparent; }
.rail a.item:hover { background: rgba(255, 255, 255, 0.08); }
.rail a.item[aria-current="page"] { border-left-color: var(--rail-ink); background: rgba(255, 255, 255, 0.12);
  font-weight: 600; }
.rail .foot { padding: 24px 20px 0; font-size: 13.5px; color: var(--rail-dim); }
.rail .foot a, .rail .foot button { color: var(--rail-ink); }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--blue); text-decoration: underline;
  text-underline-offset: 2px; cursor: pointer; }

.main { min-width: 0; padding: 0 28px 56px; }
.tableau { display: flex; flex-wrap: wrap; gap: 6px; padding: 14px 0 12px; align-items: center; }
.tableau .who { font: 600 17px/1 "Barlow Semi Condensed", sans-serif; margin-right: 10px; }
.win {
  font: 600 13.5px/1 "Barlow Semi Condensed", sans-serif; letter-spacing: 0.015em; white-space: nowrap;
  padding: 7px 10px 7px; border-radius: 3px; border: 1px solid transparent; cursor: default;
}
.win.off { background: var(--lamp-off); color: var(--lamp-off-ink); }
.win.green { background: var(--green-fill); color: var(--on-fill); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28); }
.win.red { background: var(--red-fill); color: var(--on-fill); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28); }
.win.blue { background: var(--blue-fill); color: var(--on-fill); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28); }
.win.yellow { background: var(--yellow-fill); color: var(--on-yellow); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4); }
.win.white { background: #ffffff; color: #1f2427; border-color: var(--rule); }

.page { background: var(--paper); border: 1px solid var(--rule); border-radius: 4px; padding: 26px 30px 36px;
  max-width: 1240px; overflow-x: auto; }
.page.narrow { max-width: 760px; }
.head { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-end; justify-content: space-between;
  margin-bottom: 8px; }
.lede { color: var(--ink-2); max-width: 72ch; margin: 6px 0 20px; }
.plate {
  display: inline-block; background: var(--plate); color: var(--plate-ink); border-radius: 2px;
  font: 600 15px/1 "Barlow Semi Condensed", sans-serif; letter-spacing: 0.02em; padding: 7px 11px; margin: 34px 0 14px;
}
.plate:first-child { margin-top: 0; }
section { scroll-margin-top: 12px; margin-top: 34px; }
.page > section:first-child { margin-top: 0; }

/* ---------- Meldungen */
.flash { background: var(--paper); border: 1px solid var(--rule); border-left: 6px solid var(--blue-fill);
  padding: 10px 14px; margin: 0 0 14px; max-width: 1240px; border-radius: 0 3px 3px 0; overflow-wrap: anywhere; }
.flash.ok { border-left-color: var(--green-fill); }
.flash.error { border-left-color: var(--red-fill); }
.note { background: var(--paper-2); border-left: 6px solid var(--yellow-fill); padding: 10px 14px; margin: 0 0 18px;
  max-width: 80ch; }
.note.blue { border-left-color: var(--blue-fill); }
.note.red { border-left-color: var(--red-fill); }
.note p:last-child { margin-bottom: 0; }
.empty { color: var(--ink-2); padding: 18px 0; max-width: 64ch; }
.testbar { background: var(--yellow-fill); color: var(--on-yellow); font: 600 14px/1.3 "Barlow Semi Condensed", sans-serif;
  padding: 6px 28px; }

/* ---------- Schaltflächen */
.btn {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; text-decoration: none;
  font: 600 15px/1 "Barlow Semi Condensed", sans-serif; letter-spacing: 0.01em; padding: 10px 15px;
  border-radius: 3px; border: 1px solid var(--blue-fill); background: var(--blue-fill); color: #ffffff;
}
.btn:hover { filter: brightness(1.1); }
.btn.quiet { background: transparent; color: var(--ink); border-color: var(--ink-3); }
.btn.quiet:hover { background: var(--paper-2); filter: none; }
.btn.danger { background: var(--red-fill); border-color: var(--red-fill); }
.btn.small { padding: 6px 9px; font-size: 13.5px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline { display: inline; }

/* ---------- Formulare */
label, .label { display: block; font: 600 14.5px/1.3 "Barlow Semi Condensed", sans-serif; margin-bottom: 4px; }
input[type="text"], input[type="number"], input[type="url"], input[type="search"], input[type="password"],
input[type="datetime-local"], input[type="date"], input[type="file"], select, textarea {
  width: 100%; font: 400 15px/1.4 "Barlow", system-ui, sans-serif; color: var(--ink); background: var(--paper);
  border: 1px solid var(--ink-3); border-radius: 3px; padding: 8px 10px;
}
textarea { min-height: 88px; resize: vertical; }
textarea.code, input.code { font: 14px/1.45 ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace; }
input[type="number"] { font-variant-numeric: tabular-nums; }
.field { margin-bottom: 16px; min-width: 0; }
.help { font-size: 13.5px; line-height: 1.4; color: var(--ink-2); margin-top: 4px; max-width: 70ch; }
.row { display: grid; gap: 0 18px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.row.tight { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.check { display: flex; gap: 9px; align-items: flex-start; font: 400 15px/1.4 "Barlow", sans-serif; margin-bottom: 8px; }
.check input { flex: none; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--blue-fill); }
.check .help { display: block; margin-top: 1px; }
fieldset { border: 1px solid var(--rule); border-radius: 3px; padding: 14px 16px 6px; margin: 0 0 16px; min-width: 0; }
legend { font: 600 15px/1 "Barlow Semi Condensed", sans-serif; padding: 0 6px; }
.formbox { max-width: 780px; }
/* Auswahl der Funktionen beim Verbinden eines Kanals: jede Zeile mit Erklärung und dem Recht bei Twitch */
.features .check { padding: 9px 0; margin: 0; border-bottom: 1px solid var(--rule); }
.features .check:last-of-type { border-bottom: 0; }
.features .help.small { color: var(--muted); }
.features .tag { margin-left: 4px; vertical-align: 1px; }
/* Zwei gleichwertige Wege nebeneinander (Streamer / Moderator); auf schmalen Bildschirmen untereinander */
.duo { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 6px 30px; margin: 22px 0 8px; }
.duo h2, .duo h3 { margin-top: 0; }
/* Ablauf in Schritten: Die Reihenfolge ist hier Inhalt, deshalb eine nummerierte Liste */
.steps { padding-left: 22px; margin: 0 0 22px; max-width: 70ch; }
.steps li { padding: 3px 0 3px 4px; }
.split { display: grid; gap: 28px 36px; grid-template-columns: minmax(0, 1fr) minmax(280px, 380px); align-items: start; }
.pair { display: flex; gap: 8px; }
.pair > :first-child { flex: 1 1 60%; }
.pair > :last-child { flex: 1 1 40%; }

/* ---------- Tabellen */
.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th { text-align: left; font: 600 13.5px/1.25 "Barlow Semi Condensed", sans-serif; color: var(--ink-2);
  padding: 8px 10px; border-bottom: 2px solid var(--ink); white-space: nowrap; vertical-align: bottom; }
td { padding: 9px 10px; border-bottom: 1px solid var(--rule); vertical-align: top; overflow-wrap: break-word; }
tbody tr:hover td { background: var(--paper-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.tools { white-space: nowrap; text-align: right; }
tfoot td { font-weight: 600; border-top: 2px solid var(--ink); border-bottom: 0; }
tr.off td { color: var(--ink-3); }
code, .mono { font: 14px/1.4 ui-monospace, "Cascadia Mono", Menlo, Consolas, monospace; background: var(--paper-2);
  padding: 1px 5px; border-radius: 2px; overflow-wrap: anywhere; }
.tag { display: inline-block; font: 600 12.5px/1 "Barlow Semi Condensed", sans-serif; padding: 4px 6px; border-radius: 2px;
  border: 1px solid var(--ink-3); color: var(--ink-2); white-space: nowrap; }
.tag.red { border-color: var(--red); color: var(--red); }
.tag.green { border-color: var(--green); color: var(--green); }
.tag.yellow { border-color: var(--yellow); color: var(--yellow); }
.tag.blue { border-color: var(--blue); color: var(--blue); }
.lamp { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--lamp-off);
  margin-right: 7px; flex: none; }
.lamp.green { background: var(--green-fill); } .lamp.red { background: var(--red-fill); }
.lamp.yellow { background: var(--yellow-fill); } .lamp.blue { background: var(--blue-fill); }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: grid; grid-template-columns: 18px minmax(0, 1fr); padding: 7px 0; border-bottom: 1px solid var(--rule);
  align-items: baseline; }
.checklist .help { grid-column: 2; }

/* ---------- Reiter und Zählwerk */
.tabs { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 2px solid var(--ink); margin: 18px 0 22px; }
.tabs a { font: 600 15px/1 "Barlow Semi Condensed", sans-serif; color: var(--ink-2); text-decoration: none;
  padding: 10px 13px; border-radius: 3px 3px 0 0; }
.tabs a:hover { background: var(--paper-2); }
.tabs a[aria-current="page"] { background: var(--ink); color: var(--paper); }
.counts { display: flex; flex-wrap: wrap; gap: 0 40px; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--rule);
  padding: 14px 0 12px; margin-bottom: 8px; }
.count b { display: block; font: 600 36px/1.05 "Barlow Semi Condensed", sans-serif; font-variant-numeric: tabular-nums; }
.count span { font-size: 14px; color: var(--ink-2); }
.filters { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; margin: 0 0 18px; }
.filters .field { margin: 0; }
.filters input[type="date"], .filters select { width: auto; }
.quick { display: flex; gap: 4px; flex-wrap: wrap; }

/* ---------- Diagramme */
.chart { position: relative; height: 300px; margin: 6px 0 4px; }
.chart.low { height: 210px; }
figure { margin: 0 0 22px; }
figcaption { font: 600 16px/1.3 "Barlow Semi Condensed", sans-serif; margin-bottom: 2px; }
figcaption small { display: block; font: 400 13.5px/1.4 "Barlow", sans-serif; color: var(--ink-2); }
.heat { width: auto; border-collapse: separate; border-spacing: 2px; font-size: 13px; }
.heat th { border: 0; padding: 2px 6px 2px 0; font-weight: 500; }
.heat thead th { text-align: center; padding: 0 0 2px; min-width: 24px; }
.heat td { width: 24px; height: 22px; padding: 0; border: 0; border-radius: 2px; background: var(--paper-2); }
.heat tbody tr:hover td { filter: none; }
.heat td:hover { outline: 2px solid var(--ink); outline-offset: 0; }
.h1 { background: var(--heat-1) !important; } .h2 { background: var(--heat-2) !important; }
.h3 { background: var(--heat-3) !important; } .h4 { background: var(--heat-4) !important; }
.h5 { background: var(--heat-5) !important; } .h6 { background: var(--heat-6) !important; }
.scale { display: inline-flex; align-items: center; gap: 3px; font-size: 13px; color: var(--ink-2); margin-top: 8px; }
.scale i { display: inline-block; width: 22px; height: 12px; border-radius: 2px; }
.bar { display: inline-block; height: 8px; border-radius: 0 4px 4px 0; background: var(--series-1); vertical-align: middle;
  margin-right: 8px; min-width: 2px; }

/* ---------- Mod-Feed */
.feedbar { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-bottom: 12px; }
.feed { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.feed li { display: grid; grid-template-columns: 48px 12px minmax(0, 1fr) auto; gap: 4px 10px; align-items: baseline;
  padding: 7px 0; border-bottom: 1px solid var(--rule); font-size: 15px; }
.feed time { color: var(--ink-3); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.feed .lamp { margin: 0; align-self: center; }
.feed .what { overflow-wrap: anywhere; }
.feed .who { font-weight: 600; }
.feed li.chat .what { color: var(--ink-2); }
.feed .tools { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.toast { position: fixed; right: 20px; bottom: 20px; max-width: 420px; background: var(--ink); color: var(--paper);
  padding: 10px 14px; border-radius: 3px; font-size: 15px; z-index: 20; }
.toast.error { background: var(--red-fill); color: #fff; }
dl.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 18px; margin: 0 0 18px; }
dl.facts dt { color: var(--ink-2); }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }
pre.report { background: var(--paper-2); padding: 12px 14px; border-radius: 3px; white-space: pre-wrap;
  font: 14px/1.5 ui-monospace, Menlo, Consolas, monospace; max-width: 80ch; margin: 0 0 14px; }
details > summary { cursor: pointer; font: 600 15px/1.4 "Barlow Semi Condensed", sans-serif; }
details { margin-bottom: 12px; }

/* ---------- Seiten ohne Kanal (Anmeldung, Hinweise) */
.solo { max-width: 620px; margin: 9vh auto 40px; padding: 0 20px; }
.solo .brandline { font: 600 26px/1 "Barlow Semi Condensed", sans-serif; margin-bottom: 14px; }
.public { max-width: 900px; margin: 32px auto; padding: 0 20px; }

@media (max-width: 920px) {
  .shell { display: block; }
  .rail { position: static; height: auto; padding: 10px 0; display: flex; align-items: center; overflow-x: auto;
    white-space: nowrap; }
  .rail .group, .rail .foot { display: none; }
  .brand { padding: 0 14px; font-size: 20px; }
  .rail select { width: auto; margin: 0 8px 0 0; }
  .rail a.item { border-left: 0; border-bottom: 3px solid transparent; padding: 8px 10px; }
  .rail a.item[aria-current="page"] { border-bottom-color: var(--rail-ink); }
  .main { padding: 0 12px 40px; }
  .page { padding: 18px 16px 26px; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .feed li { grid-template-columns: 44px 12px minmax(0, 1fr); }
  .feed .tools { grid-column: 3; justify-content: flex-start; }
  h1 { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
@media print {
  .rail, .tableau, .btn, .tabs, .filters { display: none !important; }
  .shell { display: block; } body { background: #fff; } .page { border: 0; padding: 0; }
}
