/* Цеховые сцены НЭК (склад / сортировка / переработка) */
.scene {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  margin-bottom: 0.85rem;
  min-height: 96px;
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  color: #f1f5f9;
}
.scene--web { box-shadow: var(--shadow); }
.scene--compact { min-height: 78px; margin-bottom: 0.75rem; }
.scene__copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.2rem;
  padding: 0.85rem 1rem;
  flex: 1;
}
.scene__copy strong { font-size: 1.05rem; letter-spacing: -0.02em; color: #fff; }
.scene__copy span { font-size: 0.8rem; color: rgba(226, 232, 240, 0.85); }
.art {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 42%;
  pointer-events: none;
  z-index: 1;
}

.scene--warehouse {
  background:
    radial-gradient(ellipse at 20% 0%, rgba(56, 189, 248, 0.22), transparent 55%),
    linear-gradient(135deg, #0f172a 0%, #1e293b 55%, #0c4a6e 100%);
}
.art-floor {
  position: absolute; left: 8%; right: 8%; bottom: 14px; height: 3px;
  background: rgba(148, 163, 184, 0.35); border-radius: 2px;
}
.art-cart {
  position: absolute; bottom: 18px; width: 44px; height: 28px;
  background: #64748b; border-radius: 4px 4px 2px 2px;
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.12);
}
.art-cart::before {
  content: ''; position: absolute; left: 6px; right: 6px; top: -10px; height: 10px;
  border: 2px solid #94a3b8; border-bottom: 0; border-radius: 6px 6px 0 0;
}
.art-cart i {
  position: absolute; bottom: -6px; width: 10px; height: 10px; border-radius: 50%;
  background: #1e293b; border: 2px solid #94a3b8;
}
.art-cart i:first-child { left: 4px; }
.art-cart i:nth-child(2) { right: 4px; }
.art-cart b {
  position: absolute; top: 4px; width: 10px; height: 14px; border-radius: 2px;
  background: #38bdf8; opacity: 0.85;
}
.art-cart b:nth-child(3) { left: 8px; }
.art-cart b:nth-child(4) { right: 8px; background: #f59e0b; }
.art-cart--a { right: 52%; animation: nekCartBob 2.8s ease-in-out infinite; }
.art-cart--b { right: 14%; animation: nekCartBob 2.8s ease-in-out infinite 0.6s; }
@keyframes nekCartBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.scene--conveyor {
  background:
    radial-gradient(ellipse at 80% 40%, rgba(45, 212, 191, 0.22), transparent 50%),
    linear-gradient(120deg, #0f172a, #134e4a 70%);
}
.art-belt {
  position: absolute; left: 6%; right: 6%; top: 48%; height: 18px;
  background: #334155; border-radius: 4px; overflow: hidden;
  box-shadow: 0 4px 0 #0f172a;
}
.art-belt em {
  position: absolute; top: 0; bottom: 0; width: 18%;
  background: repeating-linear-gradient(90deg, transparent 0 6px, rgba(45, 212, 191, 0.35) 6px 10px);
  animation: nekBeltRun 1.6s linear infinite;
}
.art-belt em:nth-child(1) { left: 0; }
.art-belt em:nth-child(2) { left: 25%; animation-delay: -0.4s; }
.art-belt em:nth-child(3) { left: 50%; animation-delay: -0.8s; }
.art-belt em:nth-child(4) { left: 75%; animation-delay: -1.2s; }
@keyframes nekBeltRun {
  from { transform: translateX(-20%); }
  to { transform: translateX(20%); }
}
.art-box {
  position: absolute; top: 34%; width: 18px; height: 14px; border-radius: 2px;
  background: #fbbf24; box-shadow: 0 2px 0 rgba(0,0,0,0.25);
  animation: nekBoxRide 3.2s linear infinite;
}
.art-box--1 { left: 12%; }
.art-box--2 { left: 12%; background: #38bdf8; animation-delay: -1.6s; }
@keyframes nekBoxRide {
  0% { left: 8%; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { left: 78%; opacity: 0; }
}
.art-roll {
  position: absolute; top: 44%; width: 14px; height: 14px; border-radius: 50%;
  background: #64748b; border: 2px solid #94a3b8;
}
.art-roll--l { left: 4%; }
.art-roll--r { right: 4%; }

.scene--scanner {
  background:
    radial-gradient(ellipse at 75% 30%, rgba(96, 165, 250, 0.3), transparent 55%),
    linear-gradient(145deg, #0f172a, #1e3a5f 65%, #0f172a);
}
.art-gun {
  position: absolute; right: 28%; top: 28%; width: 42px; height: 18px;
  background: #475569; border-radius: 4px 10px 10px 4px;
  transform: rotate(-18deg);
  box-shadow: inset 0 -3px 0 #334155;
}
.art-gun::after {
  content: ''; position: absolute; left: -10px; top: 4px; width: 12px; height: 10px;
  background: #64748b; border-radius: 2px;
}
.art-beam {
  position: absolute; right: 18%; top: 36%; width: 52px; height: 3px;
  background: linear-gradient(90deg, rgba(56, 189, 248, 0), #38bdf8 40%, rgba(56,189,248,0));
  transform: rotate(-18deg);
  animation: nekScanPulse 1.4s ease-in-out infinite;
  box-shadow: 0 0 10px #38bdf8;
}
@keyframes nekScanPulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}
.art-code {
  position: absolute; right: 10%; bottom: 18px; display: flex; gap: 3px; align-items: flex-end;
  height: 28px;
}
.art-code i {
  width: 3px; background: #e2e8f0; border-radius: 1px;
  animation: nekCodeFlicker 2s ease-in-out infinite;
}
.art-code i:nth-child(1) { height: 60%; }
.art-code i:nth-child(2) { height: 100%; animation-delay: 0.1s; }
.art-code i:nth-child(3) { height: 40%; animation-delay: 0.2s; }
.art-code i:nth-child(4) { height: 85%; animation-delay: 0.15s; }
.art-code i:nth-child(5) { height: 55%; animation-delay: 0.25s; }
.art-code i:nth-child(6) { height: 90%; animation-delay: 0.05s; }
@keyframes nekCodeFlicker {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

.scene--processing {
  background:
    radial-gradient(ellipse at 30% 40%, rgba(245, 158, 11, 0.24), transparent 50%),
    radial-gradient(ellipse at 80% 50%, rgba(239, 68, 68, 0.24), transparent 45%),
    linear-gradient(120deg, #1c1917, #0f172a 55%, #450a0a);
}
.art-crusher {
  position: absolute; left: 14%; top: 22%; width: 40px; height: 48px;
}
.art-crusher i {
  position: absolute; top: 0; width: 16px; height: 28px; background: #78716c; border-radius: 3px;
  animation: nekCrushJaw 1.1s ease-in-out infinite;
}
.art-crusher i:first-child { left: 2px; transform-origin: top left; }
.art-crusher i:nth-child(2) { right: 2px; transform-origin: top right; animation-delay: 0.15s; }
.art-crusher b {
  position: absolute; left: 6px; right: 6px; bottom: 0; height: 16px;
  background: #57534e; border-radius: 2px 2px 4px 4px;
}
@keyframes nekCrushJaw {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(8deg); }
}
.art-furnace {
  position: absolute; right: 16%; top: 18%; width: 36px; height: 52px;
  background: #44403c; border-radius: 6px 6px 4px 4px;
  box-shadow: inset 0 0 0 2px #57534e;
}
.art-furnace i {
  position: absolute; left: 6px; right: 6px; bottom: 8px; height: 22px;
  background: linear-gradient(180deg, #fbbf24, #ef4444 70%, #7f1d1d);
  border-radius: 2px; animation: nekFireGlow 1.5s ease-in-out infinite;
}
.art-furnace em {
  position: absolute; top: -10px; width: 8px; height: 12px; border-radius: 50% 50% 40% 40%;
  background: rgba(251, 191, 36, 0.7); animation: nekFireGlow 1.2s ease-in-out infinite;
}
.art-furnace em:first-of-type { left: 8px; }
.art-furnace em:last-of-type { right: 8px; animation-delay: 0.3s; }
@keyframes nekFireGlow {
  0%, 100% { opacity: 0.65; filter: brightness(0.95); }
  50% { opacity: 1; filter: brightness(1.2); }
}

.apk-update-hint {
  margin: 0.35rem 0 0;
  font-size: 0.72rem;
  color: var(--primary);
  font-weight: 600;
}
.apk-download--new {
  border-style: solid;
  border-color: var(--primary);
  background: #eff6ff;
}
.panel--secondary-sort .barcode-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.75rem;
  padding: 0.75rem;
  border-radius: 12px;
  border: 1px dashed #7dd3fc;
  background: linear-gradient(180deg, #f0f9ff, #fff);
}
.panel--secondary-sort .barcode-scan-label {
  flex: 1 1 100%;
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: #0369a1;
}
.panel--secondary-sort .barcode-row .input {
  flex: 1 1 12rem;
  min-width: 0;
}
.panel--secondary-sort #scanBarcodeBtn {
  border-color: #38bdf8;
  color: #0369a1;
  font-weight: 700;
}
.scene--scanner.scene--web {
  min-height: 110px;
}

@media (prefers-reduced-motion: reduce) {
  .art-cart, .art-belt em, .art-box, .art-beam, .art-code i, .art-crusher i, .art-furnace i, .art-furnace em {
    animation: none !important;
  }
}
