/* ==========================================================================
   Target Biology Explorer (targets-v2.html). Builds on css/home-v2.css
   (tokens, header, footer, type, buttons) and css/home-sections-v2.css.
   Rendered by js/targets/explorer.js.
   ========================================================================== */
body.page-targets, body.page-cells {
  --accent: #ff9d34;
  --accent-hi: #ffd9ad;
  --accent-soft: rgba(255, 157, 52, .14);
  --accent-glow: rgba(255, 157, 52, .5);
  --tx-blue: #7fb3d0;
}

/* ---------- Catalog hero and controls ---------- */
.tx-hero { padding-block: var(--s-8) var(--s-5); }
.tx-hero h1 { max-width: 17ch; font-size: clamp(2.2rem, 5.4vw, 3.8rem); letter-spacing: -0.035em; line-height: 1.05; }
.tx-lead { margin-top: var(--s-5); max-width: 62ch; color: var(--text); font-size: clamp(1.02rem, 1.5vw, 1.15rem); line-height: 1.55; }
.tx-scope { margin-top: var(--s-3); max-width: 70ch; color: var(--muted); font-size: .95rem; line-height: 1.55; }
.tx-controls { margin-top: var(--s-6); display: grid; gap: var(--s-3); }
.tx-search {
  width: 100%; max-width: 420px; min-height: 46px; padding: 0 var(--s-4);
  background: var(--surface); color: var(--text); border: 1px solid var(--line-strong); border-radius: 999px;
  font: 400 1rem/1 var(--sans);
}
.tx-search::placeholder { color: var(--dim); }
.tx-search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tx-filters { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.tx-chip {
  min-height: 36px; padding: 0 var(--s-4); border: 1px solid var(--line-strong); border-radius: 999px;
  background: none; color: var(--muted); font: 500 .85rem/1 var(--sans); cursor: pointer;
  transition: border-color .2s ease, color .2s ease, background-color .2s ease;
}
.tx-chip:hover { color: var(--text); border-color: var(--muted); }
.tx-chip[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: #000; }
.tx-count { margin-top: var(--s-4); font: 400 .74rem/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }

/* Content-status flag (placeholder / conceptual) */
.tx-flag {
  display: inline-block; margin: 0 0 var(--s-5); padding: 6px 12px; border: 1px dashed var(--line-strong); border-radius: 8px;
  font: 400 .72rem/1.4 var(--mono); letter-spacing: .04em; color: var(--muted);
}
.tx-flag[hidden] { display: none; }

/* ---------- Catalog grid and cards ---------- */
.tx-catalog { padding-bottom: var(--s-8); }
.tx-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.tx-group { grid-column: 1 / -1; font-family: var(--font-mono, "Geist Mono", monospace); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding-top: var(--s-4); border-top: 1px solid var(--line); }
.tx-group:first-child { padding-top: 0; border-top: 0; }
.tx-card-link {
  display: flex; flex-direction: column; height: 100%;
  border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); overflow: hidden;
  transition: border-color .25s var(--ease), transform .25s var(--ease);
}
.tx-card-link:hover, .tx-card-link:focus-visible { border-color: rgba(255, 157, 52, .7); transform: translateY(-2px); }
.tx-card-net { position: relative; display: block; aspect-ratio: 16 / 9; background: var(--dots), #070605; border-bottom: 1px solid var(--line); }
.tx-card-net svg { position: absolute; inset: 8% 6%; width: 88%; height: 84%; }
.tx-card-label { position: absolute; left: 10px; bottom: 8px; font: 400 .62rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.tx-card-body { display: flex; flex-direction: column; gap: var(--s-2); padding: var(--s-5); flex: 1; }
.tx-card-areas { font: 500 .68rem/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.tx-card-symbol { font-size: 1.45rem; font-weight: 500; letter-spacing: -0.02em; color: var(--text); }
.tx-card-type { margin-top: -4px; font-size: .85rem; color: var(--dim); }
.tx-card-themes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--s-1); }
.tx-card-themes span { padding: 2px 9px; border: 1px solid var(--line-strong); border-radius: 999px; font-size: .74rem; color: var(--muted); }
.tx-card-q { margin-top: var(--s-2); color: var(--text); font-size: .92rem; line-height: 1.45; flex: 1; }
.tx-card-cta { margin-top: var(--s-3); color: var(--accent); font-weight: 500; font-size: .9rem; }
.tx-empty { padding: var(--s-6) 0; color: var(--muted); }
.tx-empty[hidden] { display: none; }

/* ---------- Network SVG ---------- */
.tx-net { display: block; width: 100%; height: auto; overflow: visible; }
.tx-edge { fill: none; stroke: rgba(255, 157, 52, .55); stroke-width: .45; }
.tx-edge-feedback { stroke: var(--tx-blue); stroke-dasharray: 1.4 1.1; }
.tx-edge-question { stroke: rgba(245, 245, 245, .45); stroke-dasharray: 1 1.3; }
.tx-arrowhead { fill: rgba(255, 157, 52, .8); }
.tx-net-mini .tx-edge { stroke-width: .7; }
.tx-node .tx-dot { fill: #666666; }
.tx-node-target .tx-dot { fill: var(--accent); }
.tx-node-feedback .tx-dot { fill: var(--tx-blue); }
.tx-node-output .tx-dot { fill: #cccccc; }
.tx-basis-question .tx-dot, .tx-net-mini .tx-basis-question { fill: #0b0b0b; stroke: rgba(245, 245, 245, .7); stroke-width: .45; stroke-dasharray: .9 .7; }
.tx-net-mini .tx-node-target { fill: var(--accent); }
.tx-net-mini .tx-node-feedback { fill: var(--tx-blue); }
.tx-net-mini .tx-node-output { fill: #cccccc; }
.tx-net-mini .tx-node-upstream, .tx-net-mini .tx-node-pathway { fill: #666666; }
.tx-halo { fill: none; stroke: rgba(255, 157, 52, .35); stroke-width: .5; }
.tx-hit { fill: transparent; }
.tx-node { cursor: pointer; outline: none; }
.tx-node text { font: 500 2.2px/1 var(--mono); fill: var(--muted); letter-spacing: .02em; pointer-events: none; }
.tx-node:hover .tx-dot, .tx-node:focus-visible .tx-dot { stroke: var(--text); stroke-width: .5; }
.tx-node:focus-visible .tx-hit { stroke: var(--accent); stroke-width: .4; }
.has-selection .tx-node:not(.is-selected) text { fill: var(--dim); }
.tx-node.is-selected .tx-dot { stroke: var(--accent-hi); stroke-width: .7; }
.tx-node.is-selected text { fill: var(--text); }
.has-selection .tx-edge { opacity: .45; }
.has-selection .tx-edge.is-linked { opacity: 1; stroke-width: .7; }
@media (prefers-reduced-motion: no-preference) {
  .tx-halo { animation: tx-pulse 3.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
  @keyframes tx-pulse { 50% { opacity: .35; transform: scale(1.15); } }
}

/* ---------- Detail view ---------- */
.tx-detail { padding-block: var(--s-7) var(--s-8); }
.tx-back { margin-bottom: var(--s-4); }
.tx-d-head { display: grid; gap: var(--s-3); max-width: 760px; }
.tx-d-head h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); letter-spacing: -0.04em; line-height: 1; outline: none; }
.tx-d-type { color: var(--dim); font-size: .95rem; }
.tx-d-overview { color: var(--text); font-size: 1.08rem; line-height: 1.55; }
.tx-d-why { color: var(--muted); line-height: 1.55; }
.tx-d-head .btn { justify-self: start; margin-top: var(--s-2); }
.tx-d-sec { margin-top: var(--s-8); padding-top: var(--s-6); border-top: 1px solid var(--line); }
.tx-d-sec h2 { margin-bottom: var(--s-4); }
.tx-d-sub, .tx-d-note { max-width: 70ch; color: var(--muted); font-size: .95rem; line-height: 1.55; }
.tx-d-note { margin-top: var(--s-4); font-size: .88rem; color: var(--dim); }

.tx-net-grid { margin-top: var(--s-5); display: grid; gap: var(--s-4); }
.tx-net-fig { margin: 0; padding: var(--s-5); border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--dots), #070605; }
.tx-legend { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); margin-top: var(--s-4); font: 400 .68rem/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tx-legend i { display: inline-block; width: 18px; height: 0; margin-right: 6px; vertical-align: middle; border-top: 1.5px solid rgba(255, 157, 52, .8); }
.tx-legend .lg-fb { border-top: 1.5px dashed var(--tx-blue); }
.tx-legend .lg-q { border-top: 1.5px dashed rgba(245, 245, 245, .6); }
.tx-legend-note { color: var(--dim); }
.tx-panel { padding: var(--s-5); border: 1px solid rgba(255, 157, 52, .45); border-radius: var(--radius); background: var(--surface); align-self: start; }
.tx-panel h3 { margin-top: var(--s-2); font-size: 1.25rem; }
.tx-panel p { margin-top: var(--s-2); color: var(--text); font-size: .92rem; line-height: 1.5; }
.tx-panel-kind, .tx-panel-label { font: 500 .68rem/1.4 var(--mono) !important; letter-spacing: .1em; text-transform: uppercase; color: var(--accent) !important; }
.tx-panel-label { margin-top: var(--s-4) !important; color: var(--dim) !important; }
.tx-panel-basis { display: inline-block; padding: 2px 9px; border-radius: 999px; font: 500 .68rem/1.4 var(--mono) !important; border: 1px solid rgba(255, 157, 52, .5); color: var(--accent) !important; }
.tx-panel-question { border-style: dashed; border-color: var(--line-strong); color: var(--muted) !important; }
.tx-panel ul { list-style: none; margin: var(--s-2) 0 0; padding: 0; display: grid; gap: 4px; font: 400 .8rem/1.4 var(--mono); color: var(--muted); }

.tx-questions { list-style: none; margin: var(--s-4) 0 0; padding: 0; display: grid; gap: var(--s-3); }
.tx-questions li { display: flex; gap: var(--s-4); align-items: baseline; padding: var(--s-4); border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); line-height: 1.5; }
.tx-questions li span { flex: none; font: 500 .75rem/1 var(--mono); color: var(--accent); }

.tx-steps { list-style: none; margin: var(--s-4) 0 var(--s-4); padding: 0; display: grid; gap: var(--s-3); }
.tx-steps li { display: grid; gap: 6px; padding: var(--s-4); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); }
.tx-step-n { font: 500 .72rem/1 var(--mono); color: var(--accent); }
.tx-steps b { font-weight: 500; }
.tx-steps li > span:last-child { color: var(--muted); font-size: .88rem; line-height: 1.45; }

.tx-deliver, .tx-apps { list-style: none; margin: var(--s-4) 0 0; padding: 0; display: grid; gap: var(--s-3); }
.tx-deliver li, .tx-apps li { padding: var(--s-5); border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); }
.tx-deliver-head { display: flex; justify-content: space-between; gap: var(--s-3); align-items: baseline; }
.tx-deliver-head b, .tx-apps b { font-weight: 500; font-size: 1.05rem; color: var(--text); }
.tx-deliver-head em { font: 500 .64rem/1.4 var(--mono); font-style: normal; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); padding: 2px 8px; border: 1px solid rgba(255, 157, 52, .5); border-radius: 999px; white-space: nowrap; }
.tx-deliver-head em.is-later { color: var(--muted); border-style: dashed; border-color: var(--line-strong); }
.tx-deliver li > p:last-child { margin-top: var(--s-2); color: var(--muted); font-size: .92rem; line-height: 1.5; }
.tx-apps p { margin-top: var(--s-3); color: var(--text); font-size: .92rem; line-height: 1.5; }
.tx-apps p span { display: block; margin-bottom: 2px; font: 500 .64rem/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }

.tx-d-cta { margin-top: var(--s-8); padding: var(--s-7) var(--s-5); text-align: center; border: 1px solid rgba(255, 157, 52, .45); border-radius: var(--radius); background: radial-gradient(ellipse 60% 80% at 50% 100%, rgba(255, 157, 52, .14), transparent 70%), var(--surface); }
.tx-d-cta h2 { margin-inline: auto; }
.tx-d-cta p { margin: var(--s-3) auto 0; max-width: 56ch; color: var(--muted); }
.tx-d-cta .actions { justify-content: center; }
.tx-grid-related { margin-top: var(--s-4); }

/* ---------- Another target ---------- */
.tx-other-grid { display: grid; gap: var(--s-6); align-items: start; }
.tx-other-form { display: grid; gap: var(--s-4); padding: var(--s-5); border: 1px solid rgba(255, 157, 52, .45); border-radius: var(--radius); background: var(--surface); }
.tx-field { display: grid; gap: var(--s-2); }
.tx-field label { font-weight: 500; font-size: .92rem; }
.tx-field input, .tx-field select {
  width: 100%; min-height: 46px; padding: 0 var(--s-4); background: var(--bg); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: 8px; font: 400 1rem/1.4 var(--sans);
}
.tx-field input:focus, .tx-field select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tx-other-form .btn { justify-self: start; border: 0; cursor: pointer; }

@media (min-width: 640px) {
  .tx-steps { grid-template-columns: repeat(2, 1fr); }
  .tx-deliver, .tx-apps { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 901px) {
  .tx-hero { padding-block: var(--s-9) var(--s-6); }
  .tx-net-grid { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
  .tx-steps { grid-template-columns: repeat(3, 1fr); }
  .tx-deliver { grid-template-columns: repeat(3, 1fr); }
  .tx-other-grid { grid-template-columns: 1fr 1fr; gap: var(--s-8); }
}
@media (prefers-reduced-motion: reduce) {
  .tx-card-link { transition: none; }
  .tx-card-link:hover, .tx-card-link:focus-visible { transform: none; }
}

/* ---------- Hero preview ---------- */
.tx-hero-grid { display: grid; gap: var(--s-7); align-items: center; }
.tx-preview {
  display: flex; flex-direction: column; border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--dots), #070605; overflow: hidden; transition: border-color .25s var(--ease);
}
.tx-preview:hover, .tx-preview:focus-visible { border-color: rgba(255, 157, 52, .7); }
.tx-preview-top, .tx-preview-foot { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-4); }
.tx-preview-kicker { font: 500 .66rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--dim); }
.tx-preview-dots { display: flex; gap: 5px; }
.tx-preview-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); }
.tx-preview-dots i.is-on { background: var(--accent); }
.tx-preview-net { display: block; padding: var(--s-2) var(--s-5) 0; }
.tx-preview-foot { border-top: 1px solid var(--line); background: rgba(19, 17, 16, .85); }
.tx-preview-foot b { display: block; font-weight: 500; font-size: 1.1rem; color: var(--text); }
.tx-preview-foot b + span { font: 400 .7rem/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.tx-preview-cta { color: var(--accent); font-weight: 500; font-size: .9rem; white-space: nowrap; }
@media (min-width: 901px) { .tx-hero-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: var(--s-8); } }
@media (max-width: 639px) { .tx-preview-cta { display: none; } }

