/* projector, Website (Arc 11). Farben: RAL-Verkehrsfarben (Verkehrsblau 5017, Signalgelb 1003,
   Verkehrsgrün 6024, Verkehrsrot 3020) auf kühlem Grau; Leitmotiv ist die Linie mit vier Haltestellen. */

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

:root {
  color-scheme: light;
  --bg: #eef1f3;
  --surface: #ffffff;
  --ink: #22313f;
  --ink-2: #566472;
  --rule: #cdd5dc;
  --line: #005387;
  --line-soft: #d6e4ef;
  --here: #f9a800;
  --good: #008351;
  --warn: #9a6400;
  --warn-mark: #f9a800;
  --bad: #c1121c;
  --focus: #f9a800;
  --display: "Barlow Semi Condensed", "Avenir Next Condensed", "Arial Narrow", sans-serif;
  --text: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #141b21;
    --surface: #1b242c;
    --ink: #e4e9ed;
    --ink-2: #9aa6b1;
    --rule: #33414d;
    --line: #5aa2dc;
    --line-soft: #233646;
    --here: #f9a800;
    --good: #2fb37a;
    --warn: #f0b429;
    --warn-mark: #f0b429;
    --bad: #f0565c;
  }
}

* { box-sizing: border-box; }
html { font-size: 100%; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 1rem/1.5 var(--text);
  font-variant-numeric: tabular-nums;
}
a { color: var(--line); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
code, .mono { font-family: var(--mono); font-size: 0.875em; }
code { background: var(--line-soft); padding: 0 0.25em; border-radius: 3px; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.15; margin: 0; letter-spacing: 0.005em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.375rem; }
h3 { font-size: 1.125rem; }
p { margin: 0.5rem 0; max-width: 75ch; }
.quiet { color: var(--ink-2); }
.small { font-size: 0.875rem; }
.num { font-family: var(--display); font-weight: 600; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------------------------------------------------------------- Kopf */

.top {
  background: var(--line);
  color: #fff;
}
.top-inner {
  max-width: 1200px; margin: 0 auto; padding: 0.5rem 1.25rem;
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1.5rem;
}
.wordmark {
  font-family: var(--display); font-weight: 600; font-size: 1.5rem; color: #fff; text-decoration: none;
  display: inline-flex; align-items: center; gap: 0.5rem;
}
.wordmark::before {
  content: ""; width: 0.8rem; height: 0.8rem; border-radius: 50%;
  background: var(--here); box-shadow: 0 0 0 3px #fff;
}
.nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.1rem; flex: 1; }
.nav a, .who a { color: #fff; text-decoration: none; padding: 0.35rem 0; border-bottom: 3px solid transparent; }
.nav a:hover, .who a:hover { border-bottom-color: rgba(255,255,255,0.6); }
.nav a[aria-current="page"] { border-bottom-color: var(--here); }
.who { display: flex; align-items: center; gap: 1rem; font-size: 0.95rem; }
.who form { margin: 0; }
.who button {
  background: transparent; color: #fff; border: 1px solid rgba(255,255,255,0.7); border-radius: 4px;
  padding: 0.2rem 0.6rem; font: inherit; cursor: pointer;
}
@media (prefers-color-scheme: dark) {
  .top { background: #0f2a40; }
}

main { max-width: 1200px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }
.page-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem 1.5rem; margin-bottom: 1.25rem; }
.page-head p { margin: 0; }
.notice, .problem {
  border-left: 4px solid var(--good); background: var(--surface); padding: 0.6rem 0.9rem; margin: 0 0 1rem;
  max-width: 75ch;
}
.problem { border-left-color: var(--bad); }

/* ---------------------------------------------------------------- Übersicht: Linien */

.lines { display: grid; gap: 1rem; }
.project {
  background: var(--surface);
  border-left: 6px solid var(--line);
  padding: 1rem 1.25rem 1.1rem;
}
.project-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 1rem; }
.project-head h2 a { color: var(--ink); text-decoration: none; }
.project-head h2 a:hover { text-decoration: underline; }
.project-head .quiet { font-size: 0.875rem; }

.arc-row {
  display: grid;
  grid-template-columns: minmax(14rem, 1.1fr) minmax(18rem, 1.6fr) minmax(12rem, 1fr);
  gap: 0.5rem 1.5rem;
  align-items: center;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--rule);
}
.arc-row:last-of-type { border-bottom: 0; }
.arc-title { font-weight: 600; color: var(--ink); text-decoration: none; }
.arc-title .num { color: var(--line); margin-right: 0.35rem; }
.arc-title:hover { text-decoration: underline; }
.arc-home { display: block; font-size: 0.8125rem; color: var(--ink-2); font-weight: 400; }
@media (max-width: 860px) {
  .arc-row { grid-template-columns: 1fr; }
}

