/* ============================================================
   Gantry web — Person profile (tabbed), #/person/:id
   Layout + motion for surfaces/web/person.jsx. Tokens only.
   ============================================================ */

.cg-p-muted { font-size: 10.5px; color: var(--fg-4); }

/* ---------- Header ---------- */
.cg-p-head { align-items: stretch; }
.cg-p-head-left { gap: 20px; }
.cg-p-avatar { width: 64px; height: 64px; font-size: 20px; flex: none; }
.cg-p-head-id { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.cg-p-h1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cg-p-fav { margin-left: 2px; }
.cg-p-affiliation { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; font-weight: 600; font-size: 14px; }
.cg-p-aff-link {
  background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; font-weight: 600; color: var(--fg);
  border-bottom: 1px solid transparent;
  transition: border-color .15s var(--ease), color .15s var(--ease);
}
.cg-p-aff-link:hover { border-bottom-color: var(--fg); }
.cg-p-aff-role { font-size: 11px; color: var(--fg-3); font-weight: 400; }
.cg-p-meta { flex-wrap: wrap; row-gap: 4px; }
.cg-p-depth { display: inline-flex; align-items: center; gap: 6px; }

.cg-p-score {
  display: flex; flex-direction: column; align-items: flex-end; justify-content: center;
  gap: 2px; text-align: right;
  padding-left: 24px; border-left: 1px solid var(--line);
  animation: cg-p-rise .5s var(--ease) both; animation-delay: 80ms;
}
.cg-p-score-num { font-size: 54px; line-height: 1; }
.cg-p-score-sub { display: inline-flex; align-items: center; gap: 10px; font-size: 12px; color: var(--fg-3); }
@media (max-width: 760px) {
  .cg-p-score { align-items: flex-start; text-align: left; padding-left: 0; border-left: 0; }
}

.cg-p-tabs .cg-tab { display: inline-flex; align-items: center; gap: 6px; }
.cg-p-tab-count { font-size: 10px; color: var(--fg-4); }

/* ---------- Overview ---------- */
.cg-p-statgrid .cg-bigstat { animation: cg-p-rise .46s var(--ease) both; }
.cg-p-statgrid .cg-bigstat:nth-child(2) { animation-delay: 50ms; }
.cg-p-statgrid .cg-bigstat:nth-child(3) { animation-delay: 100ms; }
.cg-p-statgrid .cg-bigstat:nth-child(4) { animation-delay: 150ms; }

.cg-p-strip-card { margin-bottom: 14px; }
.cg-p-strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px 22px;
  margin-top: 10px;
}
.cg-p-strip-item {
  display: flex; flex-direction: column; gap: 6px;
  animation: cg-p-rise .46s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms);
}
.cg-p-strip-label { font-family: var(--font-serif); font-size: 15px; color: var(--fg); }
.cg-p-strip-sub { display: inline-flex; align-items: center; gap: 8px; font-size: 10.5px; color: var(--fg-4); }

.cg-p-row { animation: cg-p-rise .4s var(--ease) both; animation-delay: calc(var(--i, 0) * 30ms); }

/* ---------- Scientific ---------- */
.cg-p-chart { position: relative; margin-top: 10px; }
.cg-p-chart-svg { width: 100%; height: 150px; display: block; overflow: visible; }
.cg-p-chart-grid { stroke: var(--line); stroke-width: .3; }
.cg-p-chart-pub { fill: var(--fg); }
.cg-p-chart-con { fill: var(--brand); }
.cg-p-chart-oth { fill: var(--fg-4); }
/* Bars grow from the baseline in sequence — the chart is "drawn in". */
.cg-p-chart-bar { transform-origin: 50% 46px; transform-box: view-box;
  animation: cg-p-grow .55s var(--ease) both;
  animation-delay: calc(var(--i, 0) * (600ms / var(--n, 30))); }
