/* ══════════════════════════════════════════════════════════════════
   Topic Explorer — /explore, plus the homepage band, research-page
   section and faculty/courses sidebar widget.

   Every colour, radius, shadow and font here comes from the tokens in
   style.css. Per-topic colour is the only thing set inline, because it
   is data (the focus area a term was inferred into), not styling.
   ══════════════════════════════════════════════════════════════════ */

/* ── Shared: a word in any cloud ─────────────────────────────────── */
.topic-word {
  font-family: var(--font-heading);
  line-height: 1.3;
  text-decoration: none;
  cursor: pointer;
  transition: opacity .15s;
  /* Never break a phrase across lines: in a baseline-aligned wrapping row a
     two-line "Natural Language Processing" collides with its neighbours and
     reads as two separate topics. */
  white-space: nowrap;
}
.topic-word:hover,
.topic-word:focus-visible {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}
.tx-treemap-empty, .tx-cloud-empty { padding: 3rem 1rem; text-align: center; color: var(--c-text-muted); font-size: .88rem; }

/* ── Toolbar: focus-area pills, view switch, search ──────────────── */
.tx-bar {
  /* Docks directly beneath the pinned .main-nav (see style.css), not the
     old full dept-bar+nav header height — the dept-bar scrolls away now. */
  position: sticky; top: var(--nav-h, 0px); z-index: 20;
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--c-border);
}
.tx-bar-row { display: flex; align-items: center; gap: .6rem; padding: .55rem 0; }
.tx-bar-label {
  display: inline-flex; align-items: center; gap: .4rem;
  font-family: var(--font-heading); font-weight: 700; font-size: .78rem;
  color: var(--c-text); white-space: nowrap; padding-right: .4rem;
}
.tx-bar-label i { color: var(--c-primary-dark); }
.tx-pills { flex: 1; min-width: 0; overflow-x: auto; display: flex; gap: .375rem; padding: 2px 0; scrollbar-width: thin; }
.tx-pill {
  display: inline-flex; align-items: center; gap: .4rem; flex: none;
  white-space: nowrap; padding: .375rem .8rem; border: 0;
  border-radius: var(--r-xl); font-size: .78rem; font-weight: 600;
  background: #f1f5f9; color: #475569; cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s;
}
.tx-pill:hover { background: var(--c-primary-light); color: var(--c-primary-dark); }
.tx-pill[aria-pressed="true"] {
  background: linear-gradient(135deg, var(--c-primary-dark) 0%, var(--c-primary-deeper) 100%);
  color: #fff; box-shadow: 0 3px 10px rgba(17,119,51,.35);
}
.tx-pill-n {
  font-size: .69rem; font-weight: 700; border-radius: 10px;
  padding: .1rem .375rem; background: #cbd5e1; color: #1e293b;
}
.tx-pill[aria-pressed="true"] .tx-pill-n { background: rgba(255,255,255,.28); color: #fff; }

.tx-controls { display: flex; align-items: center; gap: .75rem; padding: 1rem 0 .25rem; flex-wrap: wrap; }
.tx-search {
  flex: 1; min-width: 260px; display: flex; align-items: center; gap: .55rem;
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--r-md); padding: .5rem .8rem; box-shadow: var(--shadow-xs);
}
.tx-search i { color: var(--c-text-muted); font-size: .8rem; }
.tx-search input { border: 0; outline: 0; flex: 1; font-family: var(--font-body); font-size: .9rem; color: var(--c-text); background: transparent; }
.tx-search input::placeholder { color: var(--c-text-light); }

