/* Warehouse floor TV — full-viewport screens, huge tiles, unattended loop. */
:root {
  --bg: #0a111c;
  --surf: #101b2b;
  --surf2: #182636;
  --bd: #21324a;
  --bd2: #33496b;
  --tx: #eef4fb;
  --tx2: #97abc1;
  --tx3: #647890;
  --green: #2fc088;
  --amber: #f0ad38;
  --red: #e66767;
  --greenb: #0e332a;
  --amberb: #39290f;
  --redb: #3a191d;
  --advance: 30s;
  --pace: #1b6b8a;
  --quality: #8a3d4a;
  --eddie: #3d5a9a;
  --evan: #5a3d8a;
  --floor: #8a6b2a;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--tx);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}
.skip {
  position: absolute;
  left: -999px;
  top: 0;
}
.skip:focus { left: 12px; z-index: 20; background: var(--surf); padding: 8px 12px; color: var(--tx); }

.tv-top {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 12px 28px 10px;
  border-bottom: 3px solid #4d9fea;
  background: linear-gradient(110deg, #163554 0%, #0c1c30 42%, #1a2f22 100%);
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand .mark { height: 36px; width: auto; opacity: 0.92; }
.eyebrow {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tx3);
}
h1 {
  margin: 0;
  font-size: clamp(22px, 2.2vw, 34px);
  font-weight: 750;
  letter-spacing: -0.03em;
}
.clock-block { text-align: center; }
.clock {
  font-size: clamp(32px, 4vw, 56px);
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  line-height: 1;
}
.clock-date { margin-top: 4px; font-size: 15px; color: var(--tx2); }
.status-block { text-align: right; justify-self: end; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--bd);
  background: var(--surf2);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tx3); }
.pill.live { color: var(--green); background: var(--greenb); border-color: rgba(47, 192, 136, 0.34); }
.pill.live .dot { background: var(--green); }
.pill.wait { color: var(--amber); background: var(--amberb); border-color: rgba(240, 173, 56, 0.34); }
.pill.wait .dot { background: var(--amber); }
.pill.bad { color: var(--red); background: var(--redb); border-color: rgba(230, 103, 103, 0.34); }
.pill.bad .dot { background: var(--red); }
.asof {
  margin: 6px 0 0;
  font-size: clamp(15px, 1.15vw, 20px);
  color: var(--tx2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 42vw;
}
.screen-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}
.screen-row .screen-name { margin: 0; }
.skip-slide {
  padding: 2px 10px;
  border: 1px solid var(--bd2);
  border-radius: 999px;
  background: var(--surf2);
  color: var(--tx2);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}
.skip-slide:hover,
.skip-slide:focus-visible { color: var(--tx); border-color: #4d9fea; outline: none; }
.screen-name {
  margin: 4px 0 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tx3);
}