/* Linie mit vier Haltestellen; die aktuelle trägt den gelben Punkt. */
.stations {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr);
  font-size: 0.8125rem; color: var(--ink-2);
}
.stations li { position: relative; padding-top: 1.35rem; text-align: center; }
.stations li::before {
  content: ""; position: absolute; top: 0.25rem; left: 50%; width: 0.75rem; height: 0.75rem;
  margin-left: -0.375rem; border-radius: 50%; background: var(--surface); border: 2px solid var(--line);
  z-index: 1;
}
.stations li::after {
  content: ""; position: absolute; top: 0.56rem; left: -50%; width: 100%; height: 0;
  border-top: 3px dotted var(--rule);
}
.stations li:first-child::after { display: none; }
.stations li.done::before { background: var(--line); }
.stations li.done::after, .stations li.here::after { border-top: 3px solid var(--line); }
.stations li.here { color: var(--ink); font-weight: 600; }
.stations li.here::before {
  width: 1.05rem; height: 1.05rem; top: 0.1rem; margin-left: -0.525rem;
  background: var(--here); border: 3px solid var(--line);
}
.stations.large { font-size: 0.95rem; max-width: 40rem; }

.measure { display: grid; gap: 0.3rem; font-size: 0.875rem; }
.squares { display: flex; flex-wrap: wrap; gap: 2px; }
.squares span {
  width: 0.7rem; height: 0.7rem; border-radius: 2px; border: 1.5px solid var(--ink-2); background: transparent;
}
.squares span.met { background: var(--good); border-color: var(--good); }
.squares span.active { background: var(--here); border-color: var(--here); }

.facts {
  display: grid; grid-template-columns: minmax(14rem, 1.1fr) minmax(18rem, 2.6fr); gap: 0.5rem 1.5rem;
  margin-top: 0.85rem; padding-top: 0.75rem; border-top: 1px solid var(--rule); font-size: 0.9375rem;
}
@media (max-width: 860px) { .facts { grid-template-columns: 1fr; } }
.facts .label { color: var(--ink-2); margin-right: 0.4rem; }
.open-links a { margin-right: 0.75rem; white-space: nowrap; }
.open-links .none { color: var(--ink-2); }

.bar-wrap { display: flex; align-items: center; gap: 0.6rem; }
.bar { flex: 1; height: 0.65rem; max-width: 28rem; min-width: 6rem; display: block; }
.bar .track { fill: var(--line-soft); }
.bar .fill { fill: var(--line); }

.quiet-projects { margin-top: 2rem; }
.quiet-projects h2 { margin-bottom: 0.5rem; }

/* ---------------------------------------------------------------- Tabellen und Listen */

table { border-collapse: collapse; width: 100%; background: var(--surface); }
th, td { text-align: left; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-family: var(--display); font-weight: 600; font-size: 0.95rem; color: var(--ink-2); }
td.n, th.n { text-align: right; }
tr:last-child td { border-bottom: 0; }

.items { list-style: none; margin: 0; padding: 0; background: var(--surface); }
.items li { padding: 0.6rem 0.9rem; border-bottom: 1px solid var(--rule); display: grid; gap: 0.15rem; }
.items li:last-child { border-bottom: 0; }
.items .meta { font-size: 0.8125rem; color: var(--ink-2); }
.items .meta a { color: inherit; }
.items .head a { font-weight: 600; text-decoration: none; }
.items .head a:hover { text-decoration: underline; }
.role {
  display: inline-block; font-size: 0.75rem; padding: 0 0.4rem; border-radius: 3px; margin-right: 0.35rem;
  border: 1px solid var(--rule); color: var(--ink-2); vertical-align: 0.08em;
}

