/* Follow a figure back to its file: the panel used on the home page and the sample package page.
   Loaded by both, with assets/trace.js. Colours and the easing curve come from site.css. */
/* pick a figure on the left; its index row and the file
   itself appear on the right, joined by a line. The line and the row mark are the page's one authored
   motion; everything is readable with them switched off. */
.trace{position:relative;display:grid;grid-template-columns:minmax(0,250px) minmax(0,1fr);gap:40px;align-items:start}
.trace-figs{display:grid;gap:8px}
.trace-fig{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:2px 10px;min-height:44px;padding:11px 14px;border:1px solid var(--line-strong);border-radius:12px;background:#fff;font:inherit;color:inherit;text-align:left;cursor:pointer;transition:border-color .15s ease-out,background-color .15s ease-out}
.trace-fig:hover{border-color:var(--navy)}
.trace-fig[aria-pressed="true"]{border-color:var(--navy);background:var(--navy-t)}
.trace-l{font:600 14px/1.35 var(--sans)}
.trace-v{font:700 14px/1.35 var(--sans);text-align:right}
.trace-s{grid-column:1/-1;font-size:12.5px;color:var(--muted)}
.trace-line{position:absolute;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none}
.trace-line path{fill:none;stroke:var(--navy);stroke-width:2;stroke-linecap:round;stroke-dasharray:1}
.trace-line.s-none path{stroke:var(--line-strong);stroke-dasharray:.05 .06}
/* the reserve is the tallest of the four answers, so the page below never moves as they change */
.trace-out{display:grid;gap:12px;align-content:start;min-height:400px;container-type:inline-size}
.trace-card{min-width:0;padding:14px 16px;border:1px solid var(--line);border-radius:12px;background:#fff;font-size:14px;line-height:1.45}
.trace-card.none{border-style:dashed;border-color:var(--line-strong);background:transparent}
.trace-h{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-bottom:10px;font:600 12px/1.3 var(--sans);letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
.trace-h.path{font:600 13px/1.3 var(--sans);letter-spacing:0;text-transform:none;color:var(--ink);overflow-wrap:anywhere}
.trace-tag{padding:3px 9px;border-radius:999px;font:600 12px/1.3 var(--sans);letter-spacing:0;text-transform:none;white-space:nowrap}
.trace-tag.t-row{color:var(--ok);background:var(--ok-t)}
.trace-tag.t-file{color:var(--warn);background:var(--warn-t)}
.trace-tag.t-none{color:var(--nav);background:var(--sunken);box-shadow:inset 0 0 0 1px var(--line-strong)}
.trace-idx{margin:0;display:grid;gap:5px}
.trace-idx>div{display:grid;grid-template-columns:88px minmax(0,1fr);gap:10px}
.trace-idx dt{font:600 12.5px/1.6 var(--sans);color:var(--muted)}
.trace-idx dd{margin:0;overflow-wrap:anywhere}
.trace-idx dd.none{color:var(--muted)}
.sheet-wrap{overflow-x:auto}
.sheet{width:100%;border-collapse:collapse;font-size:13px}
.sheet th,.sheet td{padding:5px 8px;border:1px solid var(--line);text-align:left;white-space:nowrap}
.sheet th{background:var(--sunken);font:600 11.5px/1.5 var(--sans);color:var(--muted);text-align:center}
.sheet .hd td{font-weight:600}
.sheet .hit td{background-color:var(--navy-t)}
.sheet td.at{box-shadow:inset 0 0 0 2px var(--navy);font-weight:700}
.sheet td.blank{font-weight:500;color:var(--muted)}
.trace-note{margin-top:10px;font-size:13.5px;color:var(--nav)}
@keyframes trace-draw{from{stroke-dashoffset:1}}
@keyframes trace-in{from{opacity:0;transform:translateX(-8px)}}
@keyframes trace-mark{from{background-color:transparent}}
@keyframes trace-at{from{box-shadow:inset 0 0 0 2px transparent}}
@media (prefers-reduced-motion:no-preference){
  .trace.go .trace-line:not(.s-none) path{animation:trace-draw .45s var(--ease) both}
  .trace.go .trace-card{animation:trace-in .32s var(--ease) .18s both}
  .trace.go .trace-card + .trace-card{animation-delay:.34s}
  .trace.go .sheet .hit td{animation:trace-mark .28s ease-out both;animation-delay:calc(.58s + var(--c,0)*50ms)}
  .trace.go .sheet td.at{animation:trace-mark .28s ease-out both,trace-at .3s ease-out .9s both;animation-delay:calc(.58s + var(--c,0)*50ms),.9s}
}
@media (max-width:640px){
  .trace{grid-template-columns:minmax(0,1fr);gap:16px}
  .trace-line{display:none}
  .trace-figs{grid-template-columns:repeat(2,minmax(0,1fr))}
  .trace-out{min-height:480px}
  .trace-idx>div{grid-template-columns:minmax(0,1fr);gap:0}
}
/* when the panel is narrow, the spreadsheet keeps the unit, the type and the cell the index points to,
   so that cell is always in view without scrolling sideways */
@container (max-width:400px){
  .sheet.grid th:nth-child(3),.sheet.grid td:nth-child(3),.sheet.grid th:nth-child(4),.sheet.grid td:nth-child(4){display:none}
}
