/* roadmap-constellation.css (TIC-2417): the /roadmap Constellation, one deliberate night
 * scene in both app themes. The sky fills the whole main pane (it cancels <main>'s padding)
 * and the viewport between the top bar and the footer; the HUD floats over the canvas; the
 * RFC ledger sits under the sky on the same ground. Every colour is a token below. */

.cst {
  --ink: #070b16;          /* the sky */
  --ink-2: #0d1326;        /* raised panels */
  --line: #1e2742;         /* hairlines */
  --fg: #dfe6f5;           /* primary text */
  --fg-dim: #8a96b3;       /* secondary text */
  --fg-faint: #56617d;     /* captions */
  --shipped: #5eead4;      /* landed: settled teal */
  --progress: #f5b84a;     /* building: warm amber */
  --planned: #9aa8ff;      /* charted, not built */
  --display: "Chakra Petch", "Space Grotesk Variable", "Arial Narrow", sans-serif;
  --body: "Inter Variable", -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono Variable", ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: dark;
  /* Full bleed: <main> is px-6 with a pt-6 wrapper. */
  margin: -1.5rem -1.5rem 0;
  background: var(--ink);
  color: var(--fg);
  font-family: var(--body);
  font-size: 14px;
  line-height: 1.5;
}
.cst button, .cst input { font: inherit; color: inherit; }
.cst :focus-visible { outline: 2px solid var(--shipped); outline-offset: 2px; }
.cst-gutter { padding-left: 24px; padding-right: 24px; }

/* The sky: the viewport between the 3rem top bar and the 3rem footer. */
.cst-sky { position: relative; height: max(560px, calc(100dvh - 6rem)); border-bottom: 1px solid var(--line); overflow: hidden; }
.cst-map { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; touch-action: manipulation; }

.cst-hud { position: absolute; inset: 0; pointer-events: none; display: grid; grid-template-rows: auto 1fr auto; padding-top: 22px; padding-bottom: 16px; }
.cst-hud > * { pointer-events: none; }
.cst-hud a, .cst-hud button, .cst-hud input, .cst-rail, .cst-stats { pointer-events: auto; }
.cst-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 32px; align-items: flex-start; }
.cst-brand { min-width: 0; max-width: 36ch; }
.cst-eyebrow { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-faint); }
.cst-title { font-family: var(--display); font-weight: 600; font-size: clamp(30px, 4.4vw, 52px); line-height: 1; letter-spacing: .01em; margin: 8px 0 10px; text-wrap: balance; color: var(--fg); }
.cst-brand p { margin: 0; color: var(--fg-dim); font-size: 13px; }
.cst-audit { display: inline-block; margin-top: 10px; font-family: var(--mono); font-size: 11px; color: var(--fg-faint); text-decoration: none; }
.cst-audit:hover { color: var(--shipped); }

.cst-stats { display: flex; gap: 24px; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
/* With throughput totals the figures stand in two rows: status, then tickets / PRs / commits. */
.cst-stats:has(.cst-stats-row) { flex-direction: column; align-items: flex-end; gap: 14px; }
.cst-stats-row { display: flex; gap: 24px; flex-wrap: wrap; justify-content: flex-end; }
.cst-stats-row--sub .cst-stat b { font-size: 22px; color: var(--fg); }
.cst-stat { display: grid; gap: 3px; min-width: 64px; }
.cst-stat b { font-family: var(--display); font-weight: 600; font-size: 30px; line-height: 1; }
.cst-stat span { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--fg-faint); }
.cst-stat.s b { color: var(--shipped); } .cst-stat.p b { color: var(--progress); } .cst-stat.r b { color: var(--planned); } .cst-stat.share b { color: var(--fg); }

