/* ==========================================================================
   Cellular Systems (cell-systems-v2.html). Builds on css/home-v2.css,
   css/home-sections-v2.css and the shared explorer parts in css/targets-v2.css
   (search, chips, flags, detail sections, CTA, inquiry form), so the page reads
   as a sibling of Available Targets. Rendered by js/cells/explorer.js.
   ========================================================================== */

/* ---------- Hero ---------- */
.cs-hero h1 { max-width: 14ch; }
.cs-proof { list-style: none; margin: var(--s-6) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-4) var(--s-7); }
.cs-proof li { display: grid; gap: 2px; }
.cs-proof b { font: 500 clamp(1.9rem, 4vw, 2.6rem)/1 var(--mono); letter-spacing: -0.04em; color: var(--text); }
.cs-proof li:nth-child(2) b { color: var(--accent); }
.cs-proof span { font-size: .85rem; color: var(--muted); max-width: 18ch; line-height: 1.35; }
.cs-proof-sm { margin-top: var(--s-2); }
.cs-proof-sm b { font-size: 1.8rem; }
.cs-proof-note { margin-top: var(--s-4); max-width: 60ch; font: 400 .72rem/1.5 var(--mono); letter-spacing: .02em; color: var(--dim); }
.cs-entry { margin-top: var(--s-5); }

