/* ============================================================
   DSP Station motion pack — dispatch culture for Amazon fleets
   ============================================================ */

/* —— Season / Monday —— */
body.is-peak .ambient-orb.orb-a {
  opacity: 0.7;
}
body.is-monday .app {
  animation: monday-load 0.7s var(--ease-spring) both;
}
@keyframes monday-load {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Snow (Winnipeg winter / peak) */
.snow-layer {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
  display: none;
}
body.is-winter .snow-layer,
body.is-peak .snow-layer {
  display: block;
}
.snowflake {
  position: absolute;
  top: -8px;
  width: 4px;
  height: 4px;
  background: rgba(255, 255, 255, 0.75);
  border-radius: 50%;
  opacity: 0.55;
  animation: snow-fall linear infinite;
}
@keyframes snow-fall {
  to {
    transform: translateY(105vh) translateX(20px);
    opacity: 0.1;
  }
}

/*
 * Van route ribbon — under the canvas; dots track house centers.
 * Host height = 112px (96 scene + 16 ribbon); --van-scene-h must match van-runner SCENE_H.
 * is-next = approaching · is-active = at porch · is-done = delivered
 */
.van-runner.mast-van {
  display: flex;
  flex-direction: column;
  height: calc(var(--van-scene-h, 96px) + var(--van-ribbon-h, 16px)) !important;
  padding-bottom: 0;
}
/* Scene height: one source of truth with portal.css --van-scene-h (96px) */
.van-runner.mast-van #van-runner-canvas {
  flex: 0 0 var(--van-scene-h, 96px);
  height: var(--van-scene-h, 96px) !important;
  max-height: var(--van-scene-h, 96px) !important;
  min-height: var(--van-scene-h, 96px) !important;
}
.route-ribbon.route-ribbon-linked {
  position: relative;
  flex: 0 0 var(--van-ribbon-h, 16px);
  height: var(--van-ribbon-h, 16px);
  margin: 0;
  overflow: hidden;
  pointer-events: none;
  border-top: 1px solid rgba(255, 204, 0, 0.16);
  background: linear-gradient(
    180deg,
    rgba(10, 12, 16, 0.55),
    rgba(16, 20, 30, 0.78)
  );
}
/* Match Winnipeg sky period on host[data-sky] — day ribbon was stuck night-black */
.van-runner.mast-van[data-sky='day'] .route-ribbon.route-ribbon-linked {
  border-top-color: rgba(80, 130, 180, 0.28);
  background: linear-gradient(
    180deg,
    rgba(140, 185, 225, 0.42),
    rgba(55, 85, 120, 0.72)
  );
}
.van-runner.mast-van[data-sky='day'] .route-ribbon-line {
  background: repeating-linear-gradient(
    90deg,
    rgba(255, 220, 100, 0.72) 0 10px,
    transparent 10px 18px
  );
  opacity: 0.92;
}
.van-runner.mast-van[data-sky='dawn'] .route-ribbon.route-ribbon-linked,
.van-runner.mast-van[data-sky='dusk'] .route-ribbon.route-ribbon-linked {
  border-top-color: rgba(255, 140, 70, 0.28);
  background: linear-gradient(
    180deg,
    rgba(60, 35, 55, 0.55),
    rgba(18, 16, 32, 0.82)
  );
}
.route-ribbon-line {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  background: repeating-linear-gradient(
    90deg,
    rgba(255, 204, 0, 0.55) 0 10px,
    transparent 10px 18px
  );
  background-size: 28px 2px;
  /* scroll position set by van-runner — no free-run animation */
  transform: translateY(-50%);
  opacity: 0.88;
}
.route-stops {
  position: absolute;
  inset: 0;
}
.route-stop {
  position: absolute;
  top: 50%;
  width: 7px;
  height: 7px;
  margin: -3.5px 0 0 -3.5px;
  border-radius: 50%;
  background: rgba(255, 204, 0, 0.45);
  box-shadow: 0 0 4px rgba(255, 204, 0, 0.25);
  /* Never transition left/size/class — pool reuses nodes by index; morphs looked like flicker */
  transition: none;
  opacity: 0.7;
}
.route-stop.is-upcoming {
  background: rgba(255, 204, 0, 0.4);
  opacity: 0.55;
}
.route-stop.is-next {
  background: var(--gold);
  opacity: 1;
  box-shadow:
    0 0 0 1px rgba(255, 204, 0, 0.35),
    0 0 8px rgba(255, 204, 0, 0.55);
  animation: stop-pulse 1.6s cubic-bezier(0.45, 0, 0.55, 1) infinite;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
}
.route-stop.is-active {
  background: #fff6b0;
  opacity: 1;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  box-shadow:
    0 0 0 2px rgba(255, 204, 0, 0.4),
    0 0 12px rgba(255, 204, 0, 0.7);
  animation: stop-active 1.35s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}
