.fx-train { --fx-end: 1; display: grid; gap: 16px; }
.fx-train:has(#fx-train-b2:checked) { --fx-end: 2; }
.fx-train:has(#fx-train-b3:checked) { --fx-end: 3; }
.fx-train:has(#fx-train-b4:checked) { --fx-end: 4; }
.fx-train:has(#fx-train-b5:checked) { --fx-end: 5; }
.fx-train:has(#fx-train-b6:checked) { --fx-end: 6; }
.fx-train .fx-steps { list-style: none; margin: 0; padding: 0; }
.fx-train .fx-steps li + li { margin-top: 6px; }
.fx-train .fx-goal { margin: 0; color: var(--fx-ink); }
.fx-train .fx-controls { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); align-items: start; gap: 16px; }
.fx-train .fx-group { min-width: 0; margin: 0; padding: 0; border: 0; color: var(--fx-ink); }
.fx-train .fx-group legend { padding: 0; margin-bottom: 10px; font-weight: 800; }
.fx-train .fx-row { display: flex; flex-wrap: wrap; gap: 8px; }
.fx-train .fx-btn { box-sizing: border-box; display: inline-flex; align-items: center; min-height: 44px; max-width: 100%; padding: 8px 10px; border: 2px solid var(--fx-ink); border-radius: 10px; background: var(--fx-paper); color: var(--fx-ink); font-size: 14px; font-weight: 700; line-height: 1.3; cursor: pointer; }
.fx-train .fx-btn:has(input:checked) { background: var(--fx-sky-pale); color: var(--fx-ink); }
.fx-train .fx-btn:has(input:focus-visible) { outline: 3px solid var(--fx-grape); outline-offset: 3px; }
.fx-train .fx-stage { padding: 0; overflow: hidden; container-type: inline-size; color: var(--fx-ink); background: var(--fx-sky-pale); }
.fx-train .fx-map { position: relative; height: 260px; font-size: 14px; line-height: 1.35; }
.fx-train .fx-route-label { position: absolute; left: 16px; top: 12px; font-size: 16px; }
.fx-train .fx-check { position: absolute; right: 14px; top: 12px; width: 28px; height: 28px; visibility: hidden; fill: none; stroke: var(--fx-mint); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.fx-train .fx-rail { position: absolute; left: 48px; right: 48px; top: 108px; height: 4px; background: var(--fx-ink); }
.fx-train .fx-stops { position: absolute; left: 48px; right: 48px; top: 110px; display: flex; justify-content: space-between; }
.fx-train .fx-stop { position: relative; width: 0; height: 0; flex-shrink: 0; }
.fx-train .fx-point { position: absolute; left: 0; top: 0; width: 0; height: 0; }
.fx-train .fx-light { position: absolute; left: -17px; top: -17px; width: 34px; height: 34px; border-radius: 50%; background: var(--fx-sun); visibility: hidden; }
.fx-train .fx-point::before, .fx-train .fx-point::after { content: ""; box-sizing: border-box; position: absolute; border-radius: 50%; visibility: hidden; }
.fx-train .fx-point::before { left: -22px; top: -22px; width: 44px; height: 44px; border: 3px solid var(--fx-mint); }
.fx-train .fx-point::after { left: -26px; top: -26px; width: 52px; height: 52px; border: 3px dashed var(--fx-coral); }
.fx-train .fx-mark { position: absolute; left: -2px; top: -9px; width: 4px; height: 18px; background: var(--fx-ink); }
.fx-train .fx-interchange { box-sizing: border-box; left: -9px; width: 18px; border: 3px solid var(--fx-ink); border-radius: 50%; background: var(--fx-paper); }
.fx-train .fx-name { position: absolute; left: -45px; top: 36px; width: 90px; text-align: center; }
.fx-train .fx-name small { display: block; margin-top: 4px; font-size: 12px; }
.fx-train .fx-car { position: absolute; left: 26px; top: 48px; width: 44px; transform: translateX(calc(var(--fx-end) * (100cqw - 96px) / 6)); transition: transform 0.7s; }
.fx-train .fx-train-label { position: absolute; left: 0; top: -18px; width: 44px; text-align: center; font-size: 12px; font-weight: 800; }
.fx-train .fx-car svg { display: block; width: 44px; height: 26px; fill: var(--fx-sky); stroke: var(--fx-ink); stroke-width: 2; }
.fx-train .fx-car path { fill: var(--fx-paper); }
.fx-train .fx-car circle { fill: var(--fx-ink); }
.fx-train .fx-legend { display: flex; flex-wrap: wrap; gap: 12px 20px; padding: 12px; font-size: 14px; }
.fx-train .fx-legend span { display: inline-flex; align-items: center; gap: 8px; min-height: 24px; }
.fx-train .fx-key { box-sizing: border-box; width: 20px; height: 20px; flex: 0 0 20px; border-radius: 50%; }
.fx-train .fx-key-on { border: 3px solid var(--fx-mint); }
.fx-train .fx-key-off { border: 3px dashed var(--fx-coral); }
.fx-train .fx-key-lit { background: var(--fx-sun); }
.fx-train:has(#fx-train-a0:checked) .fx-s0 .fx-point::before, .fx-train:has(#fx-train-a1:checked) .fx-s1 .fx-point::before, .fx-train:has(#fx-train-b1:checked) .fx-s1 .fx-point::after, .fx-train:has(#fx-train-b2:checked) .fx-s2 .fx-point::after, .fx-train:has(#fx-train-b3:checked) .fx-s3 .fx-point::after, .fx-train:has(#fx-train-b4:checked) .fx-s4 .fx-point::after, .fx-train:has(#fx-train-b5:checked) .fx-s5 .fx-point::after, .fx-train:has(#fx-train-b6:checked) .fx-s6 .fx-point::after { visibility: visible; }
.fx-train:has(#fx-train-a0:checked):has(.fx-past1:checked) .fx-s1 .fx-light, .fx-train:has(.fx-past2:checked) .fx-s2 .fx-light, .fx-train:has(.fx-past3:checked) .fx-s3 .fx-light, .fx-train:has(.fx-past4:checked) .fx-s4 .fx-light, .fx-train:has(.fx-past5:checked) .fx-s5 .fx-light { visibility: visible; }
.fx-train .fx-messages, .fx-train .fx-hints { display: grid; }
.fx-train .fx-msg, .fx-train .fx-hint { grid-area: 1 / 1; visibility: hidden; margin: 0; color: var(--fx-ink); }
.fx-train:has(#fx-train-a1:checked):has(#fx-train-b1:checked) .fx-a1b1, .fx-train:has(#fx-train-a1:checked):has(#fx-train-b2:checked) .fx-a1b2, .fx-train:has(#fx-train-a1:checked):has(#fx-train-b3:checked) .fx-a1b3, .fx-train:has(#fx-train-a1:checked):has(#fx-train-b4:checked) .fx-a1b4, .fx-train:has(#fx-train-a1:checked):has(#fx-train-b5:checked) .fx-a1b5, .fx-train:has(#fx-train-a1:checked):has(#fx-train-b6:checked) .fx-a1b6, .fx-train:has(#fx-train-a0:checked):has(#fx-train-b1:checked) .fx-a0b1, .fx-train:has(#fx-train-a0:checked):has(#fx-train-b2:checked) .fx-a0b2, .fx-train:has(#fx-train-a0:checked):has(#fx-train-b3:checked) .fx-a0b3, .fx-train:has(#fx-train-a0:checked):has(#fx-train-b4:checked) .fx-a0b4, .fx-train:has(#fx-train-a0:checked):has(#fx-train-b5:checked) .fx-a0b5, .fx-train:has(#fx-train-a0:checked):has(#fx-train-b6:checked) .fx-a0b6, .fx-train:has(#fx-train-a1:checked):has(#fx-train-b4:checked) .fx-check, .fx-train:has(#fx-train-a1:checked):has(#fx-train-b1:checked) .fx-hint { visibility: visible; }
@container (max-width: 640px) { .fx-train .fx-map { height: 550px; } .fx-train .fx-rail { left: 78px; right: auto; top: 70px; bottom: 34px; width: 4px; height: auto; } .fx-train .fx-stops { left: 80px; right: auto; top: 70px; bottom: 34px; width: 0; flex-direction: column; } .fx-train .fx-name { left: 32px; top: -12px; width: calc(100cqw - 128px); text-align: left; } .fx-train .fx-car { left: 8px; top: 57px; transform: translateY(calc(var(--fx-end) * 446px / 6)); } }
@container (max-width: 480px) { .fx-train .fx-controls { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .fx-train .fx-car { transition: none; } }