.tx-views { display: flex; gap: 2px; background: #eef1ef; border-radius: var(--r-md); padding: 3px; }
.tx-view-btn {
  border: 0; background: transparent; cursor: pointer;
  padding: .4rem .7rem; border-radius: 7px;
  font-size: .78rem; font-weight: 600; color: var(--c-text-muted);
  display: inline-flex; align-items: center; gap: .35rem;
  transition: background .15s, color .15s;
}
.tx-view-btn:hover { color: var(--c-text); }
.tx-view-btn[aria-pressed="true"] { background: var(--c-surface); color: var(--c-primary-dark); box-shadow: var(--shadow-xs); }
.tx-view-btn i { font-size: .74rem; }

.tx-resultline { font-size: .8rem; color: var(--c-text-muted); padding: .5rem 0 0; }
.tx-empty { text-align: center; padding: 4rem 1rem; color: var(--c-text-muted); }
.tx-empty i { font-size: 1.6rem; color: var(--c-primary-muted); display: block; margin-bottom: .6rem; }

/* ── View 1: packed cloud ────────────────────────────────────────── */
.tx-cloud {
  display: flex; flex-wrap: wrap; gap: .5rem 1.25rem;
  align-items: baseline; align-content: center; justify-content: center;
  min-height: 340px; padding: 1.5rem 0;
}
.tx-cloud .topic-word { animation: tx-fade-up .45s both; }
@keyframes tx-fade-up { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .tx-cloud .topic-word, .topic-band-cloud .topic-word { animation: none; }
  .tx-graph-label { animation: none !important; }
}

/* Hover readout under the cloud */
.tx-readout {
  border-top: 1px solid var(--c-border); background: var(--c-bg);
  padding: .8rem 1.25rem; min-height: 62px;
  display: flex; align-items: center; gap: .9rem; flex-wrap: wrap;
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}
.tx-readout-term { font-family: var(--font-heading); font-weight: 700; font-size: .95rem; }
.tx-readout-area {
  font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: .62rem;
  font-weight: 600; letter-spacing: .06em; padding: .18rem .45rem; border-radius: var(--r-sm);
}
.tx-readout-sum { font-size: .82rem; color: var(--c-text-muted); flex: 1; min-width: 200px; }
.tx-readout-n { font-size: .76rem; font-weight: 600; color: var(--c-text); white-space: nowrap; }
.tx-readout-hint { font-size: .82rem; color: var(--c-text-light); }

/* ── View 2: clustered by focus area ─────────────────────────────── */
.tx-clusters { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.1rem; padding: 1.25rem 0; }
.tx-cluster { border: 1px solid var(--c-border); border-radius: var(--r-lg); overflow: hidden; background: var(--c-surface); box-shadow: var(--shadow-xs); }
.tx-cluster-head { padding: .7rem 1rem; display: flex; align-items: baseline; gap: .5rem; border-bottom: 1px solid; }
.tx-cluster-code { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-weight: 700; font-size: .68rem; letter-spacing: .08em; }
.tx-cluster-name { font-family: var(--font-heading); font-weight: 700; font-size: .88rem; color: var(--c-text); flex: 1; }
.tx-cluster-n { font-size: .7rem; font-weight: 600; }
.tx-cluster-body { padding: 1rem; display: flex; flex-wrap: wrap; gap: .35rem .85rem; align-items: baseline; align-content: flex-start; min-height: 132px; }
.tx-cluster-empty { font-size: .78rem; color: var(--c-text-light); }

/* ── View 3: chip grid (the no-JS / no-layout-tricks baseline) ───── */
.tx-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .5rem; padding: 1.25rem 0; }
.tx-chip {
  display: block; text-decoration: none;
  border: 1px solid var(--c-border); border-left: 3px solid var(--c-primary-dark);
  border-radius: var(--r-sm); padding: .55rem .75rem; background: var(--c-surface);
  transition: box-shadow .15s, transform .15s;
}
.tx-chip:hover, .tx-chip:focus-visible { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.tx-chip-top { display: flex; align-items: baseline; gap: .5rem; }
.tx-chip-term { font-size: .84rem; font-weight: 600; color: var(--c-text); flex: 1; }
.tx-chip-n { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: .68rem; font-weight: 600; color: var(--c-text-muted); }
.tx-chip-bar { height: 3px; background: #eef1ef; border-radius: 2px; overflow: hidden; margin-top: .4rem; }
.tx-chip-bar > span { display: block; height: 3px; border-radius: 2px; }
.tx-sortrow { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; padding-top: .5rem; }
.tx-sortrow-label { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: .64rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--c-text-muted); }
.tx-sortrow-note { font-size: .76rem; color: var(--c-text-muted); margin-left: auto; }

/* ── View 4: co-occurrence graph ─────────────────────────────────── */
.tx-graph { position: relative; background: #0e1a14; border-radius: var(--r-lg); overflow: hidden; margin: 1.25rem 0; }
.tx-graph-head { padding: 1.1rem 1.5rem .3rem; display: flex; align-items: baseline; gap: .9rem; flex-wrap: wrap; }
.tx-graph-head h3 { font-family: var(--font-heading); font-weight: 700; font-size: .95rem; color: #fff; margin: 0; }
.tx-graph-head p { font-size: .78rem; color: rgba(255,255,255,.55); margin: 0; }
.tx-graph-stage {
  position: relative; height: 540px; cursor: grab; touch-action: none;
  background: radial-gradient(ellipse at center, rgba(255,255,255,.05) 0%, rgba(255,255,255,0) 62%);
}
.tx-graph-stage:active { cursor: grabbing; }
.tx-graph-stage svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.tx-graph-empty {
  position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.6); font-size: .85rem; pointer-events: none;
}

.tx-graph-zoom { display: flex; gap: .3rem; margin-left: auto; }
.tx-graph-zoom button {
  width: 26px; height: 26px; padding: 0; border-radius: 6px; border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.08); color: rgba(255,255,255,.85); cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: .66rem;
  transition: background .15s;
}
.tx-graph-zoom button:hover { background: rgba(255,255,255,.2); }

/* Each group (not each of the ~650 individual edges/nodes/labels) fades in
   once on render -- animating three elements instead of hundreds is most
   of what made this view slow, along with the gradient-def count fixed in
   edgeGradientId() above. Hover response stays per-element since that's
   the whole point of it. */
.tx-graph-edges, .tx-graph-nodes, .tx-graph-labels { animation: tx-graph-in .4s ease both; }
.tx-edge { transition: opacity .18s ease, stroke-width .18s ease; }
.tx-node { transition: opacity .18s ease, transform .18s ease; transform-box: fill-box; transform-origin: center; }
.tx-graph .tx-dim { opacity: .1; }
.tx-graph .tx-hi.tx-edge { opacity: .95; stroke-width: 1.6px; }
.tx-graph .tx-hi.tx-node { opacity: 1; transform: scale(1.35); filter: drop-shadow(0 0 5px rgba(255,255,255,.85)); }
@keyframes tx-graph-in { from { opacity: 0; } }

/* Real SVG text now (see labelEl() in topic-explorer.js) so labels zoom
   and pan with everything else; paint-order gives it a halo the way an
   HTML label would have used text-shadow for. */
.tx-graph-label { cursor: pointer; }
.tx-graph-label text {
  font-family: var(--font-heading); paint-order: stroke fill;
  stroke: rgba(0,0,0,.85); stroke-width: 3px; stroke-linejoin: round;
}
.tx-graph-label:hover text { text-decoration: underline; }
.tx-graph-label-hub text { letter-spacing: .04em; }
.tx-graph-label-lazy { opacity: 0; pointer-events: none; transition: opacity .15s ease; }
.tx-graph-label-lazy.tx-label-show { opacity: 1; pointer-events: auto; }

/* ── View 5: treemap ────────────────────────────────────────────── */
.tx-treemap { position: relative; margin: 1.25rem 0; border-radius: var(--r-lg); overflow: hidden; }
.tx-tile {
  position: absolute; border: 1.5px solid #fff; border-radius: 4px;
  overflow: hidden; text-decoration: none; transition: filter .15s;
}
.tx-tile:hover { filter: brightness(1.12); }
.tx-tile-label { display: block; font-family: var(--font-heading); font-weight: 700; color: #fff; line-height: 1.2; overflow: hidden; overflow-wrap: anywhere; max-height: 100%; }
.tx-tile-n { display: block; font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 10px; color: #fff; opacity: .7; margin-top: 2px; }

/* ── View 6: alphabetical rail ───────────────────────────────────── */
.tx-alpha { display: flex; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-lg); overflow: hidden; margin: 1.25rem 0; }
.tx-alpha-rail { width: 58px; flex: none; border-right: 1px solid var(--c-border); background: var(--c-bg); padding: 1.1rem 0; display: flex; flex-direction: column; align-items: center; gap: 1px; }
.tx-alpha-rail a, .tx-alpha-rail span {
  width: 26px; height: 20px; display: flex; align-items: center; justify-content: center;
  font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: .72rem; font-weight: 600;
  border-radius: 4px; text-decoration: none;
}
.tx-alpha-rail a { color: var(--c-primary-dark); background: var(--c-primary-light); }
.tx-alpha-rail a:hover { background: var(--c-primary-muted); color: var(--c-primary-deeper); }
.tx-alpha-rail span { color: #c3ccc7; }
.tx-alpha-body { flex: 1; padding: 1.25rem 1.5rem; min-width: 0; }
.tx-alpha-group { display: flex; gap: 1.1rem; padding: .7rem 0; border-bottom: 1px solid #eef1ef; align-items: baseline; scroll-margin-top: calc(var(--header-h, 0px) + 60px); }
.tx-alpha-group:last-child { border-bottom: 0; }
.tx-alpha-letter { width: 26px; flex: none; font-family: var(--font-heading); font-weight: 800; font-size: 1.25rem; color: var(--c-primary-muted); }
.tx-alpha-words { flex: 1; display: flex; flex-wrap: wrap; gap: .35rem .9rem; align-items: baseline; }

/* ── The shared modal ───────────────────────────────────────────── */
.tx-modal-back {
  position: fixed; inset: 0; z-index: 1080;
  background: rgba(10,20,15,.55); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 1.5rem;
  animation: tx-fade-in .18s both;
}
@keyframes tx-fade-in { from { opacity: 0; } to { opacity: 1; } }
.tx-modal {
  width: 780px; max-width: 100%; max-height: 100%; overflow: auto;
  background: var(--c-surface); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
}
.tx-modal-head { padding: 1.4rem 1.75rem 1.25rem; border-bottom: 1px solid; }
.tx-modal-eyebrow { display: flex; align-items: center; gap: .5rem; margin-bottom: .55rem; flex-wrap: wrap; }
.tx-modal-code {
  font-family: 'IBM Plex Mono', ui-monospace, monospace; font-weight: 700; font-size: .62rem;
  letter-spacing: .09em; padding: .22rem .5rem; border-radius: var(--r-sm); color: #fff;
}
.tx-modal-area { font-size: .72rem; font-weight: 600; }
.tx-modal h2 { font-family: var(--font-heading); font-weight: 800; font-size: 1.6rem; letter-spacing: -.01em; margin: 0 0 .5rem; color: var(--c-text); }
.tx-modal-sum { font-size: .92rem; line-height: 1.6; color: var(--c-text); margin: 0; max-width: 64ch; text-wrap: pretty; }
.tx-modal-close {
  position: absolute; top: 1.25rem; right: 1.25rem;
  width: 34px; height: 34px; border-radius: 50%; background: var(--c-surface);
  border: 1px solid var(--c-border); display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--c-text-muted);
}
.tx-modal-close:hover { color: var(--c-text); border-color: var(--c-text-muted); }
.tx-modal-stats { display: flex; gap: .5rem; margin-top: 1.1rem; flex-wrap: wrap; }
.tx-stat { flex: 1; min-width: 110px; background: var(--c-surface); border: 1px solid; border-radius: var(--r-md); padding: .6rem .8rem; }
.tx-stat-n { font-family: var(--font-heading); font-weight: 800; font-size: 1.35rem; line-height: 1; }
.tx-stat-l { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: .6rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--c-text-muted); margin-top: .3rem; }
/* Faculty / Courses / Publications / Projects / Theses — five categories
   whose counts vary wildly per topic (7 faculty, 1 project, 48 courses…).
   Stacking them as five columns left a lopsided page of dead space under
   whichever category was short. A single-panel tab strip instead: only
   one category is ever laid out at a time, sized to its own content, and
   the panel itself scrolls rather than growing the modal without bound.
   Built with plain radio inputs + label[for] + a chained sibling selector
   so tab-switching needs no JavaScript — it degrades to "here's every
   category, pick one" with CSS alone. */
.tx-modal-tabset { display: block; }
.tx-tab-radio { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.tx-modal-tabs {
  display: flex; gap: .15rem; padding: 0 1rem; border-bottom: 1px solid var(--c-border);
  overflow-x: auto; scrollbar-width: none;
}
.tx-modal-tabs::-webkit-scrollbar { display: none; }
.tx-tab {
  display: flex; align-items: center; gap: .4rem; padding: .8rem .75rem; cursor: pointer;
  font-family: var(--font-heading); font-size: .8rem; font-weight: 700; color: var(--c-text-muted);
  white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color .15s, border-color .15s;
}
.tx-tab i { font-size: .72rem; }
.tx-tab:hover { color: var(--c-text); }
.tx-tab-n {
  font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: .66rem; font-weight: 700;
  background: var(--c-bg); border-radius: 999px; padding: .05rem .42rem; color: var(--c-text-muted);
}
.tx-tab-empty { opacity: .4; }
/* Chained by id because CSS can't compare two elements' values to each
   other — five categories is a small, fixed set, so five explicit rules
   beats reaching for JavaScript to do what native radios already do. */
#tx-tab-faculty:checked ~ .tx-modal-tabs label[for="tx-tab-faculty"],
#tx-tab-courses:checked ~ .tx-modal-tabs label[for="tx-tab-courses"],
#tx-tab-publications:checked ~ .tx-modal-tabs label[for="tx-tab-publications"],
#tx-tab-projects:checked ~ .tx-modal-tabs label[for="tx-tab-projects"],
#tx-tab-theses:checked ~ .tx-modal-tabs label[for="tx-tab-theses"] {
  color: var(--tx-accent, var(--c-primary)); border-bottom-color: var(--tx-accent, var(--c-primary));
}
.tx-modal-panels { padding: 1.1rem 1.5rem 1.4rem; max-height: 380px; overflow-y: auto; }
.tx-tab-panel { display: none; }
#tx-tab-faculty:checked ~ .tx-modal-panels #tx-panel-faculty,
#tx-tab-courses:checked ~ .tx-modal-panels #tx-panel-courses,
#tx-tab-publications:checked ~ .tx-modal-panels #tx-panel-publications,
#tx-tab-projects:checked ~ .tx-modal-panels #tx-panel-projects,
#tx-tab-theses:checked ~ .tx-modal-panels #tx-panel-theses {
  display: block;
}
/* Rows lay out as a compact card grid using the panel's full width,
   rather than one narrow vertical list — a topic with one project no
   longer looks emptier than one with five. */
.tx-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .5rem; align-content: start; }
.tx-list-row {
  display: flex; align-items: center; gap: .65rem; padding: .5rem .65rem;
  border: 1px solid var(--c-border); border-radius: var(--r-md);
  background: var(--c-surface); text-decoration: none;
  transition: box-shadow .15s, transform .15s;
}
.tx-list-row:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.tx-list-row-static { cursor: default; }
.tx-list-row-static:hover { box-shadow: none; transform: none; }
.tx-avatar {
  width: 38px; height: 38px; flex: none; border-radius: 50%; object-fit: cover;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-heading); font-weight: 700; font-size: .8rem; border: 1px solid;
}
.tx-code {
  font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: .7rem; font-weight: 600;
  border-radius: var(--r-sm); padding: .3rem .45rem; flex: none;
}
.tx-list-name { display: block; font-size: .84rem; font-weight: 600; color: var(--c-text); line-height: 1.35; }
.tx-list-meta { display: block; font-size: .74rem; color: var(--c-text-muted); line-height: 1.35; }
.tx-list-row > .fa-arrow-right { font-size: .62rem; color: var(--c-primary-muted); }
.tx-none { font-size: .78rem; color: var(--c-text-light); padding: .4rem 0; }
.tx-related { padding: 1rem 1.5rem 1.4rem; border-top: 1px solid var(--c-border); }
.tx-related h3 { font-family: var(--font-heading); font-weight: 700; font-size: .82rem; margin: 0 0 .6rem; color: var(--c-text); }
.tx-related-row { display: flex; flex-wrap: wrap; gap: .35rem; }
.tx-related-pill {
  font-size: .76rem; font-weight: 600; padding: .3rem .7rem;
  border-radius: var(--r-xl); text-decoration: none; border: 1px solid var(--c-border);
  background: var(--c-bg); color: var(--c-text);
}
.tx-related-pill:hover { border-color: var(--c-primary-muted); background: var(--c-primary-light); color: var(--c-primary-dark); }