.route-stop.is-done {
  background: #34c759;
  opacity: 0.75;
  box-shadow: 0 0 6px rgba(52, 199, 89, 0.55);
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  animation: none;
}
/* Soft scale only — smaller amplitude, longer period (less jitter) */
@keyframes stop-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.92;
  }
  50% {
    transform: scale(1.08);
    opacity: 1;
  }
}
@keyframes stop-active {
  0%,
  100% {
    transform: scale(1);
    box-shadow:
      0 0 0 2px rgba(255, 204, 0, 0.4),
      0 0 10px rgba(255, 204, 0, 0.55);
  }
  50% {
    transform: scale(1.1);
    box-shadow:
      0 0 0 2px rgba(255, 204, 0, 0.5),
      0 0 16px rgba(255, 204, 0, 0.8);
  }
}

@media (prefers-reduced-motion: reduce) {
  .route-stop.is-next,
  .route-stop.is-active {
    animation: none;
  }
  .route-stop {
    transition: none !important;
  }
}

body.motion-chill .route-stop,
body.quiet-mode .route-stop {
  transition: none !important;
  animation: none !important;
}

/* —— Login: route chips + package flop + bay door —— */
.auth-route-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 14px;
  opacity: 0.55;
}
.auth-route-chips span {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px dashed rgba(255, 204, 0, 0.3);
  color: var(--mute);
  animation: chip-rise 0.4s var(--ease-out) both;
  animation-delay: calc(var(--ci, 0) * 0.05s);
}

.pkg-flop {
  position: absolute;
  right: 18px;
  top: 72px;
  width: 28px;
  height: 22px;
  pointer-events: none;
  opacity: 0;
  z-index: 5;
}
.pkg-flop.on {
  animation: pkg-flop 0.7s var(--ease-bounce) both;
}
.pkg-flop-box {
  width: 100%;
  height: 100%;
  background: #c4a574;
  border-radius: 2px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  position: relative;
}
.pkg-flop-box::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--gold);
  transform: translateX(-50%);
}
@keyframes pkg-flop {
  0% {
    opacity: 1;
    transform: translate(0, 0) rotate(0);
  }
  40% {
    opacity: 1;
    transform: translate(8px, 40px) rotate(25deg);
  }
  70% {
    transform: translate(14px, 70px) rotate(-12deg);
  }
  100% {
    opacity: 0;
    transform: translate(18px, 100px) rotate(40deg);
  }
}

/* Bay door overlay on successful login */
.bay-door {
  position: fixed;
  inset: 0;
  z-index: 9000;
  pointer-events: none;
  display: flex;
  flex-direction: column;
}
.bay-door.hidden {
  display: none !important;
}
.bay-panel {
  flex: 1;
  background: linear-gradient(180deg, #1a1a1e, #0e0e12);
  border-bottom: 3px solid var(--gold);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 20px;
  transform-origin: top center;
}
.bay-door.opening .bay-panel {
  animation: bay-lift 0.85s var(--ease-out) forwards;
}
.bay-label {
  font-family: var(--font-brand);
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  color: var(--gold);
  text-transform: uppercase;
  opacity: 0.85;
}
@keyframes bay-lift {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-105%);
  }
}
.bay-door .bay-flash {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 40%, rgba(255, 204, 0, 0.25), transparent 55%);
  opacity: 0;
}
.bay-door.opening .bay-flash {
  animation: bay-flash 0.6s ease-out both;
}
@keyframes bay-flash {
  0% {
    opacity: 0.8;
  }
  100% {
    opacity: 0;
  }
}

