/* TM · Candidate Search — v2 role-tabs + JD→reads→ranked flow. Ported from page.css (dark surface only). */

[x-cloak] { display: none !important; }

/* Server-rendered static fallback vs. Alpine-reactive render. Default (no JS):
   show .cs-static, hide .cs-reactive. Once Alpine boots it adds .cs-live to the
   x-data root, flipping them. This can never double-render (no DOM-removal race). */
.cs-reactive { display: none; }
.cs-live .cs-static { display: none !important; }
.cs-live .cs-reactive { display: revert; }
/* `display: revert` rolls back to the UA default (block), which collapses the
   ranked-row grid on the reactive .cs-result cards (rank | name | score → stacked).
   Restore it explicitly. Other reactive elements (.cs-read chips, .cs-note, the
   inline JD span) are fine as block/inline, so revert is left as their fallback. */
.cs-live .cs-result.cs-reactive { display: grid; }

/* ---------- "Boolean would miss" note (green accent) ----- */
.cs-note {
  margin-top: 18px;
  padding: 22px 26px;
  border-radius: 12px;
  background: var(--adept-green);
  border: 1px solid var(--adept-green);
  font: 700 15px/1.7 var(--font-body);
  color: #000;
}
.cs-note b { color: #000; font-weight: 700; }

/* ---------- "Why it's different" try-it banner ----------- */
.cs-tryit {
  padding: 32px 48px;
  border-bottom: 1px solid #2a2a2a;
  background: #000000;
}
.cs-tryit__lead {
  display: flex; align-items: flex-start; gap: 18px;
  max-width: 96ch;
}
.cs-tryit__badge {
  flex-shrink: 0;
  font: 700 12px/1 var(--font-body);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #000;
  background: var(--adept-green);
  padding: 7px 11px;
  border-radius: 999px;
  margin-top: 2px;
}
.cs-tryit__narrative,
.adept-type .cs-tryit__narrative {   /* beat `.adept-type p` (keep 17px desktop; responsive.css still wins on mobile) */
  margin: 0;
  font: 400 17px/1.6 var(--font-body);
  color: rgba(255,255,255,0.86);
}
.cs-tryit__narrative b { color: #fff; font-weight: 700; }
.cs-tryit__points {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-top: 28px;
  border-top: 1px solid rgba(255,255,255,0.09);
}
.cs-tryit__point {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px 28px 0 0;
}
.cs-tryit__point + .cs-tryit__point {
  padding-left: 28px;
  border-left: 1px solid #2a2a2a;
}
.cs-tryit__point-k {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  line-height: 1.1;
  letter-spacing: -0.008em;
}
.cs-tryit__point-k.green  { color: var(--adept-green); }
.cs-tryit__point-k.blue   { color: var(--adept-blue); }
.cs-tryit__point-k.yellow { color: var(--adept-yellow); }
.cs-tryit__point-v {
  font: 400 14px/1.45 var(--font-body);
  color: rgba(255,255,255,0.78);
}

/* ---------- ranked-results header / rows ----------------- */
.cs-results__head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
}
.cs-results__title { font: 700 16px/1 var(--font-body); }
.cs-results__pill {
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap;
  font: 700 13px/1 var(--font-body);
  padding: 6px 11px;
  border-radius: 999px;
  background: var(--adept-green);
  color: #000;
}
.cs-results__pill--ok { background: var(--adept-green); color: #000; }
.cs-result {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  border-radius: 12px;
  background: #1f1f1f;
  border: 1px solid rgba(255,255,255,0.10);
  margin-bottom: 12px;
  transition: background 650ms ease, transform 650ms ease;
}
.cs-result:hover {
  background: rgba(255,255,255,0.05);
  transform: translateX(3px);
}
.cs-result__rank {
  font: 700 13px/1 var(--font-body);
  color: rgba(255,255,255,0.75);
}
.cs-result__name { font: 700 15px/1.2 var(--font-body); color: #fff; }
.cs-result__why {
  font: 400 13px/1.4 var(--font-body);
  color: rgba(255,255,255,0.7);
  margin-top: 3px;
}
.cs-result__score {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  color: var(--adept-green);
}

/* ---------- ranked-results groups ------------------------ */
.cs-resgroup + .cs-resgroup { margin-top: 22px; }
.cs-resgroup__title {
  font: 700 11px/1.3 var(--font-body); letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--fg-subtle);
  margin-bottom: 12px;
}
.cs-resgroup--surfaced .cs-resgroup__title { color: var(--adept-green); }
.cs-result--surfaced {
  background: transparent;
  border-color: var(--hairline);
}
.cs-result--surfaced .cs-result__rank { color: var(--adept-green); font-size: 15px; }

/* ---------- role tablist --------------------------------- */
.cs-roles {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 28px 48px 0;
}
.cs-role {
  appearance: none;
  border: 1px solid var(--hairline);
  background: transparent;
  color: var(--fg-muted);
  font: 600 13px/1 var(--font-body);
  padding: 9px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 140ms, color 140ms, background 140ms;
}
.cs-role:hover { color: #fff; border-color: rgba(255,255,255,0.4); }
.cs-role.is-active {
  background: var(--adept-green);
  border-color: var(--adept-green);
  color: #000;
}

/* ---------- JD → extract → ranked flow ------------------- */
.cs-flow {
  display: grid;
  grid-template-columns: 1fr auto 1.15fr;
  align-items: stretch;
  gap: 0;
  padding: 28px 48px 40px;
}
.cs-flow__in { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.cs-jd {
  background: #1f1f1f;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 14px;
  padding: 22px 24px;
}
.cs-jd__head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.cs-jd__label {
  font: 700 11px/1 var(--font-body); letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(255,255,255,0.75);
}
.cs-jd__role { font: 700 14px/1 var(--font-body); color: var(--adept-green); }
.cs-jd__body,
.adept-type .cs-jd__body {   /* beat `.adept-type p` (keep 16px size) */
  margin: 0;
  font: 400 16px/1.7 var(--font-body);
  color: #ffffff;
}
.cs-jd__body mark {
  background: transparent;
  color: #fff;
  font-weight: 700;
}
.cs-reads__label {
  font: 700 11px/1 var(--font-body); letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(255,255,255,0.92);
  margin-bottom: 14px;
}
.cs-reads__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cs-read {
  font: 700 13px/1.3 var(--font-body);
  color: #000;
  background: var(--adept-green);
  border: 0;
  padding: 9px 13px;
  border-radius: 999px;
}
.cs-read--beyond {
  color: #000;
  background: var(--adept-yellow);
  border: 0;
}
.cs-reads__label--beyond { color: rgba(255,255,255,0.92); }

/* Reading sequence: highlights sweep in as if the JD is being read,
   then extracted chips arrive, then the beyond-the-JD set lands. */
@media (prefers-reduced-motion: no-preference) {
  .cs-read-seq .cs-map__link,
  .cs-read-seq .cs-reads__label,
  .cs-read-seq .cs-read { opacity: 0; }
  .cs-read-seq .cs-map__link {
    animation: seqFade 500ms ease forwards;
    animation-delay: 0.7s;
  }
  .cs-read-seq .cs-reads--from ~ .cs-map__link { animation-delay: 2.0s; }
  .cs-read-seq .cs-reads--from .cs-reads__label {
    animation: seqFade 600ms ease forwards;
    animation-delay: 1.1s;
  }
  .cs-read-seq .cs-reads--from .cs-read {
    animation: chipIn 650ms cubic-bezier(0.25,0.6,0.2,1) forwards;
    animation-delay: calc(1.3s + var(--c, 0) * 0.16s);
  }
  .cs-read-seq .cs-reads--beyond .cs-reads__label {
    animation: seqFade 700ms ease forwards;
    animation-delay: 2.3s;
  }
  .cs-read-seq .cs-reads--beyond .cs-read {
    animation: chipSlide 1100ms cubic-bezier(0.16,0.55,0.12,1) forwards;
    animation-delay: calc(2.6s + var(--c, 0) * 0.3s);
  }
}
@keyframes seqFade { to { opacity: 1; } }
@keyframes chipIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
@keyframes chipSlide {
  from { opacity: 0; transform: translateX(-14px); }
  to   { opacity: 1; transform: none; }
}
.cs-map__link {
  width: 2px;
  height: 20px;
  margin: 12px 0 12px 26px;
  background: #3a3a3a;
}
.cs-flow__arrow {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px;
  padding: 0 28px;
}
.cs-flow__arrow svg { width: 48px; height: 24px; }
.cs-flow__arrow-line { stroke-dasharray: 40; stroke-dashoffset: 0; }
@media (prefers-reduced-motion: no-preference) {
  .cs-flow__arrow-line { animation: csArrowFlow 2.4s ease-in-out infinite; }
}
@keyframes csArrowFlow {
  0%   { stroke-dashoffset: 40; opacity: 0.3; }
  50%  { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: -40; opacity: 0.3; }
}
.cs-flow__arrow-lbl {
  font: 700 11px/1 var(--font-body); letter-spacing: 0.08em;
  color: var(--adept-green);
}
.cs-flow__out { border-radius: 14px; }

/* ---- Mobile / tablet (≤ 860px) --------------------------- */
@media (max-width: 860px) {
  .cs-roles { padding: 24px 24px 0; }
  .cs-flow {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 24px;
  }
  .cs-flow__arrow { flex-direction: row; padding: 0; }
  .cs-flow__arrow svg { transform: rotate(90deg); }
}

/* ---- Mobile (≤ 980px) ------------------------------------ */
@media (max-width: 980px) {
  .cs-tryit { padding: 24px; }
  /* Stacked: every stat row gets an equal divider + equal
     top/bottom padding so the spacing is uniform */
  .cs-tryit__points { grid-template-columns: 1fr; margin-top: 24px; border-top: 0; }
  .cs-tryit__point { padding: 18px 0; border-top: 1px solid rgba(255,255,255,0.09); }
  .cs-tryit__point + .cs-tryit__point { padding-left: 0; border-left: 0; border-top: 1px solid rgba(255,255,255,0.09); }
}

/* ---- Small phone (≤ 560px) ------------------------------- */
@media (max-width: 560px) {
  /* Try-it: badge above the narrative */
  .cs-tryit__lead { flex-direction: column; gap: 12px; }
  .cs-tryit { padding: 28px 20px; }
  .cs-tryit__point-k { font-size: 16px; }
  /* Ranked result rows */
  .cs-result { padding: 16px 20px; gap: 12px; }
  /* Results header: let the latency pill drop below the title
     instead of colliding / clipping on narrow screens */
  .cs-results__head { flex-wrap: wrap; gap: 8px 12px; }
  .cs-results__pill { flex: none; }
}