/* Phones: larger network labels and a tighter frame, so node names stay readable */
@media (max-width: 639px) {
  .tx-node text { font-size: 3.3px; }
  .tx-net-fig { padding: var(--s-3); }
  .tx-preview-net { padding: var(--s-2) var(--s-2) 0; }
}

/* ---------- Two ways to start ---------- */
.tx-paths-sec { padding-bottom: var(--s-6); }
.tx-paths { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-4); }
.tx-paths > li { display: grid; gap: var(--s-3); align-content: start; padding: var(--s-5); border: 1px solid rgba(255, 157, 52, .5); border-radius: var(--radius); background: linear-gradient(180deg, rgba(255, 157, 52, .08), rgba(255, 157, 52, 0)), var(--surface); }
.tx-paths > li + li { border-style: solid; border-color: var(--line-strong); background: var(--surface); }
.tx-path-kicker { font: 500 .7rem/1.4 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.tx-paths h2 { font-size: 1.35rem; max-width: none; }
.tx-path-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); counter-reset: s; }
.tx-path-steps li { counter-increment: s; display: flex; gap: var(--s-3); color: var(--text); font-size: .95rem; line-height: 1.45; }
.tx-path-steps li::before { content: counter(s, decimal-leading-zero); flex: none; font: 500 .72rem/1.6 var(--mono); color: var(--accent); }
.tx-path-time { display: flex; align-items: center; gap: var(--s-2); font: 400 .74rem/1.4 var(--mono); letter-spacing: .04em; color: var(--muted); }
.tx-path-time i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }
.tx-paths > li + li .tx-path-time i { background: transparent; border: 1.5px solid var(--muted); }
.tx-scope b { color: var(--text); font-weight: 500; }
.tx-note-strong { color: var(--text) !important; font-size: .95rem !important; }

