/* ============================================================================
   AI READINESS DIAGNOSTIC, ROADMAP TIMELINE EXPLORATIONS (v2)
   Three innovative ways to present the prioritised sequence. All dark-world,
   all share one foundational-badge primitive (CSQ sygnet + hover tooltip) and
   the same priority-ordered data. Depends on tokens.css + app.css.
   ========================================================================== */

.tl { font-family: var(--font-sans); color: #fff; background: var(--ink-1000); }
.tl * { box-sizing: border-box; }

/* ---- shared intro --------------------------------------------------------*/
.tl-intro { padding: var(--space-8) var(--space-8) 0; }
.tl-intro__eyebrow {
  font-size: var(--fs-eyebrow); font-weight: var(--w-bold); letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase; color: var(--ink-300); margin: 0 0 var(--space-3);
}
.tl-intro h2 {
  font-size: var(--fs-h2); font-weight: var(--w-extrabold); letter-spacing: var(--ls-heading);
  line-height: var(--lh-snug); margin: 0; color: #fff; text-wrap: balance;
}
.tl-intro h2 em { color: var(--brand-red); font-style: normal; }
.tl-intro__sub { font-size: var(--fs-body); color: var(--ink-200); margin: var(--space-4) 0 0; line-height: 1.55; max-width: 56ch; }
.tl-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-5) 0 0; }
.tl-chip {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-size: var(--fs-sm); font-weight: var(--w-semibold); color: var(--ink-100);
  background: var(--ink-700); border: 1px solid var(--ink-500); border-radius: var(--radius-pill);
  padding: 6px var(--space-3);
}
.tl-chip__rank {
  font-size: 10px; font-weight: var(--w-extrabold); color: var(--brand-red);
  background: var(--red-tint-16); border-radius: var(--radius-pill); padding: 2px 7px; letter-spacing: 0.02em;
}

/* ---- THE FOUNDATIONAL BADGE (shared primitive) ---------------------------*/
.csq-badge { position: relative; display: inline-flex; align-items: center; }
.csq-badge__mark {
  width: 20px; height: 20px; display: grid; place-items: center; cursor: help;
  color: var(--brand-red); flex: none;
}
.csq-badge__mark svg { width: 100%; height: 100%; display: block; }
.csq-badge__tip {
  position: absolute; bottom: calc(100% + 9px); left: 50%; transform: translateX(-50%) translateY(4px);
  width: max-content; max-width: 230px; padding: var(--space-3) var(--space-4);
  background: #fff; color: var(--brand-ink); border-radius: var(--radius-md);
  font-size: var(--fs-sm); font-weight: var(--w-semibold); line-height: 1.4; text-align: left;
  box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none;
  transition: opacity var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
  z-index: 20;
}
.csq-badge__tip::after {
  content: ""; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: #fff;
}
.csq-badge__tip b { display: block; font-weight: var(--w-extrabold); margin-bottom: 2px; }
.csq-badge:hover .csq-badge__tip, .csq-badge__mark:focus + .csq-badge__tip {
  opacity: 1; transform: translateX(-50%) translateY(0);
}

/* rag dots used across treatments */
.rag-low  { --_rag: var(--rag-low); }
.rag-mid  { --_rag: var(--rag-mid); }
.rag-high { --_rag: var(--rag-high); }

/* ===========================================================================
   TREATMENT A , VERTICAL SPINE
   ========================================================================= */
