/* FR-19 — Full-lifecycle stage chevron.
   Standalone sheet scoped entirely under .lc-rail, so it can sit under the deal KPI
   banner without touching Standard Brand Banner or page-level theming.
   Rendered by js/rms-lifecycle-chevron.js. */

.lc-rail {
  --lc-notch: 10px;
  --lc-future-bg: #ececec;
  --lc-future-ink: #8c8c8c;
  --lc-done-bg: #404040;
  --lc-done-ink: #e6e6e6;
  --lc-current-bg: linear-gradient(135deg, #e92a2c, #a71f23);
  /* Functional status tokens — deliberately NOT the brand red, so a terminal node
     reads as state rather than chrome. */
  --lc-danger-bg: #b3261e;
  --lc-won-bg: #2e7d4f;
  margin: 10px 0 0;
  font-family: var(--font, "Neue Haas Grotesk Text", Arial, Helvetica, sans-serif);
}

.lc-rail[hidden] { display: none; }

.lc-rail__head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 6px;
}

.lc-rail__label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted, #6b6b6b);
}

.lc-rail__hint {
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--muted, #6b6b6b);
  opacity: 0.85;
}

.lc-rail__track {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  row-gap: 6px;
}

.lc-node {
  flex: 1 1 88px;
  min-width: 76px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  margin-right: calc(var(--lc-notch) * -1);
  padding: 7px 12px 7px calc(12px + var(--lc-notch));
  background: var(--lc-future-bg);
  color: var(--lc-future-ink);
  border: 0;
  font: inherit;
  text-align: center;
  cursor: pointer;
  clip-path: polygon(
    0 0,
    calc(100% - var(--lc-notch)) 0,
    100% 50%,
    calc(100% - var(--lc-notch)) 100%,
    0 100%,
    var(--lc-notch) 50%
  );
  transition: filter 0.15s ease, transform 0.15s ease;
}

/* First node has a flat left edge; the rail's last node keeps its point so the
   lifecycle reads as open-ended rather than terminated. */
.lc-node:first-child {
  padding-left: 12px;
  clip-path: polygon(0 0, calc(100% - var(--lc-notch)) 0, 100% 50%, calc(100% - var(--lc-notch)) 100%, 0 100%);
}

.lc-node__top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 10px;
}

.lc-node__ord {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  opacity: 0.7;
  line-height: 1;
}

.lc-node__name {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.lc-node__flag {
  display: inline-block;
  margin-top: 1px;
  padding: 0 5px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.24);
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.5;
}

.lc-node--done {
  background: var(--lc-done-bg);
  color: var(--lc-done-ink);
  z-index: 1;
}

.lc-node--current {
  background: var(--lc-current-bg);
  color: #fff;
  z-index: 3;
}

.lc-node--current .lc-node__ord { opacity: 0.85; }

/* Terminal lost / not-a-fit / plan-for-the-future. */
.lc-node--terminal {
  background: var(--lc-danger-bg);
  color: #fff;
  z-index: 3;
}

.lc-node--won {
  background: var(--lc-won-bg);
  color: #fff;
  z-index: 3;
}

/* A halted lifecycle: nodes are neither complete nor pending, because the deal's
   last live stage is not recoverable from `status` alone. */
.lc-node--halted {
  background: #f2f2f2;
  color: #a9a9a9;
}

.lc-node--future[aria-disabled="true"] { cursor: default; }

.lc-node:hover { filter: brightness(1.06); }
.lc-node--future:hover { filter: none; background: #e2e2e2; }

.lc-node:focus-visible {
  outline: 2px solid #202020;
  outline-offset: -2px;
  z-index: 4;
}

/* Count of required fields still missing for the current stage — amber = warning. */
.lc-node__gap {
  flex: 0 0 auto;
  min-width: 12px;
  height: 12px;
  padding: 0 3px;
  border-radius: 6px;
  background: #ffd166;
  color: #4a3200;
  font-size: 8.5px;
  font-weight: 800;
  line-height: 12px;
  text-align: center;
}

/* Two-row compact wrap on narrow panes — the rail wraps rather than scrolling,
   so no node can slide off-screen without a cue. */
@media (max-width: 1040px) {
  .lc-node { flex: 1 1 12.5%; min-width: 0; }
  .lc-node__name { font-size: 9px; }
}

@media (max-width: 640px) {
  .lc-node { flex: 1 1 20%; padding: 6px 9px 6px calc(9px + var(--lc-notch)); }
  .lc-node:first-child { padding-left: 9px; }
  /* Drop the ordinal but keep the gap badge; the row collapses when there is no badge. */
  .lc-node__ord { display: none; }
  .lc-node__top { min-height: 0; }
}