/* Status badge: resolved network available */
.tx-status { display: inline-flex; align-items: center; gap: 6px; font: 500 .7rem/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.tx-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 6px var(--accent-glow); }
.tx-status-lg { font-size: .78rem; }
@media (min-width: 901px) { .tx-paths { grid-template-columns: 1fr 1fr; gap: var(--s-5); } }
.tx-list-title { font-size: clamp(1.5rem, 3vw, 2rem); max-width: none; }
.tx-catalog .tx-controls { margin-top: var(--s-4); }
.tx-catalog .tx-count { margin-bottom: var(--s-4); }

/* Cellular systems block on target pages (data: js/cells/cell-systems-data.js) */
.tx-cells { list-style: none; margin: var(--s-4) 0 var(--s-4); padding: 0; display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.tx-cells 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); }
.tx-cells a:hover, .tx-cells a:focus-visible { border-color: rgba(255, 157, 52, .7); }
.tx-cells b { font-size: 1.2rem; font-weight: 500; color: var(--text); }
.tx-cells-why { color: var(--text); }
.tx-cells em { justify-self: start; padding: 2px 9px; border: 1px dashed var(--line-strong); border-radius: 999px; font: 400 .66rem/1.4 var(--mono); font-style: normal; color: var(--muted); }
.tx-links { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); }
.tx-d-sub .text-link { white-space: normal; }

/* Starting-point visuals (js/cells/start-visuals.js) */
.tx-paths-fig { margin: 0 0 var(--s-6); }
#tx-paths-viz { aspect-ratio: 16 / 7.5; }
#cs-where-viz { aspect-ratio: 16 / 8.5; }
#cs-src-viz { aspect-ratio: 16 / 6; }
#cs-where-viz, #cs-src-viz { margin-top: var(--s-6); }
#cs-src-viz { margin-bottom: var(--s-6); }
@media (max-width: 639px) {
  #tx-paths-viz { aspect-ratio: 1 / 1.1; }
  #cs-where-viz { aspect-ratio: 1 / 1; }
  #cs-src-viz { aspect-ratio: 1 / 0.8; }
}

/* Catalog and preview held back until targets are confirmed */
.tx-preview[hidden], .tx-catalog[hidden] { display: none !important; }
.tx-hero-grid:has(.tx-preview[hidden]) { grid-template-columns: minmax(0, 1fr); max-width: 52rem; }