/* —— Slip totes —— */
.slip-card {
  position: relative;
  padding-left: 16px !important;
}
.slip-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 5px;
  border-radius: 0 3px 3px 0;
  background: repeating-linear-gradient(
    180deg,
    #111 0 2px,
    #ffcc00 2px 3px,
    #111 3px 5px,
    #ffe566 5px 6px
  );
  opacity: 0.85;
}
/* tote-handle removed — clashed with compact icon actions (looked like a stray arc) */
.slip-card .tote-handle {
  display: none !important;
}
.slip-card .manifest-stamp {
  position: absolute;
  right: 72px;
  top: 50%;
  transform: translateY(-50%) rotate(-12deg) scale(0.85);
  font-family: var(--font-brand);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  padding: 4px 8px;
  border-radius: 4px;
  pointer-events: none;
  text-transform: uppercase;
  opacity: 0.88;
}
/* Ready to pull — gold staged stamp */
.slip-card .manifest-stamp.is-staged {
  color: rgba(255, 204, 0, 0.95);
  border: 2px solid rgba(255, 204, 0, 0.65);
}
/* Already pulled — green delivered stamp */
.slip-card .manifest-stamp.is-delivered,
.slip-card.is-downloaded .manifest-stamp {
  color: rgba(52, 199, 89, 0.9);
  border: 2px solid rgba(52, 199, 89, 0.65);
  animation: stamp-slam 0.45s var(--ease-bounce) both;
}
@keyframes stamp-slam {
  0% {
    opacity: 0;
    transform: translateY(-50%) rotate(-25deg) scale(1.4);
  }
  60% {
    opacity: 1;
    transform: translateY(-50%) rotate(-10deg) scale(1.05);
  }
  100% {
    opacity: 0.9;
    transform: translateY(-50%) rotate(-12deg) scale(1);
  }
}
.slip-card.tote-wave {
  animation: tote-wave 0.45s var(--ease-spring) both;
  animation-delay: calc(var(--wave-i, 0) * 0.035s);
}
@keyframes tote-wave {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 204, 0, 0);
  }
  40% {
    border-color: rgba(255, 204, 0, 0.55);
    box-shadow: 0 0 0 2px rgba(255, 204, 0, 0.2);
  }
  100% {
    box-shadow: none;
  }
}

/* Today chip pulse until first download of day */
.chip-btn[data-range='today'].needs-pull.on {
  animation: today-nudge 1.8s ease-in-out infinite;
}
@keyframes today-nudge {
  0%,
  100% {
    box-shadow: 0 2px 12px rgba(255, 204, 0, 0.28);
  }
  50% {
    box-shadow: 0 2px 18px rgba(255, 204, 0, 0.55);
  }
}

/* Progress ring */
.day-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.day-progress-ring {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  transform: rotate(-90deg);
}
.day-progress-ring circle {
  fill: none;
  stroke-width: 4;
}
.day-progress-ring .bg {
  stroke: rgba(255, 255, 255, 0.08);
}
.day-progress-ring .fg {
  stroke: var(--gold);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.55s var(--ease-out);
  filter: drop-shadow(0 0 4px rgba(255, 204, 0, 0.4));
}
.day-progress-meta {
  min-width: 0;
}
.day-progress-meta strong {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
}
.day-progress-meta span {
  font-size: 0.75rem;
  color: var(--mute);
}

/* Empty state stories */
.empty-state[data-story='quiet'] .empty-visual {
  background: linear-gradient(165deg, rgba(27, 42, 74, 0.5), rgba(255, 204, 0, 0.08));
}
.empty-state[data-story='gps'] .empty-visual {
  animation: gps-spin 2.2s linear infinite;
}
.empty-state[data-story='sunrise'] .empty-visual {
  background: radial-gradient(circle at 50% 80%, rgba(255, 204, 0, 0.35), transparent 60%),
    linear-gradient(165deg, rgba(80, 40, 20, 0.4), rgba(20, 20, 30, 0.8));
}
@keyframes gps-spin {
  to {
    transform: rotate(360deg);
  }
}