.cg-p-chart-axis { position: relative; height: 14px; font-size: 9.5px; color: var(--fg-4); }
.cg-p-chart-axis span { position: absolute; transform: translateX(-50%); }
.cg-p-chart-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 10px; color: var(--fg-3); margin-top: 6px; }
.cg-p-chart-legend .cg-p-muted { margin-left: auto; }
.cg-p-sw { display: inline-block; width: 9px; height: 9px; margin-right: 5px; vertical-align: -1px; border-radius: var(--r-xs); }
.cg-p-sw-pub { background: var(--fg); }
.cg-p-sw-con { background: var(--brand); }
.cg-p-sw-oth { background: var(--fg-4); }

.cg-p-topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 8px; }
.cg-p-topic {
  display: flex; flex-direction: column; gap: 6px;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg-1);
  animation: cg-p-rise .46s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms);
  transition: border-color .15s var(--ease);
}
.cg-p-topic:hover { border-color: var(--line-strong); }
.cg-p-topic-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.cg-p-topic-name { font-family: var(--font-serif); font-size: 17px; }
.cg-p-topic-arch { font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-4); }
.cg-p-topic-foot { display: flex; align-items: center; gap: 10px; font-size: 10.5px; color: var(--fg-3); }

.cg-p-evsec { overflow: hidden; }
.cg-p-evsec-head {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; background: none; border: 0; cursor: pointer; text-align: left;
  transition: background .12s var(--ease);
}
.cg-p-evsec-head:hover { background: var(--bg-hover); }
.cg-p-evsec-title { display: inline-flex; align-items: center; gap: 10px; color: var(--fg-3); }
.cg-p-evsec-name { font-family: var(--font-serif); font-size: 18px; color: var(--fg); }
.cg-p-evsec-count { font-size: 18px; color: var(--fg-3); }
.cg-p-evsec-cov { display: inline-flex; align-items: center; gap: 8px; font-size: 10.5px; color: var(--fg-4); }
.cg-p-evsec-body { padding: 0 18px 18px; border-top: 1px solid var(--line); }
.cg-p-evsec-tools { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 0 6px; }
.cg-p-evsec-sorts { border-bottom: 0; gap: 12px; }
.cg-p-evsec-sorts .cg-tab { padding: 6px 2px; font-size: 12px; }
.cg-p-evsec-tools .cg-btn { margin-left: auto; gap: 6px; }
.cg-p-evsec-ph { height: 120px; margin-top: 8px; }
.cg-p-evlist { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; }
.cg-p-evrow {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto auto; gap: 12px; align-items: center;
  padding: 9px 0; border-top: 1px solid var(--line);
  animation: cg-p-rise .36s var(--ease) both; animation-delay: calc(var(--i, 0) * 22ms);
}
.cg-p-evrow:first-child { border-top: 0; }
.cg-p-evrow-year { font-size: 11px; color: var(--fg-3); }
.cg-p-evrow-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cg-p-evrow-title { font-size: 13px; line-height: 1.35; }
.cg-p-evrow-meta { font-size: 10.5px; color: var(--fg-4); }
.cg-p-evsec-more { margin-top: 10px; }

/* ---------- Activity ---------- */
.cg-p-fresh { list-style: none; margin: 8px 0 0; padding: 0 0 0 6px; position: relative; }
.cg-p-fresh::before { content: ""; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 1px; background: var(--line); }
.cg-p-fresh-row {
  position: relative; display: grid; grid-template-columns: 14px 78px minmax(0, 1fr) auto; gap: 12px; align-items: baseline;
  padding: 8px 0;
  animation: cg-p-rise .4s var(--ease) both; animation-delay: calc(var(--i, 0) * 40ms);
}
.cg-p-fresh-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--bg-2); border: 1px solid var(--line-strong); align-self: center; }
.cg-p-fresh-when { font-size: 11px; color: var(--fg-3); white-space: nowrap; }
.cg-p-fresh-main { display: flex; flex-direction: column; gap: 1px; }
.cg-p-fresh-label { font-weight: 500; font-size: 13px; }
.cg-p-fresh-text { font-size: 12px; color: var(--fg-3); }
.cg-p-years td, .cg-p-years th { text-align: right; }
.cg-p-years td:first-child, .cg-p-years th:first-child { text-align: left; }

