/* ------------------------------------------------------------------
   MES landing page — additions on top of /landing/cmm.css.
   Loaded after cmm.css; everything else on the page reuses the shared
   design system.
   ------------------------------------------------------------------ */

/* ------------------------------------------------------------------
   Inventory cycle diagram. Built from real elements rather than an
   image so it reflows to one column on a phone and the labels stay
   selectable, translatable and readable at any width.
   ------------------------------------------------------------------ */
.invcycle {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  counter-reset: invstep;
}
.invnode {
  position: relative;
  background: hsl(var(--card) / .9);
  border: 1px solid hsl(var(--border));
  border-radius: 12px;
  padding: 16px 16px 15px;
}
.invnode::before {
  counter-increment: invstep;
  content: counter(invstep, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .12em;
  color: hsl(var(--primary));
  display: block;
  margin-bottom: 7px;
}
.invnode h4 {
  margin: 0 0 5px;
  font-size: 15px;
  font-weight: 700;
  color: hsl(var(--fg));
}
.invnode p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: hsl(var(--mut-fg));
}
.invnode code {
  font-family: var(--font-mono);
  font-size: 12px;
  color: hsl(var(--accent));
  background: hsl(var(--accent) / .1);
  border-radius: 4px;
  padding: 1px 5px;
}
/* The step that closes the loop back to stock. */
.invnode-return { border-color: hsl(var(--accent) / .5); }
.invnode-return::before { color: hsl(var(--accent)); }

/* Connector between consecutive nodes: a chevron on the shared edge. */
.invnode + .invnode::after {
  content: "";
  position: absolute;
  left: -11px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-top: 2px solid hsl(var(--border));
  border-right: 2px solid hsl(var(--border));
  transform: translateY(-50%) rotate(45deg);
}

.invcycle-loop {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: hsl(var(--accent));
  padding: 11px 14px;
  border: 1px dashed hsl(var(--accent) / .45);
  border-radius: 10px;
  background: hsl(var(--accent) / .05);
}
.invcycle-loop svg { flex-shrink: 0; }

.invcycle-foot {
  grid-column: 1 / -1;
  margin: 2px 0 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: hsl(var(--mut-fg));
}

@media (max-width: 900px) {
  .invcycle { grid-template-columns: 1fr; }
  /* Stacked: the chevron moves to the top edge and points down. */
  .invnode + .invnode::after {
    left: 50%;
    top: -11px;
    transform: translateX(-50%) rotate(135deg);
  }
}
