:root {
  --rack-bg: #101b29;
  --rack-panel: #182638;
  --rack-line: #52657a;
}
body {
  background:
    radial-gradient(circle at 10% 0, #253d58 0, transparent 30%), #0c1520;
  color: #edf4fb;
}
header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #0b1521;
  border-bottom: 1px solid #314359;
  height: 64px;
  padding: 0 14px;
}
main {
  max-width: none;
  height: calc(100vh - 64px);
  padding: 8px;
}
.active-waves {
  flex: 1;
  min-width: 0;
  height: 58px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 1px;
  padding: 3px 12px;
}
.active-waves > span {
  white-space: nowrap;
  color: #dbe8f6;
  width: 100%;
  text-align: center;
  font-size: clamp(11px, .9vw, 15px);
  line-height: 1.12;
  font-weight: 700;
  animation: wave-in .35s ease-out;
}
.wave-line {
  width: min(508px, 100%);
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: center;
  column-gap: 6px;
  white-space: nowrap;
  color: #dbe8f6;
  font-size: clamp(11px, .9vw, 15px);
  font-weight: 750;
  line-height: 1.12;
  animation: wave-in .35s ease-out;
}
.wave-line b {
  color: #fff;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.wave-line span {
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}
.wave-line .wave-baskets {
  white-space: nowrap;
}
@keyframes wave-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.legend {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  margin: 0;
}
.legend span {
  padding: 5px 9px;
  border-radius: 99px;
  border: 1px solid #53667a;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.legend .red {
  background: #ff2038;
  color: #fff;
}
.legend .green {
  background: #00d94f;
  color: #062d14;
}
.legend .yellow {
  background: #ffe600;
  color: #322c00;
}
.legend .white {
  background: #fff;
  color: #4f5e6c;
}
.racks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 5px;
  height: 100%;
  padding: 0;
}
.rack {
  min-width: 0;
  background: linear-gradient(180deg, #1b2b3e, #142235);
  border: 0;
  border-radius: 7px;
  padding: 3px;
  box-shadow: 0 8px 20px #0005;
  display: grid;
  grid-template-rows: repeat(6, minmax(0, 1fr));
  row-gap: 2px;
}
.rack-level {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  padding: 0;
  height: 100%;
  min-height: 0;
  border: 0;
}
.rack-slot {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  border-radius: 7px;
  display: grid;
  place-items: center;
  padding: 0;
  transition:
    transform 0.15s,
    filter 0.15s;
  box-shadow: inset 0 -3px 0 #0002;
}
.rack-slot:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
}
.rack-slot b {
  font-family: Inter, "Arial Black", "Segoe UI", sans-serif;
  font-size: clamp(20px, 1.8vw, 34px);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.035em;
  line-height: 0.95;
}
.rack-slot small {
  font-size: 10px;
  margin-top: 5px;
}
.rack-slot.red {
  background: #ff1744;
  color: #fff;
  text-shadow: 0 1px 2px #7a0018aa;
}
.rack-slot.overdue {
  animation: overdue-pulse 1.1s ease-in-out infinite;
}
@keyframes overdue-pulse {
  0%,100% { filter: brightness(1); opacity: 1; }
  50% { filter: brightness(1.55); opacity: .35; }
}
.rack-slot.green {
  background: #00e65c;
  color: #043817;
  box-shadow:
    0 0 18px #00d94f55,
    inset 0 -4px 0 #0002;
}
.rack-slot.yellow {
  background: #ffeb00;
  color: #2b2600;
  box-shadow:
    0 0 18px #ffe60055,
    inset 0 -4px 0 #0002;
}
.rack-slot.white {
  background: #f8fbff;
  color: #35465a;
  box-shadow: inset 0 -3px 0 #c9d4df;
}
.rack-detail {
  background: #172638;
  color: #eef5fb;
  border: 1px solid #4a6076;
}
.rack-detail button {
  border: 0;
  border-radius: 8px;
  padding: 8px 12px;
}
@media (max-width: 800px) {
  main {
    padding: 12px;
  }
  .summary {
    position: static;
  }
  .racks {
    display: grid;
    grid-template-columns: 1fr;
    overflow: visible;
    height: auto;
  }
  .active-waves { display: none; }
  .rack {
    width: auto;
    min-width: 0;
  }
  .rack-level {
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
  }
  .rack-slot {
    min-height: 54px;
  }
  .rack-slot b {
    font-size: 18px;
  }
}