.outcome { font-weight: 600; white-space: nowrap; }
.outcome::before { margin-right: 0.25rem; }
.outcome.belegt { color: var(--good); }
.outcome.belegt::before { content: "✓"; }
.outcome.teilweise { color: var(--warn); }
.outcome.teilweise::before { content: "◐"; }
.outcome.nicht_belegt { color: var(--bad); }
.outcome.nicht_belegt::before { content: "✗"; }
.status-met { color: var(--good); font-weight: 600; white-space: nowrap; }
.status-open { color: var(--ink-2); white-space: nowrap; }
.empty-projects { margin-top: 1rem; }
.empty-projects > .panel { margin: 0; line-height: 1.9; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.5rem; }
.grid-2 > section, .stack > section { min-width: 0; }
@media (max-width: 960px) { .grid-2 { grid-template-columns: 1fr; } }
.stack { display: grid; gap: 1.75rem; }
section > h2 { margin-bottom: 0.6rem; }
section h3 { margin: 1.25rem 0 0.4rem; }
section > form + h2, section > form + h3, section > table + h3, section > p + h3 { margin-top: 1.5rem; }
section > form + h2 { display: block; }
section > h2 .quiet { font-family: var(--text); font-weight: 400; font-size: 0.95rem; }

.panel { background: var(--surface); padding: 1rem 1.25rem; }
.body { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 80ch; line-height: 1.55; }
.meta-list { display: grid; grid-template-columns: max-content 1fr; gap: 0.2rem 1rem; margin: 0; font-size: 0.9rem; }
.meta-list dt { color: var(--ink-2); }
.meta-list dd { margin: 0; overflow-wrap: anywhere; }

details { background: var(--surface); margin-bottom: 0.5rem; }
details > summary {
  cursor: pointer; padding: 0.55rem 0.9rem; font-family: var(--display); font-weight: 600; font-size: 1.05rem;
}
details[open] > summary { border-bottom: 1px solid var(--rule); }
details > .items { background: transparent; }

/* ---------------------------------------------------------------- Filter */

.filters { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: end; margin-bottom: 1rem; }
.filters label { display: grid; gap: 0.15rem; font-size: 0.875rem; color: var(--ink-2); }
.chips { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0 0 1rem; padding: 0; list-style: none; }
.chips a {
  display: inline-block; padding: 0.15rem 0.6rem; border-radius: 999px; border: 1px solid var(--rule);
  background: var(--surface); color: var(--ink); text-decoration: none; font-size: 0.875rem;
}
.chips a[aria-current="true"] { background: var(--line); border-color: var(--line); color: #fff; }

/* ---------------------------------------------------------------- Formulare */

form.stacked { display: grid; gap: 0.75rem; max-width: 44rem; }
form.inline { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: end; }
label { display: grid; gap: 0.25rem; }
label > span { font-size: 0.875rem; color: var(--ink-2); }
input[type="text"], input[type="password"], input[type="number"], select, textarea {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--ink-2);
  border-radius: 4px; padding: 0.4rem 0.55rem; min-width: 0;
}
textarea { min-height: 14rem; line-height: 1.5; resize: vertical; width: 100%; }
fieldset { border: 1px solid var(--rule); padding: 0.75rem 1rem; margin: 0; }
legend { padding: 0 0.35rem; color: var(--ink-2); font-size: 0.875rem; }
button, .button {
  font: inherit; font-weight: 600; cursor: pointer; border-radius: 4px; padding: 0.45rem 0.9rem;
  border: 2px solid var(--line); background: var(--line); color: #fff; text-decoration: none; display: inline-block;
}
button.secondary, .button.secondary { background: transparent; color: var(--line); }
button.danger { background: transparent; color: var(--bad); border-color: var(--bad); }
button:disabled { opacity: 0.55; cursor: not-allowed; }
.secret {
  font-family: var(--mono); font-size: 0.95rem; background: var(--line-soft); padding: 0.6rem 0.8rem;
  overflow-wrap: anywhere; user-select: all; border-left: 4px solid var(--here);
}