.cst-feed { justify-self: start; max-width: min(620px, 100%); font-family: var(--mono); font-size: 12px; color: var(--fg-dim); display: grid; gap: 3px; margin-bottom: 12px; }
.cst-feed .cap { color: var(--fg-faint); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; }
.cst-feed .row { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; animation: cst-rise .5s ease-out; }
.cst-feed .row em { font-style: normal; color: var(--shipped); }
@keyframes cst-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.cst-rail { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; }
.cst-play { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--ink-2); display: grid; place-items: center; cursor: pointer; padding: 0; }
.cst-play:hover { border-color: var(--shipped); }
.cst-play svg { width: 14px; height: 14px; fill: var(--fg); }
.cst-track { position: relative; height: 40px; min-width: 0; }
.cst-spark { position: absolute; left: 0; right: 0; top: 0; width: 100%; height: 24px; }
.cst-scrub { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; margin: 0; accent-color: var(--shipped); height: 14px; }
.cst-when { font-family: var(--mono); font-size: 12px; color: var(--fg); min-width: 10ch; text-align: right; font-variant-numeric: tabular-nums; }
.cst-when small { display: block; color: var(--fg-faint); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; }

.cst-tip { position: absolute; z-index: 5; pointer-events: none; background: color-mix(in srgb, var(--ink-2) 92%, transparent); border: 1px solid var(--line); padding: 8px 10px; max-width: 280px; font-size: 12.5px; line-height: 1.35; transform: translate(12px, 12px); backdrop-filter: blur(6px); color: var(--fg); }
.cst-tip .n { font-family: var(--mono); font-size: 11px; color: var(--fg-faint); }

.cst-panel { position: absolute; z-index: 6; top: 132px; right: 24px; width: min(380px, calc(100% - 48px)); max-height: calc(100% - 240px); overflow: auto; background: color-mix(in srgb, var(--ink-2) 94%, transparent); border: 1px solid var(--line); padding: 16px 16px 14px; backdrop-filter: blur(8px); }
.cst-panel h2 { font-family: var(--display); font-weight: 600; font-size: 20px; line-height: 1.2; margin: 6px 0 8px; text-wrap: balance; color: var(--fg); }
.cst-panel .close { position: absolute; top: 8px; right: 8px; background: none; border: 0; color: var(--fg-dim); cursor: pointer; font-size: 18px; width: 28px; height: 28px; }
.cst-panel p { margin: 0 0 10px; color: var(--fg-dim); font-size: 13px; }
.cst-panel .open { display: inline-block; margin: 2px 0 12px; font-family: var(--mono); font-size: 11.5px; color: var(--shipped); text-decoration: none; }
.cst-panel .open:hover { text-decoration: underline; }
.cst-facts { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; font-size: 12px; margin: 0 0 12px; }
.cst-facts dt { font-family: var(--mono); color: var(--fg-faint); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.cst-facts dd { margin: 0; font-variant-numeric: tabular-nums; color: var(--fg); }
.cst-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 12px; }
.cst-chip { font-family: var(--mono); font-size: 11px; border: 1px solid var(--line); background: none; padding: 2px 6px; cursor: pointer; color: var(--fg-dim); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cst-chip:hover { color: var(--fg); border-color: var(--fg-faint); }
.cst-commits { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 12px; color: var(--fg); }
.cst-commits li { display: grid; grid-template-columns: auto 1fr; gap: 0 8px; }
.cst-commits .d { font-family: var(--mono); color: var(--fg-faint); font-size: 11px; }
.cst-commits .k { color: var(--shipped); font-family: var(--mono); font-size: 11px; }
.cst-sub { font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--fg-faint); margin: 12px 0 4px; }

