/* ==================================================================
   LeadBridge Pipeline — product layer on top of the kit.
   tokens.css owns the system; this file adds only the patterns the kit
   does not ship: the pipeline flow rail, the verification console,
   the target ring and the activity feed.
   ================================================================== */

.tc {
  /* meaning-contract palette (playbook §6): one fixed colour per job state,
     used identically in the flow rail, every chip, every legend. */
  --st-queued:  var(--viz-mute);
  --st-running: var(--viz-1);
  --st-done:    var(--s-good);
  --st-skipped: var(--viz-4);
  --st-failed:  var(--danger);
  --tier-a: var(--s-good); --tier-b: var(--viz-1);
  --tier-c: var(--viz-2);  --tier-d: var(--viz-mute);
}

/* ---------------- the flow rail (hero) ---------------- */

.flow { display: flex; align-items: stretch; gap: 0; overflow-x: auto; padding: 4px 2px 2px; }
.flow-stage {
  /* 10 stages have to fit a laptop without the rail cutting mid-stage — a clipped
     stage reads as broken rather than scrollable. Still overflow-x on narrow screens. */
  position: relative; flex: 1 1 0; min-width: 98px; padding: 12px 10px 13px;
  border-radius: 10px; cursor: pointer; text-align: left;
  transition: background var(--t-fast) ease, transform var(--t-med) var(--ease-spring);
}
.flow-stage:hover { background: var(--surface-2); }
.flow:hover .flow-stage:not(:hover) { opacity: .55; transition: opacity var(--t-fast) ease; }
.flow-stage:active { transform: scale(.985); transition-duration: 60ms; }
.flow-stage .lane {
  font-size: 9.5px; font-weight: 650; letter-spacing: .09em; text-transform: uppercase;
  color: var(--ink-3); opacity: .75;
}
.flow-stage .st-name { display: block; margin-top: 3px; font-size: 12.5px; font-weight: 600; letter-spacing: -.006em; }
.flow-stage .st-num {
  display: flex; align-items: baseline; gap: 5px; margin-top: 7px;
  font-size: 23px; font-weight: 350; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1;
}
.flow-stage .st-num small { font-size: 11px; color: var(--ink-3); font-weight: 500; letter-spacing: 0; }
.flow-bar { display: flex; height: 5px; margin-top: 9px; border-radius: 3px; overflow: hidden; background: var(--viz-track); }
.flow-bar i { display: block; height: 100%; transform-origin: left center; transition: width .6s var(--ease-out); }
.flow-bar i.q { background: var(--st-queued); }
.flow-bar i.r { background: var(--st-running); }
.flow-bar i.d { background: var(--st-done); }
.flow-bar i.s { background: var(--st-skipped); }
.flow-bar i.f { background: var(--st-failed); }
.flow-stage .st-foot { margin-top: 8px; font-size: 11px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; min-height: 16px; }
.flow-arrow { flex: none; align-self: center; color: var(--hairline); width: 14px; display: grid; place-items: center; }
.flow-arrow svg { transition: transform var(--t-med) var(--ease-out), color var(--t-med) ease; }
.flow-stage.hot .st-num { color: var(--accent-ink); }
.flow-stage.hot::after {
  content: ""; position: absolute; left: 13px; right: 13px; bottom: 6px; height: 2px;
  border-radius: 2px; background: var(--accent); transform-origin: left;
  animation: flow-sweep .9s var(--ease-out);
}
@keyframes flow-sweep { from { transform: scaleX(0); opacity: .9 } to { transform: scaleX(1); opacity: 0 } }
.flow-stage .st-jump { position: absolute; top: 12px; right: 12px; opacity: 0; transform: translate(-3px, 3px); color: var(--accent-ink); transition: opacity var(--t-fast) ease, transform var(--t-med) var(--ease-out); }
.flow-stage:hover .st-jump { opacity: 1; transform: none; }

/* ---------------- target ring ---------------- */

.ring-wrap { position: relative; flex: none; }
.ring-c { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; pointer-events: none; }
.ring-v { font-size: 27px; font-weight: 350; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1; }
.ring-l { font-size: 9.5px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-top: 4px; }
.ring svg circle.track { stroke: var(--viz-track); }
.ring svg circle.val { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 1.1s var(--ease-out); }

/* ---------------- activity feed ---------------- */

.feed { display: flex; flex-direction: column; max-height: 420px; overflow-y: auto; scrollbar-width: thin; }
.feed-row { display: flex; gap: 10px; padding: 7px 8px; margin: 0 -8px; border-radius: 7px; transition: background var(--t-fast) ease; }
.feed-row:hover { background: var(--surface-2); }
.feed-row .fdot { flex: none; width: 6px; height: 6px; border-radius: 50%; margin-top: 6px; background: var(--viz-mute); }
.feed-row.good .fdot { background: var(--s-good); }
.feed-row.warn .fdot { background: var(--warn); }
.feed-row.bad  .fdot { background: var(--danger); }
.feed-row.info .fdot { background: var(--viz-1); }
.feed-msg { font-size: 12.5px; color: var(--ink-2); min-width: 0; }
.feed-meta { font-family: var(--mono); font-size: 10px; color: var(--ink-3); margin-top: 2px; }
.feed-row.fresh { animation: feed-in .4s var(--ease-out); }
@keyframes feed-in { from { opacity: 0; transform: translateY(-5px) } to { opacity: 1; transform: none } }

/* ---------------- verification console ---------------- */

.vc { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(430px, .85fr); gap: 14px; align-items: start; }
@media (max-width: 1180px) { .vc { grid-template-columns: 1fr } }