/* —— Ceremony overlay (conveyor / seal / pallet / email) —— */
.ceremony {
  position: fixed;
  inset: 0;
  z-index: 10040;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 8, 10, 0.55);
  backdrop-filter: blur(6px);
  pointer-events: none;
}
.ceremony.hidden {
  display: none !important;
}
.ceremony-stage {
  width: min(340px, 90vw);
  height: 160px;
  position: relative;
  border-radius: 16px;
  background: linear-gradient(180deg, #1c1c20, #121216);
  border: 1px solid rgba(255, 204, 0, 0.3);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.ceremony-caption {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.04em;
  z-index: 3;
}

/* Conveyor */
.ceremony[data-kind='conveyor'] .belt {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 48px;
  height: 14px;
  background: repeating-linear-gradient(
    90deg,
    #2a2a32 0 12px,
    #3a3a42 12px 24px
  );
  animation: belt-move 0.4s linear infinite;
}
@keyframes belt-move {
  to {
    background-position: 24px 0;
  }
}
.ceremony[data-kind='conveyor'] .c-pkg {
  position: absolute;
  bottom: 62px;
  width: 22px;
  height: 16px;
  background: #c4a574;
  border-radius: 2px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  animation: pkg-belt 1.4s var(--ease-out) both;
}
.ceremony[data-kind='conveyor'] .c-pkg:nth-child(2) {
  animation-delay: 0.12s;
  width: 18px;
  height: 14px;
}
.ceremony[data-kind='conveyor'] .c-pkg:nth-child(3) {
  animation-delay: 0.24s;
  width: 26px;
  height: 12px;
}
.ceremony[data-kind='conveyor'] .c-van {
  position: absolute;
  right: 16px;
  bottom: 56px;
  width: 48px;
  height: 24px;
  background: #1b2a4a;
  border-radius: 3px;
  border-bottom: 2px solid #ffcc00;
}
@keyframes pkg-belt {
  0% {
    left: -30px;
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  85% {
    left: calc(100% - 80px);
    opacity: 1;
  }
  100% {
    left: calc(100% - 70px);
    opacity: 0;
    transform: translateY(-8px);
  }
}

/* Manifest seal */
.ceremony[data-kind='seal'] .seal {
  position: absolute;
  left: 50%;
  top: 42%;
  width: 72px;
  height: 72px;
  margin: -36px 0 0 -36px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe566, #c9a000 55%, #8a7000);
  border: 3px solid rgba(255, 240, 180, 0.6);
  box-shadow: 0 0 30px rgba(255, 204, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-brand);
  font-weight: 800;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  color: #1a1a1c;
  text-align: center;
  line-height: 1.15;
  animation: seal-break 1.3s var(--ease-spring) both;
}
@keyframes seal-break {
  0% {
    transform: scale(0.4) rotate(-20deg);
    opacity: 0;
  }
  40% {
    transform: scale(1.15) rotate(4deg);
    opacity: 1;
  }
  70% {
    transform: scale(1) rotate(0);
  }
  100% {
    transform: scale(1.4);
    opacity: 0;
  }
}

/* Pallet wrap (ZIP) */
.ceremony[data-kind='pallet'] .pallet-stack {
  position: absolute;
  left: 50%;
  top: 38%;
  width: 70px;
  height: 50px;
  margin: -25px 0 0 -35px;
}
.ceremony[data-kind='pallet'] .pallet-stack span {
  display: block;
  height: 12px;
  margin-bottom: 3px;
  background: #c4a574;
  border-radius: 2px;
  box-shadow: 0 1px 0 #a89070;
}
.ceremony[data-kind='pallet'] .wrap {
  position: absolute;
  left: 50%;
  top: 30%;
  width: 0;
  height: 70px;
  margin-left: -42px;
  border: 2px solid rgba(180, 220, 255, 0.45);
  border-radius: 4px;
  animation: stretch-wrap 1.2s var(--ease-out) both;
  box-shadow: inset 0 0 12px rgba(180, 220, 255, 0.15);
}
@keyframes stretch-wrap {
  0% {
    width: 0;
    opacity: 0.3;
  }
  100% {
    width: 84px;
    opacity: 1;
  }
}

/* Email van depart */
.ceremony[data-kind='email'] .mail-van {
  position: absolute;
  left: 10%;
  bottom: 50px;
  width: 56px;
  height: 26px;
  background: #1b2a4a;
  border-radius: 3px;
  border-bottom: 2px solid #ffcc00;
  animation: mail-drive 1.35s var(--ease-out) both;
}
.ceremony[data-kind='email'] .mail-van::after {
  content: '✉';
  position: absolute;
  right: -6px;
  top: -14px;
  font-size: 1rem;
  animation: mail-float 1.35s ease-out both;
}
@keyframes mail-drive {
  0% {
    left: 10%;
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  100% {
    left: 110%;
    opacity: 0.3;
  }
}
@keyframes mail-float {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(-10px) rotate(12deg);
  }
}

/* Busy card modes for ceremony pairing */
.pdf-busy[data-ceremony] .pdf-busy-card {
  max-width: 320px;
}

/* —— Micro interactions —— */
button.brake-blink:not(.secondary):not(.chip-btn):not(.admin-tab):not(.pw-toggle) {
  animation: brake-blink 0.35s ease-out;
}
@keyframes brake-blink {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 42, 42, 0.5);
  }
  40% {
    box-shadow: 0 0 0 4px rgba(255, 42, 42, 0.35), 0 0 16px rgba(255, 204, 0, 0.3);
  }
  100% {
    box-shadow: 0 2px 10px rgba(255, 204, 0, 0.22);
  }
}
button.secondary.blinker-tick {
  animation: blinker-tick 0.4s ease-out;
}
@keyframes blinker-tick {
  0%,
  100% {
    border-color: rgba(255, 204, 0, 0.4);
  }
  30%,
  60% {
    border-color: #ffb020;
    box-shadow: 0 0 12px rgba(255, 176, 32, 0.35);
  }
}
button.is-spinning {
  animation: tire-spin-btn 0.55s var(--ease-out);
}
@keyframes tire-spin-btn {
  to {
    transform: rotate(360deg) scale(1.02);
  }
}

/* Settings glovebox */
#settings-panel.settings-open {
  animation: glovebox 0.4s var(--ease-spring) both;
  border-color: rgba(255, 204, 0, 0.3);
}
@keyframes glovebox {
  0% {
    opacity: 0;
    transform: translateY(-16px) scaleY(0.92);
    transform-origin: top center;
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

/*
 * Sound toggle — must sit above film-grain / empty confetti shells so the
 * corner ambient glow isn’t “cut” by a transparent full-screen layer edge.
 */
.sound-toggle {
  position: fixed;
  bottom: 14px;
  right: 14px;
  z-index: 10080; /* above confetti (10050) + toast (10060) + grain (1) */
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none !important;
  padding: 8px 12px !important;
  border-radius: 999px !important;
  background: rgba(20, 20, 24, 0.92) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  color: var(--mute) !important;
  cursor: pointer;
  margin: 0 !important;
  min-height: 0 !important;
  height: auto !important;
  width: auto !important;
  max-width: none !important;
  box-shadow: 0 0 0 0 transparent !important;
  filter: none !important;
  transform: none !important;
  overflow: visible !important;
  line-height: 1.2 !important;
  isolation: isolate;
  -webkit-appearance: none;
  appearance: none;
}
.sound-toggle:hover,
.sound-toggle:focus,
.sound-toggle:active,
.sound-toggle:focus-visible {
  transform: none !important;
  filter: none !important;
  text-decoration: none !important;
  outline: none !important;
  background: rgba(28, 28, 32, 0.96) !important;
  box-shadow: none !important;
}
.sound-toggle.on {
  color: var(--gold) !important;
  border-color: rgba(255, 204, 0, 0.45) !important;
  background: rgba(20, 20, 24, 0.92) !important;
  /* Soft glow that isn’t clipped by parent overflow */
  box-shadow:
    0 0 0 1px rgba(255, 204, 0, 0.12),
    0 0 18px rgba(255, 204, 0, 0.22) !important;
}
.sound-toggle.on:hover {
  border-color: rgba(255, 204, 0, 0.6) !important;
  background: rgba(28, 28, 32, 0.96) !important;
  box-shadow:
    0 0 0 1px rgba(255, 204, 0, 0.18),
    0 0 22px rgba(255, 204, 0, 0.3) !important;
}
/* Kill global button shimmer / gold fill / pseudo blocks on top of the pill */
.sound-toggle::before,
.sound-toggle::after {
  display: none !important;
  content: none !important;
  animation: none !important;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  inset: auto !important;
  width: 0 !important;
  height: 0 !important;
  opacity: 0 !important;
}
body.large-touch .sound-toggle {
  min-height: 0 !important;
  font-size: 0.65rem !important;
  padding: 8px 12px !important;
}

/* Empty hosts must not paint a full-screen stacking layer over the corner */
.confetti-host:empty,
.toast-host:empty {
  display: none !important;
}

/* 100th slip toast mega */
.toast.toast-mega {
  border-color: rgba(255, 204, 0, 0.7);
  background: linear-gradient(165deg, rgba(60, 50, 20, 0.98), rgba(28, 28, 30, 0.98));
  font-size: 0.95rem;
}

@media (prefers-reduced-motion: reduce) {
  .snowflake,
  .chip-btn[data-range='today'].needs-pull.on,
  .ceremony *,
  .radio-track,
  .pack-box,
  .pack-tote-fill,
  .thermal-slip,
  .thermal-tear {
    animation: none !important;
  }
  .bay-door,
  .ceremony {
    display: none !important;
  }
}

/* ============================================================
   Creative station pack v9 — hybrid dispatch + last-mile
   ============================================================ */

:root {
  --dsp-accent: #ffcc00;
  --dsp-accent-soft: rgba(255, 204, 0, 0.16);
}

/* Shift wash on ambient / mast */
body.shift-morning {
  --shift-tint: rgba(255, 200, 100, 0.06);
}
body.shift-rush {
  --shift-tint: rgba(255, 80, 60, 0.05);
}
body.shift-evening {
  --shift-tint: rgba(100, 140, 255, 0.06);
}
body.shift-night {
  --shift-tint: rgba(80, 60, 140, 0.08);
}
body.station-shell .app {
  box-shadow: inset 0 0 80px var(--shift-tint, transparent);
}
body.is-canada .mast-titles h1 {
  text-shadow: 0 0 24px rgba(255, 204, 0, 0.35);
}
body.is-spring .ambient-orb.orb-b {
  opacity: 0.55;
  filter: hue-rotate(40deg);
}

.shift-chip {
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mute);
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  white-space: nowrap;
}
body.shift-morning .shift-chip {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.35);
}
body.shift-rush .shift-chip {
  color: #fb7185;
  border-color: rgba(251, 113, 133, 0.35);
}
body.shift-evening .shift-chip {
  color: #93c5fd;
  border-color: rgba(147, 197, 253, 0.35);
}
body.shift-night .shift-chip {
  color: #c4b5fd;
  border-color: rgba(196, 181, 253, 0.35);
}
/* Radio chatter strip */
.radio-chatter {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  padding: 6px 12px;
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(27, 42, 74, 0.55), rgba(20, 20, 24, 0.4));
  border: 1px solid rgba(255, 204, 0, 0.14);
  min-height: 32px;
  overflow: hidden;
}
.radio-badge {
  flex: 0 0 auto;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: #0c0c0e;
  background: var(--dsp-accent, var(--gold));
  padding: 3px 7px;
  border-radius: 4px;
}
.radio-viewport {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.radio-track {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.radio-track.radio-flip {
  animation: radio-in 0.35s var(--ease-out) both;
}
@keyframes radio-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* DSP crest */
.welcome-crest-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.dsp-crest {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 28px;
  padding: 0 8px;
  border-radius: 6px;
  font-family: var(--font-brand);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #0c0c0e;
  background: var(--dsp-accent, var(--gold));
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25), 0 0 16px var(--dsp-accent-soft);
}
.welcome-flavor {
  margin: 6px 0 0;
  font-size: 0.78rem;
  font-style: italic;
  opacity: 0.85;
}

/* Chase strip */
.chase-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255, 80, 60, 0.06);
  border: 1px solid rgba(255, 100, 80, 0.22);
  overflow-x: auto;
}
.chase-strip.hidden {
  display: none !important;
}
.chase-label {
  flex: 0 0 auto;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fb7185;
}
.chase-chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
}
.chase-chip {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  padding: 4px 10px !important;
  min-height: 0 !important;
  border-radius: 999px !important;
  background: rgba(20, 20, 24, 0.85) !important;
  border: 1px solid rgba(251, 113, 133, 0.4) !important;
  color: var(--ink) !important;
  cursor: pointer;
  animation: chase-pop 0.4s var(--ease-spring) both;
  animation-delay: calc(var(--ci, 0) * 0.04s);
}
.chase-chip:hover {
  border-color: rgba(255, 204, 0, 0.55) !important;
  color: var(--gold) !important;
}
@keyframes chase-pop {
  from {
    opacity: 0;
    transform: scale(0.85);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* 7-day heat strip */
.week-heat {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.week-heat.hidden {
  display: none !important;
}
.week-heat-label {
  flex: 0 0 auto;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mute);
}
.week-heat-cells {
  display: flex;
  gap: 5px;
  flex: 1;
}
.heat-cell {
  flex: 1;
  min-width: 0;
  height: 28px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.04);
}
.heat-cell .heat-n {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 700;
  color: rgba(12, 12, 14, 0.85);
}
.heat-cell[data-level='1'] {
  background: rgba(255, 204, 0, 0.18);
}
.heat-cell[data-level='2'] {
  background: rgba(255, 204, 0, 0.32);
}
.heat-cell[data-level='3'] {
  background: rgba(255, 204, 0, 0.5);
}
.heat-cell[data-level='4'] {
  background: rgba(255, 204, 0, 0.72);
}
.heat-cell[data-level='0'] .heat-n {
  color: transparent;
}

/* Ticket-style WO cards */
.slip-card.slip-ticket {
  overflow: visible;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0 10px, transparent 10px),
    var(--panel2);
  border-style: solid;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
}
.slip-card.slip-ticket::after {
  /* perforation rail on left */
  content: '';
  position: absolute;
  left: 10px;
  top: 6px;
  bottom: 6px;
  width: 0;
  border-left: 2px dashed rgba(255, 255, 255, 0.12);
  pointer-events: none;
}
.slip-card .ticket-no {
  position: absolute;
  left: 18px;
  top: 6px;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--mute);
  opacity: 0.75;
  pointer-events: none;
}
.slip-card.slip-ticket .slip-main {
  padding-top: 10px;
}
/* Stamp clear of icon actions */
.slip-card .manifest-stamp {
  right: auto;
  left: 52%;
  top: 18px;
  transform: translateX(-20%) rotate(-14deg) scale(0.78);
  z-index: 2;
  background: rgba(12, 12, 14, 0.35);
  backdrop-filter: blur(2px);
}
.slip-card .manifest-stamp.is-staged {
  color: rgba(255, 204, 0, 0.95);
  border: 2px solid rgba(255, 204, 0, 0.65);
}
.slip-card .manifest-stamp.is-delivered,
.slip-card.is-downloaded .manifest-stamp {
  color: rgba(52, 199, 89, 0.95);
  border: 2px solid rgba(52, 199, 89, 0.7);
}
@keyframes stamp-slam {
  0% {
    opacity: 0;
    transform: translateX(-20%) rotate(-28deg) scale(1.35);
  }
  60% {
    opacity: 1;
    transform: translateX(-20%) rotate(-10deg) scale(1.05);
  }
  100% {
    opacity: 0.92;
    transform: translateX(-20%) rotate(-14deg) scale(0.78);
  }
}

