/* ============================================================
   Gantry web — Discipline                            #/discipline/:id
   Layout for surfaces/web/discipline.jsx. Tokens only.
   ------------------------------------------------------------
   Deliberately small. The page is the Trends page's shape scoped to one
   discipline, so its sections, cards and rows wear the .cg-tr-* rules
   already in trends.css — those are reused, never re-declared here. What
   lives in this file is only what is genuinely this page's own: the
   breadcrumb line, the header split, and the year panels beneath it.
   ============================================================ */

.cg-dc-page { display: flex; flex-direction: column; gap: 16px; }
.cg-dc-wait { font-family: var(--font-serif); font-size: 14px; color: var(--fg-3); }
.cg-dc-lede { margin: 8px 0 0; font-size: 13.5px; line-height: 1.55; color: var(--fg-2); }
.cg-dc-crumb-here { color: var(--fg-2); }

/* The reading on the left, the figures on the right — the same split the
   Trends page opens with, so the two screens start the same way. */
.cg-dc-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 28px 40px; flex-wrap: wrap;
}
.cg-dc-head-main { flex: 1 1 420px; min-width: 0; }
.cg-dc-head-side {
  flex: 0 1 auto; min-width: 0;
  display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
}
.cg-dc-h1 {
  margin: 6px 0 0;
  font-family: var(--font-serif); font-weight: 400;
  font-size: 38px; line-height: 1.05; letter-spacing: -0.015em; color: var(--fg);
}
.cg-dc-summary {
  margin: 10px 0 0; max-width: 64ch;
  font-family: var(--font-serif); font-size: 15px; line-height: 1.55; color: var(--fg-2);
}
.cg-dc-summary-empty { color: var(--fg-4); }
.cg-dc-head-main .cg-tr-research { margin-top: 10px; }
.cg-dc-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.cg-dc-asof { font-size: 10.5px; color: var(--fg-4); text-align: right; line-height: 1.6; }
/* Wide enough that six-figure counts never wrap mid-number. */
.cg-dc-counts { gap: 22px; min-width: min(100%, 380px); }

@media (max-width: 860px) {
  .cg-dc-head-side { align-items: flex-start; width: 100%; }
  .cg-dc-asof { text-align: left; }
  .cg-dc-counts { min-width: 0; width: 100%; }
}

/* What the discipline CONTAINS — the canon's tier-2 slugs as <Pill> chips.
   A row that wraps, never a scroller: there are at most a handful and a
   reader should see all of them at once. */
.cg-dc-tier2 {
  display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0;
}

/* One panel per signal, each on its own scale — never one chart with
   several series. See the note in discipline.jsx for why. */
.cg-dc-series {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px;
}
.cg-dc-series-card { min-width: 0; }
.cg-dc-series-lede {
  color: var(--fg-3); font-size: 12.5px; line-height: 1.6;
  max-width: 62ch; margin: 0 0 14px;
}
/* The basis under each chart: what was counted, in the panel's own quiet
   voice. Tucked below the bars because a reader wants the shape first. */
.cg-dc-series-basis {
  margin: 10px 0 0; color: var(--fg-4); font-size: 10.5px; line-height: 1.5;
}

.cg-dc-coverage { display: flex; justify-content: flex-end; }

/* ============================================================
   Health concerns (condition burden heatmap) — the page's own choropleth,
   built from the shared <ChoroplethMap>/<RampLegend> (design-system) and
   GeoShapes' pre-projected Albers layer. See discipline.jsx for the gate
   and data flow; this file is layout only.
   ============================================================ */
.cg-dc-heat-controls {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 14px 0 16px;
}
.cg-dc-heat-select { min-width: 260px; }
.cg-dc-heat-opt { display: flex; flex-direction: column; line-height: 1.3; }
.cg-dc-heat-opt-name { font-size: 13px; color: var(--fg); }
.cg-dc-heat-opt-cat { font-size: 10.5px; color: var(--fg-4); }
.cg-dc-heat-error { color: var(--fg-3); font-size: 13px; margin: 10px 0; }

.cg-dc-heat-body {
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(240px, 1fr);
  gap: 20px; align-items: start;
}
.cg-dc-heat-map { position: relative; min-width: 0; }
.cg-dc-heat-skeleton {
  width: 100%; aspect-ratio: 975 / 610; border-radius: var(--r-lg);
}
.cg-dc-heat-legend { margin-top: 10px; }

