/* rate-flow: <!-- EMBED:rate-flow --> (partials/rate-flow.html). Uses flow.css for
   the frame, switch and status timeline. Without (0-45 %): the truck takes the usual
   route and the cost only shows up on an invoice. With (48-95 %): rate shop prices
   all three routes, the best one (a route plan through the hub) is assigned, and the
   truck leaves with its cost known. Truck speed is the same in both. Base = end frame. */
.rt-road { fill: none; stroke: #E2DCD3; stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }
.rt-shop { fill: none; stroke: #6FBCC8; stroke-width: 4; stroke-linejoin: round; opacity: 0; }
.rt-habit { fill: none; stroke: #847C6E; stroke-width: 3; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; opacity: 0; }
.rt-chosen { fill: none; stroke: #0E6376; stroke-width: 4; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.rt-tag { fill: #CBC3B7; transform-box: fill-box; transform-origin: left center; }
.rt-tb { fill: #0E6376; }
.rt-inv { opacity: 0; }
.rt-truck { transform: translate(390px, 105px); }
.rt-k--wh { background: #EFEBE5; border: 2px solid #0C4A5A; }
.rt-k--hub { width: 12px; height: 12px; border-radius: 50%; background: #FFFFFF; border: 2.5px solid #0E6376; }
.rt-k--rate { width: 22px; height: 7px; background: #CBC3B7; }
.rt-k--truck { width: 18px; height: 10px; background: #0C4A5A; }

@media (prefers-reduced-motion: no-preference) {
  .rt-shop, .rt-habit, .rt-chosen, .rt-tag, .rt-inv, .rt-truck { animation: 10s ease-in-out infinite; }
  .rt-truck, .rt-habit, .rt-chosen { animation-timing-function: linear; }
  .rt-truck { animation-name: rt-truck; } .rt-habit { animation-name: rt-habit; } .rt-chosen { animation-name: rt-chosen; }
  .rt-sa { animation-name: rt-sa; } .rt-sb { animation-name: rt-sb; } .rt-sc { animation-name: rt-sc; }
  .rt-ta { animation-name: rt-ta; } .rt-tb { animation-name: rt-tb; } .rt-tc { animation-name: rt-tc; } .rt-inv { animation-name: rt-inv; }
}
@keyframes rt-truck {
  0%, 2% { transform: translate(90px, 125px); opacity: 1 } 22%, 43% { transform: translate(390px, 125px); opacity: 1 }
  44% { transform: translate(390px, 125px); opacity: 0 } 46% { transform: translate(90px, 105px); opacity: 0 } 48%, 64% { transform: translate(90px, 105px); opacity: 1 }
  71.3% { transform: translate(200px, 105px) } 75.3% { transform: translate(200px, 45px) } 78%, 80% { transform: translate(240px, 45px) }
  82.7% { transform: translate(280px, 45px) } 86.7% { transform: translate(280px, 105px) } 94%, 95% { transform: translate(390px, 105px); opacity: 1 }
  97% { transform: translate(390px, 105px); opacity: 0 } 98% { transform: translate(90px, 125px); opacity: 0 } 100% { transform: translate(90px, 125px); opacity: 1 }
}
@keyframes rt-habit { 0%, 2% { stroke-dashoffset: 1; opacity: 1 } 22%, 43% { stroke-dashoffset: 0; opacity: 1 } 45%, 100% { stroke-dashoffset: 0; opacity: 0 } }
@keyframes rt-chosen {
  0%, 63.9% { stroke-dashoffset: 1; opacity: 0 } 64% { stroke-dashoffset: 1; opacity: 1 } 71.3% { stroke-dashoffset: .738 } 75.3% { stroke-dashoffset: .595 }
  78%, 80% { stroke-dashoffset: .5 } 82.7% { stroke-dashoffset: .405 } 86.7% { stroke-dashoffset: .262 } 94%, 95% { stroke-dashoffset: 0; opacity: 1 }
  97% { stroke-dashoffset: 0; opacity: 0 } 100% { stroke-dashoffset: 1; opacity: 0 }
}
/* Rate shop: each route lit in turn while its rate appears */
@keyframes rt-sa { 0%, 49% { opacity: 0 } 51%, 61% { opacity: 1 } 63%, 100% { opacity: 0 } }
@keyframes rt-sb { 0%, 53% { opacity: 0 } 55%, 61% { opacity: 1 } 63%, 100% { opacity: 0 } }
@keyframes rt-sc { 0%, 57% { opacity: 0 } 59%, 61% { opacity: 1 } 63%, 100% { opacity: 0 } }
@keyframes rt-ta { 0%, 30% { transform: scaleX(0) } 33%, 44% { transform: scaleX(1) } 45%, 49% { transform: scaleX(0) } 52%, 95% { transform: scaleX(1) } 97%, 100% { transform: scaleX(0) } }
@keyframes rt-tb { 0%, 53% { transform: scaleX(0); fill: #CBC3B7 } 56%, 61% { transform: scaleX(1); fill: #CBC3B7 } 63%, 95% { transform: scaleX(1); fill: #0E6376 } 97%, 100% { transform: scaleX(0); fill: #CBC3B7 } }
@keyframes rt-tc { 0%, 57% { transform: scaleX(0) } 60%, 95% { transform: scaleX(1) } 97%, 100% { transform: scaleX(0) } }
@keyframes rt-inv { 0%, 30% { opacity: 0 } 32%, 44% { opacity: 1 } 45%, 100% { opacity: 0 } }
