/* /demos/pprof-lab — page chrome.
 *
 * The flame graph's colors carry information rather than decoration: the
 * application's own frames are the ones a reader is hunting for, so they are the
 * only saturated color on the chart and the runtime and standard library
 * recede. A rainbow palette here would make the runtime frames — which are the
 * bulk of every tree and the least interesting part of it — the loudest thing on
 * screen. */

.ppl__lede { max-width: 68ch; }

.ppl__recorded,
.ppl__env,
.ppl__reading {
  margin: 1.75rem 0;
  padding: 1rem 1.15rem;
  border-left: 3px solid var(--pf-accent, #2f6f4f);
  background: var(--pf-surface, rgba(127, 127, 127, 0.06));
}

.ppl__recorded p,
.ppl__reading p { max-width: 74ch; }

.ppl__envlist {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.3rem 1rem;
  margin: 0.75rem 0;
}
.ppl__envlist dt { font-weight: 600; }
.ppl__envlist dd { margin: 0; font-variant-numeric: tabular-nums; }

.ppl__ceiling { max-width: 74ch; margin-bottom: 0; }

.ppl__pickers {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1rem 0;
}
.ppl__picker { flex: 1 1 18rem; min-width: 0; }
.ppl__picker label { display: block; font-weight: 600; margin-bottom: 0.25rem; }
.ppl__select { width: 100%; max-width: 100%; padding: 0.4rem; }

.ppl__status { font-style: italic; margin: 0.5rem 0 1rem; }

/* Two panels side by side on a wide screen, stacked below it. The breakpoint is
 * where a single flame graph stops being readable at half width. */
.ppl__panels {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
@media (min-width: 62rem) {
  .ppl__panels { grid-template-columns: 1fr 1fr; }
}

.ppl__panel { min-width: 0; }
.ppl__panel-title { margin: 0 0 0.35rem; font-size: 1.05rem; }
.ppl__why { font-size: 0.92rem; margin: 0 0 0.5rem; }
.ppl__prov {
  font-size: 0.85rem;
  margin: 0 0 0.75rem;
  opacity: 0.85;
  font-variant-numeric: tabular-nums;
}

.ppl__figure { margin: 0 0 1.25rem; }

/* The caption names which profile the figure is. It is not decoration and it is
 * not optional: the block totals here are tens of seconds and the CPU totals are
 * tenths of one, in the same unit, meaning different things. */
.ppl__cap {
  font-size: 0.88rem;
  margin-bottom: 0.35rem;
  padding-left: 0.5rem;
  border-left: 2px solid var(--pf-accent, #2f6f4f);
}

.ppl__flame {
  width: 100%;
  overflow-x: auto;
  border: 1px solid rgba(127, 127, 127, 0.35);
  border-radius: 3px;
}
.ppl__svg { display: block; }

.ppl__axis {
  font-size: 0.82rem;
  margin: 0.3rem 0 0;
  opacity: 0.85;
  font-variant-numeric: tabular-nums;
}

.ppl__empty {
  margin: 0;
  padding: 0.9rem;
  font-size: 0.88rem;
  font-style: italic;
}

/* Flame bars. Application frames are the signal; everything else is context. */
.ppl-f { stroke: rgba(255, 255, 255, 0.35); stroke-width: 0.5; }
.ppl-f--app { fill: #c2542f; }
.ppl-f--runtime { fill: #9aa3ad; }
.ppl-f--std { fill: #6f8ba3; }

.ppl-flabel {
  font-size: 10px;
  fill: #10161c;
  pointer-events: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.ppl__diff { margin: 2rem 0; }
.ppl__diff-note { font-size: 0.9rem; max-width: 74ch; }

.ppl__difftable {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
  display: block;
  overflow-x: auto;
}
.ppl__difftable th,
.ppl__difftable td {
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid rgba(127, 127, 127, 0.3);
  text-align: right;
  white-space: nowrap;
}
.ppl__difftable th:first-child,
.ppl__difftable td:first-child { text-align: left; }
.ppl__frame {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8rem;
}
.ppl-grew td:last-child { color: #b3452a; font-weight: 600; }
.ppl-shrank td:last-child { color: #2f6f4f; font-weight: 600; }

.ppl__deltas {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.3rem 1rem;
  margin-top: 1rem;
}
.ppl__deltas dt { font-weight: 600; }
.ppl__deltas dd { margin: 0; font-variant-numeric: tabular-nums; }

@media (prefers-color-scheme: dark) {
  .ppl-flabel { fill: #0b0f13; }
  .ppl-grew td:last-child { color: #e4805f; }
  .ppl-shrank td:last-child { color: #6fbf93; }
}