/* Bay lanes (kanban) */
.slips-list.is-bay-lanes {
  gap: 0;
}
.bay-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
}
@media (max-width: 720px) {
  .bay-board {
    grid-template-columns: 1fr;
  }
}
.bay-lane {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.18);
  min-height: 120px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.bay-lane-staged {
  border-color: rgba(255, 204, 0, 0.28);
  box-shadow: inset 0 0 0 1px rgba(255, 204, 0, 0.06);
}
.bay-lane-delivered {
  border-color: rgba(52, 199, 89, 0.28);
}
.bay-lane-head {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 2px 8px;
  padding: 10px 12px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.04), transparent);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.bay-lane-head strong {
  font-family: var(--font-brand);
  font-size: 0.88rem;
  letter-spacing: 0.04em;
}
.bay-lane-count {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gold);
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 204, 0, 0.1);
  border: 1px solid rgba(255, 204, 0, 0.22);
}
.bay-lane-sub {
  grid-column: 1 / -1;
  font-size: 0.7rem;
}
.bay-lane-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  flex: 1;
}
.bay-lane-empty {
  margin: 12px 0;
  text-align: center;
  font-size: 0.8rem;
}
.bay-lane .slip-card .manifest-stamp {
  display: none; /* lane already says status */
}

/* Packing-line ceremony */
.ceremony[data-kind='packline'] .packline-stage {
  height: 170px;
}
.ceremony[data-kind='packline'] .pack-lane {
  position: absolute;
  left: 0;
  right: 0;
  top: 36px;
  height: 40px;
}
.ceremony[data-kind='packline'] .pack-box {
  position: absolute;
  top: 8px;
  width: 20px;
  height: 14px;
  background: #c4a574;
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
  animation: pack-slide 1.6s var(--ease-out) both;
}
.ceremony[data-kind='packline'] .pack-box:nth-child(2) {
  animation-delay: 0.15s;
  width: 16px;
  height: 18px;
}
.ceremony[data-kind='packline'] .pack-box:nth-child(3) {
  animation-delay: 0.3s;
  width: 24px;
  height: 12px;
}
@keyframes pack-slide {
  0% {
    left: -30px;
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  70% {
    left: 58%;
    opacity: 1;
  }
  100% {
    left: 62%;
    opacity: 0;
    transform: translateY(18px) scale(0.7);
  }
}
.ceremony[data-kind='packline'] .pack-tote {
  position: absolute;
  right: 28px;
  top: 48px;
  width: 56px;
  height: 48px;
  border: 2px solid rgba(255, 204, 0, 0.55);
  border-radius: 4px 4px 8px 8px;
  background: rgba(27, 42, 74, 0.55);
  overflow: hidden;
}
.ceremony[data-kind='packline'] .pack-tote-fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0;
  background: linear-gradient(180deg, #d4b896, #c4a574);
  animation: tote-fill 1.5s 0.2s var(--ease-out) both;
}
.ceremony[data-kind='packline'] .pack-tote-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.7);
  z-index: 1;
}
@keyframes tote-fill {
  to {
    height: 78%;
  }
}
.ceremony[data-kind='packline'] .pack-tape {
  position: absolute;
  left: 20%;
  top: 28px;
  width: 40%;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  animation: tape-flash 0.6s 1.1s ease both;
  opacity: 0;
}
@keyframes tape-flash {
  0% {
    opacity: 0;
    transform: scaleX(0.2);
  }
  40% {
    opacity: 1;
    transform: scaleX(1);
  }
  100% {
    opacity: 0;
  }
}