.spine { padding: var(--space-8); }
.spine__list { position: relative; margin-top: var(--space-6); }
.spine__station {
  font-size: var(--fs-eyebrow); font-weight: var(--w-bold); letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase; color: var(--ink-300); margin: var(--space-6) 0 var(--space-4) 56px;
}
.spine__station:first-child { margin-top: 0; }
.spine-step {
  position: relative; display: grid; grid-template-columns: 56px 1fr; align-items: stretch;
  padding-bottom: var(--space-4);
}
/* the continuous rail */
.spine-step::before {
  content: ""; position: absolute; left: 19px; top: 0; bottom: 0; width: 2px;
  background: var(--ink-500);
}
.spine-step:last-child::before { bottom: auto; height: 22px; }
.spine-step__node {
  position: relative; z-index: 2; width: 40px; height: 40px; border-radius: 50%;
  background: var(--ink-800); border: 2px solid var(--_rag, var(--ink-500));
  display: grid; place-items: center; font-weight: var(--w-extrabold); font-size: var(--fs-body);
  color: #fff; font-variant-numeric: tabular-nums;
}
.spine-step__node--found { box-shadow: 0 0 0 4px var(--red-tint-16); }
.spine-step__card {
  background: var(--ink-800); border: 1px solid var(--ink-600);
  border-left: 3px solid var(--_rag, var(--ink-500)); border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5); margin-left: var(--space-2);
}
.spine-step__top { display: flex; align-items: center; gap: var(--space-3); margin-bottom: 5px; }
.spine-step__area { font-size: var(--fs-lead); font-weight: var(--w-bold); color: #fff; letter-spacing: -0.01em; }
.spine-step__why { font-size: var(--fs-sm); color: var(--ink-200); line-height: 1.5; margin: 0; }
.spine-step__rag {
  margin-left: auto; font-size: 10px; font-weight: var(--w-extrabold); letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase; color: var(--_rag); flex: none;
}

/* ===========================================================================
   TREATMENT B , HORIZON COLUMNS (Now / Next / Later)
   ========================================================================= */
.horizons { padding: var(--space-8); }
.horizons__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); margin-top: var(--space-6); align-items: start; }
.horizon { border-top: 3px solid var(--_h, var(--ink-500)); padding-top: var(--space-4); }
.horizon--now   { --_h: var(--brand-red); }
.horizon--next  { --_h: var(--rag-mid); }
.horizon--later { --_h: var(--ink-400); }
.horizon__head { display: flex; align-items: baseline; gap: var(--space-2); margin-bottom: var(--space-4); }
.horizon__label { font-size: var(--fs-lead); font-weight: var(--w-extrabold); color: #fff; letter-spacing: -0.01em; }
.horizon__when { font-size: var(--fs-caption); color: var(--ink-300); font-weight: var(--w-semibold); }
.horizon__cards { display: grid; gap: var(--space-3); }
.hz-card {
  background: var(--ink-800); border: 1px solid var(--ink-600); border-radius: var(--radius-md);
  padding: var(--space-4); display: grid; gap: 6px;
}
.hz-card__top { display: flex; align-items: center; gap: var(--space-2); }
.hz-card__num {
  font-size: var(--fs-sm); font-weight: var(--w-extrabold); color: var(--_rag, var(--ink-200));
  font-variant-numeric: tabular-nums; min-width: 1.4em;
}
.hz-card__area { font-size: var(--fs-body); font-weight: var(--w-bold); color: #fff; letter-spacing: -0.01em; line-height: 1.25; }
.hz-card__why { font-size: var(--fs-sm); color: var(--ink-200); line-height: 1.45; margin: 0; }
.horizon--later .hz-card { background: transparent; }
.horizon--later .hz-card__area { color: var(--ink-100); font-weight: var(--w-semibold); }

/* ===========================================================================
   CLEARWAY , all-green holding panel (no remediation roadmap to draw)
   ========================================================================= */
.clearway { padding: var(--space-8); }
.clearway__panel {
  margin-top: var(--space-7);
  display: grid; grid-template-columns: auto 1fr; gap: var(--space-5); align-items: start;
  background: var(--ink-900); border: 1px solid var(--ink-600);
  border-left: 3px solid var(--rag-high); border-radius: var(--radius-lg);
  padding: var(--space-6);
}
.clearway__mark { width: 40px; height: 40px; color: var(--rag-high); flex: none; display: block; }
.clearway__mark svg { width: 100%; height: 100%; display: block; }
.clearway__note { font-size: var(--fs-body); color: var(--ink-200); line-height: 1.6; margin: 0; max-width: 60ch; }
.clearway__one { display: grid; gap: 6px; }
.clearway__one-label {
  font-size: var(--fs-eyebrow); font-weight: var(--w-bold); letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase; color: var(--ink-300);
}
.clearway__one-row { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.clearway__one-area {
  font-size: var(--fs-lead); font-weight: var(--w-bold); color: #fff; letter-spacing: -0.01em;
  display: inline-flex; align-items: center; gap: var(--space-2);
}
.clearway__one-why { font-size: var(--fs-sm); color: var(--ink-200); line-height: 1.5; margin: 0; }
.clearway__one .route-stop__sev { margin-top: 0; }
@media (max-width: 620px) {
  .clearway__panel { grid-template-columns: 1fr; gap: var(--space-4); padding: var(--space-5); }
}

/* ===========================================================================
   TREATMENT C , ROUTE / METRO (alternating stops on a centre line)
   ========================================================================= */
.route { padding: var(--space-8); }
.route__track { position: relative; margin-top: var(--space-8); }
.route__track::before {
  content: ""; position: absolute; left: 50%; transform: translateX(-50%); top: 0; bottom: 0;
  width: 3px; background: linear-gradient(180deg, var(--brand-red), var(--rag-mid) 55%, var(--ink-400));
  border-radius: 3px;
}
.route-stop {
  position: relative; display: grid; grid-template-columns: 1fr 56px 1fr; grid-template-rows: auto; align-items: center;
  margin-bottom: var(--space-6); min-height: 64px;
}
.route-stop > * { grid-row: 1; }
.route-stop__node {
  grid-column: 2; justify-self: center; z-index: 3;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--ink-900); border: 3px solid var(--_rag, var(--ink-400));
  display: grid; place-items: center; font-weight: var(--w-extrabold); font-size: var(--fs-lead);
  color: #fff; font-variant-numeric: tabular-nums;
}
.route-stop__node--found { box-shadow: 0 0 0 5px var(--red-tint-16); }
.route-stop__card {
  background: var(--ink-800); border: 1px solid var(--ink-600); border-radius: var(--radius-lg);
  padding: var(--space-4); position: relative;
}
.route-stop__card--l { grid-column: 1; margin-right: var(--space-3); text-align: right; }
.route-stop__card--r { grid-column: 3; margin-left: var(--space-3); }
/* connector from card to centre node */
.route-stop__card::after {
  content: ""; position: absolute; top: 50%; transform: translateY(-50%); width: var(--space-3); height: 2px; background: var(--ink-500);
}
.route-stop__card--l::after { right: calc(var(--space-3) * -1); }
.route-stop__card--r::after { left: calc(var(--space-3) * -1); }
.route-stop__top { display: flex; align-items: center; gap: var(--space-2); margin-bottom: 4px; }
.route-stop__card--l .route-stop__top { flex-direction: row-reverse; }
.route-stop__area { font-size: var(--fs-body); font-weight: var(--w-bold); color: #fff; letter-spacing: -0.01em; }
.route-stop__why { font-size: var(--fs-sm); color: var(--ink-200); line-height: 1.45; margin: 0; }

/* severity tag (Critical / Partial / Strong), coloured by RAG */
.route-stop__sev {
  display: inline-block; margin-top: var(--space-2);
  font-size: var(--fs-caption); font-weight: var(--w-bold);
  letter-spacing: var(--ls-eyebrow); text-transform: uppercase;
}
.route-stop__sev.rag-sev-low  { color: var(--rag-low); }
.route-stop__sev.rag-sev-mid  { color: var(--rag-mid); }
.route-stop__sev.rag-sev-high { color: var(--rag-high); }

/* expandable stop: the card is a button styled to match the static card */
button.route-stop__card {
  font-family: inherit; width: 100%; cursor: pointer; color: inherit;
  display: block;
}
button.route-stop__card--l { text-align: right; }
button.route-stop__card:hover { border-color: var(--ink-500); }
button.route-stop__card:focus-visible { outline: 2px solid var(--brand-red); outline-offset: 2px; }
.route-stop__chev { color: var(--ink-300); flex: none; transition: transform var(--dur-base) var(--ease-out); }
.route-stop.is-open .route-stop__chev { transform: rotate(180deg); }

/* the detail panel lives in the same grid column as its card */
.route-stop__detail {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows var(--dur-base) var(--ease-in-out);
}
.route-stop.is-open .route-stop__detail { grid-template-rows: 1fr; }
.route-stop__detail > div { overflow: hidden; }
/* detail sits on a second row, under its card's column */
.route-stop.has-detail { grid-template-rows: auto auto; }
.route-stop__detail { grid-row: 2; }
.route-stop__detail--l { grid-column: 1; margin: var(--space-2) var(--space-3) 0 0; }
.route-stop__detail--r { grid-column: 3; margin: var(--space-2) 0 0 var(--space-3); }
.route-stop__signal { font-size: var(--fs-sm); font-weight: var(--w-semibold); color: #fff; margin: var(--space-2) 0 var(--space-3); line-height: 1.5; }
.route-stop__block { margin: 0 0 var(--space-3); text-align: left; }
.route-stop__block h5 { font-size: var(--fs-eyebrow); font-weight: var(--w-bold); letter-spacing: var(--ls-eyebrow); text-transform: uppercase; color: var(--ink-300); margin: 0 0 4px; }
.route-stop__block p { font-size: var(--fs-sm); color: var(--ink-200); line-height: 1.55; margin: 0; }
.route-stop__needle { margin: 0; padding-left: var(--space-5); }
.route-stop__needle li { font-size: var(--fs-sm); color: var(--ink-200); line-height: 1.55; margin-bottom: var(--space-2); }
.route-stop__block--watch p { color: var(--rag-mid); }
.route-stop__start, .route-stop__end {
  text-align: center; font-size: var(--fs-eyebrow); font-weight: var(--w-bold); letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase; color: var(--ink-300); margin-bottom: var(--space-5);
}
.route-stop__end { margin-top: var(--space-2); margin-bottom: 0; color: var(--rag-high); }

/* horizon zone marker on the spine (the B×C hybrid) */
.route-zone { position: relative; text-align: center; margin: var(--space-6) 0 var(--space-5); z-index: 4; }
.route-zone:first-of-type { margin-top: var(--space-2); }
.route-zone__pill {
  display: inline-flex; align-items: baseline; gap: var(--space-2);
  background: var(--ink-1000); border: 1px solid var(--_h, var(--ink-500)); border-radius: var(--radius-pill);
  padding: 7px var(--space-4);
}
.route-zone__label { font-size: var(--fs-sm); font-weight: var(--w-extrabold); color: #fff; letter-spacing: var(--ls-eyebrow); text-transform: uppercase; }
.route-zone__when { font-size: var(--fs-caption); color: var(--ink-300); font-weight: var(--w-semibold); }
.route-zone--now   { --_h: var(--brand-red); }
.route-zone--next  { --_h: var(--rag-mid); }

/* the quiet "Later" group , compact rows, not full stops */
.route-later { position: relative; z-index: 4; margin-top: var(--space-6); }
.route-later__head {
  text-align: center; font-size: var(--fs-eyebrow); font-weight: var(--w-bold); letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase; color: var(--ink-300); margin-bottom: var(--space-4);
  position: relative; z-index: 5;
}
/* mask the centre spine behind just the label text */
.route-later__head span {
  display: inline-block; background: var(--ink-1000); padding: 0 var(--space-4);
}
.route-later__list {
  background: var(--ink-900); border: 1px solid var(--ink-600); border-radius: var(--radius-lg);
  overflow: hidden; max-width: 460px; margin: 0 auto;
}
.route-later__row {
  display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-4); border-top: 1px solid var(--ink-700);
}
.route-later__row:first-child { border-top: 0; }
.route-later__num { font-size: var(--fs-sm); font-weight: var(--w-extrabold); color: var(--ink-300); font-variant-numeric: tabular-nums; min-width: 1.5em; }
.route-later__area { font-size: var(--fs-sm); font-weight: var(--w-bold); color: var(--ink-100); letter-spacing: -0.01em; }
.route-later__why { font-size: var(--fs-caption); color: var(--ink-300); line-height: 1.4; }

/* mobile , collapse the alternating route to a single left rail */
@media (max-width: 620px) {
  .route__track::before { left: 21px; transform: none; }
  .route-stop { grid-template-columns: 44px 1fr; min-height: 0; margin-bottom: var(--space-5); }
  .route-stop__node { grid-column: 1; justify-self: start; }
  .route-stop__card--l, .route-stop__card--r { grid-column: 2; margin: 0 0 0 var(--space-4); text-align: left; }
  .route-stop__card--l .route-stop__top { flex-direction: row; }
  .route-stop__card--l::after, .route-stop__card--r::after { left: calc(var(--space-4) * -1); right: auto; }
  .route-zone, .route-later__head, .route-stop__start, .route-stop__end { text-align: left; padding-left: 4px; }
  .route-later__list { max-width: none; }
  /* detail panel: full width under the card in the single rail */
  .route-stop__detail--l, .route-stop__detail--r { grid-column: 2; margin: var(--space-2) 0 0 var(--space-4); text-align: left; }
}
