/* Fahrplan – dunkles Leitstellen-Design */
:root{
  --fp-bg:#020914;
  --fp-panel:#061529;
  --fp-panel2:#071b36;
  --fp-blue:#2f7cff;
  --fp-blue2:#7fbbff;
  --fp-line:#23476f;
  --fp-line2:#315f92;
  --fp-text:#ffffff;
  --fp-muted:#9ec6ff;
}

.timetableBackdrop{
  position:fixed;
  inset:0;
  z-index:9999;
  display:none;
  align-items:center;
  justify-content:center;
  padding:18px;
  background:rgba(0,0,0,.55);
  backdrop-filter:blur(4px);
}
.timetableBackdrop.show{display:flex;}

.timetableDialog{
  width:min(1600px,98vw);
  max-height:94vh;
  overflow:hidden;
  border:1px solid #0b3c78;
  border-radius:14px;
  background:linear-gradient(180deg,#061326,#020914 100%);
  color:var(--fp-text);
  box-shadow:0 24px 70px rgba(0,0,0,.75), inset 0 1px 0 rgba(255,255,255,.12);
  font-family:Arial,Helvetica,sans-serif;
}

.timetableTopbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  height:42px;
  padding:0 12px;
  background:linear-gradient(180deg,#08275a 0%,#051a3d 55%,#031024 100%);
  border-bottom:1px solid #092f61;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.16);
}
.timetableTitle{
  display:flex;
  align-items:center;
  gap:8px;
  font-size:15px;
  font-weight:500;
  letter-spacing:.1px;
  color:#fff;
  text-shadow:0 1px 1px rgba(0,0,0,.6);
}
.timetableTitleIcon{font-size:18px; line-height:1;}
.timetableWindowBtns{display:flex; align-items:center; gap:14px; color:#fff; font-size:17px;}
.timetableWindowBtns button{
  border:0!important;
  background:transparent!important;
  color:#fff!important;
  padding:0!important;
  min-width:18px;
  height:22px;
  box-shadow:none!important;
  font-weight:400!important;
  cursor:pointer;
}

.timetableBody{
  padding:10px 12px 12px;
  overflow:auto;
  max-height:calc(94vh - 42px);
  background:
    radial-gradient(circle at 18% 0%,rgba(45,124,255,.20),transparent 33%),
    radial-gradient(circle at 82% 0%,rgba(45,124,255,.16),transparent 32%),
    #020914;
}

.timetablePanels{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
}
.timetablePanel{
  border:1px solid #123d72;
  border-radius:8px;
  background:linear-gradient(180deg,rgba(8,33,67,.92),rgba(3,13,27,.96));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.10), 0 10px 26px rgba(0,0,0,.35);
  overflow:hidden;
}
.timetablePanelHead{
  display:flex;
  align-items:center;
  gap:10px;
  padding:9px 11px 8px;
  background:linear-gradient(180deg,rgba(18,58,112,.55),rgba(6,24,50,.30));
}
.timetableTrainIcon{
  width:38px;
  height:38px;
  border-radius:999px;
  display:grid;
  place-items:center;
  color:#fff;
  font-size:22px;
  background:linear-gradient(180deg,#316cc5,#123a7f);
  border:1px solid #3f8cff;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.42),0 6px 14px rgba(0,0,0,.35);
}
.timetablePanelTitle{font-size:20px; font-weight:700; line-height:1.05; color:#fff; text-shadow:0 1px 1px #000;}
.timetablePanelSub{margin-top:2px; font-size:14px; color:#6db3ff; font-weight:600;}

.timetableTableWrap{padding:0 10px 10px;overflow-x:auto;}
.timetableTable{
  width:100%;
  border-collapse:collapse;
  table-layout:fixed;
  color:#fff;
  background:transparent;
  font-size:17px;
}
.timetableTable th,
.timetableTable td{
  border:1px solid var(--fp-line);
  height:27px;
  padding:4px 6px;
  text-align:center;
  vertical-align:middle;
  color:#fff;
  background:rgba(3,13,27,.48);
  font-weight:400;
  text-shadow:0 1px 1px rgba(0,0,0,.50);
  outline:none;
}
.timetableTable th{
  height:28px;
  font-weight:600;
  background:linear-gradient(180deg,#0f3468,#092348)!important;
  color:#fff;
}
.timetableTable tbody tr:nth-child(even) td{background:rgba(6,21,42,.58);}
.timetableTable tbody tr:hover td{background:rgba(22,72,135,.62);}
.timetableTable td[contenteditable="true"]{cursor:text;}
.timetableTable td[contenteditable="true"]:empty::after{content:'';}
.timetableTable td[contenteditable="true"]:focus{
  background:linear-gradient(180deg,rgba(43,114,220,.55),rgba(12,42,88,.70))!important;
  box-shadow:inset 0 0 0 2px #2f7cff;
}

.timetableAddBtn{
  width:100%;
  height:34px;
  margin-top:8px;
}

.timetableFooterActions{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-top:10px;
  padding-top:8px;
}
.timetableActionGroup{display:flex; gap:10px; align-items:center;}

.timetableDialog button{
  border:1px solid #2e67bd;
  border-radius:7px;
  color:#fff;
  background:linear-gradient(to bottom,#86b8ff 0%,#3d79df 46%,#1352bd 47%,#0d3277 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.95),
    inset 0 12px 16px rgba(255,255,255,.20),
    inset 0 -8px 14px rgba(0,0,0,.20),
    0 2px 7px rgba(0,0,0,.45);
  text-shadow:0 -1px 0 rgba(0,0,0,.75);
  font-weight:700;
  cursor:pointer;
  padding:7px 14px;
}
.timetableDialog button:hover{filter:brightness(1.08);}
.timetableDialog button:active{transform:translateY(1px); filter:brightness(.96);}
.timetableFooterActions button{min-width:128px; height:34px; font-size:17px;}
.timetableFooterActions .saveBtn{min-width:120px;}

@media (max-width:850px){
  .timetablePanels{grid-template-columns:1fr;}
  .timetableDialog{width:96vw;}
}

@media print{
  body *{visibility:hidden!important;}
  .timetableBackdrop,.timetableBackdrop *{visibility:visible!important;}
  .timetableBackdrop{position:static; display:block; padding:0; background:#fff!important; backdrop-filter:none;}
  .timetableDialog{box-shadow:none; border:0; background:#fff; color:#000; width:auto; max-height:none; overflow:visible; border-radius:0;}
  .timetableTopbar,.timetableFooterActions,.timetableAddBtn{display:none!important;}
  .timetableBody{padding:0; max-height:none; overflow:visible; background:#fff!important;}
  .timetablePanels{display:grid; grid-template-columns:1fr 1fr; gap:8mm;}
  .timetablePanel{box-shadow:none; border:0; background:#fff; overflow:visible;}
  .timetablePanelHead{background:#fff!important; color:#000; padding:0 0 4mm; display:block; text-align:center;}
  .timetableTrainIcon{display:none;}
  .timetablePanelTitle,.timetablePanelSub{color:#000!important; text-shadow:none;}
  .timetablePanelTitle{font-size:16px;}
  .timetablePanelSub{font-size:17px;}
  .timetableTableWrap{padding:0;}
  .timetableTable{border-collapse:collapse; background:#fff; color:#000; font-size:11px;}
  .timetableTable th,.timetableTable td{border:1px solid #000!important; background:#fff!important; color:#000!important; box-shadow:none!important; height:22px; padding:4px 5px; font-weight:400!important; text-align:center!important; text-shadow:none!important;}
  .timetableTable th{font-weight:700!important;}
  @page{margin:10mm;}
}

.timetableTable th{font-size:16px;}
.timetableTable td{font-size:17px;line-height:1.45;}


/* ChatGPT redesign */
.timetableDialog{width:min(1400px,98vw);}
.timetableTopbar{
 height:68px;
 padding:0 22px;
 background:linear-gradient(180deg,#0d2d68,#071a3d 55%,#041022);
}
.timetableTitle{font-size:28px;font-weight:700;gap:14px}
.timetableTitleIcon{font-size:34px}
.timetableBody{padding:14px}
.timetablePanels{gap:18px}
.timetablePanel{border-radius:14px}
.timetablePanelHead{padding:16px 18px;border-bottom:2px solid #1f8fff}
.timetableTrainIcon{width:64px;height:64px;font-size:34px}
.timetablePanelTitle{font-size:26px}
.timetablePanelSub{font-size:18px}
.timetableTable{font-size:20px}
.timetableTable th{font-size:20px;height:44px}
.timetableTable td{font-size:22px;height:50px}
.timetableTable th:first-child,.timetableTable td:first-child{font-weight:700}
.timetableTable tbody tr:nth-child(-n+4) td{
 background:linear-gradient(90deg,rgba(41,102,196,.45),rgba(20,48,92,.25));
}
.timetableFooter button,
.timetableAddRowBtn,
.timetableActionBtn{
 background:linear-gradient(180deg,#7fb2ff 0%,#4d87ef 42%,#295fcb 43%,#214da8 100%) !important;
 border:1px solid #7cb2ff !important;
 color:#fff !important;
 box-shadow:inset 0 2px 0 rgba(255,255,255,.55),0 4px 12px rgba(0,0,0,.45) !important;
 text-shadow:0 -1px 0 rgba(0,0,0,.4);
}

/* Fahrplan-Import und Fahrplan-Auswahl */
.timetableControlBar{
  display:flex;
  align-items:center;
  gap:12px;
  margin:0 0 12px;
  padding:10px 12px;
  border:1px solid #123d72;
  border-radius:10px;
  background:linear-gradient(180deg,rgba(9,31,65,.88),rgba(3,13,27,.72));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.10);
}
.timetableControlBar label{
  display:flex;
  align-items:center;
  gap:8px;
  color:#cfe6ff;
  font-size:15px;
  font-weight:600;
}
.timetableControlBar select{
  min-width:190px;
  height:34px;
  border-radius:7px;
  border:1px solid #2f6fc4;
  background:linear-gradient(180deg,#0e2c5b,#081b39);
  color:#fff;
  padding:0 10px;
  font-weight:600;
  outline:none;
}
.timetableImportHint{
  color:#8fbceb;
  font-size:13px;
  margin-left:auto;
  white-space:nowrap;
}
#timetableImportPdfBtn{
  height:34px;
  white-space:nowrap;
}
@media (max-width:850px){
  .timetableControlBar{flex-wrap:wrap;}
  .timetableImportHint{width:100%; margin-left:0;}
}
@media print{
  .timetableControlBar{display:none!important;}
}

.timetableActiveInfo{
  color:#ffffff;
  font-size:13px;
  font-weight:600;
  padding:6px 10px;
  border:1px solid rgba(91,157,255,.45);
  border-radius:8px;
  background:linear-gradient(180deg,rgba(42,104,202,.30),rgba(10,34,74,.35));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.12);
  white-space:nowrap;
}
@media (max-width:850px){.timetableActiveInfo{width:100%;white-space:normal;}}
@media print{.timetableActiveInfo{display:none!important;}}

.timetableStatus{
  display:none;
  min-width:220px;
  max-width:420px;
  color:#fff;
  font-size:13px;
  font-weight:700;
  padding:7px 11px;
  border-radius:8px;
  white-space:normal;
  line-height:1.25;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.16),0 4px 12px rgba(0,0,0,.28);
}
.timetableStatus.show{display:inline-flex;align-items:center;}
.timetableStatus.ok{border:1px solid rgba(74,222,128,.45);background:linear-gradient(180deg,rgba(22,101,52,.95),rgba(20,83,45,.95));}
.timetableStatus.bad{border:1px solid rgba(248,113,113,.55);background:linear-gradient(180deg,rgba(185,28,28,.96),rgba(127,29,29,.96));}

/* Fix: alle importierten Fahrplanzeilen behalten denselben Hintergrund */
.timetableTable tbody tr td,
.timetableTable tbody tr:nth-child(odd) td,
.timetableTable tbody tr:nth-child(even) td,
.timetableTable tbody tr.imported td,
.timetableTable tbody tr.selected td{
  background:rgba(3,13,27,.48) !important;
  background-image:none !important;
}
.timetableTable tbody tr:hover td{
  background:rgba(22,72,135,.62) !important;
}


/* Fahrplan: Kopf/Bedienleiste fest sichtbar, nur Tabellenbereich scrollt */
.timetableDialog{
  height:min(94vh,980px);
  display:flex;
  flex-direction:column;
  overflow:hidden;
}
.timetableTopbar{
  flex:0 0 auto;
}
.timetableBody{
  flex:1 1 auto;
  min-height:0;
  display:flex;
  flex-direction:column;
  overflow:hidden !important;
}
.timetableControlBar{
  flex:0 0 auto;
}
.timetablePanels{
  flex:1 1 auto;
  min-height:0;
  overflow:hidden;
}
.timetablePanel{
  min-height:0;
  display:flex;
  flex-direction:column;
}
.timetablePanelHead{
  flex:0 0 auto;
}
.timetablePanel > .timetableTableWrap:first-of-type{
  flex:1 1 auto;
  min-height:0;
  overflow:auto;
  padding-bottom:0;
}
.timetablePanel > .timetableTableWrap:last-of-type{
  flex:0 0 auto;
  padding-top:8px;
}
.timetableTable thead th{
  position:sticky;
  top:0;
  z-index:2;
}
.timetableFooterActions{
  flex:0 0 auto;
  position:relative;
  z-index:5;
  margin-top:12px;
  padding:10px 0 0;
  background:linear-gradient(180deg,rgba(2,9,20,.35),rgba(2,9,20,.95));
  box-shadow:0 -12px 22px rgba(2,9,20,.80);
}
#timetableFolderBtn{
  white-space:nowrap;
}
#timetableImportPdfBtn{
  display:none!important;
}
@media (max-width:850px){
  .timetablePanels{overflow:auto;}
  .timetablePanel{min-height:420px;}
}
@media print{
  .timetableDialog,.timetableBody,.timetablePanels,.timetablePanel,.timetablePanel>.timetableTableWrap:first-of-type{
    height:auto!important; display:block!important; overflow:visible!important;
  }
  .timetableFooterActions{position:static!important; box-shadow:none!important; background:#fff!important;}
}


/* Fix: Tabellenbereich im Fahrplan scrollt separat; Kopf und Fuß bleiben sichtbar */
.timetableDialog{
  height:min(94vh,980px) !important;
  display:flex !important;
  flex-direction:column !important;
  overflow:hidden !important;
}
.timetableTopbar,
.timetableControlBar,
.timetableFooterActions{
  flex:0 0 auto !important;
}
.timetableBody{
  flex:1 1 auto !important;
  min-height:0 !important;
  display:flex !important;
  flex-direction:column !important;
  overflow:hidden !important;
}
.timetablePanels{
  flex:1 1 auto !important;
  min-height:0 !important;
  overflow:hidden !important;
}
.timetablePanel{
  min-height:0 !important;
  display:flex !important;
  flex-direction:column !important;
}
.timetablePanelHead{
  flex:0 0 auto !important;
}
.timetablePanel > .timetableTableWrap:first-of-type{
  flex:1 1 auto !important;
  min-height:0 !important;
  overflow-y:auto !important;
  overflow-x:hidden !important;
  max-height:calc(94vh - 310px) !important;
  scrollbar-width:thin;
  scrollbar-color:#4a82d9 #07162b;
}
.timetablePanel > .timetableTableWrap:first-of-type::-webkit-scrollbar{width:10px;}
.timetablePanel > .timetableTableWrap:first-of-type::-webkit-scrollbar-track{background:#07162b;border-left:1px solid #183d6d;}
.timetablePanel > .timetableTableWrap:first-of-type::-webkit-scrollbar-thumb{background:linear-gradient(180deg,#6da9ff,#245ebd);border-radius:8px;}
.timetableTable thead th{
  position:sticky !important;
  top:0 !important;
  z-index:5 !important;
}
.timetableFooterActions{
  position:relative !important;
  z-index:10 !important;
}

/* Betriebstag-Sortierung erfolgt per JavaScript: 03:15 bis 03:14 */


/* Scroll-Fix: Tabellenbereich scrollt, Kopf und Footer bleiben stehen */
.timetableTableWrap{
  flex:1 1 auto !important;
  min-height:0 !important;
  overflow-y:auto !important;
  overflow-x:hidden !important;
  max-height:none !important;
}
.timetablePanel{
  height:100% !important;
}


/* Übersicht importierte Fahrpläne */
.importedPlansBackdrop{
  position:fixed; inset:0; display:none; align-items:center; justify-content:center;
  background:rgba(3,10,24,.72); z-index:10020; padding:28px;
}
.importedPlansBackdrop.show{display:flex;}
.importedPlansDialog{
  width:min(1120px,96vw); max-height:86vh; display:flex; flex-direction:column;
  background:linear-gradient(180deg,#13233d,#0b1426); color:#eef6ff;
  border:1px solid rgba(118,169,255,.35); border-radius:18px;
  box-shadow:0 22px 70px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.08);
  overflow:hidden;
}
.importedPlansHead{
  display:flex; align-items:center; justify-content:space-between; gap:16px;
  padding:16px 18px; border-bottom:1px solid rgba(118,169,255,.22);
  background:linear-gradient(180deg,rgba(255,255,255,.08),rgba(255,255,255,.02));
}
.importedPlansHead strong{font-size:20px; letter-spacing:.2px;}
#importedPlansSub{opacity:.78; margin-left:6px; font-size:14px;}
#importedPlansCloseBtn{
  width:36px; height:36px; border-radius:10px; border:1px solid rgba(255,255,255,.18);
  background:rgba(255,255,255,.08); color:#fff; font-size:24px; line-height:1; cursor:pointer;
}
.importedPlansBody{padding:14px; overflow:auto;}
.importedPlansEmpty{padding:28px; text-align:center; opacity:.75;}
.importedPlansTable{width:100%; border-collapse:separate; border-spacing:0 8px; font-size:14px;}
.importedPlansTable th{font-weight:600; color:#a9c9ff; text-align:left; padding:0 10px 4px; white-space:nowrap;}
.importedPlansTable td{
  padding:10px; background:rgba(255,255,255,.055); border-top:1px solid rgba(255,255,255,.08); border-bottom:1px solid rgba(255,255,255,.08);
  vertical-align:middle;
}
.importedPlansTable tr td:first-child{border-left:1px solid rgba(255,255,255,.08); border-radius:10px 0 0 10px; color:#70b7ff; font-weight:600;}
.importedPlansTable tr td:last-child{border-right:1px solid rgba(255,255,255,.08); border-radius:0 10px 10px 0; white-space:nowrap;}
.importedPlansTable tr.active td{background:rgba(37,99,235,.24); border-color:rgba(96,165,250,.35);}
.importedPlansTable .fileCell{max-width:360px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.importedPlansUseBtn,.importedPlansDeleteBtn{
  border:1px solid rgba(255,255,255,.18); border-radius:10px; padding:7px 10px; margin-left:6px;
  background:linear-gradient(180deg,rgba(59,130,246,.9),rgba(29,78,216,.9)); color:#fff; cursor:pointer;
}
.importedPlansDeleteBtn{background:linear-gradient(180deg,rgba(185,28,28,.85),rgba(127,29,29,.85));}
.importedPlansDeleteBtn.confirm{
  min-width:132px;
  background:linear-gradient(180deg,rgba(239,68,68,.98),rgba(153,27,27,.98));
  box-shadow:0 0 0 2px rgba(248,113,113,.28);
}


/* Wagen im Gleisplan: Hauptnummer klar lesbar, Kuppelhinweise als kleine Randchips */
.rail .veh{
  height:26px !important;
  min-width:34px !important;
  border-radius:7px !important;
  overflow:visible !important;
  isolation:isolate;
}
.rail .veh .vehicle-main-number{
  position:absolute !important;
  left:50% !important;
  top:56% !important;
  transform:translate(-50%,-50%) !important;
  z-index:80 !important;
  max-width:calc(100% - 8px) !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
  white-space:nowrap !important;
  padding:0 3px !important;
  border-radius:4px !important;
  line-height:1.05 !important;
  letter-spacing:0 !important;
}
.rail .veh.dt4 .vehicle-main-number,
.rail .veh.dt46 .vehicle-main-number,
.rail .veh.dt5 .vehicle-main-number{
  background:rgba(255,255,255,.72);
  color:#05070b;
  text-shadow:none;
}
.rail .veh.status-anforderung .vehicle-main-number,
.rail .veh.status-defekt .vehicle-main-number,
.rail .veh.status-graffiti .vehicle-main-number,
.rail .veh.status-defekt_graffiti .vehicle-main-number,
.rail .veh.status-defekt-graffiti .vehicle-main-number,
.rail .veh.status-reserve .vehicle-main-number,
.rail .veh.work .vehicle-main-number{
  background:rgba(2,6,23,.34);
  color:#fff;
  text-shadow:0 1px 1px rgba(0,0,0,.65);
}
.rail .veh .couple-tag{
  top:-4px !important;
  height:12px !important;
  max-width:42% !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
  white-space:nowrap !important;
  padding:1px 5px 0 !important;
  border:1px solid rgba(255,255,255,.92) !important;
  border-radius:999px !important;
  font-size:9px !important;
  line-height:10px !important;
  z-index:60 !important;
  background:linear-gradient(180deg,#19386e,#08152c) !important;
  box-shadow:0 1px 3px rgba(0,0,0,.38) !important;
}
.rail .veh .couple-tag.left{
  left:3px !important;
  right:auto !important;
}
.rail .veh .couple-tag.right{
  right:3px !important;
  left:auto !important;
}
.rail .veh .frist-badge,
.rail .veh .cleaning-badge{
  position:absolute !important;
  right:3px !important;
  bottom:-4px !important;
  z-index:85 !important;
  transform:scale(.86);
  transform-origin:right bottom;
}
.rail .veh .cleaning-badge{
  bottom:-2px !important;
}


/* GH walkway markers like Farmsen */
.walk{
  width:10px !important;
  background:repeating-linear-gradient(
    45deg,
    #f5d000 0px,
    #f5d000 6px,
    #111 6px,
    #111 12px
  ) !important;
  border-left:1px solid #fff;
  border-right:1px solid #fff;
}

/* Verbesserte Gleisdarstellung: zwei Schienen, dezente Schwellen, klare Ebenen */
.rail{
  position:relative !important;
  isolation:isolate !important;
  border:1px solid #60718d !important;
  border-radius:10px !important;
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 18px,
      rgba(148,163,184,.24) 18px,
      rgba(148,163,184,.24) 21px,
      transparent 21px,
      transparent 39px
    ),
    linear-gradient(180deg,#172033 0%,#0f172a 48%,#0b1120 100%) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.18),
    inset 0 -1px 0 rgba(0,0,0,.52),
    0 1px 4px rgba(15,23,42,.22) !important;
}

.rail::before,
.rail::after{
  content:"" !important;
  position:absolute !important;
  left:9px !important;
  right:9px !important;
  height:3px !important;
  border-radius:999px !important;
  background:linear-gradient(180deg,#f8fafc 0%,#aab7c9 45%,#52627a 100%) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.7),
    inset 0 -1px 0 rgba(0,0,0,.36),
    0 1px 2px rgba(0,0,0,.28) !important;
  transform:none !important;
  z-index:1 !important;
  pointer-events:none !important;
}

.rail::before{top:calc(50% - 7px) !important;}
.rail::after{top:calc(50% + 5px) !important;}

.rail .veh{
  z-index:10 !important;
}

.rail .walk{
  z-index:32 !important;
  box-shadow:
    0 0 0 2px rgba(250,204,21,.20),
    0 0 8px rgba(250,204,21,.22) !important;
}

.rail .lock{
  z-index:36 !important;
  background:
    repeating-linear-gradient(
      45deg,
      rgba(220,38,38,.34) 0,
      rgba(220,38,38,.34) 8px,
      rgba(255,255,255,.13) 8px,
      rgba(255,255,255,.13) 16px
    ) !important;
  border:2px solid rgba(248,113,113,.95) !important;
  box-shadow:
    inset 0 0 0 1px rgba(127,29,29,.45),
    0 0 9px rgba(248,113,113,.18) !important;
  opacity:.74 !important;
}

.rail.dragover{
  outline:3px solid #60a5fa !important;
  outline-offset:2px !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.22),
    inset 0 -1px 0 rgba(0,0,0,.52),
    0 0 0 3px rgba(96,165,250,.22),
    0 1px 4px rgba(15,23,42,.22) !important;
}

/* Fenster lassen sich an der Kopfzeile verschieben; beim erneuten Öffnen starten sie wieder mittig. */
.dialogDragHandle{
  cursor:move !important;
  user-select:none !important;
}

.dialogDragHandle button,
.dialogDragHandle input,
.dialogDragHandle select,
.dialogDragHandle textarea,
.dialogDragHandle a{
  cursor:auto !important;
}

.is-dragging-dialog{
  cursor:move !important;
  opacity:.98;
  box-shadow:0 28px 78px rgba(0,0,0,.58) !important;
  z-index:31000 !important;
}

/* Ruhigeres, luftigeres Einstellungen-Menü */
.settingsMenu{
  min-width:240px !important;
  padding:10px !important;
  border-radius:14px !important;
  background:linear-gradient(180deg,#111827,#0b1220) !important;
  border:1px solid rgba(148,163,184,.42) !important;
  box-shadow:0 20px 52px rgba(0,0,0,.44) !important;
}

.settingsMenu::before{
  padding:10px 10px 11px !important;
  margin-bottom:9px !important;
  font-size:17px !important;
  line-height:1.15 !important;
  border-bottom:1px solid rgba(148,163,184,.28) !important;
}

.settingsMenu button{
  min-height:42px !important;
  margin:0 0 8px 0 !important;
  padding:10px 12px !important;
  border-radius:10px !important;
  border:1px solid rgba(203,213,225,.35) !important;
  background:linear-gradient(180deg,#475569,#263244) !important;
  color:#ffffff !important;
  font-size:14px !important;
  font-weight:900 !important;
  line-height:1.2 !important;
  text-align:left !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.30),
    0 2px 8px rgba(0,0,0,.20) !important;
}

.settingsMenu button:last-child{
  margin-bottom:0 !important;
}

.settingsMenu button:hover{
  background:linear-gradient(180deg,#5b6b80,#334155) !important;
  border-color:rgba(219,234,254,.62) !important;
}

/* Fahrplan als kompaktes Arbeitsfenster: Gleise bleiben sichtbar und bedienbar. */
.timetableBackdrop{
  align-items:flex-start !important;
  justify-content:flex-end !important;
  padding:58px 16px 14px !important;
  background:transparent !important;
  backdrop-filter:none !important;
  pointer-events:none !important;
}
.timetableBackdrop.show{display:flex !important;}
.timetableDialog{
  pointer-events:auto !important;
  width:clamp(620px,42vw,820px) !important;
  height:min(82vh,780px) !important;
  max-height:82vh !important;
  border-radius:10px !important;
  border-color:rgba(91,157,255,.55) !important;
  background:linear-gradient(180deg,rgba(6,19,38,.96),rgba(2,9,20,.94)) !important;
  box-shadow:0 18px 46px rgba(0,0,0,.52), inset 0 1px 0 rgba(255,255,255,.12) !important;
}
.timetableTopbar{
  height:40px !important;
  padding:0 12px !important;
}
.timetableTitle{
  font-size:18px !important;
  gap:8px !important;
}
.timetableTitleIcon{font-size:20px !important;}
.timetableWindowBtns{
  gap:10px !important;
  font-size:15px !important;
}
.timetableWindowBtns > span{display:none !important;}
.timetableBody{
  padding:8px !important;
  max-height:calc(82vh - 40px) !important;
}
.timetableControlBar{
  flex-wrap:wrap !important;
  gap:7px !important;
  margin-bottom:8px !important;
  padding:7px !important;
  border-radius:8px !important;
}
.timetableControlBar label{
  font-size:12px !important;
  gap:5px !important;
}
.timetableControlBar select{
  min-width:138px !important;
  height:28px !important;
  padding:0 7px !important;
  font-size:12px !important;
}
#timetableFolderBtn,
#timetableImportedPlansBtn{
  height:28px !important;
  padding:4px 8px !important;
  font-size:12px !important;
  border-radius:6px !important;
}
.timetableImportHint{display:none !important;}
.timetableActiveInfo{
  order:5 !important;
  max-width:100% !important;
  padding:4px 7px !important;
  font-size:11px !important;
  white-space:normal !important;
}
.timetableStatus{
  order:6 !important;
  min-width:0 !important;
  max-width:100% !important;
  padding:5px 8px !important;
  font-size:11px !important;
}
.timetablePanels{
  gap:8px !important;
}
.timetablePanel{
  border-radius:8px !important;
}
.timetablePanelHead{
  padding:7px 9px !important;
  gap:7px !important;
  border-bottom:1px solid rgba(31,143,255,.75) !important;
}
.timetableTrainIcon{
  width:34px !important;
  height:34px !important;
  font-size:0 !important;
  overflow:hidden !important;
  border-radius:8px !important;
  background:
    radial-gradient(circle at 50% 45%,rgba(96,165,250,.24),transparent 70%),
    linear-gradient(180deg,rgba(15,35,71,.95),rgba(7,20,43,.95)) !important;
  border:1px solid rgba(125,211,252,.72) !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.22),0 4px 10px rgba(0,0,0,.34) !important;
}
.timetableTrainIcon::before{
  content:"" !important;
  display:block !important;
  width:100% !important;
  height:100% !important;
  background:url("../assets/dt5-front.png") center center / 118% auto no-repeat !important;
}
.timetablePanelTitle{
  font-size:15px !important;
  line-height:1.05 !important;
}
.timetablePanelSub{
  font-size:11px !important;
  margin-top:1px !important;
}
.timetableTableWrap{
  padding:0 6px 6px !important;
}
.timetableTable{
  font-size:13px !important;
}
.timetableTable th{
  height:26px !important;
  padding:3px 4px !important;
  font-size:13px !important;
}
.timetableTable td{
  height:30px !important;
  padding:3px 4px !important;
  font-size:14px !important;
  line-height:1.15 !important;
}
.timetableTable th:nth-child(1),
.timetableTable td:nth-child(1){width:31% !important;}
.timetableTable th:nth-child(2),
.timetableTable td:nth-child(2){width:24% !important;}
.timetableTable th:nth-child(3),
.timetableTable td:nth-child(3){width:23% !important;}
.timetableTable th:nth-child(4),
.timetableTable td:nth-child(4){width:22% !important;}
.timetableAddBtn{
  height:27px !important;
  margin-top:5px !important;
  padding:4px 8px !important;
  font-size:12px !important;
  border-radius:6px !important;
}
.timetableFooterActions{
  gap:7px !important;
  margin-top:7px !important;
  padding-top:7px !important;
  box-shadow:0 -8px 16px rgba(2,9,20,.70) !important;
}
.timetableActionGroup{
  gap:6px !important;
  flex-wrap:wrap !important;
}
.timetableFooterActions button{
  min-width:0 !important;
  height:28px !important;
  padding:4px 8px !important;
  font-size:12px !important;
  border-radius:6px !important;
}
.timetablePanel > .timetableTableWrap:first-of-type{
  max-height:none !important;
}
@media (max-width:1200px){
  .timetableDialog{
    width:min(720px,72vw) !important;
  }
}
@media (max-width:850px){
  .timetableBackdrop{
    padding:8px !important;
    justify-content:center !important;
  }
  .timetableDialog{
    width:96vw !important;
    height:86vh !important;
    max-height:86vh !important;
  }
  .timetablePanels{
    grid-template-columns:1fr !important;
    overflow:auto !important;
  }
  .timetablePanel{min-height:320px !important;}
}

/* Optik-Upgrade: mehr Tiefe und klare Betriebsatmosphaere ohne die Lesbarkeit zu verlieren */
body{
  background:
    radial-gradient(circle at 18% 8%,rgba(37,99,235,.18),transparent 28%),
    radial-gradient(circle at 84% 18%,rgba(20,184,166,.10),transparent 26%),
    linear-gradient(180deg,#080d18 0%,#101827 52%,#0b111d 100%) !important;
}

header{
  background:
    linear-gradient(135deg,#06101f 0%,#10284a 58%,#123d56 100%) !important;
  border-bottom:1px solid rgba(125,211,252,.22) !important;
  box-shadow:0 8px 28px rgba(0,0,0,.34) !important;
}

main{
  background:
    linear-gradient(rgba(148,163,184,.035) 1px,transparent 1px),
    linear-gradient(90deg,rgba(148,163,184,.035) 1px,transparent 1px) !important;
  background-size:42px 42px !important;
}

.block{
  position:relative !important;
  border:1px solid rgba(125,211,252,.22) !important;
  background:
    linear-gradient(180deg,rgba(18,27,44,.98),rgba(9,15,26,.98)) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.08),
    0 14px 34px rgba(0,0,0,.28) !important;
}

.block::before{
  content:"" !important;
  position:absolute !important;
  inset:0 !important;
  pointer-events:none !important;
  border-radius:inherit !important;
  background:
    linear-gradient(90deg,rgba(56,189,248,.16),transparent 32%,transparent 68%,rgba(34,197,94,.09)),
    linear-gradient(180deg,rgba(255,255,255,.045),transparent 26%) !important;
  opacity:.85 !important;
  z-index:0 !important;
}

.block > *{
  position:relative !important;
  z-index:1 !important;
}

.block.primary{
  border-color:rgba(96,165,250,.36) !important;
}

.block.ot-top{
  border-color:rgba(250,204,21,.26) !important;
}

.block.gh-bottom{
  border-color:rgba(34,197,94,.28) !important;
}

.block-head{
  border-bottom:1px solid rgba(191,219,254,.42) !important;
  padding:5px 8px 7px !important;
  margin-bottom:5px !important;
  background:
    linear-gradient(90deg,rgba(59,130,246,.10),rgba(255,255,255,.025),rgba(20,184,166,.08)) !important;
  border-radius:8px 8px 3px 3px !important;
}

.block h2{
  color:#ffffff !important;
  font-size:19px !important;
  letter-spacing:0 !important;
  text-shadow:0 1px 0 #020617,0 0 12px rgba(96,165,250,.55) !important;
}

.dir{
  color:#bfdbfe !important;
  font-weight:800 !important;
}

.tracks{
  gap:5px !important;
}

.track{
  border-radius:10px !important;
  padding:2px 3px !important;
  background:linear-gradient(90deg,rgba(15,23,42,.24),rgba(30,41,59,.10),rgba(15,23,42,.18)) !important;
}

.track:hover{
  background:linear-gradient(90deg,rgba(30,64,175,.28),rgba(15,23,42,.10),rgba(13,148,136,.16)) !important;
}

.track-name{
  color:#eff6ff !important;
  border:1px solid rgba(147,197,253,.45) !important;
  background:
    radial-gradient(circle at 35% 20%,rgba(255,255,255,.28),transparent 34%),
    linear-gradient(180deg,#1f3b66,#0b1830 70%,#070d1a) !important;
  text-shadow:0 1px 2px #020617,0 0 7px rgba(96,165,250,.42) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.28),
    inset 0 -1px 0 rgba(0,0,0,.55),
    0 2px 8px rgba(15,23,42,.36) !important;
}

.track-len{
  color:#c7e9ff !important;
  border:1px solid rgba(96,165,250,.28) !important;
  background:
    linear-gradient(180deg,rgba(15,32,58,.95),rgba(7,13,25,.95)) !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.10) !important;
}

.summary{
  color:#a7f3d0 !important;
  font-weight:900 !important;
  text-shadow:0 0 8px rgba(34,197,94,.30) !important;
}

.rail{
  border-color:rgba(147,197,253,.42) !important;
  background:
    linear-gradient(90deg,rgba(56,189,248,.10) 0 1px,transparent 1px 100%),
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 18px,
      rgba(148,163,184,.31) 18px,
      rgba(148,163,184,.31) 21px,
      transparent 21px,
      transparent 39px
    ),
    radial-gradient(circle at 12% 50%,rgba(59,130,246,.18),transparent 28%),
    linear-gradient(180deg,#1b2a43 0%,#0d1525 48%,#080d17 100%) !important;
  background-size:13px 100%,auto,auto,auto !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.20),
    inset 0 -1px 0 rgba(0,0,0,.58),
    0 0 0 1px rgba(15,23,42,.70),
    0 4px 12px rgba(0,0,0,.24) !important;
}

.rail::before,
.rail::after{
  background:
    linear-gradient(180deg,#ffffff 0%,#d8e0ea 34%,#748399 100%) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.78),
    inset 0 -1px 0 rgba(0,0,0,.42),
    0 0 5px rgba(186,230,253,.22),
    0 1px 2px rgba(0,0,0,.34) !important;
}

.rail .veh{
  border-radius:8px !important;
  border:1px solid rgba(15,23,42,.78) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.82),
    inset 0 -10px 16px rgba(0,0,0,.16),
    0 2px 0 rgba(255,255,255,.10),
    0 6px 14px rgba(0,0,0,.34) !important;
}

.rail .veh.dt4,
.rail .veh.dt46,
.rail .veh.dt5{
  background:
    linear-gradient(180deg,#ffffff 0%,#edf2f7 42%,#cbd5e1 100%) !important;
  color:#020617 !important;
}

.rail .veh.status-defekt{
  background:
    linear-gradient(180deg,#ff8a80 0%,#ef2929 46%,#8f1111 100%) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.56),
    inset 0 -10px 16px rgba(0,0,0,.24),
    0 0 12px rgba(239,68,68,.30),
    0 6px 14px rgba(0,0,0,.34) !important;
}

.rail .veh.status-graffiti{
  background:
    linear-gradient(180deg,#f0abfc 0%,#c026d3 50%,#701a75 100%) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.58),
    inset 0 -10px 16px rgba(0,0,0,.24),
    0 0 12px rgba(217,70,239,.30),
    0 6px 14px rgba(0,0,0,.34) !important;
}

/* Fristfarben muessen auch nach dem Optik-Upgrade sichtbar bleiben */
.rail .veh.frist-heute-bba,
.rail .veh.bba-due:not(.status-defekt):not(.status-graffiti):not(.status-defekt_graffiti):not(.status-defekt-graffiti):not(.status-werkstatt):not(.status-reserve){
  background:
    linear-gradient(180deg,#fff9b8 0%,#facc15 48%,#b98500 100%) !important;
  color:#111827 !important;
  text-shadow:none !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.70),
    inset 0 -10px 16px rgba(120,83,0,.20),
    0 0 13px rgba(250,204,21,.32),
    0 6px 14px rgba(0,0,0,.34) !important;
}

.rail .veh.frist-heute-bfa,
.rail .veh.bfa-due-tomorrow:not(.status-defekt):not(.status-graffiti):not(.status-defekt_graffiti):not(.status-defekt-graffiti):not(.status-werkstatt):not(.status-reserve){
  background:
    linear-gradient(180deg,#bfdbfe 0%,#3b82f6 48%,#1d4ed8 100%) !important;
  color:#ffffff !important;
  text-shadow:0 1px 1px rgba(0,0,0,.55) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.60),
    inset 0 -10px 16px rgba(15,23,42,.22),
    0 0 13px rgba(59,130,246,.34),
    0 6px 14px rgba(0,0,0,.34) !important;
}

.rail .veh.frist-heute-bbi,
.rail .veh.bbi-due:not(.status-defekt):not(.status-graffiti):not(.status-defekt_graffiti):not(.status-defekt-graffiti):not(.status-werkstatt):not(.status-reserve){
  background:
    linear-gradient(180deg,#bbf7d0 0%,#22c55e 48%,#15803d 100%) !important;
  color:#052e16 !important;
  text-shadow:none !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.66),
    inset 0 -10px 16px rgba(5,46,22,.22),
    0 0 13px rgba(34,197,94,.32),
    0 6px 14px rgba(0,0,0,.34) !important;
}

.rail .veh.frist-heute-bba .vehicle-main-number,
.rail .veh.bba-due .vehicle-main-number,
.rail .veh.frist-heute-bbi .vehicle-main-number,
.rail .veh.bbi-due .vehicle-main-number{
  background:rgba(255,255,255,.72) !important;
  color:#020617 !important;
  text-shadow:none !important;
}

.rail .veh.frist-heute-bfa .vehicle-main-number,
.rail .veh.bfa-due-tomorrow .vehicle-main-number{
  background:rgba(2,6,23,.28) !important;
  color:#ffffff !important;
  text-shadow:0 1px 1px rgba(0,0,0,.55) !important;
}

/* Sonderstatus bleiben gegenueber der neutralen DT-Optik vorrangig sichtbar */
.rail .veh.status-anforderung{
  background:
    linear-gradient(180deg,#93c5fd 0%,#2563eb 48%,#1e3a8a 100%) !important;
  color:#ffffff !important;
  text-shadow:0 1px 1px rgba(0,0,0,.62) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.58),
    inset 0 -10px 16px rgba(15,23,42,.22),
    0 0 13px rgba(37,99,235,.34),
    0 6px 14px rgba(0,0,0,.34) !important;
}

.rail .veh.status-werkstatt{
  background:
    linear-gradient(180deg,#fbcfe8 0%,#f472d0 48%,#be3db5 100%) !important;
  color:#ffffff !important;
  text-shadow:0 1px 1px rgba(0,0,0,.66) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.65),
    inset 0 -10px 16px rgba(84,19,76,.22),
    0 0 13px rgba(244,114,208,.34),
    0 6px 14px rgba(0,0,0,.34) !important;
}

.rail .veh.status-reserve{
  background:
    linear-gradient(180deg,#cbd5e1 0%,#64748b 48%,#334155 100%) !important;
  color:#ffffff !important;
  text-shadow:0 1px 1px rgba(0,0,0,.70) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.56),
    inset 0 -10px 16px rgba(15,23,42,.25),
    0 0 10px rgba(148,163,184,.24),
    0 6px 14px rgba(0,0,0,.34) !important;
}

.rail .veh.status-defekt_graffiti,
.rail .veh.status-defekt-graffiti{
  background:
    linear-gradient(135deg,#dc2626 0%,#dc2626 48%,#7c3aed 52%,#7c3aed 100%) !important;
  color:#ffffff !important;
  text-shadow:0 1px 1px rgba(0,0,0,.72) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.58),
    inset 0 -10px 16px rgba(15,23,42,.24),
    0 0 13px rgba(220,38,38,.24),
    0 0 16px rgba(124,58,237,.22),
    0 6px 14px rgba(0,0,0,.34) !important;
}

.rail .veh.work{
  background:
    linear-gradient(180deg,#a7b7cc 0%,#64748b 50%,#334155 100%) !important;
  color:#ffffff !important;
  text-shadow:0 1px 1px rgba(0,0,0,.70) !important;
}

.rail .veh.status-anforderung .vehicle-main-number,
.rail .veh.status-werkstatt .vehicle-main-number,
.rail .veh.status-reserve .vehicle-main-number,
.rail .veh.status-defekt_graffiti .vehicle-main-number,
.rail .veh.status-defekt-graffiti .vehicle-main-number,
.rail .veh.work .vehicle-main-number{
  background:rgba(2,6,23,.30) !important;
  color:#ffffff !important;
  text-shadow:0 1px 1px rgba(0,0,0,.60) !important;
}

.rail .veh.selected{
  outline:2px solid #fde68a !important;
  outline-offset:2px !important;
  box-shadow:
    0 0 0 3px rgba(2,6,23,.95),
    0 0 18px rgba(250,204,21,.48),
    inset 0 1px 0 rgba(255,255,255,.82),
    inset 0 -10px 16px rgba(0,0,0,.16) !important;
}

.track-signal{
  filter:drop-shadow(0 0 6px rgba(96,165,250,.18)) !important;
}

.signal-head{
  border-color:rgba(148,163,184,.55) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.18),
    0 2px 7px rgba(0,0,0,.65) !important;
}

.track-signal.is-green .signal-lamp.green{
  box-shadow:0 0 12px #22c55e,0 0 22px rgba(34,197,94,.35) !important;
}

.track-signal.is-yellow .signal-lamp.yellow{
  box-shadow:0 0 12px #facc15,0 0 22px rgba(250,204,21,.35) !important;
}

.track-signal.is-red .signal-lamp.red{
  box-shadow:0 0 12px #ef4444,0 0 22px rgba(239,68,68,.35) !important;
}

/* Einsetzer aus dem Fahrplan im Gleisplan kenntlich machen */
.rail .veh.einsetzer{
  outline:2px solid #38bdf8 !important;
  outline-offset:2px !important;
  box-shadow:
    0 0 0 3px rgba(2,6,23,.92),
    0 0 18px rgba(56,189,248,.58),
    inset 0 1px 0 rgba(255,255,255,.78),
    inset 0 -10px 16px rgba(0,0,0,.18) !important;
}

.einsetzer-badge{
  position:absolute !important;
  left:7px !important;
  top:auto !important;
  bottom:1px !important;
  transform:none !important;
  z-index:90 !important;
  min-width:18px !important;
  height:16px !important;
  padding:1px 5px 0 !important;
  border-radius:999px !important;
  border:1px solid rgba(255,255,255,.92) !important;
  background:linear-gradient(180deg,#38bdf8,#0f5fa8) !important;
  color:#ffffff !important;
  font-size:11px !important;
  line-height:14px !important;
  font-weight:950 !important;
  text-align:center !important;
  text-shadow:0 1px 1px rgba(0,0,0,.65) !important;
  box-shadow:0 2px 6px rgba(0,0,0,.42),0 0 10px rgba(56,189,248,.34) !important;
  pointer-events:auto !important;
}

#timetableSortBtn{
  display:none !important;
}

.timetableFooterActions,
.timetableActionGroup{
  flex-wrap:nowrap !important;
  align-items:center !important;
}

/* Großhansdorf: Gleise dichter zur Mitte und Betriebsflächen wie in der Vorlage */
body.facility-vf-gh-ot .block.gh-bottom .tracks{
  position:relative !important;
  isolation:isolate !important;
  grid-template-rows:58px 58px !important;
  align-content:center !important;
  gap:64px !important;
  overflow:visible !important;
  padding:10px 0 18px !important;
}
body.facility-vf-gh-ot .block.gh-bottom .tracks::before{
  content:"" !important;
  position:absolute !important;
  inset:0 3.5% 0 7.5% !important;
  z-index:0 !important;
  pointer-events:none !important;
  opacity:.74 !important;
  background:
    repeating-linear-gradient(0deg,rgba(255,255,255,.11) 0 1px,transparent 1px 5px),
    repeating-linear-gradient(90deg,rgba(255,255,255,.11) 0 1px,transparent 1px 6px),
    linear-gradient(180deg,rgba(128,137,148,.70),rgba(128,137,148,.70)),

    repeating-linear-gradient(0deg,rgba(255,255,255,.11) 0 1px,transparent 1px 5px),
    repeating-linear-gradient(90deg,rgba(255,255,255,.11) 0 1px,transparent 1px 6px),
    linear-gradient(180deg,rgba(128,137,148,.70),rgba(128,137,148,.70)),

    repeating-linear-gradient(0deg,rgba(255,255,255,.11) 0 1px,transparent 1px 5px),
    repeating-linear-gradient(90deg,rgba(255,255,255,.11) 0 1px,transparent 1px 6px),
    linear-gradient(180deg,rgba(128,137,148,.70),rgba(128,137,148,.70)),

    repeating-linear-gradient(0deg,rgba(255,255,255,.11) 0 1px,transparent 1px 5px),
    repeating-linear-gradient(90deg,rgba(255,255,255,.11) 0 1px,transparent 1px 6px),
    linear-gradient(180deg,rgba(128,137,148,.70),rgba(128,137,148,.70)),

    repeating-linear-gradient(0deg,rgba(255,255,255,.11) 0 1px,transparent 1px 5px),
    repeating-linear-gradient(90deg,rgba(255,255,255,.11) 0 1px,transparent 1px 6px),
    linear-gradient(180deg,rgba(128,137,148,.70),rgba(128,137,148,.70)) !important;

  background-size:
    30% 18px,30% 18px,30% 18px,
    32% 18px,32% 18px,32% 18px,
    29.8% 36px,29.8% 36px,29.8% 36px,
    30% 18px,30% 18px,30% 18px,
    32% 18px,32% 18px,32% 18px !important;

  background-position:
    46% 24.5%,46% 24.5%,46% 24.5%,
    93% 24.5%,93% 24.5%,93% 24.5%,
    0% 49%,0% 49%,0% 49%,
    46% 73.5%,46% 73.5%,46% 73.5%,
    93% 73.5%,93% 73.5%,93% 73.5% !important;

  background-repeat:no-repeat !important;
  filter:drop-shadow(0 1px 2px rgba(0,0,0,.38)) !important;
}
body.facility-vf-gh-ot .block.gh-bottom .tracks::after{
  content:"" !important;
  position:absolute !important;
  left:15.5% !important;
  right:18.5% !important;
  top:49% !important;
  height:22% !important;
  transform:translateY(-50%) !important;
  z-index:0 !important;
  pointer-events:none !important;
  opacity:0 !important;
  background:
    linear-gradient(90deg,rgba(20,31,49,.50),rgba(28,41,63,.70),rgba(20,31,49,.48)) !important;
  box-shadow:0 0 18px rgba(15,23,42,.28) inset !important;
}
body.facility-vf-gh-ot .block.gh-bottom .track{
  position:relative !important;
  z-index:1 !important;
}

/* Fahrplan-Kopfleiste: Auswahl, Status und Import sauber gruppieren. */
.timetableControlBar{
  display:grid !important;
  grid-template-columns:minmax(220px,1fr) max-content !important;
  grid-template-rows:auto auto auto !important;
  align-items:center !important;
  column-gap:10px !important;
  row-gap:6px !important;
}
.timetableControlBar label{
  grid-column:1 !important;
  grid-row:1 !important;
  width:100% !important;
  min-width:0 !important;
}
.timetableControlBar select{
  width:100% !important;
}
.timetableActiveInfo{
  grid-column:1 !important;
  grid-row:2 !important;
  justify-self:start !important;
  order:initial !important;
  max-width:100% !important;
}
#timetableFolderBtn,
#timetableImportedPlansBtn{
  justify-self:end !important;
  min-width:0 !important;
}
#timetableFolderBtn{
  grid-column:2 !important;
  grid-row:1 !important;
  align-self:center !important;
}
#timetableImportedPlansBtn{
  grid-column:2 !important;
  grid-row:2 !important;
  align-self:center !important;
}
.timetableStatus{
  grid-column:1 / -1 !important;
  grid-row:3 !important;
  order:initial !important;
}
@media (max-width:850px){
  .timetableControlBar{
    grid-template-columns:1fr !important;
    grid-template-rows:auto auto auto auto auto !important;
  }
  .timetableControlBar label{grid-column:1 !important;grid-row:1 !important;}
  .timetableActiveInfo{grid-column:1 !important;grid-row:2 !important;}
  #timetableFolderBtn{grid-column:1 !important;grid-row:3 !important;}
  #timetableImportedPlansBtn{grid-column:1 !important;grid-row:4 !important;}
  .timetableStatus{grid-column:1 !important;grid-row:5 !important;}
  #timetableFolderBtn,
  #timetableImportedPlansBtn{
    justify-self:stretch !important;
    width:100% !important;
  }
}




/* FIX: Fahrplan-Button "+ Zeile hinzufügen" wieder vollständig sichtbar */
.timetablePanel > .timetableTableWrap:last-of-type{
  flex:0 0 auto !important;
  min-height:48px !important;
  height:48px !important;
  overflow:visible !important;
  padding:8px 6px 6px !important;
  margin-top:6px !important;
  background:linear-gradient(180deg,rgba(2,9,20,.18),rgba(2,9,20,.58)) !important;
  position:relative !important;
  z-index:8 !important;
}
.timetableAddBtn,
.timetableAddRowBtn{
  display:block !important;
  width:100% !important;
  height:32px !important;
  min-height:32px !important;
  line-height:16px !important;
  padding:6px 10px !important;
  margin:0 !important;
  overflow:hidden !important;
  white-space:nowrap !important;
  position:relative !important;
  z-index:9 !important;
}
.timetablePanel > .timetableTableWrap:first-of-type{
  padding-bottom:6px !important;
}
.timetableFooterActions{
  margin-top:8px !important;
  padding-top:8px !important;
}


/* FIX: Fahrplan-Zugziel-Spalte */
.timetableTable{
  table-layout:fixed !important;
}
.timetableTable col:nth-child(1){width:26% !important;}
.timetableTable col:nth-child(2){width:20% !important;}
.timetableTable col:nth-child(3){width:18% !important;}
.timetableTable col:nth-child(4){width:13% !important;}
.timetableTable col:nth-child(5){width:23% !important;}
.timetableTable th,
.timetableTable td{
  padding-left:4px !important;
  padding-right:4px !important;
  font-size:15px !important;
}
.timetableTable td[data-col$="Zugziel"]{
  font-weight:700 !important;
}


/* FIX: Fahrplanfenster breiter wegen Spalte Zugziel */
.timetableDialog{
  width:clamp(760px,88vw,1550px) !important;
}
.timetablePanels{
  gap:14px !important;
}
.timetablePanel{
  min-width:0 !important;
}
.timetableTable th,
.timetableTable td{
  font-size:15px !important;
}
.timetableTable col:nth-child(1){width:24% !important;}
.timetableTable col:nth-child(2){width:18% !important;}
.timetableTable col:nth-child(3){width:16% !important;}
.timetableTable col:nth-child(4){width:12% !important;}
.timetableTable col:nth-child(5){width:30% !important;}


/* ChatGPT adjustment: smaller draggable timetable */
.timetableDialog{width:min(1100px,72vw)!important;max-width:1100px!important;min-width:900px;position:absolute;right:20px;top:70px;}
.timetableTopbar{cursor:move;}

/* ChatGPT adjustment: kompaktere Fahrplantabellen, links und rechts identisch */
.timetableDialog{
  width:min(980px,64vw) !important;
  max-width:980px !important;
  min-width:780px !important;
  position:absolute !important;
  right:20px !important;
  top:70px !important;
}
.timetablePanels{
  gap:10px !important;
}
.timetablePanel{
  min-width:0 !important;
}
.timetableTable{
  table-layout:fixed !important;
}
.timetableTable col:nth-child(1){width:80px !important;}   /* ZN */
.timetableTable col:nth-child(2){width:65px !important;}   /* Zeit */
.timetableTable col:nth-child(3){width:55px !important;}   /* Typ */
.timetableTable col:nth-child(4){width:55px !important;}   /* Gl. */
.timetableTable col:nth-child(5){width:auto !important;}   /* Zugziel */
.timetableTable th,
.timetableTable td{
  padding-left:3px !important;
  padding-right:3px !important;
  font-size:14px !important;
}
.timetableTopbar{cursor:move !important;}


/* ChatGPT adjustment: noch kompaktere Spalten + echte Größenänderung */
.timetableDialog{
  width:860px !important;
  height:680px !important;
  max-width:calc(100vw - 30px) !important;
  max-height:calc(100vh - 30px) !important;
  min-width:min(700px, calc(100vw - 16px)) !important;
  min-height:min(500px, calc(100vh - 16px)) !important;

  resize:both !important;
  overflow:auto !important;

  position:absolute !important;
  right:20px !important;
  top:70px !important;
}
.timetableBody{
  height:calc(100% - 42px) !important;
  max-height:none !important;
  overflow:auto !important;
}
.timetablePanels{
  grid-template-columns:1fr 1fr !important;
  gap:8px !important;
}
.timetablePanel{
  min-width:0 !important;
}
.timetableTableWrap{
  overflow:auto !important;
}
.timetableTable{
  width:315px !important;
  min-width:315px !important;
  max-width:315px !important;
  table-layout:fixed !important;
  margin:0 auto !important;
}
.timetableTable col:nth-child(1){width:80px !important;}   /* ZN */
.timetableTable col:nth-child(2){width:60px !important;}   /* Zeit */
.timetableTable col:nth-child(3){width:50px !important;}   /* Typ */
.timetableTable col:nth-child(4){width:45px !important;}   /* Gl. */
.timetableTable col:nth-child(5){width:80px !important;}   /* Zugziel */
.timetableTable th,
.timetableTable td{
  padding-left:2px !important;
  padding-right:2px !important;
}
.timetableResizeHandle{
  position:absolute;
  z-index:30;
  background:transparent;
}
.timetableResizeRight{
  top:42px;
  right:0;
  width:8px;
  bottom:14px;
  cursor:ew-resize;
}
.timetableResizeBottom{
  left:0;
  right:14px;
  bottom:0;
  height:8px;
  cursor:ns-resize;
}
.timetableResizeCorner{
  right:0;
  bottom:0;
  width:18px;
  height:18px;
  cursor:nwse-resize;
}
.timetableResizeCorner::after{
  content:"";
  position:absolute;
  right:4px;
  bottom:4px;
  width:10px;
  height:10px;
  border-right:2px solid rgba(180,210,255,.75);
  border-bottom:2px solid rgba(180,210,255,.75);
  opacity:.75;
}

/* Stabile Fahrplan-Größe: rechts angedockt, klein/groß per Button statt Ziehen an der Ecke */
.timetableBackdrop{
  align-items:flex-start !important;
  justify-content:flex-start !important;
  padding:0 !important;
  background:transparent !important;
  backdrop-filter:none !important;
  pointer-events:none !important;
}
.timetableBackdrop.show{display:flex !important;}
.timetableDialog{
  pointer-events:auto !important;
  position:fixed !important;
  top:70px !important;
  right:auto !important;
  left:8px !important;
  bottom:auto !important;
  transform:none !important;
  margin:0 !important;
  width:860px !important;
  height:min(82vh,720px) !important;
  min-width:min(700px, calc(100vw - 16px)) !important;
  min-height:min(500px, calc(100vh - 16px)) !important;
  max-width:calc(100vw - 32px) !important;
  max-height:calc(100vh - 16px) !important;
  resize:none !important;
  overflow:hidden !important;
}
.timetableDialog.timetableLarge{
  width:min(1180px,92vw) !important;
  height:min(88vh,860px) !important;
}
.timetableDialog .timetableResizeHandle{
  display:block !important;
  position:absolute !important;
  z-index:50 !important;
  background:transparent !important;
  user-select:none !important;
}
.timetableResizeN,
.timetableResizeS{
  left:10px !important;
  right:10px !important;
  height:8px !important;
  cursor:ns-resize !important;
}
.timetableResizeN{top:0 !important;}
.timetableResizeS{bottom:0 !important;}
.timetableResizeE,
.timetableResizeW{
  top:10px !important;
  bottom:10px !important;
  width:8px !important;
  cursor:ew-resize !important;
}
.timetableResizeE{right:0 !important;}
.timetableResizeW{left:0 !important;}
.timetableResizeNE,
.timetableResizeSE,
.timetableResizeSW,
.timetableResizeNW{
  width:16px !important;
  height:16px !important;
}
.timetableResizeNE{top:0 !important;right:0 !important;cursor:nesw-resize !important;}
.timetableResizeSE{right:0 !important;bottom:0 !important;cursor:nwse-resize !important;}
.timetableResizeSW{left:0 !important;bottom:0 !important;cursor:nesw-resize !important;}
.timetableResizeNW{left:0 !important;top:0 !important;cursor:nwse-resize !important;}
.timetableResizeSE::after{
  content:"";
  position:absolute;
  right:4px;
  bottom:4px;
  width:10px;
  height:10px;
  border-right:2px solid rgba(180,210,255,.75);
  border-bottom:2px solid rgba(180,210,255,.75);
  opacity:.75;
}
.timetableTopbar{cursor:move !important;}
body.is-dragging-dialog,
body.is-dragging-dialog *{
  cursor:move !important;
  user-select:none !important;
}
body.is-resizing-dialog,
body.is-resizing-dialog *{
  user-select:none !important;
}


/* Fristen heute: nur die heutige Frist bekommt die kräftige Ortsfarbe.
   Morgen/übermorgen/überübermorgen bleiben unverändert. */
.rail .veh.frist-heute-bfa:not(.status-defekt):not(.status-graffiti):not(.status-defekt_graffiti):not(.status-defekt-graffiti):not(.status-werkstatt):not(.status-reserve){
  background:linear-gradient(180deg,#4aa3ff 0%,#1589ff 48%,#0066d6 100%) !important;
  color:#ffffff !important;
  text-shadow:0 1px 1px rgba(0,0,0,.55) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.62),
    inset 0 -10px 16px rgba(15,23,42,.22),
    0 0 14px rgba(21,137,255,.45),
    0 6px 14px rgba(0,0,0,.34) !important;
}
.rail .veh.frist-heute-bba:not(.status-defekt):not(.status-graffiti):not(.status-defekt_graffiti):not(.status-defekt-graffiti):not(.status-werkstatt):not(.status-reserve){
  background:linear-gradient(180deg,#fff36b 0%,#ffd400 48%,#c79a00 100%) !important;
  color:#111827 !important;
  text-shadow:none !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.72),
    inset 0 -10px 16px rgba(120,83,0,.22),
    0 0 14px rgba(255,212,0,.45),
    0 6px 14px rgba(0,0,0,.34) !important;
}
.rail .veh.frist-heute-bbi:not(.status-defekt):not(.status-graffiti):not(.status-defekt_graffiti):not(.status-defekt-graffiti):not(.status-werkstatt):not(.status-reserve){
  background:linear-gradient(180deg,#46e981 0%,#16b957 48%,#087b32 100%) !important;
  color:#ffffff !important;
  text-shadow:0 1px 1px rgba(0,0,0,.50) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.62),
    inset 0 -10px 16px rgba(5,46,22,.22),
    0 0 14px rgba(22,185,87,.45),
    0 6px 14px rgba(0,0,0,.34) !important;
}
.rail .veh.frist-heute-bfa .vehicle-main-number,
.rail .veh.frist-heute-bbi .vehicle-main-number{
  background:rgba(2,6,23,.26) !important;
  color:#ffffff !important;
  text-shadow:0 1px 1px rgba(0,0,0,.55) !important;
}
.rail .veh.frist-heute-bba .vehicle-main-number{
  background:rgba(255,255,255,.72) !important;
  color:#020617 !important;
  text-shadow:none !important;
}

/* FINAL: Fristenfarben klar getrennt
   Heute = kräftig/dunkel nach Ort; kommende Fristen = deutlich hell.
   Betrifft nur Fahrzeuge ohne höhere Priorität wie Defekt/Graffiti. */
.rail .veh.frist-heute-bfa:not(.status-defekt):not(.status-graffiti):not(.status-defekt_graffiti):not(.status-defekt-graffiti):not(.status-werkstatt):not(.status-reserve),
.veh.frist-heute-bfa:not(.status-defekt):not(.status-graffiti):not(.status-defekt_graffiti):not(.status-defekt-graffiti):not(.status-werkstatt):not(.status-reserve){
  background:linear-gradient(180deg,#2f7cff 0%,#145ee8 48%,#083f9f 100%) !important;
  color:#ffffff !important;
  text-shadow:0 1px 1px rgba(0,0,0,.60) !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.55),inset 0 -10px 16px rgba(15,23,42,.24),0 0 15px rgba(37,99,235,.55),0 6px 14px rgba(0,0,0,.34) !important;
}
.rail .veh.frist-heute-bba:not(.status-defekt):not(.status-graffiti):not(.status-defekt_graffiti):not(.status-defekt-graffiti):not(.status-werkstatt):not(.status-reserve),
.veh.frist-heute-bba:not(.status-defekt):not(.status-graffiti):not(.status-defekt_graffiti):not(.status-defekt-graffiti):not(.status-werkstatt):not(.status-reserve){
  background:linear-gradient(180deg,#ffe34d 0%,#facc15 48%,#b78300 100%) !important;
  color:#111827 !important;
  text-shadow:none !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.72),inset 0 -10px 16px rgba(120,83,0,.22),0 0 15px rgba(250,204,21,.58),0 6px 14px rgba(0,0,0,.34) !important;
}
.rail .veh.frist-heute-bbi:not(.status-defekt):not(.status-graffiti):not(.status-defekt_graffiti):not(.status-defekt-graffiti):not(.status-werkstatt):not(.status-reserve),
.veh.frist-heute-bbi:not(.status-defekt):not(.status-graffiti):not(.status-defekt_graffiti):not(.status-defekt-graffiti):not(.status-werkstatt):not(.status-reserve){
  background:linear-gradient(180deg,#31d76a 0%,#16a34a 48%,#08712f 100%) !important;
  color:#ffffff !important;
  text-shadow:0 1px 1px rgba(0,0,0,.58) !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.55),inset 0 -10px 16px rgba(5,46,22,.22),0 0 15px rgba(22,163,74,.55),0 6px 14px rgba(0,0,0,.34) !important;
}

/* Morgen/übermorgen/überübermorgen: absichtlich viel heller als heute */
.rail .veh.bfa-due-tomorrow:not(.frist-heute-bfa):not(.status-defekt):not(.status-graffiti):not(.status-defekt_graffiti):not(.status-defekt-graffiti):not(.status-werkstatt):not(.status-reserve),
.veh.bfa-due-tomorrow:not(.frist-heute-bfa):not(.status-defekt):not(.status-graffiti):not(.status-defekt_graffiti):not(.status-defekt-graffiti):not(.status-werkstatt):not(.status-reserve){
  background:linear-gradient(180deg,#dbeafe 0%,#bfdbfe 55%,#93c5fd 100%) !important;
  color:#0f172a !important;
  text-shadow:none !important;
}
.rail .veh.bba-due:not(.frist-heute-bba):not(.status-defekt):not(.status-graffiti):not(.status-defekt_graffiti):not(.status-defekt-graffiti):not(.status-werkstatt):not(.status-reserve),
.veh.bba-due:not(.frist-heute-bba):not(.status-defekt):not(.status-graffiti):not(.status-defekt_graffiti):not(.status-defekt-graffiti):not(.status-werkstatt):not(.status-reserve){
  background:linear-gradient(180deg,#fffde7 0%,#fef3c7 55%,#fde68a 100%) !important;
  color:#111827 !important;
  text-shadow:none !important;
}
.rail .veh.bbi-due:not(.frist-heute-bbi):not(.status-defekt):not(.status-graffiti):not(.status-defekt_graffiti):not(.status-defekt-graffiti):not(.status-werkstatt):not(.status-reserve),
.veh.bbi-due:not(.frist-heute-bbi):not(.status-defekt):not(.status-graffiti):not(.status-defekt_graffiti):not(.status-defekt-graffiti):not(.status-werkstatt):not(.status-reserve){
  background:linear-gradient(180deg,#ecfdf5 0%,#bbf7d0 55%,#86efac 100%) !important;
  color:#052e16 !important;
  text-shadow:none !important;
}

.rail .veh.frist-heute-bfa .vehicle-main-number,
.rail .veh.frist-heute-bbi .vehicle-main-number,
.veh.frist-heute-bfa .vehicle-main-number,
.veh.frist-heute-bbi .vehicle-main-number{
  background:rgba(2,6,23,.30) !important;
  color:#ffffff !important;
  text-shadow:0 1px 1px rgba(0,0,0,.60) !important;
}
.rail .veh.frist-heute-bba .vehicle-main-number,
.veh.frist-heute-bba .vehicle-main-number,
.rail .veh.bfa-due-tomorrow .vehicle-main-number,
.veh.bfa-due-tomorrow .vehicle-main-number,
.rail .veh.bba-due .vehicle-main-number,
.veh.bba-due .vehicle-main-number,
.rail .veh.bbi-due .vehicle-main-number,
.veh.bbi-due .vehicle-main-number{
  background:rgba(255,255,255,.74) !important;
  color:#020617 !important;
  text-shadow:none !important;
}

/* FINAL OVERRIDE 24.06.2026: dezente Gleisdarstellung
   Die frühere dominante Darstellung mit hellen Doppelschienen,
   vielen Schwellen und starkem Leuchteffekt wird hier am Ende
   der CSS-Kette überschrieben. */
.rail{
  border:1px solid rgba(148,163,184,.38) !important;
  border-radius:8px !important;
  background:linear-gradient(180deg,#151f32 0%,#0f172a 52%,#0b1120 100%) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.10),
    inset 0 -1px 0 rgba(0,0,0,.42) !important;
  overflow:hidden !important;
}
.rail::before{
  content:"" !important;
  position:absolute !important;
  left:10px !important;
  right:10px !important;
  top:50% !important;
  height:2px !important;
  transform:translateY(-50%) !important;
  border-radius:999px !important;
  background:rgba(203,213,225,.72) !important;
  box-shadow:none !important;
  z-index:1 !important;
  pointer-events:none !important;
}
.rail::after{
  content:"" !important;
  position:absolute !important;
  left:10px !important;
  right:10px !important;
  top:calc(50% + 6px) !important;
  height:1px !important;
  border-radius:999px !important;
  background:rgba(148,163,184,.30) !important;
  box-shadow:none !important;
  z-index:1 !important;
  pointer-events:none !important;
}
.rail .veh{
  z-index:10 !important;
}


/* UPDATE: Fahrplan Kompakt / Leitstellenansicht für zweiten Monitor
   Leitstelle: SG1 und SG2 bleiben direkt nebeneinander, aber deutlich größer und ruhiger. */
.timetableViewToggle{
  border:1px solid rgba(125,211,252,.38) !important;
  background:linear-gradient(180deg,rgba(14,116,144,.42),rgba(15,23,42,.78)) !important;
  color:#e0f2fe !important;
  border-radius:10px !important;
  padding:8px 12px !important;
  font-weight:700 !important;
  white-space:nowrap !important;
}
.timetableViewToggle[aria-pressed="true"]{
  box-shadow:0 0 0 1px rgba(56,189,248,.28),0 0 16px rgba(14,165,233,.16) !important;
}

.timetableDialog.timetableLeitstelle{
  width:min(1700px, calc(100vw - 20px)) !important;
  height:min(950px, calc(100vh - 20px)) !important;
  max-width:calc(100vw - 20px) !important;
  max-height:calc(100vh - 20px) !important;
}
.timetableDialog.timetableLeitstelle .timetableBody{
  height:calc(100% - 48px) !important;
}
.timetableDialog.timetableLeitstelle .timetableControlBar{
  min-height:54px !important;
  gap:10px !important;
  padding:10px 12px !important;
  font-size:15px !important;
}
.timetableDialog.timetableLeitstelle .timetableControlBar select,
.timetableDialog.timetableLeitstelle .timetableControlBar button{
  font-size:15px !important;
  min-height:38px !important;
}
.timetableDialog.timetableLeitstelle .timetablePanels{
  grid-template-columns:minmax(0, 1fr) minmax(0, 1fr) !important;
  gap:8px !important;
  height:calc(100% - 120px) !important;
}
.timetableDialog.timetableLeitstelle .timetablePanel{
  min-width:0 !important;
}
.timetableDialog.timetableLeitstelle .timetablePanelHead{
  min-height:58px !important;
  padding:11px 14px !important;
}
.timetableDialog.timetableLeitstelle .timetablePanelTitle{
  font-size:18px !important;
}
.timetableDialog.timetableLeitstelle .timetablePanelSub{
  font-size:15px !important;
}
.timetableDialog.timetableLeitstelle .timetableTableWrap{
  overflow:auto !important;
}
.timetableDialog.timetableLeitstelle .timetableTable{
  width:100% !important;
  min-width:650px !important;
  max-width:none !important;
  margin:0 !important;
  table-layout:fixed !important;
}
.timetableDialog.timetableLeitstelle .timetableTable col:nth-child(1){width:110px !important;} /* ZN */
.timetableDialog.timetableLeitstelle .timetableTable col:nth-child(2){width:90px !important;}  /* Zeit */
.timetableDialog.timetableLeitstelle .timetableTable col:nth-child(3){width:80px !important;}  /* Typ */
.timetableDialog.timetableLeitstelle .timetableTable col:nth-child(4){width:70px !important;}  /* Gl. */
.timetableDialog.timetableLeitstelle .timetableTable col:nth-child(5){width:auto !important;}  /* Zugziel */
.timetableDialog.timetableLeitstelle .timetableTable th,
.timetableDialog.timetableLeitstelle .timetableTable td{
  font-size:17px !important;
  line-height:22px !important;
  height:36px !important;
  min-height:36px !important;
  padding:7px 8px !important;
}
.timetableDialog.timetableLeitstelle .timetableTable th{
  height:40px !important;
  font-size:16px !important;
}
.timetableDialog.timetableLeitstelle .timetableTable td[data-col$="Gl"],
.timetableDialog.timetableLeitstelle .timetableTable td[data-col$="Zugziel"]{
  font-weight:700 !important;
}
.timetableDialog.timetableLeitstelle .timetableAddBtn{
  height:38px !important;
  min-height:38px !important;
  font-size:15px !important;
}
.timetableDialog.timetableLeitstelle .timetableFooterActions{
  min-height:54px !important;
  padding:10px 12px !important;
}
.timetableDialog.timetableLeitstelle .timetableFooterActions button{
  min-height:38px !important;
  font-size:15px !important;
}

/* Standalone-Fahrplan: nutzt das komplette Fenster, das per Button mit 1700 x 950 geöffnet wird. */
body.timetableStandalone .timetableDialog.timetableLeitstelle{
  width:100vw !important;
  height:100vh !important;
  max-width:none !important;
  max-height:none !important;
}
body.timetableStandalone .timetableDialog.timetableLeitstelle .timetablePanels{
  height:calc(100vh - 190px) !important;
}


/* UPDATE: Fahrplan-Kopfbereich aufgeräumt, Leitstellenansicht fest aktiv */
.timetableViewToggle,
#timetableViewToggleBtn,
.timetableActiveInfo,
.timetableImportHint{
  display:none !important;
}

.timetableDialog.timetableLeitstelle .timetableTopbar{
  height:52px !important;
  padding:0 18px !important;
  background:linear-gradient(180deg,#0a2a5e 0%,#061d42 58%,#031126 100%) !important;
}
.timetableDialog.timetableLeitstelle .timetableTitle{
  font-size:20px !important;
  font-weight:800 !important;
  gap:12px !important;
}
.timetableDialog.timetableLeitstelle .timetableTitleIcon{
  font-size:22px !important;
}

.timetableDialog.timetableLeitstelle .timetableControlBar{
  display:grid !important;
  grid-template-columns:auto minmax(360px,1fr) auto auto minmax(180px,auto) !important;
  align-items:center !important;
  column-gap:10px !important;
  row-gap:6px !important;
  min-height:50px !important;
  padding:8px 12px !important;
  margin-bottom:8px !important;
}
.timetableDialog.timetableLeitstelle .timetableControlBar label{
  display:contents !important;
}
.timetableDialog.timetableLeitstelle .timetableControlBar label::before{
  content:'Fahrplan' !important;
  color:#cfe6ff !important;
  font-size:15px !important;
  font-weight:800 !important;
  padding-right:2px !important;
}
.timetableDialog.timetableLeitstelle #timetablePlanSelect{
  min-width:0 !important;
  width:100% !important;
  height:38px !important;
  font-size:15px !important;
}
.timetableDialog.timetableLeitstelle #timetableFolderBtn,
.timetableDialog.timetableLeitstelle #timetableImportedPlansBtn{
  height:38px !important;
  min-height:38px !important;
  white-space:nowrap !important;
}
.timetableDialog.timetableLeitstelle .timetableStatus{
  justify-self:end !important;
  min-width:0 !important;
  max-width:260px !important;
}

.timetableDialog.timetableLeitstelle .timetablePanels{
  height:calc(100% - 112px) !important;
}
body.timetableStandalone .timetableDialog.timetableLeitstelle .timetablePanels{
  height:calc(100vh - 176px) !important;
}

.timetableDialog.timetableLeitstelle .timetableFooterActions{
  display:flex !important;
  justify-content:space-between !important;
  align-items:center !important;
}
.timetableDialog.timetableLeitstelle .timetableFooterActions .timetableActionGroup:last-child{
  margin-left:auto !important;
}
.timetableDialog.timetableLeitstelle #timetableCloseBtn{
  min-width:112px !important;
  height:38px !important;
  font-size:15px !important;
  font-weight:800 !important;
  border-radius:10px !important;
  border:1px solid rgba(148,163,184,.70) !important;
  color:#fff !important;
  background:linear-gradient(180deg,#a8b3c5 0%,#64748b 48%,#334155 49%,#1e293b 100%) !important;
  box-shadow:inset 0 2px 0 rgba(255,255,255,.45),0 4px 12px rgba(0,0,0,.45) !important;
  text-shadow:0 -1px 0 rgba(0,0,0,.55) !important;
}

body.timetableStandalone #timetableCloseBtn{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  font-size:15px!important;
  min-width:112px!important;
  height:38px!important;
}
body.timetableStandalone #timetableCloseBtn::before{
  content:none!important;
}

@media (max-width:1100px){
  .timetableDialog.timetableLeitstelle .timetableControlBar{
    grid-template-columns:auto minmax(260px,1fr) auto auto !important;
  }
  .timetableDialog.timetableLeitstelle .timetableStatus{
    grid-column:1 / -1 !important;
    justify-self:start !important;
  }
}


/* UPDATE: Fahrplan Kopfzeile + neue Spalte Standort */
.timetableDialog.timetableLeitstelle .timetableControlBar{
  display:grid !important;
  grid-template-columns:auto auto auto minmax(360px, 1fr) !important;
  align-items:center !important;
  gap:10px !important;
}
.timetableDialog.timetableLeitstelle #timetableFolderBtn,
.timetableDialog.timetableLeitstelle #timetableImportedPlansBtn{
  grid-row:1 !important;
  justify-self:start !important;
  min-width:190px !important;
}
.timetableDialog.timetableLeitstelle #timetableFolderBtn{ grid-column:2 !important; }
.timetableDialog.timetableLeitstelle #timetableImportedPlansBtn{ grid-column:3 !important; }
.timetableDialog.timetableLeitstelle .timetableControlBar label{
  grid-column:1 / -1 !important;
  grid-row:1 !important;
  display:grid !important;
  grid-template-columns:auto minmax(360px, 1fr) !important;
  align-items:center !important;
  gap:10px !important;
  max-width:720px !important;
  margin-left:auto !important;
}
.timetableDialog.timetableLeitstelle .timetableControlBar label::before{ content:none !important; }
.timetableDialog.timetableLeitstelle .timetableControlBar label select{ width:100% !important; }
.timetableDialog.timetableLeitstelle .timetableStatus{ display:none !important; }

.timetableDialog.timetableLeitstelle .timetableTable{ min-width:760px !important; }
.timetableDialog.timetableLeitstelle .timetableTable col:nth-child(1){width:105px !important;} /* ZN */
.timetableDialog.timetableLeitstelle .timetableTable col:nth-child(2){width:90px !important;}  /* Zeit */
.timetableDialog.timetableLeitstelle .timetableTable col:nth-child(3){width:80px !important;}  /* Typ */
.timetableDialog.timetableLeitstelle .timetableTable col:nth-child(4){width:80px !important;}  /* Gleis */
.timetableDialog.timetableLeitstelle .timetableTable col:nth-child(5){width:120px !important;} /* Standort */
.timetableDialog.timetableLeitstelle .timetableTable col:nth-child(6){width:auto !important;} /* Zugziel */
.timetableDialog.timetableLeitstelle .timetableTable td[data-col$="Gl"],
.timetableDialog.timetableLeitstelle .timetableTable td[data-col$="Standort"],
.timetableDialog.timetableLeitstelle .timetableTable td[data-col$="Zugziel"]{
  font-weight:700 !important;
}

@media (max-width:1250px){
  .timetableDialog.timetableLeitstelle .timetableControlBar{
    grid-template-columns:auto auto !important;
  }
  .timetableDialog.timetableLeitstelle .timetableControlBar label{
    grid-column:1 / -1 !important;
    grid-row:2 !important;
    margin-left:0 !important;
    max-width:none !important;
  }
  .timetableDialog.timetableLeitstelle #timetableFolderBtn{ grid-column:1 !important; }
  .timetableDialog.timetableLeitstelle #timetableImportedPlansBtn{ grid-column:2 !important; }
}


/* FINAL: Kopfzeile klar nebeneinander: Einlesen | Importierte | Fahrplanauswahl */
.timetableDialog.timetableLeitstelle .timetableControlBar{
  grid-template-columns:auto auto minmax(420px, 1fr) !important;
}
.timetableDialog.timetableLeitstelle #timetableFolderBtn{ grid-column:1 !important; grid-row:1 !important; }
.timetableDialog.timetableLeitstelle #timetableImportedPlansBtn{ grid-column:2 !important; grid-row:1 !important; }
.timetableDialog.timetableLeitstelle .timetableControlBar label{
  grid-column:3 !important;
  grid-row:1 !important;
  display:grid !important;
  grid-template-columns:auto minmax(300px,1fr) !important;
  margin-left:0 !important;
  max-width:none !important;
  min-width:0 !important;
}
@media (max-width:1250px){
  .timetableDialog.timetableLeitstelle .timetableControlBar{
    grid-template-columns:auto auto !important;
  }
  .timetableDialog.timetableLeitstelle .timetableControlBar label{
    grid-column:1 / -1 !important;
    grid-row:2 !important;
  }
}


/* Update: Fahrplan-Kopfbereich sauber ausrichten (Fahrplan + Betriebstag) */
.timetableControlBarClean{
  display:grid !important;
  grid-template-columns:minmax(0,1fr) auto !important;
  align-items:start !important;
  gap:14px 18px !important;
  padding:12px 14px !important;
}
.timetableControlRows{
  display:grid !important;
  grid-template-columns:1fr !important;
  gap:8px !important;
  min-width:0 !important;
}
.timetableControlRow{
  display:grid !important;
  grid-template-columns:128px minmax(320px,1fr) !important;
  align-items:center !important;
  gap:12px !important;
  width:100% !important;
  min-width:0 !important;
  margin:0 !important;
}
.timetableControlLabel{
  display:block !important;
  color:#cfe6ff !important;
  font-size:16px !important;
  font-weight:700 !important;
  white-space:nowrap !important;
  line-height:1 !important;
}
.timetableControlBarClean select{
  width:100% !important;
  min-width:0 !important;
  height:42px !important;
  font-size:16px !important;
}
.timetableControlButtons{
  display:flex !important;
  align-items:flex-start !important;
  justify-content:flex-end !important;
  gap:10px !important;
  flex-wrap:nowrap !important;
  white-space:nowrap !important;
}
.timetableControlButtons button{
  height:42px !important;
  white-space:nowrap !important;
}
.timetableOperatingDateInfo{
  grid-column:1 / -1 !important;
}
@media (max-width:1100px){
  .timetableControlBarClean{grid-template-columns:1fr !important;}
  .timetableControlButtons{justify-content:flex-start !important; flex-wrap:wrap !important;}
}
@media (max-width:700px){
  .timetableControlRow{grid-template-columns:1fr !important; gap:6px !important;}
}
@media print{
  .timetableControlBarClean{display:none!important;}
}

/* FIX FINAL: Kopfbereich Fahrplan/Betriebstag darf nicht von alten Label-Regeln überlagert werden */
.timetableDialog.timetableLeitstelle .timetableControlBarClean{
  display:grid !important;
  grid-template-columns:minmax(0,1fr) auto !important;
  align-items:start !important;
  gap:14px 18px !important;
}
.timetableDialog.timetableLeitstelle .timetableControlBarClean .timetableControlRows{
  display:grid !important;
  grid-template-columns:minmax(0,1fr) !important;
  gap:10px !important;
  min-width:0 !important;
}
.timetableDialog.timetableLeitstelle .timetableControlBarClean .timetableControlRow{
  display:grid !important;
  grid-template-columns:130px minmax(360px,1fr) !important;
  align-items:center !important;
  gap:14px !important;
  width:100% !important;
  min-width:0 !important;
  margin:0 !important;
  max-width:none !important;
  grid-column:auto !important;
  grid-row:auto !important;
}
.timetableDialog.timetableLeitstelle .timetableControlBarClean .timetableControlLabel{
  display:block !important;
  width:130px !important;
  min-width:130px !important;
  max-width:130px !important;
  overflow:visible !important;
  white-space:nowrap !important;
  color:#cfe6ff !important;
  font-size:16px !important;
  font-weight:700 !important;
  line-height:1.2 !important;
  grid-column:auto !important;
  grid-row:auto !important;
}
.timetableDialog.timetableLeitstelle .timetableControlBarClean .timetableControlRow select{
  grid-column:2 !important;
  grid-row:auto !important;
  width:100% !important;
  min-width:0 !important;
  max-width:none !important;
}
.timetableDialog.timetableLeitstelle .timetableControlBarClean .timetableControlButtons{
  display:flex !important;
  flex-direction:row !important;
  align-items:flex-start !important;
  justify-content:flex-end !important;
  gap:10px !important;
  flex-wrap:nowrap !important;
  white-space:nowrap !important;
}
@media (max-width:1250px){
  .timetableDialog.timetableLeitstelle .timetableControlBarClean{
    grid-template-columns:1fr !important;
  }
  .timetableDialog.timetableLeitstelle .timetableControlBarClean .timetableControlButtons{
    justify-content:flex-start !important;
  }
}


/* Update: Betriebstag-Auswahl farblich unterscheiden */
#timetableDayModeSelect.daymode-current{
  background: linear-gradient(180deg, #0f315c 0%, #0a2548 100%) !important;
  color:#ffffff !important;
  border-color:#2f6fa8 !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 0 0 1px rgba(47,111,168,.18) !important;
}
#timetableDayModeSelect.daymode-next{
  background: linear-gradient(180deg, #7a5818 0%, #4f370d 100%) !important;
  color:#ffffff !important;
  border-color:#d29a2e !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16), 0 0 0 1px rgba(210,154,46,.25) !important;
}
#timetableDayModeSelect.daymode-current option,
#timetableDayModeSelect.daymode-next option{
  background:#0b1d2d !important;
  color:#ffffff !important;
}

/* Update: Fahrplanfenster ca. 20 Prozent kompakter */
.timetableDialog.timetableLeitstelle{
  width:min(1360px, calc(100vw - 16px)) !important;
  height:min(760px, calc(100vh - 16px)) !important;
  max-width:calc(100vw - 16px) !important;
  max-height:calc(100vh - 16px) !important;
}
.timetableDialog.timetableLeitstelle .timetableTopbar{
  height:42px !important;
  padding:0 14px !important;
}
.timetableDialog.timetableLeitstelle .timetableTitle{
  font-size:16px !important;
  gap:10px !important;
}
.timetableDialog.timetableLeitstelle .timetableTitleIcon{
  font-size:18px !important;
}
.timetableDialog.timetableLeitstelle .timetableBody{
  height:calc(100% - 42px) !important;
}
.timetableDialog.timetableLeitstelle .timetableControlBarClean{
  gap:11px 14px !important;
  padding:6px 10px !important;
}
.timetableDialog.timetableLeitstelle .timetableControlBarClean .timetableControlRows{
  gap:8px !important;
}
.timetableDialog.timetableLeitstelle .timetableControlBarClean .timetableControlRow{
  grid-template-columns:104px minmax(290px,1fr) !important;
  gap:11px !important;
}
.timetableDialog.timetableLeitstelle .timetableControlBarClean .timetableControlLabel{
  width:104px !important;
  min-width:104px !important;
  max-width:104px !important;
  font-size:13px !important;
}
.timetableDialog.timetableLeitstelle .timetableControlBarClean .timetableControlRow select,
.timetableDialog.timetableLeitstelle .timetableControlButtons button{
  height:34px !important;
  min-height:34px !important;
  font-size:13px !important;
}
.timetableDialog.timetableLeitstelle .timetableControlButtons{
  gap:8px !important;
}
.timetableDialog.timetableLeitstelle .timetablePanels{
  gap:6px !important;
  height:calc(100% - 92px) !important;
}
.timetableDialog.timetableLeitstelle .timetablePanelHead{
  min-height:46px !important;
  padding:9px 11px !important;
}
.timetableDialog.timetableLeitstelle .timetableTrainIcon{
  width:27px !important;
  height:27px !important;
  font-size:15px !important;
}
.timetableDialog.timetableLeitstelle .timetablePanelTitle{
  font-size:14px !important;
}
.timetableDialog.timetableLeitstelle .timetablePanelSub{
  font-size:12px !important;
}
.timetableDialog.timetableLeitstelle .timetableTable{
  min-width:610px !important;
}
.timetableDialog.timetableLeitstelle .timetableTable th,
.timetableDialog.timetableLeitstelle .timetableTable td{
  font-size:14px !important;
  line-height:18px !important;
  height:29px !important;
  min-height:29px !important;
  padding:5px 6px !important;
}
.timetableDialog.timetableLeitstelle .timetableTable th{
  height:32px !important;
  font-size:13px !important;
}

.timetableDialog.timetableLeitstelle .timetableTable.timetableVfGhOtTable{
  min-width:760px !important;
}
.timetableDialog.timetableLeitstelle .timetableTable.timetableVfGhOtTable col:nth-child(1){width:132px !important;} /* Bereich */
.timetableDialog.timetableLeitstelle .timetableTable.timetableVfGhOtTable col:nth-child(2){width:84px !important;}  /* ZN */
.timetableDialog.timetableLeitstelle .timetableTable.timetableVfGhOtTable col:nth-child(3){width:70px !important;}  /* Zeit */
.timetableDialog.timetableLeitstelle .timetableTable.timetableVfGhOtTable col:nth-child(4){width:58px !important;}  /* Typ */
.timetableDialog.timetableLeitstelle .timetableTable.timetableVfGhOtTable col:nth-child(5){width:54px !important;}  /* Gleis */
.timetableDialog.timetableLeitstelle .timetableTable.timetableVfGhOtTable col:nth-child(6){width:90px !important;}  /* Standort */
.timetableDialog.timetableLeitstelle .timetableTable.timetableVfGhOtTable col:nth-child(7){width:auto !important;} /* Zugziel */
.timetableDialog.timetableLeitstelle .timetableTable.timetableVfGhOtTable .timetableAreaCell{
  color:#a9dcff !important;
  font-weight:800 !important;
  text-align:left !important;
  padding-left:8px !important;
  white-space:nowrap !important;
  background:rgba(14,46,78,.78) !important;
}

.timetableDialog.timetableLeitstelle .timetableAddBtn,
.timetableDialog.timetableLeitstelle .timetableFooterActions button,
.timetableDialog.timetableLeitstelle #timetableCloseBtn{
  min-height:30px !important;
  height:30px !important;
  font-size:12px !important;
}
.timetableDialog.timetableLeitstelle .timetableFooterActions{
  min-height:43px !important;
  padding:8px 10px !important;
}
body.timetableStandalone .timetableDialog.timetableLeitstelle .timetablePanels{
  height:calc(100vh - 141px) !important;
}

/* Tablet-Einzelseite: immer oben beginnen und die Buttons im sichtbaren Fenster halten. */
body.timetableStandalone #timetableBackdrop{
  position:fixed !important;
  inset:0 !important;
  align-items:stretch !important;
  justify-content:stretch !important;
  padding:0 !important;
  margin:0 !important;
}
body.timetableStandalone .timetableDialog.timetableLeitstelle{
  position:fixed !important;
  inset:0 !important;
  left:0 !important;
  top:0 !important;
  right:auto !important;
  bottom:auto !important;
  transform:none !important;
  width:100vw !important;
  max-width:none !important;
  min-width:0 !important;
  height:100vh !important;
  max-height:none !important;
  display:flex !important;
  flex-direction:column !important;
  margin:0 !important;
  border-radius:0 !important;
}
body.timetableStandalone .timetableDialog.timetableLeitstelle .timetableTopbar,
body.timetableStandalone .timetableDialog.timetableLeitstelle .timetableControlBarClean,
body.timetableStandalone .timetableDialog.timetableLeitstelle .timetableFooterActions{
  flex:0 0 auto !important;
}
body.timetableStandalone .timetableDialog.timetableLeitstelle .timetableBody{
  flex:1 1 auto !important;
  min-height:0 !important;
  height:auto !important;
  display:flex !important;
  flex-direction:column !important;
  overflow:hidden !important;
}
body.timetableStandalone .timetableDialog.timetableLeitstelle .timetablePanels{
  flex:1 1 auto !important;
  min-height:0 !important;
  height:auto !important;
}

/* Tablet-App: Fahrplan im Vollformat anzeigen, damit alle Spalten sichtbar sind. */
@media (min-width: 1000px) and (orientation: landscape){
  #timetableBackdrop.show{
    position:fixed !important;
    inset:0 !important;
    width:100vw !important;
    height:100vh !important;
    display:flex !important;
    align-items:stretch !important;
    justify-content:stretch !important;
    padding:0 !important;
    margin:0 !important;
  }
  #timetableBackdrop.show .timetableDialog.timetableLeitstelle{
    position:fixed !important;
    inset:0 !important;
    left:0 !important;
    top:0 !important;
    right:auto !important;
    bottom:auto !important;
    transform:none !important;
    width:100vw !important;
    max-width:none !important;
    min-width:0 !important;
    height:100vh !important;
    max-height:none !important;
    display:flex !important;
    flex-direction:column !important;
    margin:0 !important;
    border-radius:0 !important;
  }
  #timetableBackdrop.show .timetableDialog.timetableLeitstelle .timetableTopbar,
  #timetableBackdrop.show .timetableDialog.timetableLeitstelle .timetableControlBarClean,
  #timetableBackdrop.show .timetableDialog.timetableLeitstelle .timetableFooterActions{
    flex:0 0 auto !important;
  }
  #timetableBackdrop.show .timetableDialog.timetableLeitstelle .timetableBody{
    flex:1 1 auto !important;
    min-height:0 !important;
    height:auto !important;
    display:flex !important;
    flex-direction:column !important;
    overflow:hidden !important;
  }
  #timetableBackdrop.show .timetableDialog.timetableLeitstelle .timetablePanels{
    flex:1 1 auto !important;
    min-height:0 !important;
    height:auto !important;
    grid-template-columns:minmax(0,1fr) minmax(0,1fr) !important;
  }
  #timetableBackdrop.show .timetableDialog.timetableLeitstelle .timetablePanel{
    min-width:0 !important;
  }
  #timetableBackdrop.show .timetableDialog.timetableLeitstelle .timetableTable.timetableVfGhOtTable{
    min-width:0 !important;
    width:100% !important;
  }
  #timetableBackdrop.show .timetableDialog.timetableLeitstelle .timetableTable.timetableVfGhOtTable col:nth-child(1){width:20% !important;}
  #timetableBackdrop.show .timetableDialog.timetableLeitstelle .timetableTable.timetableVfGhOtTable col:nth-child(2){width:13% !important;}
  #timetableBackdrop.show .timetableDialog.timetableLeitstelle .timetableTable.timetableVfGhOtTable col:nth-child(3){width:11% !important;}
  #timetableBackdrop.show .timetableDialog.timetableLeitstelle .timetableTable.timetableVfGhOtTable col:nth-child(4){width:9% !important;}
  #timetableBackdrop.show .timetableDialog.timetableLeitstelle .timetableTable.timetableVfGhOtTable col:nth-child(5){width:8% !important;}
  #timetableBackdrop.show .timetableDialog.timetableLeitstelle .timetableTable.timetableVfGhOtTable col:nth-child(6){width:14% !important;}
  #timetableBackdrop.show .timetableDialog.timetableLeitstelle .timetableTable.timetableVfGhOtTable col:nth-child(7){width:25% !important;}
}

/* FINAL FIX 03.07.2026: Fahrplan bleibt beim Öffnen breit.
   Verhindert, dass ältere 860px/50%-Regeln am Ende der CSS-Kette wieder greifen. */
.timetableDialog.timetableLeitstelle{
  width:calc(100vw - 20px) !important;
  max-width:calc(100vw - 20px) !important;
}
body.timetableStandalone .timetableDialog.timetableLeitstelle{
  width:calc(100vw - 16px) !important;
  height:calc(100vh - 16px) !important;
  max-width:none !important;
  max-height:none !important;
}


/* UPDATE 03.07.2026: Bereichsauswahl platzsparend direkt neben Betriebstag.
   Die frühere eigene Zeile "Fahrplan" entfällt im HTML. */
.timetableDialog.timetableLeitstelle .timetableControlBarClean{
  align-items:start !important;
}
.timetableDialog.timetableLeitstelle .timetableControlBarClean .timetableControlRows{
  gap:6px !important;
}
.timetableDialog.timetableLeitstelle .timetableControlBarClean .timetableDayFacilityRow{
  grid-template-columns:104px minmax(210px,260px) minmax(155px,200px) !important;
  gap:8px !important;
  align-items:center !important;
}
.timetableDialog.timetableLeitstelle .timetableControlBarClean .timetableDayFacilityRow #timetableDayModeSelect{
  grid-column:2 !important;
}
.timetableDialog.timetableLeitstelle .timetableControlBarClean .timetableDayFacilityRow #timetableFacilitySelect{
  grid-column:3 !important;
  width:100% !important;
}
.timetableDialog.timetableLeitstelle .timetableControlBarClean .timetableControlRow:not(.timetableDayFacilityRow){
  grid-template-columns:104px minmax(360px,1fr) !important;
}
.timetableDialog.timetableLeitstelle .timetablePanels{
  height:calc(100% - 84px) !important;
}
body.timetableStandalone .timetableDialog.timetableLeitstelle .timetablePanels{
  height:calc(100vh - 132px) !important;
}
@media (max-width:820px){
  .timetableDialog.timetableLeitstelle .timetableControlBarClean .timetableDayFacilityRow{
    grid-template-columns:104px minmax(180px,1fr) minmax(145px,180px) !important;
  }
}
@media (max-width:620px){
  .timetableDialog.timetableLeitstelle .timetableControlBarClean .timetableDayFacilityRow{
    grid-template-columns:1fr !important;
  }
  .timetableDialog.timetableLeitstelle .timetableControlBarClean .timetableDayFacilityRow #timetableDayModeSelect,
  .timetableDialog.timetableLeitstelle .timetableControlBarClean .timetableDayFacilityRow #timetableFacilitySelect{
    grid-column:1 !important;
  }
}

/* UPDATE 03.07.2026: Kopfmenü neu sortiert.
   Zeile 1: Plan + Import-Buttons. Zeile 2: Betriebstag + Bereichsauswahl. */
.timetableDialog.timetableLeitstelle .timetableControlBarClean{
  display:grid !important;
  grid-template-columns:minmax(0,1fr) auto !important;
  column-gap:14px !important;
  row-gap:6px !important;
  align-items:start !important;
}
.timetableDialog.timetableLeitstelle .timetableControlBarClean .timetableControlRows{
  display:grid !important;
  grid-template-columns:1fr !important;
  gap:6px !important;
  min-width:0 !important;
}
.timetableDialog.timetableLeitstelle .timetableControlBarClean .timetableControlButtons{
  grid-column:2 !important;
  grid-row:1 !important;
  display:flex !important;
  gap:10px !important;
  align-items:center !important;
  justify-content:flex-end !important;
  padding-top:0 !important;
  white-space:nowrap !important;
}
.timetableDialog.timetableLeitstelle .timetableControlBarClean .timetablePlanImportRow{
  grid-row:1 !important;
  display:grid !important;
  grid-template-columns:104px minmax(360px,1fr) !important;
  gap:10px !important;
  align-items:center !important;
  min-width:0 !important;
}
.timetableDialog.timetableLeitstelle .timetableControlBarClean .timetableDayFacilityRow{
  grid-row:2 !important;
  display:grid !important;
  grid-template-columns:104px minmax(210px,260px) minmax(155px,200px) !important;
  gap:8px !important;
  align-items:center !important;
  min-width:0 !important;
}
.timetableDialog.timetableLeitstelle .timetableControlBarClean .timetablePlanImportRow #timetablePlanSelect,
.timetableDialog.timetableLeitstelle .timetableControlBarClean .timetableDayFacilityRow #timetableDayModeSelect,
.timetableDialog.timetableLeitstelle .timetableControlBarClean .timetableDayFacilityRow #timetableFacilitySelect{
  width:100% !important;
  min-width:0 !important;
}
.timetableDialog.timetableLeitstelle .timetableControlBarClean .timetableDayFacilityRow #timetableDayModeSelect{grid-column:2 !important;}
.timetableDialog.timetableLeitstelle .timetableControlBarClean .timetableDayFacilityRow #timetableFacilitySelect{grid-column:3 !important;}
@media (max-width:1050px){
  .timetableDialog.timetableLeitstelle .timetableControlBarClean{
    grid-template-columns:1fr !important;
  }
  .timetableDialog.timetableLeitstelle .timetableControlBarClean .timetableControlButtons{
    grid-column:1 !important;
    grid-row:3 !important;
    justify-content:flex-start !important;
  }
}

/* Fahrplan-Werkzeuge: seltene Funktionen in ein kompaktes Menü verschoben */
.timetableToolsWrap{
  position:relative;
  margin-left:auto;
  display:flex;
  align-items:center;
  flex:0 0 auto;
}
.timetableToolsBtn{
  height:38px;
  min-width:132px;
  padding:0 14px !important;
  border-radius:10px !important;
  border:1px solid rgba(118,169,231,.55) !important;
  background:linear-gradient(180deg,#112838,#0b1b27 58%,#07131d) !important;
  color:#fff !important;
  font-weight:800 !important;
  font-size:16px !important;
  letter-spacing:.1px;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.20),0 4px 12px rgba(0,0,0,.28) !important;
  text-shadow:0 1px 1px #000;
  white-space:nowrap;
}
.timetableToolsBtn:hover{
  border-color:#8fbfff !important;
  filter:brightness(1.10);
}
.timetableToolsMenu{
  display:none;
  position:absolute;
  right:0;
  top:calc(100% + 8px);
  z-index:50;
  min-width:286px;
  padding:10px;
  border:1px solid rgba(101,162,238,.55);
  border-radius:8px;
  background:#071522;
  box-shadow:0 16px 30px rgba(0,0,0,.48), inset 0 1px 0 rgba(255,255,255,.08);
}
.timetableToolsMenu.show{display:block;}
.timetableToolsMenu button{
  width:100%;
  height:36px;
  display:flex;
  align-items:center;
  justify-content:flex-start;
  text-align:left;
  margin:0;
  padding:0 12px !important;
  border-radius:6px !important;
  border:1px solid transparent !important;
  background:transparent !important;
  color:#f3f7ff !important;
  font-size:15px !important;
  font-weight:750 !important;
  box-shadow:none !important;
  text-shadow:none;
  white-space:nowrap;
}
.timetableToolsMenu button:hover{
  background:#12345d !important;
  border-color:rgba(129,188,255,.32) !important;
}
.timetableToolsMenu button:focus-visible{
  outline:2px solid #8fbfff;
  outline-offset:1px;
}
.timetableToolsDivider{
  height:1px;
  margin:8px 4px;
  background:rgba(148,194,255,.24);
}
@media print{
  .timetableToolsWrap{display:none!important;}
}


/* ChatGPT: Zugziel schmaler, Standort behält Platz. */
.timetableDialog.timetableLeitstelle .timetableTable{
  table-layout:fixed !important;
  width:100% !important;
  min-width:0 !important;
  max-width:none !important;
}
.timetableDialog.timetableLeitstelle .timetableTable col:nth-child(1){width:105px !important;} /* ZN */
.timetableDialog.timetableLeitstelle .timetableTable col:nth-child(2){width:88px !important;}  /* Zeit */
.timetableDialog.timetableLeitstelle .timetableTable col:nth-child(3){width:78px !important;}  /* Typ */
.timetableDialog.timetableLeitstelle .timetableTable col:nth-child(4){width:80px !important;}  /* Gleis */
.timetableDialog.timetableLeitstelle .timetableTable col:nth-child(5){width:120px !important;} /* Standort */
.timetableDialog.timetableLeitstelle .timetableTable col:nth-child(6){width:96px !important;}  /* Zugziel */
.timetableDialog.timetableLeitstelle .timetableTable td[data-col$="Zugziel"],
.timetableDialog.timetableLeitstelle .timetableTable th:nth-child(6){
  max-width:96px !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
  white-space:nowrap !important;
}
@media (min-width:1450px){
  .timetableDialog.timetableLeitstelle .timetableTable col:nth-child(6){width:108px !important;}
}

/* Werkzeug-Menue: Text und Hintergrund als ein sauberer Button. */
.timetableDialog.timetableLeitstelle .timetableToolsMenu button,
.timetableToolsMenu button{
  position:relative !important;
  width:100% !important;
  height:36px !important;
  min-height:36px !important;
  display:flex !important;
  align-items:center !important;
  justify-content:flex-start !important;
  margin:0 0 6px 0 !important;
  padding:0 12px !important;
  border-radius:6px !important;
  border:1px solid rgba(111,151,205,.36) !important;
  background:linear-gradient(180deg,#111827 0%,#0a1422 100%) !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.18),0 1px 2px rgba(0,0,0,.28) !important;
  color:#fff !important;
  font-size:14px !important;
  font-weight:800 !important;
  line-height:1 !important;
  text-align:left !important;
  text-shadow:0 1px 1px rgba(0,0,0,.75) !important;
  white-space:nowrap !important;
}
.timetableDialog.timetableLeitstelle .timetableToolsMenu button::before,
.timetableToolsMenu button::before{
  content:"" !important;
  display:block !important;
  position:absolute !important;
  left:26px !important;
  right:26px !important;
  top:6px !important;
  height:9px !important;
  border-radius:999px !important;
  background:linear-gradient(180deg,rgba(255,255,255,.72),rgba(255,255,255,.24) 70%,rgba(255,255,255,0)) !important;
  pointer-events:none !important;
  z-index:0 !important;
}
.timetableDialog.timetableLeitstelle .timetableToolsMenu button::after,
.timetableToolsMenu button::after{
  content:none !important;
  display:none !important;
}
.timetableDialog.timetableLeitstelle .timetableToolsMenu .toolMenuLabel,
.timetableToolsMenu .toolMenuLabel{
  position:relative !important;
  z-index:1 !important;
  display:block !important;
  padding-left:28px !important;
  line-height:1 !important;
}
.timetableDialog.timetableLeitstelle .timetableToolsMenu button:last-child,
.timetableToolsMenu button:last-child{
  margin-bottom:0 !important;
}
.timetableDialog.timetableLeitstelle .timetableToolsMenu button:hover,
.timetableToolsMenu button:hover{
  background:linear-gradient(180deg,#17335a 0%,#0e2442 100%) !important;
  border-color:rgba(143,191,255,.55) !important;
}

/* Fahrplan kompakt: gleich breite Spalten je Bezeichnung + randloses Standalone-Fenster */

/* Jede Tabelle nutzt dieselben Spaltenbreiten. So sind ZN, Zeit, Typ, Gleis,
   Standort und Zugziel auf Streckengleis 1 und 2 exakt gleich breit. */
.timetableTable{
  table-layout:fixed !important;
  width:min(100%, 690px) !important;
}
.timetableTable col:nth-child(1){width:18%;}  /* ZN */
.timetableTable col:nth-child(2){width:15%;}  /* Zeit */
.timetableTable col:nth-child(3){width:12%;}  /* Typ */
.timetableTable col:nth-child(4){width:12%;}  /* Gleis */
.timetableTable col:nth-child(5){width:22%;}  /* Standort */
.timetableTable col:nth-child(6){width:21%;}  /* Zugziel */
.timetableTable th,
.timetableTable td{
  padding-left:4px !important;
  padding-right:4px !important;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.timetableTable th{font-size:15px !important;}
.timetableTable td{font-size:15px !important;}
.timetablePanel > .timetableTableWrap:first-of-type{overflow-x:hidden !important;}

/* Im eigenen Fahrplanfenster soll der Fahrplan direkt am Fensterrand beginnen. */
body.timetableStandalone,
body.timetableStandalone #timetableBackdrop{
  background:#061326 !important;
}
body.timetableStandalone #timetableBackdrop{
  padding:0 !important;
}
body.timetableStandalone .timetableDialog{
  border:0 !important;
  border-radius:0 !important;
  box-shadow:none !important;
}
body.timetableStandalone .timetableBody{
  padding:8px 10px 10px !important;
}
body.timetableStandalone .timetableTopbar{
  border-top:0 !important;
}

/* Streckengleis 1/2: Tabellen sichtbar schmaler halten. */
.timetableDialog.timetableLeitstelle .timetableTable:not(.timetableVfGhOtTable){
  width:650px !important;
  min-width:0 !important;
  max-width:100% !important;
}
