#perf-panel {
  overflow: hidden;
}

#perf-panel[hidden] { display: none; }

.pf-live { margin-left: auto; }

.pf-close {
  flex: none;
  color: var(--fm-ink-3);
}

.pf-close:hover { color: var(--fm-danger); }

.pf-body {
  display: flex;
  flex-direction: column;
  gap: var(--fm-sp-2);
  min-height: 0;
  padding: var(--fm-sp-3);
  overflow: hidden auto;
}

.pf-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--fm-sp-2);
}

.pf-kpi {
  display: flex;
  flex-direction: column;
  gap: var(--fm-sp-0);
  min-width: 0;
  padding: var(--fm-sp-2);
  border: 1px solid var(--fm-line-1);
  border-radius: var(--fm-r-1);
  background: var(--fm-surface-2);
}

.pf-kpi__label {
  font-size: var(--fm-fs-100);
  letter-spacing: var(--fm-tr-1);
  text-transform: uppercase;
  color: var(--fm-ink-3);
}

.pf-kpi__value {
  font-family: var(--fm-font-mono);
  font-size: var(--fm-fs-600);
  line-height: var(--fm-lh-1);
  color: var(--fm-ink-1);
  font-variant-numeric: tabular-nums;
}

.pf-kpi__sub {
  font-size: var(--fm-fs-100);
  line-height: var(--fm-lh-1);
  color: var(--fm-ink-3);
}

.pf-verdict {
  margin: 0;
  padding: var(--fm-sp-2) var(--fm-sp-3);
  border-left: 2px solid var(--fm-accent-line);
  border-radius: var(--fm-r-1);
  background: var(--fm-accent-soft);
  font-size: var(--fm-fs-200);
  line-height: var(--fm-lh-2);
  color: var(--fm-ink-1);
}

.pf-sub {
  margin: var(--fm-sp-2) 0 0;
  font-family: var(--fm-font-display);
  font-weight: 700;
  font-size: var(--fm-fs-100);
  letter-spacing: var(--fm-tr-2);
  text-transform: uppercase;
  color: var(--fm-ink-3);
}

.pf-list {
  display: flex;
  flex-direction: column;
  gap: var(--fm-sp-1);
}

.pf-row {
  display: grid;
  grid-template-columns: 172px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--fm-sp-2);
  min-height: 16px;
}

.pf-row__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--fm-fs-200);
  color: var(--fm-ink-2);
}

.pf-row__val {
  white-space: nowrap;
  text-align: right;
  font-family: var(--fm-font-mono);
  font-size: var(--fm-fs-100);
  color: var(--fm-ink-1);
  font-variant-numeric: tabular-nums;
}

.pf-bar {
  display: flex;
  height: 6px;
  min-width: 24px;
  overflow: hidden;
  border-radius: var(--fm-r-pill);
  background: rgba(255, 255, 255, 0.07);
}

.pf-bar__busy,
.pf-bar__wait {
  display: block;
  flex: none;
  width: 0;
  height: 100%;
}

.pf-bar__busy { background: var(--fm-accent); }
.pf-bar__wait { background: var(--fm-warn); }

.pf-legend {
  display: flex;
  gap: var(--fm-sp-4);
  font-size: var(--fm-fs-100);
  color: var(--fm-ink-3);
}

.pf-key::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: var(--fm-sp-1);
  border-radius: 2px;
  vertical-align: -1px;
  background: var(--pf-key);
}

.pf-key--busy { --pf-key: var(--fm-accent); }
.pf-key--wait { --pf-key: var(--fm-warn); }
.pf-key--idle { --pf-key: rgba(255, 255, 255, 0.14); }

.pf-foot {
  margin: var(--fm-sp-2) 0 0;
  font-size: var(--fm-fs-100);
  line-height: var(--fm-lh-2);
  color: var(--fm-ink-3);
}