.deck {
  flex: 1 1 auto;
  position: relative;
  min-height: 0;
}
.screen {
  position: absolute;
  inset: 0;
  padding: 18px 28px 12px;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  overflow: hidden;
}
.screen.on {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.screen-title {
  margin: 0;
  font-size: clamp(22px, 2.4vw, 36px);
  font-weight: 750;
  letter-spacing: -0.03em;
}
.screen-sub {
  margin: 4px 0 10px;
  font-size: clamp(16px, 1.35vw, 22px);
  color: var(--tx2);
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.screen[data-screen="0"] { background: linear-gradient(180deg, rgba(47, 192, 136, 0.18), transparent 42%); }
.screen[data-screen="1"] { background: linear-gradient(180deg, rgba(27, 107, 138, 0.22), transparent 42%); }
.screen[data-screen="2"] { background: linear-gradient(180deg, rgba(61, 90, 154, 0.22), transparent 42%); }
.screen[data-screen="3"] { background: linear-gradient(180deg, rgba(138, 61, 74, 0.22), transparent 42%); }
.screen[data-screen="4"] { background: linear-gradient(180deg, rgba(90, 61, 138, 0.22), transparent 42%); }
.screen[data-screen="5"] { background: linear-gradient(180deg, rgba(138, 107, 42, 0.22), transparent 42%); }
.screen[data-screen="0"] .screen-title { color: #8eecc4; }
.screen[data-screen="0"] .card { container-type: size; }
.screen[data-screen="0"] .card .label {
  font-size: clamp(26px, 2.2vw, 40px);
}
.screen[data-screen="0"] .card .window {
  font-size: clamp(16px, 1.4vw, 26px);
}
.screen[data-screen="0"] .card .value {
  font-size: min(52cqh, 44cqw);
  line-height: 0.9;
  align-items: center;
  justify-content: center;
}
.screen[data-screen="0"] .card .value.compact {
  font-size: min(22cqh, 17.2cqw);
  line-height: 0.95;
}
.screen[data-screen="0"] .card:has(.oldest) .value {
  font-size: min(30cqh, 28cqw);
}
.screen[data-screen="0"] .card .detail {
  display: none;
}
.screen[data-screen="0"] .oldest {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 0;
  margin-top: 8px;
  padding-top: 18px;
  border-top: 2px solid rgba(255, 255, 255, 0.12);
}
.screen[data-screen="0"] .oldest-label {
  font-size: clamp(32px, 2.8vw, 48px);
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #f0d48a;
}
.screen[data-screen="0"] .oldest-value {
  font-size: min(30cqh, 28cqw);
  font-weight: 750;
  letter-spacing: -0.04em;
  line-height: 0.92;
  font-variant-numeric: tabular-nums;
}
.screen[data-screen="1"] .screen-title { color: #7fd4f2; }
.screen[data-screen="2"] .screen-title { color: #9db4f5; }
.screen[data-screen="3"] .screen-title { color: #f4a3ae; }
.screen[data-screen="4"] .screen-title { color: #c4a8f5; }
.screen[data-screen="5"] .screen-title { color: #f0d48a; }
.screen-grid {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  gap: 16px;
}
.screen-grid.count-3 {
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 1fr;
}
.screen-grid.count-4 {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}
.screen-grid.count-5 {
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: 1fr 1fr;
}
.screen-grid.count-5 .card:nth-child(1),
.screen-grid.count-5 .card:nth-child(2) { grid-column: span 3; }
.screen-grid.count-5 .card:nth-child(3),
.screen-grid.count-5 .card:nth-child(4),
.screen-grid.count-5 .card:nth-child(5) { grid-column: span 2; }
.screen-grid.count-6 {
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}

.card {
  background: linear-gradient(180deg, #152338, var(--surf));
  border: 1px solid var(--bd2);
  border-left: 10px solid #4d9fea;
  border-radius: 18px;
  padding: 14px 18px 12px;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 8px 24px rgba(0, 0, 0, 0.25);
}
.card.wait {
  border-style: solid;
  border-left-color: var(--amber);
  background: linear-gradient(180deg, #2a2212, #0d1624);
}
.card.load { border-color: var(--red); border-left-color: var(--red); }
.card.live { border-left-color: var(--green); }
.card.trend-good { border-left-color: var(--green); box-shadow: inset 8px 0 24px rgba(47, 192, 136, 0.12); }
.card.trend-bad { border-left-color: var(--red); box-shadow: inset 8px 0 24px rgba(230, 103, 103, 0.14); }
.card.trend-even { border-left-color: #4d9fea; }
.card.heat-none { --heat: #ff8d8d; --heat-edge: #e66767; --heat-wash: rgba(230, 103, 103, 0.42); }
.card.heat-one { --heat: #ffc49a; --heat-edge: #f08a3c; --heat-wash: rgba(240, 138, 60, 0.40); }
.card.heat-two { --heat: #ffe08a; --heat-edge: #e2b423; --heat-wash: rgba(226, 180, 35, 0.38); }
.card.heat-three { --heat: #d4f5a8; --heat-edge: #7dba3a; --heat-wash: rgba(125, 186, 58, 0.36); }
.card.heat-top { --heat: #8eecc4; --heat-edge: #2fc088; --heat-wash: rgba(47, 192, 136, 0.42); }
.card.heat-none,
.card.heat-one,
.card.heat-two,
.card.heat-three,
.card.heat-top {
  border-left-color: var(--heat-edge);
  background: linear-gradient(180deg, var(--heat-wash), #121c2c 62%);
  box-shadow: inset 10px 0 28px var(--heat-wash);
}
.card.heat-none .qualifier,
.card.heat-one .qualifier,
.card.heat-two .qualifier,
.card.heat-three .qualifier,
.card.heat-top .qualifier { color: var(--heat); }
.tier-legend {
  flex: 0 0 auto;
  display: flex;
  gap: 10px;
  margin: 0 0 12px;
}
.tier-legend .step {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(7, 13, 23, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.tier-legend .swatch {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  flex: 0 0 auto;
}
.tier-legend .heat-none .swatch { background: #e66767; }
.tier-legend .heat-one .swatch { background: #f08a3c; }
.tier-legend .heat-two .swatch { background: #e2b423; }
.tier-legend .heat-three .swatch { background: #7dba3a; }
.tier-legend .heat-top .swatch { background: #2fc088; }
.tier-legend .copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.tier-legend .name {
  font-size: clamp(15px, 1.25vw, 22px);
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card .qualifier .cutoff {
  display: block;
  margin-top: 2px;
  font-size: clamp(14px, 1.1vw, 20px);
  font-weight: 650;
  color: var(--tx2);
  line-height: 1.15;
}
.card .kicker {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 8px;
}
.card .label {
  font-size: clamp(18px, 1.6vw, 28px);
  font-weight: 650;
  color: var(--tx);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card .state {
  font-size: clamp(12px, 1vw, 16px);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tx3);
  white-space: nowrap;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}
.card.live .state { color: #042016; background: var(--green); }
.card.wait .state { color: #2a1b04; background: var(--amber); }
.card.load .state { color: #fff; background: var(--red); }
.card .value {
  font-size: clamp(40px, 5.2vw, 96px);
  font-weight: 750;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  line-height: 0.95;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
}
.card .value.compact {
  font-size: clamp(28px, 3.4vw, 60px);
  letter-spacing: -0.03em;
}
.card .value.tight {
  font-size: clamp(22px, 2.4vw, 42px);
  letter-spacing: -0.02em;
}
.card:has(.qualifier) .value {
  flex: 0 1 auto;
}
.card .qualifier {
  flex: 0 0 auto;
  margin-top: 6px;
  font-size: clamp(20px, 1.7vw, 32px);
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1.15;
  color: #f0d48a;
}
.card.wait .value {
  font-size: clamp(32px, 4.2vw, 64px);
  color: var(--amber);
  letter-spacing: 0.04em;
}
.card .window {
  font-size: clamp(13px, 1.1vw, 18px);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #7fd4f2;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card .detail {
  flex: 0 0 auto;
  min-height: 0;
  overflow: hidden;
  display: block;
}
.card .trend {
  margin-top: 4px;
  font-size: clamp(18px, 1.6vw, 26px);
  font-weight: 800;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}
.card .trend.good { color: var(--green); }
.card .trend.bad { color: #ff8a8a; }
.card .trend.even { color: #9ecbff; }
.card .delta,
.card .meaning,
.card .note {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow-wrap: break-word;
  word-break: normal;
}
.card .delta {
  margin-top: 2px;
  font-size: clamp(16px, 1.25vw, 22px);
  color: var(--tx2);
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}
.card .meaning {
  margin-top: 4px;
  font-size: clamp(16px, 1.3vw, 22px);
  color: var(--tx);
  font-weight: 650;
  line-height: 1.25;
}
.card .note {
  margin-top: 2px;
  font-size: clamp(15px, 1.15vw, 20px);
  color: var(--tx3);
  line-height: 1.25;
}
.card.has-list .detail {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}
.card.has-list .review-list {
  flex: 1 1 auto;
  justify-content: center;
  margin-top: 8px;
  gap: 12px;
}
.card .review-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.card .review-list li {
  display: flex;
  align-items: baseline;
  gap: 14px;
  min-width: 0;
  font-size: clamp(18px, 1.45vw, 26px);
  line-height: 1.2;
  font-weight: 650;
}
.card .review-list .stars {
  flex: 0 0 auto;
  letter-spacing: 0.08em;
  font-size: 0.95em;
  white-space: nowrap;
}
.card .review-list .stars .on { color: #f0ad38; }
.card .review-list .stars .off { color: #3d4d63; }
.card .review-list .product {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card .review-list .when {
  flex: 0 0 auto;
  color: var(--tx2);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.card .review-list .more {
  color: var(--tx3);
  font-size: 0.85em;
  font-weight: 650;
}

.map-wrap {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 26vw);
  gap: 16px;
}
.ship-map {
  min-height: 0;
  border: 1px solid var(--bd2);
  border-radius: 18px;
  overflow: hidden;
  background: #070d16;
}
.ship-map.leaflet-container { background: #070d16; font-family: inherit; }
.ship-map.map-fallback { padding: 24px; overflow: auto; }
.map-fallback-note { margin: 0 0 12px; color: var(--amber); font-size: clamp(16px, 1.3vw, 22px); }
.map-side {
  min-height: 0;
  border: 1px solid var(--bd2);
  border-left: 10px solid var(--green);
  border-radius: 18px;
  padding: 18px 20px;
  background: linear-gradient(180deg, #152338, var(--surf));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.map-total { display: flex; flex-direction: column; margin-bottom: 14px; }
.map-total-n {
  font-size: clamp(48px, 5vw, 96px);
  font-weight: 750;
  letter-spacing: -0.04em;
  line-height: 0.95;
  font-variant-numeric: tabular-nums;
}
.map-total-l {
  font-size: clamp(15px, 1.2vw, 20px);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #7fd4f2;
}
.map-speed {
  display: flex;
  flex-direction: column;
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid rgba(47, 192, 136, 0.34);
  border-radius: 14px;
  background: var(--greenb);
}
.map-speed-n {
  font-size: clamp(30px, 3vw, 56px);
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--green);
  font-variant-numeric: tabular-nums;
}
.map-speed-l {
  margin-top: 4px;
  font-size: clamp(14px, 1.1vw, 19px);
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #8eecc4;
}
.map-speed-sub {
  margin: 8px 0 0;
  font-size: clamp(13px, 1vw, 17px);
  color: var(--tx2);
}
.map-fine {
  margin: 6px 0 0;
  font-size: clamp(11px, 0.85vw, 14px);
  color: var(--tx3);
}
.map-states {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.map-states li {
  display: grid;
  grid-template-columns: 2.4em 1fr auto 3em;
  align-items: center;
  gap: 10px;
  font-size: clamp(18px, 1.5vw, 28px);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.map-states .bar { height: 12px; border-radius: 999px; background: var(--bd); overflow: hidden; }
.map-states .bar i { display: block; height: 100%; background: #4d9fea; border-radius: 999px; }
.map-states .pct { color: var(--tx2); text-align: right; }
.leaflet-tooltip.st-label {
  background: transparent;
  border: 0;
  box-shadow: none;
  color: #eef4fb;
  font-size: clamp(13px, 1.05vw, 18px);
  font-weight: 800;
  text-shadow: 0 1px 3px #000, 0 0 6px #000;
  padding: 0;
}
.leaflet-tooltip.st-label::before { display: none; }
.leaflet-tooltip.origin-label {
  background: var(--greenb);
  border: 1px solid var(--green);
  color: #8eecc4;
  font-size: clamp(14px, 1.1vw, 20px);
  font-weight: 800;
  border-radius: 8px;
  box-shadow: none;
}
.leaflet-tooltip-left.origin-label::before { border-left-color: var(--green); }
.leaflet-tooltip-right.origin-label::before { border-right-color: var(--green); }
.leaflet-tooltip-bottom.origin-label::before { border-bottom-color: var(--green); }
.leaflet-tooltip-top.origin-label::before { border-top-color: var(--green); }

.pager {
  flex: 0 0 auto;
  padding: 0 28px 14px;
}
.dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
}
.dots button {
  width: 12px;
  height: 12px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--bd2);
  pointer-events: none;
}
.dots button.on { background: var(--tx); }
.prog {
  height: 4px;
  border-radius: 999px;
  background: var(--bd);
  overflow: hidden;
}
.prog i {
  display: block;
  height: 100%;
  width: 0;
  background: #4d9fea;
  transform-origin: left center;
}
.screen.on ~ .pager .prog i,
.pager .prog i.run {
  animation: fill var(--advance) linear forwards;
}
@keyframes fill {
  from { width: 0; }
  to { width: 100%; }
}

html.kiosk .portal-header,
html.kiosk a.ph-back,
body.kiosk .portal-header,
body.kiosk a.ph-back { display: none !important; }
html.kiosk, body.kiosk {
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
}

/* Floor TV ignores OS “reduce motion” — the loop must keep filling and advancing. */
@media (prefers-reduced-motion: reduce) {
  html:not(.kiosk) .screen { transition: none; }
  html:not(.kiosk) .pager .prog i.run { animation: none; width: 100%; }
}
