/* Fahrplan-Karte – Website */
.fk-karte {
	--fk-accent: #1F6FB2;
	--fk-height: 480px;
	--fk-text: #1D2327;
	--fk-muted: #50575E;
	--fk-line: #E3E5E8;
	--fk-bg: #FFFFFF;
	--fk-soft: #F4F6F9;
	position: relative;
	color: var(--fk-text);
	font-size: 15px;
	line-height: 1.4;
	margin: 1.5em 0;
}
.fk-karte *, .fk-karte *::before, .fk-karte *::after { box-sizing: border-box; }
.fk-karte .fk-fallback ul { margin: 1em 0 0 1.2em; }
.fk-karte.fk-ready .fk-fallback { display: none; }

/* Rahmen */
.fk-karte .fk-block {
	display: flex;
	align-items: stretch;
	background: var(--fk-bg);
	border: 1px solid #DCDFE3;
	border-radius: 12px;
	overflow: hidden;
}
.fk-karte .fk-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

/* Knöpfe (gegen Theme-Stile abgesichert) */
.fk-karte .fk-btn,
.fk-karte .fk-tab,
.fk-karte .fk-row,
.fk-karte .fk-hs {
	-webkit-appearance: none;
	appearance: none;
	margin: 0;
	font: inherit;
	text-transform: none;
	letter-spacing: normal;
	text-decoration: none;
	box-shadow: none;
	min-height: 0;
	min-width: 0;
	width: auto;
	line-height: 1.2;
}
.fk-karte .fk-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	height: 40px;
	padding: 0 12px;
	border: 1px solid #D0D4D9;
	border-radius: 8px;
	background: #FFFFFF;
	color: var(--fk-text);
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	white-space: nowrap;
}
.fk-karte .fk-btn:hover { background: #EEF1F5; color: var(--fk-text); }
.fk-karte .fk-btn:focus-visible,
.fk-karte .fk-tab:focus-visible,
.fk-karte .fk-row:focus-visible,
.fk-karte .fk-x:focus-visible,
.fk-karte .fk-textbtn:focus-visible,
.fk-karte .fk-card-open:focus-visible,
.fk-karte a:focus-visible,
.fk-karte .fk-search:focus-visible,
.fk-karte .fk-hs:focus-visible {
	outline: 3px solid var(--fk-accent);
	outline-offset: 2px;
}
.fk-karte .fk-btn-primary { background: var(--fk-accent); border-color: var(--fk-accent); color: #FFFFFF; font-weight: 600; }
.fk-karte .fk-btn-primary:hover { background: var(--fk-accent); color: #FFFFFF; filter: brightness(0.92); }
.fk-karte .fk-btn-small { height: 30px; padding: 0 10px; font-size: 12px; border-radius: 6px; }
.fk-karte .fk-icon-btn { width: 40px; padding: 0; border: 0; border-radius: 0; background: transparent; }
.fk-karte .fk-ico { display: inline-flex; flex: 0 0 auto; }
.fk-karte .fk-ico svg { display: block; }

/* Werkzeugleiste */
.fk-karte .fk-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	padding: 10px 12px;
	border-bottom: 1px solid var(--fk-line);
	background: #FAFBFC;
}
.fk-karte .fk-zoom { display: flex; align-items: center; border: 1px solid #D0D4D9; border-radius: 8px; background: #FFFFFF; overflow: hidden; height: 40px; }
.fk-karte .fk-zoom .fk-icon-btn { height: 38px; }
.fk-karte .fk-zoom .fk-icon-btn:hover { background: #EEF1F5; }
.fk-karte .fk-pct { min-width: 56px; text-align: center; font-size: 13px; font-weight: 600; color: #3C434A; border-left: 1px solid var(--fk-line); border-right: 1px solid var(--fk-line); line-height: 38px; }
.fk-karte .fk-spacer { flex: 1 1 auto; }

/* Karte */
.fk-karte .fk-viewport {
	position: relative;
	height: var(--fk-height);
	overflow: hidden;
	background: #ECEEF1;
	cursor: grab;
	touch-action: none;
	-webkit-user-select: none;
	user-select: none;
}
.fk-karte .fk-viewport.fk-dragging { cursor: grabbing; }
.fk-karte .fk-stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.fk-karte .fk-stage img { display: block; width: 100%; height: 100%; max-width: none; pointer-events: none; border: 0; border-radius: 0; box-shadow: none; }

.fk-karte .fk-hs {
	position: absolute;
	display: block;
	padding: 0;
	border: 2px solid transparent;
	border-radius: 6px;
	background: transparent;
	cursor: pointer;
	transition: background-color .12s, box-shadow .12s, border-color .12s;
}
.fk-karte.fk-outlines .fk-hs-line { border-color: rgba(31, 111, 178, .55); }
.fk-karte.fk-outlines .fk-hs-stop { border: 2px dashed rgba(31, 111, 178, .75); }
.fk-karte .fk-hs:hover { background: rgba(31, 111, 178, .16); border-color: var(--fk-accent); box-shadow: 0 0 0 3px rgba(31, 111, 178, .3); }
.fk-karte .fk-hs-empty { cursor: help; }
.fk-karte .fk-hs.fk-on {
	border: 2px solid var(--fk-accent);
	background: rgba(31, 111, 178, .2);
	animation: fkPulse 1.4s ease-out infinite;
}
@keyframes fkPulse {
	0% { box-shadow: 0 0 0 0 rgba(31, 111, 178, .6); }
	100% { box-shadow: 0 0 0 16px rgba(31, 111, 178, 0); }
}
@media (prefers-reduced-motion: reduce) {
	.fk-karte .fk-hs.fk-on { animation: none; box-shadow: 0 0 0 4px rgba(31, 111, 178, .35); }
	.fk-karte .fk-stage { transition: none !important; }
}

.fk-karte .fk-wheelhint {
	position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
	background: rgba(17, 20, 24, .45); color: #FFFFFF; font-size: 16px; font-weight: 600;
	pointer-events: none; opacity: 0; transition: opacity .2s; text-align: center; padding: 16px;
}
.fk-karte .fk-wheelhint.fk-show { opacity: 1; }

.fk-karte .fk-foot { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 10px 14px; border-top: 1px solid var(--fk-line); font-size: 12px; color: var(--fk-muted); }
.fk-karte .fk-mbar { display: none; }

/* Seitenleiste / Inhalte */
.fk-karte .fk-vpwrap { position: relative; }

/* Schwebendes Fenster rechts (Desktop) */
.fk-karte .fk-card-wrap { position: absolute; top: 20px; right: 20px; bottom: 20px; width: 330px; max-width: calc(100% - 40px); z-index: 5; display: flex; flex-direction: column; pointer-events: none; }
.fk-karte .fk-card-wrap[hidden] { display: none; }
.fk-karte .fk-card { pointer-events: auto; max-height: 100%; display: flex; flex-direction: column; background: #FFFFFF; box-shadow: 0 4px 18px rgba(0, 0, 0, .16); cursor: default; }
.fk-karte .fk-card-open {
	position: absolute; top: 20px; right: 20px; z-index: 5;
	-webkit-appearance: none; appearance: none; margin: 0; display: inline-flex; align-items: center; gap: 8px;
	height: 44px; padding: 0 16px; border: 0; border-radius: 22px; background: #FFFFFF; color: var(--fk-text);
	box-shadow: 0 4px 16px rgba(0, 0, 0, .18); font: inherit; font-size: 14px; font-weight: 600; line-height: 1; cursor: pointer;
	text-transform: none; letter-spacing: normal;
}
.fk-karte .fk-card-open[hidden] { display: none; }
.fk-karte .fk-card-open:hover { background: #F4F6F9; color: var(--fk-text); }

/* Inhalt (Fenster und Handy-Fenster) */
.fk-karte .fk-head { display: flex; align-items: flex-start; gap: 8px; padding: 20px 14px 10px 22px; flex: 0 0 auto; }
.fk-karte .fk-head-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fk-karte .fk-kicker { font-size: 13px; letter-spacing: .05em; color: #3C434A; text-transform: uppercase; }
.fk-karte .fk-title { margin: 0; padding: 0; font-family: inherit; font-size: 26px; font-weight: 600; line-height: 1.2; color: #222222; overflow-wrap: anywhere; }
.fk-karte .fk-x {
	-webkit-appearance: none; appearance: none; margin: 0; flex: 0 0 auto; width: 38px; height: 38px; padding: 0;
	border: 0; border-radius: 19px; background: transparent; color: #3C434A; cursor: pointer;
	display: inline-flex; align-items: center; justify-content: center; box-shadow: none; min-height: 0;
}
.fk-karte .fk-x:hover { background: #F0F2F5; color: #222222; }
.fk-karte .fk-tools { padding: 4px 22px 12px; display: flex; flex-direction: column; gap: 10px; flex: 0 0 auto; }
.fk-karte .fk-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px; background: #EEF1F4; border-radius: 8px; }
.fk-karte .fk-tab { height: 34px; padding: 0 6px; border: 0; border-radius: 6px; background: transparent; color: var(--fk-muted); font-size: 13px; font-weight: 600; cursor: pointer; }
.fk-karte .fk-tab-on { background: #FFFFFF; color: var(--fk-text); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.fk-karte .fk-search-wrap { position: relative; display: block; margin: 0; }
.fk-karte .fk-search-wrap .fk-ico { position: absolute; left: 11px; top: 11px; color: #8A9199; pointer-events: none; }
.fk-karte .fk-search {
	width: 100%; height: 38px; margin: 0; padding: 0 12px 0 34px;
	border: 1px solid #C9CED4; border-radius: 6px; background: #FFFFFF;
	font: inherit; font-size: 14px; color: var(--fk-text); box-shadow: none;
}
.fk-karte .fk-sub { padding: 0 22px 4px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; flex: 0 0 auto; }
.fk-karte .fk-sub-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.fk-karte .fk-label { font-size: 14px; color: #222222; }
.fk-karte .fk-textbtn {
	-webkit-appearance: none; appearance: none; margin: 0; padding: 0; border: 0; background: transparent; box-shadow: none;
	font: inherit; font-size: 13px; font-weight: 500; color: var(--fk-accent); cursor: pointer; text-transform: none; letter-spacing: normal; min-height: 0; line-height: 1.4;
}
.fk-karte .fk-textbtn:hover { text-decoration: underline; background: transparent; color: var(--fk-accent); }
.fk-karte .fk-box { flex: 1 1 auto; min-height: 0; overflow-y: auto; margin: 10px 22px 22px; border: 1px dashed #9AA0A6; }
.fk-karte .fk-list { padding: 0; }
.fk-karte .fk-row {
	display: flex; align-items: center; gap: 8px; width: 100%;
	padding: 10px 12px; border: 0; border-bottom: 1px solid #E3E5E8; border-radius: 0; background: transparent;
	color: var(--fk-text); text-align: left; cursor: pointer;
}
.fk-karte .fk-row:last-child { border-bottom: 0; }
.fk-karte .fk-row:hover { background: var(--fk-soft); color: var(--fk-text); }
.fk-karte .fk-row .fk-ico { color: #8A9199; }
.fk-karte .fk-row-text { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.fk-karte .fk-row-title { font-size: 15px; font-weight: 400; color: #222222; }
.fk-karte .fk-row-sub { font-size: 12px; color: #646970; font-weight: 400; }
.fk-karte .fk-empty { margin: 14px 12px; font-size: 14px; color: #646970; }

.fk-karte .fk-lines { padding: 2px 12px 8px; }
.fk-karte .fk-line { padding: 12px 0 10px; border-bottom: 1px solid #DCDCDE; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.fk-karte .fk-badge { display: inline-block; padding: 1px 10px; font-size: 15px; font-weight: 600; line-height: 1.45; text-decoration: none; border-radius: 0; }
.fk-karte a.fk-badge:hover { filter: brightness(.9); text-decoration: none; }
.fk-karte .fk-dir { display: block; color: #3C434A; font-size: 14px; line-height: 1.45; text-decoration: none; }
.fk-karte a.fk-dir:hover { text-decoration: underline; color: var(--fk-accent); }
.fk-karte .fk-dir-empty { color: #8A9199; }

/* Volle Bildschirmbreite: Breite und Position setzt das Skript passend zur Spalte des Themes */
.fk-karte.fk-breit { position: relative; }
.fk-karte.fk-breit .fk-block { border-radius: 0; border-left: 0; border-right: 0; }
.fk-karte.fk-portal { margin: 0; }
/* 100vw enthält die Scrollbar-Breite: verhindert horizontales Scrollen (clip bricht position:sticky nicht) */
html:has(.fk-karte.fk-breit) { overflow-x: clip; }

/* Vollansicht */
.fk-karte .fk-full-backdrop { display: none; position: fixed; inset: 0; background: #FFFFFF; z-index: 2147483000; }
.fk-karte .fk-full-backdrop.fk-show { display: block; }
.fk-karte .fk-block.fk-full { position: fixed; inset: 0; z-index: 2147483001; border: 0; border-radius: 0; box-shadow: none; }
.fk-karte .fk-block.fk-full .fk-main { height: 100%; }
.fk-karte .fk-block.fk-full .fk-vpwrap { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.fk-karte .fk-block.fk-full .fk-viewport { height: auto; flex: 1 1 auto; }
html.fk-noscroll, html.fk-noscroll body { overflow: hidden; }

/* Bottom-Sheet (schmale Bildschirme) */
.fk-karte .fk-sheet-wrap { display: none; position: fixed; inset: 0; z-index: 2147483002; }
.fk-karte .fk-sheet-wrap.fk-open { display: block; }
.fk-karte .fk-sheet-backdrop { position: absolute; inset: 0; background: rgba(17, 20, 24, .45); }
.fk-karte .fk-sheet {
	position: absolute; left: 0; right: 0; bottom: 0; max-height: 78vh; height: 78vh;
	background: #FFFFFF; border-radius: 18px 18px 0 0; box-shadow: 0 -8px 30px rgba(0, 0, 0, .2);
	display: flex; flex-direction: column; animation: fkUp .2s ease-out;
}
@keyframes fkUp { from { transform: translateY(30px); opacity: .6; } to { transform: none; opacity: 1; } }
.fk-karte .fk-sheet-top { position: relative; display: flex; justify-content: center; padding: 8px 8px 0; min-height: 30px; }
.fk-karte .fk-sheet-handle { width: 40px; height: 5px; border-radius: 3px; background: #D0D4D9; }
.fk-karte .fk-sheet-close { position: absolute; right: 6px; top: 2px; width: 44px; height: 44px; color: var(--fk-muted); border-radius: 22px; }
.fk-karte .fk-sheet-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.fk-karte .fk-sheet-body .fk-head { padding-right: 56px; padding-top: 6px; }
.fk-karte .fk-sheet-body .fk-tab { height: 40px; font-size: 14px; }
.fk-karte .fk-sheet-body .fk-search { height: 44px; font-size: 16px; }
.fk-karte .fk-sheet-body .fk-row { min-height: 52px; }
.fk-karte .fk-sheet-body .fk-dir { padding: 6px 0; }
.fk-karte .fk-sheet-body .fk-badge { padding: 4px 12px; }

/* Schmale Ansicht */
.fk-karte.fk-narrow .fk-card-wrap,
.fk-karte.fk-narrow .fk-card-open,
.fk-karte.fk-narrow .fk-foot,
.fk-karte.fk-narrow .fk-lbl { display: none; }
.fk-karte.fk-narrow .fk-block { border-radius: 10px; }
.fk-karte.fk-narrow .fk-toolbar { padding: 8px; gap: 6px; }
.fk-karte.fk-narrow .fk-toolbar .fk-btn:not(.fk-icon-btn) { width: 44px; height: 44px; padding: 0; }
.fk-karte.fk-narrow .fk-zoom { height: 44px; }
.fk-karte.fk-narrow .fk-zoom .fk-icon-btn { width: 44px; height: 42px; }
.fk-karte.fk-narrow .fk-viewport { height: min(var(--fk-height), 62vh); min-height: 300px; }
.fk-karte.fk-narrow .fk-block.fk-full { inset: 0; border-radius: 0; }
.fk-karte.fk-narrow .fk-block.fk-full .fk-viewport { height: auto; }
.fk-karte.fk-narrow .fk-mbar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 12px; border-top: 1px solid var(--fk-line); }
.fk-karte.fk-narrow .fk-mbtn { height: 50px; font-size: 14px; font-weight: 600; gap: 8px; }