/* Disease → cells → activities → network: four panels, 2 × 2 on phones */
.cs-chain { margin: 0; padding: var(--s-4); border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--dots), #070605; }
.cs-chain-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-3); }
.cs-chain-steps li { position: relative; display: grid; gap: 2px; justify-items: center; text-align: center; padding: var(--s-3) var(--s-2); border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(19, 17, 16, .7); }
.cs-chain-steps svg { width: 100%; max-width: 110px; height: auto; margin-bottom: var(--s-2); }
.cs-chain-steps b { font-weight: 500; font-size: .9rem; }
.cs-chain-steps span { font: 400 .66rem/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.c-ring { fill: none; stroke: rgba(245, 245, 245, .35); stroke-width: 1; stroke-dasharray: 2 2.5; }
.c-core, .c-dot.is-on { fill: var(--accent); }
.c-cell { fill: rgba(255, 157, 52, .06); stroke: rgba(245, 245, 245, .5); stroke-width: 1; }
.c-nuc { fill: none; stroke: var(--accent); stroke-width: 1; }
.c-dot { fill: #666666; }
.c-edge { fill: none; stroke: rgba(255, 157, 52, .6); stroke-width: 1; }
.cs-chain .hs-cap { margin-top: var(--s-3); }
@media (min-width: 640px) {
  .cs-chain-steps { grid-template-columns: repeat(4, 1fr); }
  .cs-chain-steps li:not(:last-child)::after { content: "→"; position: absolute; right: -11px; top: 38%; color: var(--accent); font-size: .8rem; z-index: 1; }
}
@media (min-width: 901px) { .cs-chain-steps { grid-template-columns: repeat(2, 1fr); } .cs-chain-steps li::after { display: none; } }
@media (min-width: 1100px) { .cs-chain-steps { grid-template-columns: repeat(4, 1fr); } .cs-chain-steps li:not(:last-child)::after { display: block; } }
@media (prefers-reduced-motion: no-preference) {
  .c-dot.is-on, .c-core { animation: cs-glow 3.6s ease-in-out infinite; }
  .cs-chain-steps li:nth-child(4) .c-dot.is-on { animation-delay: 1.2s; }
  @keyframes cs-glow { 50% { opacity: .45; } }
}

/* ---------- Library controls ---------- */
.cs-library { padding-bottom: var(--s-8); scroll-margin-top: 80px; }
.cs-views { display: inline-flex; margin-top: var(--s-4); padding: 3px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); }
.cs-view { padding: 9px var(--s-5); border-radius: 999px; color: var(--muted); font-weight: 500; font-size: .92rem; white-space: nowrap; }
.cs-view[aria-selected="true"] { background: var(--text); color: #000; }
.cs-view:hover:not([aria-selected="true"]) { color: var(--text); }
.cs-chip-n { margin-left: 4px; font: 400 .72rem/1 var(--mono); color: var(--dim); }
.tx-chip[aria-pressed="true"] .cs-chip-n { color: #3a332d; }
.tx-chip.is-request { border-style: dashed; }
.cs-filter-row { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; }
.cs-pd-toggle { display: inline-flex; align-items: center; gap: 7px; }
.cs-pd-toggle i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.cs-select { min-height: 36px; padding: 0 var(--s-4); border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--muted); font: 500 .85rem/1 var(--sans); }
.cs-select:focus, .cs-view:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------- Cards ---------- */
.cs-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.cs-grid-system { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.cs-card-link {
  display: flex; flex-direction: column; gap: var(--s-2); height: 100%; padding: var(--s-5);
  border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface);
  transition: border-color .25s var(--ease), transform .25s var(--ease);
}
.cs-card-link:hover, .cs-card-link:focus-visible { border-color: rgba(255, 157, 52, .7); transform: translateY(-2px); }
.cs-card-title { font-size: 1.3rem; font-weight: 500; letter-spacing: -0.02em; line-height: 1.2; color: var(--text); }
.cs-card-name { font-size: 1.05rem; }
.cs-card-cells, .cs-card-meta { font-size: .88rem; color: var(--muted); line-height: 1.4; }
.cs-card-d .cs-card-cells { flex: 1; }
.cs-card-stats { display: flex; flex-wrap: wrap; gap: 4px var(--s-4); font: 400 .72rem/1.4 var(--mono); letter-spacing: .04em; color: var(--muted); }
.cs-card-stats .is-pd { color: var(--accent); }
.cs-card-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cs-card-tags > span:not(.cs-pd) { padding: 2px 9px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: .74rem; color: var(--muted); }
.cs-pd { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border: 1px solid rgba(255, 157, 52, .55); border-radius: 999px; font-size: .74rem; color: var(--accent); }
.cs-pd i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 6px var(--accent-glow); }
.cs-card-tags .cs-hist-tag { border-style: dashed !important; }
.cs-card-hist { flex: 1; margin-top: var(--s-1); font-size: .82rem; line-height: 1.45; color: var(--muted); }
.cs-card-hist b { display: block; margin-bottom: 2px; font: 500 .62rem/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.cs-card-link .tx-card-cta { margin-top: var(--s-2); }

/* Provenance mix: one segment per system type (orange = patient-derived) */
.cs-mix { display: flex; gap: 2px; height: 6px; margin-top: var(--s-2); border-radius: 3px; overflow: hidden; }
.cs-mix i { min-width: 4px; }
.cs-mix .m-pd { background: var(--accent); }
.cs-mix .m-primary { background: #cccccc; }
.cs-mix .m-immortalized { background: #8a7f73; }
.cs-mix .m-ipsc { background: #7fb3d0; }
.cs-mix .m-ipsc-engineered { background: #4f7f99; }
.cs-mix .m-stem { background: #6d665e; }
.cs-mix .m-line { background: #4a443e; }

/* Empty state: feasibility, never availability */
.cs-empty { margin-top: var(--s-3); padding: var(--s-6) var(--s-5); border: 1px dashed rgba(255, 157, 52, .55); border-radius: var(--radius); background: var(--surface); }
.cs-empty[hidden] { display: none; }
.cs-empty-kicker { font: 500 .7rem/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.cs-empty h3 { margin-top: var(--s-2); font-size: 1.4rem; }
.cs-empty p:not(.cs-empty-kicker) { margin: var(--s-3) 0 var(--s-4); max-width: 62ch; color: var(--muted); line-height: 1.55; }
.cs-empty .text-link { white-space: normal; }

/* ---------- Flow (from cellular system to Biology Resolution): grid, 2 columns on phones ---------- */
.cs-flow { list-style: none; margin: var(--s-6) 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-3); }
.cs-flow li { display: grid; gap: 6px; align-content: start; padding: var(--s-4); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); }
.cs-flow li:first-child { border-color: rgba(255, 157, 52, .55); }
.cs-flow span { font: 500 .72rem/1 var(--mono); color: var(--accent); }
.cs-flow b { font-weight: 500; }
.cs-flow p { color: var(--muted); font-size: .86rem; line-height: 1.45; }
.cs-flow-3 { margin-top: var(--s-4); }
@media (max-width: 639px) { .cs-flow li:last-child:nth-child(odd) { grid-column: 1 / -1; } }
@media (min-width: 640px) { .cs-flow { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .cs-flow:not(.cs-flow-3) { grid-template-columns: repeat(5, 1fr); } }
.cs-note { margin-top: var(--s-5); max-width: 70ch; color: var(--muted); font-size: .92rem; line-height: 1.55; }

/* ---------- Sourcing routes ---------- */
.cs-routes { list-style: none; margin: var(--s-6) 0 0; padding: 0; display: grid; gap: var(--s-4); }
.cs-routes > li { display: grid; gap: var(--s-3); align-content: start; padding: var(--s-5); border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); }
.cs-routes > li:first-child { border-color: rgba(255, 157, 52, .5); background: linear-gradient(180deg, rgba(255, 157, 52, .08), rgba(255, 157, 52, 0)), var(--surface); }
.cs-routes h3 { font-size: 1.2rem; }
.cs-routes p:not(.tx-path-kicker) { color: var(--muted); font-size: .93rem; line-height: 1.5; }
.cs-routes .text-link { justify-self: start; }
@media (min-width: 901px) { .cs-routes { grid-template-columns: repeat(3, 1fr); } }
.cs-evidence { margin-top: var(--s-6); padding: var(--s-5); border-left: 2px solid var(--accent); background: var(--surface); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.cs-evidence-big { margin-top: var(--s-2); max-width: 46ch; font-size: clamp(1.1rem, 2vw, 1.35rem); line-height: 1.4; color: var(--text); }
.cs-evidence-big b { color: var(--accent); font-weight: 500; }
.cs-evidence .cs-note { margin-top: var(--s-2); font-size: .84rem; color: var(--dim); }

/* ---------- Set-up steps and documented expertise ---------- */
.cs-steps { list-style: none; margin: var(--s-6) 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-2); }
.cs-steps li { display: grid; gap: 4px; padding: var(--s-3) var(--s-4); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); font-size: .9rem; line-height: 1.35; }
.cs-steps li:last-child { border-color: rgba(255, 157, 52, .55); }
.cs-steps span { font: 500 .7rem/1 var(--mono); color: var(--accent); }
@media (min-width: 640px) { .cs-steps { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .cs-steps { grid-template-columns: repeat(6, 1fr); } }
.cs-sub { margin-top: var(--s-7); font-size: 1.2rem; }
.cs-expertise { list-style: none; margin: var(--s-4) 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-3); }
.cs-expertise li { display: grid; gap: 2px; align-content: start; padding: var(--s-4); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.cs-expertise b { font: 500 1.7rem/1.1 var(--mono); letter-spacing: -0.03em; color: var(--text); }
.cs-expertise span { font-size: .88rem; color: var(--text); line-height: 1.35; }
.cs-expertise em { font-style: normal; font-size: .78rem; color: var(--dim); line-height: 1.4; }
@media (min-width: 640px) { .cs-expertise { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .cs-expertise { grid-template-columns: repeat(4, 1fr); } }
.cs-limits { margin-top: var(--s-6); padding: var(--s-5); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.cs-limits ul { margin: var(--s-3) 0 0; padding-left: 1.1em; display: grid; gap: var(--s-2); color: var(--muted); font-size: .92rem; line-height: 1.5; }
.cs-limits b { color: var(--text); font-weight: 500; }

/* ---------- Detail pages ---------- */
.cs-detail .tx-d-head .tx-flag { justify-self: start; margin: 0; }
.cs-sys-title { font-size: clamp(2rem, 5vw, 3.4rem) !important; letter-spacing: -0.03em !important; line-height: 1.08 !important; }
.cs-crumb { color: var(--dim); }
.cs-dl { margin: var(--s-4) 0 0; display: grid; border-top: 1px solid var(--line); }
.cs-dl div { display: grid; gap: 2px; padding: var(--s-3) 0; border-bottom: 1px solid var(--line); }
.cs-dl dt { font: 500 .68rem/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.cs-dl dd { margin: 0; color: var(--text); font-size: .95rem; line-height: 1.45; }
@media (min-width: 640px) { .cs-dl div { grid-template-columns: 220px 1fr; gap: var(--s-4); align-items: baseline; } }
.cs-nr { font: 400 .78rem/1.4 var(--mono); color: var(--dim); }
.cs-qgrid { display: grid; gap: var(--s-3); margin-top: var(--s-4); }
.cs-qcol { padding: var(--s-5); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.cs-qcol.is-done { border: 1px solid rgba(255, 157, 52, .5); background: var(--surface); }
.cs-qhead { display: flex; align-items: center; gap: 8px; font: 500 .7rem/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.cs-qhead i { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--muted); flex: none; }
.is-done .cs-qhead { color: var(--accent); }
.is-done .cs-qhead i { background: var(--accent); border-color: var(--accent); }
.cs-qcol ul { margin: var(--s-3) 0 0; padding-left: 1.1em; display: grid; gap: var(--s-2); color: var(--text); font-size: .93rem; line-height: 1.5; }
.cs-qfoot { margin-top: var(--s-3); font-size: .8rem; color: var(--dim); }
@media (min-width: 901px) { .cs-qgrid { grid-template-columns: 1fr 1fr; } }
.cs-rel { list-style: none; margin: var(--s-4) 0 0; padding: 0; display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.cs-rel a { display: grid; gap: var(--s-2); height: 100%; padding: var(--s-5); border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); color: var(--muted); font-size: .9rem; line-height: 1.5; transition: border-color .25s var(--ease); }
.cs-rel a:hover, .cs-rel a:focus-visible { border-color: rgba(255, 157, 52, .7); }
.cs-rel b { font-size: 1.3rem; font-weight: 500; color: var(--text); }
.cs-rel-status { justify-self: start; padding: 2px 9px; border: 1px dashed var(--line-strong); border-radius: 999px; font: 400 .66rem/1.4 var(--mono); letter-spacing: .04em; color: var(--muted); }
.cs-rel em { font-style: normal; color: var(--accent); font-weight: 500; }

/* ---------- Inquiry ---------- */
.cs-inquiry { scroll-margin-top: 70px; }
.cs-opt { margin-left: 6px; font: 400 .7rem/1 var(--mono); color: var(--dim); text-transform: uppercase; letter-spacing: .08em; }

@media (prefers-reduced-motion: reduce) {
  .cs-card-link { transition: none; }
  .cs-card-link:hover, .cs-card-link:focus-visible { transform: none; }
}
