/* Interactive figures for the TRACER post. Everything is scoped under .tfig. */
.tfig {
  --ink: #1f2933;
  --muted: #5f6b7a;
  --faint: #8a94a3;
  --line: #e4e7eb;
  --panel: #f6f7f9;
  --accent: #006cb5;
  font-family: "Source Sans 3", "Source Sans Pro", Helvetica, Arial, sans-serif;
  color: var(--ink);
  margin: 2rem 0;
  font-size: 15px;
  line-height: 1.45;
}
.tfig *, .tfig *::before, .tfig *::after { box-sizing: border-box; }
/* The theme pads every post image; inside these figures that would misalign overlays and video posters. */
.post-content .tfig img, .post-content .tfig video { padding: 0; margin: 0; max-width: none; border: 0; }
.tfig button { font: inherit; cursor: pointer; }
.tfig .tfig-note { font-size: 14px; color: var(--muted); margin: 10px 0 0; line-height: 1.5; }
.tfig .tfig-note b { color: var(--ink); font-weight: 700; }
.tfig .tfig-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 12px; }
.tfig .tfig-chip {
  border: 1px solid #cfd5dc; background: #fff; color: var(--ink); border-radius: 999px;
  padding: 3px 14px; font-size: 14px; line-height: 1.4; transition: background .15s, border-color .15s, color .15s;
}
.tfig .tfig-chip:hover { border-color: var(--faint); }
.tfig .tfig-chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.tfig .tfig-tip {
  position: absolute; pointer-events: none; z-index: 5; background: var(--ink); color: #fff; font-size: 13px;
  line-height: 1.4; padding: 6px 9px; border-radius: 6px; opacity: 0; transition: opacity .1s;
  /* Size to the content, not to the space left before the chart's edge (which wrapped short lines). */
  width: max-content; max-width: 300px;
}
.tfig .tfig-tip.on { opacity: 1; }
.tfig .tfig-tip b { font-weight: 600; }
.tfig .tfig-tip .dim { color: #c3cad3; }

/* auto-advance bar */
.tfig .tfig-cycle { position: relative; display: inline-block; flex: 1 1 60px; min-width: 40px; max-width: 160px; height: 4px; border-radius: 2px; background: #e6e9ed; overflow: hidden; margin-left: 6px; }
.tfig .tfig-cycle-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--faint); border-radius: 2px; }
.tfig .tfig-cycle.paused .tfig-cycle-fill { background: #c1c8d0; }

/* Viewer */
.tv { position: relative; border: 1px solid var(--line); border-radius: 10px; padding: 14px; background: #fff; }
.tv-timeline { position: relative; user-select: none; touch-action: pan-y; }
.tv-timeline svg { display: block; width: 100%; height: auto; overflow: visible; }
.tv-timeline:focus { outline: none; }
.tv-timeline:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.tv-body { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 14px; margin-top: 12px; align-items: stretch; }
.tv-video { position: relative; border-radius: 8px; overflow: hidden; background: #111; aspect-ratio: 16 / 9; }
.tv-video video, .tv-video img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.tv-badge {
  position: absolute; top: 8px; font-size: 12px; font-weight: 600; color: #fff; background: rgba(20, 24, 30, .78);
  padding: 2px 8px; border-radius: 5px; letter-spacing: .01em;
}
.tv-badge.left { left: 8px; }
.tv-badge.right { right: 8px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.tv-nav { display: flex; align-items: center; gap: 8px; margin: 8px 0 6px; font-size: 13px; color: var(--muted); }
.tv-nav button, .tv-arrow { border: 1px solid #cfd5dc; background: #fff; border-radius: 6px; padding: 0 9px; color: var(--ink); font-size: 13px; line-height: 22px; }
.tv-nav button:hover, .tv-arrow:hover { border-color: var(--faint); }
.tv-tags { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; min-height: 26px; }
.tv-tags .lbl { font-size: 13px; color: var(--muted); margin-right: 2px; }
.tv-tag { font-size: 13px; padding: 1px 9px; border-radius: 999px; border: 1px solid; background: #fff; white-space: nowrap; }
.tv-tag::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: currentColor; margin-right: 6px; vertical-align: 1px; }
.tv-none { font-size: 13px; color: var(--faint); font-style: italic; }
.tv-caption { margin-top: 8px; font-size: 14px; background: var(--panel); border-left: 3px solid #8360b3; padding: 7px 10px; border-radius: 0; }
.tv-caption b { font-weight: 600; }
.tv-chat { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.tv-chat-head { display: flex; justify-content: space-between; align-items: center; padding: 5px 12px; border-bottom: 1px solid var(--line); gap: 8px; }
.tv-chat-head b { font-weight: 600; font-size: 15px; }
.tv-chat-head span { font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 5px; padding: 1px 7px; white-space: nowrap; }
.tv-qa { padding: 8px 12px 10px; display: flex; flex-direction: column; gap: 6px; }
.tv-stack { display: grid; }
.tv-slide { grid-area: 1 / 1; visibility: hidden; opacity: 0; transition: opacity .35s; align-self: start; }
.tv-turn { display: flex; flex-direction: column; gap: 6px; }
.tv-slide.on { visibility: visible; opacity: 1; }
.tv-user { align-self: flex-end; max-width: 94%; background: #2f6db5; color: #fff; border-radius: 10px 10px 2px 10px; padding: 5px 10px; font-size: 13.5px; line-height: 1.3; }
.tv-qnav { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.tv-qcount { min-width: 34px; text-align: center; font-variant-numeric: tabular-nums; }
.tv-tools { font-size: 12px; line-height: 1.3; color: var(--ink); background: var(--panel); border-radius: 6px; padding: 5px 9px; }
.tv-tools .sum { color: var(--muted); font-style: italic; margin-bottom: 1px; }
.post-content .tfig .tv-tools ol { list-style: none; margin: 0; padding: 0; line-height: 1.3; }
.post-content .tfig .tv-tools li { margin: 0; padding: 0; line-height: 1.3; font-size: 12px; }
.tv-tools .tv-check { display: inline-block; width: 15px; }
.tv-answer { background: var(--panel); border-radius: 8px; padding: 7px 10px; font-size: 13.5px; line-height: 1.4; }
.tv-answer p { margin: 0 0 6px; }
.tv-answer p:last-child { margin: 0; }
.tv-ts {
  border: 0; background: none; padding: 0; color: var(--accent); font-weight: 600; text-decoration: underline;
  text-underline-offset: 2px; font-size: inherit;
}
.tv-ts:hover { color: #004f85; }
@media (max-width: 680px) {
  .tv { padding: 10px; }
  .tv-body { grid-template-columns: minmax(0, 1fr); }
}

/* Bar chart (results) */
.tc { position: relative; }
.tc .tc-tabs { display: inline-flex; flex-direction: column; align-items: stretch; gap: 5px; margin: 0 0 12px; }
.tc .tc-tabs .tfig-chips { margin: 0; flex-wrap: nowrap; }
.tc .tc-tabs .tfig-cycle { display: block; flex: none; width: 100%; max-width: none; margin: 0; }
.tc svg { display: block; width: 100%; height: auto; overflow: visible; }
.tc .tc-sub { font-size: 18px; line-height: 1.4; color: var(--ink); margin: 0 0 8px; }
.tc .tc-sub b { font-weight: 700; }
.tc-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--muted); margin-top: 6px; }
.tc-legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; background: var(--c); }
.tc-legend span.line::before { height: 0; border-top: 2px dashed var(--c); width: 14px; border-radius: 0; vertical-align: 3px; background: none; }

/* Taxonomy illustration + radar */
.tr-row { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); column-gap: 22px; row-gap: 12px; align-items: center; }
.tr-tax { position: relative; }
.tr-tax img { display: block; width: 100%; height: auto; }
.tr-overlay { position: absolute; inset: 0; width: 100%; height: 100%; }
.tr-wash { transition: opacity .18s; pointer-events: none; }
.tr-hit { cursor: pointer; }
.tr-radar { position: relative; }
.tr-legend { display: flex; flex-wrap: wrap; gap: 2px 10px; justify-content: center; margin-bottom: 2px; }
.tr-model { border: 0; background: none; padding: 2px 4px; border-radius: 5px; font-size: 13.5px; color: var(--ink); display: inline-flex; align-items: center; gap: 6px; transition: opacity .15s, background .15s; }
.tr-model:hover, .tr-model[aria-pressed="true"] { background: #eef1f4; }
.tr-model.dim { opacity: .4; }
.tr-plot { position: relative; }
.tr-plot svg { display: block; width: 100%; height: auto; overflow: visible; }
.tr-axis { cursor: pointer; transition: fill .15s; }
.tr-poly { transition: stroke .15s, opacity .15s, fill .15s; pointer-events: none; }
@media (max-width: 760px) {
  .tr-row { grid-template-columns: minmax(0, 1fr); }
  .tr-tax { max-width: 480px; justify-self: center; width: 100%; }
}

/* The post layout is a grid, so a long unwrapped line (the BibTeX block) would otherwise widen
   the whole page on phones. Let the article shrink and the code block scroll instead. */
.post-layout > article { min-width: 0; max-width: 100%; }
.post-content pre { overflow-x: auto; }