/* Thermal tear (single PDF) */
.ceremony[data-kind='thermal'] .thermal-stage {
  height: 168px;
}
.ceremony[data-kind='thermal'] .thermal-slip {
  position: absolute;
  left: 50%;
  top: 22px;
  width: 120px;
  height: 100px;
  margin-left: -60px;
  background: linear-gradient(180deg, #f5f0e6, #e8e0d0);
  border-radius: 3px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  animation: thermal-print 1.1s var(--ease-out) both;
  overflow: hidden;
}
.ceremony[data-kind='thermal'] .thermal-lines {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 12px;
  bottom: 20px;
  background: repeating-linear-gradient(
    180deg,
    rgba(30, 30, 40, 0.2) 0 2px,
    transparent 2px 8px
  );
}
.ceremony[data-kind='thermal'] .thermal-tear {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 10px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.08));
  clip-path: polygon(
    0 0,
    8% 100%,
    16% 0,
    24% 100%,
    32% 0,
    40% 100%,
    48% 0,
    56% 100%,
    64% 0,
    72% 100%,
    80% 0,
    88% 100%,
    96% 0,
    100% 100%,
    100% 100%,
    0 100%
  );
  animation: tear-rip 0.45s 1.05s var(--ease-out) both;
}
@keyframes thermal-print {
  from {
    transform: translateY(-40px);
    opacity: 0.3;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
@keyframes tear-rip {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(8px);
    opacity: 0.85;
  }
}

/* Inspection bay photo gallery */
body.gallery-open .photo-gallery {
  background: radial-gradient(ellipse at 50% 30%, rgba(40, 50, 70, 0.55), rgba(6, 6, 8, 0.92));
}
body.gallery-open .photo-gal-card {
  border-color: rgba(255, 204, 0, 0.28);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 204, 0, 0.08);
}
body.gallery-open .photo-gal-head h2::before {
  content: 'INSPECTION BAY · ';
  font-size: 0.62em;
  letter-spacing: 0.1em;
  color: var(--gold);
  font-weight: 800;
}
body.gallery-open .photo-thumbs {
  border-top: 1px solid rgba(255, 204, 0, 0.12);
  padding-top: 10px;
  background: linear-gradient(180deg, rgba(255, 204, 0, 0.04), transparent);
}

/* Login dispatch desk */
#view-login.auth-hero .auth-route-chips span {
  border-color: rgba(255, 204, 0, 0.25);
}
body.shift-morning #view-login .auth-glow {
  opacity: 0.85;
}

/* Day progress as stronger "today dial" */
.day-progress {
  background: linear-gradient(90deg, var(--dsp-accent-soft), rgba(255, 255, 255, 0.02));
  border-color: rgba(255, 204, 0, 0.14);
}
.day-progress-ring .fg {
  stroke: var(--dsp-accent, var(--gold));
}