/* ---------------------------------------------------------------- Anmeldung */

.login {
  max-width: 26rem; margin: 6vh auto 0; background: var(--surface); padding: 1.75rem 2rem 2rem;
  border-top: 6px solid var(--line);
}
.login h1 { margin-bottom: 1rem; display: flex; align-items: center; gap: 0.6rem; }
.login h1::before {
  content: ""; width: 1rem; height: 1rem; border-radius: 50%; background: var(--here);
  box-shadow: 0 0 0 3px var(--line);
}
.or { display: flex; align-items: center; gap: 0.75rem; color: var(--ink-2); margin: 1.25rem 0; font-size: 0.875rem; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--rule); }

/* ---------------------------------------------------------------- Graphen (Cytoscape.js) */

.__________cytoscape_container { position: relative; }
.graph {
  height: 34rem; background: var(--surface); border: 1px solid var(--rule); position: relative;
}
.graph.tall { height: 40rem; }
.graph-help { font-size: 0.8125rem; color: var(--ink-2); margin: 0.35rem 0 0; }
.legend { display: flex; flex-wrap: wrap; gap: 0.35rem 1.25rem; font-size: 0.8125rem; color: var(--ink-2); margin: 0.5rem 0 0; padding: 0; list-style: none; }
.legend li { display: inline-flex; align-items: center; gap: 0.4rem; }
.legend .key { width: 0.9rem; height: 0.9rem; display: inline-block; border: 2px solid var(--ink-2); background: var(--surface); }
.legend .key.goal { background: var(--line-soft); border-color: var(--line); border-radius: 3px; }
.legend .key.proof { border-color: var(--good); border-width: 3px; border-radius: 3px; }
.legend .key.open { border-color: var(--warn-mark); border-width: 3px; border-radius: 3px; }
.legend .key.other { border-radius: 3px; }
.legend .key.focus { border-color: var(--here); border-width: 4px; border-radius: 3px; }
.legend .key.running { background: var(--line); border-color: var(--line); border-radius: 3px; }
.legend .key.closed { border-radius: 3px; }
.legend .edge { width: 1.6rem; height: 0; border-top: 2px solid var(--ink-2); }
.legend .edge.dashed { border-top-style: dashed; }
.legend .edge.bad { border-top-color: var(--bad); }
.legend .edge.good { border-top-color: var(--good); }
.legend .edge.seq { border-top: 6px solid var(--rule); }

.trace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 1.5rem; align-items: start; }
@media (max-width: 1000px) { .trace { grid-template-columns: 1fr; } }
.node-info { margin-top: 0.5rem; min-height: 3rem; font-size: 0.9rem; }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
@media print {
  .top, .filters, form { display: none; }
  body { background: #fff; }
}

[hidden] { display: none !important; }
.new-entry { margin-bottom: 1.25rem; max-width: 52rem; }
.new-entry > form { margin: 0; }
.answered { font-size: 0.8125rem; color: var(--good); white-space: nowrap; margin-left: 0.35rem; }
.answered::before { content: "✓ "; }
.answered a { color: inherit; font-weight: 400; }
.open-project > h2 { border-bottom: 2px solid var(--line); padding-bottom: 0.3rem; }
.open-project section > h3 { margin-top: 0.5rem; }
.mesh { margin-bottom: 1.75rem; }
.mesh-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 0.5rem 1.5rem; margin-bottom: 0.6rem; }
.mesh-head h2 { margin: 0; }
.mesh-head .filters { margin: 0; }
.mesh .graph { height: 40rem; }
.legend .key.proj { border-radius: 50%; background: var(--line); border-color: var(--line); }
.legend .key.session { border-radius: 50%; width: 0.6rem; height: 0.6rem; background: var(--ink-2); border-color: var(--ink-2); }