.cst-pill { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.cst-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.cst-pill.shipped::before { background: var(--shipped); }
.cst-pill.progress::before { background: var(--progress); }
.cst-pill.planned::before { border: 1.5px solid var(--planned); width: 6px; height: 6px; }
.cst-pill.exploring::before { border: 1.5px dashed var(--planned); width: 6px; height: 6px; }
.cst-pill.superseded::before { background: var(--fg-faint); width: 5px; height: 5px; }
.cst-pill.shipped { color: var(--shipped); } .cst-pill.progress { color: var(--progress); } .cst-pill.planned, .cst-pill.exploring { color: var(--planned); } .cst-pill.superseded { color: var(--fg-faint); }

.cst-below { padding-top: 28px; padding-bottom: 56px; display: grid; gap: 28px; }
.cst-legend { display: flex; flex-wrap: wrap; gap: 10px 26px; color: var(--fg-dim); font-size: 12.5px; align-items: center; }
.cst-note { color: var(--fg-faint); font-size: 12px; flex-basis: 100%; max-width: 90ch; }
.cst-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.cst-search { background: var(--ink-2); border: 1px solid var(--line); padding: 8px 10px; min-width: 0; width: min(340px, 100%); border-radius: 0; }
.cst-search::placeholder { color: var(--fg-faint); }
.cst-areas { display: flex; flex-wrap: wrap; gap: 6px; }
.cst-area-btn { background: none; border: 1px solid var(--line); padding: 5px 10px; font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-dim); cursor: pointer; }
.cst-area-btn[aria-pressed="true"] { color: var(--ink); background: var(--fg); border-color: var(--fg); }
/* "Replay on arrival": the embedding page remembers the choice; the renderer only reads opts.autoplay. */
.cst-autoplay { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-dim); cursor: pointer; user-select: none; }
.cst-autoplay input { accent-color: var(--shipped); width: 14px; height: 14px; margin: 0; cursor: pointer; }
.cst-autoplay:hover { color: var(--fg); }
.cst-ledger { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 28px 40px; }
.cst-ledger section { min-width: 0; }
.cst-ledger h3 { font-family: var(--display); font-weight: 600; font-size: 18px; margin: 0 0 6px; display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--line); padding-bottom: 6px; color: var(--fg); }
.cst-ledger h3 span { font-family: var(--mono); font-size: 11px; color: var(--fg-faint); font-weight: 400; align-self: end; }
.cst-ledger ol { list-style: none; margin: 0; padding: 0; }
.cst-ledger li a { width: 100%; text-align: left; padding: 6px 0; display: grid; grid-template-columns: 4.2ch 1fr auto; gap: 10px; align-items: baseline; cursor: pointer; border-bottom: 1px solid color-mix(in srgb, var(--line) 50%, transparent); text-decoration: none; }
.cst-ledger li a:hover .t { color: var(--fg); }
.cst-ledger .num { font-family: var(--mono); font-size: 11px; color: var(--fg-faint); }
.cst-ledger .t { color: var(--fg-dim); font-size: 13px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cst-foot { color: var(--fg-faint); font-size: 12px; font-family: var(--mono); margin: 0; }

/* The list view: collapsed, so the page is the map. */
.cst-listview > summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--fg-dim); border: 1px solid var(--line); padding: 6px 12px; }
.cst-listview > summary::-webkit-details-marker { display: none; }
.cst-listview > summary::after { content: "▾"; transition: transform .2s; }
.cst-listview[open] > summary::after { transform: rotate(180deg); }
.cst-listview > summary:hover { color: var(--fg); border-color: var(--fg-faint); }
.cst-listview[open] > summary { margin-bottom: 24px; }
.cst-items { margin-top: 36px; max-width: 900px; }
.cst-items > h3 { font-family: var(--display); font-weight: 600; font-size: 18px; margin: 0 0 14px; border-bottom: 1px solid var(--line); padding-bottom: 6px; color: var(--fg); }

@media (max-width: 760px) {
  .cst-gutter { padding-left: 16px; padding-right: 16px; }
  .cst-sky { height: auto; display: flex; flex-direction: column; }
  .cst-map { position: relative; height: 62vh; min-height: 420px; order: 1; }
  .cst-hud { position: relative; inset: auto; order: 0; padding-top: 16px; padding-bottom: 8px; }
  .cst-hud .cst-bottom { display: none; }
  .cst-mrail { padding-top: 8px; padding-bottom: 14px; }
  .cst-panel { position: relative; top: auto; right: auto; width: auto; max-height: none; margin: 0 16px 16px; order: 3; }
  .cst-stats { gap: 16px; }
  .cst-stat b { font-size: 22px; }
  .cst-ledger { grid-template-columns: 1fr; }
}
@media (min-width: 761px) { .cst-mrail { display: none; } }
