.pm-scene {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  margin: 0 0 14px;
  color: var(--kls-graphite, #373a3c);
  font-family: var(--sans, sans-serif);
  font-variant-numeric: tabular-nums;
  container-type: inline-size;
}
.pm-scene *, .pm-scene *::before, .pm-scene *::after { box-sizing: border-box }
.pm-scene button {
  padding: 5px 0;
  color: #664725;
  background: transparent;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  font: 600 .77rem/1.35 var(--sans, sans-serif);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: #b79c73;
}
.pm-scene button:hover { text-decoration-color: currentColor }
.pm-scene button:focus-visible { outline: 2px solid #965a24; outline-offset: 3px }
.pm-vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* The neutral and revealed banks share the very same positions and relief. */
.pm-flow { display: block; width: 100%; overflow: hidden; touch-action: pan-y }
.pm-flow.is-lensed { cursor: none }
.pm-slip { --face: url(#pm-paper); --edge: #b29a72; --ink: #8a7351 }
.pm-red { --face: url(#pm-red); --edge: #af644d; --ink: #733e31 }
.pm-orange { --face: url(#pm-orange); --edge: #b78038; --ink: #795022 }
.pm-green { --face: url(#pm-green); --edge: #79935c; --ink: #46633e }
.pm-slip-depth { fill: #b7a081; stroke: #9d8769; stroke-width: .65 }
.pm-slip-face { fill: var(--face); stroke: var(--edge); stroke-width: 1.3 }
.pm-slip-ink { stroke: var(--ink); stroke-width: 1.5 }
.pm-flow:focus-visible { outline: 2px solid #956b3e; outline-offset: 2px; border-radius: 4px }
.pm-endpoint { font: 600 13px var(--sans, sans-serif) }
.pm-speech { font: 500 15px var(--sans, sans-serif); fill: var(--kls-graphite, #373a3c) }
.pm-stream-tools, .pm-route-footer, .pm-lane-head, .pm-clock, .pm-report-nav {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.pm-stream-tools { margin: 0 0 4px; border-block-end: 1px solid #c9baa3; padding: 6px 0 7px }
.pm-stream-tools > span, .pm-route-footer small { color: #705c42; font-size: .75rem; line-height: 1.35 }
.pm-touch-hint { display: none }
.pm-statuses { display: none; margin: 10px 0; padding: 0; list-style: none; gap: 4px; font-size: .79rem }
.pm-statuses i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: .45em }
.pm-key-red { background: #ba7058 }.pm-key-orange { background: #c18a3c }.pm-key-green { background: #65834f }
@media (hover: none), (pointer: coarse) {
  .pm-mouse-hint { display: none }
  .pm-touch-hint { display: inline }
}

/* Both lines receive the same orders, including two that arrive late in the shift. */
.pm-routes { padding: 9px 0 3px; --rail-margin: 8% }
.pm-stations { display: flex; justify-content: space-between; margin: 11px var(--rail-margin) 6px; position: relative; height: 2rem }
.pm-stations b {
  line-height: 1.1; position: absolute; top: 50%; transform: translate(-50%,-50%);
  font-weight: 500; font-size: clamp(.68rem,2.5cqw,.9rem); text-align: center;
}
.pm-stations b:nth-child(1) { left: 0 }.pm-stations b:nth-child(2) { left: 33.333% }
.pm-stations b:nth-child(3) { left: 66.667% }.pm-stations b:nth-child(4) { left: 100% }
.pm-lane { position: relative; padding: 4px 0; border-top: 1px solid #c9bca4 }
.pm-lane-head b { color: #695640; font: 600 .83rem/1.15 var(--sans, sans-serif) }
.pm-lane-head { display:flex; align-items:center; justify-content:space-between }
.pm-count-label { color: #6d563a; font: 500 .77rem/1 var(--sans, sans-serif) }
.pm-count-label strong { margin-left:.2em; font: 500 1.24rem/1 var(--serif, Georgia, serif) }
.pm-lane.auto .pm-count-label { color: #4b6944 }
.pm-rail { position: relative; height: 30px; margin: 4px var(--rail-margin) 0 }
.pm-waypoints {
  position: absolute; top: 64%; height: 2px; left: 0; right: 0;
  background: linear-gradient(90deg,#aa7a43,#86623b);
}
.pm-lane.manual .pm-waypoints { background: linear-gradient(to right,transparent 0 33.333%,#9b7f59 33.333% 100%) }
.pm-lane.manual .pm-waypoints::before {
  content: ''; display: block; width: 33.333%; height: 2px;
  background: repeating-linear-gradient(90deg,#98734f 0 5px,transparent 5px 10px);
}
.pm-waypoints i { position: absolute; top: -3px; width: 8px; height: 8px; transform: translateX(-50%); border-radius: 50%; background: #eadcc6; border: 1.5px solid #91724e }
.pm-ticket {
  position: absolute; left: 0; top: 4px; display: block; width: clamp(23px,5cqw,35px); height: clamp(17px,3.5cqw,24px);
  border-radius: 2px; transform: translate(calc(-50% + var(--dx, 0px)),var(--dy,0px)) skewX(-11deg);
  border: 1px solid #b39975; background: linear-gradient(135deg,#fffbf0,#e7d0a6); box-shadow: 1px 2px 3px #694f3245;
}
.pm-ticket::before, .pm-ticket::after { content: ''; position: absolute; left: 17%; top: 28%; width: 52%; height: 1px; background: #a98a61 }
.pm-ticket::after { top: 51%; width: 38% }
.pm-ticket[hidden] { display:none }
.pm-ticket.done b {
  position: absolute; right: -4px; bottom: -3px; width: 9px; height: 9px; border-radius: 50%; border: 1px solid #f1edda; background: #678357;
}
.pm-annotation { min-height: 1.6em; padding: 1px 0 3px; color: #6c563c; font: italic .78rem/1.25 var(--sans, sans-serif) }
.pm-lane.auto .pm-annotation { color: #466449 }
.pm-route-footer { margin-top: 3px; border-top: 1px solid #c9bca4; padding-top: 4px }
.pm-shift-clock {
  display: inline-flex; align-items: center; gap: .4em; flex: none; padding-block: .18em;
  color: #695032; font: 600 1rem/1.25 var(--sans, sans-serif); font-variant-numeric: tabular-nums;
}

/* The report is the one visual that is deliberately a separate window. */
.pm-report {
  border: 1px solid #a98759; border-radius: 12px; background: linear-gradient(120deg,#23322e,#1d2827 52%,#182323);
  box-shadow: 0 11px 22px -12px #4238257a, inset 0 0 0 2px #c4ac7f25;
  color: #f1e9d9; padding: clamp(12px,2.4%,20px);
}
.pm-report figcaption { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid #a995724d }
.pm-report figcaption strong { font: 500 clamp(1rem,3.8cqw,1.46rem)/1.02 var(--serif, Georgia, serif); letter-spacing: -.025em }
.pm-report-date { color: #efc991; font-size: .86rem; font-weight: 600; white-space: nowrap }
.pm-feed { display:flex; align-items:center; gap:8px; min-height:30px; margin-top:5px; padding:6px 4px 0; border-top:1px solid #a995724d; color:#e9dfcb; font:500 .82rem/1.3 var(--sans,sans-serif) }
.pm-feed i { flex:none; width:6px; height:6px; border-radius:50%; background:#c3b69a }
.pm-feed[data-channel="0"] i { background:#e6bd82; box-shadow:0 0 7px #dda76866 }
.pm-feed[data-channel="1"] i { background:#92ccad; box-shadow:0 0 7px #92ccad66 }
.pm-plots { display: grid; grid-template-columns: 1.12fr 1fr; gap: 12px; padding: 10px 0 }
.pm-plots > div { min-width: 0 }
.pm-plots > div > b { font: 500 clamp(.85rem,2.8cqw,1.05rem)/1 var(--serif, Georgia, serif); color: #faedcf }
.pm-bar-chart {
  display: grid; grid-template-columns: repeat(3,1fr); gap: 5px; margin: 16px 0 2px;
  background: repeating-linear-gradient(0deg,transparent 0 16px,#c6b99931 16px 17px) 0 0 / 100% 64px no-repeat;
}
.pm-bar-group { text-align: center }
.pm-bar-group > div { display: flex; gap: 4px; height: 64px; align-items: end; justify-content: center; border-bottom: 1px solid #bbb09c73 }
.pm-bar-group small { display: block; font-size: .65rem; color: #d4d3c5; margin-top: 3px; line-height: 1.15 }
.pm-column {
  position: relative; display: block; height: calc(var(--v)*100%); width: min(24px,29%);
  border-radius: 2px 2px 0 0; background: linear-gradient(0deg,var(--color),var(--highlight));
  transition: height .62s cubic-bezier(.22,.72,.24,1);
}
.pm-report .c0 { --color: #ba8854; --highlight: #e7c38b }
.pm-report .c1 { --color: #589b89; --highlight: #a6ccba }
.pm-column em { position: absolute; top: -11px; left: 50%; transform: translateX(-50%); color: #f2e7d3; font: 600 .58rem/1 var(--sans,sans-serif) }
.pm-channel-key { display: flex; justify-content: center; gap: 11px; padding-top: 4px; color: #c8cebf; font-size: .67rem }
.pm-channel-key span::before { content: ''; display: inline-block; background: var(--highlight); width: 7px; height: 7px; border-radius: 2px; margin-right: 4px }
.pm-cost { border-left: 1px solid #a995724d; padding-left: 12px }
.pm-cost-row { display: grid; grid-template-columns: 1fr auto; gap: 4px; margin-top: 9px }
.pm-cost-row > div { grid-row: 2; grid-column: 1/-1; height: 6px; background: #a7b2a123; border-radius: 3px; overflow: hidden }
.pm-cost-row i { display: block; height: 100%; width: calc(var(--v)*100%); border-radius: inherit; background: linear-gradient(90deg,var(--color),var(--highlight)); transition: width .62s cubic-bezier(.22,.72,.24,1) }
.pm-cost-row small,.pm-cost-row b { font-size: .72rem; line-height: 1.1; font-style: normal }
.pm-cost-row b { color: #f2e7d3 }
.pm-report table { border-collapse: collapse; table-layout: fixed; width: 100%; margin: 0; font-size: clamp(.7rem,2.2cqw,.86rem); line-height: 1.22 }
.pm-report th,.pm-report td { border: 0; text-align: right; padding: 4px 3px; background: none; font-weight: 450; vertical-align: middle; color: #eee8db; border-top: 1px solid #b3ad9040 }
.pm-report th:first-child { width: 44%; text-align: left; color: #e9e3d3 }
.pm-report thead th { color: #d4d3c5; font-size: .95em; font-weight: 600 }
.pm-report td { font-weight: 550 }
.pm-report[data-final=true] tbody tr:last-child :is(td,th) { background: #bc925225; color: #ffe4af }
.pm-report tbody tr:last-child :is(td,th) { background: #bbc1a80b }
.pm-report td.pm-changed { animation: pm-number-pulse .75s ease-out }
@keyframes pm-number-pulse { from { background-color: #d8bb7744 } to { background-color: transparent } }
@container (min-width: 540px) {
  .pm-stations { margin: 16px max(105px,16%) 5px 28% }
  .pm-stations b { white-space: nowrap; font: 500 1rem/1.1 var(--serif, Georgia, serif) }
  .pm-stations b:first-child { white-space: normal; width: 108px }
  .pm-lane { padding: 10px 0; border-top: 0 }
  .pm-lane-head { position: absolute; inset: 10px 0 auto; height: 42px; pointer-events: none }
  .pm-lane-head b { max-width: 25%; color: var(--kls-graphite, #373a3c); font: 500 1.08rem/1.13 var(--serif, Georgia, serif) }
  .pm-count-label strong { font-size: 1.36rem }
  .pm-rail { margin: 0 max(105px,16%) 0 28%; height: 42px }
  .pm-ticket { top: 9px; box-shadow: 1px 3px 5px #694f324d }
  .pm-ticket.done b::after { content: ''; position: absolute; inset: 2px 1px 2px 2px; border: solid white; border-width: 0 0 1px 1px; transform: rotate(-45deg) }
  .pm-annotation { margin-left: 34%; padding: 2px 0 3px 11px; border-left: 1px solid #b19771; font-size: .88rem }
  .pm-route-footer { margin-top: 9px }
  .pm-route-footer small { font-size: .86rem }
  .pm-report .pm-plots { padding-block: 14px }
  .pm-bar-chart { margin-top: 17px; background-size: 100% 78px }
  .pm-bar-group > div { height: 78px }
  .pm-column { width: min(31px,32%) }
  .pm-column em { top: -13px; font-size: .71rem }
  .pm-bar-group small, .pm-channel-key { font-size: .76rem }
  .pm-cost-row { margin-top: 13px }
  .pm-cost-row > div { height: 11px; border-radius: 2px }
  .pm-cost-row b, .pm-cost-row small { font-size: .84rem }
  .pm-report table { font-size: .94rem }
  .pm-report tbody tr:last-child td { font-size: 1.02rem }
}
@container (max-width: 510px) {
  .pm-report figcaption { align-items: baseline }
  .pm-report-date { font-size: .76rem }
}
@container (max-width: 400px) {
  .pm-plots { grid-template-columns: 1fr; gap: 7px }
  .pm-cost { border-left: 0; padding: 7px 0 0; border-top: 1px solid #a995724d }
  .pm-cost-row { margin-top: 6px }
  .pm-bar-group > div { height: 49px }
  .pm-bar-chart { background-size: 100% 49px }
  .pm-endpoint { font-size: 12px }
  .pm-stations b { max-width: 23%; font-size: .72rem }
}
@media (prefers-reduced-motion: reduce) {
  .pm-statuses { display: grid }
  .pm-column,.pm-cost-row i { transition: none }
  .pm-report td.pm-changed { animation: none }
}