/* ── Placement: sidebar widget ──────────────────────────────────── */
.topic-widget { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-lg); padding: 1.1rem 1.25rem 1.25rem; box-shadow: var(--shadow-xs); }
.topic-widget-head { display: flex; align-items: center; gap: .5rem; }
.topic-widget-head i { color: var(--c-primary-dark); font-size: .78rem; }
.topic-widget-head h2 { font-family: var(--font-heading); font-weight: 700; font-size: .86rem; margin: 0; color: var(--c-text); }
.topic-widget-sub { font-size: .74rem; color: var(--c-text-muted); margin: .25rem 0 .9rem; }
.topic-widget-cloud { display: flex; flex-wrap: wrap; gap: .35rem .75rem; align-items: baseline; }
.topic-widget-all { display: inline-flex; align-items: center; gap: .4rem; margin-top: 1rem; padding-top: .8rem; border-top: 1px solid var(--c-border); font-size: .78rem; font-weight: 600; width: 100%; }
.topic-widget-all i { font-size: .62rem; }

/* ── Placement: homepage band / research section ─────────────────── */
.topic-band { padding: 2.5rem 0 2.75rem; }
.topic-band-hero { background: linear-gradient(135deg, var(--c-primary-dark) 0%, var(--c-primary-deeper) 100%); }
.topic-band-section { background: var(--c-bg); border-top: 1px solid var(--c-border); border-bottom: 1px solid var(--c-border); }
.topic-band-eyebrow {
  font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: .64rem; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; margin-bottom: .6rem;
}
.topic-band-hero .topic-band-eyebrow { color: rgba(255,255,255,.6); }
.topic-band-section .topic-band-eyebrow { color: var(--c-text-muted); }
.topic-band-title { font-family: var(--font-heading); font-weight: 800; font-size: clamp(1.35rem, 3vw, 1.65rem); letter-spacing: -.01em; margin: 0 0 1.35rem; }
.topic-band-hero .topic-band-title { color: #fff; }
.topic-band-section .topic-band-title { color: var(--c-text); }
.topic-band-cloud { display: flex; flex-wrap: wrap; gap: .5rem 1.1rem; align-items: baseline; }
.topic-band-cloud .topic-word { animation: tx-fade-up .5s both; }
.topic-band-hero .topic-word:hover { color: #fff !important; }
.topic-band-cta {
  display: inline-flex; align-items: center; gap: .5rem; margin-top: 1.6rem;
  font-size: .82rem; font-weight: 600; padding: .55rem 1.1rem; border-radius: var(--r-xl);
  text-decoration: none;
}
.topic-band-hero .topic-band-cta { background: #fff; color: var(--c-primary-dark); }
.topic-band-hero .topic-band-cta:hover { background: var(--c-primary-light); color: var(--c-primary-deeper); }
.topic-band-section .topic-band-cta { background: var(--c-primary-dark); color: #fff; }
.topic-band-section .topic-band-cta:hover { background: var(--c-primary-deeper); color: #fff; }
.topic-band-cta i { font-size: .68rem; }

/* ── Focus-area snapshot gallery (static SVGs from topics_write_area_clouds()) ── */
.topic-gallery { padding: 0 0 2.75rem; background: var(--c-bg); }
.topic-gallery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.1rem; margin-top: 1.35rem; }
.topic-gallery-card {
  display: block; border: 1px solid; border-radius: var(--r-lg); overflow: hidden;
  background: var(--c-surface); text-decoration: none; transition: box-shadow .15s, transform .15s;
}
.topic-gallery-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.topic-gallery-card img { display: block; width: 100%; height: auto; }
.topic-gallery-card-foot { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .8rem 1rem; }
.topic-gallery-card-name { font-family: var(--font-heading); font-weight: 700; font-size: .88rem; }
.topic-gallery-card-n { font-size: .72rem; color: var(--c-text-muted); white-space: nowrap; display: inline-flex; align-items: center; gap: .35rem; }
.topic-gallery-card-n i { font-size: .6rem; }

/* ── Narrow screens ─────────────────────────────────────────────── */
@media (max-width: 767.98px) {
  .tx-tab { padding: .7rem .55rem; font-size: .74rem; }
  .tx-modal-panels { max-height: 46vh; }
  .tx-graph-stage { height: 420px; }
  .tx-alpha-rail { display: none; }
  .tx-cloud { min-height: 260px; }
  .tx-modal-back { padding: 0; align-items: flex-end; }
  .tx-modal { max-height: 92vh; border-radius: var(--r-lg) var(--r-lg) 0 0; }
}