/* Positioned by the pointer's own coordinates within the map wrapper
   (discipline.jsx's onMouseMove); the small offset keeps it from sitting
   directly under the cursor. */
.cg-dc-heat-tip {
  position: absolute; z-index: 2; pointer-events: none;
  transform: translate(12px, -100%);
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--r-md); box-shadow: 0 4px 16px rgba(0, 0, 0, .28);
  padding: 6px 9px; max-width: 220px;
}
.cg-dc-heat-tip-name { font-size: 12px; color: var(--fg); font-weight: 500; }
.cg-dc-heat-tip-meta { font-size: 10.5px; color: var(--fg-3); margin-top: 2px; }

.cg-dc-heat-list { min-width: 0; }
.cg-dc-heat-top { margin: 8px 0 0; padding: 0; list-style: none; }
.cg-dc-heat-top-row {
  display: flex; align-items: baseline; gap: 8px;
  padding: 6px 0; border-bottom: 1px solid var(--line);
}
.cg-dc-heat-top-row:last-child { border-bottom: none; }
.cg-dc-heat-top-rank { color: var(--fg-4); font-size: 11px; width: 1.4em; flex: none; }
.cg-dc-heat-top-name { flex: 1 1 auto; min-width: 0; font-size: 13px; color: var(--fg-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cg-dc-heat-top-burden { font-size: 13px; color: var(--fg); flex: none; }
/* Neutral on purpose — a rising health concern is not a business metric, and
   the good/bad palette EntityRow's metricDir uses would say so by accident. */
.cg-dc-heat-top-trend {
  font-size: 10.5px; color: var(--fg-4); text-transform: lowercase; flex: none;
}
.cg-dc-heat-top-est { flex: none; font-size: 9.5px; padding: 1px 6px; }
.cg-dc-heat-top-empty { color: var(--fg-4); font-size: 12.5px; margin: 8px 0 0; }

.cg-dc-heat-summary {
  margin: 14px 0 0; max-width: 70ch; font-size: 13px; line-height: 1.55;
  color: var(--fg-2);
}
.cg-dc-heat-basis, .cg-dc-heat-complete {
  margin: 8px 0 0; color: var(--fg-4); font-size: 10.5px; line-height: 1.5;
}

@media (max-width: 760px) {
  .cg-dc-heat-body { grid-template-columns: 1fr; }
  .cg-dc-heat-select { min-width: 0; width: 100%; }
}

/* ============================================================
   The disciplines INDEX (#/disciplines, disciplines.jsx)
   ------------------------------------------------------------
   A grid of every discipline. Shares this stylesheet with the discipline
   page because the two are one screen's worth of furniture — the same
   head, the same crumb, the same waiting card — and a second file would
   only make them drift.
   ============================================================ */
.cg-dx-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px; margin-top: 18px;
}

/* The whole card is the control, so it is a real <button> — keyboard order
   and focus ring come free. Reset the agent styles, keep the hairline. */
.cg-dx-card {
  display: flex; flex-direction: column; gap: 10px; align-items: stretch;
  width: 100%; text-align: left; cursor: pointer;
  padding: 14px; font: inherit; color: var(--fg);
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--r-lg);
  transition: border-color 120ms ease, background 120ms ease;
}
.cg-dx-card:hover { border-color: var(--line-strong); background: var(--bg-hover); }
.cg-dx-card:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.cg-dx-card-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
}
.cg-dx-name { font-family: var(--font-serif); font-size: 17px; line-height: 1.25; }
/* A mark, not a badge: quiet enough to scan past, present enough to find. */
.cg-dx-mark {
  font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--fg-4); white-space: nowrap;
}

.cg-dx-tier2 { display: flex; flex-wrap: wrap; gap: 5px; }
.cg-dx-more { font-size: 10px; color: var(--fg-4); align-self: center; }

.cg-dx-counts { display: flex; gap: 16px; margin-top: auto; padding-top: 4px; }
.cg-dx-count { display: flex; flex-direction: column; gap: 2px; }
.cg-dx-count-n { font-size: 15px; font-variant-numeric: tabular-nums; }
.cg-dx-count-l {
  font-size: 9.5px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--fg-4);
}
/* ⚠ Unmeasured is not zero, and the card must not let a reader mistake
   the em-dashes above for "none". */
.cg-dx-unmeasured { font-size: 10px; color: var(--fg-4); }

/* The stamp now sits under the legend, on the map (G4's one date). */
.cg-dc-heat-map .cg-dc-heat-complete { margin: 6px 0 0; }
