/* Stellwerk – Gestaltung nach Bahnhofsschild und Fallblattanzeiger */
:root {
  --blau: #103a86;
  --blau-tief: #0a1f4d;
  --nacht: #0d1016;
  --tafel: #131823;
  --tafel2: #1b2230;
  --linie: #2b3446;
  --text: #e9edf4;
  --leise: #9aa5b8;
  --gelb: #f6c41c;
  --gruen: #35c46a;
  --rot: #e5484d;
  --hell: #4f8bff;
  --schrift: "Bahnschrift", "DIN Alternate", "Barlow", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { color-scheme: dark; scroll-padding-top: 5rem; }
body { margin: 0; background: var(--nacht); color: var(--text); font: 17px/1.55 var(--schrift); min-height: 100vh; display: flex; flex-direction: column; }
main { width: min(1180px, 100% - 2.4rem); margin: 2rem auto 4rem; flex: 1; }
a { color: #8db4ff; text-underline-offset: .2em; }
a:hover { color: #fff; }
:focus-visible { outline: 3px solid var(--gelb); outline-offset: 2px; }
h1, h2, h3 { line-height: 1.15; font-weight: 600; text-wrap: balance; margin: 0 0 .6rem; }
h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.12rem; }
section { margin: 2.8rem 0; }
p { max-width: 72ch; margin: .4rem 0 .9rem; }
code { font-family: Consolas, ui-monospace, monospace; font-size: .92em; overflow-wrap: anywhere; }
.leise { color: var(--leise); }
.klein { font-size: .9rem; }
.text { max-width: 75ch; }

.kopf { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 2rem; padding: .8rem max(1.2rem, (100% - 1180px) / 2); background: var(--blau-tief); border-bottom: 4px solid #f1f1ea; position: sticky; top: 0; z-index: 20; }
.marke { display: block; background: var(--blau); color: #fff; text-decoration: none; padding: 4px; border-radius: 6px; }
.marke span { display: block; border: 2px solid #fff; border-radius: 3px; padding: .1rem .8rem .18rem; font-size: 1.4rem; font-weight: 600; }
.kopf nav { display: flex; flex-wrap: wrap; gap: .2rem; }
.kopf nav a { color: #dbe5ff; text-decoration: none; padding: .4rem .75rem; border-radius: 5px; }
.kopf nav a:hover { background: rgba(255,255,255,.12); }
.kopf nav a[aria-current] { background: var(--gelb); color: #17140a; }

.held { display: grid; grid-template-columns: 1.1fr 1fr; gap: 2.5rem; align-items: center; margin: 1.5rem 0 2rem; }
.held-text { background: var(--blau); padding: 8px; border-radius: 12px; }
.held-text > * { margin-inline: 1.6rem; }
.held-text { box-shadow: inset 0 0 0 8px var(--blau), inset 0 0 0 11px #fff; padding: 1.9rem .6rem 1.5rem; }
.held-text h1 { font-size: clamp(2.6rem, 7vw, 4.4rem); color: #fff; margin-bottom: .3rem; }
.held-text p { color: #e5edff; font-size: 1.1rem; }

.knopf { display: inline-block; background: #22304a; color: #fff; border: 2px solid #5570a5; border-radius: 6px; padding: .5rem 1rem; font: inherit; text-decoration: none; cursor: pointer; line-height: 1.25; }
.knopf:hover { background: #2d4064; color: #fff; }
.knopf.gross { background: var(--gelb); border-color: var(--gelb); color: #17140a; font-weight: 600; }
.knopf.gross:hover { background: #ffd84a; }
.knopf.rot { border-color: var(--rot); background: #3a1c21; }
.knopf.klein { padding: .22rem .6rem; font-size: .92rem; }
.knopfreihe { display: flex; flex-wrap: wrap; gap: .7rem; max-width: none; }

.anzeiger { background: #05070b; border: 10px solid #252b36; border-radius: 10px; min-width: 0; }
.anzeiger-kopf { display: flex; justify-content: space-between; align-items: baseline; background: #f2f2ec; color: #12306f; padding: .5rem 1rem; font-size: 1.2rem; font-weight: 600; }
.anzeiger-kopf strong { font-size: 1.7rem; font-variant-numeric: tabular-nums; }
.anzeiger-leer { padding: .2rem 1rem; }
.anzeigetafel { width: 100%; border-collapse: collapse; }
.anzeigetafel td { padding: .45rem 1rem; border-bottom: 1px solid #1d2431; vertical-align: top; line-height: 1.3; }
.anzeigetafel td:first-child { color: var(--gelb); overflow-wrap: anywhere; }
.anzeigetafel td:last-child { text-align: right; white-space: nowrap; font-size: .9rem; }

.meldung { background: #2a2410; border: 2px solid var(--gelb); border-radius: 8px; padding: .8rem 1.1rem; max-width: none; }
.meldung p { margin: .2rem 0 0; }
.zeile-kopf { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between; align-items: center; }

.karten { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 310px), 1fr)); gap: 1.1rem; }
.karte { display: block; background: var(--tafel); border: 2px solid var(--linie); border-radius: 10px; color: inherit; text-decoration: none; overflow: hidden; }
.karte:hover { border-color: var(--hell); color: inherit; }
.karte-text { padding: .9rem 1.1rem 1rem; }
.karte-text p { margin: .15rem 0; }
.gleisbild { display: block; width: 100%; height: auto; background: #05070b; }
.gleisbild .g { fill: none; stroke: #c9d2df; stroke-width: 2.2; stroke-linecap: round; }
.gleisbild .b { fill: none; stroke: var(--hell); stroke-width: 5; }
.gleisbild text { fill: var(--gelb); font: 600 13px var(--schrift); text-anchor: middle; }
.plan { border: 2px solid var(--linie); border-radius: 10px; overflow: hidden; margin: 1rem 0; }

.schild { display: inline-block; background: #2b3446; color: #e5ebf5; border-radius: 4px; padding: .05rem .5rem; font-size: .88rem; text-decoration: none; }
.schild.gruen { background: #15402a; color: #8bf0b2; }
.schild.gelb { background: #463a0b; color: #ffe07a; }
.schild.rot { background: #4b1d21; color: #ffb3b6; }
.schild.blau { background: #143a80; color: #cfe0ff; }

.version { display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between; align-items: flex-start; background: var(--tafel); border-radius: 10px; padding: 1.2rem 1.4rem; margin: 1rem 0; border: 2px solid var(--linie); }
.version > div { flex: 1 1 26rem; min-width: 0; }
.version.neu { border-color: var(--gelb); }
.schritte { padding-left: 1.4rem; max-width: 75ch; }
.schritte li { margin: .4rem 0; }
.spalten { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); gap: 1.4rem 2.4rem; }
.spalten section { margin: 1.2rem 0; min-width: 0; }
.spalten.zwei { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
dl { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1rem; margin: 0; }
dt { color: var(--leise); }
dd { margin: 0; }
.grenzen { list-style: none; padding: 0; margin: 0; }
.grenzen li { padding: .3rem 0; }
.ort { margin: 1.1rem 0; background: var(--tafel); border-radius: 8px; overflow: hidden; }
.ort h3 { margin: 0; padding: .6rem 1rem; background: var(--tafel2); }

.netz { display: block; width: 100%; background: #05070b; border: 2px solid var(--linie); border-radius: 10px; touch-action: none; cursor: grab; }
.netz.klein { cursor: pointer; touch-action: auto; }
.netz:active { cursor: grabbing; }
.netz-rahmen { position: relative; }
#netz-info { position: absolute; top: 14px; right: 14px; width: min(310px, calc(100% - 28px)); background: rgba(12,20,40,.96); border: 2px solid #5570a5; border-radius: 10px; padding: .9rem 1.1rem; }
#netz-info h3 { margin-right: 2rem; }
#netz-info p { margin: .3rem 0; }
#netz-info button { position: absolute; top: .5rem; right: .6rem; background: none; border: 0; color: var(--leise); font-size: 1.4rem; cursor: pointer; }
.legende { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; color: var(--leise); }
.punkt { width: 13px; height: 13px; border-radius: 50%; display: inline-block; margin-left: .8rem; }
.punkt:first-child { margin-left: 0; }
.punkt.gruen { background: var(--gruen); } .punkt.gelb { background: var(--gelb); } .punkt.blau { background: var(--hell); }
.strich { width: 26px; border-top: 3px dashed var(--gelb); display: inline-block; margin-left: .8rem; }
.schalter { display: flex; gap: .5rem; align-items: center; cursor: pointer; }
.schalter input { width: 1.1rem; height: 1.1rem; }

.saeulen { display: flex; align-items: flex-end; gap: 3px; height: 150px; border-bottom: 2px solid var(--linie); padding-bottom: 1.4rem; }
.saeulen div { flex: 1; height: 100%; display: flex; align-items: flex-end; position: relative; }
.saeulen i { display: block; width: 100%; min-height: 2px; background: var(--hell); border-radius: 3px 3px 0 0; }
.saeulen span { position: absolute; bottom: -1.4rem; left: 0; right: 0; text-align: center; font-size: .7rem; color: var(--leise); }

table { border-collapse: collapse; width: 100%; }
th { text-align: left; color: var(--leise); font-weight: 500; }
th, td { padding: .5rem .7rem; border-bottom: 1px solid var(--linie); vertical-align: top; }
.scroll { overflow-x: auto; }
input, textarea, select { background: #0a0e16; color: var(--text); border: 2px solid var(--linie); border-radius: 6px; padding: .5rem .7rem; font: inherit; max-width: 100%; }
input[type=checkbox] { accent-color: var(--gelb); }
textarea { width: 100%; min-height: 7rem; }
label.feld { display: block; margin: .9rem 0; }
label.feld > span { display: block; color: var(--leise); margin-bottom: .2rem; }
label.feld input:not([type=checkbox]), label.feld select { width: min(100%, 30rem); }
.suche { display: flex; gap: .5rem; flex-wrap: wrap; }

.admin { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 2rem; }
.admin > nav { display: flex; flex-direction: column; gap: .2rem; position: sticky; top: 6rem; align-self: start; }
.admin > nav a { padding: .45rem .8rem; border-radius: 6px; color: #dbe5ff; text-decoration: none; display: flex; justify-content: space-between; gap: .5rem; }
.admin > nav a:hover { background: var(--tafel2); }
.admin > nav a[aria-current] { background: var(--blau); }
.kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin: 1rem 0 2rem; }
.kacheln div { background: var(--tafel); border: 2px solid var(--linie); border-radius: 10px; padding: .8rem 1rem; }
.kacheln strong { display: block; font-size: 2rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.aktionen { display: flex; flex-wrap: wrap; gap: .4rem; }
.aktionen form { margin: 0; }
.ablage { border: 3px dashed #5570a5; border-radius: 12px; padding: 2rem; text-align: center; background: var(--tafel); }
.ablage.an { border-color: var(--gelb); }
progress { width: 100%; height: 1.2rem; accent-color: var(--gelb); }
.gut { color: #8bf0b2; } .schlecht { color: #ffb3b6; }

.fuss { border-top: 4px solid #f1f1ea; background: var(--blau-tief); padding: 1.1rem max(1.2rem, (100% - 1180px) / 2); display: flex; flex-wrap: wrap; justify-content: space-between; gap: .4rem 2rem; color: #c3d0ee; font-size: .94rem; }
.fuss p { margin: 0; }
.fuss nav { display: flex; gap: 1.2rem; }
.fuss a { color: #dbe5ff; }

@media (max-width: 820px) {
  .held, .admin { grid-template-columns: minmax(0, 1fr); }
  .admin > nav { position: static; flex-direction: row; flex-wrap: wrap; }
  .kopf { position: static; }
}
@media (prefers-reduced-motion: no-preference) {
  .knopf, .karte, .kopf nav a { transition: background .15s, border-color .15s; }
}
