/* Route preview (static/js/route-play.js): an ink token with a yellow icon travels the route, tags pop where a ride starts and where you arrive.
   Ink with a white ring reads on both the yellow route line and the grey basemap. Only the inner elements animate: the Leaflet marker roots carry their own transform. */
.rp-marker, .rp-tag-icon { background: none; border: 0; pointer-events: none; }
.rp-unit { position: relative; width: 0; height: 0; animation: rp-pop .3s cubic-bezier(.2, .9, .3, 1.2) both; }
.rp-rot, .rp-car { position: absolute; left: 0; top: 0; width: 0; height: 0; will-change: transform; }
.rp-sprite { position: absolute; overflow: visible; transform: scale(1.3); filter: drop-shadow(0 2px 2.5px rgba(18, 19, 22, .38)); }
/* Every shape gets a white halo so it reads on grey, yellow and green alike; .n shapes are inner details without one. */
.rp-sprite * { paint-order: stroke; stroke: #fff; stroke-width: 1.7; stroke-linejoin: round; }
.rp-sprite .n { stroke: none; }
.rp-sprite .rib2 { stroke: rgba(255, 255, 255, .3); stroke-width: .6; fill: none; paint-order: normal; }
.rp-sprite .rib { stroke: rgba(0, 0, 0, .14); stroke-width: .8; fill: none; paint-order: normal; }
.rp-sprite .n[stroke] { stroke: #1d6b41; }
/* Legs, arms and pedals swing in opposite pairs: a walk cycle and a pedal stroke without redrawing anything. */
.rp-s-walk .rp-l1, .rp-s-walk .rp-a1 { animation: rp-swing .46s ease-in-out infinite alternate; }
.rp-s-walk .rp-l2, .rp-s-walk .rp-a2 { animation: rp-swing .46s ease-in-out infinite alternate-reverse; }
.rp-s-bike .rp-l1 { animation: rp-pedal .52s ease-in-out infinite alternate; }
.rp-s-bike .rp-l2 { animation: rp-pedal .52s ease-in-out infinite alternate-reverse; }
.rp-tag { position: absolute; left: 0; bottom: 30px; transform: translateX(-50%); padding: 4px 9px; border: 1.5px solid var(--nv-ink, #121316); border-radius: 999px; background: #fff; color: var(--nv-ink, #121316); font-family: inherit; font-size: 12px; font-weight: 700; line-height: 1.2; white-space: nowrap; box-shadow: 0 1px 4px rgba(18, 19, 22, .25); animation: rp-tag .26s cubic-bezier(.2, .9, .3, 1.15) both; }
.rp-out .rp-unit { animation: rp-out .24s ease-in forwards; }
.rp-out .rp-tag { animation: rp-tag-out .24s ease-in forwards; }
/* Moments of delight, all short: a ripple wherever a stop is reached, a hop when it changes vehicle, confetti and a tick on arrival. */
.rp-unit.rp-hop { animation: rp-hop .45s cubic-bezier(.3, 1.6, .5, 1) both; }
.rp-ring { position: absolute; left: -20px; top: -20px; width: 40px; height: 40px; box-sizing: border-box; border: 3px solid var(--nv-accent, #e9b83a); border-radius: 50%; opacity: 0; animation: rp-ring 1.2s ease-out both; }
.rp-burst { position: absolute; left: 0; top: 0; }
.rp-burst i { position: absolute; left: -3px; top: -4px; width: var(--w, 6px); height: calc(var(--w, 6px) * 1.5); border-radius: 2px; background: var(--c); opacity: 0; animation: rp-confetti 1.4s cubic-bezier(.12, .75, .3, 1) var(--dl, 0ms) both; }
.rp-tag.is-arrive { padding-left: 24px; background: var(--nv-ink, #121316); color: #fff; border-color: var(--nv-ink, #121316); }
.rp-tag.is-arrive::before { content: ''; position: absolute; left: 7px; top: 50%; width: 11px; height: 6px; margin-top: -5px; border-left: 2.5px solid var(--nv-accent, #e9b83a); border-bottom: 2.5px solid var(--nv-accent, #e9b83a); transform: rotate(-45deg) scale(0); transform-origin: center; animation: rp-tick .3s .25s cubic-bezier(.3, 1.6, .5, 1) forwards; }
@keyframes rp-ring { 0% { transform: scale(.3); opacity: .95; } 100% { transform: scale(2.6); opacity: 0; } }
@keyframes rp-hop { 0% { transform: scale(.85); } 60% { transform: scale(1.22); } 100% { transform: scale(1); } }
@keyframes rp-confetti { 0% { transform: rotate(var(--a)) translateY(0) rotate(0); opacity: 1; } 100% { transform: rotate(var(--a)) translateY(calc(var(--d) * -1)) rotate(540deg); opacity: 0; } }
@keyframes rp-tick { to { transform: rotate(-45deg) scale(1); } }
@keyframes rp-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes rp-pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes rp-swing { from { transform: translateY(-2.6px); } to { transform: translateY(2.6px); } }
@keyframes rp-pedal { from { transform: translateY(-3px); } to { transform: translateY(3px); } }
@keyframes rp-tag { from { transform: translate(-50%, 8px) scale(.85); opacity: 0; } to { transform: translate(-50%, 0) scale(1); opacity: 1; } }
@keyframes rp-out { to { opacity: 0; transform: scale(.85); } }
@keyframes rp-tag-out { to { opacity: 0; transform: translate(-50%, 4px) scale(.9); } }
@media (prefers-reduced-motion: reduce) {
    .rp-unit, .rp-tag, .rp-out .rp-unit, .rp-out .rp-tag, .rp-sprite *, .rp-ring, .rp-burst i, .rp-tag.is-arrive::before { animation: none !important; }
    .rp-ring, .rp-burst { display: none; }
    .rp-tag.is-arrive::before { transform: rotate(-45deg) scale(1); }
    .rp-out .rp-unit, .rp-out .rp-tag { opacity: 0; }
}
.rp-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* While a preview runs, the Stop button fills like a progress bar in step with the trip. */
.rp-running .is-playing { position: relative; overflow: hidden; isolation: isolate; }
.rp-running .is-playing::before { content: ''; position: absolute; inset: 0; z-index: -1; background: rgba(233, 184, 58, .34); transform-origin: left; animation: rp-fill var(--rp-dur, 10s) linear both; }
@media (prefers-reduced-motion: reduce) { .rp-running .is-playing::before { animation: none; transform: none; display: none; } }

/* Vehicle label: the bus number, line code or mode, beside the figure (not rotated with it). */
.rp-label { position: absolute; top: 0; transform: translateY(-50%); padding: 2px 7px; border: 1.5px solid #fff; border-radius: 999px; background: var(--c, #121316); color: var(--t, #fff); font-size: 11px; font-weight: 800; line-height: 1.25; letter-spacing: .02em; white-space: nowrap; box-shadow: 0 1px 4px rgba(18, 19, 22, .4); }
.rp-label[hidden] { display: none; }
.rp-sprite.rp-s-train { transform: scale(.7); }
/* Interchange tag: the two line codes as coloured chips. */
.rp-chips { display: inline-flex; align-items: center; gap: 4px; margin-right: 7px; vertical-align: middle; }
.rp-chip { padding: 1px 6px; border-radius: 6px; background: var(--c); color: var(--t); font-style: normal; font-size: 11px; font-weight: 800; }
.rp-chips b { font-size: 11px; }
/* Film-style captions: a dark lower third with the current scene and a chapter bar that fills as each leg plays. */
.rp-vignette { position: absolute; inset: 0; z-index: 640; pointer-events: none; opacity: 0; transition: opacity .6s; background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 55%, rgba(18, 19, 22, .22) 100%); }
.rp-vignette.on { opacity: 1; }
.rp-caption { position: absolute; z-index: 820; max-width: 440px; margin: 0 auto; padding: 8px 14px 11px; border-radius: 14px; background: rgba(18, 19, 22, .88); color: #fff; box-shadow: 0 8px 24px -8px rgba(0, 0, 0, .55); backdrop-filter: blur(6px); pointer-events: none; animation: rp-cap-up .45s cubic-bezier(.2, .9, .3, 1.1) both; }
.rp-segs { display: flex; gap: 4px; margin-bottom: 8px; }
.rp-segs i { position: relative; flex: 1; height: 3px; overflow: hidden; border-radius: 2px; background: rgba(255, 255, 255, .22); }
.rp-segs i.done { background: var(--c, #e9b83a); }
.rp-segs i.now::after { content: ''; position: absolute; inset: 0; background: var(--c, #e9b83a); transform-origin: left; animation: rp-seg var(--d, 3s) linear both; }
.rp-cap-row { display: flex; align-items: center; gap: 12px; }
.rp-cap-row.in .rp-cap-text { animation: rp-cap-in .5s cubic-bezier(.2, .9, .3, 1) both; }
.rp-cap-icon { position: relative; flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, .12); overflow: hidden; }
.rp-cap-icon .rp-sprite { position: static; transform: scale(.52); filter: none; }
.rp-cap-flag { width: 14px; height: 14px; border-radius: 50%; background: var(--c, #e9b83a); }
.rp-cap-text { display: grid; gap: 1px; min-width: 0; }
.rp-cap-eyebrow { font-size: 10.5px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--c, #e9b83a); }
.rp-cap-title { font-size: 15px; line-height: 1.25; font-weight: 700; }
.rp-cap-sub { font-size: 12px; color: rgba(255, 255, 255, .72); }
.rp-cap-sub:empty { display: none; }
.rp-caption.rp-out, .rp-vignette.rp-out { animation: none; opacity: 0; transition: opacity .3s; transform: translateY(6px); }
@keyframes rp-cap-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes rp-cap-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes rp-seg { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) { .rp-caption, .rp-cap-row.in .rp-cap-text, .rp-segs i.now::after { animation: none; } .rp-segs i.now::after { transform: none; } .rp-vignette { display: none; } }
.rp-still .rp-sprite * { animation-play-state: paused; }
/* The small pictogram in trip cards sits on a light card, not the dark caption. */
.bus-trip-leg .rp-cap-icon, .bus-trip .rp-cap-icon { width: 26px; height: 26px; margin-right: 6px; vertical-align: middle; background: #f4f3ee; border: 1px solid var(--nv-ink, #121316); }
.bus-trip-leg .rp-cap-icon .rp-sprite { transform: scale(.4); }