/* ---------- Collaborators ---------- */
.cg-p-network-slot:empty { display: none; }
.cg-p-network-slot { margin-bottom: 14px; }
.cg-p-collab-head { align-items: center; flex-wrap: wrap; gap: 10px; }
.cg-p-collab-tools { display: inline-flex; align-items: center; gap: 10px; }
.cg-p-strength-steps { display: inline-flex; gap: 4px; }
.cg-p-strength-steps .cg-btn { padding: 4px 9px; font-size: 11.5px; }
.cg-p-collab-list { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; }
.cg-p-collab-row {
  display: grid; grid-template-columns: 36px minmax(0, 1fr) auto auto; gap: 14px; align-items: center;
  padding: 10px 6px; border-top: 1px solid var(--line); cursor: pointer; border-radius: var(--r-sm);
  transition: background .12s var(--ease);
  animation: cg-p-rise .4s var(--ease) both; animation-delay: calc(var(--i, 0) * 28ms);
}
.cg-p-collab-row:first-child { border-top: 0; }
.cg-p-collab-row:hover { background: var(--bg-hover); }
.cg-p-collab-row:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.cg-p-collab-avatar { width: 36px; height: 36px; font-size: 12px; }
.cg-p-collab-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cg-p-collab-name { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 500; font-size: 14px; }
.cg-p-collab-name .cg-pill { font-size: 9.5px; }
.cg-p-collab-sub { font-size: 10.5px; color: var(--fg-4); }
.cg-p-collab-strength { display: inline-flex; align-items: center; gap: 10px; }
.cg-p-collab-row .cg-btn { gap: 6px; }

.cg-p-modal { width: min(760px, 100%); }
.cg-p-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; width: 100%; }
.cg-p-modal-title { font-family: var(--font-serif); font-size: 20px; margin-top: 4px; }
.cg-p-modal-body { display: flex; flex-direction: column; gap: 18px; }
.cg-p-modal-group-head { display: flex; align-items: baseline; gap: 8px; font-size: 13px; color: var(--fg-2); margin-bottom: 4px; }
.cg-p-modal-group-n { font-size: 22px; }
.cg-p-modal-thin { padding: 18px; border: 1px dashed var(--line-2); border-radius: var(--r-md); font-size: 13px; color: var(--fg-3); line-height: 1.5; }
.cg-p-modal-thin-title { font-family: var(--font-serif); font-size: 18px; color: var(--fg); margin-bottom: 4px; }
.cg-p-modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cg-p-modal-foot .mono { display: inline-flex; align-items: center; gap: 8px; }
.cg-p-modal-actions { display: inline-flex; gap: 8px; }
.cg-p-modal-actions .cg-btn { gap: 6px; }

/* ---------- Motion ---------- */
@keyframes cg-p-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes cg-p-grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@media (prefers-reduced-motion: reduce) {
  .cg-p-score, .cg-p-statgrid .cg-bigstat, .cg-p-strip-item, .cg-p-row, .cg-p-chart-bar,
  .cg-p-topic, .cg-p-evrow, .cg-p-fresh-row, .cg-p-collab-row { animation: none !important; }
  .cg-p-aff-link, .cg-p-topic, .cg-p-evsec-head { transition: none; }
}

/* A congress evidence row is a LINK to that meeting (PROD-39); every other
   kind names a document, which has no page of its own here. Styled as the
   title it replaces so the two kinds of row still line up. */
.cg-p-evrow-link {
  display: inline-flex; align-items: center; gap: 5px;
  background: none; border: 0; padding: 0; margin: 0;
  font: inherit; color: inherit; text-align: left; cursor: pointer;
  border-bottom: 1px solid transparent;
  transition: border-color .15s var(--ease), color .15s var(--ease);
}
.cg-p-evrow-link:hover { color: var(--brand-text); border-bottom-color: currentColor; }
.cg-p-evrow-link:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .cg-p-evrow-link { transition: none; } }

/* Inline actions under the name (2026-09): the add-to-list picker. */
.cg-p-head-actions { margin-top: 10px; display: flex; gap: 8px; }
