.freight-demo {
  padding-block: clamp(3.1rem, 7.3vw, 6.5rem);
  background: #e8f0e3;
  scroll-margin-top: 88px;
}
.freight-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  margin-bottom: 1.75rem;
}
.freight-heading h2 { font-size: clamp(2.35rem, 5vw, 4rem); margin-block: .55rem .6rem; }
.freight-heading p:not(.eyebrow) { color: var(--muted); max-width: 57ch; }
.freight-switch { display: flex; flex-wrap: wrap; gap: .35rem; padding: .3rem; border: 1px solid #cedecb; border-radius: .65rem; background: #dce9d8; }
.freight-switch button {
  min-height: 44px;
  padding: .43rem .85rem;
  border: 1px solid transparent;
  border-radius: .43rem;
  background: transparent;
  color: var(--green);
  font-weight: 700;
  font-size: .9375rem;
  transition: background-color .17s, color .17s, box-shadow .17s;
}
.freight-switch button:hover { background: #f5faf1; }
.freight-switch button[aria-pressed="true"] { background: var(--green); color: white; box-shadow: 0 2px 5px #08231921; }

.freight-simulator {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 25%);
  overflow: hidden;
  border: 1px solid #214a39;
  border-radius: .88rem;
  box-shadow: 0 20px 45px #122d2122;
  background: #0a251c;
  color: #f4fcf0;
}
.freight-simulator :focus-visible { outline-color: var(--lime); }
.freight-stage { display: grid; place-items: center; min-width: 0; background: radial-gradient(ellipse at 36% 75%, #204c36 0, #133b2a 30%, #0a251c 74%); }
.freight-graphic { display: block; width: 100%; height: auto; }
.scene-secondary-roads { fill: none; stroke: #80a68c; stroke-width: 1.3; opacity: .28; }
.scene-road, .scene-road-center, .scene-feeder, .scene-signal { fill: none; stroke-linecap: round; }
.scene-road { stroke: #36634c; stroke-width: 17; opacity: .82; }
.scene-road-center { stroke: #7da49a; stroke-width: 1.65; stroke-dasharray: 8 8; opacity: .68; }
.scene-feeder { stroke: #78b39c; stroke-width: 2; stroke-dasharray: 6 8; opacity: .52; }
.scene-signal { stroke: url(#freight-lane-gradient); stroke-width: 4.1; filter: drop-shadow(0 0 6px #b3faa255); }
.feeder-signal { stroke: #8fe3bf; stroke-width: 2.7; }
.scene-stop { color: #c3e4b5; }
.scene-halo { fill: #aef692; opacity: 0; transform-origin: center; transform-box: fill-box; }
.scene-ring { fill: #0b2a20; stroke: #7da489; stroke-width: 2; transition: fill .24s, stroke .24s; }
.scene-stop.is-active .scene-ring { stroke: var(--lime); stroke-width: 2.8; fill: #204b35; }
.scene-stop.is-active .scene-halo { opacity: .24; }
.freight-demo[data-playback="playing"] .scene-stop.is-active .scene-halo { animation: freight-stop-pulse 1s ease-out 3; }
.scene-stop.is-delivered { color: #defbaa; }
.scene-stop.is-delivered .scene-ring { fill: #397347; stroke: #c7f781; }
.scene-check { fill: none; stroke: #efffd3; opacity: 0; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; transition: opacity .22s; }
.scene-delivery.is-delivered .scene-check { opacity: 1; }
.scene-delivery.is-delivered use { opacity: 0; }
.scene-label { fill: #d7ecda; font-family: inherit; font-size: 14px; font-weight: 770; letter-spacing: .065em; text-anchor: middle; }
.scene-package { filter: drop-shadow(0 2px 5px #05191099); }
.scene-truck { filter: drop-shadow(0 1px 8px #d6fb8840); }
.scene-speed-mark { stroke: #d6fb88; stroke-width: 1.5; stroke-linecap: round; opacity: 0; }
.scene-truck.is-moving .scene-speed-mark { opacity: .72; }
@keyframes freight-stop-pulse {
  from { opacity: .42; transform: scale(.75); }
  to { opacity: 0; transform: scale(1.56); }
}

.freight-panel {
  padding: clamp(1.15rem, 2.3vw, 1.7rem);
  border-left: 1px solid #2d5141;
  background: #103428;
}
.freight-panel .eyebrow { color: #a9cbae; font-size: .77rem; letter-spacing: .1em; }
.freight-panel .eyebrow span { width: 1rem; }
.freight-panel h3 { font-size: clamp(1.38rem, 2.1vw, 1.8rem); margin-top: .4rem; letter-spacing: -.04em; }
.freight-phase-list { list-style: none; display: grid; gap: .38rem; padding: 0; margin: .9rem 0 0; }
.freight-phase-list li {
  display: grid;
  grid-template-columns: 12px 1fr;
  align-items: start;
  gap: .62rem;
  padding: .4rem .4rem;
  border-radius: .35rem;
  transition: background-color .2s;
}
.freight-phase-list li > span { margin-top: .34rem; width: 11px; height: 11px; border: 1.5px solid #81aa8d; border-radius: 50%; }
.freight-phase-list li[aria-current="step"] { background: #28553d; }
.freight-phase-list li[aria-current="step"] > span, .freight-phase-list li.is-complete > span { background: var(--lime); border-color: var(--lime); }
.freight-phase-list strong, .freight-phase-list small { display: block; }
.freight-phase-list strong { color: #f1fcf1; font-size: .94rem; line-height: 1.25; }
.freight-phase-list small { margin-top: .15rem; color: #c4ddc8; font-size: .82rem; line-height: 1.34; }

.freight-controls { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: .75rem 1.75rem; flex-wrap: wrap; min-height: 72px; padding: .8rem 1.4rem; border-top: 1px solid #2d5141; }
.freight-controls p { color: #dcecdc; font-size: .91rem; }
.freight-playback { display: flex; flex-wrap: wrap; gap: .55rem 1rem; align-items: center; }
.freight-playback progress { appearance: none; width: clamp(3rem, 11vw, 8.5rem); height: 5px; border: 0; border-radius: 10px; overflow: hidden; background: #3d5f4d; accent-color: var(--lime); }
.freight-playback progress::-webkit-progress-bar { background: #3d5f4d; }
.freight-playback progress::-webkit-progress-value { background: var(--lime); }
.freight-playback progress::-moz-progress-bar { background: var(--lime); }
.freight-playback button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  min-height: 40px;
  min-width: 163px;
  padding: .4rem .7rem;
  border: 1px solid #5a8064;
  border-radius: .45rem;
  background: #164233;
  color: #effeec;
  font-weight: 670;
  font-size: .875rem;
}
.freight-playback button:hover { background: #235b42; }
.freight-play-icon { width: 1rem; height: 1rem; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; fill: none; }

@media (max-width: 850px) {
  .freight-simulator { grid-template-columns: minmax(0, 1fr); }
  .freight-panel { border-left: 0; border-top: 1px solid #2d5141; }
  .freight-phase-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .freight-phase-list li { align-items: start; gap: .4rem; }
}
@media (max-width: 510px) {
  .freight-phase-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .freight-controls { padding-inline: .95rem; }
  .scene-label { font-size: 17px; letter-spacing: 0; }
  .freight-playback { flex: 1 1 100%; }
  .freight-playback progress { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .freight-demo[data-playback="playing"] .scene-stop.is-active .scene-halo { animation: none; }
  .freight-playback { display: none; }
}