.ev-shot {
  width: 100%; border-radius: 10px; border: 1px solid var(--hairline); background: var(--surface-2);
  display: block; cursor: zoom-in; transition: transform var(--t-med) var(--ease-out);
}
.ev-shot:hover { transform: scale(1.006); }
.ev-none { padding: 26px 20px; text-align: center; color: var(--ink-3); font-size: 12.5px; }

.src-grid { display: grid; grid-template-columns: 118px 1fr; gap: 7px 14px; font-size: 12.5px; }
.src-grid dt { font-size: 10.5px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); padding-top: 2px; }
.src-grid dd { color: var(--ink); word-break: break-word; }
.src-grid dd.mono { font-family: var(--mono); font-size: 12px; }

.vf { display: flex; flex-direction: column; gap: 13px; }
.vf-field { position: relative; }
.vf-field .inp { height: 40px; font-size: 15px; font-family: var(--mono); letter-spacing: .01em; width: 100%; }
.vf-field .inp.changed { border-color: color-mix(in srgb, var(--warn) 60%, var(--hairline)); box-shadow: 0 0 0 3.5px rgba(237,161,0,.12); }
.vf-orig { margin-top: 5px; font-size: 11px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.vf-orig b { font-family: var(--mono); color: var(--ink-2); font-weight: 500; }
.vf-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.vf-actions .btn { height: 36px; justify-content: center; }
.vf-actions .btn.wide { grid-column: span 2; }
.key {
  font-family: var(--mono); font-size: 10px; color: var(--ink-3);
  border: 1px solid var(--hairline); border-bottom-width: 2px; border-radius: 4px;
  padding: 0 4px; background: var(--surface-2); margin-left: 6px;
}
.btn.accent .key, .btn.primary .key { color: rgba(255,255,255,.8); border-color: rgba(255,255,255,.3); background: rgba(255,255,255,.12); }

.vc-progress { display: flex; align-items: center; gap: 10px; }
.vc-track { flex: 1; height: 6px; border-radius: 3px; background: var(--viz-track); overflow: hidden; }
.vc-fill { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width .7s var(--ease-out); }

.saved-wisp {
  position: absolute; right: 10px; top: -18px; font-size: 11px; font-weight: 600; color: var(--s-good-ink);
  opacity: 0; transform: translateY(4px); pointer-events: none;
}
.saved-wisp.on { animation: wisp 1.15s var(--ease-out); }
@keyframes wisp { 0% { opacity: 0; transform: translateY(4px) } 18% { opacity: 1; transform: none } 75% { opacity: 1 } 100% { opacity: 0; transform: translateY(-4px) } }

/* ---------------- small shared bits ---------------- */

/* the kit's user card expects block children; ours are spans */
.u-meta .u-name, .u-meta .u-role { display: block; }

/* reading surfaces stay capped and centred (playbook §1) even inside a wide shell */
.wrap.wide.reading { max-width: 1160px; }
.wrap.wide.reading .page-head { padding-left: 0; padding-right: 0; }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.sentence::first-letter { text-transform: uppercase; }
.muted { color: var(--ink-3); }
.stat-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--hairline-2); font-size: 12.5px; }
.stat-row:last-child { border-bottom: 0; }
.stat-row b { font-weight: 550; font-variant-numeric: tabular-nums; }
.bar-mini { height: 5px; border-radius: 3px; background: var(--viz-track); overflow: hidden; }
.bar-mini i { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width .8s var(--ease-out); }

.tier { display: inline-grid; place-items: center; width: 19px; height: 19px; border-radius: 6px; font-size: 10.5px; font-weight: 700; color: #fff; }
.tier.A { background: var(--tier-a) } .tier.B { background: var(--tier-b) }
.tier.C { background: var(--tier-c); color: var(--ink) } .tier.D { background: var(--tier-d) }

.src-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 600; padding: 1.5px 8px; border-radius: 99px; border: 1px dashed var(--warn); color: var(--warn-ink); background: rgba(237,161,0,.08); }
.src-badge.real { border-style: solid; border-color: rgba(12,163,12,.3); color: var(--s-good-ink); background: rgba(12,163,12,.07); }

.login-wrap { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.login-card { width: 380px; max-width: 100%; padding: 28px 26px 24px; }
.login-card h1 { font-size: 20px; font-weight: 600; letter-spacing: -.02em; }
.login-card .sub { margin-top: 5px; font-size: 12.5px; color: var(--ink-3); }
.login-card form { margin-top: 20px; display: flex; flex-direction: column; gap: 13px; }
.login-err { font-size: 12px; color: var(--danger); min-height: 16px; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 1100px) { .split { grid-template-columns: 1fr } }

.evidence-zoom { position: fixed; inset: 0; z-index: 120; background: rgba(17,17,19,.72); display: grid; place-items: center; padding: 32px; opacity: 0; pointer-events: none; transition: opacity var(--t-med) ease; }
.evidence-zoom.on { opacity: 1; pointer-events: auto; }
.evidence-zoom img { max-width: 100%; max-height: 100%; border-radius: 10px; box-shadow: 0 24px 70px -20px rgba(0,0,0,.6); }

.toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 14px); z-index: 130; background: rgba(23,22,20,.95); color: #f4f3f0; font-size: 12.5px; padding: 9px 16px; border-radius: 9px; opacity: 0; pointer-events: none; transition: opacity var(--t-med) ease, transform var(--t-med) var(--ease-out); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: rgba(150,40,40,.96); }

.skel { background: linear-gradient(90deg, var(--surface-2) 25%, var(--hairline-2) 37%, var(--surface-2) 63%); border-radius: 6px; height: 12px; }

@media (prefers-reduced-motion: reduce) {
  .tc *, .tc *::before, .tc *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
